@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.
@@ -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
- function createApplicationFiles(host, options) {
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
- (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/nx-welcome'), options.appProjectRoot, templateVariables);
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) {
@@ -29,6 +29,7 @@ export interface Schema {
29
29
  bundler?: 'webpack' | 'vite' | 'rspack';
30
30
  minimal?: boolean;
31
31
  addPlugin?: boolean;
32
+ nxCloudToken?: string;
32
33
  }
33
34
 
34
35
  export interface NormalizedSchema<T extends Schema = Schema> extends T {
@@ -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)({
@@ -21,6 +21,7 @@ async function withModuleFederation(options, configOverride) {
21
21
  config.output.scriptType = 'text/javascript';
22
22
  }
23
23
  config.optimization = {
24
+ ...(config.optimization ?? {}),
24
25
  runtimeChunk: false,
25
26
  };
26
27
  if (config.mode === 'development' &&