@nx/react 19.6.0-canary.20240809-d3747e0 → 19.6.0-canary.20240814-6d83ae2
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/package.json +6 -6
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +6 -1
- package/src/generators/application/application.js +1 -1
- package/src/generators/application/files/nx-welcome/claimed/src/app/nx-welcome.tsx__tmpl__ +862 -0
- package/src/generators/application/files/nx-welcome/{src/app/nx-welcome.tsx → not-configured/src/app/nx-welcome.tsx__tmpl__} +191 -211
- package/src/generators/application/files/nx-welcome/unclaimed/src/app/nx-welcome.tsx__tmpl__ +864 -0
- package/src/generators/application/lib/create-application-files.d.ts +1 -1
- package/src/generators/application/lib/create-application-files.js +9 -2
- package/src/generators/application/schema.d.ts +1 -0
- package/src/module-federation/with-module-federation-ssr.js +1 -0
- package/src/module-federation/with-module-federation.js +1 -0
@@ -1,3 +1,3 @@
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
2
2
|
import { NormalizedSchema } from '../schema';
|
3
|
-
export declare function createApplicationFiles(host: Tree, options: NormalizedSchema): void
|
3
|
+
export declare function createApplicationFiles(host: Tree, options: NormalizedSchema): Promise<void>;
|
@@ -9,7 +9,8 @@ const get_in_source_vitest_tests_template_1 = require("../../../utils/get-in-sou
|
|
9
9
|
const maybe_js_1 = require("../../../utils/maybe-js");
|
10
10
|
const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
|
11
11
|
const get_app_tests_1 = require("./get-app-tests");
|
12
|
-
|
12
|
+
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
13
|
+
async function createApplicationFiles(host, options) {
|
13
14
|
let styleSolutionSpecificAppFiles;
|
14
15
|
if (options.styledModule && options.style !== 'styled-jsx') {
|
15
16
|
styleSolutionSpecificAppFiles = '../files/style-styled-module';
|
@@ -29,6 +30,9 @@ function createApplicationFiles(host, options) {
|
|
29
30
|
else {
|
30
31
|
styleSolutionSpecificAppFiles = '../files/style-css-module';
|
31
32
|
}
|
33
|
+
const onBoardingStatus = await (0, onboarding_1.createNxCloudOnboardingURLForWelcomeApp)(host, options.nxCloudToken);
|
34
|
+
const connectCloudUrl = onBoardingStatus === 'unclaimed' &&
|
35
|
+
(await (0, onboarding_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
|
32
36
|
const relativePathToRootTsConfig = (0, js_1.getRelativePathToRootTsConfig)(host, options.appProjectRoot);
|
33
37
|
const appTests = (0, get_app_tests_1.getAppTests)(options);
|
34
38
|
const templateVariables = {
|
@@ -114,7 +118,10 @@ function createApplicationFiles(host, options) {
|
|
114
118
|
host.delete(`${options.appProjectRoot}/src/app/${options.fileName}.spec.tsx`);
|
115
119
|
}
|
116
120
|
if (!options.minimal) {
|
117
|
-
|
121
|
+
const tutorialUrl = options.rootProject
|
122
|
+
? 'https://nx.dev/getting-started/tutorials/react-standalone-tutorial'
|
123
|
+
: 'https://nx.dev/react-tutorial/1-code-generation?utm_source=nx-project';
|
124
|
+
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/nx-welcome', onBoardingStatus), options.appProjectRoot, { ...templateVariables, connectCloudUrl, tutorialUrl });
|
118
125
|
}
|
119
126
|
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, styleSolutionSpecificAppFiles), options.appProjectRoot, templateVariables);
|
120
127
|
if (options.js) {
|
@@ -13,6 +13,7 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
13
13
|
config.target = false;
|
14
14
|
config.output.uniqueName = options.name;
|
15
15
|
config.optimization = {
|
16
|
+
...(config.optimization ?? {}),
|
16
17
|
runtimeChunk: false,
|
17
18
|
};
|
18
19
|
config.plugins.push(new (require('@module-federation/node').UniversalFederationPlugin)({
|