Clean up CLI module dependencies and revert incorrect require() changes

Align dependency versions in CLI modules to match the original CLI
package versions. Move dependencies that are only used by modules out
of the main CLI package, and add missing dependencies to the modules
that actually use them. Revert import-to-require conversions in
cli-module-build that were incorrectly introduced during the split.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-15 12:40:25 +01:00
parent ff593fa8fa
commit 9937a8aa8e
9 changed files with 73 additions and 445 deletions
+3
View File
@@ -49,5 +49,8 @@
"@types/fs-extra": "^11.0.0",
"@types/proper-lockfile": "^4"
},
"optionalDependencies": {
"keytar": "^7.9.0"
},
"bin": "bin/cli-module-auth"
}
+17 -8
View File
@@ -40,7 +40,7 @@
"@backstage/module-federation-common": "workspace:^",
"@manypkg/get-packages": "^1.1.3",
"@module-federation/enhanced": "^0.21.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
"@rollup/plugin-commonjs": "^26.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
@@ -49,37 +49,46 @@
"@rspack/dev-server": "^1.1.4",
"@rspack/plugin-react-refresh": "^1.4.3",
"bfj": "^9.0.2",
"buffer": "^6.0.3",
"chalk": "^4.0.0",
"chokidar": "^3.5.3",
"chokidar": "^3.3.1",
"cleye": "^2.3.0",
"cross-spawn": "^7.0.6",
"cross-spawn": "^7.0.3",
"css-loader": "^6.5.1",
"ctrlc-windows": "^2.1.0",
"esbuild-loader": "^4.4.2",
"esbuild-loader": "^4.0.0",
"eslint-rspack-plugin": "^4.2.1",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"fs-extra": "^11.2.0",
"glob": "^7.1.7",
"html-webpack-plugin": "^5.6.3",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.10.1",
"mini-css-extract-plugin": "^2.4.2",
"node-stdlib-browser": "^1.3.1",
"npm-packlist": "^5.0.0",
"p-queue": "^6.6.2",
"postcss": "^8.1.0",
"postcss-import": "^16.1.0",
"process": "^0.11.10",
"raw-loader": "^4.0.2",
"react-dev-utils": "^12.0.0-next.60",
"react-refresh": "^0.18.0",
"rollup": "^4.27.3",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-postcss": "^4.0.0",
"rollup-pluginutils": "^2.8.2",
"shell-quote": "^1.8.1",
"style-loader": "^3.3.1",
"swc-loader": "^0.2.3",
"tar": "^7.5.6",
"ts-checker-rspack-plugin": "^1.1.5",
"ts-morph": "^24.0.0",
"webpack": "^5.105.4",
"webpack-dev-server": "^5.2.3",
"util": "^0.12.3",
"webpack": "~5.105.0",
"webpack-dev-server": "^5.0.0",
"yml-loader": "^2.1.0",
"yn": "^4.0.0"
},
"devDependencies": {
@@ -32,9 +32,7 @@ import pickBy from 'lodash/pickBy';
import { runOutput, targetPaths } from '@backstage/cli-common';
import { transforms } from './transforms';
const { version } = require('../../../package.json') as { version: string };
import { version } from '../../../package.json';
import yn from 'yn';
import { hasReactDomClient } from './hasReactDomClient';
import { createWorkspaceLinkingPlugins } from './linkWorkspaces';
@@ -26,13 +26,10 @@ import * as tar from 'tar';
import partition from 'lodash/partition';
import { run, targetPaths } from '@backstage/cli-common';
const { dependencies: cliDependencies, devDependencies: cliDevDependencies } =
require('../../../package.json') as {
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
};
import {
dependencies as cliDependencies,
devDependencies as cliDevDependencies,
} from '../../../package.json';
import {
BuildOptions,
buildPackages,
+2 -1
View File
@@ -37,8 +37,9 @@
"chalk": "^4.0.0",
"cleye": "^2.3.0",
"eslint": "^8.6.0",
"eslint-formatter-friendly": "^7.0.0",
"fs-extra": "^11.2.0",
"globby": "^11.0.0",
"globby": "^11.1.0",
"shell-quote": "^1.8.1"
},
"devDependencies": {
+2 -2
View File
@@ -54,9 +54,9 @@
"@backstage/core-plugin-api": "workspace:^",
"@backstage/test-utils": "workspace:^",
"@types/fs-extra": "^11.0.0",
"@types/inquirer": "^8",
"@types/inquirer": "^8.1.3",
"@types/lodash": "^4.14.151",
"@types/recursive-readdir": "^2.2.4"
"@types/recursive-readdir": "^2.2.0"
},
"bin": "bin/cli-module-new"
}
+1 -1
View File
@@ -35,7 +35,7 @@
"@backstage/cli-common": "workspace:^",
"@backstage/cli-node": "workspace:^",
"cleye": "^2.3.0",
"yargs": "^17.0.0"
"yargs": "^16.2.0"
},
"devDependencies": {
"@backstage/cli": "workspace:^"
+3 -135
View File
@@ -47,7 +47,6 @@
]
},
"dependencies": {
"@backstage/catalog-model": "workspace:^",
"@backstage/cli-common": "workspace:^",
"@backstage/cli-module-auth": "workspace:^",
"@backstage/cli-module-build": "workspace:^",
@@ -61,47 +60,21 @@
"@backstage/cli-module-test-jest": "workspace:^",
"@backstage/cli-module-translations": "workspace:^",
"@backstage/cli-node": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/config-loader": "workspace:^",
"@backstage/errors": "workspace:^",
"@backstage/eslint-plugin": "workspace:^",
"@backstage/integration": "workspace:^",
"@backstage/module-federation-common": "workspace:^",
"@backstage/release-manifests": "workspace:^",
"@backstage/types": "workspace:^",
"@manypkg/get-packages": "^1.1.3",
"@module-federation/enhanced": "^0.21.6",
"@octokit/request": "^8.0.0",
"@rollup/plugin-commonjs": "^26.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-yaml": "^4.0.0",
"@rspack/core": "^1.4.11",
"@rspack/dev-server": "^1.1.4",
"@rspack/plugin-react-refresh": "^1.4.3",
"@spotify/eslint-config-base": "^15.0.0",
"@spotify/eslint-config-react": "^15.0.0",
"@spotify/eslint-config-typescript": "^15.0.0",
"@swc/core": "^1.15.6",
"@swc/helpers": "^0.5.17",
"@swc/jest": "^0.2.39",
"@types/webpack-env": "^1.15.2",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.16.0",
"bfj": "^9.0.2",
"buffer": "^6.0.3",
"chalk": "^4.0.0",
"chokidar": "^3.3.1",
"cleye": "^2.3.0",
"commander": "^14.0.3",
"cross-fetch": "^4.0.0",
"cross-spawn": "^7.0.3",
"css-loader": "^6.5.1",
"ctrlc-windows": "^2.1.0",
"esbuild": "^0.27.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^9.0.0",
"eslint-formatter-friendly": "^7.0.0",
"eslint-plugin-deprecation": "^3.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
@@ -109,55 +82,13 @@
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-unused-imports": "^4.1.4",
"eslint-rspack-plugin": "^4.2.1",
"express": "^4.22.0",
"fs-extra": "^11.2.0",
"git-url-parse": "^15.0.0",
"glob": "^7.1.7",
"global-agent": "^3.0.0",
"globby": "^11.1.0",
"handlebars": "^4.7.3",
"html-webpack-plugin": "^5.6.3",
"inquirer": "^8.2.0",
"jest-css-modules": "^2.1.0",
"json-schema": "^0.4.0",
"lodash": "^4.17.21",
"minimatch": "^10.2.1",
"node-stdlib-browser": "^1.3.1",
"npm-packlist": "^5.0.0",
"ora": "^5.3.0",
"p-queue": "^6.6.2",
"pirates": "^4.0.6",
"postcss": "^8.1.0",
"postcss-import": "^16.1.0",
"process": "^0.11.10",
"proper-lockfile": "^4.1.2",
"raw-loader": "^4.0.2",
"react-dev-utils": "^12.0.0-next.60",
"react-refresh": "^0.18.0",
"recursive-readdir": "^2.2.2",
"replace-in-file": "^7.1.0",
"rollup": "^4.27.3",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-postcss": "^4.0.0",
"rollup-pluginutils": "^2.8.2",
"semver": "^7.5.3",
"shell-quote": "^1.8.1",
"style-loader": "^3.3.1",
"sucrase": "^3.20.2",
"swc-loader": "^0.2.3",
"tar": "^7.5.6",
"ts-checker-rspack-plugin": "^1.1.5",
"ts-morph": "^24.0.0",
"undici": "^7.2.3",
"util": "^0.12.3",
"yaml": "^2.0.0",
"yargs": "^16.2.0",
"yml-loader": "^2.1.0",
"yn": "^4.0.0",
"zod": "^3.25.76",
"zod-validation-error": "^4.0.2"
"yaml": "^2.0.0"
},
"devDependencies": {
"@backstage/backend-plugin-api": "workspace:^",
@@ -177,91 +108,28 @@
"@backstage/test-utils": "workspace:^",
"@backstage/theme": "workspace:^",
"@jest/environment-jsdom-abstract": "^30.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
"@types/cross-spawn": "^6.0.2",
"@types/ejs": "^3.1.3",
"@types/express": "^4.17.6",
"@types/fs-extra": "^11.0.0",
"@types/http-proxy": "^1.17.4",
"@types/inquirer": "^8.1.3",
"@types/jest": "^30.0.0",
"@types/node": "^22.13.14",
"@types/npm-packlist": "^3.0.0",
"@types/proper-lockfile": "^4",
"@types/recursive-readdir": "^2.2.0",
"@types/rollup-plugin-peer-deps-external": "^2.2.0",
"@types/rollup-plugin-postcss": "^3.1.4",
"@types/shell-quote": "^1.7.5",
"@types/svgo": "^2.6.2",
"@types/terser-webpack-plugin": "^5.0.4",
"@types/webpack-sources": "^3.2.3",
"del": "^8.0.0",
"esbuild-loader": "^4.0.0",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"jest": "^30.2.0",
"jsdom": "^27.1.0",
"mini-css-extract-plugin": "^2.4.2",
"msw": "^1.0.0",
"nodemon": "^3.0.1",
"terser-webpack-plugin": "^5.1.3",
"webpack": "~5.105.0",
"webpack-dev-server": "^5.0.0"
},
"optionalDependencies": {
"keytar": "^7.9.0"
"nodemon": "^3.0.1"
},
"peerDependencies": {
"@jest/environment-jsdom-abstract": "^30.0.0",
"@module-federation/enhanced": "^0.21.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
"esbuild-loader": "^4.0.0",
"eslint-webpack-plugin": "^4.2.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"jest": "^29.0.0 || ^30.0.0",
"jest-environment-jsdom": "*",
"jsdom": "^27.1.0",
"mini-css-extract-plugin": "^2.4.2",
"terser-webpack-plugin": "^5.1.3",
"webpack": "~5.105.0",
"webpack-dev-server": "^5.0.0"
"jsdom": "^27.1.0"
},
"peerDependenciesMeta": {
"@jest/environment-jsdom-abstract": {
"optional": true
},
"@module-federation/enhanced": {
"optional": true
},
"@pmmmwh/react-refresh-webpack-plugin": {
"optional": true
},
"esbuild-loader": {
"optional": true
},
"eslint-webpack-plugin": {
"optional": true
},
"fork-ts-checker-webpack-plugin": {
"optional": true
},
"jest-environment-jsdom": {
"optional": true
},
"jsdom": {
"optional": true
},
"mini-css-extract-plugin": {
"optional": true
},
"terser-webpack-plugin": {
"optional": true
},
"webpack": {
"optional": true
},
"webpack-dev-server": {
"optional": true
}
},
"configSchema": {