You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All essential commands are available at the root via `npm run <script name>` - e.g. `npm run lint`. To view the available commands, run: `npm run`
31
+
32
+
<detailsid="develop-run-tests">
33
+
<summary><b>How to run your tests</b></summary>
34
+
<p>
35
+
36
+
to run the tests:
37
+
38
+
`npm test`
39
+
40
+
to run the coverage:
41
+
42
+
`npm run coverage`
43
+
44
+
to run browser tests with [karma](https://karma-runner.github.io/latest/index.html) (make sure you have the [Firefox launcher](https://npmjs.org/browse/keyword/karma-launcher) installed):
45
+
46
+
`npm run test:browser`
47
+
48
+
</p>
49
+
</details>
50
+
51
+
52
+
<detailsid="develop-npm-scripts">
53
+
<summary><b>How to name npm scripts</b></summary>
54
+
<p>
55
+
56
+
npm scripts are the primary means of executing programmatic tasks (e.g. tests, linting, releasing, etc) within the repo. to view available scripts, run `npm run`.
57
+
58
+
when creating a new script, be sure it does not already exist and use the following naming convention:
59
+
60
+
`<category>:[<subcategory>]:[<action>]`
61
+
62
+
our standard categories include: `test`, `lint`, `build`, `clean`, `docs`, `package`, `dependencies`, and `release`. top-level scripts - e.g. `npm run clean` - will typically run all of its subcategories (e.g. `npm run clean:dist && npm run clean:tmp`).
63
+
64
+
`npm` itself includes special handling for `test` and `start` (doc: [1](https://docs.npmjs.com/cli/v6/commands/npm-test), [2](https://docs.npmjs.com/cli/v6/commands/npm-start)) amongst other [lifecycle scripts](https://docs.npmjs.com/cli/v7/using-npm/scripts#life-cycle-scripts) - use these to expose key testing and start-up commands.
65
+
66
+
sometimes your new script will be very similar to an existing script. in those cases, try to extend the existing script before adding another one.
67
+
68
+
</p>
69
+
</details>
70
+
71
+
## Conventions
72
+
73
+
*[npm scripts](https://docs.npmjs.com/misc/scripts) form the _developer's API_ for the repo and all of its packages - key orchestration commands should be exposed here
74
+
* document developer-facing process / tooling instructions in the [Development](#development) section
75
+
* plan to release your changes upon merging to `main` - refrain from merging if you cannot so you don't leave unpublished changes to others
76
+
* avoid making changes in files unrelated to the work you are doing so you aren't having to publish trivial updates
77
+
* test files live alongside their source files and are named like `*.test.js` or `*.spec.js`
78
+
* if the linter does not flag your code (error or warning), it's formatted properly
79
+
* avoid reformatting unflagged code as it can obscure more meaningful changes and increase the chance of merge conflicts
80
+
* todo comments include your last name and are formatted like: `TODO (mirande): <message>`
81
+
82
+
83
+
## Docs & Resources
27
84
28
85
First, read the [documentation for Particle API JS on the Documentation website.][docs-website] It contains examples to get started.
29
86
@@ -55,6 +112,9 @@ Update the API docs with your changes:
55
112
$ npm run docs
56
113
```
57
114
115
+
## Releasing
116
+
117
+
See the release process in the [RELEASE.md](RELEASE.md) file.
0 commit comments