Commit 9fdef57
authored
chore: change sbom generation to happen on
By having the sbom generated during the `postinstall` step, we have
inadvertently made the package impossible to install as a dependency.
This is because when installing this as a dependency in a project,
`npm install` is run under the hood. Subsequently, `npm run postinstall`
happens, but the published package does not contain a package-lock.json
file and the sbom generation fails, therefore failing the installation
of the module altogether.
This commit modifies the npm scripts so that the sbom generation happens
only when publishing, and the publish will fail if there are any
modified files in the repo, i.e. if the sbom was updated. This means it
is incumbent on maintainers of this package to keep the sbom up to date
by periodically running `npm run sbom` when modifying dependencies. If
in the course of making changes on this module, the package.json or
package-lock.json files are modified, the developer MUST run the command
`npm run sbom`.
Signed-off-by: Lance Ball <lball@redhat.com>prepublishOnly (#268)1 parent f0d8415 commit 9fdef57
2 files changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
2764 | 2764 | | |
2765 | 2765 | | |
2766 | 2766 | | |
2767 | | - | |
| 2767 | + | |
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
| |||
0 commit comments