nx 22.6.0 → 22.6.2
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/bin/nx.js +19 -11
- package/package.json +11 -12
- package/release/changelog-renderer/index.d.ts +2 -1
- package/release/changelog-renderer/index.d.ts.map +1 -1
- package/schemas/nx-schema.json +102 -0
- package/src/adapter/ngcli-adapter.d.ts +8 -5
- package/src/adapter/ngcli-adapter.d.ts.map +1 -1
- package/src/adapter/ngcli-adapter.js +33 -19
- package/src/ai/clone-ai-config-repo.d.ts.map +1 -1
- package/src/ai/clone-ai-config-repo.js +2 -0
- package/src/command-line/add/add.js +1 -1
- package/src/command-line/examples.d.ts +7 -0
- package/src/command-line/examples.d.ts.map +1 -1
- package/src/command-line/examples.js +29 -1
- package/src/command-line/exec/exec.js +3 -3
- package/src/command-line/format/format.js +3 -3
- package/src/command-line/generate/generate.d.ts.map +1 -1
- package/src/command-line/generate/generate.js +1 -1
- package/src/command-line/graph/graph.js +1 -1
- package/src/command-line/init/command-object.js +1 -21
- package/src/command-line/init/configure-plugins.js +1 -1
- package/src/command-line/init/implementation/angular/integrated-workspace.js +1 -1
- package/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -2
- package/src/command-line/init/implementation/deduce-default-base.js +5 -5
- package/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +2 -2
- package/src/command-line/init/implementation/dot-nx/nxw.js +1 -1
- package/src/command-line/init/implementation/utils.d.ts +1 -2
- package/src/command-line/init/implementation/utils.d.ts.map +1 -1
- package/src/command-line/init/implementation/utils.js +1 -15
- package/src/command-line/init/init-v1.d.ts +0 -3
- package/src/command-line/init/init-v1.d.ts.map +1 -1
- package/src/command-line/init/init-v1.js +1 -27
- package/src/command-line/init/init-v2.d.ts +0 -1
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +7 -35
- package/src/command-line/mcp/mcp.d.ts.map +1 -1
- package/src/command-line/mcp/mcp.js +2 -0
- package/src/command-line/migrate/migrate-ui-api.d.ts.map +1 -1
- package/src/command-line/migrate/migrate-ui-api.js +13 -0
- package/src/command-line/migrate/migrate.d.ts.map +1 -1
- package/src/command-line/migrate/migrate.js +41 -23
- package/src/command-line/migrate/run-migration-process.js +2 -0
- package/src/command-line/nx-cloud/connect/view-logs.js +1 -1
- package/src/command-line/nx-commands.js +65 -65
- package/src/command-line/release/config/version-plans.js +1 -1
- package/src/command-line/release/utils/exec-command.js +1 -1
- package/src/command-line/release/utils/launch-editor.js +2 -2
- package/src/command-line/release/utils/remote-release-clients/github.d.ts +1 -0
- package/src/command-line/release/utils/remote-release-clients/github.d.ts.map +1 -1
- package/src/command-line/release/utils/remote-release-clients/github.js +39 -2
- package/src/command-line/release/utils/remote-release-clients/gitlab.d.ts.map +1 -1
- package/src/command-line/release/utils/remote-release-clients/gitlab.js +1 -0
- package/src/command-line/release/version/release-group-processor.d.ts.map +1 -1
- package/src/command-line/release/version/release-group-processor.js +2 -4
- package/src/command-line/release/version.js +1 -1
- package/src/command-line/run/run-one.d.ts.map +1 -1
- package/src/command-line/run/run-one.js +1 -1
- package/src/command-line/run/run.d.ts.map +1 -1
- package/src/command-line/run/run.js +2 -2
- package/src/command-line/show/target.js +5 -2
- package/src/command-line/watch/watch.js +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/daemon/client/client.d.ts +2 -2
- package/src/daemon/client/client.d.ts.map +1 -1
- package/src/daemon/client/client.js +3 -2
- package/src/daemon/client/generate-help-output.js +1 -1
- package/src/daemon/server/handle-configure-ai-agents.js +11 -4
- package/src/daemon/server/handle-hash-tasks.d.ts +1 -0
- package/src/daemon/server/handle-hash-tasks.d.ts.map +1 -1
- package/src/daemon/server/handle-hash-tasks.js +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts +1 -1
- package/src/daemon/server/project-graph-incremental-recomputation.d.ts.map +1 -1
- package/src/daemon/server/project-graph-listener-sockets.d.ts +1 -1
- package/src/daemon/server/project-graph-listener-sockets.d.ts.map +1 -1
- package/src/daemon/server/shutdown-utils.js +1 -1
- package/src/devkit-internals.d.ts +3 -2
- package/src/devkit-internals.d.ts.map +1 -1
- package/src/devkit-internals.js +5 -4
- package/src/executors/run-commands/run-commands.impl.d.ts.map +1 -1
- package/src/executors/run-commands/run-commands.impl.js +60 -7
- package/src/executors/run-commands/running-tasks.d.ts.map +1 -1
- package/src/executors/run-commands/running-tasks.js +1 -5
- package/src/executors/run-script/run-script.impl.js +1 -1
- package/src/executors/utils/convert-nx-executor.js +2 -2
- package/src/generators/utils/project-configuration.js +4 -4
- package/src/hasher/hash-plan-inspector.d.ts.map +1 -1
- package/src/hasher/hash-plan-inspector.js +1 -1
- package/src/hasher/native-task-hasher-impl.d.ts +2 -2
- package/src/hasher/native-task-hasher-impl.d.ts.map +1 -1
- package/src/hasher/native-task-hasher-impl.js +6 -6
- package/src/hasher/task-hasher.d.ts +4 -4
- package/src/hasher/task-hasher.d.ts.map +1 -1
- package/src/hasher/task-hasher.js +9 -6
- package/src/native/index.d.ts +1 -1
- package/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -1
- package/src/plugins/js/lock-file/bun-parser.js +1 -1
- package/src/plugins/js/lock-file/lock-file.d.ts.map +1 -1
- package/src/plugins/js/lock-file/lock-file.js +3 -1
- package/src/project-graph/build-project-graph.d.ts +1 -1
- package/src/project-graph/build-project-graph.d.ts.map +1 -1
- package/src/project-graph/build-project-graph.js +2 -2
- package/src/project-graph/error-types.d.ts +2 -1
- package/src/project-graph/error-types.d.ts.map +1 -1
- package/src/project-graph/file-utils.d.ts.map +1 -1
- package/src/project-graph/file-utils.js +4 -2
- package/src/project-graph/nx-deps-cache.d.ts +1 -1
- package/src/project-graph/nx-deps-cache.d.ts.map +1 -1
- package/src/project-graph/plugins/isolation/isolated-plugin.js +5 -5
- package/src/project-graph/project-graph.d.ts +2 -2
- package/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts +23 -18
- package/src/project-graph/utils/project-configuration/name-substitution-manager.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration/name-substitution-manager.js +129 -87
- package/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +40 -0
- package/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/project-nodes-manager.js +264 -0
- package/src/project-graph/utils/project-configuration/target-merging.d.ts +32 -0
- package/src/project-graph/utils/project-configuration/target-merging.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/target-merging.js +332 -0
- package/src/project-graph/utils/project-configuration/target-normalization.d.ts +13 -0
- package/src/project-graph/utils/project-configuration/target-normalization.d.ts.map +1 -0
- package/src/project-graph/utils/project-configuration/target-normalization.js +177 -0
- package/src/project-graph/utils/project-configuration-utils.d.ts +16 -41
- package/src/project-graph/utils/project-configuration-utils.d.ts.map +1 -1
- package/src/project-graph/utils/project-configuration-utils.js +56 -734
- package/src/tasks-runner/cache.js +1 -1
- package/src/tasks-runner/default-tasks-runner.js +1 -1
- package/src/tasks-runner/life-cycle.d.ts +4 -0
- package/src/tasks-runner/life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts.map +1 -1
- package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +4 -0
- package/src/tasks-runner/task-orchestrator.d.ts +12 -4
- package/src/tasks-runner/task-orchestrator.d.ts.map +1 -1
- package/src/tasks-runner/task-orchestrator.js +123 -68
- package/src/tasks-runner/tasks-schedule.d.ts +1 -1
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +14 -3
- package/src/tasks-runner/utils.d.ts +2 -2
- package/src/tasks-runner/utils.d.ts.map +1 -1
- package/src/tasks-runner/utils.js +5 -7
- package/src/utils/ab-testing.js +1 -1
- package/src/utils/analytics-prompt.d.ts.map +1 -1
- package/src/utils/analytics-prompt.js +2 -0
- package/src/utils/child-process.d.ts.map +1 -1
- package/src/utils/child-process.js +1 -2
- package/src/utils/command-line-utils.js +3 -3
- package/src/utils/default-base.js +1 -1
- package/src/utils/git-utils.d.ts.map +1 -1
- package/src/utils/git-utils.index-filter.js +2 -2
- package/src/utils/git-utils.js +6 -5
- package/src/utils/git-utils.tree-filter.js +1 -1
- package/src/utils/machine-id-cache.d.ts.map +1 -1
- package/src/utils/machine-id-cache.js +72 -2
- package/src/utils/package-json.js +2 -2
- package/src/utils/package-manager.d.ts.map +1 -1
- package/src/utils/package-manager.js +8 -13
- package/src/utils/provenance.d.ts.map +1 -1
- package/src/utils/provenance.js +2 -2
- package/src/utils/require-nx-key.js +1 -1
- package/src/utils/serialize-overrides-into-command-line.d.ts.map +1 -1
- package/src/utils/serialize-overrides-into-command-line.js +3 -4
- package/src/utils/shell-quoting.d.ts +11 -0
- package/src/utils/shell-quoting.d.ts.map +1 -0
- package/src/utils/shell-quoting.js +41 -0
- package/src/utils/split-target.d.ts +13 -2
- package/src/utils/split-target.d.ts.map +1 -1
- package/src/utils/split-target.js +180 -31
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-craco-commands-to-package-scripts.js +0 -21
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts +0 -2
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +0 -20
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-custom-webpack-setup.js +0 -17
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts +0 -2
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/check-for-uncommitted-changes.js +0 -20
- package/src/command-line/init/implementation/react/clean-up-files.d.ts +0 -2
- package/src/command-line/init/implementation/react/clean-up-files.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/clean-up-files.js +0 -30
- package/src/command-line/init/implementation/react/index.d.ts +0 -5
- package/src/command-line/init/implementation/react/index.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/index.js +0 -77
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts +0 -2
- package/src/command-line/init/implementation/react/read-name-from-package-json.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/read-name-from-package-json.js +0 -16
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts +0 -2
- package/src/command-line/init/implementation/react/rename-js-to-jsx.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/rename-js-to-jsx.js +0 -22
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts +0 -2
- package/src/command-line/init/implementation/react/tsconfig-setup.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/tsconfig-setup.js +0 -108
- package/src/command-line/init/implementation/react/write-vite-config.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-config.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-config.js +0 -53
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts +0 -2
- package/src/command-line/init/implementation/react/write-vite-index-html.d.ts.map +0 -1
- package/src/command-line/init/implementation/react/write-vite-index-html.js +0 -24
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupTsConfig = setupTsConfig;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fileutils_1 = require("../../../../utils/fileutils");
|
|
6
|
-
const defaultTsConfig = (relativePathToRoot) => ({
|
|
7
|
-
extends: relativePathToRoot
|
|
8
|
-
? (0, path_1.join)(relativePathToRoot, 'tsconfig.base.json')
|
|
9
|
-
: './tsconfig.base.json',
|
|
10
|
-
compilerOptions: {
|
|
11
|
-
jsx: 'react',
|
|
12
|
-
allowJs: true,
|
|
13
|
-
esModuleInterop: true,
|
|
14
|
-
allowSyntheticDefaultImports: true,
|
|
15
|
-
},
|
|
16
|
-
files: [],
|
|
17
|
-
include: [],
|
|
18
|
-
references: [
|
|
19
|
-
{
|
|
20
|
-
path: './tsconfig.app.json',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
path: './tsconfig.spec.json',
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
});
|
|
27
|
-
const defaultTsConfigApp = (relativePathToRoot) => ({
|
|
28
|
-
extends: './tsconfig.json',
|
|
29
|
-
compilerOptions: {
|
|
30
|
-
outDir: (0, path_1.join)(relativePathToRoot, 'dist/out-tsc'),
|
|
31
|
-
types: ['node'],
|
|
32
|
-
},
|
|
33
|
-
files: [
|
|
34
|
-
(0, path_1.join)(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
|
|
35
|
-
(0, path_1.join)(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
|
|
36
|
-
],
|
|
37
|
-
exclude: ['**/*.spec.ts', '**/*.spec.tsx'],
|
|
38
|
-
include: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
|
|
39
|
-
});
|
|
40
|
-
const defaultTsConfigSpec = (relativePathToRoot) => ({
|
|
41
|
-
extends: './tsconfig.json',
|
|
42
|
-
compilerOptions: {
|
|
43
|
-
outDir: (0, path_1.join)(relativePathToRoot, 'dist/out-tsc'),
|
|
44
|
-
module: 'commonjs',
|
|
45
|
-
types: ['jest', 'node'],
|
|
46
|
-
},
|
|
47
|
-
include: [
|
|
48
|
-
'**/*.spec.ts',
|
|
49
|
-
'**/*.spec.tsx',
|
|
50
|
-
'**/*.spec.js',
|
|
51
|
-
'**/*.spec.jsx',
|
|
52
|
-
'**/*.d.ts',
|
|
53
|
-
],
|
|
54
|
-
files: [
|
|
55
|
-
(0, path_1.join)(relativePathToRoot, 'node_modules/@nx/react/typings/cssmodule.d.ts'),
|
|
56
|
-
(0, path_1.join)(relativePathToRoot, 'node_modules/@nx/react/typings/image.d.ts'),
|
|
57
|
-
],
|
|
58
|
-
});
|
|
59
|
-
function setupTsConfig(appName, isStandalone) {
|
|
60
|
-
const tsconfigPath = isStandalone
|
|
61
|
-
? 'tsconfig.json'
|
|
62
|
-
: `apps/${appName}/tsconfig.json`;
|
|
63
|
-
const tsconfigAppPath = isStandalone
|
|
64
|
-
? 'tsconfig.app.json'
|
|
65
|
-
: `apps/${appName}/tsconfig.app.json`;
|
|
66
|
-
const tsconfiSpecPath = isStandalone
|
|
67
|
-
? 'tsconfig.spec.json'
|
|
68
|
-
: `apps/${appName}/tsconfig.spec.json`;
|
|
69
|
-
const tsconfigBasePath = isStandalone
|
|
70
|
-
? './tsconfig.base.json'
|
|
71
|
-
: '../../tsconfig.base.json';
|
|
72
|
-
const relativePathToRoot = isStandalone ? '' : '../../';
|
|
73
|
-
if ((0, fileutils_1.fileExists)(tsconfigPath)) {
|
|
74
|
-
const json = (0, fileutils_1.readJsonFile)(tsconfigPath);
|
|
75
|
-
json.extends = tsconfigBasePath;
|
|
76
|
-
if (json.compilerOptions) {
|
|
77
|
-
json.compilerOptions.jsx = 'react';
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
json.compilerOptions = {
|
|
81
|
-
jsx: 'react',
|
|
82
|
-
allowJs: true,
|
|
83
|
-
esModuleInterop: true,
|
|
84
|
-
allowSyntheticDefaultImports: true,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
(0, fileutils_1.writeJsonFile)(tsconfigPath, json);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
(0, fileutils_1.writeJsonFile)(tsconfigPath, defaultTsConfig(relativePathToRoot));
|
|
91
|
-
}
|
|
92
|
-
if ((0, fileutils_1.fileExists)(tsconfigAppPath)) {
|
|
93
|
-
const json = (0, fileutils_1.readJsonFile)(tsconfigAppPath);
|
|
94
|
-
json.extends = './tsconfig.json';
|
|
95
|
-
(0, fileutils_1.writeJsonFile)(tsconfigAppPath, json);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
(0, fileutils_1.writeJsonFile)(tsconfigAppPath, defaultTsConfigApp(relativePathToRoot));
|
|
99
|
-
}
|
|
100
|
-
if ((0, fileutils_1.fileExists)(tsconfiSpecPath)) {
|
|
101
|
-
const json = (0, fileutils_1.readJsonFile)(tsconfiSpecPath);
|
|
102
|
-
json.extends = './tsconfig.json';
|
|
103
|
-
(0, fileutils_1.writeJsonFile)(tsconfiSpecPath, json);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
(0, fileutils_1.writeJsonFile)(tsconfiSpecPath, defaultTsConfigSpec(relativePathToRoot));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-vite-config.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/command-line/init/implementation/react/write-vite-config.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,QAwDd"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeViteConfig = writeViteConfig;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
function writeViteConfig(appName, isStandalone, isJs) {
|
|
6
|
-
let port = 3000;
|
|
7
|
-
// Use PORT from .env file if it exists in project.
|
|
8
|
-
if ((0, fs_1.existsSync)(`../.env`)) {
|
|
9
|
-
const envFile = (0, fs_1.readFileSync)(`../.env`).toString();
|
|
10
|
-
const result = envFile.match(/\bport=(?<port>\d{4})/i);
|
|
11
|
-
const portCandidate = Number(result?.groups?.port);
|
|
12
|
-
if (!isNaN(portCandidate)) {
|
|
13
|
-
port = portCandidate;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
(0, fs_1.writeFileSync)(isStandalone ? 'vite.config.mjs' : `apps/${appName}/vite.config.mjs`, `import { defineConfig } from 'vite'
|
|
17
|
-
import react from '@vitejs/plugin-react'
|
|
18
|
-
import replace from '@rollup/plugin-replace';
|
|
19
|
-
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|
20
|
-
|
|
21
|
-
// Match CRA's environment variables.
|
|
22
|
-
// TODO: Replace these with VITE_ prefixed environment variables, and using import.meta.env.VITE_* instead of process.env.REACT_APP_*.
|
|
23
|
-
const craEnvVarRegex = /^REACT_APP/i;
|
|
24
|
-
const craEnvVars = Object.keys(process.env)
|
|
25
|
-
.filter((key) => craEnvVarRegex.test(key))
|
|
26
|
-
.reduce((env, key) => {
|
|
27
|
-
env[\`process.env.\${key}\`] = JSON.stringify(process.env[key]);
|
|
28
|
-
return env;
|
|
29
|
-
}, {});
|
|
30
|
-
|
|
31
|
-
// https://vite.dev/config/
|
|
32
|
-
export default defineConfig({
|
|
33
|
-
build: {
|
|
34
|
-
outDir: ${isStandalone ? `'./dist/${appName}'` : `'../../dist/apps/${appName}'`}
|
|
35
|
-
},
|
|
36
|
-
server: {
|
|
37
|
-
port: ${port},
|
|
38
|
-
open: true,
|
|
39
|
-
},
|
|
40
|
-
test: {
|
|
41
|
-
globals: true,
|
|
42
|
-
environment: 'jsdom',
|
|
43
|
-
setupFiles: 'src/setupTests.${isJs ? 'js' : 'ts'}',
|
|
44
|
-
css: true,
|
|
45
|
-
},
|
|
46
|
-
plugins: [
|
|
47
|
-
react(),
|
|
48
|
-
replace({ values: craEnvVars, preventAssignment: true }),
|
|
49
|
-
nxViteTsPaths(),
|
|
50
|
-
],
|
|
51
|
-
});
|
|
52
|
-
`);
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-vite-index-html.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/nx/src/command-line/init/implementation/react/write-vite-index-html.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,OAAO,EACrB,IAAI,EAAE,OAAO,QAuBd"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeViteIndexHtml = writeViteIndexHtml;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
function writeViteIndexHtml(appName, isStandalone, isJs) {
|
|
6
|
-
const indexPath = isStandalone ? 'index.html' : `apps/${appName}/index.html`;
|
|
7
|
-
if ((0, fs_1.existsSync)(indexPath)) {
|
|
8
|
-
(0, fs_1.copyFileSync)(indexPath, indexPath + '.old');
|
|
9
|
-
}
|
|
10
|
-
const indexFile = isJs ? '/src/index.jsx' : '/src/index.tsx';
|
|
11
|
-
(0, fs_1.writeFileSync)(indexPath, `<!DOCTYPE html>
|
|
12
|
-
<html lang="en">
|
|
13
|
-
<head>
|
|
14
|
-
<meta charset="UTF-8" />
|
|
15
|
-
<link rel="icon" href="/favicon.ico" />
|
|
16
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
17
|
-
<title>Vite + React + Nx</title>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<div id="root"></div>
|
|
21
|
-
<script type="module" src="${indexFile}"></script>
|
|
22
|
-
</body>
|
|
23
|
-
</html>`);
|
|
24
|
-
}
|