Skip to content

Commit 8e826d2

Browse files
authored
fix: dependencies 2025-06-03 (#4639)
1 parent 5598d24 commit 8e826d2

File tree

25 files changed

+1515
-194
lines changed

25 files changed

+1515
-194
lines changed

.github/workflows/pullRequests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
run: yarn eslint
187187
working-directory: ${{ github.base_ref }}
188188
- name: Sync Dependencies Verification
189-
run: yarn webiny verify-dependencies
189+
run: yarn verify-dependencies
190190
working-directory: ${{ github.base_ref }}
191191
runs-on: ubuntu-latest
192192
env:
@@ -219,7 +219,7 @@ jobs:
219219
run: yarn build:quick
220220
working-directory: ${{ github.base_ref }}
221221
- name: Sync Dependencies Verification
222-
run: yarn webiny verify-dependencies
222+
run: yarn verify-dependencies
223223
working-directory: ${{ github.base_ref }}
224224
runs-on: ubuntu-latest
225225
env:

.github/workflows/pushDev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
run: yarn build:quick
131131
working-directory: dev
132132
- name: Sync Dependencies Verification
133-
run: yarn webiny verify-dependencies
133+
run: yarn verify-dependencies
134134
working-directory: dev
135135
runs-on: ubuntu-latest
136136
env:

.github/workflows/pushNext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
run: yarn build:quick
131131
working-directory: next
132132
- name: Sync Dependencies Verification
133-
run: yarn webiny verify-dependencies
133+
run: yarn verify-dependencies
134134
working-directory: next
135135
runs-on: ubuntu-latest
136136
env:

.github/workflows/wac/pullRequests.wac.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export const pullRequests = createWorkflow({
273273
{ name: "ESLint", run: "yarn eslint" },
274274
{
275275
name: "Sync Dependencies Verification",
276-
run: "yarn webiny verify-dependencies"
276+
run: "yarn verify-dependencies"
277277
}
278278
],
279279
{ "working-directory": DIR_WEBINY_JS }
@@ -294,7 +294,7 @@ export const pullRequests = createWorkflow({
294294
...installBuildSteps,
295295
{
296296
name: "Sync Dependencies Verification",
297-
run: "yarn webiny verify-dependencies",
297+
run: "yarn verify-dependencies",
298298
"working-directory": DIR_WEBINY_JS
299299
}
300300
]

.github/workflows/wac/push.wac.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const createPushWorkflow = (branchName: string) => {
338338
...installBuildSteps,
339339
{
340340
name: "Sync Dependencies Verification",
341-
run: "yarn webiny verify-dependencies",
341+
run: "yarn verify-dependencies",
342342
"working-directory": DIR_WEBINY_JS
343343
}
344344
]

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@
2828
"url": "https://github.com/webiny/webiny-js.git"
2929
},
3030
"devDependencies": {
31-
"@babel/cli": "^7.26.4",
32-
"@babel/code-frame": "^7.26.2",
33-
"@babel/compat-data": "7.26.5",
34-
"@babel/core": "7.26.7",
35-
"@babel/helper-define-polyfill-provider": "^0.6.3",
31+
"@babel/cli": "7.27.2",
32+
"@babel/code-frame": "7.27.1",
33+
"@babel/compat-data": "7.27.2",
34+
"@babel/core": "7.27.1",
35+
"@babel/helper-define-polyfill-provider": "0.6.4",
3636
"@babel/helper-environment-visitor": "^7.24.7",
37-
"@babel/parser": "7.26.7",
37+
"@babel/parser": "7.27.2",
3838
"@babel/plugin-proposal-class-properties": "^7.18.6",
3939
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
40-
"@babel/plugin-proposal-throw-expressions": "^7.25.9",
40+
"@babel/plugin-proposal-throw-expressions": "7.27.1",
4141
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
42-
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
43-
"@babel/plugin-transform-runtime": "^7.25.9",
44-
"@babel/preset-env": "7.26.7",
45-
"@babel/preset-react": "^7.26.3",
46-
"@babel/preset-typescript": "^7.26.0",
47-
"@babel/register": "^7.25.9",
48-
"@babel/runtime": "7.26.10",
49-
"@babel/template": "^7.25.9",
50-
"@babel/traverse": "7.26.7",
51-
"@babel/types": "7.26.7",
42+
"@babel/plugin-transform-modules-commonjs": "7.27.1",
43+
"@babel/plugin-transform-runtime": "7.27.1",
44+
"@babel/preset-env": "7.27.2",
45+
"@babel/preset-react": "7.27.1",
46+
"@babel/preset-typescript": "7.27.1",
47+
"@babel/register": "7.27.1",
48+
"@babel/runtime": "7.27.1",
49+
"@babel/template": "7.27.2",
50+
"@babel/traverse": "7.27.1",
51+
"@babel/types": "7.27.1",
5252
"@commitlint/cli": "^11.0.0",
5353
"@commitlint/config-conventional": "^11.0.0",
5454
"@grpc/grpc-js": "^1.11.1",
@@ -77,7 +77,7 @@
7777
"adio": "^1.0.1",
7878
"axios": "^1.7.9",
7979
"babel-jest": "29.7.0",
80-
"babel-loader": "^9.2.1",
80+
"babel-loader": "9.2.1",
8181
"babel-plugin-dynamic-import-node": "2.3.3",
8282
"babel-plugin-macros": "3.1.0",
8383
"babel-plugin-module-resolver": "^5.0.2",
@@ -191,7 +191,8 @@
191191
"verdaccio:start": "yarn verdaccio -c ./.verdaccio.yaml",
192192
"verdaccio:start:detached": "yarn pm2 start \"yarn verdaccio:start\"",
193193
"webiny": "./node_modules/.bin/webiny",
194-
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn webiny verify-dependencies",
194+
"verify-depdendencies": "yarn webiny verify-dependencies --allowed-duplicates=downshift",
195+
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn verify-dependencies",
195196
"system:build": "yarn && yarn ghawac build && yarn webiny sync-dependencies && yarn build",
196197
"wby": "./node_modules/.bin/wby",
197198
"webiny-ui-build-storybook": "cd packages/ui && cross-env OUT=../../netlify-static yarn build-storybook"
@@ -208,7 +209,7 @@
208209
"eslint --max-warnings=0 --no-ignore"
209210
],
210211
"**/package.json": [
211-
"yarn webiny verify-dependencies"
212+
"yarn verify-dependencies"
212213
]
213214
},
214215
"yargs": {
@@ -246,7 +247,6 @@
246247
]
247248
},
248249
"resolutions": {
249-
"@babel/runtime": "7.26.10",
250250
"systeminformation": "^5.23.18",
251251
"@emotion/react": "11.10.8",
252252
"@octokit/rest": "^20.0.2",

packages/api-headless-cms/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
],
1919
"license": "MIT",
2020
"dependencies": {
21-
"@babel/code-frame": "^7.26.2",
22-
"@graphql-tools/merge": "^9.0.4",
23-
"@graphql-tools/schema": "^10.0.6",
21+
"@babel/code-frame": "7.27.1",
22+
"@graphql-tools/merge": "9.0.24",
23+
"@graphql-tools/schema": "10.0.23",
2424
"@webiny/api": "0.0.0",
2525
"@webiny/api-i18n": "0.0.0",
2626
"@webiny/api-security": "0.0.0",

packages/cli-plugin-dependencies/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
],
1515
"description": "A tool to generate and verify dependency sync files for Webiny.",
1616
"dependencies": {
17-
"@babel/runtime": "7.26.10",
17+
"@babel/runtime": "7.27.1",
1818
"@webiny/cli": "0.0.0",
1919
"chalk": "^4.1.2",
2020
"get-yarn-workspaces": "^1.0.2",

packages/cli-plugin-dependencies/src/index.ts

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path from "path";
2-
import { CliCommandPlugin, CliCommandPluginArgs } from "@webiny/cli/types";
2+
import { CliCommandPlugin, CliCommandPluginArgs, type Yargs } from "@webiny/cli/types";
33
import { createDependencyTree } from "./references";
44
import { createReferenceFile } from "./references/createReferenceFile";
55
import { verifyDependencies } from "./references/verifyDependencies";
@@ -28,10 +28,28 @@ const createReferenceFileCommandExecutor = ({ context }: Pick<CliCommandPluginAr
2828
};
2929
};
3030

31+
interface IVerifyDependenciesFileCommandExecutorParams {
32+
allowedDuplicates?: string;
33+
["allowed-duplicates"]?: string;
34+
}
35+
36+
const getAllowedDuplicates = (params: IVerifyDependenciesFileCommandExecutorParams): string[] => {
37+
const allowedDuplicates = params.allowedDuplicates || params["allowed-duplicates"];
38+
if (!allowedDuplicates || typeof allowedDuplicates !== "string") {
39+
return [];
40+
}
41+
return allowedDuplicates
42+
.split(",")
43+
.map(item => item.trim())
44+
.filter(Boolean);
45+
};
46+
3147
const verifyDependenciesFileCommandExecutor = ({
3248
context
3349
}: Pick<CliCommandPluginArgs, "context">) => {
34-
return async () => {
50+
return async (input: unknown) => {
51+
const params = input as IVerifyDependenciesFileCommandExecutorParams;
52+
3553
const dirname = getDirname();
3654
const tree = createDependencyTree({
3755
context,
@@ -40,7 +58,8 @@ const verifyDependenciesFileCommandExecutor = ({
4058

4159
verifyDependencies({
4260
tree,
43-
dirname
61+
dirname,
62+
allowedDuplicates: getAllowedDuplicates(params)
4463
});
4564
};
4665
};
@@ -54,9 +73,7 @@ export default (): CliCommandPlugin[] => {
5473
yargs.command(
5574
"sync-dependencies",
5675
"Sync dependencies for all packages.",
57-
(yargs: Record<string, any>) => {
58-
yargs.example("$0 sync-dependencies");
59-
},
76+
() => {},
6077
createReferenceFileCommandExecutor({ context })
6178
);
6279
}
@@ -68,8 +85,12 @@ export default (): CliCommandPlugin[] => {
6885
yargs.command(
6986
"verify-dependencies",
7087
"Verify dependencies for all packages.",
71-
(yargs: Record<string, any>) => {
72-
yargs.example("$0 verify-dependencies");
88+
(yargs: Yargs) => {
89+
yargs.option("max-duplicates", {
90+
describe: `Max allowed duplicates in the dependency tree. If there are more than this number, the command will fail.`,
91+
type: "number",
92+
required: false
93+
});
7394
},
7495
verifyDependenciesFileCommandExecutor({ context })
7596
);

packages/cli-plugin-dependencies/src/references/verifyDependencies.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import { green } from "chalk";
77
export interface IVerifyDependenciesParams {
88
tree: IDependencyTree;
99
dirname: string;
10+
allowedDuplicates: string[];
1011
}
1112

1213
export const verifyDependencies = (params: IVerifyDependenciesParams): void => {
13-
const { tree, dirname } = params;
14+
const { tree, dirname, allowedDuplicates } = params;
1415

1516
const referencesFile = getReferencesFilePath({
1617
dirname
@@ -51,6 +52,14 @@ export const verifyDependencies = (params: IVerifyDependenciesParams): void => {
5152
"Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command."
5253
);
5354
}
55+
for (const duplicate of tree.duplicates) {
56+
if (allowedDuplicates.includes(duplicate.name)) {
57+
continue;
58+
}
59+
throw new Error(
60+
`Duplicate package "${duplicate.name}" found, but it is not in the allowed duplicates list. Please add it to the allowed duplicates list or fix the reason for it being a duplicate.`
61+
);
62+
}
5463
} else {
5564
throw new Error(
5665
"Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command."

0 commit comments

Comments
 (0)