Repository navigation
USWDS - Dependencies: POAM Dec '23 - #5673
Conversation
Dependency was used for previous token JSON to SASS conversion
postcss-sass-loader hasn't been updated in 5 years and not used directly
mahoneycm
left a comment
There was a problem hiding this comment.
Lgtm!
- Vulnerabilities reduced.
- No build errors.
- No other gulp task errors.
- Style changers render in storybook correctly.
-
npm audit fixdoesn't change any dependencies.
| "gulp-sourcemaps": "3.0.0", | ||
| "gulp-svgstore": "9.0.0", | ||
| "gulp-uglify": "3.0.2", | ||
| "handlebars-helpers": "0.10.0", |
There was a problem hiding this comment.
Just flagging there's an existing PR to remove handlebars-helpers with some additional information. We can go ahead and close that PR in favor of this one 👍
There was a problem hiding this comment.
@mejiaj I am getting an error here with the gulp buildSass command (as part of npm run test) that I am not seeing in develop. Are you seeing the same thing?
Here is the error:
Error: Cannot find module 'sass'
Require stack:
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/sass-true/lib/main.js
- /Users/amy.leadem/Dev/github/workspace/uswds/packages/uswds-core/src/test/sass.spec.js
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/esm-utils.js
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/mocha.js
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/cli/one-and-dones.js
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/cli/options.js
- /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/bin/mocha
at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object.runSass (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/sass-true/lib/main.js:50:12)
at Object.<anonymous> (/Users/amy.leadem/Dev/github/workspace/uswds/packages/uswds-core/src/test/sass.spec.js:6:10)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at exports.requireOrImport (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/esm-utils.js:42:12)
at exports.loadFilesAsync (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/esm-utils.js:55:34)
at Mocha.loadFilesAsync (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/mocha.js:473:19)
at singleRun (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/cli/run-helpers.js:125:15)
at exports.runMocha (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/cli/run-helpers.js:190:10)
at exports.handler (/Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/mocha/lib/cli/run.js:362:11)
at /Users/amy.leadem/Dev/github/workspace/uswds/node_modules/gulp-mocha/node_modules/yargs/build/index.cjs:443:71
[16:13:42] 'sassTests' errored after 246 ms
[16:13:42] Error in plugin "gulp-mocha"
Message:
There were test failures
Details:
domainEmitter: [object Object]
domainThrown: false
[16:13:42] 'test' errored after 7.37 s
This work was causing conflicts when running sass unit tests since `sass-embedded` wasn't a part of `uswds-core`'s package.json.
re: gulp sassTests error@amyleadem good find, I was able to reproduce. I've added two additional changes and updated the PR description.
Footnotes
|
amyleadem
left a comment
There was a problem hiding this comment.
Thanks for fixing and thanks for the footnotes.
- Confirmed vulnerability changes listed in the PR description are current (44 vulnerabilities (17 moderate, 27 high))
- Confirm dependency changes in the PR description match code changes
- Run fresh
npm installwithout error - Run
npm start,npm test,gulp, andnpm run build:htmlwithout error - Confirm Sass changes compile as expected
Summary
Addressing two POAM issues, dependency updates, removing unused deps. Closes #5712.
Before: 51 vulnerabilities (24 moderate, 27 high).
After: 44 vulnerabilities (17 moderate, 27 high).
Breaking change
This is not a breaking change.
Related issue
Part of POAM process.
Related pull requests
N/A
Preview link
Preview link:
StorybookJS preview →
Problem statement
Addressing two ongoing dependency issues with no available updates.
Solution
package.json.Major changes
Removed
uswds-core's package.json file. This experimental work unintentionally got published. Removing it in favor of open PR USWDS - Packages: Prevent nested node_modules from being included in publish #5245 because its causing conflicts with project dependencies and sass unit testing (sass-embedded isn't a dependency of uswds-core).Testing and review
npm install.npm start.npx gulp sassTestsornpm run testshould not fail.Dependency updates
Also created #5674 to address an outstanding nanoid issue.
Footnotes
Previously used for token JSON to SASS conversion. ↩
Was already being used, but not included directly in package.json. ↩
Dependency that wasn't called directly. Hasn't been updated in 5 years now. ↩
Added as a dependency for
sass-true. ↩