From e5ce39fcdcacc7da21ce9276bdd7f82c6d2c6b9d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 13 Jun 2024 11:57:49 +0200 Subject: [PATCH] docs/package-metadata: document scripts field Signed-off-by: Patrik Oldsberg --- docs/tooling/package-metadata.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/tooling/package-metadata.md b/docs/tooling/package-metadata.md index f3ffe6986e..7dc583bfda 100644 --- a/docs/tooling/package-metadata.md +++ b/docs/tooling/package-metadata.md @@ -57,3 +57,19 @@ This field can be generated by the `backstage-cli repo fix` command. First fill This field declares whether it is safe to remove unused code when bundling this package into a frontend build, and is defined for example by [WebPack](https://github.com/backstage/backstage/blob/8d5cdb5d536cc8eb444da4b57dca4e36716f4535/plugins/auth-backend-module-google-provider/config.d.ts#L22). This field can be generated by the `backstage-cli repo fix` command. It will set to `false` by default for all frontend packages, since Backstage frontend packages should generally never have any side effects. If your package does have side effects, you can set explicitly set this field to `true`. + +### `scripts` + +The package scripts as defined by [NPM](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#scripts). The Backstage CLI provides a set of standard scripts, which you can read more about in the [build system](./cli/02-build-system.md) section. The full list of scripts is as follows: + +```js +"scripts": { + "start": "backstage-cli package start", + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "clean": "backstage-cli package clean", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack" +} +```