@nx/vite 20.3.2 → 20.3.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "20.3.
|
|
3
|
+
"version": "20.3.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"migrations": "./migrations.json"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nx/devkit": "20.3.
|
|
33
|
+
"@nx/devkit": "20.3.4",
|
|
34
34
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
35
35
|
"@swc/helpers": "~0.5.0",
|
|
36
36
|
"enquirer": "~2.3.6",
|
|
37
|
-
"@nx/js": "20.3.
|
|
37
|
+
"@nx/js": "20.3.4",
|
|
38
38
|
"tsconfig-paths": "^4.1.2",
|
|
39
39
|
"minimatch": "9.0.3"
|
|
40
40
|
},
|
|
@@ -56,7 +56,7 @@ async function* vitestExecutor(options, context) {
|
|
|
56
56
|
process.on('exit', processExit);
|
|
57
57
|
}
|
|
58
58
|
// vitest sets the exitCode in case of exception without notifying reporters
|
|
59
|
-
if (process.exitCode === undefined) {
|
|
59
|
+
if (process.exitCode === undefined || watch && ctx.state.getFiles().length > 0) {
|
|
60
60
|
for await (const report of nxReporter){
|
|
61
61
|
// vitest sets the exitCode = 1 when code coverage isn't met
|
|
62
62
|
hasErrors = report.hasErrors || process.exitCode && process.exitCode !== 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/vite/src/executors/test/vitest.impl.ts"],"sourcesContent":["import { ExecutorContext, workspaceRoot } from '@nx/devkit';\nimport { VitestExecutorOptions } from './schema';\nimport { resolve } from 'path';\nimport { registerTsConfigPaths } from '@nx/js/src/internal';\nimport { NxReporter } from './lib/nx-reporter';\nimport { getOptions } from './lib/utils';\nimport { loadVitestDynamicImport } from '../../utils/executor-utils';\n\nexport async function* vitestExecutor(\n options: VitestExecutorOptions,\n context: ExecutorContext\n) {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n registerTsConfigPaths(resolve(workspaceRoot, projectRoot, 'tsconfig.json'));\n\n process.env.VITE_CJS_IGNORE_WARNING = 'true';\n // Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.\n const { startVitest } = await loadVitestDynamicImport();\n\n const resolvedOptions =\n (await getOptions(options, context, projectRoot)) ?? {};\n\n const watch = resolvedOptions['watch'] === true;\n\n const nxReporter = new NxReporter(watch);\n if (resolvedOptions['reporters'] === undefined) {\n resolvedOptions['reporters'] = [];\n } else if (typeof resolvedOptions['reporters'] === 'string') {\n resolvedOptions['reporters'] = [resolvedOptions['reporters']];\n }\n resolvedOptions['reporters'].push(nxReporter);\n\n const cliFilters = options.testFiles ?? [];\n\n const ctx = await startVitest(\n resolvedOptions['mode'] ?? 'test',\n cliFilters,\n resolvedOptions\n );\n\n let hasErrors = false;\n\n const processExit = () => {\n ctx.exit();\n if (hasErrors) {\n process.exit(1);\n } else {\n process.exit(0);\n }\n };\n\n if (watch) {\n process.on('SIGINT', processExit);\n process.on('SIGTERM', processExit);\n process.on('exit', processExit);\n }\n\n // vitest sets the exitCode in case of exception without notifying reporters\n if (process.exitCode === undefined) {\n for await (const report of nxReporter) {\n // vitest sets the exitCode = 1 when code coverage isn't met\n hasErrors =\n report.hasErrors || (process.exitCode && process.exitCode !== 0);\n }\n } else {\n hasErrors = process.exitCode !== 0;\n }\n\n return {\n success: !hasErrors,\n };\n}\n\nexport default vitestExecutor;\n"],"names":["vitestExecutor","options","context","projectRoot","projectsConfigurations","projects","projectName","root","registerTsConfigPaths","resolve","workspaceRoot","process","env","VITE_CJS_IGNORE_WARNING","startVitest","loadVitestDynamicImport","resolvedOptions","getOptions","watch","nxReporter","NxReporter","undefined","push","cliFilters","testFiles","ctx","hasErrors","processExit","exit","on","exitCode","report","success"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/vite/src/executors/test/vitest.impl.ts"],"sourcesContent":["import { ExecutorContext, workspaceRoot } from '@nx/devkit';\nimport { VitestExecutorOptions } from './schema';\nimport { resolve } from 'path';\nimport { registerTsConfigPaths } from '@nx/js/src/internal';\nimport { NxReporter } from './lib/nx-reporter';\nimport { getOptions } from './lib/utils';\nimport { loadVitestDynamicImport } from '../../utils/executor-utils';\n\nexport async function* vitestExecutor(\n options: VitestExecutorOptions,\n context: ExecutorContext\n) {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n registerTsConfigPaths(resolve(workspaceRoot, projectRoot, 'tsconfig.json'));\n\n process.env.VITE_CJS_IGNORE_WARNING = 'true';\n // Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.\n const { startVitest } = await loadVitestDynamicImport();\n\n const resolvedOptions =\n (await getOptions(options, context, projectRoot)) ?? {};\n\n const watch = resolvedOptions['watch'] === true;\n\n const nxReporter = new NxReporter(watch);\n if (resolvedOptions['reporters'] === undefined) {\n resolvedOptions['reporters'] = [];\n } else if (typeof resolvedOptions['reporters'] === 'string') {\n resolvedOptions['reporters'] = [resolvedOptions['reporters']];\n }\n resolvedOptions['reporters'].push(nxReporter);\n\n const cliFilters = options.testFiles ?? [];\n\n const ctx = await startVitest(\n resolvedOptions['mode'] ?? 'test',\n cliFilters,\n resolvedOptions\n );\n\n let hasErrors = false;\n\n const processExit = () => {\n ctx.exit();\n if (hasErrors) {\n process.exit(1);\n } else {\n process.exit(0);\n }\n };\n\n if (watch) {\n process.on('SIGINT', processExit);\n process.on('SIGTERM', processExit);\n process.on('exit', processExit);\n }\n\n // vitest sets the exitCode in case of exception without notifying reporters\n if (\n process.exitCode === undefined ||\n (watch && ctx.state.getFiles().length > 0)\n ) {\n for await (const report of nxReporter) {\n // vitest sets the exitCode = 1 when code coverage isn't met\n hasErrors =\n report.hasErrors || (process.exitCode && process.exitCode !== 0);\n }\n } else {\n hasErrors = process.exitCode !== 0;\n }\n\n return {\n success: !hasErrors,\n };\n}\n\nexport default vitestExecutor;\n"],"names":["vitestExecutor","options","context","projectRoot","projectsConfigurations","projects","projectName","root","registerTsConfigPaths","resolve","workspaceRoot","process","env","VITE_CJS_IGNORE_WARNING","startVitest","loadVitestDynamicImport","resolvedOptions","getOptions","watch","nxReporter","NxReporter","undefined","push","cliFilters","testFiles","ctx","hasErrors","processExit","exit","on","exitCode","state","getFiles","length","report","success"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;IA8EA,OAA8B;eAA9B;;IAtEuBA,cAAc;eAAdA;;;wBARwB;sBAEvB;0BACc;4BACX;uBACA;+BACa;AAEjC,gBAAgBA,eACrBC,OAA8B,EAC9BC,OAAwB;IAExB,MAAMC,cACJD,QAAQE,sBAAsB,CAACC,QAAQ,CAACH,QAAQI,WAAW,CAAC,CAACC,IAAI;IAEnEC,IAAAA,+BAAqB,EAACC,IAAAA,aAAO,EAACC,qBAAa,EAAEP,aAAa;IAE1DQ,QAAQC,GAAG,CAACC,uBAAuB,GAAG;IACtC,yFAAyF;IACzF,MAAM,EAAEC,WAAW,EAAE,GAAG,MAAMC,IAAAA,sCAAuB;QAGlD;IADH,MAAMC,kBACJ,CAAC,OAAA,MAAMC,IAAAA,iBAAU,EAAChB,SAASC,SAASC,wBAAnC,OAAoD,CAAC;IAExD,MAAMe,QAAQF,eAAe,CAAC,QAAQ,KAAK;IAE3C,MAAMG,aAAa,IAAIC,sBAAU,CAACF;IAClC,IAAIF,eAAe,CAAC,YAAY,KAAKK,WAAW;QAC9CL,eAAe,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