Skip to content

chore(core): drop unused and replaceable grunt plugins, upgrade vulnerable dev dependencies - #3559

Merged
kumilingus merged 3 commits into
clientIO:masterfrom
kumilingus:chore/core-grunt-cleanup
Oct 26, 2026
Merged

kumilingus merged 3 commits into
clientIO:masterfrom
kumilingus:chore/core-grunt-cleanup

Conversation

@kumilingus

@kumilingus kumilingus commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Several dev dependencies of the joint workspaces pull in old, vulnerable transitive packages (browserify 16 → elliptic, chokidar 2 → braces 2 / micromatch 3 / decode-uri-component, xml2js, pinned lodash / minimatch / js-yaml / serialize-javascript). This removes the grunt plugins that do little or nothing, and upgrades the parents that pin vulnerable versions instead of overriding them with resolutions.

@joint/core grunt setup

Removed Replacement
load-grunt-config, jit-grunt ~25-line loader in Gruntfile.js: grunt/config/<name>.js → task config, aliases.js → registerTask, every grunt-* devDependency loaded with loadNpmTasks; pkg stays in the config
grunt-ts shell:ts-test / shell:ts-test-exports → tsc --noEmit -p test/ts{,-exports}/tsconfig.json
grunt-mocha-test shell:mocha-server → mocha --reporter spec "test/*-nodejs/*" (grunt-mocha-test does not support mocha 12)
grunt-browserify, grunt-webpack, webpack none: test/jointjs/browserify.html and the webpack bundle are removed (no test loaded the webpack bundle). test:bundles keeps the requirejs pages for joint, geometry and vectorizer
grunt-contrib-watch none: only the default alias used it
es-module-shims, should, webpack-dev-server none: not referenced

The root build-bundles script (only @joint/core defined it) is removed, together with its CLAUDE.md mention.

Upgrades

Package From To Fixes
grunt (@joint/core) 1.6.1 1.6.3 minimatch ^3.1.5, js-yaml ^3.15.0
mocha (@joint/core, @joint/layout-directed-graph) 11.1.0 12.0.3 serialize-javascript ^7
lodash (@joint/core) ~4.17.21 ^4.18.1 lodash
@rollup/plugin-terser (layout-directed-graph, layout-elk, layout-msagl, router-avoid) ^0.4.4 ^1.0.2 serialize-javascript ^7
copy-webpack-plugin (examples avoid-router-ts, layout-directed-graph, libavoid) 5.1.1 14.0.0 serialize-javascript ^7; the config now takes { patterns: [...] }
@angular-devkit/build-angular → @angular/build (example angular-element-view-ts) ^19.2.0 ^19.2.0 serialize-javascript 6 (via copy-webpack-plugin 12); the example already used the esbuild application builder, now taken from @angular/build
@vue/test-utils (@joint/vitest-plugin-mock-svg, ^2.4.6) 2.4.6 2.5.1 (refreshed in range) minimatch 9.0.1: 2.5 moves to js-beautify 2 → editorconfig 3
grunt-legacy-log / -util, terser-webpack-plugin refreshed in range lodash ^4.18, serialize-javascript

Not included

  • eslint-plugin-sonarjs 4 (would fix minimatch 9.0.5): 4.2.2, the latest, crashes on packages/joint-react/src/__tests__/internal.test.ts (sonarjs/assertions-in-tests: Cannot read properties of undefined (reading 'declarations')). Left for a follow-up.

Note: while trying sonarjs 4, re-resolving the lockfile moved sonarjs 3's typescript: ">=5" dependency to TypeScript 7.0.2, which lacks the JS API sonarjs uses (SyntaxKind), and yarn lint crashed. The lockfile here is regenerated from master so that range stays on 5.9.3 - worth knowing for any future yarn up that touches it.

Testing

  • yarn install --immutable: clean.
  • Build output compared with master (diff -r of dist/): byte-identical for @joint/core (yarn dist, 10 files) and for layout-directed-graph, layout-elk, layout-msagl and router-avoid (113 files, including the terser .min.js).
  • @joint/core yarn test: mocha 4 passing (as on master), karma geometry 350 / vectorizer 453 / joint 2179, QUnit requirejs pages 3 + 2 + 2, both tsc checks pass. shell:ts-test-exports fails on an injected type error.
  • @joint/layout-directed-graph yarn test (mocha 12): 8 passing, karma 22.
  • yarn lint: passes.
  • Examples avoid-router-ts, layout-directed-graph and libavoid build with copy-webpack-plugin 14; index.html and libavoid.wasm are copied into dist/.
  • @joint/vitest-plugin-mock-svg yarn test (after building @joint/mock-svg and the plugin): React and Vue typechecks pass, 2 / 2 tests.
  • Example angular-element-view-ts builds with @angular/build (same output size as on master; the existing initial-bundle budget warning is unchanged).

@kumilingus
kumilingus marked this pull request as ready for review October 25, 2026 16:59
@kumilingus
kumilingus force-pushed the chore/core-grunt-cleanup branch from 0f3a19d to 9b07f5c Compare October 26, 2026 12:16
…rable dev dependencies

Remove grunt plugins and dev dependencies of `@joint/core` that pull in
old, vulnerable transitive packages, and upgrade the parents that pin
vulnerable versions elsewhere:

- `load-grunt-config` + `jit-grunt`: replaced by a small loader in
  `Gruntfile.js` that loads every `grunt-*` devDependency
- `grunt-ts`: `ts:test` / `ts:test-exports` are now `shell:ts-test` /
  `shell:ts-test-exports` (`tsc --noEmit`)
- `grunt-mocha-test` (no mocha 12 support): `shell:mocha-server`
- `grunt-browserify`, `grunt-webpack`, `webpack`: the browserify test
  page and the untested webpack bundle are removed; `test:bundles` keeps
  the requirejs pages
- `grunt-contrib-watch`: only used by the `default` alias
- `es-module-shims`, `should`, `webpack-dev-server`: not referenced
- `grunt` 1.6.1 -> 1.6.3 (`minimatch ^3.1.5`, `js-yaml ^3.15.0`),
  `mocha` 11.1.0 -> 12.0.3, `lodash` ~4.17.21 -> ^4.18.1
- `@rollup/plugin-terser` ^0.4.4 -> ^1.0.2 in the layout packages and
  `@joint/router-avoid` (`serialize-javascript` ^7)
- `mocha` 11.1.0 -> 12.0.3 in `@joint/layout-directed-graph`
- `copy-webpack-plugin` 5.1.1 -> 14.0.0 in three examples (the plugin
  now takes `{ patterns }`)
- `grunt-legacy-log` / `grunt-legacy-util` and `terser-webpack-plugin`
  refreshed within their ranges
The example already uses the esbuild `application` builder; take it
from `@angular/build` instead of `@angular-devkit/build-angular`, which
pulls in the webpack toolchain (`copy-webpack-plugin` 12 and the
vulnerable `serialize-javascript` 6).
2.5 depends on js-beautify 2, whose editorconfig 3 no longer pins the
vulnerable minimatch 9.0.1.
@kumilingus
kumilingus force-pushed the chore/core-grunt-cleanup branch from 9b07f5c to 2c56ceb Compare October 26, 2026 12:18
@kumilingus
kumilingus merged commit 93baf23 into clientIO:master Oct 26, 2026
3 checks passed
@kumilingus
kumilingus deleted the chore/core-grunt-cleanup branch October 26, 2026 12:28
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.

2 participants