diff --git a/.changeset/four-donkeys-smoke.md b/.changeset/four-donkeys-smoke.md new file mode 100644 index 000000000000..f1d3371c6e0f --- /dev/null +++ b/.changeset/four-donkeys-smoke.md @@ -0,0 +1,31 @@ +--- +'@modern-js/storybook-next-generator': minor +'@modern-js/tailwindcss-generator': minor +'@modern-js/dependence-generator': minor +'@modern-js/module-doc-generator': minor +'@modern-js/changeset-generator': minor +'@modern-js/generator-generator': minor +'@modern-js/router-v5-generator': minor +'@modern-js/packages-generator': minor +'@modern-js/upgrade-generator': minor +'@modern-js/module-generator': minor +'@modern-js/server-generator': minor +'@modern-js/entry-generator': minor +'@modern-js/base-generator': minor +'@modern-js/repo-generator': minor +'@modern-js/bff-generator': minor +'@modern-js/mwa-generator': minor +'@modern-js/ssg-generator': minor +'@modern-js/generator-plugin-plugin': minor +'@modern-js/generator-common': minor +'@modern-js/generator-plugin': minor +'@modern-js/generator-utils': minor +'@modern-js/sandpack-react': patch +'@modern-js/new-action': patch +'@modern-js/plugin-i18n': patch +'@modern-js/create': patch +--- + +feat: optimize generator download + +feat: 优化生成器下载 diff --git a/biome.json b/biome.json index 0a59d6bbff72..9344c68d0a2e 100644 --- a/biome.json +++ b/biome.json @@ -96,6 +96,8 @@ "node_modules/**/*", "dist/**/*", "dist-1/**/*", + "dist-2/**/*", + "dist-swc/**/*", "output/**/*", ".output/**/*", ".netlify/**/*", diff --git a/packages/generator/generator-common/package.json b/packages/generator/generator-common/package.json index 9d54f3a71fc8..42db474f2840 100644 --- a/packages/generator/generator-common/package.json +++ b/packages/generator/generator-common/package.json @@ -37,14 +37,14 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@modern-js/codesmith-formily": "2.5.2", + "@modern-js/codesmith-formily": "2.6.3", "@modern-js/plugin-i18n": "workspace:*", "@swc/helpers": "0.5.13" }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/utils": "workspace:*", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", diff --git a/packages/generator/generator-common/tests/packageManager.test.ts b/packages/generator/generator-common/tests/packageManager.test.ts index 4e93aa9087b8..3f7776b195d8 100644 --- a/packages/generator/generator-common/tests/packageManager.test.ts +++ b/packages/generator/generator-common/tests/packageManager.test.ts @@ -7,7 +7,7 @@ import { MaterialsManager, } from '@modern-js/codesmith'; import { AppAPI } from '@modern-js/codesmith-api-app'; -import { fs } from '@modern-js/utils'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; import { getPackageManagerSchema } from '../src/common/packageManager'; describe('test package manager schema', () => { diff --git a/packages/generator/generator-plugin/package.json b/packages/generator/generator-plugin/package.json index 0efff217d981..7b34238434db 100644 --- a/packages/generator/generator-plugin/package.json +++ b/packages/generator/generator-plugin/package.json @@ -18,19 +18,21 @@ "test": "jest" }, "dependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-git": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", - "@modern-js/codesmith-api-npm": "2.5.2", - "@modern-js/codesmith-formily": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-git": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", + "@modern-js/codesmith-api-npm": "2.6.3", + "@modern-js/codesmith-formily": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/new-action": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", - "@modern-js/utils": "workspace:*", "@swc/helpers": "0.5.13", "ejs": "^3.1.9", - "handlebars": "^4.7.7" + "globby": "11.1.0", + "handlebars": "^4.7.7", + "json5": "2.2.3" }, "devDependencies": { "@scripts/build": "workspace:*", diff --git a/packages/generator/generator-plugin/src/context/input.ts b/packages/generator/generator-plugin/src/context/input.ts index b539f8658ce6..511bc17e8dba 100644 --- a/packages/generator/generator-plugin/src/context/input.ts +++ b/packages/generator/generator-plugin/src/context/input.ts @@ -1,5 +1,5 @@ import type { Schema } from '@modern-js/codesmith-formily'; -import { isFunction } from '@modern-js/utils/lodash'; +import { isFunction } from '@modern-js/codesmith-utils/lodash'; export type { Schema }; export class PluginInputContext { @@ -97,7 +97,7 @@ export class PluginInputContext { const schema = this.solutionSchema[key]; if (schema) { (schema as Record)[field] = isFunction(value) - ? value(schema) + ? (value as (input: Schema) => unknown)(schema) : value; return; } @@ -107,7 +107,7 @@ export class PluginInputContext { if (beforeSchema) { findFlag = true; (beforeSchema as Record)[field] = isFunction(value) - ? value(schema) + ? (value as (input: Schema) => unknown)(schema) : value; break; } @@ -115,7 +115,7 @@ export class PluginInputContext { if (afterSchema) { findFlag = true; (afterSchema as Record)[field] = isFunction(value) - ? value(schema) + ? (value as (input: Schema) => unknown)(schema) : value; break; } diff --git a/packages/generator/generator-plugin/src/index.ts b/packages/generator/generator-plugin/src/index.ts index 28b69739fa57..c2e706e6c090 100644 --- a/packages/generator/generator-plugin/src/index.ts +++ b/packages/generator/generator-plugin/src/index.ts @@ -6,13 +6,14 @@ import { getPackageInfo, } from '@modern-js/codesmith'; import type { Schema } from '@modern-js/codesmith-formily'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import { isFunction, merge } from '@modern-js/codesmith-utils/lodash'; import { type Solution, SolutionSchemas, i18n as commonI18n, } from '@modern-js/generator-common'; -import { fs, i18n as utilsI18n } from '@modern-js/generator-utils'; -import { isFunction, merge } from '@modern-js/utils/lodash'; +import { i18n as utilsI18n } from '@modern-js/generator-utils'; import type { ICustomInfo } from './common'; import { LifeCycle, diff --git a/packages/generator/generator-plugin/src/utils/file.ts b/packages/generator/generator-plugin/src/utils/file.ts index 898b12b563fe..b0372dc2ef78 100644 --- a/packages/generator/generator-plugin/src/utils/file.ts +++ b/packages/generator/generator-plugin/src/utils/file.ts @@ -1,6 +1,6 @@ import path from 'path'; import { fs } from '@modern-js/generator-utils'; -import { globby } from '@modern-js/utils'; +import globby from 'globby'; export enum FileType { Text = 'text', diff --git a/packages/generator/generator-plugin/src/utils/module.ts b/packages/generator/generator-plugin/src/utils/module.ts index 2c8012eaaec6..097d6d0af97a 100644 --- a/packages/generator/generator-plugin/src/utils/module.ts +++ b/packages/generator/generator-plugin/src/utils/module.ts @@ -1,4 +1,4 @@ -import { get } from '@modern-js/utils/lodash'; +import { get } from '@modern-js/codesmith-utils/lodash'; export function requireModule(modulePath: string) { const module = require(modulePath); diff --git a/packages/generator/generator-plugin/tests/input.test.ts b/packages/generator/generator-plugin/tests/input.test.ts index e6869e4cc3b5..23d8032a265e 100644 --- a/packages/generator/generator-plugin/tests/input.test.ts +++ b/packages/generator/generator-plugin/tests/input.test.ts @@ -1,4 +1,4 @@ -import { isObject } from '@modern-js/utils/lodash'; +import { isObject } from '@modern-js/codesmith-utils'; import { PluginInputContext, type Schema } from '../src/context/input'; describe('PluginInputContext Test', () => { diff --git a/packages/generator/generator-utils/package.json b/packages/generator/generator-utils/package.json index 34397f4d3b82..1388e78dcd8a 100644 --- a/packages/generator/generator-utils/package.json +++ b/packages/generator/generator-utils/package.json @@ -38,14 +38,19 @@ "dependencies": { "@modern-js/generator-common": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", - "@modern-js/utils": "workspace:*", + "@modern-js/codesmith-utils": "2.6.3", + "glob": "7.2.0", + "js-yaml": "4.1.0", + "json5": "2.2.3", "@swc/helpers": "0.5.13" }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", + "@modern-js/codesmith": "2.6.3", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", + "@types/glob": "7.2.0", + "@types/js-yaml": "4.0.9", "@types/node": "^14", "jest": "^29", "typescript": "^5" diff --git a/packages/generator/generator-utils/src/index.ts b/packages/generator/generator-utils/src/index.ts index 759486ee9e82..a07fb60a838b 100644 --- a/packages/generator/generator-utils/src/index.ts +++ b/packages/generator/generator-utils/src/index.ts @@ -1,65 +1,44 @@ import path from 'path'; import type { GeneratorContext } from '@modern-js/codesmith'; +import { getNpmVersion, getPackageInfo } from '@modern-js/codesmith'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import { ora } from '@modern-js/codesmith-utils/ora'; import { Solution, SolutionToolsMap } from '@modern-js/generator-common'; -import { - fs, - canUseNpm, - canUsePnpm, - execa, - getMonorepoPackages, - ora, -} from '@modern-js/utils'; import { i18n, localeKeys } from './locale'; import { fileExist } from './utils/fsExist'; +import { getMonorepoPackages } from './utils/monorepo'; import { getAvailableVersion, isPackageExist } from './utils/package'; -import { stripAnsi } from './utils/stripAnsi'; export * from './utils'; export { - ora, - fs, - semver, - execa, - chalk, - readTsConfigByFile, - getPackageManager, canUseNpm, canUsePnpm, canUseYarn, - isReact18, -} from '@modern-js/utils'; +} from '@modern-js/codesmith-utils/npm'; +export { fs } from '@modern-js/codesmith-utils/fs-extra'; +export { ora } from '@modern-js/codesmith-utils/ora'; +export { semver } from '@modern-js/codesmith-utils/semver'; +export { execa } from '@modern-js/codesmith-utils/execa'; +export { chalk } from '@modern-js/codesmith-utils/chalk'; export { i18n } from './locale'; export async function getPackageVersion( packageName: string, - registry?: string, -) { + registryUrl?: string, +): Promise { const spinner = ora({ text: 'Load Generator...', spinner: 'runner', }).start(); - if (await canUsePnpm()) { - const args = ['info', packageName, 'version']; - if (registry) { - args.push(`--registry=${registry}`); - } - const result = await execa('pnpm', args); - spinner.stop(); - return stripAnsi(result.stdout); - } - if (await canUseNpm()) { - const args = ['view', packageName, 'version']; - if (registry) { - args.push(`--registry=${registry}`); - } - const result = await execa('npm', args); - spinner.stop(); - return stripAnsi(result.stdout); - } + const { name, version: pkgVersion } = getPackageInfo(packageName); + const version = await getNpmVersion(name, { + version: pkgVersion, + registryUrl, + }); spinner.stop(); - throw new Error('not found npm, please install npm before'); + return version; } export async function getModernVersion( diff --git a/packages/generator/generator-utils/src/utils/fsExist.ts b/packages/generator/generator-utils/src/utils/fsExist.ts index c5e3c72b5ca7..bc95f0183953 100644 --- a/packages/generator/generator-utils/src/utils/fsExist.ts +++ b/packages/generator/generator-utils/src/utils/fsExist.ts @@ -1,4 +1,4 @@ -import { fs } from '@modern-js/utils'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; export async function fileExist(filePath: string) { try { diff --git a/packages/generator/generator-utils/src/utils/get.ts b/packages/generator/generator-utils/src/utils/get.ts new file mode 100644 index 000000000000..26f61fe77b90 --- /dev/null +++ b/packages/generator/generator-utils/src/utils/get.ts @@ -0,0 +1,12 @@ +import path from 'path'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import json5 from 'json5'; + +export const readTsConfig = (root: string) => { + return readTsConfigByFile(path.resolve(root, './tsconfig.json')); +}; + +export const readTsConfigByFile = (filename: string) => { + const content = fs.readFileSync(path.resolve(filename), 'utf-8'); + return json5.parse(content); +}; diff --git a/packages/generator/generator-utils/src/utils/index.ts b/packages/generator/generator-utils/src/utils/index.ts index b61f5db24582..7902dcd6bb91 100644 --- a/packages/generator/generator-utils/src/utils/index.ts +++ b/packages/generator/generator-utils/src/utils/index.ts @@ -1,3 +1,5 @@ export * from './stripAnsi'; export * from './package'; -export { getGeneratorPath } from './getGeneratorPath'; +export * from './getGeneratorPath'; +export * from './get'; +export * from './is'; diff --git a/packages/generator/generator-utils/src/utils/is.ts b/packages/generator/generator-utils/src/utils/is.ts new file mode 100644 index 000000000000..72a9f83a4d55 --- /dev/null +++ b/packages/generator/generator-utils/src/utils/is.ts @@ -0,0 +1,23 @@ +import path from 'path'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import { semver } from '@modern-js/codesmith-utils/semver'; + +export const isReact18 = (cwd: string = process.cwd()) => { + const pkgPath = path.join(cwd, 'package.json'); + + if (!fs.existsSync(pkgPath)) { + return false; + } + + const pkgInfo = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); + const deps = { + ...pkgInfo.devDependencies, + ...pkgInfo.dependencies, + }; + + if (typeof deps.react !== 'string') { + return false; + } + + return semver.satisfies(semver.minVersion(deps.react)!, '>=18.0.0'); +}; diff --git a/packages/generator/generator-utils/src/utils/monorepo.ts b/packages/generator/generator-utils/src/utils/monorepo.ts new file mode 100644 index 000000000000..7176e91e12a4 --- /dev/null +++ b/packages/generator/generator-utils/src/utils/monorepo.ts @@ -0,0 +1,97 @@ +import fs from 'fs'; +import path from 'path'; +import glob from 'glob'; +import yaml from 'js-yaml'; + +const PACKAGE_MAX_DEPTH = 5; + +const WORKSPACE_FILES = { + YARN: 'package.json', + PNPM: 'pnpm-workspace.yaml', + LERNA: 'lerna.json', +}; + +export const isLerna = (root: string) => + fs.existsSync(path.join(root, WORKSPACE_FILES.LERNA)); + +export const isYarnWorkspaces = (root: string) => { + const pkg = path.join(root, WORKSPACE_FILES.YARN); + + if (!fs.existsSync(pkg)) { + return false; + } + + const json = JSON.parse(fs.readFileSync(pkg, 'utf8')); + + return Boolean(json.workspaces?.packages); +}; + +export const isPnpmWorkspaces = (root: string) => + fs.existsSync(path.join(root, WORKSPACE_FILES.PNPM)); + +export const isMonorepo = (root: string) => + isLerna(root) || isYarnWorkspaces(root) || isPnpmWorkspaces(root); + +export const findMonorepoRoot = ( + appDirectory: string, + maxDepth: number = PACKAGE_MAX_DEPTH, +) => { + let inMonorepo = false; + let monorepoRoot = appDirectory; + + for (let depth = 0; depth < maxDepth; depth++) { + if (isMonorepo(appDirectory)) { + inMonorepo = true; + break; + } + monorepoRoot = path.dirname(appDirectory); + } + + return inMonorepo ? monorepoRoot : undefined; +}; + +export const getMonorepoPackages = ( + root: string, +): { name: string; path: string }[] => { + let packages: string[] = []; + + if (isYarnWorkspaces(root)) { + const json = JSON.parse( + fs.readFileSync(path.join(root, 'package.json'), 'utf8'), + ); + ({ packages } = json.workspaces); + } else if (isLerna(root)) { + const json = JSON.parse( + fs.readFileSync(path.resolve(root, 'lerna.json'), 'utf8'), + ); + ({ packages } = json); + } else { + ({ packages } = yaml.load( + fs.readFileSync(path.join(root, WORKSPACE_FILES.PNPM), 'utf8'), + ) as { + packages: string[]; + }); + } + + if (packages) { + return packages + .map(name => + // The trailing / ensures only dirs are picked up + glob.sync(path.join(root, `${name}/`), { + ignore: ['**/node_modules/**'], + }), + ) + .reduce((acc, val) => acc.concat(val), []) + .filter((filepath: string) => + fs.existsSync(path.resolve(filepath, 'package.json')), + ) + .map((filepath: string) => ({ + path: filepath, + name: JSON.parse( + fs.readFileSync(path.resolve(filepath, 'package.json'), 'utf8'), + ).name, + })); + } + + return []; +}; diff --git a/packages/generator/generator-utils/src/utils/package.ts b/packages/generator/generator-utils/src/utils/package.ts index f9cdc5893831..b6a7e9d3d84a 100644 --- a/packages/generator/generator-utils/src/utils/package.ts +++ b/packages/generator/generator-utils/src/utils/package.ts @@ -1,4 +1,14 @@ -import { canUseNpm, execa, logger, semver, stripAnsi } from '@modern-js/utils'; +import os from 'os'; +import path from 'path'; +import { execa } from '@modern-js/codesmith-utils/execa'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import { + canUseNpm, + canUsePnpm, + canUseYarn, +} from '@modern-js/codesmith-utils/npm'; +import { semver } from '@modern-js/codesmith-utils/semver'; +import { stripAnsi } from './stripAnsi'; // 判断包是否存在 export async function isPackageExist(packageName: string, registry?: string) { @@ -47,7 +57,7 @@ export function semverDecrease(version: string) { const result = versionObj.format(); if (!semver.valid(result)) { - logger.debug(`Version ${result} is not valid semver`); + console.error(`Version ${result} is not valid semver`); return version; } return result; @@ -90,3 +100,29 @@ export async function getAvailableVersion( } return currentVersion; } + +const MAX_TIMES = 5; +export async function getPackageManager(cwd: string = process.cwd()) { + let appDirectory = cwd; + let times = 0; + while (os.homedir() !== appDirectory && times < MAX_TIMES) { + times++; + if (fs.existsSync(path.resolve(appDirectory, 'pnpm-lock.yaml'))) { + return 'pnpm'; + } + if (fs.existsSync(path.resolve(appDirectory, 'yarn.lock'))) { + return 'yarn'; + } + if (fs.existsSync(path.resolve(appDirectory, 'package-lock.json'))) { + return 'npm'; + } + appDirectory = path.join(appDirectory, '..'); + } + if (await canUsePnpm()) { + return 'pnpm'; + } + if (await canUseYarn()) { + return 'yarn'; + } + return 'npm'; +} diff --git a/packages/generator/generator-utils/tests/stripAnsi.test.ts b/packages/generator/generator-utils/tests/stripAnsi.test.ts index d92c5cee5663..cac6f415b0a3 100644 --- a/packages/generator/generator-utils/tests/stripAnsi.test.ts +++ b/packages/generator/generator-utils/tests/stripAnsi.test.ts @@ -1,4 +1,4 @@ -import { stripAnsi } from '../src'; +import { stripAnsi } from '../src/utils/stripAnsi'; describe('test stripAnsi utils', () => { test('stripAnsi right', () => { diff --git a/packages/generator/generators/base-generator/package.json b/packages/generator/generators/base-generator/package.json index 99f415be536d..7996bbe413dc 100644 --- a/packages/generator/generators/base-generator/package.json +++ b/packages/generator/generators/base-generator/package.json @@ -29,12 +29,10 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@scripts/build": "workspace:*", diff --git a/packages/generator/generators/base-generator/src/index.ts b/packages/generator/generators/base-generator/src/index.ts index 77b58a27f26a..e1fba8224418 100644 --- a/packages/generator/generators/base-generator/src/index.ts +++ b/packages/generator/generators/base-generator/src/index.ts @@ -1,12 +1,10 @@ -import path from 'path'; import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith'; import { AppAPI } from '@modern-js/codesmith-api-app'; import { PackageManager, getBaseSchema } from '@modern-js/generator-common'; -import { fs } from '@modern-js/generator-utils'; const handleTemplateFile = async ( context: GeneratorContext, - generator: GeneratorCore, + _generator: GeneratorCore, appApi: AppAPI, ) => { const { hasPlugin, generatorPlugin, ...extra } = context.config; diff --git a/packages/generator/generators/bff-generator/package.json b/packages/generator/generators/bff-generator/package.json index b7abe850ac2a..4124a7910354 100644 --- a/packages/generator/generators/bff-generator/package.json +++ b/packages/generator/generators/bff-generator/package.json @@ -29,13 +29,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", diff --git a/packages/generator/generators/changeset-generator/package.json b/packages/generator/generators/changeset-generator/package.json index c21805f7f0a3..82345eaea702 100644 --- a/packages/generator/generators/changeset-generator/package.json +++ b/packages/generator/generators/changeset-generator/package.json @@ -28,12 +28,10 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/generator-common": "workspace:*", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", diff --git a/packages/generator/generators/dependence-generator/package.json b/packages/generator/generators/dependence-generator/package.json index e6eb2fe0e275..26b984273d36 100644 --- a/packages/generator/generators/dependence-generator/package.json +++ b/packages/generator/generators/dependence-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", diff --git a/packages/generator/generators/entry-generator/package.json b/packages/generator/generators/entry-generator/package.json index fcd7f2b9edc3..63d4f4664da4 100644 --- a/packages/generator/generators/entry-generator/package.json +++ b/packages/generator/generators/entry-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-handlebars": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-handlebars": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", diff --git a/packages/generator/generators/entry-generator/src/index.ts b/packages/generator/generators/entry-generator/src/index.ts index f1082aa3c005..b56eded58e76 100644 --- a/packages/generator/generators/entry-generator/src/index.ts +++ b/packages/generator/generators/entry-generator/src/index.ts @@ -1,12 +1,12 @@ import path from 'path'; import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith'; import { AppAPI } from '@modern-js/codesmith-api-app'; +import { merge } from '@modern-js/codesmith-utils/lodash'; import { i18n as commonI18n, getEntrySchema, } from '@modern-js/generator-common'; import { fs, getPackageObj, isTsProject } from '@modern-js/generator-utils'; -import { merge } from '@modern-js/utils/lodash'; import { i18n, localeKeys } from './locale'; import { isEmptySource, isSingleEntry } from './utils'; diff --git a/packages/generator/generators/generator-generator/package.json b/packages/generator/generators/generator-generator/package.json index 22ef6cbe1f34..d37656d306da 100644 --- a/packages/generator/generators/generator-generator/package.json +++ b/packages/generator/generators/generator-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/module-generator": "workspace:*", diff --git a/packages/generator/generators/module-doc-generator/package.json b/packages/generator/generators/module-doc-generator/package.json index 72ad1abf7747..7f27dc044c73 100644 --- a/packages/generator/generators/module-doc-generator/package.json +++ b/packages/generator/generators/module-doc-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/module-generator/package.json b/packages/generator/generators/module-generator/package.json index a6223b400538..605c5f3dbace 100644 --- a/packages/generator/generators/module-generator/package.json +++ b/packages/generator/generators/module-generator/package.json @@ -28,14 +28,12 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { + "@modern-js/codesmith-utils": "2.6.3", "@modern-js/base-generator": "workspace:*", "@modern-js/changeset-generator": "workspace:*", - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/module-generator/src/index.ts b/packages/generator/generators/module-generator/src/index.ts index fa63964cbbb2..ccfe8eb3e589 100644 --- a/packages/generator/generators/module-generator/src/index.ts +++ b/packages/generator/generators/module-generator/src/index.ts @@ -28,6 +28,14 @@ export const handleTemplateFile = async ( generator: GeneratorCore, appApi: AppAPI, ) => { + generator.logger?.timing(`🕐 Get Modern.js module-tools version`); + const modernVersion = await getModernVersion( + Solution.MWA, + context.config.registry, + context.config.distTag, + ); + generator.logger?.timing(`🕐 Get Modern.js module-tools version`, true); + const { isMonorepoSubProject, isLocalPackages, @@ -102,14 +110,6 @@ export const handleTemplateFile = async ( ); } - generator.logger?.timing(`🕐 Get Modern.js module-tools version`); - const modernVersion = await getModernVersion( - Solution.Module, - context.config.registry, - context.config.distTag, - ); - generator.logger?.timing(`🕐 Get Modern.js module-tools version`, true); - generator.logger.debug(`💡 [Input Answer]: ${JSON.stringify(ans)}`); const { packageName, packagePath, language, packageManager } = ans; diff --git a/packages/generator/generators/mwa-generator/package.json b/packages/generator/generators/mwa-generator/package.json index 10db5dd762ab..093383aa6a50 100644 --- a/packages/generator/generators/mwa-generator/package.json +++ b/packages/generator/generators/mwa-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { + "@modern-js/codesmith-utils": "2.6.3", "@modern-js/base-generator": "workspace:*", - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/entry-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", diff --git a/packages/generator/generators/mwa-generator/src/index.ts b/packages/generator/generators/mwa-generator/src/index.ts index b0409d449b6e..07320fa48d84 100644 --- a/packages/generator/generators/mwa-generator/src/index.ts +++ b/packages/generator/generators/mwa-generator/src/index.ts @@ -27,6 +27,14 @@ export const handleTemplateFile = async ( generator: GeneratorCore, appApi: AppAPI, ) => { + generator.logger?.timing(`🕐 Get Modern.js app-tools version`); + const modernVersion = await getModernVersion( + Solution.MWA, + context.config.registry, + context.config.distTag, + ); + generator.logger?.timing(`🕐 Get Modern.js app-tools version`, true); + const { isMonorepoSubProject, projectDir = '' } = context.config; const { outputPath } = generator; @@ -98,14 +106,6 @@ export const handleTemplateFile = async ( ); } - generator.logger?.timing(`🕐 Get Modern.js app-tools version`); - const modernVersion = await getModernVersion( - Solution.MWA, - context.config.registry, - context.config.distTag, - ); - generator.logger?.timing(`🕐 Get Modern.js app-tools version`, true); - generator.logger.debug(`💡 [Input Answer]: ${JSON.stringify(ans)}`); const { packageName, packagePath, language, packageManager } = ans; diff --git a/packages/generator/generators/packages-generator/package.json b/packages/generator/generators/packages-generator/package.json index 14c29f88f65c..d4d4d5007b31 100644 --- a/packages/generator/generators/packages-generator/package.json +++ b/packages/generator/generators/packages-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@scripts/build": "workspace:*", diff --git a/packages/generator/generators/repo-generator/modern.config.js b/packages/generator/generators/repo-generator/modern.config.js index 57303a8d8dfa..9b4d1bc9482f 100644 --- a/packages/generator/generators/repo-generator/modern.config.js +++ b/packages/generator/generators/repo-generator/modern.config.js @@ -1,5 +1,7 @@ -const { generatorBuildConfig } = require('@scripts/build'); - module.exports = { - buildConfig: generatorBuildConfig, + buildConfig: { + autoExternal: false, + dts: false, + sideEffects: false, + }, }; diff --git a/packages/generator/generators/repo-generator/package.json b/packages/generator/generators/repo-generator/package.json index dd5b804aad6b..9d550f950b10 100644 --- a/packages/generator/generators/repo-generator/package.json +++ b/packages/generator/generators/repo-generator/package.json @@ -28,23 +28,12 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/base-generator": "workspace:*", - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/generator-common": "workspace:*", - "@modern-js/generator-plugin": "workspace:*", + "@modern-js/codesmith": "2.6.3", "@modern-js/generator-utils": "workspace:*", - "@modern-js/module-generator": "workspace:*", - "@modern-js/mwa-generator": "workspace:*", + "@modern-js/repo-next-generator": "workspace:*", "@scripts/build": "workspace:*", - "@scripts/jest-config": "workspace:*", - "@types/jest": "^29", "@types/node": "^14", - "jest": "^29", "typescript": "^5" }, "sideEffects": false, diff --git a/packages/generator/generators/repo-generator/src/index.ts b/packages/generator/generators/repo-generator/src/index.ts index ae1db0ae3c18..54bd2260e87c 100644 --- a/packages/generator/generators/repo-generator/src/index.ts +++ b/packages/generator/generators/repo-generator/src/index.ts @@ -1,123 +1,31 @@ -import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith'; -import { AppAPI } from '@modern-js/codesmith-api-app'; import { - BaseGenerator, - type Solution, - SolutionDefaultConfig, - SolutionGenerator, - getScenesSchema, - getSolutionSchema, - i18n, -} from '@modern-js/generator-common'; -import { GeneratorPlugin } from '@modern-js/generator-plugin'; + CodeSmith, + type GeneratorContext, + type GeneratorCore, +} from '@modern-js/codesmith'; import { getGeneratorPath } from '@modern-js/generator-utils'; -import { merge } from '@modern-js/utils/lodash'; - -const mergeDefaultConfig = (context: GeneratorContext) => { - const { defaultSolution } = context.config; - - if (defaultSolution) { - merge( - context.config, - { solution: defaultSolution }, - SolutionDefaultConfig[defaultSolution as Solution], - ); - } -}; - -const getNeedRunPlugin = ( - context: GeneratorContext, - generatorPlugin?: GeneratorPlugin, -): boolean => { - if (!generatorPlugin) { - return false; - } - const { extendPlugin, customPlugin } = generatorPlugin; - const { solution, scenes } = context.config; - if (!scenes || scenes === solution) { - return extendPlugin?.[solution] && extendPlugin[solution].length > 0; - } - return Boolean(customPlugin[solution]?.find(plugin => plugin.key === scenes)); -}; - -const handleTemplateFile = async ( - context: GeneratorContext, - generator: GeneratorCore, - appApi: AppAPI, - generatorPlugin?: GeneratorPlugin, -) => { - const { solution } = await appApi.getInputBySchemaFunc(getSolutionSchema, { - ...context.config, - customPlugin: generatorPlugin?.customPlugin, - }); - - await appApi.getInputBySchemaFunc(getScenesSchema, context.config); - - const solutionGenerator = - solution === 'custom' - ? BaseGenerator - : SolutionGenerator[solution as Solution]; - - if (!solution || !solutionGenerator) { - generator.logger.error(`🔴 [Check Solution]: ${solution} is not support`); - } - - await appApi.runSubGenerator( - getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]), - undefined, - { - ...context.config, - hasPlugin: getNeedRunPlugin(context, generatorPlugin), - generatorPlugin, - }, - ); -}; - -const handlePlugin = async ( - context: GeneratorContext, - generator: GeneratorCore, -) => { - const { plugins, registry, locale } = context.config; - const generatorPlugin = new GeneratorPlugin( - generator.logger, - generator.event, - locale, - ); - await generatorPlugin.setupPlugin(plugins, registry); - return generatorPlugin; -}; export default async (context: GeneratorContext, generator: GeneratorCore) => { process.setMaxListeners(20); - const appApi = new AppAPI(context, generator); - - const { locale } = context.config; - i18n.changeLanguage({ locale }); - appApi.i18n.changeLanguage({ locale }); - - if (!(await appApi.checkEnvironment())) { - process.exit(1); - } generator.logger.debug(`🚀 [Start Run Repo Generator]`); - generator.logger.debug( - '💡 [Current Config]:', - JSON.stringify(context.config), - ); - - mergeDefaultConfig(context); - let generatorPlugin; - if (context.config.plugins?.length > 0) { - generatorPlugin = await handlePlugin(context, generator); + // check prepare global + if (!(global as any).codesmith) { + generator.logger.warn( + '🟡 Please use the latest @modern-js/create version to run generator', + ); + const codesmith = new CodeSmith({}); + await codesmith.prepareGlobal(); } - try { - await handleTemplateFile(context, generator, appApi, generatorPlugin); - } catch (e) { - generator.logger.error(`🔴 [Handle Repo Template Error]:`, e); - process.exit(1); - } + const RepoNextGeneratort = '@modern-js/repo-next-generator'; + + await generator.runSubGenerator( + getGeneratorPath(RepoNextGeneratort, context.config.distTag, [__dirname]), + undefined, + context.config, + ); generator.logger.debug(`🚀 [End Run Repo Generator]`); }; diff --git a/packages/generator/generators/repo-next-generator/LICENSE b/packages/generator/generators/repo-next-generator/LICENSE new file mode 100644 index 000000000000..39e3c5971226 --- /dev/null +++ b/packages/generator/generators/repo-next-generator/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-present Modern.js + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/generator/generators/repo-next-generator/README.md b/packages/generator/generators/repo-next-generator/README.md new file mode 100644 index 000000000000..f3d407c43230 --- /dev/null +++ b/packages/generator/generators/repo-next-generator/README.md @@ -0,0 +1,26 @@ +

+ Modern.js Logo +

+ +

Modern.js

+ +

+ A Progressive React Framework for modern web development. +

+ +## Getting Started + +Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js. + +## Documentation + +- [English Documentation](https://modernjs.dev/en/) +- [中文文档](https://modernjs.dev) + +## Contributing + +Please read the [Contributing Guide](https://github.com/web-infra-dev/modern.js/blob/main/CONTRIBUTING.md). + +## License + +Modern.js is [MIT licensed](https://github.com/web-infra-dev/modern.js/blob/main/LICENSE). diff --git a/packages/generator/generators/repo-next-generator/jest.config.js b/packages/generator/generators/repo-next-generator/jest.config.js new file mode 100644 index 000000000000..5fcd3e5b28bd --- /dev/null +++ b/packages/generator/generators/repo-next-generator/jest.config.js @@ -0,0 +1,7 @@ +const sharedConfig = require('@scripts/jest-config'); + +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + ...sharedConfig, + rootDir: __dirname, +}; diff --git a/packages/generator/generators/repo-next-generator/modern.config.js b/packages/generator/generators/repo-next-generator/modern.config.js new file mode 100644 index 000000000000..57303a8d8dfa --- /dev/null +++ b/packages/generator/generators/repo-next-generator/modern.config.js @@ -0,0 +1,5 @@ +const { generatorBuildConfig } = require('@scripts/build'); + +module.exports = { + buildConfig: generatorBuildConfig, +}; diff --git a/packages/generator/generators/repo-next-generator/package.json b/packages/generator/generators/repo-next-generator/package.json new file mode 100644 index 000000000000..e208e5d823e3 --- /dev/null +++ b/packages/generator/generators/repo-next-generator/package.json @@ -0,0 +1,57 @@ +{ + "name": "@modern-js/repo-next-generator", + "description": "A Progressive React Framework for modern web development.", + "homepage": "https://modernjs.dev", + "bugs": "https://github.com/web-infra-dev/modern.js/issues", + "repository": { + "type": "git", + "url": "https://github.com/web-infra-dev/modern.js", + "directory": "packages/generator/generators/repo-generator" + }, + "license": "MIT", + "keywords": [ + "react", + "framework", + "modern", + "modern.js" + ], + "version": "3.6.3", + "jsnext:source": "./src/index.ts", + "main": "./src/index.ts", + "files": [ + "/templates", + "/dist/index.js" + ], + "scripts": { + "prepublishOnly": "only-allow-pnpm", + "new": "modern-lib new", + "build": "modern-lib build", + "test": "jest --passWithNoTests" + }, + "devDependencies": { + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/base-generator": "workspace:*", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/generator-common": "workspace:*", + "@modern-js/generator-plugin": "workspace:*", + "@modern-js/generator-utils": "workspace:*", + "@modern-js/module-generator": "workspace:*", + "@modern-js/mwa-generator": "workspace:*", + "@modern-js/plugin-module-banner": "workspace:*", + "@scripts/build": "workspace:*", + "@scripts/jest-config": "workspace:*", + "@types/jest": "^29", + "@types/node": "^14", + "jest": "^29", + "typescript": "^5" + }, + "sideEffects": false, + "publishConfig": { + "main": "./dist/index.js", + "registry": "https://registry.npmjs.org/", + "access": "public", + "provenance": true + }, + "types": "./src/index.ts" +} diff --git a/packages/generator/generators/repo-next-generator/src/index.ts b/packages/generator/generators/repo-next-generator/src/index.ts new file mode 100644 index 000000000000..2d129a8fd83b --- /dev/null +++ b/packages/generator/generators/repo-next-generator/src/index.ts @@ -0,0 +1,124 @@ +import type { GeneratorContext, GeneratorCore } from '@modern-js/codesmith'; +import { AppAPI } from '@modern-js/codesmith-api-app'; +import { merge } from '@modern-js/codesmith-utils/lodash'; +import { + BaseGenerator, + type Solution, + SolutionDefaultConfig, + SolutionGenerator, + getScenesSchema, + getSolutionSchema, + i18n, +} from '@modern-js/generator-common'; +import { GeneratorPlugin } from '@modern-js/generator-plugin'; +import { getGeneratorPath } from '@modern-js/generator-utils'; + +const mergeDefaultConfig = (context: GeneratorContext) => { + const { defaultSolution } = context.config; + + if (defaultSolution) { + merge( + context.config, + { solution: defaultSolution }, + SolutionDefaultConfig[defaultSolution as Solution], + ); + } +}; + +const getNeedRunPlugin = ( + context: GeneratorContext, + generatorPlugin?: GeneratorPlugin, +): boolean => { + if (!generatorPlugin) { + return false; + } + const { extendPlugin, customPlugin } = generatorPlugin; + const { solution, scenes } = context.config; + if (!scenes || scenes === solution) { + return extendPlugin?.[solution] && extendPlugin[solution].length > 0; + } + return Boolean(customPlugin[solution]?.find(plugin => plugin.key === scenes)); +}; + +const handleTemplateFile = async ( + context: GeneratorContext, + generator: GeneratorCore, + appApi: AppAPI, + generatorPlugin?: GeneratorPlugin, +) => { + const { solution } = await appApi.getInputBySchemaFunc(getSolutionSchema, { + ...context.config, + customPlugin: generatorPlugin?.customPlugin, + }); + + await appApi.getInputBySchemaFunc(getScenesSchema, context.config); + + const solutionGenerator = + solution === 'custom' + ? BaseGenerator + : SolutionGenerator[solution as Solution]; + + if (!solution || !solutionGenerator) { + generator.logger.error(`🔴 [Check Solution]: ${solution} is not support`); + } + + await appApi.runSubGenerator( + getGeneratorPath(solutionGenerator, context.config.distTag, [__dirname]), + undefined, + { + ...context.config, + hasPlugin: getNeedRunPlugin(context, generatorPlugin), + generatorPlugin, + }, + ); +}; + +const handlePlugin = async ( + context: GeneratorContext, + generator: GeneratorCore, +) => { + const { plugins, registry, locale } = context.config; + const generatorPlugin = new GeneratorPlugin( + generator.logger, + generator.event, + locale, + ); + await generatorPlugin.setupPlugin(plugins, registry); + return generatorPlugin; +}; + +export default async (context: GeneratorContext, generator: GeneratorCore) => { + process.setMaxListeners(20); + + const appApi = new AppAPI(context, generator); + + const { locale } = context.config; + i18n.changeLanguage({ locale }); + appApi.i18n.changeLanguage({ locale }); + + if (!(await appApi.checkEnvironment())) { + process.exit(1); + } + + generator.logger.debug(`🚀 [Start Run Repo Next Generator]`); + generator.logger.debug( + '💡 [Current Config]:', + JSON.stringify(context.config), + ); + + mergeDefaultConfig(context); + + let generatorPlugin; + if (context.config.plugins?.length > 0) { + generatorPlugin = await handlePlugin(context, generator); + } + + try { + await handleTemplateFile(context, generator, appApi, generatorPlugin); + } catch (e) { + generator.logger.error(`🔴 [Handle Repo Template Error]:`, e); + process.exit(1); + } + + generator.logger.debug(`🚀 [End Run Repo Next Generator]`); +}; diff --git a/packages/generator/generators/repo-next-generator/tsconfig.json b/packages/generator/generators/repo-next-generator/tsconfig.json new file mode 100644 index 000000000000..32a7aee84b06 --- /dev/null +++ b/packages/generator/generators/repo-next-generator/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@modern-js/tsconfig/base", + "compilerOptions": { + "declaration": false, + "jsx": "preserve", + "baseUrl": "./", + "paths": {} + }, + "include": ["src"] +} diff --git a/packages/generator/generators/router-v5-generator/package.json b/packages/generator/generators/router-v5-generator/package.json index e5ff90205e8d..9324849073c5 100644 --- a/packages/generator/generators/router-v5-generator/package.json +++ b/packages/generator/generators/router-v5-generator/package.json @@ -28,12 +28,10 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/server-generator/package.json b/packages/generator/generators/server-generator/package.json index ddd652d345d2..157f635d18a5 100644 --- a/packages/generator/generators/server-generator/package.json +++ b/packages/generator/generators/server-generator/package.json @@ -29,13 +29,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/ssg-generator/package.json b/packages/generator/generators/ssg-generator/package.json index 59f9d18feccf..66adeb9c70c2 100644 --- a/packages/generator/generators/ssg-generator/package.json +++ b/packages/generator/generators/ssg-generator/package.json @@ -28,12 +28,10 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/storybook-next-generator/modern.config.js b/packages/generator/generators/storybook-next-generator/modern.config.js index 9df5200ab6eb..57303a8d8dfa 100644 --- a/packages/generator/generators/storybook-next-generator/modern.config.js +++ b/packages/generator/generators/storybook-next-generator/modern.config.js @@ -1,10 +1,5 @@ +const { generatorBuildConfig } = require('@scripts/build'); + module.exports = { - buildConfig: { - target: 'es2019', - autoExternal: false, - alias: { - chalk: '@modern-js/utils/chalk', - }, - dts: false, - }, + buildConfig: generatorBuildConfig, }; diff --git a/packages/generator/generators/storybook-next-generator/package.json b/packages/generator/generators/storybook-next-generator/package.json index 2ceaf46c415e..543e16c654dd 100644 --- a/packages/generator/generators/storybook-next-generator/package.json +++ b/packages/generator/generators/storybook-next-generator/package.json @@ -29,9 +29,9 @@ "test": "jest --passWithNoTests" }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/tailwindcss-generator/package.json b/packages/generator/generators/tailwindcss-generator/package.json index 96d783513ea6..1da36590062b 100644 --- a/packages/generator/generators/tailwindcss-generator/package.json +++ b/packages/generator/generators/tailwindcss-generator/package.json @@ -28,13 +28,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/utils": "workspace:*" - }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/dependence-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", diff --git a/packages/generator/generators/upgrade-generator/package.json b/packages/generator/generators/upgrade-generator/package.json index 83e3ce28d6f1..f835b2a543c2 100644 --- a/packages/generator/generators/upgrade-generator/package.json +++ b/packages/generator/generators/upgrade-generator/package.json @@ -28,16 +28,14 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-api-app": "2.5.2", - "@modern-js/codesmith-api-json": "2.5.2", + "devDependencies": { + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/codesmith-api-app": "2.6.3", + "@modern-js/codesmith-api-json": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", - "@modern-js/utils": "workspace:*" - }, - "devDependencies": { "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", diff --git a/packages/generator/new-action/package.json b/packages/generator/new-action/package.json index bc60b645c84f..285932d1ecda 100644 --- a/packages/generator/new-action/package.json +++ b/packages/generator/new-action/package.json @@ -39,12 +39,14 @@ "test": "jest --passWithNoTests" }, "dependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/codesmith-formily": "2.5.2", + "@swc/helpers": "0.5.13", + "json5": "2.2.3", + "commander": "10.0.1", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-formily": "2.6.3", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", - "@modern-js/utils": "workspace:*", - "@swc/helpers": "0.5.13" + "@modern-js/codesmith-utils": "2.6.3" }, "devDependencies": { "@scripts/build": "workspace:*", diff --git a/packages/generator/new-action/src/module.ts b/packages/generator/new-action/src/module.ts index b108b69d4a34..a4d277d7befc 100644 --- a/packages/generator/new-action/src/module.ts +++ b/packages/generator/new-action/src/module.ts @@ -1,5 +1,6 @@ import { CodeSmith } from '@modern-js/codesmith'; import { FormilyAPI } from '@modern-js/codesmith-formily'; +import { merge } from '@modern-js/codesmith-utils/lodash'; import { type ActionFunction, ActionType, @@ -18,7 +19,6 @@ import { getModernPluginVersion, getPackageManager, } from '@modern-js/generator-utils'; -import { merge } from '@modern-js/utils/lodash'; import { enableAlreadyText } from './constants'; import { alreadyRepo, @@ -42,7 +42,7 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => { locale = 'zh', distTag = '', debug = false, - registry = '', + registry, config = '{}', cwd = process.cwd(), needInstall = true, @@ -61,13 +61,23 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => { const smith = new CodeSmith({ debug, - registryUrl: registry, + registryUrl: registry === '' ? undefined : registry, }); if (!alreadyRepo(cwd)) { smith.logger.warn('not valid modern.js repo'); } + smith.logger?.timing('🕒 Run Module New Tools'); + + const prepareGlobalPromise = smith.prepareGlobal(); + + const prepareGeneratorPromise = smith.prepareGenerators([ + `@modern-js/dependence-generator@${distTag || 'latest'}`, + `@modern-js/module-doc-generator@${distTag || 'latest'}`, + `@modern-js/storybook-next-generator@${distTag || 'latest'}`, + ]); + const formilyAPI = new FormilyAPI({ materials: {}, config: {}, @@ -175,6 +185,7 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => { }, ]; + await Promise.all([prepareGlobalPromise, prepareGeneratorPromise]); await smith.forge({ tasks: task.map(runner => ({ generator: runner.name, @@ -182,4 +193,6 @@ export const ModuleNewAction = async (options: IModuleNewActionOption) => { })), pwd: cwd, }); + + smith.logger?.timing('🕒 Run Module New Tools', true); }; diff --git a/packages/generator/new-action/src/mwa.ts b/packages/generator/new-action/src/mwa.ts index 01433db67779..cf5407e8c092 100644 --- a/packages/generator/new-action/src/mwa.ts +++ b/packages/generator/new-action/src/mwa.ts @@ -1,5 +1,6 @@ import { CodeSmith } from '@modern-js/codesmith'; import { FormilyAPI } from '@modern-js/codesmith-formily'; +import { merge } from '@modern-js/codesmith-utils/lodash'; import { type ActionFunction, type ActionRefactor, @@ -22,7 +23,6 @@ import { getModernPluginVersion, getPackageManager, } from '@modern-js/generator-utils'; -import { merge } from '@modern-js/utils/lodash'; import { enableAlreadyText } from './constants'; import { alreadyRepo, @@ -46,7 +46,7 @@ export const MWANewAction = async (options: IMWANewActionOption) => { locale = 'zh', distTag = '', debug = false, - registry = '', + registry, config = '{}', cwd = process.cwd(), needInstall = true, @@ -72,6 +72,20 @@ export const MWANewAction = async (options: IMWANewActionOption) => { smith.logger.warn('not valid modern.js repo'); } + smith.logger?.timing('🕒 Run MWA New Tools'); + + const prepareGlobalPromise = smith.prepareGlobal(); + + const prepareGeneratorPromise = smith.prepareGenerators([ + `@modern-js/dependence-generator@${distTag || 'latest'}`, + `@modern-js/bff-generator@${distTag || 'latest'}`, + `@modern-js/server-generator@${distTag || 'latest'}`, + `@modern-js/entry-generator@${distTag || 'latest'}`, + `@modern-js/ssg-generator@${distTag || 'latest'}`, + `@modern-js/storybook-next-generator@${distTag || 'latest'}`, + `@modern-js/tailwindcss-generator@${distTag || 'latest'}`, + ]); + const formilyAPI = new FormilyAPI({ materials: {}, config: {}, @@ -185,6 +199,8 @@ export const MWANewAction = async (options: IMWANewActionOption) => { }, ]; + await Promise.all([prepareGlobalPromise, prepareGeneratorPromise]); + await smith.forge({ tasks: task.map(runner => ({ generator: runner.name, @@ -192,4 +208,6 @@ export const MWANewAction = async (options: IMWANewActionOption) => { })), pwd: cwd, }); + + smith.logger?.timing('🕒 Run MWA New Tools', true); }; diff --git a/packages/generator/new-action/src/run.ts b/packages/generator/new-action/src/run.ts index 57b4f7ba5729..57cff1c08880 100644 --- a/packages/generator/new-action/src/run.ts +++ b/packages/generator/new-action/src/run.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -import { Command } from '@modern-js/utils/commander'; +import { Command } from 'commander'; import { ModuleNewAction } from './module'; import { MWANewAction } from './mwa'; @@ -13,6 +13,8 @@ const main = async () => { .option('--solution ', 'solution', '') .option('--config ', 'config', '{}') .option('--root-path ', 'project root path', '') + .option('--debug', 'using debug mode to log something', false) + .option('--time', 'show run generator time log', false) .action(async params => { if (!params.solution) { params.solution = getSolutionByDependance(); diff --git a/packages/generator/new-action/src/utils/index.ts b/packages/generator/new-action/src/utils/index.ts index 5f562575ff29..b19f72acc58a 100644 --- a/packages/generator/new-action/src/utils/index.ts +++ b/packages/generator/new-action/src/utils/index.ts @@ -1,4 +1,5 @@ import path from 'path'; +import { semver } from '@modern-js/codesmith-utils'; import { type ActionFunction, type ActionRefactor, @@ -6,7 +7,7 @@ import { SolutionToolsMap, } from '@modern-js/generator-common'; import { fs, getModernPluginVersion } from '@modern-js/generator-utils'; -import { json5, semver } from '@modern-js/utils'; +import json5 from 'json5'; const swap = (obj: Record) => { return Object.keys(obj).reduce>((acc, key) => { @@ -72,7 +73,7 @@ export function getGeneratorPath(generator: string, distTag: string) { export async function usePluginNameExport( solution: Solution, - options: Record, + options: Record, ) { const solutionVersion = await getModernPluginVersion( solution, diff --git a/packages/generator/plugins/generator-plugin/modern.config.js b/packages/generator/plugins/generator-plugin/modern.config.js index 9df5200ab6eb..57303a8d8dfa 100644 --- a/packages/generator/plugins/generator-plugin/modern.config.js +++ b/packages/generator/plugins/generator-plugin/modern.config.js @@ -1,10 +1,5 @@ +const { generatorBuildConfig } = require('@scripts/build'); + module.exports = { - buildConfig: { - target: 'es2019', - autoExternal: false, - alias: { - chalk: '@modern-js/utils/chalk', - }, - dts: false, - }, + buildConfig: generatorBuildConfig, }; diff --git a/packages/generator/plugins/generator-plugin/package.json b/packages/generator/plugins/generator-plugin/package.json index aa94e1d89d48..1615a9c58baf 100644 --- a/packages/generator/plugins/generator-plugin/package.json +++ b/packages/generator/plugins/generator-plugin/package.json @@ -38,7 +38,7 @@ "@modern-js/generator-common": "workspace:*", "@modern-js/generator-plugin": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", - "@modern-js/utils": "workspace:*", + "@modern-js/codesmith-utils": "2.6.3", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", diff --git a/packages/generator/sandpack-react/package.json b/packages/generator/sandpack-react/package.json index a17c0a7d7474..8d0ab01bc482 100644 --- a/packages/generator/sandpack-react/package.json +++ b/packages/generator/sandpack-react/package.json @@ -44,13 +44,13 @@ }, "devDependencies": { "@modern-js/base-generator": "workspace:*", - "@modern-js/codesmith-api-handlebars": "2.5.2", + "@modern-js/codesmith-api-handlebars": "2.6.3", "@modern-js/entry-generator": "workspace:*", "@modern-js/generator-common": "workspace:*", "@modern-js/generator-utils": "workspace:*", "@modern-js/module-generator": "workspace:*", "@modern-js/mwa-generator": "workspace:*", - "@modern-js/utils": "workspace:*", + "@modern-js/codesmith-utils": "2.6.3", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", diff --git a/packages/generator/sandpack-react/scripts/template.ts b/packages/generator/sandpack-react/scripts/template.ts index 2b9906bde30b..f3374ebccd2f 100644 --- a/packages/generator/sandpack-react/scripts/template.ts +++ b/packages/generator/sandpack-react/scripts/template.ts @@ -1,8 +1,8 @@ import path from 'path'; import { renderString } from '@modern-js/codesmith-api-handlebars'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; import { Solution } from '@modern-js/generator-common'; import { getModernVersion } from '@modern-js/generator-utils'; -import fs from '@modern-js/utils/fs-extra'; import recursive from 'recursive-readdir'; const IgnoreFiles = [ diff --git a/packages/toolkit/create/modern.config.js b/packages/toolkit/create/modern.config.js index 6f11366a24a6..9b4d1bc9482f 100644 --- a/packages/toolkit/create/modern.config.js +++ b/packages/toolkit/create/modern.config.js @@ -1,9 +1,6 @@ module.exports = { buildConfig: { autoExternal: false, - alias: { - chalk: '@modern-js/utils/chalk', - }, dts: false, sideEffects: false, }, diff --git a/packages/toolkit/create/package.json b/packages/toolkit/create/package.json index ed6ca5e0b24e..f38638bcc655 100644 --- a/packages/toolkit/create/package.json +++ b/packages/toolkit/create/package.json @@ -43,11 +43,12 @@ "test": "jest --passWithNoTests" }, "devDependencies": { - "@modern-js/codesmith": "2.5.2", + "commander": "10.0.1", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", "@modern-js/generator-plugin-plugin": "workspace:*", "@modern-js/plugin-i18n": "workspace:*", "@modern-js/repo-generator": "workspace:*", - "@modern-js/utils": "workspace:*", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", "@types/jest": "^29", diff --git a/packages/toolkit/create/src/cleanCacheAction.ts b/packages/toolkit/create/src/cleanCacheAction.ts index 4c81e1caa2b3..460f59652b39 100644 --- a/packages/toolkit/create/src/cleanCacheAction.ts +++ b/packages/toolkit/create/src/cleanCacheAction.ts @@ -1,7 +1,7 @@ import os from 'os'; import path from 'path'; -import fs from '@modern-js/utils/fs-extra'; -import ora from '@modern-js/utils/ora'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; +import { ora } from '@modern-js/codesmith-utils/ora'; import { i18n, localeKeys } from './locale'; export async function cleanCacheAction() { diff --git a/packages/toolkit/create/src/createAction.ts b/packages/toolkit/create/src/createAction.ts index 2c06471de3a2..1c62fe9deb26 100644 --- a/packages/toolkit/create/src/createAction.ts +++ b/packages/toolkit/create/src/createAction.ts @@ -1,7 +1,7 @@ import path from 'path'; import { CodeSmith, type Logger } from '@modern-js/codesmith'; +import { ora } from '@modern-js/codesmith-utils/ora'; import { getLocaleLanguage } from '@modern-js/plugin-i18n/language-detector'; -import { logger } from '@modern-js/utils'; import { version as pkgVersion } from '../package.json'; import { i18n, localeKeys } from './locale'; import { createDir } from './utils'; @@ -123,17 +123,34 @@ export async function createAction(projectDir: string, options: Options) { debug, time, namespace: 'create', - registryUrl: registry, + registryUrl: registry === '' ? undefined : registry, }); if (lang) { i18n.changeLanguage({ locale: lang }); } if (version) { - logger.greet(`@modern-js/create v${pkgVersion}`); + smith.logger.info(`@modern-js/create v${pkgVersion}`); return; } + smith.logger?.timing('🕒 Run Create Tools'); + const spinner = ora({ + text: 'Load Generator...', + spinner: 'runner', + }).start(); + const prepareGlobalPromise = smith.prepareGlobal(); + + const prepareGeneratorPromise = smith.prepareGenerators([ + `@modern-js/repo-generator@${distTag || 'latest'}`, + `@modern-js/repo-next-generator@${distTag || 'latest'}`, + `@modern-js/base-generator@${distTag || 'latest'}`, + `@modern-js/mwa-generator@${distTag || 'latest'}`, + `@modern-js/entry-generator@${distTag || 'latest'}`, + `@modern-js/module-generator@${distTag || 'latest'}`, + `@modern-js/changeset-generator@${distTag || 'latest'}`, + ]); + smith.logger.debug('📦 @modern-js/create:', `v${pkgVersion}`); smith.logger.debug('💡 [Current Dir]:', projectDir || ''); smith.logger.debug('💡 [Current Config]:', JSON.stringify(options)); @@ -145,6 +162,7 @@ export async function createAction(projectDir: string, options: Options) { smith.logger.error( i18n.t(localeKeys.tooltip.dir_exists, { dirName: projectDir }), ); + smith.logger?.timing('🕒 Run Create Tools', true); process.exit(1); } @@ -159,8 +177,13 @@ export async function createAction(projectDir: string, options: Options) { generator = require.resolve(REPO_GENERATOR); } else if (!path.isAbsolute(generator) && distTag) { generator = `${generator}@${distTag}`; + await prepareGeneratorPromise; } + await prepareGlobalPromise; + + spinner.stop(); + const task: RunnerTask = [ { name: generator, @@ -177,6 +200,7 @@ export async function createAction(projectDir: string, options: Options) { pwd, }); } catch (e) { + smith.logger?.timing('🕒 Run Create Tools', true); process.exit(1); } @@ -185,4 +209,5 @@ export async function createAction(projectDir: string, options: Options) { i18n.t(localeKeys.tooltip.dir_entry, { dirName: projectDir }), ); } + smith.logger?.timing('🕒 Run Create Tools', true); } diff --git a/packages/toolkit/create/src/index.ts b/packages/toolkit/create/src/index.ts index f5e57bf2d9da..f620451f8ed7 100644 --- a/packages/toolkit/create/src/index.ts +++ b/packages/toolkit/create/src/index.ts @@ -1,5 +1,5 @@ import { getLocaleLanguage } from '@modern-js/plugin-i18n/language-detector'; -import { Command } from '@modern-js/utils/commander'; +import { Command } from 'commander'; import { cleanCacheAction } from './cleanCacheAction'; import { createAction } from './createAction'; import { i18n, localeKeys } from './locale'; diff --git a/packages/toolkit/create/src/utils/index.ts b/packages/toolkit/create/src/utils/index.ts index c97fc05d9101..1126d1bb1b0a 100644 --- a/packages/toolkit/create/src/utils/index.ts +++ b/packages/toolkit/create/src/utils/index.ts @@ -1,5 +1,5 @@ import path from 'path'; -import fs from '@modern-js/utils/fs-extra'; +import { fs } from '@modern-js/codesmith-utils/fs-extra'; export function isEmptyDir(dirname: string) { try { diff --git a/packages/toolkit/upgrade/modern.config.js b/packages/toolkit/upgrade/modern.config.js index c2bf3e85b393..9b4d1bc9482f 100644 --- a/packages/toolkit/upgrade/modern.config.js +++ b/packages/toolkit/upgrade/modern.config.js @@ -1,5 +1,7 @@ -const { tscLikeBuildConfig } = require('@scripts/build'); - module.exports = { - buildConfig: tscLikeBuildConfig, + buildConfig: { + autoExternal: false, + dts: false, + sideEffects: false, + }, }; diff --git a/packages/toolkit/upgrade/package.json b/packages/toolkit/upgrade/package.json index 0b8b0a42a613..93c9c445622e 100644 --- a/packages/toolkit/upgrade/package.json +++ b/packages/toolkit/upgrade/package.json @@ -42,13 +42,11 @@ "build": "modern-lib build", "test": "jest --passWithNoTests" }, - "dependencies": { - "@modern-js/codesmith": "2.5.2", - "@modern-js/plugin-i18n": "workspace:*", - "@modern-js/utils": "workspace:*", - "@swc/helpers": "0.5.13" - }, "devDependencies": { + "commander": "10.0.1", + "@modern-js/codesmith": "2.6.3", + "@modern-js/codesmith-utils": "2.6.3", + "@modern-js/plugin-i18n": "workspace:*", "@modern-js/upgrade-generator": "workspace:*", "@scripts/build": "workspace:*", "@scripts/jest-config": "workspace:*", diff --git a/packages/toolkit/upgrade/src/index.ts b/packages/toolkit/upgrade/src/index.ts index 4cdea02e5927..7e0b8ad873e1 100644 --- a/packages/toolkit/upgrade/src/index.ts +++ b/packages/toolkit/upgrade/src/index.ts @@ -1,5 +1,5 @@ import { getLocaleLanguage } from '@modern-js/plugin-i18n/language-detector'; -import { Command } from '@modern-js/utils/commander'; +import { Command } from 'commander'; import { i18n, localeKeys } from './locale'; import type { Options } from './upgrade'; @@ -14,8 +14,13 @@ export function defineCommand(program: Command) { .usage('npx @modern-js/upgrade [options]') .option('-c --config ', i18n.t(localeKeys.command.config)) .option('--dist-tag ', i18n.t(localeKeys.command.distTag), '') - .option('--registry ', i18n.t(localeKeys.command.registry), '') + .option( + '--registry ', + i18n.t(localeKeys.command.registry), + undefined, + ) .option('-d,--debug', i18n.t(localeKeys.command.debug), false) + .option('--time', i18n.t(localeKeys.command.time), false) .option('--cwd ', i18n.t(localeKeys.command.cwd), '') .option('--no-need-install', i18n.t(localeKeys.command.noNeedInstall)) .action(async params => { diff --git a/packages/toolkit/upgrade/src/locale/en.ts b/packages/toolkit/upgrade/src/locale/en.ts index 354b889f8c83..076aee0ede55 100644 --- a/packages/toolkit/upgrade/src/locale/en.ts +++ b/packages/toolkit/upgrade/src/locale/en.ts @@ -8,5 +8,6 @@ export const EN_LOCALE = { noNeedInstall: 'not run install command', config: 'specify the configuration file, which can be a relative or absolute path', + time: 'show run generator time log', }, }; diff --git a/packages/toolkit/upgrade/src/locale/zh.ts b/packages/toolkit/upgrade/src/locale/zh.ts index 985a78ed02ce..f4a6918466d2 100644 --- a/packages/toolkit/upgrade/src/locale/zh.ts +++ b/packages/toolkit/upgrade/src/locale/zh.ts @@ -7,5 +7,6 @@ export const ZH_LOCALE = { noNeedInstall: '无需安装依赖', cwd: '项目路径', config: '指定配置文件路径,可以为相对路径或绝对路径', + time: '展示生成器时间日志信息', }, }; diff --git a/packages/toolkit/upgrade/src/upgrade.ts b/packages/toolkit/upgrade/src/upgrade.ts index 8d7bbebea1e4..e947bcfc127b 100644 --- a/packages/toolkit/upgrade/src/upgrade.ts +++ b/packages/toolkit/upgrade/src/upgrade.ts @@ -1,8 +1,10 @@ import { CodeSmith } from '@modern-js/codesmith'; +import { ora } from '@modern-js/codesmith-utils/ora'; export interface Options { cwd?: string; debug?: boolean; + time?: boolean; distTag?: string; registry?: string; needInstall?: boolean; @@ -14,6 +16,7 @@ export async function upgradeAction(options: Options) { const { cwd = process.cwd(), debug = false, + time = false, distTag, registry, needInstall, @@ -22,8 +25,18 @@ export async function upgradeAction(options: Options) { const smith = new CodeSmith({ debug, + time, }); + smith.logger?.timing('🕒 Run Upgrade Tools'); + + const spinner = ora({ + text: 'Load Generator...', + spinner: 'runner', + }).start(); + const prepareGlobalPromise = smith.prepareGlobal(); + const prepareGeneratorPromise = smith.prepareGenerators([UPGRADE_GENERATOR]); + smith.logger.debug('@modern-js/upgrade', projectDir || '', options); let generator = UPGRADE_GENERATOR; @@ -32,8 +45,13 @@ export async function upgradeAction(options: Options) { generator = require.resolve(UPGRADE_GENERATOR); } else if (distTag) { generator = `${UPGRADE_GENERATOR}@${distTag}`; + await prepareGeneratorPromise; } + await prepareGlobalPromise; + + spinner.stop(); + try { await smith.forge({ tasks: [ @@ -50,6 +68,8 @@ export async function upgradeAction(options: Options) { pwd: cwd, }); } catch (e) { + smith.logger?.timing('🕒 Run Upgrade Tools', true); process.exit(1); } + smith.logger?.timing('🕒 Run Upgrade Tools', true); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 48e49bc3cfd9..50e9726dd55b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1227,8 +1227,8 @@ importers: packages/generator/generator-common: dependencies: '@modern-js/codesmith-formily': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../cli/plugin-i18n @@ -1237,14 +1237,14 @@ importers: version: 0.5.13 devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -1267,20 +1267,23 @@ importers: packages/generator/generator-plugin: dependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-git': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-npm': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3) '@modern-js/codesmith-formily': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../generator-common @@ -1293,18 +1296,21 @@ importers: '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../cli/plugin-i18n - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils '@swc/helpers': specifier: 0.5.13 version: 0.5.13 ejs: specifier: ^3.1.9 version: 3.1.10 + globby: + specifier: 11.1.0 + version: 11.1.0 handlebars: specifier: ^4.7.7 version: 4.7.8 + json5: + specifier: 2.2.3 + version: 2.2.3 devDependencies: '@scripts/build': specifier: workspace:* @@ -1330,31 +1336,46 @@ importers: packages/generator/generator-utils: dependencies: + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../generator-common '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../cli/plugin-i18n - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils '@swc/helpers': specifier: 0.5.13 version: 0.5.13 + glob: + specifier: 7.2.0 + version: 7.2.0 + js-yaml: + specifier: 4.1.0 + version: 4.1.0 + json5: + specifier: 2.2.3 + version: 2.2.3 devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@scripts/build': specifier: workspace:* version: link:../../../scripts/build '@scripts/jest-config': specifier: workspace:* version: link:../../../scripts/jest-config + '@types/glob': + specifier: 7.2.0 + version: 7.2.0 '@types/jest': specifier: ^29 version: 29.5.13 + '@types/js-yaml': + specifier: 4.0.9 + version: 4.0.9 '@types/node': specifier: ^14 version: 14.18.35 @@ -1366,17 +1387,16 @@ importers: version: 5.3.3 packages/generator/generators/base-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1403,20 +1423,19 @@ importers: version: 5.3.3 packages/generator/generators/bff-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1446,17 +1465,16 @@ importers: version: 5.3.3 packages/generator/generators/changeset-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1480,20 +1498,19 @@ importers: version: 5.3.3 packages/generator/generators/dependence-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1523,20 +1540,19 @@ importers: version: 5.3.3 packages/generator/generators/entry-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-handlebars': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1566,20 +1582,19 @@ importers: version: 5.3.3 packages/generator/generators/generator-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1612,20 +1627,19 @@ importers: version: 5.3.3 packages/generator/generators/module-doc-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1658,10 +1672,6 @@ importers: version: 5.3.3 packages/generator/generators/module-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/base-generator': specifier: workspace:* @@ -1670,11 +1680,14 @@ importers: specifier: workspace:* version: link:../changeset-generator '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1710,20 +1723,19 @@ importers: version: 5.3.3 packages/generator/generators/mwa-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/base-generator': specifier: workspace:* version: link:../base-generator '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1762,20 +1774,19 @@ importers: version: 5.3.3 packages/generator/generators/packages-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1802,20 +1813,40 @@ importers: version: 5.3.3 packages/generator/generators/repo-generator: - dependencies: - '@modern-js/utils': + devDependencies: + '@modern-js/codesmith': + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/generator-utils': specifier: workspace:* - version: link:../../../toolkit/utils + version: link:../../generator-utils + '@modern-js/repo-next-generator': + specifier: workspace:* + version: link:../repo-next-generator + '@scripts/build': + specifier: workspace:* + version: link:../../../../scripts/build + '@types/node': + specifier: ^14 + version: 14.18.35 + typescript: + specifier: ^5 + version: 5.3.3 + + packages/generator/generators/repo-next-generator: devDependencies: '@modern-js/base-generator': specifier: workspace:* version: link:../base-generator '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.4.5) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -1831,6 +1862,9 @@ importers: '@modern-js/mwa-generator': specifier: workspace:* version: link:../mwa-generator + '@modern-js/plugin-module-banner': + specifier: workspace:* + version: link:../../../module/plugin-module-banner '@scripts/build': specifier: workspace:* version: link:../../../../scripts/build @@ -1848,20 +1882,19 @@ importers: version: 29.5.0(@types/node@14.18.35)(ts-node@10.9.2) typescript: specifier: ^5 - version: 5.3.3 + version: 5.4.5 packages/generator/generators/router-v5-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1894,20 +1927,19 @@ importers: version: 5.3.3 packages/generator/generators/server-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1937,17 +1969,16 @@ importers: version: 5.3.3 packages/generator/generators/ssg-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -1982,14 +2013,14 @@ importers: packages/generator/generators/storybook-next-generator: devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -2022,20 +2053,19 @@ importers: version: 5.3.3 packages/generator/generators/tailwindcss-generator: - dependencies: - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/dependence-generator': specifier: workspace:* version: link:../dependence-generator @@ -2065,16 +2095,19 @@ importers: version: 5.3.3 packages/generator/generators/upgrade-generator: - dependencies: + devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-api-app': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) '@modern-js/codesmith-api-json': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -2084,10 +2117,6 @@ importers: '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../../cli/plugin-i18n - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils - devDependencies: '@scripts/build': specifier: workspace:* version: link:../../../../scripts/build @@ -2110,23 +2139,29 @@ importers: packages/generator/new-action: dependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 '@modern-js/codesmith-formily': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../generator-common '@modern-js/generator-utils': specifier: workspace:* version: link:../generator-utils - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils '@swc/helpers': specifier: 0.5.13 version: 0.5.13 + commander: + specifier: 10.0.1 + version: 10.0.1 + json5: + specifier: 2.2.3 + version: 2.2.3 devDependencies: '@scripts/build': specifier: workspace:* @@ -2152,6 +2187,9 @@ importers: packages/generator/plugins/generator-plugin: devDependencies: + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-common': specifier: workspace:* version: link:../../generator-common @@ -2161,9 +2199,6 @@ importers: '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../../cli/plugin-i18n - '@modern-js/utils': - specifier: workspace:* - version: link:../../../toolkit/utils '@scripts/build': specifier: workspace:* version: link:../../../../scripts/build @@ -2202,8 +2237,11 @@ importers: specifier: workspace:* version: link:../generators/base-generator '@modern-js/codesmith-api-handlebars': - specifier: 2.5.2 - version: 2.5.2(@modern-js/codesmith@2.5.2) + specifier: 2.6.3 + version: 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/entry-generator': specifier: workspace:* version: link:../generators/entry-generator @@ -2219,9 +2257,6 @@ importers: '@modern-js/mwa-generator': specifier: workspace:* version: link:../generators/mwa-generator - '@modern-js/utils': - specifier: workspace:* - version: link:../../toolkit/utils '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -3009,7 +3044,7 @@ importers: version: 1.8.2 jest: specifier: ^29 - version: 29.5.0(@types/node@22.7.5)(ts-node@10.9.2) + version: 29.5.0(@types/node@18.19.55)(ts-node@10.9.2) packages/server/bff-core: dependencies: @@ -4175,8 +4210,11 @@ importers: packages/toolkit/create: devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/generator-plugin-plugin': specifier: workspace:* version: link:../../generator/plugins/generator-plugin @@ -4186,9 +4224,6 @@ importers: '@modern-js/repo-generator': specifier: workspace:* version: link:../../generator/generators/repo-generator - '@modern-js/utils': - specifier: workspace:* - version: link:../utils '@scripts/build': specifier: workspace:* version: link:../../../scripts/build @@ -4201,6 +4236,9 @@ importers: '@types/node': specifier: ^14 version: 14.18.35 + commander: + specifier: 10.0.1 + version: 10.0.1 jest: specifier: ^29 version: 29.5.0(@types/node@14.18.35)(ts-node@10.9.2) @@ -4396,20 +4434,16 @@ importers: version: 2.15.0 packages/toolkit/upgrade: - dependencies: + devDependencies: '@modern-js/codesmith': - specifier: 2.5.2 - version: 2.5.2 + specifier: 2.6.3 + version: 2.6.3 + '@modern-js/codesmith-utils': + specifier: 2.6.3 + version: 2.6.3 '@modern-js/plugin-i18n': specifier: workspace:* version: link:../../cli/plugin-i18n - '@modern-js/utils': - specifier: workspace:* - version: link:../utils - '@swc/helpers': - specifier: 0.5.13 - version: 0.5.13 - devDependencies: '@modern-js/upgrade-generator': specifier: workspace:* version: link:../../generator/generators/upgrade-generator @@ -4425,6 +4459,9 @@ importers: '@types/node': specifier: ^14 version: 14.18.35 + commander: + specifier: 10.0.1 + version: 10.0.1 jest: specifier: ^29 version: 29.5.0(@types/node@14.18.35)(ts-node@10.9.2) @@ -12029,7 +12066,7 @@ packages: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.5.4 + semver: 7.6.3 /@changesets/assemble-release-plan@5.2.4: resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} @@ -12039,7 +12076,7 @@ packages: '@changesets/get-dependents-graph': 1.3.6 '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 - semver: 7.5.4 + semver: 7.6.3 /@changesets/changelog-git@0.1.14: resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} @@ -12107,7 +12144,7 @@ packages: '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.5.4 + semver: 7.6.3 /@changesets/get-release-plan@3.0.17: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} @@ -12429,15 +12466,15 @@ packages: '@commitlint/execute-rule': 17.4.0 '@commitlint/resolve-extends': 17.4.4 '@commitlint/types': 17.4.4 - '@types/node': 22.7.5 + '@types/node': 18.19.55 chalk: 4.1.2 cosmiconfig: 8.3.6(typescript@5.4.5) - cosmiconfig-typescript-loader: 4.3.0(@types/node@22.7.5)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.5) + cosmiconfig-typescript-loader: 4.3.0(@types/node@18.19.55)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - '@swc/core' @@ -13332,6 +13369,18 @@ packages: '@formily/shared': 2.2.24 typescript: 5.3.3 + /@formily/json-schema@2.2.24(typescript@5.4.5): + resolution: {integrity: sha512-3aEMEO5D0B1p5rM/lzWmhx3rYqid4OKzCXAdxBsyicacFK9dVqxlOBt8d6auOsppMZ675q52jSVDxNSgh4xKqg==} + engines: {npm: '>=3.0.0'} + peerDependencies: + typescript: '>4.1.5' + dependencies: + '@formily/core': 2.2.24 + '@formily/reactive': 2.2.24 + '@formily/shared': 2.2.24 + typescript: 5.4.5 + dev: true + /@formily/path@2.2.24: resolution: {integrity: sha512-DrRBIPvlqGr7+xQ/74MY/j7WSbUzvWeHOsjfXTIllbijKAdUm+DovpQuHMXR16I3gnuQ8CvyMzCizP9RKVnhzw==} engines: {npm: '>=3.0.0'} @@ -13471,8 +13520,8 @@ packages: resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 chalk: 4.1.2 jest-message-util: 29.5.0 jest-util: 29.5.0 @@ -13490,28 +13539,28 @@ packages: '@jest/console': 29.5.0 '@jest/reporters': 29.5.0 '@jest/test-result': 29.5.0 - '@jest/transform': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 18.11.17 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 ansi-escapes: 4.3.2 chalk: 4.1.2 - ci-info: 3.3.2 + ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.5.0 - jest-config: 29.5.0(@types/node@18.11.17)(ts-node@10.9.2) - jest-haste-map: 29.5.0 - jest-message-util: 29.5.0 - jest-regex-util: 29.4.3 + jest-config: 29.5.0(@types/node@18.19.55)(ts-node@10.9.2) + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 + jest-regex-util: 29.6.3 jest-resolve: 29.5.0 jest-resolve-dependencies: 29.5.0 jest-runner: 29.5.0 jest-runtime: 29.5.0 jest-snapshot: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 jest-watcher: 29.5.0 - micromatch: 4.0.5 + micromatch: 4.0.8 pretty-format: 29.7.0 slash: 3.0.0 strip-ansi: 6.0.1 @@ -13531,8 +13580,8 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/fake-timers': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 jest-mock: 29.5.0 /@jest/expect-utils@29.7.0: @@ -13554,9 +13603,9 @@ packages: resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.0.2 - '@types/node': 14.18.35 + '@types/node': 18.19.55 jest-message-util: 29.7.0 jest-mock: 29.5.0 jest-util: 29.5.0 @@ -13567,7 +13616,7 @@ packages: dependencies: '@jest/environment': 29.5.0 '@jest/expect': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 jest-mock: 29.5.0 transitivePeerDependencies: - supports-color @@ -13584,10 +13633,10 @@ packages: '@bcoe/v8-coverage': 0.2.3 '@jest/console': 29.5.0 '@jest/test-result': 29.5.0 - '@jest/transform': 29.5.0 - '@jest/types': 29.5.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 14.18.35 + '@types/node': 18.19.55 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -13598,9 +13647,9 @@ packages: istanbul-lib-report: 3.0.0 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 - jest-message-util: 29.5.0 - jest-util: 29.5.0 - jest-worker: 29.5.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 + jest-worker: 29.7.0 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 @@ -13627,7 +13676,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/console': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 collect-v8-coverage: 1.0.1 @@ -13637,7 +13686,7 @@ packages: dependencies: '@jest/test-result': 29.5.0 graceful-fs: 4.2.11 - jest-haste-map: 29.5.0 + jest-haste-map: 29.7.0 slash: 3.0.0 /@jest/transform@29.5.0: @@ -13683,7 +13732,6 @@ packages: write-file-atomic: 4.0.2 transitivePeerDependencies: - supports-color - dev: true /@jest/types@27.5.1: resolution: {integrity: sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==} @@ -13691,7 +13739,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/yargs': 16.0.9 chalk: 4.1.2 dev: true @@ -13703,7 +13751,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.17 + '@types/node': 18.19.55 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -13714,7 +13762,7 @@ packages: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -13897,7 +13945,7 @@ packages: npmlog: 5.0.1 rimraf: 3.0.2 semver: 7.6.3 - tar: 6.2.0 + tar: 6.2.1 transitivePeerDependencies: - encoding - supports-color @@ -14072,101 +14120,158 @@ packages: redux: 4.2.1 dev: false - /@modern-js/codesmith-api-app@2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3): - resolution: {integrity: sha512-ve6bCjMnC5b5CfKV+8YYUqzs/vbYUWk539GOxdhtYCEkL0h22TBNoKJwsJ5PG9GX8zTdvhS80v2bAlW5Veh/Dg==} + /@modern-js/codesmith-api-app@2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3): + resolution: {integrity: sha512-pCEbPvB8wl0LVlDiOwOPOFYB0NCytScoE1UyEKacd31AOdVPIvC3dW1irGqKBcPEqHnR2US5twCm6UQjsiv+VQ==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 - '@modern-js/codesmith-api-ejs': 2.5.2(@modern-js/codesmith@2.5.2) - '@modern-js/codesmith-api-fs': 2.5.2(@modern-js/codesmith@2.5.2) - '@modern-js/codesmith-api-git': 2.5.2(@modern-js/codesmith@2.5.2) - '@modern-js/codesmith-api-handlebars': 2.5.2(@modern-js/codesmith@2.5.2) - '@modern-js/codesmith-api-npm': 2.5.2 - '@modern-js/codesmith-formily': 2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3) - '@modern-js/plugin-i18n': 2.60.2 - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-api-ejs': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-fs': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-git': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-handlebars': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-npm': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-formily': 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3) + '@modern-js/codesmith-utils': 2.6.3 + '@modern-js/plugin-i18n': 2.60.3 + '@swc/helpers': 0.5.1 + comment-json: 4.2.3 + extra: 0.2.1 + inquirer: 8.1.3 + transitivePeerDependencies: + - typescript + dev: true + + /@modern-js/codesmith-api-app@2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.4.5): + resolution: {integrity: sha512-pCEbPvB8wl0LVlDiOwOPOFYB0NCytScoE1UyEKacd31AOdVPIvC3dW1irGqKBcPEqHnR2US5twCm6UQjsiv+VQ==} + peerDependencies: + '@modern-js/codesmith': ^2.6.3 + dependencies: + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-api-ejs': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-fs': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-git': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-handlebars': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-api-npm': 2.6.3(@modern-js/codesmith@2.6.3) + '@modern-js/codesmith-formily': 2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.4.5) + '@modern-js/codesmith-utils': 2.6.3 + '@modern-js/plugin-i18n': 2.60.3 '@swc/helpers': 0.5.1 comment-json: 4.2.3 extra: 0.2.1 inquirer: 8.1.3 transitivePeerDependencies: - - supports-color - typescript + dev: true - /@modern-js/codesmith-api-ejs@2.5.2(@modern-js/codesmith@2.5.2): - resolution: {integrity: sha512-AaPKaE/3EZj+7HcFK6lSdrdXAwORgekMx0I8s58vMIBmHrWzq5qsrzbozDVUsiBFcwY+ToHxRkFlZe359xSK4Q==} + /@modern-js/codesmith-api-ejs@2.6.3(@modern-js/codesmith@2.6.3): + resolution: {integrity: sha512-H0uAHi0lKixetfvwfTVhXBLF13Fh0cItmf57Fy0GEcg3WzMc/mkxHUaZI4m3/c+0VaVp/PNcvCDXFphM3BcWcQ==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 + '@modern-js/codesmith': 2.6.3 '@swc/helpers': 0.5.1 ejs: 3.1.10 + dev: true - /@modern-js/codesmith-api-fs@2.5.2(@modern-js/codesmith@2.5.2): - resolution: {integrity: sha512-UlzetFOlcFDoB5ftpbK3QpaEyNdNM5OX5OxhvwGixlZ1V7Jf+6/BuwGyc8FDfxQSMeDJLRfle+eC4OwPHypxGA==} + /@modern-js/codesmith-api-fs@2.6.3(@modern-js/codesmith@2.6.3): + resolution: {integrity: sha512-uPAD/SJeXs7xgpJqTIqjMGV7sfiIEriESXf4vwQcj0/v9iiA4YIwDyXiBLWA+a+7QIHPYbo/njdmiEhSssd8pw==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-utils': 2.6.3 '@swc/helpers': 0.5.1 + dev: true - /@modern-js/codesmith-api-git@2.5.2(@modern-js/codesmith@2.5.2): - resolution: {integrity: sha512-53zHcssIrkuKjKqNG5krIY/AEAXLjGJCoaFnhb7ZXDGZKLqXp3QBM9cOOv8wTnVHdAiZG5ZyM1TNv9aSZtJeaQ==} + /@modern-js/codesmith-api-git@2.6.3(@modern-js/codesmith@2.6.3): + resolution: {integrity: sha512-C43wVybO6Iusgn4ZAwUW1tRGSy4I8Bgj+rX7kKuKlaMk57wLp1IAwBJX2vhI1P/RtzzA+SWbqn0zy4j3tcZ6tw==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-utils': 2.6.3 '@swc/helpers': 0.5.1 - /@modern-js/codesmith-api-handlebars@2.5.2(@modern-js/codesmith@2.5.2): - resolution: {integrity: sha512-P44XJMjKtq2ZUVpmvDAaupUcH6BHhW/AMhUv/pX2Bzdpo54pg1GXO75+zhvxAvYsqNZxtOc3oNqiiEKfGB+raA==} + /@modern-js/codesmith-api-handlebars@2.6.3(@modern-js/codesmith@2.6.3): + resolution: {integrity: sha512-y7Mp9dMHk7UGMjijtEU9oZytt2I5mZ90D2igki/jLxr2XjcFSdCzeRdIxna6Zo0wKIdwdF7zlChBNfOQ0IWmeA==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 + '@modern-js/codesmith': 2.6.3 '@swc/helpers': 0.5.1 handlebars: 4.7.8 + dev: true - /@modern-js/codesmith-api-json@2.5.2: - resolution: {integrity: sha512-HwLIXyuxTDxUVhExG7LWmNSI95bKYuUbLd0Roys1SC95eAVAU0cnAIaeiXSN1CnTg67CyvTL0J4ECpxBjRX+KA==} + /@modern-js/codesmith-api-json@2.6.3: + resolution: {integrity: sha512-vCXJbp13Hano0YFoKWjfP46kSHdoHd1lnRkWYqJZx+99AP9DVe5ruzSxo0pv03A2UbyWVKmtxKO6Pxt5xS+CQQ==} dependencies: - '@modern-js/codesmith': 2.5.2 + '@modern-js/codesmith': 2.6.3 '@swc/helpers': 0.5.1 comment-json: 4.2.3 declaration-update: 0.0.2 transitivePeerDependencies: - supports-color - /@modern-js/codesmith-api-npm@2.5.2: - resolution: {integrity: sha512-4ilQLRQ5fWINVkAWox67fYUsjJJavfQBfcd8lreIaFF3MCPmY+B3Y0Py7qmN+IklC0xBdyWqLx/+C51+RphPyQ==} + /@modern-js/codesmith-api-npm@2.6.3(@modern-js/codesmith@2.6.3): + resolution: {integrity: sha512-ISEFHdPZ241HTRzGCJvOmMgkt21NbR/cFRD/vDDC2gmZk6HHr6a1w147MDse4FXzmEwdNbEDzbKMF80g47XskQ==} + peerDependencies: + '@modern-js/codesmith': ^2.6.3 dependencies: - '@modern-js/codesmith': 2.5.2 - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-utils': 2.6.3 '@swc/helpers': 0.5.1 - transitivePeerDependencies: - - supports-color - /@modern-js/codesmith-formily@2.5.2(@modern-js/codesmith@2.5.2)(typescript@5.3.3): - resolution: {integrity: sha512-Oj6278W/kwAc4u/1g3QHwlfgMiQvZq1nUvNEPUCRsvWOp0+fq2kr+ocHJsBoa8xM7AFCnBml+5MHN2V5Lx2zTw==} + /@modern-js/codesmith-formily@2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.3.3): + resolution: {integrity: sha512-MQARu7JiNPoDxh8l2UqS9MOXEwoDaMj8WLBjXKVbYP4O+yG7p/W3kasVhTOnfxswtL1jG6UYxES7DAOR6YALZA==} peerDependencies: - '@modern-js/codesmith': ^2.5.2 + '@modern-js/codesmith': ^2.6.3 dependencies: '@formily/json-schema': 2.2.24(typescript@5.3.3) '@formily/validator': 2.2.24 - '@modern-js/codesmith': 2.5.2 - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-utils': 2.6.3 + '@swc/helpers': 0.5.1 + inquirer: 8.2.6 + transitivePeerDependencies: + - typescript + + /@modern-js/codesmith-formily@2.6.3(@modern-js/codesmith@2.6.3)(typescript@5.4.5): + resolution: {integrity: sha512-MQARu7JiNPoDxh8l2UqS9MOXEwoDaMj8WLBjXKVbYP4O+yG7p/W3kasVhTOnfxswtL1jG6UYxES7DAOR6YALZA==} + peerDependencies: + '@modern-js/codesmith': ^2.6.3 + dependencies: + '@formily/json-schema': 2.2.24(typescript@5.4.5) + '@formily/validator': 2.2.24 + '@modern-js/codesmith': 2.6.3 + '@modern-js/codesmith-utils': 2.6.3 '@swc/helpers': 0.5.1 inquirer: 8.2.6 transitivePeerDependencies: - typescript + dev: true + + /@modern-js/codesmith-utils@2.6.3: + resolution: {integrity: sha512-Vbbc3ZFBhe4nWCZc0Jvp6VOZ8YQqPtCkRj4wNjSLg7868hoKcDfo+NETn/wHxw07SPkrm4TPTma4hkddNicHqQ==} + dependencies: + '@swc/helpers': 0.5.1 + chalk: 4.1.2 + execa: 5.1.1 + fs-extra: 10.0.1 + glob: 7.2.0 + lodash.flattendeep: 4.4.0 + lodash.get: 4.4.2 + lodash.isfunction: 3.0.9 + lodash.isobject: 3.0.2 + lodash.isstring: 4.0.1 + lodash.merge: 4.6.2 + ora: 5.4.1 + semver: 7.6.0 - /@modern-js/codesmith@2.5.2: - resolution: {integrity: sha512-CqQtfwbaCqUv+C1bBLguOYMy5hUBsYSHfe4kEWYO0DGwESCpcllAtjPJnTFFo+v1KPlL6c8lMLNVyIE3EUBZ3Q==} + /@modern-js/codesmith@2.6.3: + resolution: {integrity: sha512-5Fx+FyW0IKiSJrBZuGYHdxF9Klqf/UyFTMV87OnxGbv+ixTfAbLdTk6ErYma6XsDsaMvAHch2j2oLo3ZAVaX7w==} dependencies: - '@modern-js/utils': 2.60.2 + '@modern-js/codesmith-utils': 2.6.3 '@swc/helpers': 0.5.1 axios: 1.7.7(debug@4.3.7) debug: 4.3.7(supports-color@9.3.1) @@ -14258,12 +14363,6 @@ packages: - debug dev: true - /@modern-js/plugin-i18n@2.60.2: - resolution: {integrity: sha512-too6UmsB9CUDGNnh2Z2RkOJwaRH3WMFUk/P7c5YmebkhnIOPQRKD1lOfsRK+0oNfLPPii6nf7TDe7drIurLi+w==} - dependencies: - '@modern-js/utils': 2.60.2 - '@swc/helpers': 0.5.13 - /@modern-js/plugin-i18n@2.60.3: resolution: {integrity: sha512-cWWg8DXFznwUovmXQLwP6SoRy/yMfKIJZbQ7ARb8HXpsLglvpzLi8Iw8wzE7IsUazzaJmwo7frmG1AXbMWLDxg==} dependencies: @@ -14300,7 +14399,7 @@ packages: event-source-polyfill: 1.0.26 fastestsmallesttextencoderdecoder: 1.0.22 from2-string: 1.1.0 - glob: 7.2.0 + glob: 7.2.3 graceful-fs: 4.2.11 html5shiv: 3.7.3 intl: 1.2.5 @@ -14435,14 +14534,6 @@ packages: rslog: 1.2.3 dev: true - /@modern-js/utils@2.60.2: - resolution: {integrity: sha512-7T95WiwSlfoX/3vQiTSRE1QGt5GIm0/DeXFbN4pyQzqzFLWrgnVmlloKHKQSejDlgp7ttRZZpBiRVmIiqZX98Q==} - dependencies: - '@swc/helpers': 0.5.13 - caniuse-lite: 1.0.30001668 - lodash: 4.17.21 - rslog: 1.2.3 - /@modern-js/utils@2.60.3: resolution: {integrity: sha512-g9kxWsYZ71MZPXMEf2ltDP229WjGIChNB95fjmcvtWRoW9grhINdQJ0/tO+jEaHZiDDQEWuPJlqqUrXWcZB0nQ==} dependencies: @@ -14635,7 +14726,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 playwright-core: 1.33.0 optionalDependencies: fsevents: 2.3.2 @@ -18343,7 +18434,7 @@ packages: '@storybook/node-logger': 7.6.20 '@storybook/types': 7.6.20 '@types/find-cache-dir': 3.2.1 - '@types/node': 18.19.54 + '@types/node': 18.19.55 '@types/node-fetch': 2.6.11 '@types/pretty-hrtime': 1.0.3 chalk: 4.1.2 @@ -18598,7 +18689,7 @@ packages: '@storybook/types': 7.6.20 '@types/escodegen': 0.0.6 '@types/estree': 0.0.51 - '@types/node': 18.19.54 + '@types/node': 18.19.55 acorn: 7.4.1 acorn-jsx: 5.3.2(acorn@7.4.1) acorn-walk: 7.2.0 @@ -19011,7 +19102,7 @@ packages: /@types/accepts@1.3.5: resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/acorn@4.0.6: @@ -19061,14 +19152,14 @@ packages: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: '@types/connect': 3.4.38 - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/cacheable-request@6.0.3: resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/responselike': 1.0.3 /@types/chai-subset@1.3.3: @@ -19089,18 +19180,18 @@ packages: resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} dependencies: '@types/express-serve-static-core': 5.0.0 - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/content-disposition@0.5.5: resolution: {integrity: sha512-v6LCdKfK6BwcqMo+wYW05rLS12S0ZO0Fl4w1h4aaZMD7bqT3gVUns6FvLJKGZHQmYn3SX55JWGpziwJRwVgutA==} @@ -19134,19 +19225,19 @@ packages: '@types/connect': 3.4.38 '@types/express': 5.0.0 '@types/keygrip': 1.0.2 - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/cross-spawn@6.0.6: resolution: {integrity: sha512-fXRhhUkG4H3TQk5dBhQ7m/JDdSNHKwR2BBia62lhwEIq9xGiQKLxd6LymNhn47SjXhsUEPmxi+PKw2OkW4LLjA==} dependencies: - '@types/node': 20.8.8 + '@types/node': 18.19.55 dev: false /@types/debug@0.0.30: @@ -19195,7 +19286,7 @@ packages: /@types/express-serve-static-core@4.19.6: resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/qs': 6.9.16 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -19203,7 +19294,7 @@ packages: /@types/express-serve-static-core@5.0.0: resolution: {integrity: sha512-AbXMTZGt40T+KON9/Fdxx0B2WK5hsgxcfXJLr5bFpZ7b4JCex2WyQPTEKdXqfHiY5nKKBScZ7yCoO6Pvgxfvnw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/qs': 6.9.16 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -19229,7 +19320,7 @@ packages: /@types/finalhandler@1.2.3: resolution: {integrity: sha512-I+Ba0JZEiuSr8LLjVmBhvLBEN8KG9GSITNXWwPCLeAvZj/k5pXEdOBEvnEEIgA038eeaauJ3BPxbuxeFBsqqUw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/find-cache-dir@3.2.1: @@ -19238,7 +19329,7 @@ packages: /@types/formidable@1.2.8: resolution: {integrity: sha512-6psvrUy5VDYb+yaPJReF1WrRsz+FBwyJutK9Twz1Efa27tm07bARNIkK2B8ZPWq80dXqpKfrxTO96xrtPp+AuA==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/fs-extra@9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} @@ -19253,25 +19344,24 @@ packages: resolution: {integrity: sha512-rTtf75rwyP9G2qO5yRpYtdJ6aU1QqEhWbtW55qEgquEDa6bXW0s2TWZfDm02GuppjEozOWG/F2UnPq5hAQb+gw==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.11.17 + '@types/node': 18.19.55 dev: false /@types/glob@7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.11.17 + '@types/node': 18.19.55 /@types/graceful-fs@4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/graceful-fs@4.1.9: resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} dependencies: - '@types/node': 22.7.5 - dev: true + '@types/node': 18.19.55 /@types/hast@2.3.4: resolution: {integrity: sha512-wLEm0QvaoawEDoTRwzTXp4b4jpwiJDvR5KMnFnVodm3scufTlBOWRD6N1OBf9TZMhjlNsSfcO5V+7AF4+Vy+9g==} @@ -19320,7 +19410,7 @@ packages: /@types/http-proxy@1.17.15: resolution: {integrity: sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/inquirer@8.2.10: @@ -19382,7 +19472,7 @@ packages: /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 @@ -19399,7 +19489,7 @@ packages: /@types/keyv@3.1.4: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/koa-compose@3.2.8: resolution: {integrity: sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==} @@ -19423,7 +19513,7 @@ packages: '@types/http-errors': 1.8.2 '@types/keygrip': 1.0.2 '@types/koa-compose': 3.2.8 - '@types/node': 18.11.17 + '@types/node': 18.19.55 dev: true /@types/less@3.0.6: @@ -19501,7 +19591,7 @@ packages: /@types/mkdirp@0.5.2: resolution: {integrity: sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==} dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 dev: false /@types/ms@0.7.31: @@ -19510,7 +19600,7 @@ packages: /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 form-data: 4.0.0 /@types/node@12.20.24: @@ -19530,31 +19620,16 @@ packages: /@types/node@18.11.17: resolution: {integrity: sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==} - /@types/node@18.19.54: - resolution: {integrity: sha512-+BRgt0G5gYjTvdLac9sIeE0iZcJxi4Jc4PV5EUzqi+88jmQLr+fRZdv2tCTV7IHKSGxM6SaLoOXQWWUiLUItMw==} - dependencies: - undici-types: 5.26.5 - /@types/node@18.19.55: resolution: {integrity: sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==} dependencies: undici-types: 5.26.5 - dev: false /@types/node@20.8.8: resolution: {integrity: sha512-YRsdVxq6OaLfmR9Hy816IMp33xOBjfyOgUd77ehqg96CFywxAPbDbXvAsuN2KVg2HOT8Eh6uAfU+l4WffwPVrQ==} dependencies: undici-types: 5.25.3 - - /@types/node@22.7.4: - resolution: {integrity: sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==} - dependencies: - undici-types: 6.19.8 - - /@types/node@22.7.5: - resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} - dependencies: - undici-types: 6.19.8 + dev: true /@types/node@8.10.66: resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} @@ -19655,19 +19730,19 @@ packages: /@types/recursive-readdir@2.2.4: resolution: {integrity: sha512-84REEGT3lcgopvpkmGApzmU5UEG0valme5rQS/KGiguTkJ70/Au8UYZTyrzoZnY9svuX9351+1uvrRPzWDD/uw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/responselike@1.0.3: resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 /@types/rimraf@2.0.5: resolution: {integrity: sha512-YyP+VfeaqAyFmXoTh3HChxOQMyjByRMsHU7kc5KOJkSlXudhMhQIALbYV7rHh/l8d2lX3VUQzprrcAgWdRuU8g==} dependencies: '@types/glob': 7.2.0 - '@types/node': 18.11.17 + '@types/node': 18.19.55 dev: false /@types/semver@7.5.0: @@ -19680,7 +19755,7 @@ packages: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} dependencies: '@types/mime': 1.3.5 - '@types/node': 22.7.4 + '@types/node': 18.19.55 /@types/serialize-javascript@5.0.4: resolution: {integrity: sha512-Z2R7UKFuNWCP8eoa2o9e5rkD3hmWxx/1L0CYz0k2BZzGh0PhEVMp9kfGiqEml/0IglwNERXZ2hwNzIrSz/KHTA==} @@ -19690,7 +19765,7 @@ packages: resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} dependencies: '@types/http-errors': 2.0.4 - '@types/node': 22.7.4 + '@types/node': 18.19.55 '@types/send': 0.17.4 /@types/signal-exit@3.0.4: @@ -19700,7 +19775,7 @@ packages: /@types/signale@1.4.7: resolution: {integrity: sha512-nc0j37QupTT7OcYeH3gRE1ZfzUalEUsDKJsJ3IsJr0pjjFZTjtrX1Bsn6Kv56YXI/H9rNSwAkIPRxNlZI8GyQw==} dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 dev: true /@types/source-list-map@0.1.6: @@ -19728,7 +19803,7 @@ packages: dependencies: '@types/cookiejar': 2.1.5 '@types/methods': 1.1.4 - '@types/node': 14.18.35 + '@types/node': 18.19.55 form-data: 4.0.0 dev: true @@ -19754,7 +19829,7 @@ packages: /@types/through@0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/tmp@0.0.33: @@ -19767,7 +19842,7 @@ packages: /@types/type-is@1.6.6: resolution: {integrity: sha512-fs1KHv/f9OvmTMsu4sBNaUu32oyda9Y9uK25naJG8gayxNrfqGIjPQsbLIYyfe7xFkppnPlJB+BuTldOaX9bXw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true /@types/ua-parser-js@0.7.39: @@ -19796,14 +19871,14 @@ packages: /@types/webpack-sources@3.2.3: resolution: {integrity: sha512-4nZOdMwSPHZ4pTEZzSp0AsTM4K7Qmu40UKW4tJDiOVs20UzYF9l+qUe4s0ftfN0pin06n+5cWWDJXH+sbhAiDw==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/source-list-map': 0.1.6 source-map: 0.7.4 /@types/webpack@4.41.39: resolution: {integrity: sha512-otxUJvoi6FbBq/64gGH34eblpKLgdi+gf08GaAh8Bx6So0ZZic028Ev/SUxD22gbthMKCkeeiXEat1kHLDJfYg==} dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 '@types/tapable': 1.0.12 '@types/uglify-js': 3.17.5 '@types/webpack-sources': 3.2.3 @@ -19813,7 +19888,7 @@ packages: /@types/webpack@5.28.0(esbuild@0.17.19): resolution: {integrity: sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==} dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 tapable: 2.2.1 webpack: 5.95.0(esbuild@0.17.19) transitivePeerDependencies: @@ -19846,7 +19921,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 14.18.35 + '@types/node': 18.19.55 dev: true optional: true @@ -19867,7 +19942,7 @@ packages: async-sema: 3.1.1 bindings: 1.5.0 estree-walker: 2.0.2 - glob: 7.2.0 + glob: 7.2.3 graceful-fs: 4.2.11 micromatch: 4.0.5 node-gyp-build: 4.4.0 @@ -22116,11 +22191,11 @@ packages: /commander@10.0.0: resolution: {integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==} engines: {node: '>=14'} + dev: false /commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} - dev: true /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -22453,7 +22528,7 @@ packages: vary: 1.1.2 dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@22.7.5)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.5): + /cosmiconfig-typescript-loader@4.3.0(@types/node@18.19.55)(cosmiconfig@8.3.6)(ts-node@10.9.2)(typescript@5.4.5): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -22462,9 +22537,9 @@ packages: ts-node: '>=10' typescript: '>=3' dependencies: - '@types/node': 22.7.5 + '@types/node': 18.19.55 cosmiconfig: 8.3.6(typescript@5.4.5) - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) typescript: 5.4.5 dev: true @@ -23292,7 +23367,7 @@ packages: debug: 3.2.7 eol: 0.9.1 get-port: 3.2.0 - glob: 7.2.0 + glob: 7.2.3 is-valid-domain: 0.1.6 lodash: 4.17.21 mkdirp: 0.5.6 @@ -23599,7 +23674,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 14.18.35 + '@types/node': 18.19.55 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -24516,6 +24591,7 @@ packages: /extra@0.2.1: resolution: {integrity: sha512-PWEUSjpFNAFk6W3wAcyPR8SW48wKGvtZUz/OP4eUZUbrFPakU4YYRUKTxMAKZDndlnAjBUuLV1L67IpmlkJbBg==} + dev: true /extract-zip@1.7.0: resolution: {integrity: sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==} @@ -24534,7 +24610,7 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true dependencies: - debug: 4.3.4 + debug: 4.3.7(supports-color@9.3.1) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -24647,7 +24723,6 @@ packages: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} dependencies: bser: 2.1.1 - dev: true /fbemitter@3.0.0: resolution: {integrity: sha512-KWKaceCwKQU0+HPoop6gn4eOHk50bBv/VxjJtGMfwmJt3D29JpN4H4eisCtIPA+a8GVBam+ldMMpMjJUvpDyHw==} @@ -25080,7 +25155,6 @@ packages: graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 - dev: true /fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} @@ -25389,6 +25463,7 @@ packages: /glob@7.2.0: resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -25396,7 +25471,6 @@ packages: minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 - dev: false /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} @@ -25472,7 +25546,7 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.11 - ignore: 5.3.0 + ignore: 5.3.2 merge2: 1.4.1 slash: 3.0.0 @@ -26187,6 +26261,7 @@ packages: /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} + dev: true /ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} @@ -26285,6 +26360,7 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 through: 2.3.8 + dev: true /inquirer@8.2.6: resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} @@ -26869,18 +26945,18 @@ packages: '@jest/environment': 29.5.0 '@jest/expect': 29.5.0 '@jest/test-result': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 is-generator-fn: 2.1.0 jest-each: 29.5.0 jest-matcher-utils: 29.7.0 - jest-message-util: 29.5.0 + jest-message-util: 29.7.0 jest-runtime: 29.5.0 jest-snapshot: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 p-limit: 3.1.0 pretty-format: 29.7.0 pure-rand: 6.0.1 @@ -26901,13 +26977,13 @@ packages: dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) '@jest/test-result': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 jest-config: 29.5.0(@types/node@14.18.35)(ts-node@10.9.2) - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 prompts: 2.4.2 yargs: 17.7.1 @@ -26928,13 +27004,13 @@ packages: dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) '@jest/test-result': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 jest-config: 29.5.0(@types/node@16.11.68)(ts-node@10.9.2) - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 prompts: 2.4.2 yargs: 17.7.1 @@ -26944,7 +27020,7 @@ packages: - ts-node dev: true - /jest-cli@29.5.0(@types/node@22.7.5)(ts-node@10.9.2): + /jest-cli@29.5.0(@types/node@18.19.55)(ts-node@10.9.2): resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -26956,13 +27032,13 @@ packages: dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) '@jest/test-result': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.5.0(@types/node@22.7.5)(ts-node@10.9.2) - jest-util: 29.5.0 + jest-config: 29.5.0(@types/node@18.19.55)(ts-node@10.9.2) + jest-util: 29.7.0 jest-validate: 29.5.0 prompts: 2.4.2 yargs: 17.7.1 @@ -26986,28 +27062,28 @@ packages: dependencies: '@babel/core': 7.25.8 '@jest/test-sequencer': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@types/node': 14.18.35 babel-jest: 29.5.0(@babel/core@7.25.8) chalk: 4.1.2 - ci-info: 3.3.2 + ci-info: 3.9.0 deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 jest-circus: 29.5.0 jest-environment-node: 29.5.0 jest-get-type: 29.6.3 - jest-regex-util: 29.4.3 + jest-regex-util: 29.6.3 jest-resolve: 29.5.0 jest-runner: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 - micromatch: 4.0.5 + micromatch: 4.0.8 parse-json: 5.2.0 pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) transitivePeerDependencies: - supports-color @@ -27025,72 +27101,33 @@ packages: dependencies: '@babel/core': 7.25.8 '@jest/test-sequencer': 29.5.0 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@types/node': 16.11.68 babel-jest: 29.5.0(@babel/core@7.25.8) chalk: 4.1.2 - ci-info: 3.3.2 + ci-info: 3.9.0 deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 jest-circus: 29.5.0 jest-environment-node: 29.5.0 jest-get-type: 29.6.3 - jest-regex-util: 29.4.3 + jest-regex-util: 29.6.3 jest-resolve: 29.5.0 jest-runner: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 - micromatch: 4.0.5 + micromatch: 4.0.8 parse-json: 5.2.0 pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true - /jest-config@29.5.0(@types/node@18.11.17)(ts-node@10.9.2): - resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.25.8 - '@jest/test-sequencer': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 18.11.17 - babel-jest: 29.5.0(@babel/core@7.25.8) - chalk: 4.1.2 - ci-info: 3.3.2 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.5.0 - jest-environment-node: 29.5.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.5.0 - jest-runner: 29.5.0 - jest-util: 29.5.0 - jest-validate: 29.5.0 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) - transitivePeerDependencies: - - supports-color - - /jest-config@29.5.0(@types/node@22.7.5)(ts-node@10.9.2): + /jest-config@29.5.0(@types/node@18.19.55)(ts-node@10.9.2): resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -27104,31 +27141,30 @@ packages: dependencies: '@babel/core': 7.25.8 '@jest/test-sequencer': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 22.7.5 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 babel-jest: 29.5.0(@babel/core@7.25.8) chalk: 4.1.2 - ci-info: 3.3.2 + ci-info: 3.9.0 deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 jest-circus: 29.5.0 jest-environment-node: 29.5.0 jest-get-type: 29.6.3 - jest-regex-util: 29.4.3 + jest-regex-util: 29.6.3 jest-resolve: 29.5.0 jest-runner: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 - micromatch: 4.0.5 + micromatch: 4.0.8 parse-json: 5.2.0 pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) transitivePeerDependencies: - supports-color - dev: true /jest-dev-server@8.0.5: resolution: {integrity: sha512-pgf6R6r9z9Cf+9wGEXV24hIPYPPBPpJtETJm4O1hWtnaSiDshOsgQNOLB3EmoZIq+fAfZuLsuaxETf33GhJNGg==} @@ -27175,10 +27211,10 @@ packages: resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 chalk: 4.1.2 jest-get-type: 29.6.3 - jest-util: 29.5.0 + jest-util: 29.7.0 pretty-format: 29.7.0 /jest-environment-jsdom@29.5.0: @@ -27194,7 +27230,7 @@ packages: '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 '@types/jsdom': 20.0.1 - '@types/node': 18.11.17 + '@types/node': 18.19.55 jest-mock: 29.5.0 jest-util: 29.5.0 jsdom: 20.0.3 @@ -27210,7 +27246,7 @@ packages: '@jest/environment': 29.5.0 '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.11.17 + '@types/node': 18.19.55 jest-mock: 29.5.0 jest-util: 29.5.0 @@ -27246,9 +27282,9 @@ packages: resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.5 - '@types/node': 14.18.35 + '@types/node': 18.19.55 anymatch: 3.1.3 fb-watchman: 2.0.1 graceful-fs: 4.2.11 @@ -27266,7 +27302,7 @@ packages: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 22.7.5 + '@types/node': 18.19.55 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -27277,7 +27313,6 @@ packages: walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 - dev: true /jest-leak-detector@29.5.0: resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==} @@ -27308,7 +27343,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.25.7 - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 graceful-fs: 4.2.11 @@ -27335,8 +27370,8 @@ packages: resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 jest-util: 29.5.0 /jest-pnp-resolver@1.2.2(jest-resolve@29.5.0): @@ -27372,7 +27407,6 @@ packages: /jest-regex-util@29.6.3: resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dev: true /jest-resolve-dependencies@29.5.0: resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==} @@ -27389,9 +27423,9 @@ packages: dependencies: chalk: 4.1.2 graceful-fs: 4.2.11 - jest-haste-map: 29.5.0 + jest-haste-map: 29.7.0 jest-pnp-resolver: 1.2.2(jest-resolve@29.5.0) - jest-util: 29.5.0 + jest-util: 29.7.0 jest-validate: 29.5.0 resolve: 1.22.8 resolve.exports: 2.0.1 @@ -27404,22 +27438,22 @@ packages: '@jest/console': 29.5.0 '@jest/environment': 29.5.0 '@jest/test-result': 29.5.0 - '@jest/transform': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 jest-docblock: 29.4.3 jest-environment-node: 29.5.0 - jest-haste-map: 29.5.0 + jest-haste-map: 29.7.0 jest-leak-detector: 29.5.0 - jest-message-util: 29.5.0 + jest-message-util: 29.7.0 jest-resolve: 29.5.0 jest-runtime: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 jest-watcher: 29.5.0 - jest-worker: 29.5.0 + jest-worker: 29.7.0 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: @@ -27434,21 +27468,21 @@ packages: '@jest/globals': 29.5.0 '@jest/source-map': 29.4.3 '@jest/test-result': 29.5.0 - '@jest/transform': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-haste-map: 29.5.0 - jest-message-util: 29.5.0 + jest-haste-map: 29.7.0 + jest-message-util: 29.7.0 jest-mock: 29.5.0 - jest-regex-util: 29.4.3 + jest-regex-util: 29.6.3 jest-resolve: 29.5.0 jest-snapshot: 29.5.0 - jest-util: 29.5.0 + jest-util: 29.7.0 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: @@ -27465,8 +27499,8 @@ packages: '@babel/traverse': 7.25.7 '@babel/types': 7.25.8 '@jest/expect-utils': 29.7.0 - '@jest/transform': 29.5.0 - '@jest/types': 29.5.0 + '@jest/transform': 29.7.0 + '@jest/types': 29.6.3 '@types/babel__traverse': 7.20.6 '@types/prettier': 2.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.25.8) @@ -27476,8 +27510,8 @@ packages: jest-diff: 29.7.0 jest-get-type: 29.6.3 jest-matcher-utils: 29.7.0 - jest-message-util: 29.5.0 - jest-util: 29.5.0 + jest-message-util: 29.7.0 + jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 semver: 7.6.3 @@ -27489,7 +27523,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@types/node': 18.19.55 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.11 @@ -27500,7 +27534,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.3 - '@types/node': 14.18.35 + '@types/node': 18.19.55 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -27510,7 +27544,7 @@ packages: resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 camelcase: 6.3.0 chalk: 4.1.2 jest-get-type: 29.6.3 @@ -27522,19 +27556,19 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/test-result': 29.5.0 - '@jest/types': 29.5.0 - '@types/node': 14.18.35 + '@jest/types': 29.6.3 + '@types/node': 18.19.55 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 - jest-util: 29.5.0 + jest-util: 29.7.0 string-length: 4.0.2 /jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -27542,7 +27576,7 @@ packages: resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 22.7.4 + '@types/node': 18.19.55 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -27551,11 +27585,10 @@ packages: resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 22.7.5 + '@types/node': 18.19.55 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - dev: true /jest@29.5.0(@types/node@14.18.35)(ts-node@10.9.2): resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} @@ -27568,7 +27601,7 @@ packages: optional: true dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 import-local: 3.1.0 jest-cli: 29.5.0(@types/node@14.18.35)(ts-node@10.9.2) transitivePeerDependencies: @@ -27587,7 +27620,7 @@ packages: optional: true dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 import-local: 3.1.0 jest-cli: 29.5.0(@types/node@16.11.68)(ts-node@10.9.2) transitivePeerDependencies: @@ -27596,7 +27629,7 @@ packages: - ts-node dev: true - /jest@29.5.0(@types/node@22.7.5)(ts-node@10.9.2): + /jest@29.5.0(@types/node@18.19.55)(ts-node@10.9.2): resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -27607,9 +27640,9 @@ packages: optional: true dependencies: '@jest/core': 29.5.0(ts-node@10.9.2) - '@jest/types': 29.5.0 + '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.5.0(@types/node@22.7.5)(ts-node@10.9.2) + jest-cli: 29.5.0(@types/node@18.19.55)(ts-node@10.9.2) transitivePeerDependencies: - '@types/node' - supports-color @@ -27998,7 +28031,7 @@ packages: dependencies: chalk: 5.2.0 cli-truncate: 3.1.0 - commander: 10.0.0 + commander: 10.0.1 debug: 4.3.7(supports-color@9.3.1) execa: 7.1.1 lilconfig: 2.1.0 @@ -28132,13 +28165,15 @@ packages: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} dev: true + /lodash.flattendeep@4.4.0: + resolution: {integrity: sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==} + /lodash.flow@3.5.0: resolution: {integrity: sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==} dev: true /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} - dev: false /lodash.invokemap@4.6.0: resolution: {integrity: sha512-CfkycNtMqgUlfjfdh2BhKO/ZXrP8ePOX5lEU/g0R3ItJcnuxWDwokMGKx1hWcfOikmyOVx6X9IwWnDGlgKl61w==} @@ -28150,12 +28185,17 @@ packages: /lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} - dev: true + + /lodash.isobject@3.0.2: + resolution: {integrity: sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==} /lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} dev: true + /lodash.isstring@4.0.1: + resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + /lodash.kebabcase@4.1.1: resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} dev: true @@ -30461,7 +30501,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.35 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) yaml: 1.10.2 dev: false @@ -30479,7 +30519,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.47 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) yaml: 1.10.2 dev: false @@ -30497,7 +30537,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.35 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@18.19.55)(typescript@5.4.5) yaml: 2.2.1 /postcss-media-minmax@5.0.0(postcss@8.4.35): @@ -34179,6 +34219,7 @@ packages: /rslog@1.2.3: resolution: {integrity: sha512-antALPJaKBRPBU1X2q9t085K4htWDOOv/K1qhTUk7h0l1ePU/KbDqKJn19eKP0dk7PqMioeA0+fu3gyPXCsXxQ==} engines: {node: '>=14.17.6'} + dev: true /rspack-manifest-plugin@5.0.1: resolution: {integrity: sha512-K2g7kcOdj+cHTi+xvzwdLZ4rdL1nnphJhs9P8VH5sVcoQd1U/FxpNXnEm5ARxhE7qZO0yfqaL74aXwcQH0T0Ig==} @@ -34854,7 +34895,6 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 - dev: false /semver@7.6.3: resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} @@ -35942,18 +35982,6 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 - /tar@6.2.0: - resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} - engines: {node: '>=10'} - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 5.0.0 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - dev: false - /tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} @@ -36486,7 +36514,7 @@ packages: yn: 3.1.1 dev: true - /ts-node@10.9.2(@types/node@22.7.5)(typescript@5.4.5): + /ts-node@10.9.2(@types/node@18.19.55)(typescript@5.4.5): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true peerDependencies: @@ -36505,7 +36533,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.7.5 + '@types/node': 18.19.55 acorn: 8.12.1 acorn-walk: 8.3.4 arg: 4.1.3 @@ -36811,13 +36839,11 @@ packages: /undici-types@5.25.3: resolution: {integrity: sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==} + dev: true /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - /undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - /unherit@1.1.3: resolution: {integrity: sha512-Ft16BJcnapDKp0+J/rqFC3Rrk6Y/Ng4nzsC028k2jdDII/rdZ7Wd3pPT/6+vIIxRagwRc9K0IUX0Ra4fKvw+WQ==} dependencies: @@ -37337,7 +37363,7 @@ packages: vfile-message: 4.0.2 dev: true - /vite-node@0.33.0(@types/node@18.11.17): + /vite-node@0.33.0(@types/node@18.19.55): resolution: {integrity: sha512-19FpHYbwWWxDr73ruNahC+vtEdza52kA90Qb3La98yZ0xULqV8A5JLNPUff0f5zID4984tW7l3DH2przTJUZSw==} engines: {node: '>=v14.18.0'} hasBin: true @@ -37347,7 +37373,7 @@ packages: mlly: 1.7.2 pathe: 1.1.1 picocolors: 1.1.0 - vite: 4.5.2(@types/node@18.11.17) + vite: 4.5.2(@types/node@18.19.55) transitivePeerDependencies: - '@types/node' - less @@ -37359,7 +37385,7 @@ packages: - terser dev: true - /vite@4.5.2(@types/node@18.11.17): + /vite@4.5.2(@types/node@18.19.55): resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -37387,7 +37413,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.11.17 + '@types/node': 18.19.55 esbuild: 0.17.19 postcss: 8.4.47 rollup: 3.29.5 @@ -37428,7 +37454,7 @@ packages: dependencies: '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 - '@types/node': 18.11.17 + '@types/node': 18.19.55 '@vitest/expect': 0.33.0 '@vitest/runner': 0.33.0 '@vitest/snapshot': 0.33.0 @@ -37448,8 +37474,8 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.6.0 - vite: 4.5.2(@types/node@18.11.17) - vite-node: 0.33.0(@types/node@18.11.17) + vite: 4.5.2(@types/node@18.19.55) + vite-node: 0.33.0(@types/node@18.19.55) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/scripts/build/src/index.js b/scripts/build/src/index.js index 275c8c08af50..39ab5c8360e3 100644 --- a/scripts/build/src/index.js +++ b/scripts/build/src/index.js @@ -176,18 +176,30 @@ const tscLikeBuildConfig = [ ]; const generatorBuildConfig = { - target: 'es2019', + format: 'umd', autoExternal: false, - alias: { - chalk: '@modern-js/utils/chalk', - }, dts: false, - externals: [ - '@modern-js/utils', - '@modern-js/utils/lodash', - '@modern-js/utils/fs-extra', - '@modern-js/utils/chalk', - ], + umdGlobals: { + '@modern-js/codesmith': 'codesmith', + '@modern-js/codesmith-api-app': 'codesmithApiApp', + '@modern-js/codesmith-api-git': 'codesmithApiGit', + '@modern-js/codesmith-api-npm': 'codesmithApiNpm', + '@modern-js/codesmith-api-ejs': 'codesmithApiEjs', + '@modern-js/codesmith-api-fs': 'codesmithApiFs', + '@modern-js/codesmith-api-handlebars': 'codesmithApiHandlebars', + '@modern-js/codesmith-api-json': 'codesmithApiJson', + '@modern-js/codesmith-formily': 'codesmithFormily', + '@modern-js/codesmith-utils': 'codesmithUtils', + '@modern-js/codesmith-utils/lodash': 'codesmithLodashUtils', + '@modern-js/codesmith-utils/glob': 'codesmithGlobUtils', + '@modern-js/codesmith-utils/fs-extra': 'codesmithFsUtils', + '@modern-js/codesmith-utils/chalk': 'codesmithChalkUtils', + '@modern-js/codesmith-utils/execa': 'codesmithExecaUtils', + '@modern-js/codesmith-utils/npm': 'codesmithNpmUtils', + '@modern-js/codesmith-utils/ora': 'codesmithOraUtils', + '@modern-js/codesmith-utils/semver': 'codesmithSemverUtils', + '@modern-js/plugin-i18n': 'pluginI18N', + }, }; module.exports = { diff --git a/tests/jest-ut.config.js b/tests/jest-ut.config.js index 79384aaf5f60..2c352a051475 100644 --- a/tests/jest-ut.config.js +++ b/tests/jest-ut.config.js @@ -55,6 +55,7 @@ module.exports = { '/packages/toolkit/e2e/', '/packages/(server|solutions)/', '/packages/(server|solutions)/', + '/packages/generator/', ], rootDir: path.join(__dirname, '../'), testEnvironment: '/tests/jest.env.js', @@ -104,6 +105,7 @@ module.exports = { testPathIgnorePatterns: [ '/packages/uni-builder/', '/packages/toolkit/e2e/', + '/packages/generator/', ], rootDir: path.join(__dirname, '../'), testEnvironment: 'node', @@ -114,5 +116,52 @@ module.exports = { '/packages/solutions/**/tests/**/*.test.[jt]s?(x)', ], }, + { + setupFiles: [], + transform: { + '\\.[jt]sx?$': [ + require.resolve('@swc/jest'), + { + jsc: { + parser: { + syntax: 'typescript', + decorators: true, + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + ], + }, + moduleNameMapper: { + '^@modern-js/generator-common$': + '/packages/generator/generator-common/src', + '^@modern-js/generator-utils$': + '/packages/generator/generator-utils/src', + '^@modern-js/generator-plugin$': + '/packages/generator/generator-plugin/src', + '^@modern-js/plugin-i18n$': '/packages/cli/plugin-i18n/src', + }, + globals: {}, + transformIgnorePatterns: [], + modulePathIgnorePatterns: [ + '/packages/cli/uni-builder/', + '/packages/toolkit/e2e/', + '/packages/solutions/module-tools/compiled/', + '/packages/toolkit/utils/compiled/', + '/.nx-cache', + '/.nx', + ], + testPathIgnorePatterns: [], + rootDir: path.join(__dirname, '../'), + testEnvironment: 'node', + testMatch: [ + '/packages/generator/**/src/**/*.test.[jt]s?(x)', + '/packages/generator/**/tests/**/*.test.[jt]s?(x)', + ], + }, ], };