Allow running the kit either as a project or as an npm package
See original GitHub issueWhat
Make changes to the code in this repo so that if the user installs it as a node module into another project using npm install /path/to/govuk-prototype-kit
, they can run the kit using node node_modules/govuk-prototype-kit/start.js
.
At the same time we still want the kit to work as it currently does, however, as its own project. This ticket does not include changing any documentation for users, or how we distribute the kit.
Also out of scope is anything to do with the v6 compatibility mode or docs app.
Why
We want to be able to distribute the prototype kit as an npm package, so we need to support the kit running from the node modules folder. We haven’t decided yet on how exactly it will work as an npm package, so we can’t do much more than lay the groundwork, which why this ticket is tightly limited in scope, but we might as well do the groundwork now, as we know it is necessary.
Who needs to work on this
Developer
Who needs to review this
Developer, Tech lead (@natcarey)
Further details
@natcarey did a spike on this,
Done when
- govuk-prototype-kit can run when installed as a node modules
- We have tests successfully running govuk-prototype kit as a node module
- govuk-prototype-kit can still be run from project folder
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top GitHub Comments
Sorry, I should have been clearer in the ticket, this is not about actually suggesting to users that they follow this method. This is about making changes to the code that are necessary to allow us to make our code into a package, however we do it. If we want to have a private beta, we will still need to do this work. I agree with your key questions, but we won’t be able to explore them unless we do this work.
I’ve updated the ticket now to make it clearer that this is only about code changes.
on looking for extensions, I think it makes sense to only look at the user’s package.json (then they’re in control as @natcarey says) … but then that brings up the initial user experience and how they get useful ‘starter’ extensions like Frontend, etc