What do `npm run build`, `npm test` and `npm publish` do in a pipeline?
BeginnerConceptBuild Tools and Artifact Repositories
Answer
They execute scripts defined in package.json scripts (build, test) or publish the package to the configured registry. npm publish uses an auth token in .npmrc (for CI, //registry.npmjs.org/:_authToken=${NPM_TOKEN}), and --provenance attaches a signed provenance statement when run from a supported CI such as GitHub Actions with OIDC.
npm publish --provenance --access public
More on Build Tools and Artifact Repositories
What is Maven and what is its build lifecycle?BeginnerWhat is the difference between `mvn package`, `install` and `deploy`?BeginnerHow do Maven dependency scopes and transitive dependencies work?IntermediateWhat is `settings.xml` in Maven and how do CI builds use it?IntermediateWhat is the Maven Wrapper and why use it?BeginnerHow do you cache dependencies and speed up Maven builds in CI?Intermediate