alphagov / govuk_elements

❗️GOV.UK Elements is deprecated, and will only receive major bug fixes and security patches.
https://govuk-elements.herokuapp.com/
MIT License
227 stars 90 forks source link

Would it be possible to publish this as an npm module? #33

Closed lennym closed 10 years ago

lennym commented 10 years ago

We're using a lot of the components for this down at the passports exemplar, but keeping up to date with changes is tricky as it's a manual process.

Just being able to update the version in our package.json would make life a lot easier - as we do with the mustache tempaltes and forntent toolkit.

Thanks.

lennym commented 10 years ago

Just spoke to @gavboulton who mentioned he'd asked @tombye about this before. Apparently this isn't published because it's not "offically" supported.

Would it be possible to publish it with a version 0.0.1-alpha, and with a disclaimer in the readme to state that it's not supported and usage is at our own risk? If nothing else, the easier it is to use then the more people are likely to use it, test it, and feed back fixes/issues.

Thanks.

andy-polhill commented 10 years ago

Not sure if it helps or not but we use the resource by pulling the whole repository in through npm using npm install git://github.com/alphagov/govuk_elements.git --save-dev It kind of works, but disappointingly it does check it out as express_prototype and I haven't found a sensible way to alias it yet.

lennym commented 10 years ago

@thatguynamedandy See #34

andy-polhill commented 10 years ago

Cheers :smile:

lennym commented 10 years ago

@thatguynamedandy Declaring the dependency as a git repo is a good shout though.

I was hoping "govuk_elements": "git+https://git@github.com/alphagov/govuk_elements.git" in my package.json would "just work", but I have the same problems.

tombye commented 10 years ago

The repo uses an expressJS wrapper just for display and the code it wraps, as you mentioned, isn't supported.

I think even a 0.0.1-alpha version is still publishing it as 'a thing' and would just add confusion to what this repo is.

That shouldn't stop you using some of the files for prototyping though. Couldn't you reference it as a submodule or use bower to pull them in? NPM's scripts field works quite well for this. (We're using it to bring in bower dependancies on my current project.)

lennym commented 10 years ago

The express wrapper would be fairly easy to remove with judicious use of an .npmignore file to prevent publishing anything other than the sass files so that the project would still work with an express wrapper when git clone'd, but if npm install'ed would include only the sass components. I would be happy to do the work for this if needed. Alternatively it could be split into separate projects for the sass components and the express demo wrapper - I'd struggle to do all of that myself though without write access.

At the very least, would you be willing to merge #34? That way we can (sensibly) include it as a git dependency in package.json and avoid having to introduce an extra dependency management system to our projects.

tombye commented 10 years ago

I think I missed your point, sorry.

The reason they aren't packaged up as a proper dependancy is because it isn't code that is directly used in projects and so the responsibility for maintenance isn't held with anyone (unlike the toolkit and template). The repository wasn't set up with the intention that the code would be used in anything other than prototyping.

This probably sounds like blocking but I'm just being honest that this wasn't something that was part of the original considerations. I think if you want to use this code in production projects, we (those involved in the project) should have a discussion about that beforehand. Happy to do so over email.

lennym commented 10 years ago

OK, I was under the impression that this was a conversation you'd already had with @gavboulton.

We're using (I think, I've only been here a few weeks) fairly large amounts of the code (grid, typography, forms) as part of the production build of the Passports exemplar. It's fairly early days yet, but given how much we're using it seems to make a lot of sense to use these components directly and battle-test them as part of a production build, and then be able to feed any bugs/fixes we find back into the repo.

It might well be that our approach is flawed, and that we can get a lot more out of the frontend toolkit without needing to use this repo - I'm very far from being expert in either css or the govuk tookits. If that is the case then it would be really helpful to get your guidance on the approach we should be taking. Feel free to email me on leonard.martin@digital...etc...