-
Notifications
You must be signed in to change notification settings - Fork 328
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
Namespace nunjucks and components #1458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 🌮 Left a couple of non-blocking comments.
There are quite a few places in the documentation where we need to reflect this change (do a search for "src/" in docs/
to see them).
I'll do a separate PR for docs and assets as this PR is already a large one with all the renames |
Generally looking really good. The before and after directory structures in the first commit message use different depths (one includes all files; the other just includes the top-level folder names) – this makes it quite difficult to see the difference. Could we re-word the commit message using consistent directory structures? |
Due to a known Github bug (isaacs/github#900) you can’t view previous history after using `git mv`. To view the previous history of files in src/govuk, use git blame. The URL format is repo-name/blame/branch/dir/file. For example https://github.com/alphagov/govuk-frontend/blame/master/src/README.md Description of work: This is a start to namespacing our code under govuk and has been accepted by the community. Directory structure before the commit: src ├── assets ├── components ├── core ├── helpers ├── objects ├── overrides ├── settings ├── tools ├── utilities ├── vendor ├── README.md ├── all-ie8.scss ├── all.js ├── all.scss ├── all.test.js ├── common.js ├── template.njk └── template.test.js Directory structure after this commit: src └── govuk ├── assets ├── components ├── core ├── helpers ├── objects ├── overrides ├── settings ├── tools ├── utilities ├── vendor ├── README.md ├── all-ie8.scss ├── all.js ├── all.scss ├── all.test.js ├── common.js ├── template.njk └── template.test.js See proposal for more detail https://github.com/alphagov/govuk-design-system-architecture/blob/master/proposals/005-namespace-govuk-frontend-nunjucks-sass-using-a-nested-folder-structure.md Co-authored-by: Hanna Laakso <hanna.laakso@digital.cabinet-office.gov.uk>
Co-authored-by: Hanna Laakso <hanna.laakso@digital.cabinet-office.gov.uk>
Before: package ├── assets ├── components ├── core ├── helpers ├── objects ├── overrides ├── settings ├── tools ├── utilities ├── vendor ├── README.md ├── all-ie8.scss ├── all.js ├── all.scss ├── common.js ├── govuk-prototype-kit.config.json ├── package.json └── template.njk After: package ├── govuk │ ├── assets │ ├── components │ ├── core │ ├── helpers │ ├── objects │ ├── overrides │ ├── settings │ ├── tools │ ├── utilities │ ├── vendor │ ├── all-ie8.scss │ ├── all.js │ ├── all.scss │ ├── common.js │ └── template.njk ├── README.md ├── govuk-prototype-kit.config.json └── package.json See proposal for more detail https://github.com/alphagov/govuk-design-system-architecture/blob/master/proposals/005-namespace-govuk-frontend-nunjucks-sass-using-a-nested-folder-structure.md
This commit fixes the issues identified while trying to run `npm run build:dist`. Current and desired directory structure: dist ├── assets │ ├── fonts │ └── images ├── VERSION.txt ├── govuk-frontend-2.13.0.min.css ├── govuk-frontend-2.13.0.min.js └── govuk-frontend-ie8-2.13.0.min.css See proposal for more detail https://github.com/alphagov/govuk-design-system-architecture/blob/master/proposals/005-namespace-govuk-frontend-nunjucks-sass-using-a-nested-folder-structure.md
Some of the changes made before meant that js files were being compiled and placed in a `govuk` directory. This meant that the browser could not find the js files when viewing the page. Current & desired folder structure for `public` when serving up the review app: public ├── components │ ├── accordion │ ├── button │ ├── character-count │ ├── checkboxes │ ├── details │ ├── error-summary │ ├── header │ ├── radios │ └── tabs ├── vendor │ └── polyfills ├── all.js ├── app-ie8.css ├── app-legacy-ie8.css ├── app-legacy.css ├── app.css └── common.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🙌 Need another person to approve who didn't do work on this
If you try to run this prototype now it doesn’t work, because the version of GOV.UK Frontend that you get if running ```shell npm install govuk-frontend@^3.0.0 ``` introduces a breaking change[1] that came with version 3.0.0 of GOV.UK Frontend. This repo was using a pre-release version of 3.0.0 in order to get the new focus styles. However when it was updated to 3.0.0 stable it wasn’t also updated[2] to respect the folder structure changes that came with 3.0.0. This commit updates the paths to the macros to point to the right place. 1. alphagov/govuk-frontend#1458 2. alphagov@22d7f9c
To namespace GOV.UK Frontend components, a new
govuk
directory has been added to thepackage
andsrc
directories. This means that users should now be able to run GOV.UK Frontend along side their own departmental frontend without any conflicts. There was no need to addgovuk
directory todist
orpublic
as they would only contain compiled code and be used differently frompackage
andsrc
Changes to
src
directoryBefore
After
Changes to
package
Before
After
Tested:
npm start
still worksnpm run pre-release
still worksnpm run release-to-branch
still worksdist
andpublic
directories.Details