Visitar URL original
USWDS - Dependencies: POAM Dec '23 by mejiaj · Pull Request #5673 · uswds/uswds · GitHub
Skip to content

USWDS - Dependencies: POAM Dec '23 - #5673

Merged
thisisdano merged 9 commits into
developfrom
jm-poam-dec-23
Feb 27, 2024
Merged

thisisdano merged 9 commits into
developfrom
jm-poam-dec-23

Conversation

@mejiaj

@mejiaj mejiaj commented Dec 13, 2023 •

Copy link
Copy Markdown
Contributor

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

  1. Updated patch and minor dependencies.
  2. Removed unused deps.
  3. Added dependency that was used, but not in 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

  1. Run npm install.
  2. Run npm start.
  3. Update a SASS file and see it update in StorybookJS.
  4. Running npx gulp sassTests or npm run test should not fail.
  5. Run gulp tasks (like build) and ensure there aren't errors and things build correctly.

Dependency updates

Dependency Old New
@babel/core 7.23.2 7.23.6
@babel/preset-env 7.23.2 7.23.6
@types/node 20.8.9 20.10.4
eslint 8.52.0 8.55.0
eslint-config-prettier 9.0.0 9.1.0
handlebars-helpers 1 0.10.0 -
html-webpack-plugin 5.5.3 5.5.4
postcss 8.4.31 8.4.32
postcss-import 2 - 15.1.0
postcss-preset-env 9.2.0 9.3.0
postcss-sass-loader 3 1.1.0 -
sass 4 - 1.69.5
snyk 1.1237.0 1.1262.0
svgo 3.0.2 3.1.0
typescript 5.2.2 5.3.3

Also created #5674 to address an outstanding nanoid issue.

Footnotes

  1. Previously used for token JSON to SASS conversion. ↩

  2. Was already being used, but not included directly in package.json. ↩

  3. Dependency that wasn't called directly. Hasn't been updated in 5 years now. ↩

  4. Added as a dependency for sass-true. ↩

James Mejia added 3 commits December 13, 2023 10:19
Dependency was used for previous token JSON to SASS conversion
postcss-sass-loader hasn't been updated in 5 years and not used directly
@mejiaj mejiaj self-assigned this Dec 13, 2023
@mejiaj
mejiaj marked this pull request as ready for review December 13, 2023 17:31

@mahoneycm mahoneycm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

  • Vulnerabilities reduced.
  • No build errors.
  • No other gulp task errors.
  • Style changers render in storybook correctly.
  • npm audit fix doesn't change any dependencies.

Comment thread package.json
"gulp-sourcemaps": "3.0.0",
"gulp-svgstore": "9.0.0",
"gulp-uglify": "3.0.2",
"handlebars-helpers": "0.10.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍

@amyleadem amyleadem left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

James Mejia added 5 commits December 20, 2023 09:06
@mejiaj

mejiaj commented Dec 20, 2023 •

Copy link
Copy Markdown
Contributor Author

re: gulp sassTests error

@amyleadem good find, I was able to reproduce. I've added two additional changes and updated the PR description.

  1. Remove unreleased work related to uswds-core package 1 d09b1ab, 516bab7.
  2. Install sass dependency for sass-true 2 b478b7f.

Footnotes

  1. Once merged we can close out USWDS - Packages: Prevent nested node_modules from being included in publish #5245. ↩

  2. Not ideal, but I couldn't find any guidance in sass-true docs, issues, or pr's. ↩

@mejiaj
mejiaj requested a review from amyleadem December 20, 2023 16:48

@amyleadem amyleadem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 install without error
  • Run npm start, npm test, gulp, and npm run build:html without error
  • Confirm Sass changes compile as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

USWDS - Dependencies: Remove experimental module work from core

4 participants