Update dependency groups across the monorepo#7840
Conversation
🦋 Changeset detectedLatest commit: ba92867 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
| "@primer/stylelint-config": "13.5.0", | ||
| "@size-limit/preset-big-lib": "11.2.0", | ||
| "@types/node": "20.12.11", | ||
| "@types/node": "^25.8.0", |
| /** | ||
| * Returns array of plugins from the given PostCSS preset | ||
| * @param {import('postcss').Processor | import('postcss').Plugin} preset | ||
| * @param {any} preset |
|
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refreshes dependency versions across the Primer React monorepo in logical groups and applies targeted compatibility adjustments to keep builds, types, and tooling working with the upgraded packages.
Changes:
- Updated dependency sets across workspaces (React/styled-react, MCP/doc-gen, PostCSS tooling, examples, and root tooling).
- Applied compatibility shims for upgraded dependencies (MCP SDK request shape, Storybook PostCSS typing, TS type test expectations, markdown lint guard).
- Updated PostCSS preset snapshots to match output changes from newer plugin versions.
Show a summary per file
| File | Description |
|---|---|
| packages/styled-react/src/components/ThemeProvider.tsx | Adjusts children typing for styled-components ThemeProvider compatibility. |
| packages/styled-react/package.json | Refreshes styled-react dependency versions (React/types, Storybook/Vite, Rollup). |
| packages/styled-react/.storybook/main.ts | Adds PostCSS plugin typing cast to avoid PostCSS type conflicts. |
| packages/rollup-plugin-import-css/package.json | Updates PostCSS/tooling dependency versions. |
| packages/react/src/Token/tests/Token.types.test.tsx | Marks unsupported resize props as an expected TS error. |
| packages/react/script/components-json/build.ts | Hardens markdown lint errorRange guard against null/undefined. |
| packages/react/package.json | Updates @primer/react deps/tooling versions (Storybook, Babel, lint/build tools, etc.). |
| packages/react/.storybook/main.ts | Adds PostCSS plugin typing cast for Storybook/Vite config. |
| packages/postcss-preset-primer/src/index.js | Refines JSDoc typing around PostCSS preset plugin extraction. |
| packages/postcss-preset-primer/src/tests/snapshots/preset.test.ts.snap | Updates snapshots for new PostCSS output ordering. |
| packages/postcss-preset-primer/package.json | Updates PostCSS ecosystem dependencies (postcss, preset-env, cssnano, glob). |
| packages/mcp/src/server.ts | Updates MCP SDK request shape (temperature top-level). |
| packages/mcp/package.json | Refreshes MCP runtime/build dependencies. |
| packages/doc-gen/package.json | Refreshes doc-gen runtime/build dependencies (Babel/Rollup, yargs types). |
| package.json | Updates root tooling deps (notably @types/node, rimraf, storybook). |
| examples/theming/package.json | Updates example deps; adds react-is for styled-components/Vite resolution. |
| examples/nextjs/package.json | Updates Next.js example deps to current compatible versions. |
| examples/codesandbox/package.json | Updates example tooling deps; adds react-is and bumps Vite. |
| .changeset/mcp-dependency-refresh.md | Adds changeset for publishing MCP dependency refresh as a patch. |
Copilot's findings
- Files reviewed: 19/20 changed files
- Comments generated: 2
| * Returns array of plugins from the given PostCSS preset | ||
| * @param {import('postcss').Processor | import('postcss').Plugin} preset | ||
| * @returns {Array<any>} | ||
| * @param {{postcssPlugin?: import('postcss').Plugin['postcssPlugin'], plugins?: Array<unknown>}} preset | ||
| * @returns {Array<import('postcss').Plugin | import('postcss').TransformCallback | import('postcss').Transformer>} | ||
| */ | ||
| function plugins(preset) { | ||
| return 'plugins' in preset ? preset.plugins : [] | ||
| return 'plugins' in preset | ||
| ? /** @type {Array<import('postcss').Plugin | import('postcss').TransformCallback | import('postcss').Transformer>} */ ( | ||
| preset.plugins | ||
| ) | ||
| : [] |
| "@types/lodash.isempty": "4.4.9", | ||
| "@types/lodash.isobject": "3.0.9", | ||
| "@types/lodash.keyby": "4.6.9", | ||
| "@types/node": "20.12.11", |
@actions/core v3.0.1 is ESM-only (no "require" condition in its exports map), which broke the CJS script get-export-sizes.cjs with ERR_PACKAGE_PATH_NOT_EXPORTED. Reverting to v1.11.1 which ships only a "main" field and is fully require()-compatible. Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
|
@copilot don't downgrade the package for actions, update the sizes script to work with the latest dependencies that have been installed (actions, gzip, etc) |
@actions/core v3 and gzip-size v7 are ESM-only. Convert the sizes
script from get-export-sizes.cjs to get-export-sizes.mjs so all
imports use ESM syntax:
- Replace require() with import statements
- Replace __dirname with path.dirname(fileURLToPath(import.meta.url))
- Use named import { gzipSize } from 'gzip-size' (v7 named export)
- Use import * as core from '@actions/core' (v3 ESM-only)
Restore @actions/core to 3.0.1 and update the CI workflow step to
reference the new .mjs script.
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Done in the latest commit. Converted
|
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/20874 |
|
Integration test results from github/github-ui:
CI check runs linting, type checking, and unit tests. Check the workflow logs for specific failures. Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance. |
Changelog
New
@primer/mcpto cover the published dependency refresh.Changed
Dependency refresh by logical group
@primer/doc-genand@primer/mcpdependencies to current releases.postcss-preset-primerandrollup-plugin-import-css.@primer/reactand@primer/styled-reactdependency sets, keeping React/Vite on the compatible track where newer majors broke builds/types.codesandbox,nextjs,theming) to current compatible versions.Required compatibility fixes for upgraded packages
temperatureinstead of nestedsampling).components-jsongeneration.react-isto styled-components-based examples so Vite production builds resolve correctly.Small follow-up cleanup
next-env.d.tsimport formatting to satisfy repo lint rules.Tokenresize prop type test as an expected error to match the component’s supported prop surface.Removed
Rollout strategy
Testing & Reviewing
Review by dependency group / commit. Most of the code changes are compatibility shims required to keep the upgraded packages buildable and type-safe.
Example of the MCP SDK adjustment:
Merge checklist
Original prompt
Created from Copilot CLI via the copilot delegate command.