-
Notifications
You must be signed in to change notification settings - Fork 236
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
Remove gulp functionality #1324
Conversation
Looking good! I'm going to clean up the history of these commits a bit, to try and split out the changes related to docs and v6 into separate commits. Edited to add: Done :) |
c57b431
to
95bf7f2
Compare
Look at all those deletions 🥲
|
95bf7f2
to
5ba0b9a
Compare
I'd like us to consider putting the build stuff in the lib folder, to keep it out of sight from users. We could maybe work towards putting everything in there as sort of a halfway-house towards having a proper package... what do you think @BenSurgisonGDS @natcarey? |
|
||
describe(`${gulpConfig.paths.assets}sass/`, () => { | ||
describe(`${buildConfig.paths.assets}sass/`, () => { | ||
it.each(sassFiles)('%s renders to CSS without errors', async (file) => { | ||
return new Promise((resolve, reject) => { | ||
sass.render({ |
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.
I wonder if we can change this line to use a function from build/run-tasks.js
... that feels like it would be a better test?
We want to avoid using gulp, as it has a load of dependencies. With better fs libraries in Node.js we can do this. Co-authored-by: Ben Surgison <ben.surgison@digital.cabinet-office.gov.uk> Co-authored-by: Joe Lanman <joelanman@gmail.com>
Node 12 and below don't have the `fs.rmSync` or `fs.rm` functions, and has limited support for removing a directory recursively. Instead we use `del`, which we include as a dependency anyway.
There is a bug where `sass.compile` will throw with an extremely unhelpful error trace when running in Jest [[1]]. > TypeError: J.getInterceptor$ax(...).map$1$1 is not a function > > at Object.map$1$1$ax (node_modules/sass/sass.dart.js:24513:44) > at listDir_closure0.call$0 (node_modules/sass/sass.dart.js:87066:18) > at Object._systemErrorToFileSystemException0 (node_modules/sass/sass.dart.js:20776:23) > at Object.listDir0 (node_modules/sass/sass.dart.js:20771:16) > at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:84710:34) > at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27273:24) > at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:84699:32) > at _realCasePath_helper_closure0.call$0 (node_modules/sass/sass.dart.js:84706:35) > at JsLinkedHashMap.putIfAbsent$2 (node_modules/sass/sass.dart.js:27273:24) > at _realCasePath_helper0.call$1 (node_modules/sass/sass.dart.js:84699:32) It has been suggested that it is related to `path.absolute` being overridden by the jsdom environment [[2]], but the workaround of using the "node" environment does not solve the issue for us. Instead, what did work is using the legacy API [[3]]. I'm not sure why this is, but it seems to do the trick. Note that with the legacy API, the file path is part of the options object, rather than being the first argument. If you forget to change the call signature, you will get a different unhelpful error message: > NoSuchMethodError: method not found: 'call' [1]: sass/dart-sass#1692 [2]: sass/dart-sass#710 (comment) [3]: https://sass-lang.com/documentation/js-api#legacy-api
5ba0b9a
to
3c3f3a2
Compare
lib/build/run-tasks.js
Outdated
} | ||
|
||
function clean () { | ||
// doesn't clean extensions.scss, should it? |
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.
we should probably resolve this question @natcarey
f3a4696
to
515a76b
Compare
e01f998
to
f07b196
Compare
Remove dead code
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
This PR resolves issue: #1290
Changes: