From ab2ecc315f0b9beff9d18e5d48120689571e12ef Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Wed, 18 May 2022 20:02:47 +0800 Subject: [PATCH 1/4] feat: support toplevelawait --- examples/basic-project/tsconfig.json | 2 +- packages/webpack-config/src/unPlugins/compilation.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/basic-project/tsconfig.json b/examples/basic-project/tsconfig.json index 7f2f2ffce..d65e53b4b 100644 --- a/examples/basic-project/tsconfig.json +++ b/examples/basic-project/tsconfig.json @@ -5,7 +5,7 @@ "baseUrl": ".", "outDir": "build", "module": "esnext", - "target": "es6", + "target": "es2017", "jsx": "react-jsx", "moduleResolution": "node", "allowSyntheticDefaultImports": true, diff --git a/packages/webpack-config/src/unPlugins/compilation.ts b/packages/webpack-config/src/unPlugins/compilation.ts index 33d22aaa5..4e142407a 100644 --- a/packages/webpack-config/src/unPlugins/compilation.ts +++ b/packages/webpack-config/src/unPlugins/compilation.ts @@ -104,6 +104,7 @@ function getSwcTransformOptions({ exportDefaultFrom: true, exportNamespaceFrom: true, decorators: true, + topLevelAwait: true, }, }, }, commonOptions); From 26ec660710c9bc955702e10b8866d12f58602b12 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Fri, 20 May 2022 16:39:53 +0800 Subject: [PATCH 2/4] feat: analyze import --- packages/ice/package.json | 2 + packages/ice/src/utils/topLevelAwait.ts | 50 ++++++++++++ packages/ice/tests/topLevelAwait.test.ts | 35 ++++++++ pnpm-lock.yaml | 100 ++++++----------------- 4 files changed, 114 insertions(+), 73 deletions(-) create mode 100644 packages/ice/src/utils/topLevelAwait.ts create mode 100644 packages/ice/tests/topLevelAwait.test.ts diff --git a/packages/ice/package.json b/packages/ice/package.json index c611d1e11..fdcc1b8e6 100644 --- a/packages/ice/package.json +++ b/packages/ice/package.json @@ -30,6 +30,7 @@ "@ice/runtime": "^1.0.0", "@ice/types": "^1.0.0", "@ice/webpack-config": "^1.0.0", + "acorn": "^8.7.1", "address": "^1.1.2", "body-parser": "^1.20.0", "build-scripts": "2.0.0-17", @@ -47,6 +48,7 @@ "find-up": "^5.0.0", "fs-extra": "^10.0.0", "less": "^4.1.2", + "magic-string": "^0.26.1", "micromatch": "^4.0.5", "mrmime": "^1.0.0", "multer": "^1.4.4", diff --git a/packages/ice/src/utils/topLevelAwait.ts b/packages/ice/src/utils/topLevelAwait.ts new file mode 100644 index 000000000..196527027 --- /dev/null +++ b/packages/ice/src/utils/topLevelAwait.ts @@ -0,0 +1,50 @@ +import consola from 'consola'; +import MagicString from 'magic-string'; +import { parse as parseAST } from 'acorn'; +import type { Node } from 'estree'; +import { init, parse } from '@ice/bundles/compiled/es-module-lexer/index.js'; +import type { ImportSpecifier } from '@ice/bundles/compiled/es-module-lexer'; +import { resolveId } from '../service/analyze.js'; +import type { Alias } from '../service/analyze.js'; + +type ImportName = { importedName: string; localName: string }; +async function topLevelAwait(code: string, alias: Alias) { + await init; + let imports: readonly ImportSpecifier[] = []; + + try { + imports = parse(code)[0]; + } catch (e) { + consola.error('[parse error]', e); + } + + if (!imports.length) return code; + + let s: MagicString | undefined; + const str = () => s || (s = new MagicString(code)); + imports.forEach((importSpecifier) => { + // check relative import + let awaitImport = ''; + const importStr = code.substring(importSpecifier.ss, importSpecifier.se); + const node = (parseAST(importStr, { + ecmaVersion: 'latest', + sourceType: 'module', + }) as any).body[0] as Node; + if (node.type === 'ImportDeclaration') { + if (node.specifiers.length === 0) { + awaitImport = `import '${node.source.value}';`; + } + + const importNames: ImportName[] = []; + for (const specifier of node.specifiers) { + if (specifier.type === 'ImportSpecifier' && specifier.imported.type === 'Identifier') { + importNames.push({ + importedName: specifier.imported.name, + localName: specifier.local.name, + }); + } else if (specifier.type === 'ImportNamespaceSpecifier') { + } + } + } + }); +} diff --git a/packages/ice/tests/topLevelAwait.test.ts b/packages/ice/tests/topLevelAwait.test.ts new file mode 100644 index 000000000..492dfc9a8 --- /dev/null +++ b/packages/ice/tests/topLevelAwait.test.ts @@ -0,0 +1,35 @@ +import { expect, it, describe } from 'vitest'; + +describe('top level await transform', () => { + it('import a from \'a\'', async () => { + + }); + + it('import \'a\'', async () => { + + }); + + it('import { a } from \'a\'', async () => { + + }); + + it('import { a as b } from \'a\'', async () => { + + }); + + it('import { a, b } from \'a\'', async () => { + + }); + + it('import { a as c, b } from \'a\'', async () => { + + }); + + it('import * as a from \'a\'', async () => { + + }); + + it('import a, { b } from \'a\'', async () => { + + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a527f409..86f05b766 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -263,6 +263,7 @@ importers: '@types/multer': ^1.4.7 '@types/sass': ^1.43.1 '@types/temp': ^0.9.1 + acorn: ^8.7.1 address: ^1.1.2 body-parser: ^1.20.0 build-scripts: 2.0.0-17 @@ -281,6 +282,7 @@ importers: find-up: ^5.0.0 fs-extra: ^10.0.0 less: ^4.1.2 + magic-string: ^0.26.1 micromatch: ^4.0.5 mrmime: ^1.0.0 multer: ^1.4.4 @@ -302,6 +304,7 @@ importers: '@ice/runtime': link:../runtime '@ice/types': link:../types '@ice/webpack-config': link:../webpack-config + acorn: 8.7.1 address: 1.1.2 body-parser: 1.20.0 build-scripts: 2.0.0-17 @@ -319,6 +322,7 @@ importers: find-up: 5.0.0 fs-extra: 10.1.0 less: 4.1.2 + magic-string: 0.26.1 micromatch: 4.0.5 mrmime: 1.0.0 multer: 1.4.4 @@ -478,7 +482,7 @@ packages: '@typescript-eslint/eslint-plugin': 5.21.0_829e74f28e9c9eb05edda582d47d45b8 '@typescript-eslint/parser': 5.21.0_eslint@8.14.0+typescript@4.6.3 eslint: 8.14.0 - eslint-plugin-import: 2.26.0_5yvnzvdwzksrnum37j3gumwy4y + eslint-plugin-import: 2.26.0_eslint@8.14.0 eslint-plugin-jsx-a11y: 6.5.1_eslint@8.14.0 eslint-plugin-jsx-plus: 0.1.0 eslint-plugin-react: 7.29.4_eslint@8.14.0 @@ -511,7 +515,7 @@ packages: deepmerge: 4.2.2 eslint: 8.14.0 eslint-config-ali: 13.1.0_eslint@8.14.0 - eslint-plugin-import: 2.26.0_5yvnzvdwzksrnum37j3gumwy4y + eslint-plugin-import: 2.26.0_eslint@8.14.0 eslint-plugin-jsx-a11y: 6.5.1_eslint@8.14.0 eslint-plugin-jsx-plus: 0.1.0 eslint-plugin-rax-compile-time-miniapp: 1.0.0 @@ -526,8 +530,6 @@ packages: stylelint-scss: 4.2.0_stylelint@14.7.1 vue-eslint-parser: 8.3.0_eslint@8.14.0 transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - supports-color - typescript dev: true @@ -1997,6 +1999,14 @@ packages: acorn: 8.7.0 dev: true + /acorn-import-assertions/1.8.0_acorn@8.7.1: + resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} + peerDependencies: + acorn: ^8 + dependencies: + acorn: 8.7.1 + dev: true + /acorn-jsx/5.3.2_acorn@8.7.0: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -2035,6 +2045,11 @@ packages: hasBin: true dev: true + /acorn/8.7.1: + resolution: {integrity: sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==} + engines: {node: '>=0.4.0'} + hasBin: true + /address/1.1.2: resolution: {integrity: sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==} engines: {node: '>= 0.12.0'} @@ -2345,8 +2360,6 @@ packages: raw-body: 2.5.1 type-is: 1.6.18 unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color /bonjour-service/1.0.12: resolution: {integrity: sha512-pMmguXYCu63Ug37DluMKEHdxc+aaIf/ay4YbF8Gxtba+9d3u+rmEWy61VK3Z3hp8Rskok3BunHYnG0dUHAsblw==} @@ -2669,8 +2682,6 @@ packages: on-headers: 1.0.2 safe-buffer: 5.1.2 vary: 1.1.2 - transitivePeerDependencies: - - supports-color /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} @@ -3032,21 +3043,11 @@ packages: /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.0.0 /debug/3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.1.3 @@ -3172,8 +3173,6 @@ packages: dependencies: address: 1.1.2 debug: 2.6.9 - transitivePeerDependencies: - - supports-color dev: false /detective/5.2.0: @@ -3641,54 +3640,29 @@ packages: dependencies: debug: 3.2.7 resolve: 1.22.0 - transitivePeerDependencies: - - supports-color dev: true - /eslint-module-utils/2.7.3_siwxndurugrzrndocd3gqxwhna: + /eslint-module-utils/2.7.3: resolution: {integrity: sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==} engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true dependencies: - '@typescript-eslint/parser': 5.21.0_5wsz2tb7zzudmaqxfve53vbauu debug: 3.2.7 - eslint-import-resolver-node: 0.3.6 find-up: 2.1.0 - transitivePeerDependencies: - - supports-color dev: true - /eslint-plugin-import/2.26.0_5yvnzvdwzksrnum37j3gumwy4y: + /eslint-plugin-import/2.26.0_eslint@8.14.0: resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} engines: {node: '>=4'} peerDependencies: - '@typescript-eslint/parser': '*' eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true dependencies: - '@typescript-eslint/parser': 5.21.0_5wsz2tb7zzudmaqxfve53vbauu array-includes: 3.1.4 array.prototype.flat: 1.3.0 debug: 2.6.9 doctrine: 2.1.0 eslint: 8.14.0 eslint-import-resolver-node: 0.3.6 - eslint-module-utils: 2.7.3_siwxndurugrzrndocd3gqxwhna + eslint-module-utils: 2.7.3 has: 1.0.3 is-core-module: 2.9.0 is-glob: 4.0.3 @@ -3696,10 +3670,6 @@ packages: object.values: 1.1.5 resolve: 1.22.0 tsconfig-paths: 3.14.1 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color dev: true /eslint-plugin-jsx-a11y/6.5.1_eslint@8.14.0: @@ -4026,8 +3996,6 @@ packages: type-is: 1.6.18 utils-merge: 1.0.1 vary: 1.1.2 - transitivePeerDependencies: - - supports-color /external-editor/3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} @@ -4130,8 +4098,6 @@ packages: parseurl: 1.3.3 statuses: 2.0.1 unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color /find-up/2.1.0: resolution: {integrity: sha1-RdG35QbHF93UgndaK3eSCjwMV6c=} @@ -5221,8 +5187,6 @@ packages: mime: 1.6.0 needle: 2.9.1 source-map: 0.6.1 - transitivePeerDependencies: - - supports-color dev: false /levn/0.4.1: @@ -5616,8 +5580,6 @@ packages: debug: 3.2.7 iconv-lite: 0.4.24 sax: 1.2.4 - transitivePeerDependencies: - - supports-color dev: false optional: true @@ -6014,8 +5976,6 @@ packages: async: 2.6.4 debug: 3.2.7 mkdirp: 0.5.6 - transitivePeerDependencies: - - supports-color /postcss-attribute-case-insensitive/5.0.0_postcss@8.4.12: resolution: {integrity: sha512-b4g9eagFGq9T5SWX4+USfVyjIb3liPnjhHHRMP7FMB2kFVpYyfEscV0wP3eaXhKlcHKUut8lt5BGoeylWA/dBQ==} @@ -7293,8 +7253,6 @@ packages: on-finished: 2.4.1 range-parser: 1.2.1 statuses: 2.0.1 - transitivePeerDependencies: - - supports-color /serialize-javascript/6.0.0: resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} @@ -7313,8 +7271,6 @@ packages: http-errors: 1.6.3 mime-types: 2.1.35 parseurl: 1.3.3 - transitivePeerDependencies: - - supports-color /serve-static/1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} @@ -7324,8 +7280,6 @@ packages: escape-html: 1.0.3 parseurl: 1.3.3 send: 0.18.0 - transitivePeerDependencies: - - supports-color /set-blocking/2.0.0: resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=} @@ -7883,7 +7837,7 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - acorn: 8.7.0 + acorn: 8.7.1 commander: 2.20.3 source-map: 0.7.3 source-map-support: 0.5.21 @@ -8358,7 +8312,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.0.0 - webpack: 5.72.0_@swc+core@1.2.168 + webpack: 5.72.0_esbuild@0.14.38 /webpack-dev-server/4.8.1_webpack@5.72.0: resolution: {integrity: sha512-dwld70gkgNJa33czmcj/PlKY/nOy/BimbrgZRaR9vDATBQAYgLzggR0nxDtPLJiLrMgZwbE6RRfJ5vnBBasTyg==} @@ -8398,7 +8352,7 @@ packages: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack: 5.72.0_@swc+core@1.2.168 + webpack: 5.72.0_esbuild@0.14.38 webpack-dev-middleware: 5.3.1_webpack@5.72.0 ws: 8.5.0 transitivePeerDependencies: @@ -8510,8 +8464,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.7.0 - acorn-import-assertions: 1.8.0_acorn@8.7.0 + acorn: 8.7.1 + acorn-import-assertions: 1.8.0_acorn@8.7.1 browserslist: 4.20.3 chrome-trace-event: 1.0.3 enhanced-resolve: 5.9.3 From 7f67646416e2b69cea6314279b30bab8e5a57125 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Wed, 25 May 2022 16:19:37 +0800 Subject: [PATCH 3/4] feat: transform toplevelawait --- packages/ice/src/utils/topLevelAwait.ts | 35 ++++++++++++++++++++---- packages/ice/tests/topLevelAwait.test.ts | 28 ++++++++++++++----- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/packages/ice/src/utils/topLevelAwait.ts b/packages/ice/src/utils/topLevelAwait.ts index 196527027..7a3dcc97c 100644 --- a/packages/ice/src/utils/topLevelAwait.ts +++ b/packages/ice/src/utils/topLevelAwait.ts @@ -4,11 +4,10 @@ import { parse as parseAST } from 'acorn'; import type { Node } from 'estree'; import { init, parse } from '@ice/bundles/compiled/es-module-lexer/index.js'; import type { ImportSpecifier } from '@ice/bundles/compiled/es-module-lexer'; -import { resolveId } from '../service/analyze.js'; -import type { Alias } from '../service/analyze.js'; type ImportName = { importedName: string; localName: string }; -async function topLevelAwait(code: string, alias: Alias) { +type ValidateId = (id: string) => boolean; +async function topLevelAwait(code: string, validateId?: ValidateId): Promise { await init; let imports: readonly ImportSpecifier[] = []; @@ -25,6 +24,7 @@ async function topLevelAwait(code: string, alias: Alias) { imports.forEach((importSpecifier) => { // check relative import let awaitImport = ''; + if (validateId && !validateId(importSpecifier.n)) return; const importStr = code.substring(importSpecifier.ss, importSpecifier.se); const node = (parseAST(importStr, { ecmaVersion: 'latest', @@ -32,19 +32,42 @@ async function topLevelAwait(code: string, alias: Alias) { }) as any).body[0] as Node; if (node.type === 'ImportDeclaration') { if (node.specifiers.length === 0) { - awaitImport = `import '${node.source.value}';`; + awaitImport = `await import('${node.source.value}')`; } const importNames: ImportName[] = []; for (const specifier of node.specifiers) { - if (specifier.type === 'ImportSpecifier' && specifier.imported.type === 'Identifier') { + if (specifier.type === 'ImportNamespaceSpecifier') { + // import * as xx from 'xx'; + awaitImport = `const ${specifier.local.name} = await import('${node.source.value}')`; + } else if (specifier.type === 'ImportSpecifier' && specifier.imported.type === 'Identifier') { importNames.push({ importedName: specifier.imported.name, localName: specifier.local.name, }); - } else if (specifier.type === 'ImportNamespaceSpecifier') { + } else if (specifier.type === 'ImportDefaultSpecifier') { + importNames.push({ + importedName: 'default', + localName: specifier.local.name, + }); } } + const awaitIdentifiers = []; + importNames.forEach(({ importedName, localName }) => { + if (importedName === localName) { + awaitIdentifiers.push(importedName); + } else { + awaitIdentifiers.push(`${importedName} as ${localName}`); + } + }); + if (awaitIdentifiers.length > 0) { + awaitImport = `const { ${awaitIdentifiers.join(',')} } = await import('${node.source.value}')`; + } + str().overwrite(importSpecifier.ss, importSpecifier.se, awaitImport); } }); + + return str().toString(); } + +export default topLevelAwait; diff --git a/packages/ice/tests/topLevelAwait.test.ts b/packages/ice/tests/topLevelAwait.test.ts index 492dfc9a8..855f58ac2 100644 --- a/packages/ice/tests/topLevelAwait.test.ts +++ b/packages/ice/tests/topLevelAwait.test.ts @@ -1,35 +1,49 @@ import { expect, it, describe } from 'vitest'; +import topLevelAwait from '../src/utils/topLevelAwait'; describe('top level await transform', () => { it('import a from \'a\'', async () => { - + const code = await topLevelAwait('import a from \'a\''); + expect(code).toBe(`const { default as a } = await import('a')`); }); it('import \'a\'', async () => { - + const code = await topLevelAwait('import \'a\''); + expect(code).toBe(`await import('a')`); }); it('import { a } from \'a\'', async () => { - + const code = await topLevelAwait('import { a } from \'a\''); + expect(code).toBe(`const { a } = await import('a')`); }); it('import { a as b } from \'a\'', async () => { - + const code = await topLevelAwait('import { a as b } from \'a\''); + expect(code).toBe(`const { a as b } = await import('a')`); }); it('import { a, b } from \'a\'', async () => { - + const code = await topLevelAwait('import { a, b } from \'a\''); + expect(code).toBe(`const { a,b } = await import('a')`); }); it('import { a as c, b } from \'a\'', async () => { - + const code = await topLevelAwait('import { a as c, b } from \'a\''); + expect(code).toBe(`const { a as c,b } = await import('a')`); }); it('import * as a from \'a\'', async () => { - + const code = await topLevelAwait('import * as a from \'a\''); + expect(code).toBe(`const a = await import('a')`); }); it('import a, { b } from \'a\'', async () => { + const code = await topLevelAwait('import a, { b } from \'a\''); + expect(code).toBe(`const { default as a,b } = await import('a')`); + }); + it('validate id', async () => { + const code = await topLevelAwait('import a, { b } from \'a\'', (id) => false); + expect(code).toBe(`import a, { b } from \'a\'`); }); }); From 2a532c99942b26f0be9d7136769ebb4ecd39976c Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Wed, 25 May 2022 16:24:06 +0800 Subject: [PATCH 4/4] chore: update dependencies --- packages/ice/package.json | 3 ++- pnpm-lock.yaml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ice/package.json b/packages/ice/package.json index 6ee1c0139..c2d4d16ab 100644 --- a/packages/ice/package.json +++ b/packages/ice/package.json @@ -32,8 +32,8 @@ "@ice/webpack-config": "^1.0.0", "acorn": "^8.7.1", "address": "^1.1.2", - "build-scripts": "^2.0.0-21", "body-parser": "^1.20.0", + "build-scripts": "^2.0.0-21", "chalk": "^4.0.0", "commander": "^9.0.0", "consola": "^2.15.3", @@ -65,6 +65,7 @@ "devDependencies": { "@types/cross-spawn": "^6.0.2", "@types/ejs": "^3.1.0", + "@types/estree": "^0.0.51", "@types/less": "^3.0.3", "@types/micromatch": "^4.0.2", "@types/multer": "^1.4.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 629980ad9..991c5d947 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -258,6 +258,7 @@ importers: '@ice/webpack-config': ^1.0.0 '@types/cross-spawn': ^6.0.2 '@types/ejs': ^3.1.0 + '@types/estree': ^0.0.51 '@types/less': ^3.0.3 '@types/micromatch': ^4.0.2 '@types/multer': ^1.4.7 @@ -338,6 +339,7 @@ importers: devDependencies: '@types/cross-spawn': 6.0.2 '@types/ejs': 3.1.0 + '@types/estree': 0.0.51 '@types/less': 3.0.3 '@types/micromatch': 4.0.2 '@types/multer': 1.4.7