Skip to content

chore(deps): trivial major-version dependency migrations - #3294

Open
ByronDWall wants to merge 5 commits into
mainfrom
chore/deps-trivial-major-migration
Open

chore(deps): trivial major-version dependency migrations#3294
ByronDWall wants to merge 5 commits into
mainfrom
chore/deps-trivial-major-migration

Conversation

@ByronDWall

Copy link
Copy Markdown
Contributor

Context

Split out from #3293, which batch-consolidated safe Renovate updates and explicitly excluded all 28 genuine major-version dependency bumps for later handling. This PR picks up the subset of those excluded majors that are trivial ecosystem churn and are genuinely present in this repo (this repo's Renovate dependency dashboard is known to be heavily contaminated with items from a different repo's dependency graph).

Included (4)

  • @manypkg/find-root 1.1.0 → 3.1.0 — pure ESM since v3.0.0, consumed via ts-node --compiler-options '{"module":"commonjs"}' in generators/package-json. Breaking change found during migration: findRootSync now returns a MonorepoRoot object ({ rootDir, tool }) instead of a plain path string. Fixed the one call site to read .rootDir. Verified: CLI smoke test (generate-package-json --dry-run), Jest unit tests, and pnpm typecheck all pass.
  • @manypkg/get-packages 1.1.3 → 3.1.0 — pure ESM since v3.0.0. Both consumers (generators/package-json, generators/readme) only read .packages from getPackagesSync(), never .root/.rootPackage/.tool, so the v2.0 API rename doesn't affect this repo. Verified: CLI smoke tests (--dry-run and --all-workspace-packages --dry-run), Jest unit tests.
  • commander ^13.1.0 → 15.0.0 — ESM-only internals since v15, requires Node ≥22.12 (this repo runs Node 24). No call-site changes needed; verified all 3 call sites (scripts/version.js via CJS require, and the two generator bin scripts via ESM import compiled through ts-node's commonjs mode) run without ERR_REQUIRE_ESM. None of the 3 sites declare paired --no-* boolean negation options, so v15's default-value behavior change for those doesn't apply.
  • execa 9.6.1 → 10.0.1 — zero call sites anywhere in this repo's source (only a bare devDependency catalog entry). Verified pnpm install succeeds and both require('execa') and import('execa') resolve under Node 24.

Also fixed: a real, previously-unverified regression the dashboard's research didn't catch

Running the generators' Jest suite after the @manypkg/* bumps surfaced two real problems, both fixed in a dedicated follow-up commit:

  1. babel-plugin-package-version.js does require('find-up'), but find-up was never a declared dependency anywhere in this repo — it only resolved by accident via Jest's haste-map fallback landing on whichever find-up version happened to be reachable in the pnpm store. Regenerating the lockfile for the 4 bumps in this PR shifted that phantom resolution from a CJS find-up@4.1.0 to the ESM-only find-up@7.0.0, which Jest's CJS module runtime can't require() (SyntaxError: Cannot use import statement outside a module), breaking generators/readme's test suite. Fixed by declaring find-up@5.0.0 (already present in the lockfile, CJS, has the .sync API this file uses) as an explicit devDependency, making the resolution deterministic.
  2. The Jest specs for generators/package-json and generators/readme import ../src, which unconditionally imports the now-ESM-only @manypkg/find-root / @manypkg/get-packages at module-eval time. Jest's CJS runtime can't require ESM packages directly (unlike Node's native require(), which has supported this since Node 22.12 — why the CLI smoke tests were unaffected). Neither spec actually exercises findRootSync/getPackagesSync, so added narrow jest.mock() stubs in the two spec files, without touching the shared root Jest config used by the rest of the monorepo's tests.

Explicitly excluded (out of scope for this trivial-churn batch)

All non-trivial majors, reason: "non-trivial major, out of scope for this trivial-churn batch, left for dedicated follow-up":
babel packages, git workflow tools, i18n/formatjs, jest packages, linting major group (incl. eslint v10), node.js updates, svgr, typescript packages, @testing-library/jest-dom, @vitejs/plugin-react(-swc), babel-plugin-formatjs, jsdom, prettier, puppeteer, stylelint*, vite.

Verified-but-already-current (no-op, nothing to commit)

  • cross-env — already 10.1.0
  • downshift — already 9.4.0 (catalogs.react)
  • glob — already 13.0.6

Dropped as not actually present/real in this repo (dashboard contamination)

  • flat-cache>rimrafflat-cache is present (both 4.0.1 and 6.1.22 resolved in the lockfile), but neither resolved version depends on rimraf (they depend on flatted/keyv and cacheable/hookified respectively). This transitive relationship doesn't exist in this repo's dependency graph.
  • webpack-dev-server>rimrafwebpack-dev-server doesn't appear anywhere in pnpm-lock.yaml; not a dependency of this repo at all.

This is consistent with #3293's own findings about dashboard contamination.

Build/test verification

  • pnpm typecheck — 20 pre-existing errors in 5 unrelated files (icon-button/card/spacings/data-table typings), confirmed present on a pristine origin/main checkout too; no new errors introduced by this PR.
  • npx jest --config jest.ts-test.config.js (generators + all other ts-test-node specs) — 3 suites / 7 tests pass.
  • pnpm test (full monorepo suite, after pnpm compile-intl) — 124/125 suites, 1402/1403 tests pass. The one flaky test (generators/readme's "Justice League" inline snapshot) is a pre-existing, order-dependent race unrelated to this PR: generators/package-json and generators/readme test suites both copy fixtures into the same shared os.tmpdir()/packages/justice-league path, and their fixture package.json files have different description text, so whichever suite's beforeAll copy runs last wins. Reproduced the identical flake on a pristine origin/main checkout (failed in 1 of 3 runs there too) — confirmed pre-existing, not introduced by this PR, and left unfixed as out of scope.
  • pnpm build — passes fully (exit code 0).

Changeset

Not needed. All 4 deps (@manypkg/find-root, @manypkg/get-packages, commander, execa) plus the added find-up are devDependencies / repo-tooling-only — confirmed none are a runtime dependencies entry of any published @commercetools-uikit/* or @commercetools-frontend/* package (the generators themselves are "private": true). This matches the precedent for pure tooling deps.

Not merging or closing PR #3293 or any original Renovate PRs.

findRootSync now returns a MonorepoRoot object ({ rootDir, tool })
instead of a plain root-path string (breaking change since v3.0.0).
Update the sole call site in generators/package-json/src/index.ts to
read .rootDir.
No call-site changes needed: both consumers (generators/package-json
and generators/readme) only read the .packages array from
getPackagesSync(), never .root/.rootPackage/.tool, so the v2.0
root->rootPackage rename and other API changes don't affect this repo.
No call-site changes needed. Verified require('commander') still works
under Node 24 (commander v15 is ESM-only internally but Node's
synchronous require()-of-ESM support handles it), and all 3 call sites
(scripts/version.js via CJS require, generators/package-json and
generators/readme bin scripts via ESM import compiled through
ts-node's commonjs mode) run without ERR_REQUIRE_ESM or similar
errors. None of the 3 call sites declare paired --no-* boolean
negation options, so the v15 default-value behavior change for those
does not apply here.
No call sites in this repo (git grep for "execa" across *.js/*.ts/*.mjs/*.cjs
outside node_modules returns nothing) — it's a bare devDependency
catalog entry only. Verified 'pnpm install' succeeds and both
require('execa') and import('execa') resolve without error under
Node 24.
…M deps in generator tests

Two real, previously-unverified regressions surfaced by running the
generators' Jest test suite (jest.ts-test.config.js) after the
@manypkg/find-root and @manypkg/get-packages major bumps:

1. babel-plugin-package-version.js does `require('find-up')` but
   find-up was never a declared dependency anywhere in this repo -- it
   only resolved by accident via Jest's haste-map fallback landing on
   whichever find-up version happened to be reachable in the .pnpm
   store. Before this change that happened to be the CJS find-up@4.1.0
   pulled in by some other package; after regenerating the lockfile
   for the 4 dep bumps in this branch, the phantom resolution shifted
   to the ESM-only find-up@7.0.0, which Jest's CJS module runtime
   can't require (`SyntaxError: Cannot use import statement outside a
   module`), breaking generators/readme's test suite (it invokes
   react-docgen -> @babel/core -> babel.config.js ->
   babel-plugin-package-version.js). Declaring find-up@5.0.0 (already
   present in the lockfile, CJS, has the .sync API this file uses) as
   an explicit devDependency makes the resolution deterministic and
   fixes the test.

2. generators/package-json and generators/readme's Jest specs import
   '../src', which unconditionally imports @manypkg/find-root /
   @manypkg/get-packages at module-eval time. Both packages are pure
   ESM since their v3 majors. Jest's CJS runtime can't require ESM
   packages directly (unlike Node's native require(), which has
   supported this since Node 22.12 -- which is why the CLI smoke tests
   for these generators were unaffected). Neither spec file actually
   exercises findRootSync/getPackagesSync (only transformDocument is
   under test), so jest.mock() stubs for both packages avoid the
   module-load-time SyntaxError without touching the shared root Jest
   config used by the rest of the monorepo's test suites.
@ByronDWall
ByronDWall requested a review from a team as a code owner August 10, 2026 19:07
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ui-kit Ready Ready Preview Aug 10, 2026 7:08pm

Request Review

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4505ade

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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.

1 participant