Open
Conversation
| "lint:fix": "npm run lint:prettier:fix && npm run lint:js:fix && npm run lint:scss:fix", | ||
| "test": "npm run lint && npx govuk-prototype-kit@latest validate-plugin", | ||
| "test": "npm run lint && npx govuk-prototype-kit@latest validate-plugin && npm run test:css", | ||
| "test:css": "npx sass --pkg-importer=node --load-path=. --quiet-deps src/x-govuk/index.scss ./tmp/output.css", |
There was a problem hiding this comment.
Worth flagging that --quiet-deps uses loads paths to determine dependencies
It's a downside of --load-path=. and silences local warnings 😭
You might want to consider:
-
Adding Sass CLI
--fatal-deprecation
E.g. See Sass config from NHS.UK frontend -
Checking output for uncompiled Sass variables (or functions)
E.g. See Sass GitHub Action from NHS.UK frontend
Contributor
Author
There was a problem hiding this comment.
@colinrotherham is it better to drop --quiet-deps from the test compile then?
There was a problem hiding this comment.
Yeah, unfortunately
At least until the day everyone uses pkg: or drops node_modues from load paths
- @import "node_modules/govuk-frontend/dist/govuk";
+ @import "govuk-frontend/dist/govuk";3dbed5b to
bfb92b5
Compare
This should help us catch where the sass doesn't compile for some reason?
6661068 to
e9cb936
Compare
8d13172 to
0036fd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tests currently just run a code linter and validate the prototype plugin config but don’t actually compile the sass at all.
This adds a compile of the sass to the tests.
There might be a better way to do this, but using the sass command line tool seemed simplest?
cc @colinrotherham @paulrobertlloyd