Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
run: yarn eslint
working-directory: ${{ github.base_ref }}
- name: Sync Dependencies Verification
run: yarn webiny verify-dependencies
run: yarn verify-dependencies
working-directory: ${{ github.base_ref }}
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
run: yarn build:quick
working-directory: ${{ github.base_ref }}
- name: Sync Dependencies Verification
run: yarn webiny verify-dependencies
run: yarn verify-dependencies
working-directory: ${{ github.base_ref }}
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pushDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
run: yarn build:quick
working-directory: dev
- name: Sync Dependencies Verification
run: yarn webiny verify-dependencies
run: yarn verify-dependencies
working-directory: dev
runs-on: ubuntu-latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pushNext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
run: yarn build:quick
working-directory: next
- name: Sync Dependencies Verification
run: yarn webiny verify-dependencies
run: yarn verify-dependencies
working-directory: next
runs-on: ubuntu-latest
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wac/pullRequests.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export const pullRequests = createWorkflow({
{ name: "ESLint", run: "yarn eslint" },
{
name: "Sync Dependencies Verification",
run: "yarn webiny verify-dependencies"
run: "yarn verify-dependencies"
}
],
{ "working-directory": DIR_WEBINY_JS }
Expand All @@ -294,7 +294,7 @@ export const pullRequests = createWorkflow({
...installBuildSteps,
{
name: "Sync Dependencies Verification",
run: "yarn webiny verify-dependencies",
run: "yarn verify-dependencies",
"working-directory": DIR_WEBINY_JS
}
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wac/push.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ const createPushWorkflow = (branchName: string) => {
...installBuildSteps,
{
name: "Sync Dependencies Verification",
run: "yarn webiny verify-dependencies",
run: "yarn verify-dependencies",
"working-directory": DIR_WEBINY_JS
}
]
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@
"url": "https://github.com/webiny/webiny-js.git"
},
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/code-frame": "^7.26.2",
"@babel/compat-data": "7.26.5",
"@babel/core": "7.26.7",
"@babel/helper-define-polyfill-provider": "^0.6.3",
"@babel/cli": "7.27.2",
"@babel/code-frame": "7.27.1",
"@babel/compat-data": "7.27.2",
"@babel/core": "7.27.1",
"@babel/helper-define-polyfill-provider": "0.6.4",
"@babel/helper-environment-visitor": "^7.24.7",
"@babel/parser": "7.26.7",
"@babel/parser": "7.27.2",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-throw-expressions": "^7.25.9",
"@babel/plugin-proposal-throw-expressions": "7.27.1",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "7.26.7",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/register": "^7.25.9",
"@babel/runtime": "7.26.10",
"@babel/template": "^7.25.9",
"@babel/traverse": "7.26.7",
"@babel/types": "7.26.7",
"@babel/plugin-transform-modules-commonjs": "7.27.1",
"@babel/plugin-transform-runtime": "7.27.1",
"@babel/preset-env": "7.27.2",
"@babel/preset-react": "7.27.1",
"@babel/preset-typescript": "7.27.1",
"@babel/register": "7.27.1",
"@babel/runtime": "7.27.1",
"@babel/template": "7.27.2",
"@babel/traverse": "7.27.1",
"@babel/types": "7.27.1",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@grpc/grpc-js": "^1.11.1",
Expand Down Expand Up @@ -77,7 +77,7 @@
"adio": "^1.0.1",
"axios": "^1.7.9",
"babel-jest": "29.7.0",
"babel-loader": "^9.2.1",
"babel-loader": "9.2.1",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-macros": "3.1.0",
"babel-plugin-module-resolver": "^5.0.2",
Expand Down Expand Up @@ -191,7 +191,8 @@
"verdaccio:start": "yarn verdaccio -c ./.verdaccio.yaml",
"verdaccio:start:detached": "yarn pm2 start \"yarn verdaccio:start\"",
"webiny": "./node_modules/.bin/webiny",
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn webiny verify-dependencies",
"verify-depdendencies": "yarn webiny verify-dependencies --allowed-duplicates=downshift",
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn verify-dependencies",
"system:build": "yarn && yarn ghawac build && yarn webiny sync-dependencies && yarn build",
"wby": "./node_modules/.bin/wby",
"webiny-ui-build-storybook": "cd packages/ui && cross-env OUT=../../netlify-static yarn build-storybook"
Expand All @@ -208,7 +209,7 @@
"eslint --max-warnings=0 --no-ignore"
],
"**/package.json": [
"yarn webiny verify-dependencies"
"yarn verify-dependencies"
]
},
"yargs": {
Expand Down Expand Up @@ -246,7 +247,6 @@
]
},
"resolutions": {
"@babel/runtime": "7.26.10",
"systeminformation": "^5.23.18",
"@emotion/react": "11.10.8",
"@octokit/rest": "^20.0.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/api-headless-cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
],
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.26.2",
"@graphql-tools/merge": "^9.0.4",
"@graphql-tools/schema": "^10.0.6",
"@babel/code-frame": "7.27.1",
"@graphql-tools/merge": "9.0.24",
"@graphql-tools/schema": "10.0.23",
"@webiny/api": "0.0.0",
"@webiny/api-i18n": "0.0.0",
"@webiny/api-security": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-plugin-dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"description": "A tool to generate and verify dependency sync files for Webiny.",
"dependencies": {
"@babel/runtime": "7.26.10",
"@babel/runtime": "7.27.1",
"@webiny/cli": "0.0.0",
"chalk": "^4.1.2",
"get-yarn-workspaces": "^1.0.2",
Expand Down
37 changes: 29 additions & 8 deletions packages/cli-plugin-dependencies/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import { CliCommandPlugin, CliCommandPluginArgs } from "@webiny/cli/types";
import { CliCommandPlugin, CliCommandPluginArgs, type Yargs } from "@webiny/cli/types";
import { createDependencyTree } from "./references";
import { createReferenceFile } from "./references/createReferenceFile";
import { verifyDependencies } from "./references/verifyDependencies";
Expand Down Expand Up @@ -28,10 +28,28 @@ const createReferenceFileCommandExecutor = ({ context }: Pick<CliCommandPluginAr
};
};

interface IVerifyDependenciesFileCommandExecutorParams {
allowedDuplicates?: string;
["allowed-duplicates"]?: string;
}

const getAllowedDuplicates = (params: IVerifyDependenciesFileCommandExecutorParams): string[] => {
const allowedDuplicates = params.allowedDuplicates || params["allowed-duplicates"];
if (!allowedDuplicates || typeof allowedDuplicates !== "string") {
return [];
}
return allowedDuplicates
.split(",")
.map(item => item.trim())
.filter(Boolean);
};

const verifyDependenciesFileCommandExecutor = ({
context
}: Pick<CliCommandPluginArgs, "context">) => {
return async () => {
return async (input: unknown) => {
const params = input as IVerifyDependenciesFileCommandExecutorParams;

const dirname = getDirname();
const tree = createDependencyTree({
context,
Expand All @@ -40,7 +58,8 @@ const verifyDependenciesFileCommandExecutor = ({

verifyDependencies({
tree,
dirname
dirname,
allowedDuplicates: getAllowedDuplicates(params)
});
};
};
Expand All @@ -54,9 +73,7 @@ export default (): CliCommandPlugin[] => {
yargs.command(
"sync-dependencies",
"Sync dependencies for all packages.",
(yargs: Record<string, any>) => {
yargs.example("$0 sync-dependencies");
},
() => {},
createReferenceFileCommandExecutor({ context })
);
}
Expand All @@ -68,8 +85,12 @@ export default (): CliCommandPlugin[] => {
yargs.command(
"verify-dependencies",
"Verify dependencies for all packages.",
(yargs: Record<string, any>) => {
yargs.example("$0 verify-dependencies");
(yargs: Yargs) => {
yargs.option("max-duplicates", {
describe: `Max allowed duplicates in the dependency tree. If there are more than this number, the command will fail.`,
type: "number",
required: false
});
},
verifyDependenciesFileCommandExecutor({ context })
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { green } from "chalk";
export interface IVerifyDependenciesParams {
tree: IDependencyTree;
dirname: string;
allowedDuplicates: string[];
}

export const verifyDependencies = (params: IVerifyDependenciesParams): void => {
const { tree, dirname } = params;
const { tree, dirname, allowedDuplicates } = params;

const referencesFile = getReferencesFilePath({
dirname
Expand Down Expand Up @@ -51,6 +52,14 @@ export const verifyDependencies = (params: IVerifyDependenciesParams): void => {
"Duplicates are not in sync. Please run `yarn webiny sync-dependencies` command."
);
}
for (const duplicate of tree.duplicates) {
if (allowedDuplicates.includes(duplicate.name)) {
continue;
}
throw new Error(
`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.`
);
}
} else {
throw new Error(
"Duplicates file does not exist. Please run `yarn webiny sync-dependencies` command."
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-plugin-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"description": "A tool to bootstrap a Webiny project.",
"dependencies": {
"@babel/runtime": "7.26.10",
"@babel/runtime": "7.27.1",
"@webiny/aws-sdk": "0.0.0",
"@webiny/cli": "0.0.0",
"@webiny/cli-plugin-scaffold": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"react": "18.2.0"
},
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.7",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.1",
"@babel/preset-react": "^7.27.1",
"@babel/preset-typescript": "^7.27.1",
"@types/react": "18.2.79",
"@webiny/cli": "^5.0.0",
"@webiny/project-utils": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/files/duplicates.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"@babel/runtime","versions":[{"version":"7.26.10","files":[{"file":"/package.json","types":["devDependencies","resolutions"]},{"file":"/packages/cli-plugin-dependencies/package.json","types":["dependencies"]},{"file":"/packages/cli-plugin-extensions/package.json","types":["dependencies"]}]},{"version":"7.26.7","files":[{"file":"/packages/project-utils/package.json","types":["dependencies"]}]}]},{"name":"downshift","versions":[{"version":"3.1.2","files":[{"file":"/packages/app-admin/package.json","types":["dependencies"]}]},{"version":"2.1.5","files":[{"file":"/packages/ui/package.json","types":["dependencies"]}]}]}]
[{"name":"downshift","versions":[{"version":"3.1.2","files":[{"file":"/packages/app-admin/package.json","types":["dependencies"]}]},{"version":"2.1.5","files":[{"file":"/packages/ui/package.json","types":["dependencies"]}]}]}]
2 changes: 1 addition & 1 deletion packages/cli/files/references.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/cli/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,14 @@ export interface CliContext {
};
}

export type Yargs = typeof yargs;
/**
* Arguments for CliPlugin.create
*
* @category Cli
*/
export interface CliCommandPluginArgs {
yargs: typeof yargs;
yargs: Yargs;
context: CliContext;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/cwp-template-aws/template/ddb-es/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"@webiny/serverless-cms-aws": "latest"
},
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.7",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.7",
"@babel/preset-typescript": "^7.26.0",
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"@babel/preset-typescript": "^7.27.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.10",
"@types/react": "18.2.79",
Expand Down
10 changes: 5 additions & 5 deletions packages/cwp-template-aws/template/ddb-os/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"@webiny/serverless-cms-aws": "latest"
},
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.7",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.7",
"@babel/preset-typescript": "^7.26.0",
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"@babel/preset-typescript": "^7.27.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.10",
"@types/react": "18.2.79",
Expand Down
10 changes: 5 additions & 5 deletions packages/cwp-template-aws/template/ddb/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"@webiny/serverless-cms-aws": "latest"
},
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/core": "^7.26.7",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.7",
"@babel/preset-typescript": "^7.26.0",
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.1",
"@babel/plugin-transform-runtime": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"@babel/preset-typescript": "^7.27.1",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.10",
"@types/react": "18.2.79",
Expand Down
2 changes: 1 addition & 1 deletion packages/handler-aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@webiny/handler-client": "0.0.0",
"@webiny/plugins": "0.0.0",
"@webiny/utils": "0.0.0",
"fastify": "4.29.0"
"fastify": "4.29.1"
},
"devDependencies": {
"@webiny/project-utils": "0.0.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/handler-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"Adrian Smijulj <[email protected]>"
],
"dependencies": {
"@graphql-tools/merge": "^9.0.4",
"@graphql-tools/resolvers-composition": "^7.0.1",
"@graphql-tools/schema": "^10.0.6",
"@graphql-tools/utils": "^10.3.1",
"@graphql-tools/merge": "9.0.24",
"@graphql-tools/resolvers-composition": "7.0.18",
"@graphql-tools/schema": "10.0.23",
"@graphql-tools/utils": "10.8.6",
"@webiny/api": "0.0.0",
"@webiny/error": "0.0.0",
"@webiny/handler": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@webiny/handler-client": "0.0.0",
"@webiny/plugins": "0.0.0",
"@webiny/utils": "0.0.0",
"fastify": "4.29.0"
"fastify": "4.29.1"
},
"devDependencies": {
"@webiny/project-utils": "0.0.0",
Expand Down
Loading
Loading