-
Notifications
You must be signed in to change notification settings - Fork 236
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
Make govuk-prototype-kit install command work with npm #1575
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b64fc76
to
3f4279f
Compare
3f4279f
to
dee000f
Compare
We want to make sure that the version that the version of the kit the user has installed at the end of the install process is the same as the one used to do the install. The easiest and best way to do this is to have two steps, with the first bootstrapping the second with the latest version of the kit package, similar to how create-react-app works [[1]]. This commit splits the process in two within the cli script. [1]: https://github.com/facebook/create-react-app/blob/main/packages/create-react-app/createReactApp.js
You can now run govuk-prototype-kit install --package-spec govuk-prototype-kit@13.0.100 govuk-prototype-kit install --package-spec file:~/Code/govuk-prototype-kit
The code from this was pretty shamelessly taken from Facebook's create-react-app [[1]], and is covered under their copy of the MIT Licence [[2]]. As we already use the MIT licence and include it in this project [[3]], I think that means we are already adhering to the licence terms. [1]: https://github.com/facebook/create-react-app/blob/f34d88e30c7d8be7181f728d1abc4fd8d5cd07d3/packages/create-react-app/createReactApp.js#L906 [2]: https://github.com/facebook/create-react-app/blob/f34d88e30c7d8be7181f728d1abc4fd8d5cd07d3/LICENSE [3]: https://github.com/alphagov/govuk-prototype-kit/blob/9e4a7fd6a4689be14c067c674bdf0f767fd03f1f/LICENCE.txt
Older versions of Node come with npm@6, which doesn't have the npm exec command (and may or may not have npx). Instead of relying on that tool just call the binary directly. This also means we can ensure we're using the same version of node as the caller.
dee000f
to
3b26d7c
Compare
Closing in favour of #1621 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We want users to be able to run
and have it do the thing they expect; i.e install the kit and create the project for them.
To get this to work I had to make a few changes; see the commits for details.