docs/package-metadata: document scripts field

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-06-13 11:57:49 +02:00
parent 013449b98a
commit e5ce39fcdc
+16
View File
@@ -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"
}
```