From fde54c9a9c01c114bbac94312666ec3e291edcd3 Mon Sep 17 00:00:00 2001 From: yoho Date: Wed, 20 Apr 2022 23:25:53 +0800 Subject: [PATCH 1/8] docs: test env different from production (#7710) Co-authored-by: Bjorn Lu --- CONTRIBUTING.md | 2 ++ scripts/jestPerTestSetup.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f086627de5cfe0..c7020c97a84c80 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,6 +95,8 @@ test('should work', async () => { Some common test helpers, e.g. `testDir`, `isBuild` or `editFile` are available in `packages/playground/testUtils.ts`. +Note: The test build environment uses a [different default set of Vite config](https://github.com/vitejs/vite/blob/9c6501d9c363eaa3c1e7708d531fb2a92b633db6/scripts/jestPerTestSetup.ts#L102-L122) to skip transpilation during tests to make it faster. This may produce a different result compared to the default production build. + ### Extending the Test Suite To add new tests, you should find a related playground to the fix or feature (or create a new one). As an example, static assets loading are tested in the [assets playground](https://github.com/vitejs/vite/tree/main/packages/playground/assets). In this Vite App, there is a test for `?raw` imports, with [a section is defined in the `index.html` for it](https://github.com/vitejs/vite/blob/71215533ac60e8ff566dc3467feabfc2c71a01e2/packages/playground/assets/index.html#L121): diff --git a/scripts/jestPerTestSetup.ts b/scripts/jestPerTestSetup.ts index 43258b3c8b0d6e..f4c9db03627c7c 100644 --- a/scripts/jestPerTestSetup.ts +++ b/scripts/jestPerTestSetup.ts @@ -123,6 +123,7 @@ beforeAll(async () => { } }, build: { + // esbuild do not minify ES lib output since that would remove pure annotations and break tree-shaking // skip transpilation during tests to make it faster target: 'esnext' }, From 0b2d307a086d4359822ef1373c884fd2cbdcb953 Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Thu, 21 Apr 2022 01:19:11 +0200 Subject: [PATCH 2/8] fix: ssr.noExternal with boolean values (#7813) --- packages/playground/ssr-webworker/vite.config.js | 11 ++++++++++- packages/vite/src/node/config.ts | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/playground/ssr-webworker/vite.config.js b/packages/playground/ssr-webworker/vite.config.js index 80cc1784cdc565..91a0571380608e 100644 --- a/packages/playground/ssr-webworker/vite.config.js +++ b/packages/playground/ssr-webworker/vite.config.js @@ -10,9 +10,18 @@ module.exports = { }, ssr: { target: 'webworker', - noExternal: true + noExternal: ['this-should-be-replaced-by-the-boolean'] }, plugins: [ + { + config() { + return { + ssr: { + noExternal: true + } + } + } + }, { config() { return { diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 556fcf7cbae77a..d242ac632c220e 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -745,7 +745,8 @@ function mergeConfigRecursively( } else if (key === 'assetsInclude' && rootPath === '') { merged[key] = [].concat(existing, value) continue - } else if (key === 'noExternal' && existing === true) { + } else if (key === 'noExternal' && (existing === true || value === true)) { + merged[key] = true continue } From 1d468c8e6f02b0d0e362aa2d6542af1e1f55ab45 Mon Sep 17 00:00:00 2001 From: yoho Date: Thu, 21 Apr 2022 07:21:54 +0800 Subject: [PATCH 3/8] fix: escape character in string regexp match (#7834) --- .../src/node/__tests__/cleanString.spec.ts | 19 +++++++++++++++++++ packages/vite/src/node/cleanString.ts | 12 ++++++++++-- packages/vite/src/node/plugins/css.ts | 17 ++++++++++------- packages/vite/src/node/plugins/html.ts | 3 ++- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/packages/vite/src/node/__tests__/cleanString.spec.ts b/packages/vite/src/node/__tests__/cleanString.spec.ts index 1065a2d4985ceb..b77f4c0fb5fbad 100644 --- a/packages/vite/src/node/__tests__/cleanString.spec.ts +++ b/packages/vite/src/node/__tests__/cleanString.spec.ts @@ -32,6 +32,25 @@ test('strings', () => { expect(clean).toMatch('const b = "\0\0\0\0"') }) +test('escape character', () => { + const clean = emptyString(` + '1\\'1' + "1\\"1" + "1\\"1\\"1" + "1\\'1'\\"1" + "1'1'" + "1'\\'1\\''\\"1\\"\\"" + '1"\\"1\\""\\"1\\"\\"' + '""1""' + '"""1"""' + '""""1""""' + "''1''" + "'''1'''" + "''''1''''" + `) + expect(clean).not.toMatch('1') +}) + test('strings comment nested', () => { expect( emptyString(` diff --git a/packages/vite/src/node/cleanString.ts b/packages/vite/src/node/cleanString.ts index 05163ea055b631..2b7cba41aef66b 100644 --- a/packages/vite/src/node/cleanString.ts +++ b/packages/vite/src/node/cleanString.ts @@ -2,7 +2,8 @@ import type { RollupError } from 'rollup' // bank on the non-overlapping nature of regex matches and combine all filters into one giant regex // /`([^`\$\{\}]|\$\{(`|\g<1>)*\})*`/g can match nested string template // but js not support match expression(\g<0>). so clean string template(`...`) in other ways. -const cleanerRE = /"[^"]*"|'[^']*'|\/\*(.|[\r\n])*?\*\/|\/\/.*/g +const cleanerRE = + /"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|\/\*(.|[\r\n])*?\*\/|\/\/.*/g const blankReplacer = (s: string) => ' '.repeat(s.length) const stringBlankReplacer = (s: string) => @@ -25,9 +26,16 @@ export function emptyString(raw: string): string { } const enum LexerState { + // template string inTemplateString, inInterpolationExpression, - inObjectExpression + inObjectExpression, + // strings + inSingleQuoteString, + inDoubleQuoteString, + // comments + inMultilineCommentsRE, + inSinglelineCommentsRE } function replaceAt( diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 2f5ab3df58b46a..83e18aabecdb33 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -1122,7 +1122,7 @@ export async function hoistAtRules(css: string) { // to top when multiple files are concatenated. // match until semicolon that's not in quotes s.replace( - /@import\s*(?:url\([^\)]*\)|"[^"]*"|'[^']*'|[^;]*).*?;/gm, + /@import\s*(?:url\([^\)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm, (match) => { s.appendLeft(0, match) return '' @@ -1131,13 +1131,16 @@ export async function hoistAtRules(css: string) { // #6333 // CSS @charset must be the top-first in the file, hoist the first to top let foundCharset = false - s.replace(/@charset\s*(?:"[^"]*"|'[^']*'|[^;]*).*?;/gm, (match) => { - if (!foundCharset) { - s.prepend(match) - foundCharset = true + s.replace( + /@charset\s*(?:"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm, + (match) => { + if (!foundCharset) { + s.prepend(match) + foundCharset = true + } + return '' } - return '' - }) + ) return s.toString() } diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index 5c86b6c0ac6073..e8df0825ddb3fa 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -46,7 +46,8 @@ interface ScriptAssetsUrl { const htmlProxyRE = /\?html-proxy=?[&inline\-css]*&index=(\d+)\.(js|css)$/ const inlineCSSRE = /__VITE_INLINE_CSS__([^_]+_\d+)__/g // Do not allow preceding '.', but do allow preceding '...' for spread operations -const inlineImportRE = /(? htmlProxyRE.test(id) From 72abe488b5ce52d21977c9ba35d6c590e47dbe05 Mon Sep 17 00:00:00 2001 From: chris-zhu <1633711653@qq.com> Date: Thu, 21 Apr 2022 18:49:59 +0800 Subject: [PATCH 4/8] docs(api-hmr): update hmr hot type (#7787) --- docs/guide/api-hmr.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/guide/api-hmr.md b/docs/guide/api-hmr.md index 46eabab04e8868..1cba492e6613c1 100644 --- a/docs/guide/api-hmr.md +++ b/docs/guide/api-hmr.md @@ -10,21 +10,27 @@ Vite exposes its manual HMR API via the special `import.meta.hot` object: ```ts interface ImportMeta { - readonly hot?: { - readonly data: any + readonly hot?: ViteHotContext +} + +interface ViteHotContext { + readonly data: any - accept(): void - accept(cb: (mod: any) => void): void - accept(dep: string, cb: (mod: any) => void): void - accept(deps: string[], cb: (mods: any[]) => void): void + accept(): void + accept(cb: (mod: any) => void): void + accept(dep: string, cb: (mod: any) => void): void + accept(deps: readonly string[], cb: (mods: any[]) => void): void - prune(cb: () => void): void - dispose(cb: (data: any) => void): void - decline(): void - invalidate(): void + dispose(cb: (data: any) => void): void + decline(): void + invalidate(): void - on(event: string, cb: (...args: any[]) => void): void - } + // `InferCustomEventPayload` provides types for built-in Vite events + on( + event: T, + cb: (payload: InferCustomEventPayload) => void + ): void + send(event: T, data?: InferCustomEventPayload): void } ``` From e29d1d92f7810c5160aac2f1e56f7b03bfa4c933 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:32:19 +0200 Subject: [PATCH 5/8] chore(deps): update all non-major dependencies (#7847) --- package.json | 4 +-- packages/plugin-legacy/package.json | 2 +- packages/vite/package.json | 2 +- pnpm-lock.yaml | 49 ++++++++++++++++------------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index a90c2c9a43b3fe..701da1e4ef7887 100644 --- a/package.json +++ b/package.json @@ -46,12 +46,12 @@ "cross-env": "^7.0.3", "esbuild": "^0.14.27", "eslint": "^8.13.0", - "eslint-define-config": "^1.3.0", + "eslint-define-config": "^1.4.0", "eslint-plugin-node": "^11.1.0", "execa": "^5.1.1", "fs-extra": "^10.1.0", "jest": "^27.5.1", - "lint-staged": "^12.3.8", + "lint-staged": "^12.4.0", "minimist": "^1.2.6", "node-fetch": "^2.6.6", "npm-run-all": "^4.1.5", diff --git a/packages/plugin-legacy/package.json b/packages/plugin-legacy/package.json index 3734390a3cdf25..adc97e974f2d37 100644 --- a/packages/plugin-legacy/package.json +++ b/packages/plugin-legacy/package.json @@ -23,7 +23,7 @@ "homepage": "https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#readme", "dependencies": { "@babel/standalone": "^7.17.9", - "core-js": "^3.22.0", + "core-js": "^3.22.2", "magic-string": "^0.26.1", "regenerator-runtime": "^0.13.9", "systemjs": "^6.12.1" diff --git a/packages/vite/package.json b/packages/vite/package.json index 50f8487ad55895..0fd8b867dfe042 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -55,7 +55,7 @@ "@ampproject/remapping": "^2.1.2", "@babel/parser": "^7.17.9", "@babel/types": "^7.17.0", - "@jridgewell/trace-mapping": "^0.3.4", + "@jridgewell/trace-mapping": "^0.3.9", "@rollup/plugin-alias": "^3.1.9", "@rollup/plugin-commonjs": "^21.1.0", "@rollup/plugin-dynamic-import-vars": "^1.4.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 235dd8c48a30ca..140dabd1e04eb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,12 +22,12 @@ importers: cross-env: ^7.0.3 esbuild: ^0.14.27 eslint: ^8.13.0 - eslint-define-config: ^1.3.0 + eslint-define-config: ^1.4.0 eslint-plugin-node: ^11.1.0 execa: ^5.1.1 fs-extra: ^10.1.0 jest: ^27.5.1 - lint-staged: ^12.3.8 + lint-staged: ^12.4.0 minimist: ^1.2.6 node-fetch: ^2.6.6 npm-run-all: ^4.1.5 @@ -58,12 +58,12 @@ importers: cross-env: 7.0.3 esbuild: 0.14.27 eslint: 8.13.0 - eslint-define-config: 1.3.0 + eslint-define-config: 1.4.0 eslint-plugin-node: 11.1.0_eslint@8.13.0 execa: 5.1.1 fs-extra: 10.1.0 jest: 27.5.1_ts-node@10.4.0 - lint-staged: 12.3.8 + lint-staged: 12.4.0 minimist: 1.2.6 node-fetch: 2.6.6 npm-run-all: 4.1.5 @@ -744,13 +744,13 @@ importers: packages/plugin-legacy: specifiers: '@babel/standalone': ^7.17.9 - core-js: ^3.22.0 + core-js: ^3.22.2 magic-string: ^0.26.1 regenerator-runtime: ^0.13.9 systemjs: ^6.12.1 dependencies: '@babel/standalone': 7.17.9 - core-js: 3.22.0 + core-js: 3.22.2 magic-string: 0.26.1 regenerator-runtime: 0.13.9 systemjs: 6.12.1 @@ -816,7 +816,7 @@ importers: '@ampproject/remapping': ^2.1.2 '@babel/parser': ^7.17.9 '@babel/types': ^7.17.0 - '@jridgewell/trace-mapping': ^0.3.4 + '@jridgewell/trace-mapping': ^0.3.9 '@rollup/plugin-alias': ^3.1.9 '@rollup/plugin-commonjs': ^21.1.0 '@rollup/plugin-dynamic-import-vars': ^1.4.3 @@ -894,7 +894,7 @@ importers: '@ampproject/remapping': 2.1.2 '@babel/parser': 7.17.9 '@babel/types': 7.17.0 - '@jridgewell/trace-mapping': 0.3.4 + '@jridgewell/trace-mapping': 0.3.9 '@rollup/plugin-alias': 3.1.9_rollup@2.62.0 '@rollup/plugin-commonjs': 21.1.0_rollup@2.62.0 '@rollup/plugin-dynamic-import-vars': 1.4.3_rollup@2.62.0 @@ -1080,7 +1080,7 @@ packages: resolution: {integrity: sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.4 + '@jridgewell/trace-mapping': 0.3.9 /@babel/code-frame/7.16.0: resolution: {integrity: sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==} @@ -2210,6 +2210,13 @@ packages: dependencies: '@jridgewell/resolve-uri': 3.0.5 '@jridgewell/sourcemap-codec': 1.4.10 + dev: true + + /@jridgewell/trace-mapping/0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.0.5 + '@jridgewell/sourcemap-codec': 1.4.10 /@mapbox/node-pre-gyp/1.0.8: resolution: {integrity: sha512-CMGKi28CF+qlbXh26hDe6NxCd7amqeAzEqnS6IHeO6LoaKyM/n+Xw3HT1COdq8cuioOdlKdqn/hCmqPUOMOywg==} @@ -3355,7 +3362,7 @@ packages: /axios/0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} dependencies: - follow-redirects: 1.14.6_debug@4.3.4 + follow-redirects: 1.14.6 transitivePeerDependencies: - debug dev: false @@ -4081,8 +4088,8 @@ packages: is-what: 3.14.1 dev: true - /core-js/3.22.0: - resolution: {integrity: sha512-8h9jBweRjMiY+ORO7bdWSeWfHhLPO7whobj7Z2Bl0IDo00C228EdGgH7FE4jGumbEjzcFfkfW8bXgdkEDhnwHQ==} + /core-js/3.22.2: + resolution: {integrity: sha512-Z5I2vzDnEIqO2YhELVMFcL1An2CIsFe9Q7byZhs8c/QxummxZlAHw33TUHbIte987LkisOgL0LwQ1P9D6VISnA==} requiresBuild: true dev: false @@ -4787,9 +4794,9 @@ packages: source-map: 0.6.1 dev: true - /eslint-define-config/1.3.0: - resolution: {integrity: sha512-sFbHUnaXdJfG74c0EfFjXajjM3ugDVOMteKBnddCHQP5eas6p3nmS7PbSVhyZ8Y9DaNNtFbzlovdGmVdTwrHcw==} - engines: {node: '>= 16.9.0', npm: '>= 7.0.0', pnpm: '>= 6.32.2'} + /eslint-define-config/1.4.0: + resolution: {integrity: sha512-DJGEdzX4fkdkhPSzPgOpBbBjhT+b9DcgbAgxfrEUcipVWlSuesQJriKffHz1JF5mhKFm7PGoiZz4D2nb4GslNA==} + engines: {node: '>= 14.6.0', npm: '>= 6.0.0', pnpm: '>= 6.32.9'} dev: true /eslint-plugin-es/3.0.1_eslint@8.13.0: @@ -5168,7 +5175,7 @@ packages: resolution: {integrity: sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw==} dev: true - /follow-redirects/1.14.6_debug@4.3.4: + /follow-redirects/1.14.6: resolution: {integrity: sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==} engines: {node: '>=4.0'} peerDependencies: @@ -5176,8 +5183,6 @@ packages: peerDependenciesMeta: debug: optional: true - dependencies: - debug: 4.3.4 /form-data/3.0.1: resolution: {integrity: sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==} @@ -5578,7 +5583,7 @@ packages: engines: {node: '>=8.0.0'} dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.14.6_debug@4.3.4 + follow-redirects: 1.14.6 requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -6082,7 +6087,7 @@ packages: jest-runner: 27.5.1 jest-util: 27.5.1 jest-validate: 27.5.1 - micromatch: 4.0.4 + micromatch: 4.0.5 parse-json: 5.2.0 pretty-format: 27.5.1 slash: 3.0.0 @@ -6663,8 +6668,8 @@ packages: /lines-and-columns/1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - /lint-staged/12.3.8: - resolution: {integrity: sha512-0+UpNaqIwKRSGAFOCcpuYNIv/j5QGVC+xUVvmSdxHO+IfIGoHbFLo3XcPmV/LLnsVj5EAncNHVtlITSoY5qWGQ==} + /lint-staged/12.4.0: + resolution: {integrity: sha512-3X7MR0h9b7qf4iXf/1n7RlVAx+EzpAZXoCEMhVSpaBlgKDfH2ewf+QUm7BddFyq29v4dgPP+8+uYpWuSWx035A==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} hasBin: true dependencies: From d7540c8bd43c889253dc1e8ed040a20f9959e083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Thu, 21 Apr 2022 23:32:45 +0900 Subject: [PATCH 6/8] fix: update sourcemap in importAnalysisBuild (#7825) --- .../src/node/plugins/importAnalysisBuild.ts | 61 +++++++++++++++---- packages/vite/src/node/server/sourcemap.ts | 2 +- packages/vite/src/node/utils.ts | 7 ++- 3 files changed, 53 insertions(+), 17 deletions(-) diff --git a/packages/vite/src/node/plugins/importAnalysisBuild.ts b/packages/vite/src/node/plugins/importAnalysisBuild.ts index 91ce663b9f8111..9f4c75025fff27 100644 --- a/packages/vite/src/node/plugins/importAnalysisBuild.ts +++ b/packages/vite/src/node/plugins/importAnalysisBuild.ts @@ -4,10 +4,12 @@ import type { Plugin } from '../plugin' import MagicString from 'magic-string' import type { ImportSpecifier } from 'es-module-lexer' import { init, parse as parseImports } from 'es-module-lexer' -import type { OutputChunk } from 'rollup' +import type { OutputChunk, SourceMap } from 'rollup' import { isCSSRequest, removedPureCssFilesCache } from './css' import { transformImportGlob } from '../importGlob' -import { bareImportRE } from '../utils' +import { bareImportRE, combineSourcemaps } from '../utils' +import type { RawSourceMap } from '@ampproject/remapping' +import { genSourceMapUrl } from '../server/sourcemap' /** * A flag for injected helpers. This flag will be set to `false` if the output @@ -20,7 +22,7 @@ export const preloadMarker = `__VITE_PRELOAD__` export const preloadBaseMarker = `__VITE_PRELOAD_BASE__` const preloadHelperId = 'vite/preload-helper' -const preloadMarkerRE = new RegExp(`"${preloadMarker}"`, 'g') +const preloadMarkerWithQuote = `"${preloadMarker}"` as const /** * Helper for preloading CSS and direct imports of async chunks in parallel to @@ -263,8 +265,10 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin { this.error(e, e.idx) } + const s = new MagicString(code) + const rewroteMarkerStartPos = new Set() // position of the leading double quote + if (imports.length) { - const s = new MagicString(code) for (let index = 0; index < imports.length; index++) { // To handle escape sequences in specifier strings, the .n field will be provided where possible. const { @@ -324,16 +328,16 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin { addDeps(normalizedFile) } - let markPos = code.indexOf(preloadMarker, end) + let markerStartPos = code.indexOf(preloadMarkerWithQuote, end) // fix issue #3051 - if (markPos === -1 && imports.length === 1) { - markPos = code.indexOf(preloadMarker) + if (markerStartPos === -1 && imports.length === 1) { + markerStartPos = code.indexOf(preloadMarkerWithQuote) } - if (markPos > 0) { + if (markerStartPos > 0) { s.overwrite( - markPos - 1, - markPos + preloadMarker.length + 1, + markerStartPos, + markerStartPos + preloadMarkerWithQuote.length, // the dep list includes the main chunk, so only need to // preload when there are actual other deps. deps.size > 1 || @@ -343,15 +347,46 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin { : `[]`, { contentOnly: true } ) + rewroteMarkerStartPos.add(markerStartPos) } } - chunk.code = s.toString() - // TODO source map } // there may still be markers due to inlined dynamic imports, remove // all the markers regardless - chunk.code = chunk.code.replace(preloadMarkerRE, 'void 0') + let markerStartPos = code.indexOf(preloadMarkerWithQuote) + while (markerStartPos >= 0) { + if (!rewroteMarkerStartPos.has(markerStartPos)) { + s.overwrite( + markerStartPos, + markerStartPos + preloadMarkerWithQuote.length, + 'void 0', + { contentOnly: true } + ) + } + + markerStartPos = code.indexOf( + preloadMarkerWithQuote, + markerStartPos + preloadMarkerWithQuote.length + ) + } + + if (s.hasChanged()) { + chunk.code = s.toString() + if (config.build.sourcemap && chunk.map) { + const nextMap = s.generateMap({ + source: chunk.fileName, + hires: true + }) + const map = combineSourcemaps( + chunk.fileName, + [nextMap as RawSourceMap, chunk.map as RawSourceMap], + false + ) as SourceMap + map.toUrl = () => genSourceMapUrl(map) + chunk.map = map + } + } } } } diff --git a/packages/vite/src/node/server/sourcemap.ts b/packages/vite/src/node/server/sourcemap.ts index dc77c4a4714298..0b9bcf9284754b 100644 --- a/packages/vite/src/node/server/sourcemap.ts +++ b/packages/vite/src/node/server/sourcemap.ts @@ -61,7 +61,7 @@ export async function injectSourcesContent( } } -function genSourceMapUrl(map: SourceMap | string | undefined) { +export function genSourceMapUrl(map: SourceMap | string | undefined) { if (typeof map !== 'string') { map = JSON.stringify(map) } diff --git a/packages/vite/src/node/utils.ts b/packages/vite/src/node/utils.ts index 16391df8c73df3..e7a20afbdd5ae7 100644 --- a/packages/vite/src/node/utils.ts +++ b/packages/vite/src/node/utils.ts @@ -605,7 +605,8 @@ const nullSourceMap: RawSourceMap = { } export function combineSourcemaps( filename: string, - sourcemapList: Array + sourcemapList: Array, + excludeContent = true ): RawSourceMap { if ( sourcemapList.length === 0 || @@ -635,7 +636,7 @@ export function combineSourcemaps( const useArrayInterface = sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === undefined if (useArrayInterface) { - map = remapping(sourcemapList, () => null, true) + map = remapping(sourcemapList, () => null, excludeContent) } else { map = remapping( sourcemapList[0], @@ -646,7 +647,7 @@ export function combineSourcemaps( return null } }, - true + excludeContent ) } if (!map.file) { From ba43c29a7920ab8356b3fcb16ca3a11dc7e5713e Mon Sep 17 00:00:00 2001 From: yoho Date: Fri, 22 Apr 2022 14:18:07 +0800 Subject: [PATCH 7/8] fix: style use string instead of js import (#7786) --- .../playground/worker/__tests__/es/es-worker.spec.ts | 2 +- .../playground/worker/__tests__/iife/worker.spec.ts | 2 +- .../sourcemap-hidden/sourcemap-hidden-worker.spec.ts | 2 +- .../sourcemap-inline/sourcemap-inline-worker.spec.ts | 2 +- .../__tests__/sourcemap/sourcemap-worker.spec.ts | 2 +- packages/vite/src/node/plugins/html.ts | 11 +++++++++-- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/playground/worker/__tests__/es/es-worker.spec.ts b/packages/playground/worker/__tests__/es/es-worker.spec.ts index c7fd0d6c19e4bc..a815596721c268 100644 --- a/packages/playground/worker/__tests__/es/es-worker.spec.ts +++ b/packages/playground/worker/__tests__/es/es-worker.spec.ts @@ -60,7 +60,7 @@ if (isBuild) { // assert correct files test('inlined code generation', async () => { const files = fs.readdirSync(assetsDir) - expect(files.length).toBe(22) + expect(files.length).toBe(21) const index = files.find((f) => f.includes('main-module')) const content = fs.readFileSync(path.resolve(assetsDir, index), 'utf-8') const worker = files.find((f) => f.includes('my-worker')) diff --git a/packages/playground/worker/__tests__/iife/worker.spec.ts b/packages/playground/worker/__tests__/iife/worker.spec.ts index fa9f72fe76131c..9be78d57edd702 100644 --- a/packages/playground/worker/__tests__/iife/worker.spec.ts +++ b/packages/playground/worker/__tests__/iife/worker.spec.ts @@ -63,7 +63,7 @@ if (isBuild) { // assert correct files test('inlined code generation', async () => { const files = fs.readdirSync(assetsDir) - expect(files.length).toBe(13) + expect(files.length).toBe(12) const index = files.find((f) => f.includes('main-module')) const content = fs.readFileSync(path.resolve(assetsDir, index), 'utf-8') const worker = files.find((f) => f.includes('my-worker')) diff --git a/packages/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts b/packages/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts index d846a5de2311d0..1797ac5269e411 100644 --- a/packages/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts +++ b/packages/playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts @@ -9,7 +9,7 @@ if (isBuild) { test('sourcemap generation for web workers', async () => { const files = fs.readdirSync(assetsDir) // should have 2 worker chunk - expect(files.length).toBe(25) + expect(files.length).toBe(24) const index = files.find((f) => f.includes('main-module')) const content = fs.readFileSync(path.resolve(assetsDir, index), 'utf-8') const indexSourcemap = getSourceMapUrl(content) diff --git a/packages/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts b/packages/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts index ceda7dae1fec7c..89af0878213ab9 100644 --- a/packages/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts +++ b/packages/playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts @@ -9,7 +9,7 @@ if (isBuild) { test('sourcemap generation for web workers', async () => { const files = fs.readdirSync(assetsDir) // should have 2 worker chunk - expect(files.length).toBe(13) + expect(files.length).toBe(12) const index = files.find((f) => f.includes('main-module')) const content = fs.readFileSync(path.resolve(assetsDir, index), 'utf-8') const indexSourcemap = getSourceMapUrl(content) diff --git a/packages/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts b/packages/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts index 54e4f1cb9f2d58..24af73d5e3edfa 100644 --- a/packages/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts +++ b/packages/playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts @@ -9,7 +9,7 @@ if (isBuild) { test('sourcemap generation for web workers', async () => { const files = fs.readdirSync(assetsDir) // should have 2 worker chunk - expect(files.length).toBe(25) + expect(files.length).toBe(24) const index = files.find((f) => f.includes('main-module')) const content = fs.readFileSync(path.resolve(assetsDir, index), 'utf-8') const indexSourcemap = getSourceMapUrl(content) diff --git a/packages/vite/src/node/plugins/html.ts b/packages/vite/src/node/plugins/html.ts index e8df0825ddb3fa..ed4250f1965869 100644 --- a/packages/vite/src/node/plugins/html.ts +++ b/packages/vite/src/node/plugins/html.ts @@ -391,8 +391,15 @@ export function buildHtmlPlugin(config: ResolvedConfig): Plugin { addToHTMLProxyCache(config, filePath, inlineModuleIndex, { code: styleNode.content }) - js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.css"` - shouldRemove = true + js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"` + + // will transform in `applyHtmlTransforms` + s.overwrite( + styleNode.loc.start.offset, + styleNode.loc.end.offset, + `__VITE_INLINE_CSS__${cleanUrl(id)}_${inlineModuleIndex}__`, + { contentOnly: true } + ) } if (shouldRemove) { From fc89057b406fc85e01a1d4fd08f128e9b6bcba5a Mon Sep 17 00:00:00 2001 From: Shinigami Date: Fri, 22 Apr 2022 21:20:57 +0200 Subject: [PATCH 8/8] fix: node v18 support (#7812) --- .github/workflows/ci.yml | 7 ++- package.json | 2 +- packages/vite/package.json | 2 +- packages/vite/src/node/logger.ts | 10 +++- pnpm-lock.yaml | 80 ++++++++++++++++---------------- 5 files changed, 57 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cde7dfb03825ed..2832dab118e279 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,12 +27,17 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node_version: [12, 14, 16, 17] + node_version: [12, 14, 16, 17, 18] include: - os: macos-latest node_version: 16 + - os: macos-latest + node_version: 18 - os: windows-latest node_version: 16 + # Maybe bug with jest on windows and node-v18 + # - os: windows-latest + # node_version: 18 fail-fast: false name: "Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}" diff --git a/package.json b/package.json index 701da1e4ef7887..1bfa2c4e77619c 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@microsoft/api-extractor": "^7.22.2", "@types/fs-extra": "^9.0.13", "@types/jest": "^27.4.1", - "@types/node": "^16.11.27", + "@types/node": "^17.0.25", "@types/prompts": "^2.0.14", "@types/semver": "^7.3.9", "@typescript-eslint/eslint-plugin": "^5.20.0", diff --git a/packages/vite/package.json b/packages/vite/package.json index 0fd8b867dfe042..2d65cc1c330cad 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -71,7 +71,7 @@ "@types/less": "^3.0.3", "@types/micromatch": "^4.0.2", "@types/mime": "^2.0.3", - "@types/node": "^16.11.27", + "@types/node": "^17.0.25", "@types/resolve": "^1.20.1", "@types/sass": "~1.43.1", "@types/stylus": "^0.48.37", diff --git a/packages/vite/src/node/logger.ts b/packages/vite/src/node/logger.ts index b6cf76f2aaa432..8ece2dd8746b7f 100644 --- a/packages/vite/src/node/logger.ts +++ b/packages/vite/src/node/logger.ts @@ -190,7 +190,15 @@ function printServerUrls( } else { Object.values(os.networkInterfaces()) .flatMap((nInterface) => nInterface ?? []) - .filter((detail) => detail && detail.address && detail.family === 'IPv4') + .filter( + (detail) => + detail && + detail.address && + // Node < v18 + ((typeof detail.family === 'string' && detail.family === 'IPv4') || + // Node >= v18 + (typeof detail.family === 'number' && detail.family === 4)) + ) .map((detail) => { const type = detail.address.includes('127.0.0.1') ? 'Local: ' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 140dabd1e04eb5..ad65e136bd1b56 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: '@microsoft/api-extractor': ^7.22.2 '@types/fs-extra': ^9.0.13 '@types/jest': ^27.4.1 - '@types/node': ^16.11.27 + '@types/node': ^17.0.25 '@types/prompts': ^2.0.14 '@types/semver': ^7.3.9 '@typescript-eslint/eslint-plugin': ^5.20.0 @@ -49,7 +49,7 @@ importers: '@microsoft/api-extractor': 7.22.2 '@types/fs-extra': 9.0.13 '@types/jest': 27.4.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 '@types/prompts': 2.0.14 '@types/semver': 7.3.9 '@typescript-eslint/eslint-plugin': 5.20.0_0df7beb8e4d849cfe6bb8e844ccdebfd @@ -77,7 +77,7 @@ importers: simple-git-hooks: 2.7.0 sirv: 2.0.2 ts-jest: 27.1.4_4dfe14e0e8266437469ae0475a5c09ac - ts-node: 10.4.0_8726306ae516cefbf62490d54d06d905 + ts-node: 10.4.0_233d9fcfccc8abc8f146a08357d842da typescript: 4.5.4 vite: link:packages/vite vitepress: 0.22.3 @@ -832,7 +832,7 @@ importers: '@types/less': ^3.0.3 '@types/micromatch': ^4.0.2 '@types/mime': ^2.0.3 - '@types/node': ^16.11.27 + '@types/node': ^17.0.25 '@types/resolve': ^1.20.1 '@types/sass': ~1.43.1 '@types/stylus': ^0.48.37 @@ -910,7 +910,7 @@ importers: '@types/less': 3.0.3 '@types/micromatch': 4.0.2 '@types/mime': 2.0.3 - '@types/node': 16.11.27 + '@types/node': 17.0.25 '@types/resolve': 1.20.1 '@types/sass': 1.43.1 '@types/stylus': 0.48.37 @@ -2012,7 +2012,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -2033,7 +2033,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.8.1 @@ -2070,7 +2070,7 @@ packages: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 jest-mock: 27.5.1 dev: true @@ -2080,7 +2080,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 16.11.27 + '@types/node': 17.0.25 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -2109,7 +2109,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -2193,7 +2193,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 '@types/yargs': 16.0.4 chalk: 4.1.2 dev: true @@ -2541,7 +2541,7 @@ packages: /@types/cross-spawn/6.0.2: resolution: {integrity: sha512-KuwNhp3eza+Rhu8IFI5HUXRP0LIhqH5cAjubUvGXXthh4YYBuP2ntwEX+Cz8GJoZUHlKo247wPWOfA9LYEq4cw==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/debug/4.1.7: @@ -2561,19 +2561,19 @@ packages: /@types/etag/1.8.1: resolution: {integrity: sha512-bsKkeSqN7HYyYntFRAmzcwx/dKW4Wa+KVMTInANlI72PWLQmOpZu96j0OqHZGArW4VQwCmJPteQlXaUDeOB0WQ==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/fs-extra/9.0.13: resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/hash-sum/1.0.0: @@ -2637,8 +2637,8 @@ packages: resolution: {integrity: sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==} dev: true - /@types/node/16.11.27: - resolution: {integrity: sha512-C1pD3kgLoZ56Uuy5lhfOxie4aZlA3UMGLX9rXteq4WitEZH6Rl80mwactt9QG0w0gLFlN/kLBTFnGXtDVWvWQw==} + /@types/node/17.0.25: + resolution: {integrity: sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==} dev: true /@types/normalize-package-data/2.4.1: @@ -2655,13 +2655,13 @@ packages: /@types/prompts/2.0.14: resolution: {integrity: sha512-HZBd99fKxRWpYCErtm2/yxUZv6/PBI9J7N4TNFffl5JbrYMHBwF25DjQGTW3b3jmXq+9P6/8fCIb2ee57BFfYA==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/resolve/1.20.1: @@ -2671,7 +2671,7 @@ packages: /@types/sass/1.43.1: resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/semver/7.3.9: @@ -2689,13 +2689,13 @@ packages: /@types/stylus/0.48.37: resolution: {integrity: sha512-IkLnS/GzdDK3rgAmQwLr8LqPvUMa43SHlCnXqsfXNukwaIpiXBNgSHil3ro8aemhF4k4ZiMoa4URE7mwBHPJnQ==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/ws/8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /@types/yargs-parser/20.2.1: @@ -2712,7 +2712,7 @@ packages: resolution: {integrity: sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==} requiresBuild: true dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true optional: true @@ -6009,7 +6009,7 @@ packages: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -6092,7 +6092,7 @@ packages: pretty-format: 27.5.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.4.0_8726306ae516cefbf62490d54d06d905 + ts-node: 10.4.0_233d9fcfccc8abc8f146a08357d842da transitivePeerDependencies: - bufferutil - canvas @@ -6135,7 +6135,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0 @@ -6153,7 +6153,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 jest-mock: 27.5.1 jest-util: 27.5.1 dev: true @@ -6169,7 +6169,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.5 - '@types/node': 16.11.27 + '@types/node': 17.0.25 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.9 @@ -6191,7 +6191,7 @@ packages: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -6246,7 +6246,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 dev: true /jest-pnp-resolver/1.2.2_jest-resolve@27.5.1: @@ -6302,7 +6302,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.9 @@ -6359,7 +6359,7 @@ packages: resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 graceful-fs: 4.2.9 dev: true @@ -6398,7 +6398,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 chalk: 4.1.2 ci-info: 3.3.0 graceful-fs: 4.2.9 @@ -6423,7 +6423,7 @@ packages: dependencies: '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 16.11.27 + '@types/node': 17.0.25 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 27.5.1 @@ -6434,7 +6434,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 16.11.27 + '@types/node': 17.0.25 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -7652,7 +7652,7 @@ packages: dependencies: import-cwd: 3.0.0 lilconfig: 2.0.4 - ts-node: 10.4.0_8726306ae516cefbf62490d54d06d905 + ts-node: 10.4.0_233d9fcfccc8abc8f146a08357d842da yaml: 1.10.2 dev: false @@ -7668,7 +7668,7 @@ packages: dependencies: lilconfig: 2.0.4 postcss: 8.4.12 - ts-node: 10.4.0_8726306ae516cefbf62490d54d06d905 + ts-node: 10.4.0_233d9fcfccc8abc8f146a08357d842da yaml: 1.10.2 dev: false @@ -7686,7 +7686,7 @@ packages: dependencies: lilconfig: 2.0.5 postcss: 8.4.12 - ts-node: 10.4.0_8726306ae516cefbf62490d54d06d905 + ts-node: 10.4.0_233d9fcfccc8abc8f146a08357d842da yaml: 1.10.2 dev: true @@ -9251,7 +9251,7 @@ packages: yargs-parser: 20.2.9 dev: true - /ts-node/10.4.0_8726306ae516cefbf62490d54d06d905: + /ts-node/10.4.0_233d9fcfccc8abc8f146a08357d842da: resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==} hasBin: true peerDependencies: @@ -9270,7 +9270,7 @@ packages: '@tsconfig/node12': 1.0.9 '@tsconfig/node14': 1.0.1 '@tsconfig/node16': 1.0.2 - '@types/node': 16.11.27 + '@types/node': 17.0.25 acorn: 8.7.0 acorn-walk: 8.2.0 arg: 4.1.3