@nx/vite 16.8.0 → 16.9.0-beta.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/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[]()
|
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
10
10
|
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
11
|
-
[](https://go.nx.dev/community)
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vite",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.9.0-beta.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for building and testing applications using Vite",
|
|
6
6
|
"repository": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"migrations": "./migrations.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nrwl/vite": "16.
|
|
33
|
-
"@nx/devkit": "16.
|
|
34
|
-
"@nx/js": "16.
|
|
32
|
+
"@nrwl/vite": "16.9.0-beta.0",
|
|
33
|
+
"@nx/devkit": "16.9.0-beta.0",
|
|
34
|
+
"@nx/js": "16.9.0-beta.0",
|
|
35
35
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
36
36
|
"@swc/helpers": "~0.5.0",
|
|
37
37
|
"enquirer": "~2.3.6",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"./plugins/nx-tsconfig-paths.plugin": "./plugins/nx-tsconfig-paths.plugin.js"
|
|
58
58
|
},
|
|
59
59
|
"type": "commonjs",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "822fb12c3f0bbaeb6d4a6fbc6cb1064a291e907f"
|
|
61
61
|
}
|
|
@@ -122,6 +122,12 @@ async function viteConfigurationGenerator(tree, schema) {
|
|
|
122
122
|
if (projectType === 'library') {
|
|
123
123
|
// update tsconfig.lib.json to include vite/client
|
|
124
124
|
(0, _devkit.updateJson)(tree, (0, _devkit.joinPathFragments)(root, 'tsconfig.lib.json'), (json)=>{
|
|
125
|
+
if (!json.compilerOptions) {
|
|
126
|
+
json.compilerOptions = {};
|
|
127
|
+
}
|
|
128
|
+
if (!json.compilerOptions.types) {
|
|
129
|
+
json.compilerOptions.types = [];
|
|
130
|
+
}
|
|
125
131
|
if (!json.compilerOptions.types.includes('vite/client')) {
|
|
126
132
|
return _extends._({}, json, {
|
|
127
133
|
compilerOptions: _extends._({}, json.compilerOptions, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/vite/src/generators/configuration/configuration.ts"],"sourcesContent":["import {\n convertNxGenerator,\n formatFiles,\n GeneratorCallback,\n joinPathFragments,\n readProjectConfiguration,\n runTasksInSerial,\n Tree,\n updateJson,\n} from '@nx/devkit';\n\nimport {\n addOrChangeBuildTarget,\n addOrChangeServeTarget,\n addPreviewTarget,\n createOrEditViteConfig,\n deleteWebpackConfig,\n editTsConfig,\n findExistingTargetsInProject,\n handleUnknownExecutors,\n handleUnsupportedUserProvidedTargets,\n moveAndEditIndexHtml,\n TargetFlags,\n UserProvidedTargetName,\n} from '../../utils/generator-utils';\n\nimport initGenerator from '../init/init';\nimport vitestGenerator from '../vitest/vitest-generator';\nimport { ViteConfigurationGeneratorSchema } from './schema';\n\nexport async function viteConfigurationGenerator(\n tree: Tree,\n schema: ViteConfigurationGeneratorSchema\n) {\n const tasks: GeneratorCallback[] = [];\n\n const { targets, projectType, root } = readProjectConfiguration(\n tree,\n schema.project\n );\n let buildTargetName = 'build';\n let serveTargetName = 'serve';\n let testTargetName = 'test';\n\n schema.includeLib ??= projectType === 'library';\n\n // Setting default to jsdom since it is the most common use case (React, Web).\n // The @nx/js:lib generator specifically sets this to node to be more generic.\n schema.testEnvironment ??= 'jsdom';\n\n /**\n * This is for when we are converting an existing project\n * to use the vite executors.\n */\n let projectAlreadyHasViteTargets: TargetFlags = {};\n\n if (!schema.newProject) {\n const userProvidedTargetName: UserProvidedTargetName = {\n build: schema.buildTarget,\n serve: schema.serveTarget,\n test: schema.testTarget,\n };\n\n const {\n validFoundTargetName,\n projectContainsUnsupportedExecutor,\n userProvidedTargetIsUnsupported,\n alreadyHasNxViteTargets,\n } = findExistingTargetsInProject(targets, userProvidedTargetName);\n projectAlreadyHasViteTargets = alreadyHasNxViteTargets;\n /**\n * This means that we only found unsupported build targets in that project.\n * The only way that buildTarget is defined, means that it is supported.\n *\n * If the `unsupported` flag was false, it would mean that we did not find\n * a build target at all, so we can create a new one.\n *\n * So we only throw if we found a target, but it is unsupported.\n */\n if (!validFoundTargetName.build && projectContainsUnsupportedExecutor) {\n throw new Error(\n `The project ${schema.project} cannot be converted to use the @nx/vite executors.`\n );\n }\n\n if (\n alreadyHasNxViteTargets.build &&\n (alreadyHasNxViteTargets.serve || projectType === 'library') &&\n alreadyHasNxViteTargets.test\n ) {\n throw new Error(\n `The project ${schema.project} is already configured to use the @nx/vite executors.\n Please try a different project, or remove the existing targets \n and re-run this generator to reset the existing Vite Configuration.\n `\n );\n }\n\n /**\n * This means that we did not find any supported executors\n * so we don't have any valid target names.\n *\n * However, the executors that we may have found are not in the\n * list of the specifically unsupported executors either.\n *\n * So, we should warn the user about it.\n */\n\n if (\n !projectContainsUnsupportedExecutor &&\n !validFoundTargetName.build &&\n !validFoundTargetName.serve &&\n !validFoundTargetName.test\n ) {\n await handleUnknownExecutors(schema.project);\n }\n\n /**\n * There is a possibility at this stage that the user has provided\n * targets with unsupported executors.\n * We keep track here of which of the targets that the user provided\n * are unsupported.\n * We do this with the `userProvidedTargetIsUnsupported` object,\n * which contains flags for each target (whether it is supported or not).\n *\n * We also keep track of the targets that we found in the project,\n * through the findExistingTargetsInProject function, which returns\n * targets for build/serve/test that use supported executors, and\n * can be converted to use the vite executors. These are the\n * kept in the validFoundTargetName object.\n */\n await handleUnsupportedUserProvidedTargets(\n userProvidedTargetIsUnsupported,\n userProvidedTargetName,\n validFoundTargetName\n );\n\n /**\n * Once the user is at this stage, then they can go ahead and convert.\n */\n\n buildTargetName = validFoundTargetName.build ?? buildTargetName;\n serveTargetName = validFoundTargetName.serve ?? serveTargetName;\n\n if (projectType === 'application') {\n moveAndEditIndexHtml(tree, schema, buildTargetName);\n }\n\n deleteWebpackConfig(\n tree,\n root,\n targets?.[buildTargetName]?.options?.webpackConfig\n );\n\n editTsConfig(tree, schema);\n }\n\n const initTask = await initGenerator(tree, {\n uiFramework: schema.uiFramework,\n includeLib: schema.includeLib,\n compiler: schema.compiler,\n testEnvironment: schema.testEnvironment,\n });\n tasks.push(initTask);\n\n if (!projectAlreadyHasViteTargets.build) {\n addOrChangeBuildTarget(tree, schema, buildTargetName);\n }\n\n if (!schema.includeLib) {\n if (!projectAlreadyHasViteTargets.serve) {\n addOrChangeServeTarget(tree, schema, serveTargetName);\n }\n if (!projectAlreadyHasViteTargets.preview) {\n addPreviewTarget(tree, schema, serveTargetName);\n }\n }\n\n if (projectType === 'library') {\n // update tsconfig.lib.json to include vite/client\n updateJson(tree, joinPathFragments(root, 'tsconfig.lib.json'), (json) => {\n if (!json.compilerOptions.types.includes('vite/client')) {\n return {\n ...json,\n compilerOptions: {\n ...json.compilerOptions,\n types: [...json.compilerOptions.types, 'vite/client'],\n },\n };\n }\n return json;\n });\n }\n\n createOrEditViteConfig(tree, schema, false, projectAlreadyHasViteTargets);\n\n if (schema.includeVitest) {\n const vitestTask = await vitestGenerator(tree, {\n project: schema.project,\n uiFramework: schema.uiFramework,\n inSourceTests: schema.inSourceTests,\n coverageProvider: 'c8',\n skipViteConfig: true,\n testTarget: testTargetName,\n skipFormat: true,\n });\n tasks.push(vitestTask);\n }\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n\n return runTasksInSerial(...tasks);\n}\n\nexport default viteConfigurationGenerator;\nexport const configurationSchematic = convertNxGenerator(\n viteConfigurationGenerator\n);\n"],"names":["viteConfigurationGenerator","configurationSchematic","tree","schema","tasks","targets","projectType","root","readProjectConfiguration","project","buildTargetName","serveTargetName","testTargetName","includeLib","testEnvironment","projectAlreadyHasViteTargets","newProject","userProvidedTargetName","build","buildTarget","serve","serveTarget","test","testTarget","validFoundTargetName","projectContainsUnsupportedExecutor","userProvidedTargetIsUnsupported","alreadyHasNxViteTargets","findExistingTargetsInProject","Error","handleUnknownExecutors","handleUnsupportedUserProvidedTargets","moveAndEditIndexHtml","deleteWebpackConfig","options","webpackConfig","editTsConfig","initTask","initGenerator","uiFramework","compiler","push","addOrChangeBuildTarget","addOrChangeServeTarget","preview","addPreviewTarget","updateJson","joinPathFragments","json","compilerOptions","types","includes","createOrEditViteConfig","includeVitest","vitestTask","vitestGenerator","inSourceTests","coverageProvider","skipViteConfig","skipFormat","formatFiles","runTasksInSerial","convertNxGenerator"],"mappings":";;;;;;;;IA8BsBA,0BAA0B;eAA1BA;;IA0LtB,OAA0C;eAA1C;;IACaC,sBAAsB;eAAtBA;;;;wBAhNN;gCAeA;sBAEmB;iCACE;AAGrB,eAAeD,2BACpBE,IAAU,EACVC,MAAwC,EACxC;QAWAA,SAEA,8EAA8E;IAC9E,8EAA8E;IAC9EA;IAdA,MAAMC,QAA6B,EAAE;IAErC,MAAM,EAAEC,QAAO,EAAEC,YAAW,EAAEC,KAAI,EAAE,GAAGC,IAAAA,gCAAwB,EAC7DN,MACAC,OAAOM,OAAO;IAEhB,IAAIC,kBAAkB;IACtB,IAAIC,kBAAkB;IACtB,IAAIC,iBAAiB;;IAErBT,gBAAAA,UAAAA,QAAOU,oCAAPV,QAAOU,aAAeP,gBAAgB,SAAS;;IAI/CH,qBAAAA,WAAAA,QAAOW,8CAAPX,SAAOW,kBAAoB,OAAO;IAElC;;;GAGC,GACD,IAAIC,+BAA4C,CAAC;IAEjD,IAAI,CAACZ,OAAOa,UAAU,EAAE;YA+FpBX;QA9FF,MAAMY,yBAAiD;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;YACvB8B,aAAapC,OAAOoC,WAAW;YAC/BiB,eAAerD,OAAOqD,aAAa;YACnCC,kBAAkB;YAClBC,gBAAgB,IAAI;YACpBnC,YAAYX;YACZ+C,YAAY,IAAI;QAClB;QACAvD,MAAMqC,IAAI,CAACa;IACb,CAAC;IAED,IAAI,CAACnD,OAAOwD,UAAU,EAAE;QACtB,MAAMC,IAAAA,mBAAW,EAAC1D;IACpB,CAAC;IAED,OAAO2D,IAAAA,wBAAgB,KAAIzD;AAC7B;MAEA,WAAeJ;AACR,MAAMC,yBAAyB6D,IAAAA,0BAAkB,EACtD9D"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/vite/src/generators/configuration/configuration.ts"],"sourcesContent":["import {\n convertNxGenerator,\n formatFiles,\n GeneratorCallback,\n joinPathFragments,\n readProjectConfiguration,\n runTasksInSerial,\n Tree,\n updateJson,\n} from '@nx/devkit';\n\nimport {\n addOrChangeBuildTarget,\n addOrChangeServeTarget,\n addPreviewTarget,\n createOrEditViteConfig,\n deleteWebpackConfig,\n editTsConfig,\n findExistingTargetsInProject,\n handleUnknownExecutors,\n handleUnsupportedUserProvidedTargets,\n moveAndEditIndexHtml,\n TargetFlags,\n UserProvidedTargetName,\n} from '../../utils/generator-utils';\n\nimport initGenerator from '../init/init';\nimport vitestGenerator from '../vitest/vitest-generator';\nimport { ViteConfigurationGeneratorSchema } from './schema';\n\nexport async function viteConfigurationGenerator(\n tree: Tree,\n schema: ViteConfigurationGeneratorSchema\n) {\n const tasks: GeneratorCallback[] = [];\n\n const { targets, projectType, root } = readProjectConfiguration(\n tree,\n schema.project\n );\n let buildTargetName = 'build';\n let serveTargetName = 'serve';\n let testTargetName = 'test';\n\n schema.includeLib ??= projectType === 'library';\n\n // Setting default to jsdom since it is the most common use case (React, Web).\n // The @nx/js:lib generator specifically sets this to node to be more generic.\n schema.testEnvironment ??= 'jsdom';\n\n /**\n * This is for when we are converting an existing project\n * to use the vite executors.\n */\n let projectAlreadyHasViteTargets: TargetFlags = {};\n\n if (!schema.newProject) {\n const userProvidedTargetName: UserProvidedTargetName = {\n build: schema.buildTarget,\n serve: schema.serveTarget,\n test: schema.testTarget,\n };\n\n const {\n validFoundTargetName,\n projectContainsUnsupportedExecutor,\n userProvidedTargetIsUnsupported,\n alreadyHasNxViteTargets,\n } = findExistingTargetsInProject(targets, userProvidedTargetName);\n projectAlreadyHasViteTargets = alreadyHasNxViteTargets;\n /**\n * This means that we only found unsupported build targets in that project.\n * The only way that buildTarget is defined, means that it is supported.\n *\n * If the `unsupported` flag was false, it would mean that we did not find\n * a build target at all, so we can create a new one.\n *\n * So we only throw if we found a target, but it is unsupported.\n */\n if (!validFoundTargetName.build && projectContainsUnsupportedExecutor) {\n throw new Error(\n `The project ${schema.project} cannot be converted to use the @nx/vite executors.`\n );\n }\n\n if (\n alreadyHasNxViteTargets.build &&\n (alreadyHasNxViteTargets.serve || projectType === 'library') &&\n alreadyHasNxViteTargets.test\n ) {\n throw new Error(\n `The project ${schema.project} is already configured to use the @nx/vite executors.\n Please try a different project, or remove the existing targets \n and re-run this generator to reset the existing Vite Configuration.\n `\n );\n }\n\n /**\n * This means that we did not find any supported executors\n * so we don't have any valid target names.\n *\n * However, the executors that we may have found are not in the\n * list of the specifically unsupported executors either.\n *\n * So, we should warn the user about it.\n */\n\n if (\n !projectContainsUnsupportedExecutor &&\n !validFoundTargetName.build &&\n !validFoundTargetName.serve &&\n !validFoundTargetName.test\n ) {\n await handleUnknownExecutors(schema.project);\n }\n\n /**\n * There is a possibility at this stage that the user has provided\n * targets with unsupported executors.\n * We keep track here of which of the targets that the user provided\n * are unsupported.\n * We do this with the `userProvidedTargetIsUnsupported` object,\n * which contains flags for each target (whether it is supported or not).\n *\n * We also keep track of the targets that we found in the project,\n * through the findExistingTargetsInProject function, which returns\n * targets for build/serve/test that use supported executors, and\n * can be converted to use the vite executors. These are the\n * kept in the validFoundTargetName object.\n */\n await handleUnsupportedUserProvidedTargets(\n userProvidedTargetIsUnsupported,\n userProvidedTargetName,\n validFoundTargetName\n );\n\n /**\n * Once the user is at this stage, then they can go ahead and convert.\n */\n\n buildTargetName = validFoundTargetName.build ?? buildTargetName;\n serveTargetName = validFoundTargetName.serve ?? serveTargetName;\n\n if (projectType === 'application') {\n moveAndEditIndexHtml(tree, schema, buildTargetName);\n }\n\n deleteWebpackConfig(\n tree,\n root,\n targets?.[buildTargetName]?.options?.webpackConfig\n );\n\n editTsConfig(tree, schema);\n }\n\n const initTask = await initGenerator(tree, {\n uiFramework: schema.uiFramework,\n includeLib: schema.includeLib,\n compiler: schema.compiler,\n testEnvironment: schema.testEnvironment,\n });\n tasks.push(initTask);\n\n if (!projectAlreadyHasViteTargets.build) {\n addOrChangeBuildTarget(tree, schema, buildTargetName);\n }\n\n if (!schema.includeLib) {\n if (!projectAlreadyHasViteTargets.serve) {\n addOrChangeServeTarget(tree, schema, serveTargetName);\n }\n if (!projectAlreadyHasViteTargets.preview) {\n addPreviewTarget(tree, schema, serveTargetName);\n }\n }\n\n if (projectType === 'library') {\n // update tsconfig.lib.json to include vite/client\n updateJson(tree, joinPathFragments(root, 'tsconfig.lib.json'), (json) => {\n if (!json.compilerOptions) {\n json.compilerOptions = {};\n }\n if (!json.compilerOptions.types) {\n json.compilerOptions.types = [];\n }\n if (!json.compilerOptions.types.includes('vite/client')) {\n return {\n ...json,\n compilerOptions: {\n ...json.compilerOptions,\n types: [...json.compilerOptions.types, 'vite/client'],\n },\n };\n }\n return json;\n });\n }\n\n createOrEditViteConfig(tree, schema, false, projectAlreadyHasViteTargets);\n\n if (schema.includeVitest) {\n const vitestTask = await vitestGenerator(tree, {\n project: schema.project,\n uiFramework: schema.uiFramework,\n inSourceTests: schema.inSourceTests,\n coverageProvider: 'c8',\n skipViteConfig: true,\n testTarget: testTargetName,\n skipFormat: true,\n });\n tasks.push(vitestTask);\n }\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n\n return runTasksInSerial(...tasks);\n}\n\nexport default viteConfigurationGenerator;\nexport const configurationSchematic = convertNxGenerator(\n viteConfigurationGenerator\n);\n"],"names":["viteConfigurationGenerator","configurationSchematic","tree","schema","tasks","targets","projectType","root","readProjectConfiguration","project","buildTargetName","serveTargetName","testTargetName","includeLib","testEnvironment","projectAlreadyHasViteTargets","newProject","userProvidedTargetName","build","buildTarget","serve","serveTarget","test","testTarget","validFoundTargetName","projectContainsUnsupportedExecutor","userProvidedTargetIsUnsupported","alreadyHasNxViteTargets","findExistingTargetsInProject","Error","handleUnknownExecutors","handleUnsupportedUserProvidedTargets","moveAndEditIndexHtml","deleteWebpackConfig","options","webpackConfig","editTsConfig","initTask","initGenerator","uiFramework","compiler","push","addOrChangeBuildTarget","addOrChangeServeTarget","preview","addPreviewTarget","updateJson","joinPathFragments","json","compilerOptions","types","includes","createOrEditViteConfig","includeVitest","vitestTask","vitestGenerator","inSourceTests","coverageProvider","skipViteConfig","skipFormat","formatFiles","runTasksInSerial","convertNxGenerator"],"mappings":";;;;;;;;IA8BsBA,0BAA0B;eAA1BA;;IAgMtB,OAA0C;eAA1C;;IACaC,sBAAsB;eAAtBA;;;;wBAtNN;gCAeA;sBAEmB;iCACE;AAGrB,eAAeD,2BACpBE,IAAU,EACVC,MAAwC,EACxC;QAWAA,SAEA,8EAA8E;IAC9E,8EAA8E;IAC9EA;IAdA,MAAMC,QAA6B,EAAE;IAErC,MAAM,EAAEC,QAAO,EAAEC,YAAW,EAAEC,KAAI,EAAE,GAAGC,IAAAA,gCAAwB,EAC7DN,MACAC,OAAOM,OAAO;IAEhB,IAAIC,kBAAkB;IACtB,IAAIC,kBAAkB;IACtB,IAAIC,iBAAiB;;IAErBT,gBAAAA,UAAAA,QAAOU,oCAAPV,QAAOU,aAAeP,gBAAgB,SAAS;;IAI/CH,qBAAAA,WAAAA,QAAOW,8CAAPX,SAAOW,kBAAoB,OAAO;IAElC;;;GAGC,GACD,IAAIC,+BAA4C,CAAC;IAEjD,IAAI,CAACZ,OAAOa,UAAU,EAAE;YA+FpBX;QA9FF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