Skip to content

Commit

Permalink
docs: update package.json naming to include 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
pmcelhaney committed Nov 28, 2022
1 parent 60bf6f8 commit bb930b4
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions docs/src/developer-guide/package-json-conventions.md
Expand Up @@ -10,22 +10,16 @@ The following applies to the "scripts" section of `package.json` files.

npm script names MUST contain only lower case letters, `:` to separate parts, `-` to separate words, and `+` to separate file extensions. Each part name SHOULD be either a full English word (e.g. `coverage` not `cov`) or a well-known initialism in all lowercase (e.g. `wasm`).

Here is a summary of the proposal in EBNF.

```ebnf
name = life-cycle | main ":fix"? target? option* ":watch"?
life-cycle = prepare | preinstall | install | postinstall | prepublish | preprepare | prepare | postprepare | prepack | postpack | prepublishOnly;
main = "build" | "lint" | "start" | "test";
target = ":" word ("-" word)* | extension ("+" extension)*;
option = ":" word ("-" word)*;
word = [a-z]+;
extension = [a-z0-9]+;
Here is a summary of the proposal in ABNF.

```abnf
name = life-cycle / main target? option* ":watch"?
life-cycle = "prepare" / "preinstall" / "install" / "postinstall" / "prepublish" / "preprepare" / "prepare" / "postprepare" / "prepack" / "postpack" / "prepublishOnly"
main = "build" / "lint" ":fix"? / "release" / "start" / "test"
target = ":" word ("-" word)* / extension ("+" extension)*
option = ":" word ("-" word)*
word = ALPHA +
extension = ( ALPHA / DIGIT )+
```

## Order
Expand All @@ -42,6 +36,10 @@ Scripts that generate a set of files from source code and / or data MUST have na

If a package contains any `build:*` scripts, there MAY be a script named `build`. If so, SHOULD produce the same output as running each of the `build` scripts individually. It MUST produce a subset of the output from running those scripts.

### Release

Scripts that have public side effects (publishing the web site, committing to Git, etc.) MUST begin with `release`.

### Lint

Scripts that statically analyze files (mostly, but not limited to running `eslint` itself) MUST have names that begin with `lint`.
Expand Down

0 comments on commit bb930b4

Please sign in to comment.