From 8815a725d6fd1df8e447434e2ed551afda48f32b Mon Sep 17 00:00:00 2001 From: Patrick McElhaney Date: Mon, 28 Nov 2022 15:53:18 -0500 Subject: [PATCH] docs: update package.json naming to include 'release' --- .../package-json-conventions.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/src/developer-guide/package-json-conventions.md b/docs/src/developer-guide/package-json-conventions.md index 4733b425264f..f3ee509de0d8 100644 --- a/docs/src/developer-guide/package-json-conventions.md +++ b/docs/src/developer-guide/package-json-conventions.md @@ -10,22 +10,22 @@ 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. +Here is a summary of the proposal in ABNF. -```ebnf -name = life-cycle | main ":fix"? target? option* ":watch"? +```abnf +name = life-cycle / main target? option* ":watch"? -life-cycle = prepare | preinstall | install | postinstall | prepublish | preprepare | prepare | postprepare | prepack | postpack | prepublishOnly; +life-cycle = "prepare" / "preinstall" / "install" / "postinstall" / "prepublish" / "preprepare" / "prepare" / "postprepare" / "prepack" / "postpack" / "prepublishOnly" -main = "build" | "lint" | "start" | "test"; +main = "build" / "lint" ":fix"? / "release" / "start" / "test" -target = ":" word ("-" word)* | extension ("+" extension)*; +target = ":" word ("-" word)* / extension ("+" extension)* -option = ":" word ("-" word)*; +option = ":" word ("-" word)* -word = [a-z]+; +word = ALPHA + -extension = [a-z0-9]+; +extension = (ALPHA / DIGIT )+ ``` ## Order @@ -42,6 +42,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`.