-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to npm ci
in the pipeline to avoid failures
#172
Conversation
Replace, in workflow and project build files, npm install with npm ci, unless the npm install is a global installation. This solves unexpected pipeline failures and provides information on which dependencies need to be added, if any.
README.md
Outdated
@@ -29,7 +29,7 @@ The [example](./example) folder shows how those components can be assembled to c | |||
### Building and Running Locally | |||
|
|||
In order to use the library components or test the library locally, the project components need to be rolled up and | |||
dependencies need to be installed initially with the command: `npm install`. From here the application can be built |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to change this for developers building locally, just the pipeline(s)
package.json
Outdated
"eject": "react-scripts eject", | ||
"lint": "npx eslint src/**/*.js --fix", | ||
"format": "prettier --write src/**/*.js", | ||
"deploy": "gh-pages -d oscal-react-library/build", | ||
"build-library-and-run-example": "npm install && cd example && npm install && npm start", | ||
"build-and-run-example": "cd example && npm install && npm start", | ||
"build-library-and-run-example": "npm ci && cd example && npm ci && npm start", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well, these are used by developers so I don't think they'd be changing.
Revert some changes made in package.json that used npm ci instead of npm install because those scripts were only used by developers and not in an actual workflow run
Replace
npm install
in the pipeline withnpm ci
. We are doing this to avoid pipeline failures caused bynpm install
modifyingpackage-lock.json
.npm ci
will not modify that file and it also provides more detailed messaging when a dependency error arises during a workflow run.