Skip to content
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

USWDS-Compile - Gulp: Support disabling sass sourcemaps #103

Merged
merged 5 commits into from
Jul 17, 2024

Conversation

mdmower-csnw
Copy link
Contributor

@mdmower-csnw mdmower-csnw commented Jun 5, 2024

  • Drop gulp-sourcemaps which is seemingly neglected and is the reason for 3 npm audit warnings. Gulp v4 and v5 have native support for toggling sourcemaps.
  • Add new boolean setting settings.compile.sassSourcemaps that defaults to true but can be set to false in consumer projects to disable outputting sass sourcemaps.

This addresses the sass portion of #70. Exclusion of USWDS JS sourcemaps would need a separate setting and handling.

Related issue

Closes #70

- Drop `gulp-sourcemaps` which is seemingly neglected and is the reason
  for 3 npm audit warnings. Gulp v4 and v5 have native support for
  toggling sourcemaps.
- Add new boolean setting `settings.compile.sassSourcemaps` that
  defaults to `true` but can be set to `false` in consumer projects to
  disable outputting sass sourcemaps.

This addresses the sass portion of uswds#70. Exclusion of USWDS JS sourcemaps
would need a separate setting and handling.
@mejiaj mejiaj requested review from mahoneycm and mejiaj June 14, 2024 13:30
@mejiaj mejiaj added this to the compile 1.2.0 milestone Jun 14, 2024
- Coerce settings.compile.sassSourcemaps to boolean to ensure the
  sourcemaps options receives a supported value (since this is user
  settable).
Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this PR!

Verified setting works as expected. Created a test PR in uswds/uswds-sandbox#143.

Before After
image image

Dependencies

Before [develop]

14 vulnerabilities (3 moderate, 11 high)

After
Moderate vulnerabilities are gone.

11 high severity vulnerabilities

@mejiaj mejiaj requested a review from amyleadem July 2, 2024 18:16
Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Working like a charm! Thanks for your contribution

  • No perceived regressions or build errors when installed on site
  • Sourcemaps included by default
  • Successfully disabled sourcemaps via settings.compile.sassSourcemaps

@mahoneycm mahoneycm changed the title Support disabling sass sourcemaps USWDS-Compile - Gulp: Support disabling sass sourcemaps Jul 8, 2024
@mahoneycm mahoneycm mentioned this pull request Jul 8, 2024
10 tasks
@mahoneycm mahoneycm requested a review from thisisdano July 8, 2024 15:06
@amyleadem amyleadem requested review from heymatthenry and removed request for amyleadem July 9, 2024 18:14
@mdmower-csnw
Copy link
Contributor Author

@mahoneycm @mejiaj - Would you like me to resolve the merge conflicts since #96 was merged, or would you like to handle that?

@mejiaj
Copy link
Contributor

mejiaj commented Jul 15, 2024

@mdmower-csnw if you're able to resolve with the latest that would help a lot!

@mdmower-csnw
Copy link
Contributor Author

@mejiaj - When I attempted to test these changes with the current develop branch, I ran into a new issue: #110 . It would be best if that issue is cleaned up in develop before I resolve conflicts in this PR. Let me know if you need any more information there.

@mejiaj
Copy link
Contributor

mejiaj commented Jul 15, 2024

Thanks for reporting, we'll take a look.

@mdmower-csnw
Copy link
Contributor Author

mdmower-csnw commented Jul 16, 2024

@mejiaj - I retested this PR after merging the latest from develop along with #111 to make sure there aren't any regressions with Gulp v5. Things look good from my end.

For a project where I use uswds 3.7.1...

  • the generated sourcemap styles.css.map is identical when using Gulp v5 built-in sourcemaps (this PR) compared to using package gulp-sourcemaps (without this PR).
  • disabling sass-sourcemaps still works with setting settings.compile.sassSourcemaps.

I've gone ahead and merged upstream develop into this branch because there are no merge conflicts introduced with #110 (this PR and that PR can be merged in any order).

FYI, the merge strategy used in 77305e5 was as follows:

# origin = https://github.com/mdmower-csnw/uswds-compile.git
# upstream = https://github.com/uswds/uswds-compile.git
git checkout csnw-sourcemaps
git reset --hard origin/csnw-sourcemaps
git fetch upstream
git merge upstream/develop
# git reports merge conflict in package-lock.json
git checkout upstream/develop package-lock.json
npm install
git add package-lock.json
git merge --continue

@heymatthenry heymatthenry merged commit d558a0e into uswds:develop Jul 17, 2024
1 check passed
@amyleadem amyleadem mentioned this pull request Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS-Compile - Feature: Allow disabling sourcemaps
4 participants