Skip to content

Remove gulp - #2432

Merged
spaceninja merged 3 commits into
mainfrom
remove-gulp
Aug 22, 2026
Merged

Remove gulp#2432
spaceninja merged 3 commits into
mainfrom
remove-gulp

Conversation

@spaceninja

Copy link
Copy Markdown
Member

Overview

This is item 6 of #2391, and the last of the sequence. Gulp goes away: 280 lines across five tasks, eight packages, and 199 packages out of the dependency tree. Each task becomes a plain script in scripts/, matching the .mjs convention .style-dictionary/build.mjs already set. Two of the five were already plain Rollup API and only needed converting to ESM, one was a five-line wrapper that shelled out to an npm script and is simply deleted, and the watcher uses node:fs.watch rather than taking on a watcher dependency — it was the only thing in the build that needed one.

The one part that is not a like-for-like port is the SVG task, and the coupling is worth knowing before reviewing it. gulp-svgmin pins SVGO 2, so taking svgo as a direct dependency means SVGO 4 — and SVGO 4 rejects the .svgo.yml plugin format outright where SVGO 2 only warned. Fixing that config and removing gulp are therefore the same change; the only way to avoid it would be depending on an end-of-life major directly. Once the config is in the current format, removeXMLNS starts applying for the first time. It has been silently dropped for years, because it is not a preset-default plugin and the old format could only express preset overrides. These partials are only ever {% include %}d into HTML, where the namespace is implied, so that was always the intent.

Everything in dist is byte-identical, verified after each task rather than only at the end, as are the generated token files. The 72 templatized SVG partials do change — they lose xmlns and pick up small coordinate rounding from the newer SVGO — and they are published, so there is a patch changeset. Rendered and compared pixel for pixel, 55 of the 72 are unchanged and the largest difference in the rest is 0.53% of pixels at the edges of curves.

One thing fixed in passing: the Rollup entry is built by joining globbed paths, so the published bundle and type declarations were quietly depending on tiny-glob's traversal order. node:fs.glob finds the same files but returns them reversed. Sorting explicitly reproduces the previous order exactly and removes the dependency on undocumented behaviour.

Screenshots

Testing

Nothing here should look any different. The SVG partials are the only output that changed, so the checks worth doing are on the things that render them.

  • On the deploy preview, open Components → Icon and step through its stories (Basic, Muted, the three sizes, Inline, Accessibility). Every icon should be visible, correctly shaped, and the right size — no blank spaces or clipped glyphs.
  • Open Design → Icons. The full icon set should render, with no gaps in the grid.
  • Open Design → Brand and Design → Favicons. The logo and favicon artwork should look normal.
  • Open Design → Illustrations. These are the most detailed artwork in the library and the most likely to show rounding differences — the feature illustrations and the avatar should look clean, with no visible distortion.
  • Open Components → Cloud Cover and Components → Card → Cloudy. The cloud artwork should sit along the bottom edge as usual.
  • Pick any component with an icon inside it — Components → Pagination or Components → Button — and confirm the icons still sit correctly next to their text.

The build scripts themselves, locally. These replace tasks that CI does exercise, except for the watcher, which nothing covers:

  • Run npm start. Storybook should come up as usual.
  • With it still running, open any file in src/assets ending in .svg, make a trivial edit such as adding a space, and save. The terminal should report that it templatized 72 SVG files.
  • Still running, open any file in src/tokens, save it without changes, and confirm the terminal reports the design token files being rebuilt.
  • Stop Storybook and run npm run build. It should complete without errors, and git status should show no changes to anything in dist.

Removes the last of the gulp toolchain: 280 lines across 5 tasks, and 8
packages (gulp, gulp-postcss, gulp-rename, gulp-run, gulp-sass, gulp-svgmin,
through2, tiny-glob), which takes 199 packages out of the tree.
Each task moves to a script in `scripts/`, matching the `.mjs` convention
`.style-dictionary/build.mjs` already set:
- `buildJS` and `buildTypes` were already plain Rollup API, so they only
needed converting to ESM. They share the virtual root entry via
`rollup-root-entry.mjs`.
- `buildSass` calls sass and postcss directly, matching what gulp-sass and
gulp-postcss were doing: compile, run `postcss.config.js`, write
`standalone.css`, then minify that with cssnano.
- `buildTokens` was a 5-line wrapper shelling out to `preprocess:tokens`, so
it is simply gone; the watcher runs the token build directly.
- `watchPreprocess` uses `node:fs.watch` with `recursive: true` rather than
taking on a watcher dependency. It was the only thing in the build needing
one.
`tiny-glob` is replaced by `node:fs.glob`, which finds the same 63 files. The
results are now sorted explicitly: the entry file is built by joining those
paths, so the published bundle and type declarations were quietly depending
on one glob library's traversal order. Sorting reproduces the previous order
exactly.
All of `dist` is byte-identical, as are the generated token files.
The SVG task is the exception. `gulp-svgmin` pins SVGO 2, so taking svgo as a
direct dependency means SVGO 4 -- and SVGO 4 rejects the `.svgo.yml` plugin
format outright rather than warning, so the config fix and the upgrade cannot
be separated. `.svgo.yml` now uses the current format, which has three
consequences:
- `removeXMLNS` finally applies. It has been silently dropped for years,
because it is not a `preset-default` plugin and the old format could only
express preset overrides. These partials are only `{% include %}`d into
HTML, where the namespace is implied.
- `removeViewBox: false` is no longer needed. SVGO 4 dropped that plugin from
`preset-default`, so viewBox is preserved by default -- which is what this
config already asked for, and what #2422 restored in the minified CSS.
- Coordinates round slightly differently. Rendered and compared pixel for
pixel, 55 of the 72 partials are unchanged, and the largest difference in
the rest is 0.53% of pixels at the edges of curves.
Verified with a headless sweep: all 337 entries (249 stories, 82 docs) render
with content and zero page errors.
Beyond replacing gulpfile.js with scripts/, the tree had drifted: Style
Dictionary's files became .mjs in #2422, .storybook/main became .mjs in
#2405, and stories stopped being .stories.mdx in the same PR.
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f0a0ff8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@cloudfour/patternsPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlifyBot commented Aug 21, 2026

Copy link
Copy Markdown

Deploy Preview for cloudfour-patterns ready!

NameLink
🔨 Latest commitf0a0ff8
🔍 Latest deploy loghttps://app.netlify.com/projects/cloudfour-patterns/deploys/6a88e56498e4c300086f4141
😎 Deploy Previewhttps://deploy-preview-2432--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@spaceninja
spaceninja merged commit 570de07 into mainAug 22, 2026
8 checks passed
@spaceninja
spaceninja deleted the remove-gulp branch August 22, 2026 00:00
@github-actionsgithub-actionsBot mentioned this pull request Aug 22, 2026
Sign up for freeto 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.

Dependency modernization: Node 24, Vite, and Storybook 10

1 participant

@spaceninja