Skip to content
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

feat: generate package-lock for faster install #233

Merged
merged 3 commits into from
Sep 13, 2018

Conversation

brandonocasey
Copy link
Contributor

Generate a package lock for plugin to save ~70s on initial install, even when deps have changed by selecting other options.

@gkatsev
Copy link
Member

gkatsev commented Sep 12, 2018

Interesting idea. With this, we can even run npm ci the very first time (maybe with a --install flag) which will make that initial install even faster.

@brandonocasey
Copy link
Contributor Author

Yeah we could, we would just have to version check npm, let me see if yeoman can do it

@brandonocasey brandonocasey force-pushed the feat/pkg-lock-generation branch from e563c6a to bdc0e9e Compare September 13, 2018 15:31
@brandonocasey brandonocasey force-pushed the feat/pkg-lock-generation branch from bdc0e9e to ae9f4d7 Compare September 13, 2018 15:33
@misteroneill
Copy link
Member

I think you could simply skip the npmInstall call and manually invoke npm ci - if I'm understanding everything correctly.

Really cool idea! 👍

@brandonocasey
Copy link
Contributor Author

So first we check if we have npm <= 5 and if so, we won't have the npm ci command and we have to do npm Install. Otherwise we do npm install --package-lock-only && npm ci

@@ -26,7 +26,8 @@
"test": "npm-run-all test:*",
"test:unit": "mocha test/*.test.js",
"test:integration": "node scripts/run-integration-tests.js",
"preversion": "npm run test",
"preversion": "npm-run-all generate-pkg-lock test",
"generate-pkg-lock": "node scripts/generate-pkg-lock.t js && git add generators/app/templates/_package-lock.json",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generate package lock and add it every version, I think this makes sense to me.

})
.withOptions(libs.options())
.withOptions(Object.assign(libs.options(), {skipInstall: false}))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the install steps below, instead we do the builtin yeoman install

@brandonocasey brandonocasey merged commit dcb0427 into master Sep 13, 2018
@brandonocasey brandonocasey deleted the feat/pkg-lock-generation branch September 13, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants