@modern-js/module-tools 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @modern-js/module-tools
2
2
 
3
+ ## 2.8.0
4
+
5
+ ### Patch Changes
6
+
7
+ - adf68ec3ed: fix: ignore some tsconfig compileOptions
8
+ fix: 忽略一些 tsconfig 的 compileOptions 配置
9
+ - Updated dependencies [1e7c2c5a65]
10
+ - Updated dependencies [1104a9f18b]
11
+ - Updated dependencies [45d726979b]
12
+ - Updated dependencies [1f6ca2c7fb]
13
+ - @modern-js/plugin-changeset@2.8.0
14
+ - @modern-js/utils@2.8.0
15
+ - @modern-js/core@2.8.0
16
+ - @modern-js/plugin-i18n@2.8.0
17
+ - @modern-js/plugin-lint@2.8.0
18
+ - @modern-js/new-action@2.8.0
19
+ - @modern-js/upgrade@2.8.0
20
+ - @modern-js/plugin@2.8.0
21
+
3
22
  ## 2.7.0
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -19,8 +19,8 @@ Please follow [Quick Start](https://modernjs.dev/module-tools/en/guide/intro/get
19
19
 
20
20
  ## Contributing
21
21
 
22
- Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
22
+ Please read the [Contributing Guide](https://github.com/web-infra-dev/modern.js/blob/main/CONTRIBUTING.md).
23
23
 
24
24
  ## License
25
25
 
26
- Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
26
+ Modern.js is [MIT licensed](https://github.com/web-infra-dev/modern.js/blob/main/LICENSE).
@@ -87,7 +87,14 @@ const runRollup = (_0, _1) => __async(void 0, [_0, _1], function* (api, { distDi
87
87
  );
88
88
  const { default: jsonPlugin } = yield Promise.resolve().then(() => __toESM(require("../../../compiled/@rollup/plugin-json")));
89
89
  const { default: dtsPlugin } = yield Promise.resolve().then(() => __toESM(require("../../../compiled/rollup-plugin-dts")));
90
+ const { transformUndefineObject } = yield Promise.resolve().then(() => __toESM(require("../../utils/common")));
90
91
  const baseUrl = import_path.default.isAbsolute(options.baseUrl || ".") ? options.baseUrl : import_path.default.join(import_path.default.dirname(tsconfigPath), options.baseUrl || ".");
92
+ const ignoreCompileOptions = [
93
+ "incremental",
94
+ "tsBuildInfoFile",
95
+ "sourceMap",
96
+ "inlineSources"
97
+ ];
91
98
  const inputConfig = {
92
99
  input,
93
100
  external: externals,
@@ -97,7 +104,7 @@ const runRollup = (_0, _1) => __async(void 0, [_0, _1], function* (api, { distDi
97
104
  dtsPlugin({
98
105
  // use external to prevent them which come from node_modules from be bundled.
99
106
  respectExternal: true,
100
- compilerOptions: __spreadProps(__spreadValues({
107
+ compilerOptions: __spreadValues(__spreadProps(__spreadValues({
101
108
  declarationMap: false,
102
109
  skipLibCheck: true,
103
110
  // https://github.com/Swatinem/rollup-plugin-dts/issues/143,
@@ -119,7 +126,7 @@ const runRollup = (_0, _1) => __async(void 0, [_0, _1], function* (api, { distDi
119
126
  checkJs: false,
120
127
  // Ensure we can parse the latest code
121
128
  target: ts.ScriptTarget.ESNext
122
- }),
129
+ }), transformUndefineObject(ignoreCompileOptions)),
123
130
  tsconfig: tsconfigPath
124
131
  })
125
132
  ].filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAwBV,MAAM,YAAY,CACvB,IACA,OACG,iBAFH,IACA,KACG,WAFH,KACA,EAAE,SAAS,cAAc,WAAW,OAAO,MAAM,GAC9C;AACH,QAAM,cAAsB;AAAA,IAC1B,MAAM;AAAA,IACN,KAAK,IAAI;AACP,UAAI,CAAC,kCAAkC,KAAK,EAAE,GAAG;AAC/C,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAAA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,IAAI,eAAe;AAClC,UAAM,UAAUA,OAAM,iCACjB,cADiB;AAAA,MAEpB,SAAS,YAAY;AAAA,MACrB,QAAQ;AAAA,IACV,EAAC,EAAE,GAAG,SAAS,CAAM,UAAS;AAC5B,UAAI,MAAM,SAAS,SAAS;AAC1B,gBAAQ;AAAA,UACN,MAAM,kBAAkB,oBAAoB,mBAAmB,GAAG;AAAA,QACpE;AAAA,MACF,WAAW,MAAM,SAAS,cAAc;AACtC,gBAAQ;AAAA,UACN,MAAM;AAAA,YACJ;AAAA,YACA,mBAAmB;AAAA,UACrB;AAAA,QACF;AACA,eAAO,cAAc,EAAE,WAAW,SAAS,CAAC;AAAA,MAC9C,WAAW,MAAM,SAAS,SAAS;AAAA,MAEnC;AAAA,IACF,EAAC;AACD,WAAO;AAAA,EACT,OAAO;AACL,QAAI;AACF,YAAM,EAAE,OAAO,IAAI,MAAM,6CAAO,0BAA0B;AAC1D,YAAM,EAAE,eAAe,IAAI,MAAM,6CAAO,mBAAmB;AAC3D,YAAM,SAAS,MAAM,OAAO,WAAW;AACvC,YAAM,eAAe,MAAM,OAAO,MAAM,YAAY;AACpD,YAAM,EAAE,aAAa,IAAI,IAAI,cAAc;AAC3C,qBAAe,cAAc,cAAc,aAAa,GAAI;AAC5D,aAAO;AAAA,IACT,SAAS,GAAP;AACA,UAAI,aAAa,OAAO;AACtB,cAAM,EAAE,iBAAiB,IAAI,MAAM,6CAAO,aAAa;AACvD,cAAM,IAAI,iBAAiB,GAAG;AAAA,UAC5B,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;;;;;","names":["watch"],"sources":["../../../src/builder/dts/rollup.ts"],"sourcesContent":["import path from 'path';\nimport type {\n InputOptions,\n OutputOptions,\n Plugin,\n RollupWatcher,\n} from '../../../compiled/rollup';\nimport type {\n BaseBuildConfig,\n Input,\n PluginAPI,\n ModuleTools,\n} from '../../types';\n\nexport type { RollupWatcher };\n\ntype Config = {\n distDir: string;\n tsconfigPath: string;\n externals: BaseBuildConfig['externals'];\n input: Input;\n watch: boolean;\n};\n\nexport const runRollup = async (\n api: PluginAPI<ModuleTools>,\n { distDir, tsconfigPath, externals, input, watch }: Config,\n) => {\n const ignoreFiles: Plugin = {\n name: 'ignore-files',\n load(id) {\n if (!/\\.(js|jsx|ts|tsx|json|cts|mts)$/.test(id)) {\n return '';\n }\n return null;\n },\n };\n const ts = await import('typescript');\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n const { options } = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n './',\n );\n\n const { default: jsonPlugin } = await import(\n '../../../compiled/@rollup/plugin-json'\n );\n const { default: dtsPlugin } = await import(\n '../../../compiled/rollup-plugin-dts'\n );\n const baseUrl = path.isAbsolute(options.baseUrl || '.')\n ? options.baseUrl\n : path.join(path.dirname(tsconfigPath), options.baseUrl || '.');\n const inputConfig: InputOptions = {\n input,\n external: externals,\n plugins: [\n jsonPlugin(),\n ignoreFiles,\n dtsPlugin({\n // use external to prevent them which come from node_modules from be bundled.\n respectExternal: true,\n compilerOptions: {\n declarationMap: false,\n skipLibCheck: true,\n // https://github.com/Swatinem/rollup-plugin-dts/issues/143,\n // but it will cause error when bundle ts which import another ts file.\n preserveSymlinks: false,\n ...options,\n // https://github.com/Swatinem/rollup-plugin-dts/issues/127\n composite: false,\n // isAbsolute\n baseUrl,\n // Ensure \".d.ts\" modules are generated\n declaration: true,\n // Skip \".js\" generation\n noEmit: false,\n emitDeclarationOnly: true,\n // Skip code generation when error occurs\n noEmitOnError: true,\n // Avoid extra work\n checkJs: false,\n // Ensure we can parse the latest code\n target: ts.ScriptTarget.ESNext,\n },\n tsconfig: tsconfigPath,\n }),\n ].filter(Boolean),\n };\n const outputConfig: OutputOptions = {\n dir: distDir,\n format: 'esm',\n exports: 'named',\n };\n if (watch) {\n const { watch } = await import('../../../compiled/rollup');\n const { watchSectionTitle } = await import('../../utils/log');\n const { SectionTitleStatus, BundleDtsLogPrefix } = await import(\n '../../constants/log'\n );\n const runner = api.useHookRunners();\n const watcher = watch({\n ...inputConfig,\n plugins: inputConfig.plugins,\n output: outputConfig,\n }).on('event', async event => {\n if (event.code === 'START') {\n console.info(\n await watchSectionTitle(BundleDtsLogPrefix, SectionTitleStatus.Log),\n );\n } else if (event.code === 'BUNDLE_END') {\n console.info(\n await watchSectionTitle(\n BundleDtsLogPrefix,\n SectionTitleStatus.Success,\n ),\n );\n runner.buildWatchDts({ buildType: 'bundle' });\n } else if (event.code === 'ERROR') {\n // this is dts rollup plugin bug, error not complete message\n }\n });\n return watcher;\n } else {\n try {\n const { rollup } = await import('../../../compiled/rollup');\n const { addRollupChunk } = await import('../../utils/print');\n const bundle = await rollup(inputConfig);\n const rollupOutput = await bundle.write(outputConfig);\n const { appDirectory } = api.useAppContext();\n addRollupChunk(rollupOutput, appDirectory, outputConfig.dir!);\n return bundle;\n } catch (e) {\n if (e instanceof Error) {\n const { InternalDTSError } = await import('../../error');\n throw new InternalDTSError(e, {\n buildType: 'bundle',\n });\n }\n throw e;\n }\n }\n};\n"]}
1
+ {"version":3,"file":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAwBV,MAAM,YAAY,CACvB,IACA,OACG,iBAFH,IACA,KACG,WAFH,KACA,EAAE,SAAS,cAAc,WAAW,OAAO,MAAM,GAC9C;AACH,QAAM,cAAsB;AAAA,IAC1B,MAAM;AAAA,IACN,KAAK,IAAI;AACP,UAAI,CAAC,kCAAkC,KAAK,EAAE,GAAG;AAC/C,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,KAAK,MAAM,6CAAO,YAAY;AACpC,QAAM,aAAa,GAAG,eAAe,cAAc,GAAG,IAAI,QAAQ;AAClE,QAAM,EAAE,QAAQ,IAAI,GAAG;AAAA,IACr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SAAS,IAAI,eAAe;AAClC,UAAM,UAAUA,OAAM,iCACjB,cADiB;AAAA,MAEpB,SAAS,YAAY;AAAA,MACrB,QAAQ;AAAA,IACV,EAAC,EAAE,GAAG,SAAS,CAAM,UAAS;AAC5B,UAAI,MAAM,SAAS,SAAS;AAC1B,gBAAQ;AAAA,UACN,MAAM,kBAAkB,oBAAoB,mBAAmB,GAAG;AAAA,QACpE;AAAA,MACF,WAAW,MAAM,SAAS,cAAc;AACtC,gBAAQ;AAAA,UACN,MAAM;AAAA,YACJ;AAAA,YACA,mBAAmB;AAAA,UACrB;AAAA,QACF;AACA,eAAO,cAAc,EAAE,WAAW,SAAS,CAAC;AAAA,MAC9C,WAAW,MAAM,SAAS,SAAS;AAAA,MAEnC;AAAA,IACF,EAAC;AACD,WAAO;AAAA,EACT,OAAO;AACL,QAAI;AACF,YAAM,EAAE,OAAO,IAAI,MAAM,6CAAO,0BAA0B;AAC1D,YAAM,EAAE,eAAe,IAAI,MAAM,6CAAO,mBAAmB;AAC3D,YAAM,SAAS,MAAM,OAAO,WAAW;AACvC,YAAM,eAAe,MAAM,OAAO,MAAM,YAAY;AACpD,YAAM,EAAE,aAAa,IAAI,IAAI,cAAc;AAC3C,qBAAe,cAAc,cAAc,aAAa,GAAI;AAC5D,aAAO;AAAA,IACT,SAAS,GAAP;AACA,UAAI,aAAa,OAAO;AACtB,cAAM,EAAE,iBAAiB,IAAI,MAAM,6CAAO,aAAa;AACvD,cAAM,IAAI,iBAAiB,GAAG;AAAA,UAC5B,WAAW;AAAA,QACb,CAAC;AAAA,MACH;AACA,YAAM;AAAA,IACR;AAAA,EACF;AACF;;;;;","names":["watch"],"sources":["../../../src/builder/dts/rollup.ts"],"sourcesContent":["import path from 'path';\nimport type {\n InputOptions,\n OutputOptions,\n Plugin,\n RollupWatcher,\n} from '../../../compiled/rollup';\nimport type {\n BaseBuildConfig,\n Input,\n PluginAPI,\n ModuleTools,\n} from '../../types';\n\nexport type { RollupWatcher };\n\ntype Config = {\n distDir: string;\n tsconfigPath: string;\n externals: BaseBuildConfig['externals'];\n input: Input;\n watch: boolean;\n};\n\nexport const runRollup = async (\n api: PluginAPI<ModuleTools>,\n { distDir, tsconfigPath, externals, input, watch }: Config,\n) => {\n const ignoreFiles: Plugin = {\n name: 'ignore-files',\n load(id) {\n if (!/\\.(js|jsx|ts|tsx|json|cts|mts)$/.test(id)) {\n return '';\n }\n return null;\n },\n };\n const ts = await import('typescript');\n const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile);\n const { options } = ts.parseJsonConfigFileContent(\n configFile.config,\n ts.sys,\n './',\n );\n\n const { default: jsonPlugin } = await import(\n '../../../compiled/@rollup/plugin-json'\n );\n const { default: dtsPlugin } = await import(\n '../../../compiled/rollup-plugin-dts'\n );\n const { transformUndefineObject } = await import('../../utils/common');\n\n const baseUrl = path.isAbsolute(options.baseUrl || '.')\n ? options.baseUrl\n : path.join(path.dirname(tsconfigPath), options.baseUrl || '.');\n const ignoreCompileOptions = [\n 'incremental',\n 'tsBuildInfoFile',\n 'sourceMap',\n 'inlineSources',\n ];\n\n const inputConfig: InputOptions = {\n input,\n external: externals,\n plugins: [\n jsonPlugin(),\n ignoreFiles,\n dtsPlugin({\n // use external to prevent them which come from node_modules from be bundled.\n respectExternal: true,\n compilerOptions: {\n declarationMap: false,\n skipLibCheck: true,\n // https://github.com/Swatinem/rollup-plugin-dts/issues/143,\n // but it will cause error when bundle ts which import another ts file.\n preserveSymlinks: false,\n ...options,\n // https://github.com/Swatinem/rollup-plugin-dts/issues/127\n composite: false,\n // isAbsolute\n baseUrl,\n // Ensure \".d.ts\" modules are generated\n declaration: true,\n // Skip \".js\" generation\n noEmit: false,\n emitDeclarationOnly: true,\n // Skip code generation when error occurs\n noEmitOnError: true,\n // Avoid extra work\n checkJs: false,\n // Ensure we can parse the latest code\n target: ts.ScriptTarget.ESNext,\n ...transformUndefineObject(ignoreCompileOptions),\n },\n tsconfig: tsconfigPath,\n }),\n ].filter(Boolean),\n };\n const outputConfig: OutputOptions = {\n dir: distDir,\n format: 'esm',\n exports: 'named',\n };\n if (watch) {\n const { watch } = await import('../../../compiled/rollup');\n const { watchSectionTitle } = await import('../../utils/log');\n const { SectionTitleStatus, BundleDtsLogPrefix } = await import(\n '../../constants/log'\n );\n const runner = api.useHookRunners();\n const watcher = watch({\n ...inputConfig,\n plugins: inputConfig.plugins,\n output: outputConfig,\n }).on('event', async event => {\n if (event.code === 'START') {\n console.info(\n await watchSectionTitle(BundleDtsLogPrefix, SectionTitleStatus.Log),\n );\n } else if (event.code === 'BUNDLE_END') {\n console.info(\n await watchSectionTitle(\n BundleDtsLogPrefix,\n SectionTitleStatus.Success,\n ),\n );\n runner.buildWatchDts({ buildType: 'bundle' });\n } else if (event.code === 'ERROR') {\n // this is dts rollup plugin bug, error not complete message\n }\n });\n return watcher;\n } else {\n try {\n const { rollup } = await import('../../../compiled/rollup');\n const { addRollupChunk } = await import('../../utils/print');\n const bundle = await rollup(inputConfig);\n const rollupOutput = await bundle.write(outputConfig);\n const { appDirectory } = api.useAppContext();\n addRollupChunk(rollupOutput, appDirectory, outputConfig.dir!);\n return bundle;\n } catch (e) {\n if (e instanceof Error) {\n const { InternalDTSError } = await import('../../error');\n throw new InternalDTSError(e, {\n buildType: 'bundle',\n });\n }\n throw e;\n }\n }\n};\n"]}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * transform ['a', 'b'] to {a: undefined, b: undefined}
3
+ */
4
+ export declare const transformUndefineObject: (arr: string[]) => Record<string, undefined>;
@@ -0,0 +1,52 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
+ var __spreadValues = (a, b) => {
11
+ for (var prop in b || (b = {}))
12
+ if (__hasOwnProp.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ if (__getOwnPropSymbols)
15
+ for (var prop of __getOwnPropSymbols(b)) {
16
+ if (__propIsEnum.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ }
19
+ return a;
20
+ };
21
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+ var common_exports = {};
36
+ __export(common_exports, {
37
+ transformUndefineObject: () => transformUndefineObject
38
+ });
39
+ module.exports = __toCommonJS(common_exports);
40
+ const transformUndefineObject = (arr) => {
41
+ return arr.reduce((o, key) => {
42
+ return __spreadProps(__spreadValues({}, o), {
43
+ [key]: void 0
44
+ });
45
+ }, {});
46
+ };
47
+ // Annotate the CommonJS export names for ESM import in node:
48
+ 0 && (module.exports = {
49
+ transformUndefineObject
50
+ });
51
+
52
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,CACrC,QAC8B;AAC9B,SAAO,IAAI,OAAO,CAAC,GAAG,QAAQ;AAC5B,WAAO,iCACF,IADE;AAAA,MAEL,CAAC,GAAG,GAAG;AAAA,IACT;AAAA,EACF,GAAG,CAAC,CAAC;AACP;","names":[],"sources":["../../src/utils/common.ts"],"sourcesContent":["/**\n * transform ['a', 'b'] to {a: undefined, b: undefined}\n */\nexport const transformUndefineObject = (\n arr: string[],\n): Record<string, undefined> => {\n return arr.reduce((o, key) => {\n return {\n ...o,\n [key]: undefined,\n };\n }, {});\n};\n"]}
package/package.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "name": "@modern-js/module-tools",
3
3
  "description": "Simple, powerful, high-performance modern npm package development solution.",
4
4
  "homepage": "https://modernjs.dev/module-tools",
5
- "bugs": "https://github.com/modern-js-dev/modern.js/issues",
6
- "repository": "modern-js-dev/modern.js",
5
+ "bugs": "https://github.com/web-infra-dev/modern.js/issues",
6
+ "repository": "web-infra-dev/modern.js",
7
7
  "license": "MIT",
8
8
  "keywords": [
9
9
  "modern",
@@ -11,7 +11,7 @@
11
11
  "module-tools",
12
12
  "lib-tools"
13
13
  ],
14
- "version": "2.7.0",
14
+ "version": "2.8.0",
15
15
  "bin": {
16
16
  "modern": "./bin/modern.js",
17
17
  "modern-module": "./bin/modern.js"
@@ -39,14 +39,14 @@
39
39
  "@modern-js/libuild": "~0.11.0",
40
40
  "@modern-js/libuild-plugin-svgr": "~0.11.0",
41
41
  "@modern-js/libuild-plugin-swc": "~0.11.0",
42
- "@modern-js/core": "2.7.0",
43
- "@modern-js/new-action": "2.7.0",
44
- "@modern-js/plugin": "2.7.0",
45
- "@modern-js/plugin-changeset": "2.7.0",
46
- "@modern-js/plugin-i18n": "2.7.0",
47
- "@modern-js/plugin-lint": "2.7.0",
48
- "@modern-js/upgrade": "2.7.0",
49
- "@modern-js/utils": "2.7.0"
42
+ "@modern-js/core": "2.8.0",
43
+ "@modern-js/new-action": "2.8.0",
44
+ "@modern-js/plugin": "2.8.0",
45
+ "@modern-js/plugin-changeset": "2.8.0",
46
+ "@modern-js/plugin-i18n": "2.8.0",
47
+ "@modern-js/plugin-lint": "2.8.0",
48
+ "@modern-js/upgrade": "2.8.0",
49
+ "@modern-js/utils": "2.8.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/fs-extra": "9.0.13",
@@ -60,10 +60,10 @@
60
60
  "postcss-alias": "2.0.0",
61
61
  "react": "17",
62
62
  "typescript": "^4",
63
- "@modern-js/builder-webpack-provider": "2.7.0",
64
- "@modern-js/self": "npm:@modern-js/module-tools@2.7.0",
65
- "@scripts/jest-config": "2.7.0",
66
- "@scripts/build": "2.7.0"
63
+ "@modern-js/builder-webpack-provider": "2.8.0",
64
+ "@modern-js/self": "npm:@modern-js/module-tools@2.8.0",
65
+ "@scripts/jest-config": "2.8.0",
66
+ "@scripts/build": "2.8.0"
67
67
  },
68
68
  "publishConfig": {
69
69
  "registry": "https://registry.npmjs.org/",