@nx/react 17.0.5 → 17.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/LICENSE +1 -1
- package/README.md +4 -9
- package/generators.json +1 -1
- package/index.d.ts +0 -1
- package/index.js +1 -3
- package/migrations.json +0 -21
- package/package.json +7 -7
- package/plugins/component-testing/index.js +24 -52
- package/plugins/component-testing/webpack-fallback.js +1 -1
- package/plugins/storybook/index.js +2 -6
- package/plugins/storybook/merge-plugins.d.ts +1 -1
- package/plugins/webpack.d.ts +3 -1
- package/plugins/webpack.js +11 -3
- package/plugins/with-react.d.ts +4 -2
- package/plugins/with-react.js +58 -2
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -13
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +58 -173
- package/src/executors/module-federation-dev-server/schema.json +1 -13
- package/src/generators/application/application.js +18 -41
- package/src/generators/application/files/base-vite/index.html__tmpl__ +1 -1
- package/src/generators/application/files/base-webpack/src/environments/environment.prod.ts__tmpl__ +3 -0
- package/src/generators/application/files/base-webpack/src/environments/environment.ts__tmpl__ +6 -0
- package/src/generators/application/files/base-webpack/src/index.html +2 -0
- package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +5 -46
- package/src/generators/application/files/nx-welcome/src/app/nx-welcome.tsx +13 -54
- package/src/generators/application/lib/add-e2e.js +7 -25
- package/src/generators/application/lib/add-jest.js +2 -2
- package/src/generators/application/lib/add-project.d.ts +2 -2
- package/src/generators/application/lib/add-project.js +15 -12
- package/src/generators/application/lib/add-routing.d.ts +1 -1
- package/src/generators/application/lib/add-routing.js +8 -4
- package/src/generators/application/lib/create-application-files.js +1 -30
- package/src/generators/application/lib/install-common-dependencies.js +1 -15
- package/src/generators/application/lib/normalize-options.js +1 -35
- package/src/generators/application/lib/set-defaults.js +0 -1
- package/src/generators/application/lib/update-jest-config.js +8 -8
- package/src/generators/application/schema.d.ts +0 -5
- package/src/generators/application/schema.json +3 -7
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +22 -39
- package/src/generators/component/lib/normalize-options.js +2 -4
- package/src/generators/component/schema.d.ts +4 -6
- package/src/generators/component/schema.json +7 -7
- package/src/generators/component-cypress-spec/schema.json +1 -1
- package/src/generators/component-story/schema.json +1 -1
- package/src/generators/component-test/schema.json +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +7 -18
- package/src/generators/cypress-component-configuration/lib/add-files.js +6 -1
- package/src/generators/cypress-component-configuration/schema.d.ts +0 -1
- package/src/generators/federate-module/federate-module.js +2 -2
- package/src/generators/federate-module/schema.d.ts +1 -1
- package/src/generators/federate-module/schema.json +3 -4
- package/src/generators/hook/files/__fileName__.ts__tmpl__ +15 -15
- package/src/generators/hook/schema.d.ts +4 -4
- package/src/generators/hook/schema.json +5 -5
- package/src/generators/host/files/module-federation/module-federation.config.js__tmpl__ +2 -17
- package/src/generators/host/files/module-federation/src/main.ts__tmpl__ +1 -0
- package/src/generators/host/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +2 -5
- package/src/generators/host/files/module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +2 -5
- package/src/generators/host/files/module-federation-ts/module-federation.config.ts__tmpl__ +2 -17
- package/src/generators/host/files/module-federation-ts/src/main.ts__tmpl__ +1 -0
- package/src/generators/host/files/module-federation-ts/webpack.config.prod.ts__tmpl__ +1 -2
- package/src/generators/host/files/module-federation-ts/webpack.config.ts__tmpl__ +2 -2
- package/src/generators/host/host.js +1 -15
- package/src/generators/host/lib/add-module-federation-files.d.ts +1 -2
- package/src/generators/host/lib/add-module-federation-files.js +11 -24
- package/src/generators/host/lib/setup-ssr-for-host.js +0 -1
- package/src/generators/host/lib/update-module-federation-e2e-project.js +5 -7
- package/src/generators/host/schema.d.ts +2 -5
- package/src/generators/host/schema.json +6 -16
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/init/init.js +49 -10
- package/src/generators/init/schema.d.ts +6 -1
- package/src/generators/init/schema.json +22 -5
- package/src/generators/library/lib/add-linting.js +2 -2
- package/src/generators/library/lib/add-rollup-build-target.d.ts +1 -2
- package/src/generators/library/lib/add-rollup-build-target.js +8 -16
- package/src/generators/library/lib/install-common-dependencies.js +5 -13
- package/src/generators/library/lib/maybe-js.d.ts +2 -0
- package/src/generators/library/lib/normalize-options.js +5 -34
- package/src/generators/library/lib/update-app-routes.js +1 -1
- package/src/generators/library/library.js +6 -17
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +3 -3
- package/src/generators/redux/schema.d.ts +1 -1
- package/src/generators/redux/schema.json +2 -2
- package/src/generators/remote/files/module-federation/module-federation.config.js__tmpl__ +1 -4
- package/src/generators/remote/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +1 -1
- package/src/generators/remote/files/module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/module-federation-ts/module-federation.config.ts__tmpl__ +1 -4
- package/src/generators/remote/lib/setup-ssr-for-remote.js +1 -5
- package/src/generators/remote/lib/setup-tspath-for-remote.js +1 -2
- package/src/generators/remote/lib/update-host-with-remote.js +1 -10
- package/src/generators/remote/remote.js +2 -22
- package/src/generators/remote/schema.d.ts +2 -3
- package/src/generators/remote/schema.json +6 -17
- package/src/generators/setup-ssr/schema.json +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +7 -23
- package/src/generators/setup-tailwind/schema.json +1 -1
- package/src/generators/stories/schema.json +1 -1
- package/src/generators/stories/stories.js +5 -17
- package/src/generators/storybook-configuration/configuration.d.ts +0 -2
- package/src/generators/storybook-configuration/configuration.js +15 -37
- package/src/generators/storybook-configuration/schema.d.ts +1 -2
- package/src/generators/storybook-configuration/schema.json +7 -7
- package/src/module-federation/ast-utils.js +1 -1
- package/src/module-federation/utils.js +1 -8
- package/src/module-federation/with-module-federation-ssr.js +0 -3
- package/src/module-federation/with-module-federation.d.ts +3 -3
- package/src/module-federation/with-module-federation.js +4 -14
- package/src/rules/update-module-federation-project.d.ts +0 -2
- package/src/rules/update-module-federation-project.js +3 -12
- package/src/utils/assertion.js +0 -1
- package/src/utils/ct-utils.d.ts +1 -6
- package/src/utils/ct-utils.js +9 -39
- package/src/utils/get-in-source-vitest-tests-template.js +1 -1
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/typings/style.d.ts +0 -1
- package/mf/dynamic-federation.d.ts +0 -4
- package/mf/dynamic-federation.js +0 -75
- package/mf/index.d.ts +0 -1
- package/mf/index.js +0 -7
- package/plugins/nx-react-webpack-plugin/lib/apply-react-config.d.ts +0 -4
- package/plugins/nx-react-webpack-plugin/lib/apply-react-config.js +0 -86
- package/plugins/nx-react-webpack-plugin/nx-react-webpack-plugin.d.ts +0 -8
- package/plugins/nx-react-webpack-plugin/nx-react-webpack-plugin.js +0 -13
- package/src/generators/application/files/style-tailwind/src/app/__fileName__.tsx__tmpl__ +0 -33
- package/src/generators/application/files/style-tailwind/src/styles.css +0 -1
- package/src/generators/host/files/common/src/main.js__tmpl__ +0 -10
- package/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +0 -19
- package/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +0 -41
- package/src/generators/host/files/common-ts/src/main.ts__tmpl__ +0 -10
- package/src/generators/remote/files/module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/src/generators/remote/files/module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +0 -2
- package/src/generators/remote/lib/add-remote-to-dynamic-host.js +0 -11
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +0 -2
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +0 -26
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -2
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/src/utils/add-mf-env-to-inputs.js +0 -27
- package/src/utils/has-vite-plugin.d.ts +0 -2
- package/src/utils/has-vite-plugin.js +0 -11
- package/src/utils/has-webpack-plugin.d.ts +0 -2
- package/src/utils/has-webpack-plugin.js +0 -11
- package/src/utils/maybe-js.d.ts +0 -3
- /package/src/generators/host/files/common/src/app/{__fileName__.js__tmpl__ → __fileName__.tsx__tmpl__} +0 -0
- /package/src/{utils → generators/library/lib}/maybe-js.js +0 -0
- /package/src/generators/remote/files/{common/src/main.js__tmpl__ → module-federation/src/main.ts__tmpl__} +0 -0
- /package/src/generators/remote/files/{common/src/remote-entry.js__tmpl__ → module-federation/src/remote-entry.ts__tmpl__} +0 -0
- /package/src/generators/remote/files/{common-ts → module-federation-ts}/src/main.ts__tmpl__ +0 -0
- /package/src/generators/remote/files/{common-ts → module-federation-ts}/src/remote-entry.ts__tmpl__ +0 -0
|
@@ -46,16 +46,7 @@ function updateHostWithRemote(host, hostName, remoteName) {
|
|
|
46
46
|
}
|
|
47
47
|
exports.updateHostWithRemote = updateHostWithRemote;
|
|
48
48
|
function findAppComponentPath(host, sourceRoot) {
|
|
49
|
-
const locations = [
|
|
50
|
-
'app/app.tsx',
|
|
51
|
-
'app/App.tsx',
|
|
52
|
-
'app/app.js',
|
|
53
|
-
'app/App.js',
|
|
54
|
-
'app.tsx',
|
|
55
|
-
'App.tsx',
|
|
56
|
-
'app.js',
|
|
57
|
-
'App.js',
|
|
58
|
-
];
|
|
49
|
+
const locations = ['app/app.tsx', 'app/App.tsx', 'app.tsx', 'App.tsx'];
|
|
59
50
|
for (const loc of locations) {
|
|
60
51
|
if (host.exists((0, devkit_1.joinPathFragments)(sourceRoot, loc))) {
|
|
61
52
|
return (0, devkit_1.joinPathFragments)(sourceRoot, loc);
|
|
@@ -10,16 +10,12 @@ const update_module_federation_project_1 = require("../../rules/update-module-fe
|
|
|
10
10
|
const setup_ssr_1 = require("../setup-ssr/setup-ssr");
|
|
11
11
|
const setup_ssr_for_remote_1 = require("./lib/setup-ssr-for-remote");
|
|
12
12
|
const setup_tspath_for_remote_1 = require("./lib/setup-tspath-for-remote");
|
|
13
|
-
const add_remote_to_dynamic_host_1 = require("./lib/add-remote-to-dynamic-host");
|
|
14
|
-
const add_mf_env_to_inputs_1 = require("../../utils/add-mf-env-to-inputs");
|
|
15
|
-
const maybe_js_1 = require("../../utils/maybe-js");
|
|
16
13
|
function addModuleFederationFiles(host, options) {
|
|
17
14
|
const templateVariables = {
|
|
18
15
|
...(0, devkit_1.names)(options.name),
|
|
19
16
|
...options,
|
|
20
17
|
tmpl: '',
|
|
21
18
|
};
|
|
22
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, `./files/${options.js ? 'common' : 'common-ts'}`), options.appProjectRoot, templateVariables);
|
|
23
19
|
const pathToModuleFederationFiles = options.typescriptConfiguration
|
|
24
20
|
? 'module-federation-ts'
|
|
25
21
|
: 'module-federation';
|
|
@@ -47,14 +43,7 @@ async function remoteGeneratorInternal(host, schema) {
|
|
|
47
43
|
const tasks = [];
|
|
48
44
|
const options = {
|
|
49
45
|
...(await (0, normalize_options_1.normalizeOptions)(host, schema, '@nx/react:remote')),
|
|
50
|
-
|
|
51
|
-
js: schema.js ?? false,
|
|
52
|
-
typescriptConfiguration: schema.js
|
|
53
|
-
? false
|
|
54
|
-
: schema.typescriptConfiguration ?? true,
|
|
55
|
-
dynamic: schema.dynamic ?? false,
|
|
56
|
-
// TODO(colum): remove when MF works with Crystal
|
|
57
|
-
addPlugin: false,
|
|
46
|
+
typescriptConfiguration: schema.typescriptConfiguration ?? false,
|
|
58
47
|
};
|
|
59
48
|
const initAppTask = await (0, application_1.default)(host, {
|
|
60
49
|
...options,
|
|
@@ -69,7 +58,7 @@ async function remoteGeneratorInternal(host, schema) {
|
|
|
69
58
|
// Module federation requires bootstrap code to be dynamically imported.
|
|
70
59
|
// Renaming original entry file so we can use `import(./bootstrap)` in
|
|
71
60
|
// new entry file.
|
|
72
|
-
host.rename((0, path_1.join)(options.appProjectRoot,
|
|
61
|
+
host.rename((0, path_1.join)(options.appProjectRoot, 'src/main.tsx'), (0, path_1.join)(options.appProjectRoot, 'src/bootstrap.tsx'));
|
|
73
62
|
addModuleFederationFiles(host, options);
|
|
74
63
|
(0, update_module_federation_project_1.updateModuleFederationProject)(host, options);
|
|
75
64
|
(0, setup_tspath_for_remote_1.setupTspathForRemote)(host, options);
|
|
@@ -86,15 +75,6 @@ async function remoteGeneratorInternal(host, schema) {
|
|
|
86
75
|
projectConfig.targets.server.options.webpackConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, `webpack.server.config.${options.typescriptConfiguration ? 'ts' : 'js'}`);
|
|
87
76
|
(0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
|
|
88
77
|
}
|
|
89
|
-
if (!options.setParserOptionsProject) {
|
|
90
|
-
host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.lint.json'));
|
|
91
|
-
}
|
|
92
|
-
if (options.host && options.dynamic) {
|
|
93
|
-
const hostConfig = (0, devkit_1.readProjectConfiguration)(host, schema.host);
|
|
94
|
-
const pathToMFManifest = (0, devkit_1.joinPathFragments)(hostConfig.sourceRoot, 'assets/module-federation.manifest.json');
|
|
95
|
-
(0, add_remote_to_dynamic_host_1.addRemoteToDynamicHost)(host, options.name, options.devServerPort, pathToMFManifest);
|
|
96
|
-
}
|
|
97
|
-
(0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(host);
|
|
98
78
|
if (!options.skipFormat) {
|
|
99
79
|
await (0, devkit_1.formatFiles)(host);
|
|
100
80
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
2
|
import type { Linter } from '@nx/eslint';
|
|
3
|
-
import type { SupportedStyles } from '../../../typings
|
|
3
|
+
import type { SupportedStyles } from '../../../typings';
|
|
4
4
|
import type { NormalizedSchema as ApplicationNormalizedSchema } from '../application/schema';
|
|
5
5
|
|
|
6
6
|
export interface Schema {
|
|
@@ -9,7 +9,7 @@ export interface Schema {
|
|
|
9
9
|
devServerPort?: number;
|
|
10
10
|
directory?: string;
|
|
11
11
|
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
12
|
-
e2eTestRunner: 'cypress' | '
|
|
12
|
+
e2eTestRunner: 'cypress' | 'none';
|
|
13
13
|
globalCss?: boolean;
|
|
14
14
|
host?: string;
|
|
15
15
|
js?: boolean;
|
|
@@ -26,7 +26,6 @@ export interface Schema {
|
|
|
26
26
|
tags?: string;
|
|
27
27
|
unitTestRunner: 'jest' | 'vitest' | 'none';
|
|
28
28
|
typescriptConfiguration?: boolean;
|
|
29
|
-
dynamic?: boolean;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
export interface NormalizedSchema extends ApplicationNormalizedSchema {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "GeneratorReactRemote",
|
|
4
4
|
"cli": "nx",
|
|
5
5
|
"title": "Generate Module Federation Setup for React Remote App",
|
|
@@ -28,12 +28,6 @@
|
|
|
28
28
|
"type": "string",
|
|
29
29
|
"enum": ["as-provided", "derived"]
|
|
30
30
|
},
|
|
31
|
-
"dynamic": {
|
|
32
|
-
"type": "boolean",
|
|
33
|
-
"description": "Should the host application use dynamic federation?",
|
|
34
|
-
"default": false,
|
|
35
|
-
"x-priority": "internal"
|
|
36
|
-
},
|
|
37
31
|
"style": {
|
|
38
32
|
"description": "The file extension to be used for style files.",
|
|
39
33
|
"type": "string",
|
|
@@ -49,15 +43,11 @@
|
|
|
49
43
|
},
|
|
50
44
|
{
|
|
51
45
|
"value": "scss",
|
|
52
|
-
"label": "SASS(.scss) [
|
|
46
|
+
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
53
47
|
},
|
|
54
48
|
{
|
|
55
49
|
"value": "less",
|
|
56
|
-
"label": "LESS [
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"value": "tailwind",
|
|
60
|
-
"label": "tailwind [ https://tailwindcss.com/ ]"
|
|
50
|
+
"label": "LESS [ http://lesscss.org ]"
|
|
61
51
|
},
|
|
62
52
|
{
|
|
63
53
|
"value": "styled-components",
|
|
@@ -109,9 +99,8 @@
|
|
|
109
99
|
},
|
|
110
100
|
"e2eTestRunner": {
|
|
111
101
|
"type": "string",
|
|
112
|
-
"enum": ["cypress", "
|
|
113
|
-
"description": "Test runner to use for end to end (
|
|
114
|
-
"x-prompt": "Which E2E test runner would you like to use?",
|
|
102
|
+
"enum": ["cypress", "none"],
|
|
103
|
+
"description": "Test runner to use for end to end (e2e) tests.",
|
|
115
104
|
"default": "cypress"
|
|
116
105
|
},
|
|
117
106
|
"tags": {
|
|
@@ -174,7 +163,7 @@
|
|
|
174
163
|
},
|
|
175
164
|
"typescriptConfiguration": {
|
|
176
165
|
"type": "boolean",
|
|
177
|
-
"description": "Whether the module federation configuration and webpack configuration files should use TS.
|
|
166
|
+
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
|
|
178
167
|
"default": true
|
|
179
168
|
}
|
|
180
169
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupSsrGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const init_1 = require("../init/init");
|
|
5
6
|
const versions_1 = require("../../utils/versions");
|
|
6
7
|
const ast_utils_1 = require("../../utils/ast-utils");
|
|
7
8
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
@@ -17,22 +18,9 @@ function readEntryFile(host, path) {
|
|
|
17
18
|
source: tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true),
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
|
-
async function getProjectConfig(tree, projectName) {
|
|
21
|
-
let maybeProjectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
22
|
-
if (!maybeProjectConfig.targets?.build) {
|
|
23
|
-
let projectGraph;
|
|
24
|
-
try {
|
|
25
|
-
projectGraph = (0, devkit_1.readCachedProjectGraph)();
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
29
|
-
}
|
|
30
|
-
maybeProjectConfig = projectGraph.nodes[projectName].data;
|
|
31
|
-
}
|
|
32
|
-
return maybeProjectConfig;
|
|
33
|
-
}
|
|
34
21
|
async function setupSsrGenerator(tree, options) {
|
|
35
|
-
|
|
22
|
+
await (0, init_1.default)(tree, { skipFormat: true });
|
|
23
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
36
24
|
const projectRoot = projectConfig.root;
|
|
37
25
|
const appImportCandidates = [
|
|
38
26
|
options.appComponentImportPath ?? 'app/app',
|
|
@@ -56,15 +44,11 @@ async function setupSsrGenerator(tree, options) {
|
|
|
56
44
|
if (projectConfig.targets.server) {
|
|
57
45
|
throw new Error(`Project ${options.project} already has a server target.`);
|
|
58
46
|
}
|
|
59
|
-
const originalOutputPath = projectConfig.targets.build?.options?.outputPath
|
|
60
|
-
projectConfig.targets.build?.outputs[0];
|
|
47
|
+
const originalOutputPath = projectConfig.targets.build?.options?.outputPath;
|
|
61
48
|
if (!originalOutputPath) {
|
|
62
49
|
throw new Error(`Project ${options.project} does not contain a outputPath for the build target.`);
|
|
63
50
|
}
|
|
64
|
-
|
|
65
|
-
if (projectConfig.targets.build.options?.outputPath) {
|
|
66
|
-
projectConfig.targets.build.options.outputPath = (0, devkit_1.joinPathFragments)(originalOutputPath, 'browser');
|
|
67
|
-
}
|
|
51
|
+
projectConfig.targets.build.options.outputPath = (0, devkit_1.joinPathFragments)(originalOutputPath, 'browser');
|
|
68
52
|
projectConfig.targets = {
|
|
69
53
|
...projectConfig.targets,
|
|
70
54
|
server: {
|
|
@@ -81,6 +65,7 @@ async function setupSsrGenerator(tree, options) {
|
|
|
81
65
|
compiler: 'babel',
|
|
82
66
|
externalDependencies: 'all',
|
|
83
67
|
outputHashing: 'none',
|
|
68
|
+
isolatedConfig: true,
|
|
84
69
|
webpackConfig: (0, devkit_1.joinPathFragments)(projectRoot, 'webpack.config.js'),
|
|
85
70
|
},
|
|
86
71
|
configurations: {
|
|
@@ -154,8 +139,7 @@ async function setupSsrGenerator(tree, options) {
|
|
|
154
139
|
? `"${options.extraInclude.join('", "')}",`
|
|
155
140
|
: '',
|
|
156
141
|
appComponentImport: appComponentInfo.importPath,
|
|
157
|
-
browserBuildOutputPath: projectConfig.targets.build
|
|
158
|
-
projectConfig.targets.build?.outputs[0],
|
|
142
|
+
browserBuildOutputPath: projectConfig.targets.build.options.outputPath,
|
|
159
143
|
});
|
|
160
144
|
// Add <StaticRouter> to server main if needed.
|
|
161
145
|
// TODO: need to read main.server.tsx not main.tsx.
|
|
@@ -6,15 +6,16 @@ const component_cypress_spec_1 = require("../component-cypress-spec/component-cy
|
|
|
6
6
|
const ast_utils_1 = require("../../utils/ast-utils");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const
|
|
9
|
+
const minimatch = require("minimatch");
|
|
10
10
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
11
11
|
const versions_1 = require("../../utils/versions");
|
|
12
12
|
let tsModule;
|
|
13
13
|
async function projectRootPath(tree, config) {
|
|
14
|
+
const { findStorybookAndBuildTargetsAndCompiler } = await Promise.resolve().then(() => require('@nx/storybook/src/utils/utilities'));
|
|
14
15
|
let projectDir;
|
|
15
16
|
if (config.projectType === 'application') {
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
17
|
+
const { nextBuildTarget } = findStorybookAndBuildTargetsAndCompiler(config.targets);
|
|
18
|
+
if (!!nextBuildTarget) {
|
|
18
19
|
// Next.js apps
|
|
19
20
|
projectDir = 'components';
|
|
20
21
|
}
|
|
@@ -52,7 +53,7 @@ async function createAllStories(tree, projectName, interactionTests, js, project
|
|
|
52
53
|
// Ignore private files starting with "_".
|
|
53
54
|
if ((0, path_1.basename)(path).startsWith('_'))
|
|
54
55
|
return;
|
|
55
|
-
if (ignorePaths?.some((pattern) =>
|
|
56
|
+
if (ignorePaths?.some((pattern) => minimatch(path, pattern)))
|
|
56
57
|
return;
|
|
57
58
|
if ((path.endsWith('.tsx') && !path.endsWith('.spec.tsx')) ||
|
|
58
59
|
(path.endsWith('.js') && !path.endsWith('.spec.js')) ||
|
|
@@ -114,17 +115,4 @@ async function storiesGenerator(host, schema) {
|
|
|
114
115
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
115
116
|
}
|
|
116
117
|
exports.storiesGenerator = storiesGenerator;
|
|
117
|
-
async function isNextJsProject(tree, config) {
|
|
118
|
-
const { findStorybookAndBuildTargetsAndCompiler } = await Promise.resolve().then(() => require('@nx/storybook/src/utils/utilities'));
|
|
119
|
-
const { nextBuildTarget } = findStorybookAndBuildTargetsAndCompiler(config.targets);
|
|
120
|
-
if (nextBuildTarget) {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
for (const configFile of ['next.config.js', 'next.config.ts']) {
|
|
124
|
-
if (tree.exists((0, path_1.join)(config.root, configFile))) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
118
|
exports.default = storiesGenerator;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { StorybookConfigureSchema } from './schema';
|
|
2
2
|
import { Tree } from '@nx/devkit';
|
|
3
3
|
export declare function storybookConfigurationGenerator(host: Tree, schema: StorybookConfigureSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
|
-
export declare function storybookConfigurationGeneratorInternal(host: Tree, schema: StorybookConfigureSchema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
5
4
|
export default storybookConfigurationGenerator;
|
|
6
|
-
export declare function findWebpackConfig(tree: Tree, projectRoot: string): string | undefined;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.storybookConfigurationGenerator = void 0;
|
|
4
4
|
const stories_1 = require("../stories/stories");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const versions_1 = require("../../utils/versions");
|
|
7
7
|
async function generateStories(host, schema) {
|
|
8
|
-
// TODO(katerina): Nx
|
|
8
|
+
// TODO(katerina): Nx 18 -> remove Cypress
|
|
9
9
|
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
10
10
|
const { getE2eProjectName } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/project-name'));
|
|
11
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.
|
|
12
|
-
const cypressProject = getE2eProjectName(schema.
|
|
11
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.name);
|
|
12
|
+
const cypressProject = getE2eProjectName(schema.name, projectConfig.root, schema.cypressDirectory);
|
|
13
13
|
await (0, stories_1.default)(host, {
|
|
14
|
-
project: schema.
|
|
14
|
+
project: schema.name,
|
|
15
15
|
generateCypressSpecs: schema.configureCypress && schema.generateCypressSpecs,
|
|
16
16
|
js: schema.js,
|
|
17
17
|
cypressProject,
|
|
@@ -20,39 +20,27 @@ async function generateStories(host, schema) {
|
|
|
20
20
|
interactionTests: schema.interactionTests ?? true,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function storybookConfigurationGenerator(host, schema) {
|
|
24
|
-
return storybookConfigurationGeneratorInternal(host, {
|
|
25
|
-
addPlugin: false,
|
|
26
|
-
...schema,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.storybookConfigurationGenerator = storybookConfigurationGenerator;
|
|
30
|
-
async function storybookConfigurationGeneratorInternal(host, schema) {
|
|
31
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
32
|
-
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
33
|
-
nxJson.useInferencePlugins !== false;
|
|
34
|
-
schema.addPlugin ??= addPluginDefault;
|
|
23
|
+
async function storybookConfigurationGenerator(host, schema) {
|
|
35
24
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
|
|
36
25
|
let uiFramework = '@storybook/react-vite';
|
|
37
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.
|
|
38
|
-
if (
|
|
26
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.name);
|
|
27
|
+
if (projectConfig.targets['build']?.executor === '@nx/webpack:webpack' ||
|
|
28
|
+
projectConfig.targets['build']?.executor === '@nrwl/webpack:webpack' ||
|
|
39
29
|
projectConfig.targets['build']?.executor === '@nx/rollup:rollup' ||
|
|
40
|
-
projectConfig.targets['build']?.executor === '@nrwl/rollup:rollup'
|
|
41
|
-
projectConfig.targets['build']?.executor === '@nx/expo:build') {
|
|
30
|
+
projectConfig.targets['build']?.executor === '@nrwl/rollup:rollup') {
|
|
42
31
|
uiFramework = '@storybook/react-webpack5';
|
|
43
32
|
}
|
|
44
33
|
const installTask = await configurationGenerator(host, {
|
|
45
|
-
|
|
34
|
+
name: schema.name,
|
|
46
35
|
configureCypress: schema.configureCypress,
|
|
47
36
|
js: schema.js,
|
|
48
37
|
linter: schema.linter,
|
|
49
38
|
cypressDirectory: schema.cypressDirectory,
|
|
50
|
-
tsConfiguration: schema.tsConfiguration ?? true,
|
|
51
|
-
interactionTests: schema.interactionTests ?? true,
|
|
39
|
+
tsConfiguration: schema.tsConfiguration ?? true,
|
|
40
|
+
interactionTests: schema.interactionTests ?? true,
|
|
52
41
|
configureStaticServe: schema.configureStaticServe,
|
|
53
|
-
uiFramework: uiFramework,
|
|
42
|
+
uiFramework: uiFramework,
|
|
54
43
|
skipFormat: true,
|
|
55
|
-
addPlugin: schema.addPlugin,
|
|
56
44
|
});
|
|
57
45
|
if (schema.generateStories) {
|
|
58
46
|
await generateStories(host, schema);
|
|
@@ -60,15 +48,5 @@ async function storybookConfigurationGeneratorInternal(host, schema) {
|
|
|
60
48
|
await (0, devkit_1.formatFiles)(host);
|
|
61
49
|
return installTask;
|
|
62
50
|
}
|
|
63
|
-
exports.
|
|
51
|
+
exports.storybookConfigurationGenerator = storybookConfigurationGenerator;
|
|
64
52
|
exports.default = storybookConfigurationGenerator;
|
|
65
|
-
function findWebpackConfig(tree, projectRoot) {
|
|
66
|
-
const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];
|
|
67
|
-
for (const ext of allowsExt) {
|
|
68
|
-
const webpackConfigPath = (0, devkit_1.joinPathFragments)(projectRoot, `webpack.config.${ext}`);
|
|
69
|
-
if (tree.exists(webpackConfigPath)) {
|
|
70
|
-
return webpackConfigPath;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.findWebpackConfig = findWebpackConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Linter } from '@nx/eslint';
|
|
2
2
|
|
|
3
3
|
export interface StorybookConfigureSchema {
|
|
4
|
-
|
|
4
|
+
name: string;
|
|
5
5
|
interactionTests?: boolean;
|
|
6
6
|
generateStories?: boolean;
|
|
7
7
|
js?: boolean;
|
|
@@ -12,5 +12,4 @@ export interface StorybookConfigureSchema {
|
|
|
12
12
|
configureCypress?: boolean;
|
|
13
13
|
generateCypressSpecs?: boolean;
|
|
14
14
|
cypressDirectory?: string;
|
|
15
|
-
addPlugin?: boolean;
|
|
16
15
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"cli": "nx",
|
|
4
4
|
"$id": "NxReactStorybookConfigure",
|
|
5
5
|
"title": "React Storybook Configure",
|
|
6
6
|
"description": "Set up Storybook for a React app or library.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
|
-
"
|
|
9
|
+
"name": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"aliases": ["
|
|
11
|
+
"aliases": ["project", "projectName"],
|
|
12
12
|
"description": "Project for which to generate Storybook configuration.",
|
|
13
13
|
"$default": {
|
|
14
14
|
"$source": "argv",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"configureCypress": {
|
|
30
30
|
"type": "boolean",
|
|
31
31
|
"description": "Run the cypress-configure generator.",
|
|
32
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in
|
|
32
|
+
"x-deprecated": "Use interactionTests instead. This option will be removed in v18."
|
|
33
33
|
},
|
|
34
34
|
"generateStories": {
|
|
35
35
|
"type": "boolean",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"generateCypressSpecs": {
|
|
42
42
|
"type": "boolean",
|
|
43
43
|
"description": "Automatically generate test files in the Cypress E2E app generated by the `cypress-configure` generator.",
|
|
44
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in
|
|
44
|
+
"x-deprecated": "Use interactionTests instead. This option will be removed in v18."
|
|
45
45
|
},
|
|
46
46
|
"configureStaticServe": {
|
|
47
47
|
"type": "boolean",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"cypressDirectory": {
|
|
54
54
|
"type": "string",
|
|
55
55
|
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
|
56
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in
|
|
56
|
+
"x-deprecated": "Use interactionTests instead. This option will be removed in v18."
|
|
57
57
|
},
|
|
58
58
|
"js": {
|
|
59
59
|
"type": "boolean",
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
]
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
-
"required": ["
|
|
93
|
+
"required": ["name"],
|
|
94
94
|
"examplesFile": "../../../docs/storybook-configuration-examples.md"
|
|
95
95
|
}
|
|
@@ -18,7 +18,7 @@ function addRemoteToConfig(source, app) {
|
|
|
18
18
|
return [];
|
|
19
19
|
const lastElement = arrayExpression.elements[arrayExpression.elements.length - 1];
|
|
20
20
|
return [
|
|
21
|
-
lastElement
|
|
21
|
+
lastElement
|
|
22
22
|
? {
|
|
23
23
|
type: devkit_1.ChangeType.Insert,
|
|
24
24
|
index: lastElement.end,
|
|
@@ -5,16 +5,9 @@ const module_federation_1 = require("@nx/webpack/src/utils/module-federation");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
7
7
|
function getFunctionDeterminateRemoteUrl(isServer = false) {
|
|
8
|
-
const target = 'serve';
|
|
8
|
+
const target = isServer ? 'serve-server' : 'serve';
|
|
9
9
|
const remoteEntry = isServer ? 'server/remoteEntry.js' : 'remoteEntry.js';
|
|
10
10
|
return function (remote) {
|
|
11
|
-
const mappedStaticRemotesFromEnv = process.env
|
|
12
|
-
.NX_MF_DEV_SERVER_STATIC_REMOTES
|
|
13
|
-
? JSON.parse(process.env.NX_MF_DEV_SERVER_STATIC_REMOTES)
|
|
14
|
-
: undefined;
|
|
15
|
-
if (mappedStaticRemotesFromEnv && mappedStaticRemotesFromEnv[remote]) {
|
|
16
|
-
return `${mappedStaticRemotesFromEnv[remote]}/${remoteEntry}`;
|
|
17
|
-
}
|
|
18
11
|
let remoteConfiguration = null;
|
|
19
12
|
try {
|
|
20
13
|
remoteConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(remote);
|
|
@@ -3,9 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederationForSSR = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
async function withModuleFederationForSSR(options) {
|
|
6
|
-
if (global.NX_GRAPH_CREATION) {
|
|
7
|
-
return (config) => config;
|
|
8
|
-
}
|
|
9
6
|
const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options, {
|
|
10
7
|
isServer: true,
|
|
11
8
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleFederationConfig } from '@nx/webpack/src/utils/module-federation';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AsyncNxWebpackPlugin } from '@nx/webpack';
|
|
3
3
|
/**
|
|
4
4
|
* @param {ModuleFederationConfig} options
|
|
5
|
-
* @return {Promise<
|
|
5
|
+
* @return {Promise<AsyncNxWebpackPlugin>}
|
|
6
6
|
*/
|
|
7
|
-
export declare function withModuleFederation(options: ModuleFederationConfig): Promise<
|
|
7
|
+
export declare function withModuleFederation(options: ModuleFederationConfig): Promise<AsyncNxWebpackPlugin>;
|
|
@@ -3,34 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederation = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
|
|
6
|
-
const isVarOrWindow = (libType) => libType === 'var' || libType === 'window';
|
|
7
6
|
/**
|
|
8
7
|
* @param {ModuleFederationConfig} options
|
|
9
|
-
* @return {Promise<
|
|
8
|
+
* @return {Promise<AsyncNxWebpackPlugin>}
|
|
10
9
|
*/
|
|
11
10
|
async function withModuleFederation(options) {
|
|
12
|
-
if (global.NX_GRAPH_CREATION) {
|
|
13
|
-
return (config) => config;
|
|
14
|
-
}
|
|
15
11
|
const { sharedDependencies, sharedLibraries, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
16
|
-
const isGlobal = isVarOrWindow(options.library?.type);
|
|
17
12
|
return (config, ctx) => {
|
|
18
13
|
config.output.uniqueName = options.name;
|
|
19
14
|
config.output.publicPath = 'auto';
|
|
20
|
-
if (
|
|
15
|
+
if (options.library?.type === 'var') {
|
|
21
16
|
config.output.scriptType = 'text/javascript';
|
|
22
17
|
}
|
|
23
18
|
config.optimization = {
|
|
24
19
|
runtimeChunk: false,
|
|
25
20
|
};
|
|
26
|
-
if (config.mode === 'development' &&
|
|
27
|
-
Object.keys(mappedRemotes).length > 1 &&
|
|
28
|
-
!options.exposes) {
|
|
29
|
-
config.optimization.runtimeChunk = 'single';
|
|
30
|
-
}
|
|
31
21
|
config.experiments = {
|
|
32
22
|
...config.experiments,
|
|
33
|
-
outputModule: !
|
|
23
|
+
outputModule: !(options.library?.type === 'var'),
|
|
34
24
|
};
|
|
35
25
|
config.plugins.push(new ModuleFederationPlugin({
|
|
36
26
|
name: options.name,
|
|
@@ -47,7 +37,7 @@ async function withModuleFederation(options) {
|
|
|
47
37
|
* { appX: 'appX@http://localhost:3001/remoteEntry.js' }
|
|
48
38
|
* { appY: 'appY@http://localhost:3002/remoteEntry.js' }
|
|
49
39
|
*/
|
|
50
|
-
...(
|
|
40
|
+
...(options.library?.type === 'var' ? { remoteType: 'script' } : {}),
|
|
51
41
|
}), sharedLibraries.getReplacementPlugin());
|
|
52
42
|
return config;
|
|
53
43
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
export declare function updateModuleFederationProject(host: Tree, options: {
|
|
3
|
-
js?: boolean;
|
|
4
3
|
projectName: string;
|
|
5
4
|
appProjectRoot: string;
|
|
6
5
|
devServerPort?: number;
|
|
7
6
|
typescriptConfiguration?: boolean;
|
|
8
|
-
dynamic?: boolean;
|
|
9
7
|
}): GeneratorCallback;
|
|
@@ -3,26 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateModuleFederationProject = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("../utils/versions");
|
|
6
|
-
const maybe_js_1 = require("../utils/maybe-js");
|
|
7
6
|
function updateModuleFederationProject(host, options) {
|
|
8
7
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
|
9
8
|
projectConfig.targets.build.options = {
|
|
10
9
|
...projectConfig.targets.build.options,
|
|
11
|
-
main:
|
|
12
|
-
webpackConfig: `${options.appProjectRoot}/webpack.config.${options.typescriptConfiguration
|
|
10
|
+
main: `${options.appProjectRoot}/src/main.ts`,
|
|
11
|
+
webpackConfig: `${options.appProjectRoot}/webpack.config.${options.typescriptConfiguration ? 'ts' : 'js'}`,
|
|
13
12
|
};
|
|
14
13
|
projectConfig.targets.build.configurations.production = {
|
|
15
14
|
...projectConfig.targets.build.configurations.production,
|
|
16
|
-
webpackConfig: `${options.appProjectRoot}/webpack.config.prod.${options.typescriptConfiguration
|
|
15
|
+
webpackConfig: `${options.appProjectRoot}/webpack.config.prod.${options.typescriptConfiguration ? 'ts' : 'js'}`,
|
|
17
16
|
};
|
|
18
|
-
// If host should be configured to use dynamic federation
|
|
19
|
-
if (options.dynamic) {
|
|
20
|
-
const pathToProdWebpackConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, `webpack.prod.config.${options.typescriptConfiguration && !options.js ? 'ts' : 'js'}`);
|
|
21
|
-
if (host.exists(pathToProdWebpackConfig)) {
|
|
22
|
-
host.delete(pathToProdWebpackConfig);
|
|
23
|
-
}
|
|
24
|
-
delete projectConfig.targets.build.configurations.production?.webpackConfig;
|
|
25
|
-
}
|
|
26
17
|
projectConfig.targets.serve.executor =
|
|
27
18
|
'@nx/react:module-federation-dev-server';
|
|
28
19
|
projectConfig.targets.serve.options.port = options.devServerPort;
|
package/src/utils/assertion.js
CHANGED
package/src/utils/ct-utils.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { type FoundTarget } from '@nx/cypress/src/utils/find-target-options';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function addCTTargetWithBuildTarget(tree: Tree, options: {
|
|
4
4
|
project: string;
|
|
5
5
|
buildTarget: string;
|
|
6
|
-
bundler: 'vite' | 'webpack';
|
|
7
6
|
validExecutorNames: Set<string>;
|
|
8
7
|
}): Promise<FoundTarget>;
|
|
9
8
|
export declare function getBundlerFromTarget(found: FoundTarget, tree: Tree): Promise<'vite' | 'webpack'>;
|
|
10
|
-
export declare function getActualBundler(tree: Tree, options: {
|
|
11
|
-
buildTarget?: string;
|
|
12
|
-
bundler?: 'vite' | 'webpack';
|
|
13
|
-
}, found: FoundTarget): Promise<"vite" | "webpack">;
|
|
14
9
|
export declare function isComponent(tree: Tree, filePath: string): boolean;
|