Skip to content

Commit 5215a33

Browse files
authored
chore: move monorepo package versions to v4.0.0 (facebook#12442)
1 parent bc1f4ab commit 5215a33

51 files changed

Lines changed: 513 additions & 494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint-autofix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ jobs:
3636
- name: Installation
3737
run: pnpm install --frozen-lockfile || pnpm install --frozen-lockfile || pnpm install --frozen-lockfile
3838

39+
- name: AutoFix Duplicated deps
40+
run: pnpm lint:deps:fix
41+
3942
- name: AutoFix Formatting
4043
run: pnpm format
4144

.syncpackrc.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import fs from 'fs-extra';
98
import type {RcFile} from 'syncpack';
109

11-
const lernaJson = await fs.readJSON('./lerna.json');
12-
13-
const CurrentDocusaurusVersion = lernaJson.version;
10+
// const lernaJson = await fs.readJSON('./lerna.json');
11+
// const CurrentDocusaurusVersion = lernaJson.version;
1412

1513
export default {
1614
source: [
@@ -83,21 +81,29 @@ export default {
8381
},
8482

8583
{
86-
label: 'Monorepo root uses workspace: protocol for internal packages',
87-
packages: ['root'],
84+
label:
85+
'Templates should use pinned versions, not the workspace:* protocol',
86+
packages: [
87+
'docusaurus-2-classic-template',
88+
'docusaurus-2-classic-typescript-template',
89+
],
8890
dependencies: ['@docusaurus/**'],
89-
pinVersion: 'workspace:',
91+
pinVersion: '4.0.0', // TODO make this dynamic
9092
},
9193

9294
{
93-
label: 'Internal @docusaurus/* monorepo packages use pinned version',
95+
label:
96+
'Internal @docusaurus/* monorepo packages use the workspace:* protocol',
9497
dependencies: [
9598
'@docusaurus/**',
99+
'create-docusaurus',
100+
'stylelint-copyright',
96101

97-
// This one is not a monorepo package
102+
// These are not monorepo packages
103+
'!@docusaurus/responsive-loader',
98104
'!@docusaurus/responsive-loader',
99105
],
100-
pinVersion: CurrentDocusaurusVersion,
106+
pinVersion: 'workspace:*',
101107
},
102108

103109
// Default: all remaining dependencies — highest version wins (syncpack default)

admin/new.docusaurus.io/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.docusaurus.io",
3-
"version": "3.10.1",
3+
"version": "4.0.0",
44
"private": true,
55
"scripts": {
66
"start": "npx --package netlify-cli netlify dev"

admin/scripts/test-release.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,26 @@ then
3838
fi
3939

4040
# Run Docker container with private npm registry Verdaccio
41+
docker rm -f verdaccio
4142
docker run -d --rm --name "$CONTAINER_NAME" -p 4873:4873 -v "$PWD/admin/verdaccio.yaml":/verdaccio/conf/config.yaml verdaccio/verdaccio:latest
4243

4344
# Build packages
4445
pnpm build:packages
4546

4647
# Publish the monorepo
47-
npx --no-install lerna publish --exact --yes --no-verify-access --no-git-reset --no-git-tag-version --no-push --registry "$CUSTOM_REGISTRY_URL" "$NEW_VERSION"
48+
npx --no-install lerna publish \
49+
--exact \
50+
--yes \
51+
--no-verify-access \
52+
--no-git-reset \
53+
--no-git-tag-version \
54+
--no-push \
55+
--include-private docusaurus-2-classic-template \
56+
--include-private docusaurus-2-classic-typescript-template \
57+
--registry "$CUSTOM_REGISTRY_URL" "$NEW_VERSION"
4858

4959
# Revert version changes
50-
git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --
60+
git restore -- '**/package.json' lerna.json pnpm-lock.yaml
5161

5262

5363
# The website is generated outside the repo to minimize chances of pnpm resolving the wrong version
@@ -56,9 +66,9 @@ cd ..
5666
echo Generating test-website in `pwd`
5767

5868
# Build skeleton website with new version
59-
npm_config_registry="$CUSTOM_REGISTRY_URL" \
60-
npm_config_min_release_age_exclude='create-docusaurus,@docusaurus/*,stylelint-copyright' \
61-
npx --yes --loglevel silly create-docusaurus@"$NEW_VERSION" test-website classic --javascript $EXTRA_OPTS
69+
pnpm_config_registry="$CUSTOM_REGISTRY_URL" \
70+
pnpm_config_minimum_release_age_exclude='["create-docusaurus","@docusaurus/*","stylelint-copyright"]' \
71+
pnpm --loglevel debug dlx create-docusaurus@"$NEW_VERSION" test-website classic --javascript $EXTRA_OPTS
6272

6373

6474
# Stop Docker container

admin/test-bad-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "test-bad-package",
3-
"version": "3.10.1",
3+
"version": "4.0.0",
44
"private": true,
55
"dependencies": {
66
"@mdx-js/react": "1.0.1",

argos/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "argos",
3-
"version": "3.10.1",
3+
"version": "4.0.0",
44
"description": "Argos visual diff tests",
55
"license": "MIT",
66
"private": true,

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "3.10.1",
2+
"version": "4.0.0",
33
"npmClient": "pnpm",
44
"useNx": false,
55
"changelog": {

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"format:website:build": "oxfmt --config .oxfmtrc.website.build.json website/build",
5454
"format:diff": "oxfmt --list-different .",
5555
"lint": "pnpm lint:js && pnpm lint:style && pnpm lint:SPELLING && pnpm lint:syncpack",
56-
"lint:ci": "pnpm lint:js --quiet && pnpm lint:style && pnpm lint:spelling && pnpm lint:syncpack",
56+
"lint:ci": "pnpm lint:js --quiet && pnpm lint:style && pnpm lint:spelling && pnpm lint:syncpack && pnpm lint:deps",
5757
"lint:js": "eslint --cache --report-unused-disable-directives \"**/*.{js,jsx,ts,tsx,mjs}\"",
5858
"lint:js:fix": "pnpm lint:js --fix",
5959
"lint:spelling": "cspell \"**\" --no-progress --show-context --show-suggestions",
@@ -62,6 +62,8 @@
6262
"lint:style:fix": "pnpm lint:style --fix",
6363
"lint:syncpack": "syncpack lint",
6464
"lint:syncpack:fix": "syncpack fix",
65+
"lint:deps": "pnpm dedupe --check",
66+
"lint:deps:fix": "pnpm dedupe",
6567
"lerna": "lerna",
6668
"test": "vitest run",
6769
"test:build:website": "./admin/scripts/test-release.sh",
@@ -74,10 +76,10 @@
7476
"devDependencies": {
7577
"@ai-sdk/react": "^3.0.280",
7678
"@crowdin/cli": "^5.0.2",
77-
"@docusaurus/eslint-plugin": "workspace:",
78-
"@docusaurus/plugin-content-blog": "workspace:",
79-
"@docusaurus/plugin-content-docs": "workspace:",
80-
"@docusaurus/plugin-content-pages": "workspace:",
79+
"@docusaurus/eslint-plugin": "workspace:*",
80+
"@docusaurus/plugin-content-blog": "workspace:*",
81+
"@docusaurus/plugin-content-docs": "workspace:*",
82+
"@docusaurus/plugin-content-pages": "workspace:*",
8183
"@eslint/js": "^10.0.1",
8284
"@swc/core": "^1.16.2",
8385
"@testing-library/dom": "^10.4.1",
@@ -124,7 +126,7 @@
124126
"strip-ansi": "^7.2.0",
125127
"stylelint": "^17.15.0",
126128
"stylelint-config-standard": "^40.0.0",
127-
"stylelint-copyright": "3.10.1",
129+
"stylelint-copyright": "workspace:*",
128130
"syncpack": "^14.3.1",
129131
"typescript": "~6.0.3",
130132
"typescript-eslint": "^8.69.0",

packages/create-docusaurus/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-docusaurus",
3-
"version": "3.10.1",
3+
"version": "4.0.0",
44
"description": "Create Docusaurus apps easily.",
55
"type": "module",
66
"repository": {
@@ -22,7 +22,7 @@
2222
},
2323
"license": "MIT",
2424
"dependencies": {
25-
"@docusaurus/logger": "3.10.1",
25+
"@docusaurus/logger": "workspace:*",
2626
"commander": "^5.1.0",
2727
"cross-spawn": "^7.0.6",
2828
"prompts": "^2.4.2",

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docusaurus-2-classic-typescript-template",
3-
"version": "3.10.1",
3+
"version": "4.0.0",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
@@ -15,19 +15,19 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "3.10.1",
19-
"@docusaurus/faster": "3.10.1",
20-
"@docusaurus/preset-classic": "3.10.1",
18+
"@docusaurus/core": "4.0.0",
19+
"@docusaurus/faster": "4.0.0",
20+
"@docusaurus/preset-classic": "4.0.0",
2121
"@mdx-js/react": "^3.1.1",
2222
"clsx": "^2.1.1",
2323
"prism-react-renderer": "^2.4.1",
2424
"react": "^19.3.0",
2525
"react-dom": "^19.3.0"
2626
},
2727
"devDependencies": {
28-
"@docusaurus/module-type-aliases": "3.10.1",
29-
"@docusaurus/tsconfig": "3.10.1",
30-
"@docusaurus/types": "3.10.1",
28+
"@docusaurus/module-type-aliases": "4.0.0",
29+
"@docusaurus/tsconfig": "4.0.0",
30+
"@docusaurus/types": "4.0.0",
3131
"@types/react": "^19.3.0",
3232
"typescript": "~6.0.3"
3333
},

0 commit comments

Comments
 (0)