@nx/angular 19.6.0-canary.20240809-d3747e0 → 19.6.0-canary.20240813-c72ba9b
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +8 -8
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +4 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +6 -1
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +808 -0
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome.component.ts__tpl__ +811 -0
- package/src/generators/application/files/{ng-module → nx-welcome/not-configured/ng-module}/src/app/nx-welcome.component.ts__tpl__ +37 -66
- package/src/generators/application/files/{standalone-components → nx-welcome/not-configured/standalone}/src/app/nx-welcome.component.ts__tpl__ +39 -68
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +810 -0
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome.component.ts__tpl__ +813 -0
- package/src/generators/application/lib/create-files.js +10 -0
- package/src/generators/application/schema.d.ts +1 -0
@@ -8,6 +8,7 @@ const test_runners_1 = require("../../../utils/test-runners");
|
|
8
8
|
const selector_1 = require("../../utils/selector");
|
9
9
|
const update_project_root_tsconfig_1 = require("../../utils/update-project-root-tsconfig");
|
10
10
|
const version_utils_1 = require("../../utils/version-utils");
|
11
|
+
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
11
12
|
async function createFiles(tree, options, rootOffset) {
|
12
13
|
const { major: angularMajorVersion, version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
13
14
|
const isUsingApplicationBuilder = angularMajorVersion >= 17 && options.bundler === 'esbuild';
|
@@ -16,6 +17,9 @@ async function createFiles(tree, options, rootOffset) {
|
|
16
17
|
(0, selector_1.validateHtmlSelector)(rootSelector);
|
17
18
|
const nxWelcomeSelector = `${options.prefix}-nx-welcome`;
|
18
19
|
(0, selector_1.validateHtmlSelector)(nxWelcomeSelector);
|
20
|
+
const onBoardingStatus = await (0, onboarding_1.createNxCloudOnboardingURLForWelcomeApp)(tree, options.nxCloudToken);
|
21
|
+
const connectCloudUrl = onBoardingStatus === 'unclaimed' &&
|
22
|
+
(await (0, onboarding_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
|
19
23
|
const substitutions = {
|
20
24
|
rootSelector,
|
21
25
|
appName: options.name,
|
@@ -34,8 +38,13 @@ async function createFiles(tree, options, rootOffset) {
|
|
34
38
|
disableModernClassFieldsBehavior,
|
35
39
|
useEventCoalescing: angularMajorVersion >= 18,
|
36
40
|
useRouterTestingModule: angularMajorVersion < 18,
|
41
|
+
connectCloudUrl,
|
42
|
+
tutorialUrl: options.standalone
|
43
|
+
? 'https://nx.dev/getting-started/tutorials/angular-standalone-tutorial?utm_source=nx-project'
|
44
|
+
: 'https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx-project',
|
37
45
|
tpl: '',
|
38
46
|
};
|
47
|
+
const angularAppType = options.standalone ? 'standalone' : 'ng-module';
|
39
48
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/base'), options.appProjectRoot, substitutions);
|
40
49
|
if (angularMajorVersion >= 18) {
|
41
50
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/base-18+'), options.appProjectRoot, substitutions);
|
@@ -49,6 +58,7 @@ async function createFiles(tree, options, rootOffset) {
|
|
49
58
|
else {
|
50
59
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/ng-module'), options.appProjectRoot, substitutions);
|
51
60
|
}
|
61
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/nx-welcome', onBoardingStatus, angularAppType), options.appProjectRoot, substitutions);
|
52
62
|
(0, update_project_root_tsconfig_1.updateProjectRootTsConfig)(tree, options.appProjectRoot, (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot), options.rootProject);
|
53
63
|
if (!options.routing) {
|
54
64
|
tree.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, '/src/app/app.routes.ts'));
|