Skip to content

Commit 8a13a84

Browse files
authored
chore: add syncpack to monorepo, align dependency semver ranges, add to CI/lints (#11926)
1 parent ae53482 commit 8a13a84

25 files changed

Lines changed: 205 additions & 189 deletions

File tree

.github/workflows/lint-autofix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- name: AutoFix Spelling
4646
run: yarn lint:spelling:fix
4747

48+
- name: AutoFix Dependency versions
49+
run: yarn lint:spelling:fix
50+
4851
- name: Print Diff
4952
run: git diff
5053

.syncpackrc.ts

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import fs from 'fs-extra';
9+
import type {RcFile} from 'syncpack';
10+
11+
const lernaJson = await fs.readJSON('./lerna.json');
12+
13+
const CurrentDocusaurusVersion = lernaJson.version;
14+
15+
export default {
16+
source: [
17+
'package.json',
18+
'packages/*/package.json',
19+
'website/package.json',
20+
'argos/package.json',
21+
'packages/create-docusaurus/templates/*/package.json',
22+
],
23+
24+
semverGroups: [
25+
{
26+
label: 'Use ~ for TypeScript monorepo root and init templates',
27+
dependencies: ['typescript'],
28+
range: '~',
29+
},
30+
],
31+
32+
versionGroups: [
33+
{
34+
label: 'Ignore * deps in type-alias packages',
35+
packages: [
36+
'@docusaurus/module-type-aliases',
37+
'@docusaurus/theme-common',
38+
'@docusaurus/types',
39+
],
40+
dependencies: [
41+
'react',
42+
'react-dom',
43+
'@types/react',
44+
'@types/react-router-config',
45+
'@types/react-router-dom',
46+
],
47+
isIgnored: true,
48+
},
49+
50+
{
51+
label: 'Ignore * internal peerDependencies',
52+
packages: [
53+
'@docusaurus/core',
54+
'@docusaurus/bundler',
55+
'@docusaurus/faster',
56+
57+
// TODO Docusaurus v4: refactor, these peerDeps shouldn't be needed
58+
'@docusaurus/plugin-content-blog',
59+
'@docusaurus/theme-common',
60+
],
61+
dependencyTypes: ['peer'],
62+
dependencies: [
63+
'@docusaurus/faster',
64+
'@docusaurus/plugin-content-docs',
65+
'@docusaurus/types',
66+
],
67+
isIgnored: true,
68+
},
69+
70+
{
71+
label: 'Ignore broad ESLint peerDep range in ESLint plugin',
72+
packages: ['@docusaurus/eslint-plugin'],
73+
dependencyTypes: ['peer'],
74+
dependencies: ['eslint'],
75+
isIgnored: true,
76+
},
77+
78+
{
79+
label: 'Ignore >= TS range in @docusaurus/tsconfig',
80+
packages: ['@docusaurus/tsconfig'],
81+
dependencyTypes: ['peer'],
82+
isIgnored: true,
83+
},
84+
85+
{
86+
label: 'Internal @docusaurus/* monorepo packages use pinned version',
87+
dependencies: [
88+
'@docusaurus/**',
89+
90+
// This one is not a monorepo package
91+
'!@docusaurus/responsive-loader',
92+
],
93+
pinVersion: CurrentDocusaurusVersion,
94+
},
95+
96+
// Default: all remaining dependencies — highest version wins (syncpack default)
97+
],
98+
} satisfies RcFile;

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,16 @@
5757
"prepare": "husky install",
5858
"format": "prettier --write .",
5959
"format:diff": "prettier --list-different .",
60-
"lint": "yarn lint:js && yarn lint:style && yarn lint:spelling",
61-
"lint:ci": "yarn lint:js --quiet && yarn lint:style && yarn lint:spelling",
60+
"lint": "yarn lint:js && yarn lint:style && yarn lint:spelling && yarn lint:syncpack",
61+
"lint:ci": "yarn lint:js --quiet && yarn lint:style && yarn lint:spelling && yarn lint:syncpack",
6262
"lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"",
6363
"lint:js:fix": "yarn lint:js --fix",
6464
"lint:spelling": "cspell \"**\" --no-progress --show-context --show-suggestions",
6565
"lint:spelling:fix": "yarn rimraf project-words.txt && echo \"# Project Words - DO NOT TOUCH - This is updated through CI\" >> project-words.txt && yarn -s lint:spelling --words-only --unique --no-exit-code --no-summary \"**\" | cross-env LC_ALL=C sort --ignore-case >> project-words.txt",
6666
"lint:style": "stylelint \"**/*.css\"",
6767
"lint:style:fix": "yarn lint:style --fix",
68+
"lint:syncpack": "syncpack lint",
69+
"lint:syncpack:fix": "syncpack fix",
6870
"lerna": "lerna",
6971
"test": "jest",
7072
"test:build:website": "./admin/scripts/test-release.sh",
@@ -78,7 +80,7 @@
7880
"@ai-sdk/react": "^2.0.30",
7981
"@crowdin/cli": "^3.13.0",
8082
"@prettier/plugin-xml": "^2.2.0",
81-
"@swc/core": "^1.7.14",
83+
"@swc/core": "^1.7.39",
8284
"@swc/jest": "^0.2.39",
8385
"@testing-library/dom": "^10.4.1",
8486
"@testing-library/jest-dom": "^6.9.1",
@@ -121,14 +123,15 @@
121123
"pkg-pr-new": "^0.0.66",
122124
"postinstall-postinstall": "^2.1.0",
123125
"prettier": "^2.8.8",
124-
"react": "^19.2.4",
125-
"react-dom": "^19.2.4",
126+
"react": "^19.2.0",
127+
"react-dom": "^19.2.0",
126128
"rimraf": "^3.0.2",
127129
"sharp": "^0.32.3",
128130
"strip-ansi": "^6.0.1",
129131
"stylelint": "^14.16.1",
130132
"stylelint-config-prettier": "^9.0.5",
131133
"stylelint-config-standard": "^29.0.0",
134+
"syncpack": "^14.3.0",
132135
"typescript": "~6.0.2"
133136
},
134137
"resolutions": {

packages/create-docusaurus/templates/classic-typescript/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"@mdx-js/react": "^3.0.0",
2222
"clsx": "^2.0.0",
2323
"prism-react-renderer": "^2.3.0",
24-
"react": "^19.0.0",
25-
"react-dom": "^19.0.0"
24+
"react": "^19.2.0",
25+
"react-dom": "^19.2.0"
2626
},
2727
"devDependencies": {
2828
"@docusaurus/module-type-aliases": "3.9.2",
2929
"@docusaurus/tsconfig": "3.9.2",
3030
"@docusaurus/types": "3.9.2",
31-
"@types/react": "^19.0.0",
31+
"@types/react": "^19.2.10",
3232
"typescript": "~6.0.2"
3333
},
3434
"browserslist": {

packages/create-docusaurus/templates/classic/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"@mdx-js/react": "^3.0.0",
2121
"clsx": "^2.0.0",
2222
"prism-react-renderer": "^2.3.0",
23-
"react": "^19.0.0",
24-
"react-dom": "^19.0.0"
23+
"react": "^19.2.0",
24+
"react-dom": "^19.2.0"
2525
},
2626
"devDependencies": {
2727
"@docusaurus/module-type-aliases": "3.9.2",

packages/docusaurus-babel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@docusaurus/logger": "3.9.2",
4141
"@docusaurus/utils": "3.9.2",
4242
"babel-plugin-dynamic-import-node": "^2.3.3",
43-
"fs-extra": "^11.1.1",
43+
"fs-extra": "^11.2.0",
4444
"tslib": "^2.6.0"
4545
},
4646
"engines": {

packages/docusaurus-mdx-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"escape-html": "^1.0.3",
2727
"estree-util-value-to-estree": "^3.0.1",
2828
"file-loader": "^6.2.0",
29-
"fs-extra": "^11.1.1",
29+
"fs-extra": "^11.2.0",
3030
"image-size": "^2.0.2",
3131
"mdast-util-mdx": "^3.0.0",
3232
"mdast-util-to-string": "^4.0.0",

packages/docusaurus-plugin-client-redirects/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@docusaurus/utils-common": "3.9.2",
2525
"@docusaurus/utils-validation": "3.9.2",
2626
"eta": "^2.2.0",
27-
"fs-extra": "^11.1.1",
27+
"fs-extra": "^11.2.0",
2828
"lodash": "^4.17.21",
2929
"tslib": "^2.6.0"
3030
},

packages/docusaurus-plugin-content-blog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"cheerio": "^1.2.0",
4343
"combine-promises": "^1.1.0",
4444
"feed": "^4.2.2",
45-
"fs-extra": "^11.1.1",
45+
"fs-extra": "^11.2.0",
4646
"lodash": "^4.17.21",
4747
"schema-dts": "^1.1.2",
4848
"srcset": "^4.0.0",

packages/docusaurus-plugin-content-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@docusaurus/utils-validation": "3.9.2",
4747
"@types/react-router-config": "^5.0.7",
4848
"combine-promises": "^1.1.0",
49-
"fs-extra": "^11.1.1",
49+
"fs-extra": "^11.2.0",
5050
"js-yaml": "^4.1.0",
5151
"lodash": "^4.17.21",
5252
"schema-dts": "^1.1.2",

0 commit comments

Comments
 (0)