@nx/vite 18.0.4 → 18.0.6
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/migrations.json +21 -0
- package/package.json +5 -5
- package/src/executors/test/lib/utils.d.ts +2 -2
- package/src/executors/test/lib/utils.js +22 -12
- package/src/executors/test/lib/utils.js.map +1 -1
- package/src/executors/test/schema.d.ts +1 -0
- package/src/executors/test/schema.json +4 -0
- package/src/executors/test/vitest.impl.js +3 -3
- package/src/executors/test/vitest.impl.js.map +1 -1
- package/src/generators/configuration/configuration.js +6 -68
- package/src/generators/configuration/configuration.js.map +1 -1
- package/src/generators/configuration/lib/convert-non-vite.d.ts +5 -0
- package/src/generators/configuration/lib/convert-non-vite.js +62 -0
- package/src/generators/configuration/lib/convert-non-vite.js.map +1 -0
- package/src/generators/configuration/schema.d.ts +0 -3
- package/src/generators/configuration/schema.json +0 -12
- package/src/generators/vitest/vitest-generator.js +2 -2
- package/src/generators/vitest/vitest-generator.js.map +1 -1
- package/src/migrations/update-16-6-0-change-ts-paths-plugin/change-ts-paths-plugin.js +2 -16
- package/src/migrations/update-16-6-0-change-ts-paths-plugin/change-ts-paths-plugin.js.map +1 -1
- package/src/migrations/update-17-2-0/update-vite-config.js +2 -16
- package/src/migrations/update-17-2-0/update-vite-config.js.map +1 -1
- package/src/utils/executor-utils.d.ts +1 -0
- package/src/utils/executor-utils.js +6 -0
- package/src/utils/executor-utils.js.map +1 -1
- package/src/{migrations/update-17-2-0/lib → utils}/find-vite-config.d.ts +1 -0
- package/src/utils/find-vite-config.js +46 -0
- package/src/utils/find-vite-config.js.map +1 -0
- package/src/utils/generator-utils.d.ts +8 -11
- package/src/utils/generator-utils.js +71 -186
- package/src/utils/generator-utils.js.map +1 -1
- package/src/utils/test-utils.js +8 -16
- package/src/utils/test-utils.js.map +1 -1
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/update-17-2-0/lib/find-vite-config.js +0 -25
- package/src/migrations/update-17-2-0/lib/find-vite-config.js.map +0 -1
- package/src/utils/test-files/react-project.config.json +0 -82
- package/src/utils/test-files/web-project.config.json +0 -69
package/src/utils/test-utils.js
CHANGED
|
@@ -33,9 +33,7 @@ _export(exports, {
|
|
|
33
33
|
});
|
|
34
34
|
const _extends = require("@swc/helpers/_/_extends");
|
|
35
35
|
const _devkit = require("@nx/devkit");
|
|
36
|
-
const _reactprojectconfigjson = require("./test-files/react-project.config.json");
|
|
37
36
|
const _reactviteprojectconfigjson = require("./test-files/react-vite-project.config.json");
|
|
38
|
-
const _webprojectconfigjson = require("./test-files/web-project.config.json");
|
|
39
37
|
const _angularprojectconfigjson = require("./test-files/angular-project.config.json");
|
|
40
38
|
const _unknownprojectconfigjson = require("./test-files/unknown-project.config.json");
|
|
41
39
|
const _reactmixedprojectconfigjson = require("./test-files/react-mixed-project.config.json");
|
|
@@ -150,6 +148,7 @@ function mockViteReactAppGenerator(tree) {
|
|
|
150
148
|
function mockReactAppGenerator(tree) {
|
|
151
149
|
const appName = 'my-test-react-app';
|
|
152
150
|
tree.write(`apps/${appName}/src/main.tsx`, `import ReactDOM from 'react-dom';\n`);
|
|
151
|
+
tree.write(`apps/${appName}/webpack.config.ts`, ``);
|
|
153
152
|
tree.write(`apps/${appName}/tsconfig.json`, `{
|
|
154
153
|
"extends": "../../tsconfig.base.json",
|
|
155
154
|
"compilerOptions": {
|
|
@@ -213,18 +212,10 @@ function mockReactAppGenerator(tree) {
|
|
|
213
212
|
<div id="root"></div>
|
|
214
213
|
</body>
|
|
215
214
|
</html>`);
|
|
216
|
-
(0, _devkit.writeJson)(tree,
|
|
217
|
-
projects: {
|
|
218
|
-
'my-test-react-app': _extends._({}, _reactprojectconfigjson, {
|
|
219
|
-
root: `apps/${appName}`,
|
|
220
|
-
projectType: 'application'
|
|
221
|
-
})
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
(0, _devkit.writeJson)(tree, `apps/${appName}/project.json`, _extends._({}, _reactprojectconfigjson, {
|
|
215
|
+
(0, _devkit.writeJson)(tree, `apps/${appName}/project.json`, {
|
|
225
216
|
root: `apps/${appName}`,
|
|
226
217
|
projectType: 'application'
|
|
227
|
-
})
|
|
218
|
+
});
|
|
228
219
|
return tree;
|
|
229
220
|
}
|
|
230
221
|
function mockReactMixedAppGenerator(tree) {
|
|
@@ -324,6 +315,7 @@ function mockWebAppGenerator(tree) {
|
|
|
324
315
|
]
|
|
325
316
|
}
|
|
326
317
|
`);
|
|
318
|
+
tree.write(`apps/${appName}/webpack.config.ts`, ``);
|
|
327
319
|
tree.write(`apps/${appName}/src/index.html`, `<!DOCTYPE html>
|
|
328
320
|
<html lang="en">
|
|
329
321
|
<head>
|
|
@@ -341,16 +333,16 @@ function mockWebAppGenerator(tree) {
|
|
|
341
333
|
`);
|
|
342
334
|
(0, _devkit.writeJson)(tree, 'workspace.json', {
|
|
343
335
|
projects: {
|
|
344
|
-
'my-test-web-app':
|
|
336
|
+
'my-test-web-app': {
|
|
345
337
|
root: `apps/${appName}`,
|
|
346
338
|
projectType: 'application'
|
|
347
|
-
}
|
|
339
|
+
}
|
|
348
340
|
}
|
|
349
341
|
});
|
|
350
|
-
(0, _devkit.writeJson)(tree, `apps/${appName}/project.json`,
|
|
342
|
+
(0, _devkit.writeJson)(tree, `apps/${appName}/project.json`, {
|
|
351
343
|
root: `apps/${appName}`,
|
|
352
344
|
projectType: 'application'
|
|
353
|
-
})
|
|
345
|
+
});
|
|
354
346
|
return tree;
|
|
355
347
|
}
|
|
356
348
|
function mockAngularAppGenerator(tree) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/vite/src/utils/test-utils.ts"],"sourcesContent":["import { Tree, writeJson } from '@nx/devkit';\nimport * as reactAppConfig from './test-files/react-project.config.json';\nimport * as reactViteConfig from './test-files/react-vite-project.config.json';\nimport * as webAppConfig from './test-files/web-project.config.json';\nimport * as angularAppConfig from './test-files/angular-project.config.json';\nimport * as randomAppConfig from './test-files/unknown-project.config.json';\nimport * as mixedAppConfig from './test-files/react-mixed-project.config.json';\nimport * as reactLibNBJest from './test-files/react-lib-non-buildable-jest.json';\nimport * as reactLibNBVitest from './test-files/react-lib-non-buildable-vitest.json';\n\nexport function mockViteReactAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-react-vite-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true,\n \"types\": [\"vite/client\"]\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"src/**/*.spec.ts\",\n \"src/**/*.test.ts\",\n \"src/**/*.spec.tsx\",\n \"src/**/*.test.tsx\",\n \"src/**/*.spec.js\",\n \"src/**/*.test.js\",\n \"src/**/*.spec.jsx\",\n \"src/**/*.test.jsx\"\n ],\n \"include\": [\"src/**/*.js\", \"src/**/*.jsx\", \"src/**/*.ts\", \"src/**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>Rv1</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n <link rel=\"stylesheet\" href=\"/src/styles.css\" />\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n </html>`\n );\n\n tree.write(\n `apps/${appName}/vite.config.ts`,\n ` /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import tsconfigPaths from 'vite-tsconfig-paths';\n \n export default defineConfig({\n server: {\n port: 4200,\n host: 'localhost',\n },\n plugins: [\n react(),\n tsconfigPaths({\n root: '../../',\n projects: ['tsconfig.base.json'],\n }),\n ],\n \n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n `\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-react-vite-app': {\n ...reactViteConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...reactViteConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockReactAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-react-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": true,\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"noImplicitOverride\": true,\n \"noPropertyAccessFromIndexSignature\": true,\n \"noImplicitReturns\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\"\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>My Test React App</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-react-app': {\n ...reactAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...reactAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\nexport function mockReactMixedAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-mixed-react-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": true,\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"noImplicitOverride\": true,\n \"noPropertyAccessFromIndexSignature\": true,\n \"noImplicitReturns\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\"\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>My Test React App</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-mixed-react-app': {\n ...mixedAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...mixedAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockWebAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-web-app';\n\n tree.write(`apps/${appName}/src/main.ts`, `import './app/app.element.ts';`);\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>WebappPure</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <workspace-root></workspace-root>\n </body>\n </html>\n `\n );\n\n writeJson(\n tree,\n 'workspace.json',\n\n {\n projects: {\n 'my-test-web-app': {\n ...webAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n }\n );\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...webAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n return tree;\n}\n\nexport function mockAngularAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-angular-app';\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-angular-app': {\n ...angularAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...angularAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockUnknownAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-random-app';\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-random-app': {\n ...randomAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...randomAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockReactLibNonBuildableJestTestRunnerGenerator(\n tree: Tree\n): Tree {\n const libName = 'react-lib-nonb-jest';\n\n tree.write(`libs/${libName}/src/index.ts`, ``);\n\n tree.write(\n `libs/${libName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.lib.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }`\n );\n tree.write(\n `libs/${libName}/tsconfig.lib.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"src/**/*.spec.ts\",\n \"src/**/*.test.ts\",\n \"src/**/*.spec.tsx\",\n \"src/**/*.test.tsx\",\n \"src/**/*.spec.js\",\n \"src/**/*.test.js\",\n \"src/**/*.spec.jsx\",\n \"src/**/*.test.jsx\"\n ],\n \"include\": [\"src/**/*.js\", \"src/**/*.jsx\", \"src/**/*.ts\", \"src/**/*.tsx\"]\n }`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n [`${libName}`]: {\n ...reactLibNBJest,\n root: `libs/${libName}`,\n projectType: 'library',\n },\n },\n });\n\n writeJson(tree, `libs/${libName}/project.json`, {\n ...reactLibNBJest,\n root: `libs/${libName}`,\n projectType: 'library',\n });\n\n return tree;\n}\n\nexport function mockReactLibNonBuildableVitestRunnerGenerator(\n tree: Tree\n): Tree {\n const libName = 'react-lib-nonb-vitest';\n\n tree.write(`libs/${libName}/src/index.ts`, ``);\n\n tree.write(\n `libs/${libName}/vite.config.ts`,\n `/// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n\n plugins: [\n nxViteTsPaths(),\n react(),\n ],\n\n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n `\n );\n\n tree.write(\n `libs/${libName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.lib.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }`\n );\n tree.write(\n `libs/${libName}/tsconfig.lib.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n }`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n [`${libName}`]: {\n ...reactLibNBVitest,\n root: `libs/${libName}`,\n projectType: 'library',\n },\n },\n });\n\n writeJson(tree, `libs/${libName}/project.json`, {\n ...reactLibNBVitest,\n root: `libs/${libName}`,\n projectType: 'library',\n });\n\n return tree;\n}\n"],"names":["mockViteReactAppGenerator","mockReactAppGenerator","mockReactMixedAppGenerator","mockWebAppGenerator","mockAngularAppGenerator","mockUnknownAppGenerator","mockReactLibNonBuildableJestTestRunnerGenerator","mockReactLibNonBuildableVitestRunnerGenerator","tree","appName","write","writeJson","projects","reactViteConfig","root","projectType","reactAppConfig","mixedAppConfig","webAppConfig","angularAppConfig","randomAppConfig","libName","reactLibNBJest","reactLibNBVitest"],"mappings":";;;;;;;;IAUgBA,yBAAyB;eAAzBA;;IAmIAC,qBAAqB;eAArBA;;IAoGAC,0BAA0B;eAA1BA;;IAqGAC,mBAAmB;eAAnBA;;IAiEAC,uBAAuB;eAAvBA;;IAsBAC,uBAAuB;eAAvBA;;IAsBAC,+CAA+C;eAA/CA;;IA4EAC,6CAA6C;eAA7CA;;;;wBA/gBgB;wCACA;4CACC;sCACH;0CACI;0CACD;6CACD;8CACA;gDACE;AAE3B,SAASP,0BAA0BQ,IAAU;IAClD,MAAMC,UAAU;IAEhBD,KAAKE,KAAK,CACR,CAAC,KAAK,EAAED,QAAQ,aAAa,CAAC,EAC9B,CAAC,mCAAmC,CAAC;IAGvCD,KAAKE,KAAK,CACR,CAAC,KAAK,EAAED,QAAQ,cAAc,CAAC,EAC/B,CAAC;;;;;;;;;;;;;;;;;;;;;MAqBC,CAAC;IAELD,KAAKE,KAAK,CACR,CAAC,KAAK,EAAED,QAAQ,kBAAkB,CAAC,EACnC,CAAC;;;;;;;;;;;;;;;;;;;;;;MAsBC,CAAC;IAGLD,KAAKE,KAAK,CACR,CAAC,KAAK,EAAED,QAAQ,WAAW,CAAC,EAC5B,CAAC;;;;;;;;;;;;;;;WAeM,CAAC;IAGVD,KAAKE,KAAK,CACR,CAAC,KAAK,EAAED,QAAQ,eAAe,CAAC,EAChC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BD,CAAC;IAGHE,IAAAA,iBAAS,EAACH,MAAM,kBAAkB;QAChCI,UAAU;YACR,0BAA0B,eACrBC;gBACHC,MAAM,CAAC,KAAK,EAAEL,QAAQ,CAAC;gBACvBM,aAAa;;Q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AS,EAACH,MAAM,CAAC,KAAK,EAAEa,QAAQ,aAAa,CAAC,EAAE,eAC3CC;QACHR,MAAM,CAAC,KAAK,EAAEO,QAAQ,CAAC;QACvBN,aAAa;;IAGf,OAAOP;AACT;AAEO,SAASD,8CACdC,IAAU;IAEV,MAAMa,UAAU;IAEhBb,KAAKE,KAAK,CAAC,CAAC,KAAK,EAAEW,QAAQ,aAAa,CAAC,EAAE,CAAC,CAAC;IAE7Cb,KAAKE,KAAK,CACR,CAAC,KAAK,EAAEW,QAAQ,eAAe,CAAC,EAChC,CAAC;;;;;;;;;;;;;;;;;;;;;EAqBH,CAAC;IAGDb,KAAKE,KAAK,CACR,CAAC,KAAK,EAAEW,QAAQ,cAAc,CAAC,EAC/B,CAAC;;;;;;;;;;;;;;;;;;;KAmBA,CAAC;IAEJb,KAAKE,KAAK,CACR,CAAC,KAAK,EAAEW,QAAQ,kBAAkB,CAAC,EACnC,CAAC;;;;;;;;;;;;;;;;;;;;;KAqBA,CAAC;IAGJV,IAAAA,iBAAS,EAACH,MAAM,kBAAkB;QAChCI,UAAU;YACR,CAAC,CAAC,EAAES,QAAQ,CAAC,CAAC,EAAE,eACXE;gBACHT,MAAM,CAAC,KAAK,EAAEO,QAAQ,CAAC;gBACvBN,aAAa;;QAEjB;IACF;IAEAJ,IAAAA,iBAAS,EAACH,MAAM,CAAC,KAAK,EAAEa,QAAQ,aAAa,CAAC,EAAE,eAC3CE;QACHT,MAAM,CAAC,KAAK,EAAEO,QAAQ,CAAC;QACvBN,aAAa;;IAGf,OAAOP;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/vite/src/utils/test-utils.ts"],"sourcesContent":["import { Tree, writeJson } from '@nx/devkit';\nimport * as reactViteConfig from './test-files/react-vite-project.config.json';\nimport * as angularAppConfig from './test-files/angular-project.config.json';\nimport * as randomAppConfig from './test-files/unknown-project.config.json';\nimport * as mixedAppConfig from './test-files/react-mixed-project.config.json';\nimport * as reactLibNBJest from './test-files/react-lib-non-buildable-jest.json';\nimport * as reactLibNBVitest from './test-files/react-lib-non-buildable-vitest.json';\n\nexport function mockViteReactAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-react-vite-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true,\n \"types\": [\"vite/client\"]\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"src/**/*.spec.ts\",\n \"src/**/*.test.ts\",\n \"src/**/*.spec.tsx\",\n \"src/**/*.test.tsx\",\n \"src/**/*.spec.js\",\n \"src/**/*.test.js\",\n \"src/**/*.spec.jsx\",\n \"src/**/*.test.jsx\"\n ],\n \"include\": [\"src/**/*.js\", \"src/**/*.jsx\", \"src/**/*.ts\", \"src/**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>Rv1</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"/favicon.ico\" />\n <link rel=\"stylesheet\" href=\"/src/styles.css\" />\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n </html>`\n );\n\n tree.write(\n `apps/${appName}/vite.config.ts`,\n ` /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import tsconfigPaths from 'vite-tsconfig-paths';\n \n export default defineConfig({\n server: {\n port: 4200,\n host: 'localhost',\n },\n plugins: [\n react(),\n tsconfigPaths({\n root: '../../',\n projects: ['tsconfig.base.json'],\n }),\n ],\n \n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n `\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-react-vite-app': {\n ...reactViteConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...reactViteConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockReactAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-react-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(`apps/${appName}/webpack.config.ts`, ``);\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": true,\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"noImplicitOverride\": true,\n \"noPropertyAccessFromIndexSignature\": true,\n \"noImplicitReturns\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\"\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>My Test React App</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>`\n );\n\n writeJson(tree, `apps/${appName}/project.json`, {\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\nexport function mockReactMixedAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-mixed-react-app';\n\n tree.write(\n `apps/${appName}/src/main.tsx`,\n `import ReactDOM from 'react-dom';\\n`\n );\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": true,\n \"esModuleInterop\": true,\n \"allowSyntheticDefaultImports\": true,\n \"forceConsistentCasingInFileNames\": true,\n \"strict\": true,\n \"noImplicitOverride\": true,\n \"noPropertyAccessFromIndexSignature\": true,\n \"noImplicitReturns\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n }\n `\n );\n tree.write(\n `apps/${appName}/tsconfig.app.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\"\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n } \n `\n );\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>My Test React App</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n </html>`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-mixed-react-app': {\n ...mixedAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...mixedAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockWebAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-web-app';\n\n tree.write(`apps/${appName}/src/main.ts`, `import './app/app.element.ts';`);\n\n tree.write(\n `apps/${appName}/tsconfig.json`,\n `{\n \"extends\": \"../../tsconfig.base.json\",\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.app.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ]\n } \n `\n );\n\n tree.write(`apps/${appName}/webpack.config.ts`, ``);\n\n tree.write(\n `apps/${appName}/src/index.html`,\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <title>WebappPure</title>\n <base href=\"/\" />\n \n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n </head>\n <body>\n <workspace-root></workspace-root>\n </body>\n </html>\n `\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-web-app': {\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n root: `apps/${appName}`,\n projectType: 'application',\n });\n return tree;\n}\n\nexport function mockAngularAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-angular-app';\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-angular-app': {\n ...angularAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...angularAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockUnknownAppGenerator(tree: Tree): Tree {\n const appName = 'my-test-random-app';\n\n writeJson(tree, 'workspace.json', {\n projects: {\n 'my-test-random-app': {\n ...randomAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n },\n },\n });\n\n writeJson(tree, `apps/${appName}/project.json`, {\n ...randomAppConfig,\n root: `apps/${appName}`,\n projectType: 'application',\n });\n\n return tree;\n}\n\nexport function mockReactLibNonBuildableJestTestRunnerGenerator(\n tree: Tree\n): Tree {\n const libName = 'react-lib-nonb-jest';\n\n tree.write(`libs/${libName}/src/index.ts`, ``);\n\n tree.write(\n `libs/${libName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.lib.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }`\n );\n tree.write(\n `libs/${libName}/tsconfig.lib.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"jest.config.ts\",\n \"src/**/*.spec.ts\",\n \"src/**/*.test.ts\",\n \"src/**/*.spec.tsx\",\n \"src/**/*.test.tsx\",\n \"src/**/*.spec.js\",\n \"src/**/*.test.js\",\n \"src/**/*.spec.jsx\",\n \"src/**/*.test.jsx\"\n ],\n \"include\": [\"src/**/*.js\", \"src/**/*.jsx\", \"src/**/*.ts\", \"src/**/*.tsx\"]\n }`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n [`${libName}`]: {\n ...reactLibNBJest,\n root: `libs/${libName}`,\n projectType: 'library',\n },\n },\n });\n\n writeJson(tree, `libs/${libName}/project.json`, {\n ...reactLibNBJest,\n root: `libs/${libName}`,\n projectType: 'library',\n });\n\n return tree;\n}\n\nexport function mockReactLibNonBuildableVitestRunnerGenerator(\n tree: Tree\n): Tree {\n const libName = 'react-lib-nonb-vitest';\n\n tree.write(`libs/${libName}/src/index.ts`, ``);\n\n tree.write(\n `libs/${libName}/vite.config.ts`,\n `/// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n import react from '@vitejs/plugin-react';\n import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';\n\n export default defineConfig({\n\n plugins: [\n nxViteTsPaths(),\n react(),\n ],\n\n test: {\n globals: true,\n cache: {\n dir: '../../node_modules/.vitest',\n },\n environment: 'jsdom',\n include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n },\n });\n `\n );\n\n tree.write(\n `libs/${libName}/tsconfig.json`,\n `{\n \"compilerOptions\": {\n \"jsx\": \"react-jsx\",\n \"allowJs\": false,\n \"esModuleInterop\": false,\n \"allowSyntheticDefaultImports\": true,\n \"strict\": true\n },\n \"files\": [],\n \"include\": [],\n \"references\": [\n {\n \"path\": \"./tsconfig.lib.json\"\n },\n {\n \"path\": \"./tsconfig.spec.json\"\n }\n ],\n \"extends\": \"../../tsconfig.base.json\"\n }`\n );\n tree.write(\n `libs/${libName}/tsconfig.lib.json`,\n `{\n \"extends\": \"./tsconfig.json\",\n \"compilerOptions\": {\n \"outDir\": \"../../dist/out-tsc\",\n \"types\": [\"node\"]\n },\n \"files\": [\n \"../../node_modules/@nx/react/typings/cssmodule.d.ts\",\n \"../../node_modules/@nx/react/typings/image.d.ts\"\n ],\n \"exclude\": [\n \"**/*.spec.ts\",\n \"**/*.test.ts\",\n \"**/*.spec.tsx\",\n \"**/*.test.tsx\",\n \"**/*.spec.js\",\n \"**/*.test.js\",\n \"**/*.spec.jsx\",\n \"**/*.test.jsx\"\n ],\n \"include\": [\"**/*.js\", \"**/*.jsx\", \"**/*.ts\", \"**/*.tsx\"]\n }`\n );\n\n writeJson(tree, 'workspace.json', {\n projects: {\n [`${libName}`]: {\n ...reactLibNBVitest,\n root: `libs/${libName}`,\n projectType: 'library',\n },\n },\n });\n\n writeJson(tree, `libs/${libName}/project.json`, {\n ...reactLibNBVitest,\n root: `libs/${libName}`,\n projectType: 'library',\n });\n\n return tree;\n}\n"],"names":["mockViteReactAppGenerator","mockReactAppGenerator","mockReactMixedAppGenerator","mockWebAppGenerator","mockAngularAppGenerator","mockUnknownAppGenerator","mockReactLibNonBuildableJestTestRunnerGenerator","mockReactLibNonBuildableVitestRunnerGenerator","tree","appName","write","writeJson","projects","reactViteConfig","root","projectType","mixedAppConfig","angularAppConfig","randomAppConfig","libName","reactLibNBJest","reactLibNBVitest"],"mappings":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,KAAK,EAAES,QAAQ,aAAa,CAAC,EAAE,CAAC,CAAC;IAE7CX,KAAKE,KAAK,CACR,CAAC,KAAK,EAAES,QAAQ,eAAe,CAAC,EAChC,CAAC;;;;;;;;;;;;;;;;;;;;;EAqBH,CAAC;IAGDX,KAAKE,KAAK,CACR,CAAC,KAAK,EAAES,QAAQ,cAAc,CAAC,EAC/B,CAAC;;;;;;;;;;;;;;;;;;;KAmBA,CAAC;IAEJX,KAAKE,KAAK,CACR,CAAC,KAAK,EAAES,QAAQ,kBAAkB,CAAC,EACnC,CAAC;;;;;;;;;;;;;;;;;;;;;KAqBA,CAAC;IAGJR,IAAAA,iBAAS,EAACH,MAAM,kBAAkB;QAChCI,UAAU;YACR,CAAC,CAAC,EAAEO,QAAQ,CAAC,CAAC,EAAE,eACXE;gBACHP,MAAM,CAAC,KAAK,EAAEK,QAAQ,CAAC;gBACvBJ,aAAa;;QAEjB;IACF;IAEAJ,IAAAA,iBAAS,EAACH,MAAM,CAAC,KAAK,EAAEW,QAAQ,aAAa,CAAC,EAAE,eAC3CE;QACHP,MAAM,CAAC,KAAK,EAAEK,QAAQ,CAAC;QACvBJ,aAAa;;IAGf,OAAOP;AACT"}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
2
|
export declare const viteVersion = "~5.0.0";
|
|
3
|
-
export declare const vitestVersion = "^1.
|
|
3
|
+
export declare const vitestVersion = "^1.3.1";
|
|
4
4
|
export declare const vitePluginReactVersion = "^4.2.0";
|
|
5
5
|
export declare const vitePluginReactSwcVersion = "^3.5.0";
|
|
6
6
|
export declare const jsdomVersion = "~22.1.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -42,7 +42,7 @@ _export(exports, {
|
|
|
42
42
|
});
|
|
43
43
|
const nxVersion = require('../../package.json').version;
|
|
44
44
|
const viteVersion = '~5.0.0';
|
|
45
|
-
const vitestVersion = '^1.
|
|
45
|
+
const vitestVersion = '^1.3.1';
|
|
46
46
|
const vitePluginReactVersion = '^4.2.0';
|
|
47
47
|
const vitePluginReactSwcVersion = '^3.5.0';
|
|
48
48
|
const jsdomVersion = '~22.1.0';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../packages/vite/src/utils/versions.ts"],"sourcesContent":["export const nxVersion = require('../../package.json').version;\nexport const viteVersion = '~5.0.0';\nexport const vitestVersion = '^1.
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/vite/src/utils/versions.ts"],"sourcesContent":["export const nxVersion = require('../../package.json').version;\nexport const viteVersion = '~5.0.0';\nexport const vitestVersion = '^1.3.1';\nexport const vitePluginReactVersion = '^4.2.0';\nexport const vitePluginReactSwcVersion = '^3.5.0';\nexport const jsdomVersion = '~22.1.0';\nexport const vitePluginDtsVersion = '~2.3.0';\nexport const happyDomVersion = '~9.20.3';\nexport const edgeRuntimeVmVersion = '~3.0.2';\n\n// Coverage providers\nexport const vitestCoverageV8Version = '^1.0.4';\nexport const vitestCoverageIstanbulVersion = '^1.0.4';\n"],"names":["nxVersion","viteVersion","vitestVersion","vitePluginReactVersion","vitePluginReactSwcVersion","jsdomVersion","vitePluginDtsVersion","happyDomVersion","edgeRuntimeVmVersion","vitestCoverageV8Version","vitestCoverageIstanbulVersion","require","version"],"mappings":";;;;;;;;IAAaA,SAAS;eAATA;;IACAC,WAAW;eAAXA;;IACAC,aAAa;eAAbA;;IACAC,sBAAsB;eAAtBA;;IACAC,yBAAyB;eAAzBA;;IACAC,YAAY;eAAZA;;IACAC,oBAAoB;eAApBA;;IACAC,eAAe;eAAfA;;IACAC,oBAAoB;eAApBA;;IAGAC,uBAAuB;eAAvBA;;IACAC,6BAA6B;eAA7BA;;;AAZN,MAAMV,YAAYW,QAAQ,sBAAsBC,OAAO;AACvD,MAAMX,cAAc;AACpB,MAAMC,gBAAgB;AACtB,MAAMC,yBAAyB;AAC/B,MAAMC,4BAA4B;AAClC,MAAMC,eAAe;AACrB,MAAMC,uBAAuB;AAC7B,MAAMC,kBAAkB;AACxB,MAAMC,uBAAuB;AAG7B,MAAMC,0BAA0B;AAChC,MAAMC,gCAAgC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "findViteConfig", {
|
|
3
|
-
enumerable: true,
|
|
4
|
-
get: function() {
|
|
5
|
-
return findViteConfig;
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
const _devkit = require("@nx/devkit");
|
|
9
|
-
function findViteConfig(tree, searchRoot) {
|
|
10
|
-
const allowsExt = [
|
|
11
|
-
'js',
|
|
12
|
-
'mjs',
|
|
13
|
-
'ts',
|
|
14
|
-
'cjs',
|
|
15
|
-
'mts',
|
|
16
|
-
'cts'
|
|
17
|
-
];
|
|
18
|
-
for (const ext of allowsExt){
|
|
19
|
-
if (tree.exists((0, _devkit.joinPathFragments)(searchRoot, `vite.config.${ext}`))) {
|
|
20
|
-
return (0, _devkit.joinPathFragments)(searchRoot, `vite.config.${ext}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=find-vite-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../packages/vite/src/migrations/update-17-2-0/lib/find-vite-config.ts"],"sourcesContent":["import { Tree, joinPathFragments } from '@nx/devkit';\n\nexport function findViteConfig(tree: Tree, searchRoot: string) {\n const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];\n\n for (const ext of allowsExt) {\n if (tree.exists(joinPathFragments(searchRoot, `vite.config.${ext}`))) {\n return joinPathFragments(searchRoot, `vite.config.${ext}`);\n }\n }\n}\n"],"names":["findViteConfig","tree","searchRoot","allowsExt","ext","exists","joinPathFragments"],"mappings":";+BAEgBA;;;eAAAA;;;wBAFwB;AAEjC,SAASA,eAAeC,IAAU,EAAEC,UAAkB;IAC3D,MAAMC,YAAY;QAAC;QAAM;QAAO;QAAM;QAAO;QAAO;KAAM;IAE1D,KAAK,MAAMC,OAAOD,UAAW;QAC3B,IAAIF,KAAKI,MAAM,CAACC,IAAAA,yBAAiB,EAACJ,YAAY,CAAC,YAAY,EAAEE,IAAI,CAAC,IAAI;YACpE,OAAOE,IAAAA,yBAAiB,EAACJ,YAAY,CAAC,YAAY,EAAEE,IAAI,CAAC;QAC3D;IACF;AACF"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-test-react-app",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"root": "apps/my-test-react-app",
|
|
5
|
-
"sourceRoot": "apps/my-test-react-app/src",
|
|
6
|
-
"projectType": "application",
|
|
7
|
-
"targets": {
|
|
8
|
-
"build": {
|
|
9
|
-
"executor": "@nx/webpack:webpack",
|
|
10
|
-
"outputs": ["{options.outputPath}"],
|
|
11
|
-
"defaultConfiguration": "production",
|
|
12
|
-
"options": {
|
|
13
|
-
"compiler": "babel",
|
|
14
|
-
"outputPath": "dist/apps/my-test-react-app",
|
|
15
|
-
"index": "apps/my-test-react-app/src/index.html",
|
|
16
|
-
"baseHref": "/",
|
|
17
|
-
"main": "apps/my-test-react-app/src/main.tsx",
|
|
18
|
-
"polyfills": "apps/my-test-react-app/src/polyfills.ts",
|
|
19
|
-
"tsConfig": "apps/my-test-react-app/tsconfig.app.json",
|
|
20
|
-
"assets": [
|
|
21
|
-
"apps/my-test-react-app/src/favicon.ico",
|
|
22
|
-
"apps/my-test-react-app/src/assets"
|
|
23
|
-
],
|
|
24
|
-
"styles": ["apps/my-test-react-app/src/styles.css"],
|
|
25
|
-
"scripts": [],
|
|
26
|
-
"webpackConfig": "@nx/react/plugins/webpack"
|
|
27
|
-
},
|
|
28
|
-
"configurations": {
|
|
29
|
-
"development": {
|
|
30
|
-
"extractLicenses": false,
|
|
31
|
-
"optimization": false,
|
|
32
|
-
"sourceMap": true,
|
|
33
|
-
"vendorChunk": true
|
|
34
|
-
},
|
|
35
|
-
"production": {
|
|
36
|
-
"fileReplacements": [
|
|
37
|
-
{
|
|
38
|
-
"replace": "apps/my-test-react-app/src/environments/environment.ts",
|
|
39
|
-
"with": "apps/my-test-react-app/src/environments/environment.prod.ts"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"optimization": true,
|
|
43
|
-
"outputHashing": "all",
|
|
44
|
-
"sourceMap": false,
|
|
45
|
-
"namedChunks": false,
|
|
46
|
-
"extractLicenses": true,
|
|
47
|
-
"vendorChunk": false
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"serve": {
|
|
52
|
-
"executor": "@nx/webpack:dev-server",
|
|
53
|
-
"defaultConfiguration": "development",
|
|
54
|
-
"options": {
|
|
55
|
-
"buildTarget": "my-test-react-app:build",
|
|
56
|
-
"hmr": true
|
|
57
|
-
},
|
|
58
|
-
"configurations": {
|
|
59
|
-
"development": {
|
|
60
|
-
"buildTarget": "my-test-react-app:build:development"
|
|
61
|
-
},
|
|
62
|
-
"production": {
|
|
63
|
-
"buildTarget": "my-test-react-app:build:production",
|
|
64
|
-
"hmr": false
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"lint": {
|
|
69
|
-
"executor": "@nx/eslint:lint",
|
|
70
|
-
"outputs": ["{options.outputFile}"]
|
|
71
|
-
},
|
|
72
|
-
"test": {
|
|
73
|
-
"executor": "@nx/jest:jest",
|
|
74
|
-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
75
|
-
"options": {
|
|
76
|
-
"jestConfig": "apps/my-test-react-app/jest.config.ts",
|
|
77
|
-
"passWithNoTests": true
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"tags": []
|
|
82
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-test-web-app",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"projectType": "application",
|
|
5
|
-
"root": "apps/my-test-web-app",
|
|
6
|
-
"sourceRoot": "apps/my-test-web-app/src",
|
|
7
|
-
"tags": [],
|
|
8
|
-
"targets": {
|
|
9
|
-
"build": {
|
|
10
|
-
"executor": "@nx/webpack:webpack",
|
|
11
|
-
"outputs": ["{options.outputPath}"],
|
|
12
|
-
"defaultConfiguration": "production",
|
|
13
|
-
"options": {
|
|
14
|
-
"outputPath": "dist/apps/my-test-web-app",
|
|
15
|
-
"compiler": "babel",
|
|
16
|
-
"main": "apps/my-test-web-app/src/main.ts",
|
|
17
|
-
"tsConfig": "apps/my-test-web-app/tsconfig.app.json",
|
|
18
|
-
"assets": [
|
|
19
|
-
"apps/my-test-web-app/src/favicon.ico",
|
|
20
|
-
"apps/my-test-web-app/src/assets"
|
|
21
|
-
],
|
|
22
|
-
"index": "apps/my-test-web-app/src/index.html",
|
|
23
|
-
"baseHref": "/",
|
|
24
|
-
"polyfills": "apps/my-test-web-app/src/polyfills.ts",
|
|
25
|
-
"styles": ["apps/my-test-web-app/src/styles.css"],
|
|
26
|
-
"scripts": []
|
|
27
|
-
},
|
|
28
|
-
"configurations": {
|
|
29
|
-
"production": {
|
|
30
|
-
"optimization": true,
|
|
31
|
-
"outputHashing": "all",
|
|
32
|
-
"sourceMap": false,
|
|
33
|
-
"namedChunks": false,
|
|
34
|
-
"extractLicenses": true,
|
|
35
|
-
"vendorChunk": false,
|
|
36
|
-
"fileReplacements": [
|
|
37
|
-
{
|
|
38
|
-
"replace": "apps/my-test-web-app/src/environments/environment.ts",
|
|
39
|
-
"with": "apps/my-test-web-app/src/environments/environment.prod.ts"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"serve": {
|
|
46
|
-
"executor": "@nx/webpack:dev-server",
|
|
47
|
-
"options": {
|
|
48
|
-
"buildTarget": "my-test-web-app:build"
|
|
49
|
-
},
|
|
50
|
-
"configurations": {
|
|
51
|
-
"production": {
|
|
52
|
-
"buildTarget": "my-test-web-app:build:production"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"lint": {
|
|
57
|
-
"executor": "@nx/eslint:lint",
|
|
58
|
-
"outputs": ["{options.outputFile}"]
|
|
59
|
-
},
|
|
60
|
-
"test": {
|
|
61
|
-
"executor": "@nx/jest:jest",
|
|
62
|
-
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
63
|
-
"options": {
|
|
64
|
-
"jestConfig": "apps/my-test-web-app/jest.config.ts",
|
|
65
|
-
"passWithNoTests": true
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|