|
1 |
| -***UPDATE BADGE URLS BELOW*** |
| 1 | +[](https://travis-ci.com/internetarchive/iaux-your-webcomponent) [](https://codecov.io/gh/internetarchive/iaux-your-webcomponent) |
2 | 2 |
|
3 |
| -[](https://travis-ci.com/internetarchive/iaux-typescript-wc-template) |
| 3 | +# Internet Archive Typescript WebComponent Template |
4 | 4 |
|
5 |
| -[](https://codecov.io/gh/internetarchive/iaux-typescript-wc-template) |
| 5 | +This is a base template for creating Typescript WebComponents. It is based off of the [Open WebComponents generator](https://open-wc.org/docs/development/generator/) with some IA-specific customizations and some development niceities. |
6 | 6 |
|
7 |
| -# \<typescript-template> |
| 7 | +## Usage |
| 8 | + |
| 9 | +1. Click the "Use this Template" button in GitHub to create a new repository based on this one. |
| 10 | +2. Clone your new repo and update the things below: |
8 | 11 |
|
9 |
| -This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation. |
| 12 | +### Things to update in your copy |
| 13 | +1. Remove this section |
| 14 | +2. Search for the strings `your-webcomponent` and `YourWebComponent` and those are most of the spots that need to be updated. |
| 15 | +3. `README.md` (this file). Update the readme in general, but also the badge URLs |
| 16 | +4. `package.json` Update the name and description |
| 17 | +5. Rename the `your-webcomponent.ts` and its associated `.test` file |
| 18 | +6. Update `.travis.yml` with the proper secure key. See the [Travis docs](https://blog.travis-ci.com/2014-03-13-slack-notifications/) for more information. |
10 | 19 |
|
11 |
| -## Installation |
| 20 | +## Local Demo with `web-dev-server` |
12 | 21 | ```bash
|
13 |
| -yarn add typescript-template |
| 22 | +yarn start |
14 | 23 | ```
|
| 24 | +To run a local development server that serves the basic demo located in `demo/index.html` |
15 | 25 |
|
16 |
| -## Usage |
17 |
| -```html |
18 |
| -<script type="module"> |
19 |
| - import 'typescript-template/typescript-template.js'; |
20 |
| -</script> |
| 26 | +## Testing with Web Test Runner |
| 27 | +To run the suite of Web Test Runner tests, run |
| 28 | +```bash |
| 29 | +yarn run test |
| 30 | +``` |
| 31 | + |
| 32 | +To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run |
21 | 33 |
|
22 |
| -<typescript-template></typescript-template> |
| 34 | +```bash |
| 35 | +yarn run test:watch |
23 | 36 | ```
|
24 | 37 |
|
25 | 38 | ## Linting with ESLint, Prettier, and Types
|
@@ -49,27 +62,8 @@ yarn run format:eslint
|
49 | 62 | yarn run format:prettier
|
50 | 63 | ```
|
51 | 64 |
|
52 |
| -## Testing with Web Test Runner |
53 |
| -To run the suite of Web Test Runner tests, run |
54 |
| -```bash |
55 |
| -yarn run test |
56 |
| -``` |
57 |
| - |
58 |
| -To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run |
59 |
| - |
60 |
| -```bash |
61 |
| -yarn run test:watch |
62 |
| -``` |
63 |
| - |
64 |
| - |
65 | 65 | ## Tooling configs
|
66 | 66 |
|
67 | 67 | For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
68 | 68 |
|
69 | 69 | If you customize the configuration a lot, you can consider moving them to individual files.
|
70 |
| - |
71 |
| -## Local Demo with `web-dev-server` |
72 |
| -```bash |
73 |
| -yarn start |
74 |
| -``` |
75 |
| -To run a local development server that serves the basic demo located in `demo/index.html` |
0 commit comments