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

Stop installing dev dependencies when creating prototype #1803

Merged
merged 4 commits into from
Nov 24, 2022

Conversation

lfdebrux
Copy link
Member

Fixes issue #1799.

This PR takes a belt-and-braces approach to fixing the issue; we both stop publishing the package with dev dependencies, and stop npm from installing any dev dependencies when creating a prototype.

Reduce duplication of code and improve consistency.
Fixes issue #1799.

We use npm shrinkwrap to try and improve security for users, however the
shrinkwrap file includes dev dependencies, and a bug in npm [[1]] means
that users are getting the dev dependencies whenever they create a new
prototype.

This commit changes the publishing process so that these dev
dependencies are removed from package.json and npm-shrinkwrap.json,
using the tool [clean-publish].

[1]: npm/cli#4323

[clean-publish]: https://github.com/shashkovdanil/clean-publish#readme
The previous commit stopped publishing govuk-prototype-kit with dev
dependencies; this commit stops any dev dependencies being installed
when creating a new prototype with the cli tool.

We take this belt-and-braces approach to handle older versions of the
kit package, or potential future versions where we don't bother to
modify `npm-shrinkwrap.json` because npm have fixed their bugs.
@lfdebrux lfdebrux linked an issue Nov 23, 2022 that may be closed by this pull request
@lfdebrux lfdebrux merged commit 9bdca11 into main Nov 24, 2022
@lfdebrux lfdebrux deleted the ldeb-use-clean-publish branch November 24, 2022 09:21
@lfdebrux lfdebrux mentioned this pull request Dec 6, 2022
@lfdebrux lfdebrux added this to the v13.0.1 milestone Dec 6, 2022
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.

Prototypes include dev dependencies
2 participants