-
Notifications
You must be signed in to change notification settings - Fork 331
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
Don’t copy *.js files into govuk-esm
#2876
Conversation
tasks/gulp/copy-to-destination.js
Outdated
@@ -15,54 +15,61 @@ const taskArguments = require('../task-arguments') | |||
|
|||
gulp.task('copy-files', () => { | |||
return merge( | |||
// Copy source JavaScript |
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.
// Copy source JavaScript | |
// Copy ESM files to make them available in the package |
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.
Can I suggest a tweak to align with the Gulpfile task?
Line 28 in 542e7ec
// Prepare package folder for publishing |
At the moment we use --destination
to choose ./package so the destination could vary
// Copy source JavaScript | |
// Copy ESM JavaScript to destination, ready for publishing |
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.
Thanks @romaricpascal
I've added a new commit with better comments for all these lines (and more!)
tasks/gulp/copy-to-destination.js
Outdated
// https://github.com/alphagov/govuk-frontend/tree/main/package#readme | ||
`!${configPaths.src}README.md`, | ||
|
||
// Exclude files from other streams |
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.
// Exclude files from other streams | |
// Exclude files from other streams (MJS and test files are already excluded a bit above) |
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.
@romaricpascal This one definitely needed a better comment
It was actually excluding files handled by the PostCSS and JSON (from YAML) streams a bit below
Hopefully this is clearer:
// Exclude Sass files handled by PostCSS stream below
`!${configPaths.src}**/*.scss`,
// Exclude source YAML handled by JSON streams below
`!${configPaths.components}**/*.yaml`
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.
It looks good to me 🙌🏻 Just got two little comments to clarify what tripped me up while wrapping my head around things. Feel free to reword or disregard if they're not relevant 😄
4d16bb6
to
79ae895
Compare
Thanks, see what you think now |
This PR was related to #2243 |
In response to comment regarding *.js files in
govuk-esm
This PR includes:
js:copy-esm
task →copy-files
${configPaths.src}**/*.js
glob so only *.mjs are copied