@nx/vite 0.0.0-pr-22179-271588f
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/LICENSE +22 -0
- package/README.md +68 -0
- package/executors.d.ts +8 -0
- package/executors.js +27 -0
- package/executors.js.map +1 -0
- package/executors.json +46 -0
- package/generators.json +25 -0
- package/index.d.ts +8 -0
- package/index.js +26 -0
- package/index.js.map +1 -0
- package/migrations.json +253 -0
- package/package.json +62 -0
- package/plugin.d.ts +1 -0
- package/plugin.js +21 -0
- package/plugin.js.map +1 -0
- package/plugins/nx-tsconfig-paths.plugin.d.ts +24 -0
- package/plugins/nx-tsconfig-paths.plugin.js +132 -0
- package/plugins/nx-tsconfig-paths.plugin.js.map +1 -0
- package/plugins/rollup-replace-files.plugin.d.ts +16 -0
- package/plugins/rollup-replace-files.plugin.js +51 -0
- package/plugins/rollup-replace-files.plugin.js.map +1 -0
- package/src/executors/build/build.impl.d.ts +13 -0
- package/src/executors/build/build.impl.js +187 -0
- package/src/executors/build/build.impl.js.map +1 -0
- package/src/executors/build/compat.d.ts +2 -0
- package/src/executors/build/compat.js +12 -0
- package/src/executors/build/compat.js.map +1 -0
- package/src/executors/build/schema.d.js +3 -0
- package/src/executors/build/schema.d.js.map +1 -0
- package/src/executors/build/schema.d.ts +10 -0
- package/src/executors/build/schema.json +67 -0
- package/src/executors/dev-server/compat.d.ts +2 -0
- package/src/executors/dev-server/compat.js +12 -0
- package/src/executors/dev-server/compat.js.map +1 -0
- package/src/executors/dev-server/dev-server.impl.d.ts +7 -0
- package/src/executors/dev-server/dev-server.impl.js +136 -0
- package/src/executors/dev-server/dev-server.impl.js.map +1 -0
- package/src/executors/dev-server/schema.d.js +3 -0
- package/src/executors/dev-server/schema.d.js.map +1 -0
- package/src/executors/dev-server/schema.d.ts +5 -0
- package/src/executors/dev-server/schema.json +38 -0
- package/src/executors/preview-server/compat.d.ts +2 -0
- package/src/executors/preview-server/compat.js +12 -0
- package/src/executors/preview-server/compat.js.map +1 -0
- package/src/executors/preview-server/preview-server.impl.d.ts +7 -0
- package/src/executors/preview-server/preview-server.impl.js +176 -0
- package/src/executors/preview-server/preview-server.impl.js.map +1 -0
- package/src/executors/preview-server/schema.d.js +3 -0
- package/src/executors/preview-server/schema.d.js.map +1 -0
- package/src/executors/preview-server/schema.d.ts +5 -0
- package/src/executors/preview-server/schema.json +37 -0
- package/src/executors/test/compat.d.ts +2 -0
- package/src/executors/test/compat.js +12 -0
- package/src/executors/test/compat.js.map +1 -0
- package/src/executors/test/lib/nx-reporter.d.ts +14 -0
- package/src/executors/test/lib/nx-reporter.js +40 -0
- package/src/executors/test/lib/nx-reporter.js.map +1 -0
- package/src/executors/test/lib/utils.d.ts +4 -0
- package/src/executors/test/lib/utils.js +77 -0
- package/src/executors/test/lib/utils.js.map +1 -0
- package/src/executors/test/schema.d.js +3 -0
- package/src/executors/test/schema.d.js.map +1 -0
- package/src/executors/test/schema.d.ts +7 -0
- package/src/executors/test/schema.json +36 -0
- package/src/executors/test/vitest.impl.d.ts +6 -0
- package/src/executors/test/vitest.impl.js +67 -0
- package/src/executors/test/vitest.impl.js.map +1 -0
- package/src/generators/configuration/configuration.d.ts +5 -0
- package/src/generators/configuration/configuration.js +147 -0
- package/src/generators/configuration/configuration.js.map +1 -0
- 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.js +3 -0
- package/src/generators/configuration/schema.d.js.map +1 -0
- package/src/generators/configuration/schema.d.ts +12 -0
- package/src/generators/configuration/schema.json +61 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +82 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/lib/utils.d.ts +6 -0
- package/src/generators/init/lib/utils.js +80 -0
- package/src/generators/init/lib/utils.js.map +1 -0
- package/src/generators/init/schema.d.js +3 -0
- package/src/generators/init/schema.d.js.map +1 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/generators/init/schema.json +31 -0
- package/src/generators/vitest/files/tsconfig.spec.json__tmpl__ +20 -0
- package/src/generators/vitest/schema.d.js +3 -0
- package/src/generators/vitest/schema.d.js.map +1 -0
- package/src/generators/vitest/schema.d.ts +11 -0
- package/src/generators/vitest/schema.json +56 -0
- package/src/generators/vitest/vitest-generator.d.ts +5 -0
- package/src/generators/vitest/vitest-generator.js +187 -0
- package/src/generators/vitest/vitest-generator.js.map +1 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.d.ts +3 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.js +67 -0
- package/src/migrations/update-15-3-1/update-vite-tsconfig-paths.js.map +1 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.d.ts +3 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.js +37 -0
- package/src/migrations/update-15-3-4/set-mode-in-configuration.js.map +1 -0
- package/src/migrations/update-15-4-3/update-report-directory.d.ts +3 -0
- package/src/migrations/update-15-4-3/update-report-directory.js +39 -0
- package/src/migrations/update-15-4-3/update-report-directory.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +15 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/migrations/update-16-4-1-update-test-file-config/update-16-4-1-test-file-config.d.ts +2 -0
- package/src/migrations/update-16-4-1-update-test-file-config/update-16-4-1-test-file-config.js +35 -0
- package/src/migrations/update-16-4-1-update-test-file-config/update-16-4-1-test-file-config.js.map +1 -0
- package/src/migrations/update-16-6-0-change-ts-paths-plugin/change-ts-paths-plugin.d.ts +2 -0
- package/src/migrations/update-16-6-0-change-ts-paths-plugin/change-ts-paths-plugin.js +39 -0
- package/src/migrations/update-16-6-0-change-ts-paths-plugin/change-ts-paths-plugin.js.map +1 -0
- package/src/migrations/update-17-1-0/move-target-defaults.d.ts +2 -0
- package/src/migrations/update-17-1-0/move-target-defaults.js +77 -0
- package/src/migrations/update-17-1-0/move-target-defaults.js.map +1 -0
- package/src/migrations/update-17-2-0/lib/add-file-replacements.d.ts +2 -0
- package/src/migrations/update-17-2-0/lib/add-file-replacements.js +67 -0
- package/src/migrations/update-17-2-0/lib/add-file-replacements.js.map +1 -0
- package/src/migrations/update-17-2-0/lib/edit-build-config.d.ts +2 -0
- package/src/migrations/update-17-2-0/lib/edit-build-config.js +121 -0
- package/src/migrations/update-17-2-0/lib/edit-build-config.js.map +1 -0
- package/src/migrations/update-17-2-0/lib/edit-test-config.d.ts +2 -0
- package/src/migrations/update-17-2-0/lib/edit-test-config.js +83 -0
- package/src/migrations/update-17-2-0/lib/edit-test-config.js.map +1 -0
- package/src/migrations/update-17-2-0/update-vite-config.d.ts +5 -0
- package/src/migrations/update-17-2-0/update-vite-config.js +68 -0
- package/src/migrations/update-17-2-0/update-vite-config.js.map +1 -0
- package/src/migrations/update-17-3-0/lib/fix-coverage-and-reporters.d.ts +3 -0
- package/src/migrations/update-17-3-0/lib/fix-coverage-and-reporters.js +117 -0
- package/src/migrations/update-17-3-0/lib/fix-coverage-and-reporters.js.map +1 -0
- package/src/migrations/update-17-3-0/vitest-coverage-and-reporters.d.ts +2 -0
- package/src/migrations/update-17-3-0/vitest-coverage-and-reporters.js +45 -0
- package/src/migrations/update-17-3-0/vitest-coverage-and-reporters.js.map +1 -0
- package/src/plugins/plugin.d.ts +10 -0
- package/src/plugins/plugin.js +223 -0
- package/src/plugins/plugin.js.map +1 -0
- package/src/utils/ensure-dependencies.d.ts +8 -0
- package/src/utils/ensure-dependencies.js +34 -0
- package/src/utils/ensure-dependencies.js.map +1 -0
- package/src/utils/executor-utils.d.ts +11 -0
- package/src/utils/executor-utils.js +59 -0
- package/src/utils/executor-utils.js.map +1 -0
- package/src/utils/find-vite-config.d.ts +3 -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 +42 -0
- package/src/utils/generator-utils.js +527 -0
- package/src/utils/generator-utils.js.map +1 -0
- package/src/utils/options-utils.d.ts +17 -0
- package/src/utils/options-utils.js +100 -0
- package/src/utils/options-utils.js.map +1 -0
- package/src/utils/test-files/angular-project.config.json +89 -0
- package/src/utils/test-files/react-lib-non-buildable-jest.json +22 -0
- package/src/utils/test-files/react-lib-non-buildable-vitest.json +22 -0
- package/src/utils/test-files/react-mixed-project.config.json +47 -0
- package/src/utils/test-files/react-vite-project.config.json +54 -0
- package/src/utils/test-files/test-vite-configs.d.ts +31 -0
- package/src/utils/test-files/test-vite-configs.js +291 -0
- package/src/utils/test-files/test-vite-configs.js.map +1 -0
- package/src/utils/test-files/unknown-project.config.json +69 -0
- package/src/utils/test-utils.d.ts +9 -0
- package/src/utils/test-utils.js +522 -0
- package/src/utils/test-utils.js.map +1 -0
- package/src/utils/versions.d.ts +11 -0
- package/src/utils/versions.js +55 -0
- package/src/utils/versions.js.map +1 -0
- package/src/utils/vite-config-edit-utils.d.ts +3 -0
- package/src/utils/vite-config-edit-utils.js +314 -0
- package/src/utils/vite-config-edit-utils.js.map +1 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _export(target, all) {
|
|
3
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: all[name]
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
_export(exports, {
|
|
9
|
+
normalizeViteConfigFilePath: function() {
|
|
10
|
+
return normalizeViteConfigFilePath;
|
|
11
|
+
},
|
|
12
|
+
getProjectTsConfigPath: function() {
|
|
13
|
+
return getProjectTsConfigPath;
|
|
14
|
+
},
|
|
15
|
+
getViteServerProxyConfigPath: function() {
|
|
16
|
+
return getViteServerProxyConfigPath;
|
|
17
|
+
},
|
|
18
|
+
getViteServerOptions: function() {
|
|
19
|
+
return getViteServerOptions;
|
|
20
|
+
},
|
|
21
|
+
getProxyConfig: function() {
|
|
22
|
+
return getProxyConfig;
|
|
23
|
+
},
|
|
24
|
+
getNxTargetOptions: function() {
|
|
25
|
+
return getNxTargetOptions;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _devkit = require("@nx/devkit");
|
|
29
|
+
const _fs = require("fs");
|
|
30
|
+
const _executorutils = require("./executor-utils");
|
|
31
|
+
function normalizeViteConfigFilePath(contextRoot, projectRoot, configFile) {
|
|
32
|
+
if (configFile) {
|
|
33
|
+
const normalized = (0, _devkit.joinPathFragments)(configFile);
|
|
34
|
+
if (!(0, _fs.existsSync)(normalized)) {
|
|
35
|
+
throw new Error(`Could not find vite config at provided path "${normalized}".`);
|
|
36
|
+
}
|
|
37
|
+
return normalized;
|
|
38
|
+
}
|
|
39
|
+
const allowsExt = [
|
|
40
|
+
'js',
|
|
41
|
+
'mjs',
|
|
42
|
+
'ts',
|
|
43
|
+
'cjs',
|
|
44
|
+
'mts',
|
|
45
|
+
'cts'
|
|
46
|
+
];
|
|
47
|
+
for (const ext of allowsExt){
|
|
48
|
+
if ((0, _fs.existsSync)((0, _devkit.joinPathFragments)(contextRoot, projectRoot, `vite.config.${ext}`))) {
|
|
49
|
+
return (0, _devkit.joinPathFragments)(contextRoot, projectRoot, `vite.config.${ext}`);
|
|
50
|
+
} else if ((0, _fs.existsSync)((0, _devkit.joinPathFragments)(contextRoot, projectRoot, `vitest.config.${ext}`))) {
|
|
51
|
+
return (0, _devkit.joinPathFragments)(contextRoot, projectRoot, `vitest.config.${ext}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function getProjectTsConfigPath(projectRoot) {
|
|
56
|
+
return (0, _fs.existsSync)((0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.app.json')) ? (0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.app.json') : (0, _fs.existsSync)((0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.lib.json')) ? (0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.lib.json') : (0, _fs.existsSync)((0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.json')) ? (0, _devkit.joinPathFragments)(projectRoot, 'tsconfig.json') : undefined;
|
|
57
|
+
}
|
|
58
|
+
function getViteServerProxyConfigPath(nxProxyConfig, context) {
|
|
59
|
+
if (nxProxyConfig) {
|
|
60
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
61
|
+
const proxyConfigPath = nxProxyConfig ? (0, _devkit.joinPathFragments)(context.root, nxProxyConfig) : (0, _devkit.joinPathFragments)(projectRoot, 'proxy.conf.json');
|
|
62
|
+
if ((0, _fs.existsSync)(proxyConfigPath)) {
|
|
63
|
+
return proxyConfigPath;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function getViteServerOptions(options, context) {
|
|
68
|
+
// returns vite ServerOptions
|
|
69
|
+
// Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.
|
|
70
|
+
const { searchForWorkspaceRoot } = await (0, _executorutils.loadViteDynamicImport)();
|
|
71
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
72
|
+
const serverOptions = {
|
|
73
|
+
fs: {
|
|
74
|
+
allow: [
|
|
75
|
+
searchForWorkspaceRoot((0, _devkit.joinPathFragments)(projectRoot)),
|
|
76
|
+
(0, _devkit.joinPathFragments)(context.root, 'node_modules/vite')
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const proxyConfigPath = getViteServerProxyConfigPath(options.proxyConfig, context);
|
|
81
|
+
if (proxyConfigPath) {
|
|
82
|
+
_devkit.logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);
|
|
83
|
+
serverOptions.proxy = require(proxyConfigPath);
|
|
84
|
+
}
|
|
85
|
+
return serverOptions;
|
|
86
|
+
}
|
|
87
|
+
function getProxyConfig(context, proxyConfig) {
|
|
88
|
+
const proxyConfigPath = getViteServerProxyConfigPath(proxyConfig, context);
|
|
89
|
+
if (proxyConfigPath) {
|
|
90
|
+
_devkit.logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);
|
|
91
|
+
return require(proxyConfigPath);
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
function getNxTargetOptions(target, context) {
|
|
96
|
+
const targetObj = (0, _devkit.parseTargetString)(target, context);
|
|
97
|
+
return (0, _devkit.readTargetOptions)(targetObj, context);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=options-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/vite/src/utils/options-utils.ts"],"sourcesContent":["import {\n ExecutorContext,\n joinPathFragments,\n logger,\n parseTargetString,\n readTargetOptions,\n} from '@nx/devkit';\nimport { existsSync } from 'fs';\nimport { ViteDevServerExecutorOptions } from '../executors/dev-server/schema';\nimport { loadViteDynamicImport } from './executor-utils';\n\n/**\n * Returns the path to the vite config file or undefined when not found.\n */\nexport function normalizeViteConfigFilePath(\n contextRoot: string,\n projectRoot: string,\n configFile?: string\n): string | undefined {\n if (configFile) {\n const normalized = joinPathFragments(configFile);\n if (!existsSync(normalized)) {\n throw new Error(\n `Could not find vite config at provided path \"${normalized}\".`\n );\n }\n return normalized;\n }\n\n const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];\n\n for (const ext of allowsExt) {\n if (\n existsSync(\n joinPathFragments(contextRoot, projectRoot, `vite.config.${ext}`)\n )\n ) {\n return joinPathFragments(contextRoot, projectRoot, `vite.config.${ext}`);\n } else if (\n existsSync(\n joinPathFragments(contextRoot, projectRoot, `vitest.config.${ext}`)\n )\n ) {\n return joinPathFragments(\n contextRoot,\n projectRoot,\n `vitest.config.${ext}`\n );\n }\n }\n}\n\nexport function getProjectTsConfigPath(\n projectRoot: string\n): string | undefined {\n return existsSync(joinPathFragments(projectRoot, 'tsconfig.app.json'))\n ? joinPathFragments(projectRoot, 'tsconfig.app.json')\n : existsSync(joinPathFragments(projectRoot, 'tsconfig.lib.json'))\n ? joinPathFragments(projectRoot, 'tsconfig.lib.json')\n : existsSync(joinPathFragments(projectRoot, 'tsconfig.json'))\n ? joinPathFragments(projectRoot, 'tsconfig.json')\n : undefined;\n}\n\n/**\n * Returns the path to the proxy configuration file or undefined when not found.\n */\nexport function getViteServerProxyConfigPath(\n nxProxyConfig: string | undefined,\n context: ExecutorContext\n): string | undefined {\n if (nxProxyConfig) {\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n\n const proxyConfigPath = nxProxyConfig\n ? joinPathFragments(context.root, nxProxyConfig)\n : joinPathFragments(projectRoot, 'proxy.conf.json');\n\n if (existsSync(proxyConfigPath)) {\n return proxyConfigPath;\n }\n }\n}\n\n/**\n * Builds the options for the vite dev server.\n */\nexport async function getViteServerOptions(\n options: ViteDevServerExecutorOptions,\n context: ExecutorContext\n): Promise<Record<string, unknown>> {\n // returns vite ServerOptions\n // Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.\n const { searchForWorkspaceRoot } = await loadViteDynamicImport();\n const projectRoot =\n context.projectsConfigurations.projects[context.projectName].root;\n const serverOptions: Record<string, unknown> = {\n fs: {\n allow: [\n searchForWorkspaceRoot(joinPathFragments(projectRoot)),\n joinPathFragments(context.root, 'node_modules/vite'),\n ],\n },\n };\n\n const proxyConfigPath = getViteServerProxyConfigPath(\n options.proxyConfig,\n context\n );\n if (proxyConfigPath) {\n logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);\n serverOptions.proxy = require(proxyConfigPath);\n }\n\n return serverOptions;\n}\n\nexport function getProxyConfig(\n context: ExecutorContext,\n proxyConfig?: string\n): Record<string, string | unknown> | undefined {\n const proxyConfigPath = getViteServerProxyConfigPath(proxyConfig, context);\n if (proxyConfigPath) {\n logger.info(`Loading proxy configuration from: ${proxyConfigPath}`);\n return require(proxyConfigPath);\n }\n return;\n}\n\nexport function getNxTargetOptions(target: string, context: ExecutorContext) {\n const targetObj = parseTargetString(target, context);\n return readTargetOptions(targetObj, context);\n}\n"],"names":["normalizeViteConfigFilePath","getProjectTsConfigPath","getViteServerProxyConfigPath","getViteServerOptions","getProxyConfig","getNxTargetOptions","contextRoot","projectRoot","configFile","normalized","joinPathFragments","existsSync","Error","allowsExt","ext","undefined","nxProxyConfig","context","projectsConfigurations","projects","projectName","root","proxyConfigPath","options","searchForWorkspaceRoot","loadViteDynamicImport","serverOptions","fs","allow","proxyConfig","logger","info","proxy","require","target","targetObj","parseTargetString","readTargetOptions"],"mappings":"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"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-angular-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-angular-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-angular-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@angular-devkit/build-angular:browser",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"options": {
|
|
12
|
+
"outputPath": "dist/apps/my-test-angular-app",
|
|
13
|
+
"index": "apps/my-test-angular-app/src/index.html",
|
|
14
|
+
"main": "apps/my-test-angular-app/src/main.ts",
|
|
15
|
+
"polyfills": ["zone.js"],
|
|
16
|
+
"tsConfig": "apps/my-test-angular-app/tsconfig.app.json",
|
|
17
|
+
"assets": [
|
|
18
|
+
"apps/my-test-angular-app/src/favicon.ico",
|
|
19
|
+
"apps/my-test-angular-app/src/assets"
|
|
20
|
+
],
|
|
21
|
+
"styles": ["apps/my-test-angular-app/src/styles.css"],
|
|
22
|
+
"scripts": []
|
|
23
|
+
},
|
|
24
|
+
"configurations": {
|
|
25
|
+
"production": {
|
|
26
|
+
"budgets": [
|
|
27
|
+
{
|
|
28
|
+
"type": "initial",
|
|
29
|
+
"maximumWarning": "500kb",
|
|
30
|
+
"maximumError": "1mb"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "anyComponentStyle",
|
|
34
|
+
"maximumWarning": "2kb",
|
|
35
|
+
"maximumError": "4kb"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"outputHashing": "all"
|
|
39
|
+
},
|
|
40
|
+
"development": {
|
|
41
|
+
"buildOptimizer": false,
|
|
42
|
+
"optimization": false,
|
|
43
|
+
"vendorChunk": true,
|
|
44
|
+
"extractLicenses": false,
|
|
45
|
+
"sourceMap": true,
|
|
46
|
+
"namedChunks": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"defaultConfiguration": "production"
|
|
50
|
+
},
|
|
51
|
+
"serve": {
|
|
52
|
+
"executor": "@angular-devkit/build-angular:dev-server",
|
|
53
|
+
"configurations": {
|
|
54
|
+
"production": {
|
|
55
|
+
"browserTarget": "my-test-angular-app:build:production"
|
|
56
|
+
},
|
|
57
|
+
"development": {
|
|
58
|
+
"browserTarget": "my-test-angular-app:build:development"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"defaultConfiguration": "development"
|
|
62
|
+
},
|
|
63
|
+
"extract-i18n": {
|
|
64
|
+
"executor": "@angular-devkit/build-angular:extract-i18n",
|
|
65
|
+
"options": {
|
|
66
|
+
"browserTarget": "my-test-angular-app:build"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"lint": {
|
|
70
|
+
"executor": "@nx/eslint:lint",
|
|
71
|
+
"outputs": ["{options.outputFile}"],
|
|
72
|
+
"options": {
|
|
73
|
+
"lintFilePatterns": [
|
|
74
|
+
"apps/my-test-angular-app/**/*.ts",
|
|
75
|
+
"apps/my-test-angular-app/**/*.html"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"test": {
|
|
80
|
+
"executor": "@nx/jest:jest",
|
|
81
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
82
|
+
"options": {
|
|
83
|
+
"jestConfig": "apps/my-test-angular-app/jest.config.ts",
|
|
84
|
+
"passWithNoTests": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"tags": []
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-lib-nonb-jest",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "libs/react-lib-nonb-jest",
|
|
5
|
+
"sourceRoot": "libs/react-lib-nonb-jest/src",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"targets": {
|
|
8
|
+
"lint": {
|
|
9
|
+
"executor": "@nx/eslint:lint",
|
|
10
|
+
"outputs": ["{options.outputFile}"]
|
|
11
|
+
},
|
|
12
|
+
"test": {
|
|
13
|
+
"executor": "@nx/jest:jest",
|
|
14
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
15
|
+
"options": {
|
|
16
|
+
"jestConfig": "libs/react-lib-nonb-jest/jest.config.ts",
|
|
17
|
+
"passWithNoTests": true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"tags": []
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-lib-nonb-vitest",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "libs/react-lib-nonb-vitest",
|
|
5
|
+
"sourceRoot": "libs/react-lib-nonb-vitest/src",
|
|
6
|
+
"projectType": "library",
|
|
7
|
+
"targets": {
|
|
8
|
+
"lint": {
|
|
9
|
+
"executor": "@nx/eslint:lint",
|
|
10
|
+
"outputs": ["{options.outputFile}"]
|
|
11
|
+
},
|
|
12
|
+
"test": {
|
|
13
|
+
"executor": "@nx/vite:test",
|
|
14
|
+
"outputs": ["{projectRoot}/coverage"],
|
|
15
|
+
"options": {
|
|
16
|
+
"passWithNoTests": true,
|
|
17
|
+
"reportsDirectory": "{workspaceRoot}/coverage/{projectRoot}"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"tags": []
|
|
22
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-mixed-react-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-mixed-react-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-mixed-react-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"invalid-build": {
|
|
9
|
+
"executor": "@nx/js:tsc",
|
|
10
|
+
"outputs": ["{options.outputPath}"]
|
|
11
|
+
},
|
|
12
|
+
"valid-build": {
|
|
13
|
+
"executor": "@nx/webpack:webpack",
|
|
14
|
+
"outputs": ["{options.outputPath}"]
|
|
15
|
+
},
|
|
16
|
+
"serve": {
|
|
17
|
+
"executor": "@nx/webpack:dev-server",
|
|
18
|
+
"defaultConfiguration": "development",
|
|
19
|
+
"options": {
|
|
20
|
+
"buildTarget": "my-test-mixed-react-app:build",
|
|
21
|
+
"hmr": true
|
|
22
|
+
},
|
|
23
|
+
"configurations": {
|
|
24
|
+
"development": {
|
|
25
|
+
"buildTarget": "my-test-mixed-react-app:build:development"
|
|
26
|
+
},
|
|
27
|
+
"production": {
|
|
28
|
+
"buildTarget": "my-test-mixed-react-app:build:production",
|
|
29
|
+
"hmr": false
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"lint": {
|
|
34
|
+
"executor": "@nx/eslint:lint",
|
|
35
|
+
"outputs": ["{options.outputFile}"]
|
|
36
|
+
},
|
|
37
|
+
"test": {
|
|
38
|
+
"executor": "@nx/jest:jest",
|
|
39
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
40
|
+
"options": {
|
|
41
|
+
"jestConfig": "apps/my-test-mixed-react-app/jest.config.ts",
|
|
42
|
+
"passWithNoTests": true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"tags": []
|
|
47
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-test-react-vite-app",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"root": "apps/my-test-react-vite-app",
|
|
5
|
+
"sourceRoot": "apps/my-test-react-vite-app/src",
|
|
6
|
+
"projectType": "application",
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@nrwl/vite:build",
|
|
10
|
+
"outputs": ["{options.outputPath}"],
|
|
11
|
+
"defaultConfiguration": "production",
|
|
12
|
+
"options": {
|
|
13
|
+
"outputPath": "dist/apps/my-test-react-vite-app"
|
|
14
|
+
},
|
|
15
|
+
"configurations": {
|
|
16
|
+
"development": {},
|
|
17
|
+
"production": {},
|
|
18
|
+
"ssr": {
|
|
19
|
+
"ssr": true,
|
|
20
|
+
"my-other-setting": "my-other-value"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"serve": {
|
|
25
|
+
"executor": "@nrwl/vite:dev-server",
|
|
26
|
+
"defaultConfiguration": "development",
|
|
27
|
+
"options": {
|
|
28
|
+
"buildTarget": "my-test-react-vite-app:build"
|
|
29
|
+
},
|
|
30
|
+
"configurations": {
|
|
31
|
+
"development": {
|
|
32
|
+
"buildTarget": "my-test-react-vite-app:build:development",
|
|
33
|
+
"hmr": true
|
|
34
|
+
},
|
|
35
|
+
"production": {
|
|
36
|
+
"buildTarget": "my-test-react-vite-app:build:production",
|
|
37
|
+
"hmr": false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"test": {
|
|
42
|
+
"executor": "@nrwl/vite:test",
|
|
43
|
+
"outputs": ["{projectRoot}/coverage"],
|
|
44
|
+
"options": {
|
|
45
|
+
"passWithNoTests": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"lint": {
|
|
49
|
+
"executor": "@nrwl/linter:eslint",
|
|
50
|
+
"outputs": ["{options.outputFile}"]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"tags": []
|
|
54
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const noBuildOptions = "\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 plugins: [\n react(),\n nxViteTsPaths(),\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 ";
|
|
2
|
+
export declare const someBuildOptions = "\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 plugins: [\n react(),\n nxViteTsPaths(),\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 build: {\n my: 'option',\n }\n\n });\n ";
|
|
3
|
+
export declare const noContentDefineConfig = "\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 ";
|
|
4
|
+
export declare const conditionalConfig = "\n /// <reference types=\"vitest\" />\n import { defineConfig } from 'vite';\n export default defineConfig(({ command, mode, ssrBuild }) => {\n if (command === 'serve') {\n return {\n port: 4200,\n host: 'localhost',\n }\n } else {\n // command === 'build'\n return {\n my: 'option',\n }\n }\n })\n ";
|
|
5
|
+
export declare const configNoDefineConfig = "\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 {\n plugins: [\n react(),\n nxViteTsPaths(),\n ],\n };\n ";
|
|
6
|
+
export declare const noBuildOptionsHasTestOption = "\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 plugins: [\n react(),\n nxViteTsPaths(),\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 ";
|
|
7
|
+
export declare const someBuildOptionsSomeTestOption = "\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 plugins: [\n react(),\n nxViteTsPaths(),\n ],\n\n test: {\n my: 'option',\n },\n\n build: {\n my: 'option',\n }\n\n });\n ";
|
|
8
|
+
export declare const hasEverything = "\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 import dts from 'vite-plugin-dts';\n import { joinPathFragments } from '@nx/devkit';\n\n export default defineConfig({\n plugins: [\n dts({ entryRoot: 'src', tsConfigFilePath: joinPathFragments(__dirname, 'tsconfig.lib.json'), skipDiagnostics: true }),\n react(),\n nxViteTsPaths(),\n ],\n \n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'pure-libs-react-vite',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es', 'cjs'],\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime'],\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 ";
|
|
9
|
+
export declare const buildOption = "\n // Configuration for building your library.\n // See: https://vitejs.dev/guide/build.html#library-mode\n build: {\n lib: {\n // Could also be a dictionary or array of multiple entry points.\n entry: 'src/index.ts',\n name: 'my-app',\n fileName: 'index',\n // Change this to the formats you want to support.\n // Don't forget to update your package.json as well.\n formats: ['es', 'cjs']\n },\n rollupOptions: {\n // External packages that should not be bundled into your library.\n external: ['react', 'react-dom', 'react/jsx-runtime']\n }\n },";
|
|
10
|
+
export declare const buildOptionObject: {
|
|
11
|
+
lib: {
|
|
12
|
+
entry: string;
|
|
13
|
+
name: string;
|
|
14
|
+
fileName: string;
|
|
15
|
+
formats: string[];
|
|
16
|
+
};
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
external: string[];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const testOption = "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 },";
|
|
22
|
+
export declare const testOptionObject: {
|
|
23
|
+
globals: boolean;
|
|
24
|
+
cache: {
|
|
25
|
+
dir: string;
|
|
26
|
+
};
|
|
27
|
+
environment: string;
|
|
28
|
+
include: string[];
|
|
29
|
+
};
|
|
30
|
+
export declare const imports: string[];
|
|
31
|
+
export declare const plugins: string[];
|