Closed joelanman closed 7 years ago
Hey Joe,
Is this more around the core of the kit itself, routing, examples etc or more geared towards the assets (CSS/JS/Images) in the kit?
One option for the assets would be to possibly have a bower install via grunt run when starting the app which would pull in the latest assets.
You could then team it up with something like https://www.npmjs.com/package/npm-check-updates which would keep any bower/package.json versions up to date.
both, but you're right it might be useful to consider them separately.
is bower necessary or could we just use npm for everything?
NPM has pre and post-install hooks you could use:
https://docs.npmjs.com/misc/scripts
You can also point NPM at github repos as well as existing modules which is often the main use for bower in a project: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
I think we could get away with just using NPM.
The link @tombye has shared about using GitHub repos in the package.json could be the perfect option as it could be locked to a specific commit/version (if required) or set to pull the latest from the repo.
I've started work on this, to keep GOV.UK elements up-to-date using NPM.
This spike only includes updating the Sass files. I'll amend it to include also copying over the images, updating the JavaScript will be a separate PR.
Things left to do:
Is this for people to update their globally installed kit before starting work on a new prototype, or updating the core code on a prototype that's already in development?
Oh and by the way, there's probably crossover here with issue #34.
@sanjaypoyzer good point - this particular issue is about the latter - updating the core of the kit on existing prototypes
I'm currently just setting an upstream remote in git for each of my kit repositories.
git remote add upstream https://github.com/alphagov/govuk_prototype_kit.git
Then if you run:
git remote
Typically you should see:
heroku
origin
upstream
Then if I want to merge the latest from the kit, I do:
git checkout master
git fetch upstream master
git merge FETCH_HEAD
@paulmsmith when I tried that a couple times in the past I got some nasty merge conflicts - you ever experience that?
@joelanman I have but only if I've made changes to files outside of /app such as routes.js
or server.js
on occasion we do make changes to /app
in the kit, such as the routes.js
file, which lives in app. I think for most people, the copy and paste instructions might be more straightforward than potentially fix merging conflicts - what do you reckon?
Oh yes, I agree the copy & paste instructions are probably safest. Merge conflicts can be difficult for less experienced users to deal with.
For those more confident among us, setting an 'upstream' to the kit has worked well for myself and the my team.
@paulmsmith do you think something like your steps above could be added to the Updating docs as an 'advanced' section? Would you have time to do a PR if so? I'm happy to do it too
@joelanman Sure. I'll do a PR later today.
Hi @joelanman @paulmsmith are you happy to close this issue?
We have a latest-release branch, so the kit can be updated using @paulmsmith's method described above.
I think this issue can be closed now?
Yep, thanks all
As a user of the kit, I need to be able to update the kit on an existing prototype so I can take advantage of new features and bug fixes.