@nx/angular 0.0.0-pr-27957-a99d5ea → 0.0.0-pr-28229-afe192c
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/generators.d.ts +0 -1
- package/generators.js +0 -1
- package/generators.json +7 -13
- package/package.json +11 -11
- package/plugin.d.ts +1 -0
- package/plugin.js +5 -0
- package/src/builders/utilities/webpack.js +30 -4
- package/src/generators/application/application.d.ts +0 -1
- package/src/generators/application/application.js +0 -7
- package/src/generators/application/lib/normalize-options.js +3 -5
- package/src/generators/application/schema.d.ts +2 -4
- package/src/generators/application/schema.json +7 -12
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +0 -7
- package/src/generators/component/lib/normalize-options.js +1 -6
- package/src/generators/component/schema.d.ts +2 -18
- package/src/generators/component/schema.json +7 -28
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -7
- package/src/generators/directive/lib/normalize-options.js +1 -6
- package/src/generators/directive/schema.d.ts +2 -15
- package/src/generators/directive/schema.json +8 -29
- package/src/generators/federate-module/lib/add-remote.js +0 -3
- package/src/generators/federate-module/schema.d.ts +0 -2
- package/src/generators/federate-module/schema.json +0 -5
- package/src/generators/host/host.d.ts +1 -2
- package/src/generators/host/host.js +8 -22
- package/src/generators/host/schema.d.ts +2 -4
- package/src/generators/host/schema.json +10 -13
- package/src/generators/init/init.js +12 -0
- package/src/generators/init/schema.d.ts +3 -0
- package/src/generators/library/lib/add-standalone-component.js +3 -2
- package/src/generators/library/lib/normalize-options.js +1 -2
- package/src/generators/library/lib/normalized-schema.d.ts +2 -2
- package/src/generators/library/library.d.ts +0 -1
- package/src/generators/library/library.js +0 -9
- package/src/generators/library/schema.d.ts +2 -4
- package/src/generators/library/schema.json +7 -13
- package/src/generators/move/move.d.ts +0 -1
- package/src/generators/move/move.js +1 -8
- package/src/generators/move/schema.d.ts +0 -3
- package/src/generators/move/schema.json +0 -5
- package/src/generators/pipe/lib/normalize-options.js +1 -6
- package/src/generators/pipe/schema.d.ts +2 -15
- package/src/generators/pipe/schema.json +7 -28
- package/src/generators/remote/remote.d.ts +1 -2
- package/src/generators/remote/remote.js +3 -12
- package/src/generators/remote/schema.d.ts +2 -4
- package/src/generators/remote/schema.json +10 -13
- package/src/generators/scam/lib/normalize-options.js +1 -6
- package/src/generators/scam/scam.js +0 -2
- package/src/generators/scam/schema.d.ts +3 -15
- package/src/generators/scam/schema.json +8 -29
- package/src/generators/scam-directive/lib/normalize-options.js +1 -6
- package/src/generators/scam-directive/scam-directive.js +0 -2
- package/src/generators/scam-directive/schema.d.ts +3 -15
- package/src/generators/scam-directive/schema.json +8 -3
- package/src/generators/scam-pipe/lib/normalize-options.js +1 -6
- package/src/generators/scam-pipe/scam-pipe.js +0 -2
- package/src/generators/scam-pipe/schema.d.ts +3 -15
- package/src/generators/scam-pipe/schema.json +8 -23
- package/src/generators/stories/schema.d.ts +0 -2
- package/src/generators/stories/schema.json +0 -10
- package/src/generators/stories/stories.js +0 -19
- package/src/generators/storybook-configuration/lib/generate-stories.js +0 -6
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
- package/src/generators/storybook-configuration/schema.d.ts +0 -3
- package/src/generators/storybook-configuration/schema.json +0 -15
- package/src/generators/storybook-configuration/storybook-configuration.js +0 -3
- package/src/generators/utils/testing.js +14 -26
- package/src/plugins/plugin.d.ts +19 -0
- package/src/plugins/plugin.js +418 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -4
- package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -35
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +0 -17
- package/src/generators/component-cypress-spec/lib/get-args-default-value.d.ts +0 -2
- package/src/generators/component-cypress-spec/lib/get-args-default-value.js +0 -24
- package/src/generators/component-cypress-spec/lib/get-component-selector.d.ts +0 -2
- package/src/generators/component-cypress-spec/lib/get-component-selector.js +0 -23
- package/src/generators/component-cypress-spec/schema.d.ts +0 -10
- package/src/generators/component-cypress-spec/schema.json +0 -66
- package/src/generators/stories/lib/get-e2e-project.d.ts +0 -2
- package/src/generators/stories/lib/get-e2e-project.js +0 -14
- package/src/generators/storybook-configuration/lib/validate-options.d.ts +0 -2
- package/src/generators/storybook-configuration/lib/validate-options.js +0 -8
|
@@ -37,11 +37,6 @@
|
|
|
37
37
|
"description": "The directory of the new remote application if one needs to be created.",
|
|
38
38
|
"type": "string"
|
|
39
39
|
},
|
|
40
|
-
"projectNameAndRootFormat": {
|
|
41
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
42
|
-
"type": "string",
|
|
43
|
-
"enum": ["as-provided", "derived"]
|
|
44
|
-
},
|
|
45
40
|
"style": {
|
|
46
41
|
"description": "The file extension to be used for style files for the remote if one needs to be created.",
|
|
47
42
|
"type": "string",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function host(tree: Tree,
|
|
4
|
-
export declare function hostInternal(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
3
|
+
export declare function host(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
5
4
|
export default host;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.host = host;
|
|
4
|
-
exports.hostInternal = hostInternal;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
@@ -12,13 +11,7 @@ const setup_mf_1 = require("../setup-mf/setup-mf");
|
|
|
12
11
|
const lib_1 = require("./lib");
|
|
13
12
|
const add_mf_env_to_inputs_1 = require("../utils/add-mf-env-to-inputs");
|
|
14
13
|
const js_1 = require("@nx/js");
|
|
15
|
-
async function host(tree,
|
|
16
|
-
return await hostInternal(tree, {
|
|
17
|
-
projectNameAndRootFormat: 'derived',
|
|
18
|
-
...options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
async function hostInternal(tree, schema) {
|
|
14
|
+
async function host(tree, schema) {
|
|
22
15
|
const { typescriptConfiguration = true, ...options } = schema;
|
|
23
16
|
options.standalone = options.standalone ?? true;
|
|
24
17
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
@@ -44,14 +37,12 @@ async function hostInternal(tree, schema) {
|
|
|
44
37
|
}
|
|
45
38
|
});
|
|
46
39
|
}
|
|
47
|
-
|
|
40
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'application');
|
|
41
|
+
const { projectName: hostProjectName, projectRoot: appRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
|
|
48
42
|
name: options.name,
|
|
49
43
|
projectType: 'application',
|
|
50
44
|
directory: options.directory,
|
|
51
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
52
|
-
callingGenerator: '@nx/angular:host',
|
|
53
45
|
});
|
|
54
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
55
46
|
const appInstallTask = await (0, application_1.default)(tree, {
|
|
56
47
|
...options,
|
|
57
48
|
standalone: options.standalone,
|
|
@@ -83,16 +74,11 @@ async function hostInternal(tree, schema) {
|
|
|
83
74
|
installTasks.push(ssrInstallTask);
|
|
84
75
|
}
|
|
85
76
|
for (const remote of remotesToGenerate) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* of the host application. Append the remote name to the host parent
|
|
92
|
-
* directory to get the remote directory.
|
|
93
|
-
*/
|
|
94
|
-
remoteDirectory = (0, devkit_1.joinPathFragments)(options.directory, '..', remote);
|
|
95
|
-
}
|
|
77
|
+
const remoteDirectory = options.directory
|
|
78
|
+
? (0, devkit_1.joinPathFragments)(options.directory, '..', remote)
|
|
79
|
+
: appRoot === '.'
|
|
80
|
+
? remote
|
|
81
|
+
: (0, devkit_1.joinPathFragments)(appRoot, '..', remote);
|
|
96
82
|
await (0, remote_1.default)(tree, {
|
|
97
83
|
...options,
|
|
98
84
|
name: remote,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
2
|
import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
|
4
3
|
import type { Styles } from '../utils/types';
|
|
5
4
|
|
|
6
5
|
export interface Schema {
|
|
7
|
-
|
|
6
|
+
directory: string;
|
|
7
|
+
name?: string;
|
|
8
8
|
remotes?: string[];
|
|
9
9
|
dynamic?: boolean;
|
|
10
10
|
setParserOptionsProject?: boolean;
|
|
@@ -14,8 +14,6 @@ export interface Schema {
|
|
|
14
14
|
prefix?: string;
|
|
15
15
|
style?: Styles;
|
|
16
16
|
skipTests?: boolean;
|
|
17
|
-
directory?: string;
|
|
18
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
19
17
|
tags?: string;
|
|
20
18
|
linter?: Linter | LinterType;
|
|
21
19
|
unitTestRunner?: UnitTestRunner;
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"properties": {
|
|
15
|
-
"
|
|
15
|
+
"directory": {
|
|
16
|
+
"description": "The directory of the new application.",
|
|
16
17
|
"type": "string",
|
|
17
|
-
"description": "The name to give to the host Angular application.",
|
|
18
18
|
"$default": {
|
|
19
19
|
"$source": "argv",
|
|
20
20
|
"index": 0
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
|
23
|
+
},
|
|
24
|
+
"name": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The name to give to the host Angular application.",
|
|
27
|
+
"pattern": "^[a-zA-Z][^:]*$",
|
|
28
|
+
"x-priority": "important"
|
|
23
29
|
},
|
|
24
30
|
"remotes": {
|
|
25
31
|
"type": "array",
|
|
@@ -31,15 +37,6 @@
|
|
|
31
37
|
"description": "Should the host application use dynamic federation?",
|
|
32
38
|
"default": false
|
|
33
39
|
},
|
|
34
|
-
"directory": {
|
|
35
|
-
"description": "The directory of the new application.",
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"projectNameAndRootFormat": {
|
|
39
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"enum": ["as-provided", "derived"]
|
|
42
|
-
},
|
|
43
40
|
"style": {
|
|
44
41
|
"description": "The file extension to be used for style files.",
|
|
45
42
|
"type": "string",
|
|
@@ -181,5 +178,5 @@
|
|
|
181
178
|
}
|
|
182
179
|
},
|
|
183
180
|
"additionalProperties": false,
|
|
184
|
-
"required": ["
|
|
181
|
+
"required": ["directory"]
|
|
185
182
|
}
|
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularInitGenerator = angularInitGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
5
6
|
const version_utils_1 = require("../utils/version-utils");
|
|
7
|
+
const plugin_1 = require("../../plugins/plugin");
|
|
6
8
|
async function angularInitGenerator(tree, options) {
|
|
7
9
|
ignoreAngularCacheDirectory(tree);
|
|
8
10
|
const installTask = installAngularDevkitCoreIfMissing(tree, options);
|
|
11
|
+
// For Angular inference plugin, we only want it during import since our
|
|
12
|
+
// generators do not use `angular.json`, and `nx init` should split
|
|
13
|
+
// `angular.json` into multiple `project.json` files -- as this is preferred
|
|
14
|
+
// by most folks we've talked to.
|
|
15
|
+
options.addPlugin ??= process.env.NX_RUNNING_NX_IMPORT === 'true';
|
|
16
|
+
if (options.addPlugin) {
|
|
17
|
+
await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/angular/plugin', plugin_1.createNodesV2, {
|
|
18
|
+
targetNamePrefix: ['', 'angular:', 'angular-'],
|
|
19
|
+
}, options.updatePackageScripts);
|
|
20
|
+
}
|
|
9
21
|
if (!options.skipFormat) {
|
|
10
22
|
await (0, devkit_1.formatFiles)(tree);
|
|
11
23
|
}
|
|
@@ -9,8 +9,9 @@ async function addStandaloneComponent(tree, { libraryOptions, componentOptions }
|
|
|
9
9
|
await (0, component_1.componentGenerator)(tree, {
|
|
10
10
|
...componentOptions,
|
|
11
11
|
name: componentOptions.name,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
path: (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, 'src', 'lib', componentOptions.flat
|
|
13
|
+
? `${componentOptions.name}`
|
|
14
|
+
: `${componentOptions.name}/${componentOptions.name}`),
|
|
14
15
|
standalone: true,
|
|
15
16
|
export: true,
|
|
16
17
|
skipFormat: true,
|
|
@@ -22,13 +22,12 @@ async function normalizeOptions(host, schema) {
|
|
|
22
22
|
skipModule: schema.skipModule || schema.standalone,
|
|
23
23
|
...schema,
|
|
24
24
|
};
|
|
25
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'library');
|
|
25
26
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
26
27
|
name: options.name,
|
|
27
28
|
projectType: 'library',
|
|
28
29
|
directory: options.directory,
|
|
29
30
|
importPath: options.importPath,
|
|
30
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
31
|
-
callingGenerator: '@nx/angular:library',
|
|
32
31
|
});
|
|
33
32
|
const fileName = options.simpleName
|
|
34
33
|
? projectNames.projectSimpleName
|
|
@@ -2,12 +2,12 @@ import { UnitTestRunner } from '../../../utils/test-runners';
|
|
|
2
2
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
3
|
export interface NormalizedSchema {
|
|
4
4
|
libraryOptions: {
|
|
5
|
-
|
|
5
|
+
directory: string;
|
|
6
|
+
name?: string;
|
|
6
7
|
addTailwind?: boolean;
|
|
7
8
|
skipFormat?: boolean;
|
|
8
9
|
simpleName?: boolean;
|
|
9
10
|
addModuleSpec?: boolean;
|
|
10
|
-
directory?: string;
|
|
11
11
|
sourceDir?: string;
|
|
12
12
|
buildable?: boolean;
|
|
13
13
|
publishable?: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function libraryGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
-
export declare function libraryGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
4
|
export default libraryGenerator;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.libraryGenerator = libraryGenerator;
|
|
4
|
-
exports.libraryGeneratorInternal = libraryGeneratorInternal;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const eslint_1 = require("@nx/eslint");
|
|
@@ -24,14 +23,6 @@ const set_generator_defaults_1 = require("./lib/set-generator-defaults");
|
|
|
24
23
|
const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependencies");
|
|
25
24
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
26
25
|
async function libraryGenerator(tree, schema) {
|
|
27
|
-
return await libraryGeneratorInternal(tree, {
|
|
28
|
-
// provide a default projectNameAndRootFormat to avoid breaking changes
|
|
29
|
-
// to external generators invoking this one
|
|
30
|
-
projectNameAndRootFormat: 'derived',
|
|
31
|
-
...schema,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
async function libraryGeneratorInternal(tree, schema) {
|
|
35
26
|
// Do some validation checks
|
|
36
27
|
if (!schema.routing && schema.lazy) {
|
|
37
28
|
throw new Error(`To use "--lazy" option, "--routing" must also be set.`);
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
2
|
import type { UnitTestRunner } from '../../utils/test-runners';
|
|
4
3
|
|
|
5
4
|
export interface Schema {
|
|
6
|
-
|
|
5
|
+
directory: string;
|
|
6
|
+
name?: string;
|
|
7
7
|
addTailwind?: boolean;
|
|
8
8
|
skipFormat?: boolean;
|
|
9
9
|
simpleName?: boolean;
|
|
10
10
|
addModuleSpec?: boolean;
|
|
11
|
-
directory?: string;
|
|
12
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
13
11
|
sourceDir?: string;
|
|
14
12
|
buildable?: boolean;
|
|
15
13
|
publishable?: boolean;
|
|
@@ -9,22 +9,16 @@
|
|
|
9
9
|
"name": {
|
|
10
10
|
"type": "string",
|
|
11
11
|
"description": "The name of the library.",
|
|
12
|
-
"
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What name would you like to use for the library?",
|
|
17
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
|
|
12
|
+
"x-priority": "important"
|
|
18
13
|
},
|
|
19
14
|
"directory": {
|
|
20
15
|
"type": "string",
|
|
21
16
|
"description": "A directory where the library is placed.",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"enum": ["as-provided", "derived"]
|
|
17
|
+
"$default": {
|
|
18
|
+
"$source": "argv",
|
|
19
|
+
"index": 0
|
|
20
|
+
},
|
|
21
|
+
"x-prompt": "Which directory do you want to create the library in?"
|
|
28
22
|
},
|
|
29
23
|
"publishable": {
|
|
30
24
|
"type": "boolean",
|
|
@@ -203,6 +197,6 @@
|
|
|
203
197
|
}
|
|
204
198
|
},
|
|
205
199
|
"additionalProperties": false,
|
|
206
|
-
"required": ["
|
|
200
|
+
"required": ["directory"],
|
|
207
201
|
"examplesFile": "../../../docs/library-examples.md"
|
|
208
202
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularMoveGenerator = angularMoveGenerator;
|
|
4
|
-
exports.angularMoveGeneratorInternal = angularMoveGeneratorInternal;
|
|
5
4
|
const move_1 = require("@nx/workspace/src/generators/move/move");
|
|
6
5
|
async function angularMoveGenerator(tree, schema) {
|
|
7
|
-
await angularMoveGeneratorInternal(tree, {
|
|
8
|
-
projectNameAndRootFormat: 'derived',
|
|
9
|
-
...schema,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
async function angularMoveGeneratorInternal(tree, schema) {
|
|
13
6
|
process.env.NX_ANGULAR_MOVE_INVOKED = 'true';
|
|
14
|
-
await (0, move_1.
|
|
7
|
+
await (0, move_1.moveGenerator)(tree, schema);
|
|
15
8
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
|
-
|
|
3
1
|
export interface Schema {
|
|
4
2
|
projectName: string;
|
|
5
3
|
destination: string;
|
|
@@ -7,5 +5,4 @@ export interface Schema {
|
|
|
7
5
|
importPath?: string;
|
|
8
6
|
skipFormat?: boolean;
|
|
9
7
|
newProjectName?: string;
|
|
10
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
11
8
|
}
|
|
@@ -35,11 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"x-priority": "important"
|
|
37
37
|
},
|
|
38
|
-
"projectNameAndRootFormat": {
|
|
39
|
-
"description": "Whether to generate the new project name and destination as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"enum": ["as-provided", "derived"]
|
|
42
|
-
},
|
|
43
38
|
"importPath": {
|
|
44
39
|
"type": "string",
|
|
45
40
|
"description": "The new import path to use in the `tsconfig.base.json`."
|
|
@@ -5,13 +5,8 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
async function normalizeOptions(tree, options) {
|
|
7
7
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
8
|
-
artifactType: 'pipe',
|
|
9
|
-
callingGenerator: '@nx/angular:pipe',
|
|
10
8
|
name: options.name,
|
|
11
|
-
|
|
12
|
-
flat: options.flat,
|
|
13
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
14
|
-
project: options.project,
|
|
9
|
+
path: options.path,
|
|
15
10
|
suffix: 'pipe',
|
|
16
11
|
});
|
|
17
12
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
4
|
+
path: string;
|
|
5
|
+
name?: string;
|
|
7
6
|
skipTests?: boolean;
|
|
8
7
|
skipImport?: boolean;
|
|
9
8
|
standalone?: boolean;
|
|
10
9
|
module?: string;
|
|
11
10
|
export?: boolean;
|
|
12
11
|
skipFormat?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
15
|
-
*/
|
|
16
|
-
flat?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
19
|
-
*/
|
|
20
|
-
path?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
23
|
-
*/
|
|
24
|
-
project?: string;
|
|
25
12
|
}
|
|
26
13
|
|
|
27
14
|
export interface NormalizedSchema extends Schema {
|
|
@@ -7,40 +7,19 @@
|
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"description": "Creates an Angular pipe.",
|
|
9
9
|
"properties": {
|
|
10
|
-
"
|
|
10
|
+
"path": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"description": "The
|
|
12
|
+
"description": "The path at which to create the pipe file, relative to the workspace root.",
|
|
13
13
|
"$default": {
|
|
14
14
|
"$source": "argv",
|
|
15
15
|
"index": 0
|
|
16
16
|
},
|
|
17
|
-
"x-prompt": "What
|
|
18
|
-
},
|
|
19
|
-
"directory": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The directory at which to create the pipe file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
22
|
-
"aliases": ["dir", "path"],
|
|
23
|
-
"x-priority": "important"
|
|
24
|
-
},
|
|
25
|
-
"nameAndDirectoryFormat": {
|
|
26
|
-
"description": "Whether to generate the pipe in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
|
|
27
|
-
"type": "string",
|
|
28
|
-
"enum": ["as-provided", "derived"]
|
|
17
|
+
"x-prompt": "What is the path of the new pipe?"
|
|
29
18
|
},
|
|
30
|
-
"
|
|
19
|
+
"name": {
|
|
31
20
|
"type": "string",
|
|
32
|
-
"description": "The name of the
|
|
33
|
-
"
|
|
34
|
-
"$source": "projectName"
|
|
35
|
-
},
|
|
36
|
-
"x-dropdown": "projects",
|
|
37
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
|
|
38
|
-
},
|
|
39
|
-
"flat": {
|
|
40
|
-
"type": "boolean",
|
|
41
|
-
"default": true,
|
|
42
|
-
"description": "When true (the default) creates files at the top level of the project.",
|
|
43
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
21
|
+
"description": "The name of the pipe.",
|
|
22
|
+
"x-prompt": "What name would you like to use for the pipe?"
|
|
44
23
|
},
|
|
45
24
|
"skipTests": {
|
|
46
25
|
"type": "boolean",
|
|
@@ -73,5 +52,5 @@
|
|
|
73
52
|
"description": "Skip formatting of files."
|
|
74
53
|
}
|
|
75
54
|
},
|
|
76
|
-
"required": ["
|
|
55
|
+
"required": ["path"]
|
|
77
56
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function remote(tree: Tree,
|
|
4
|
-
export declare function remoteInternal(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
3
|
+
export declare function remote(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
5
4
|
export default remote;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.remote = remote;
|
|
4
|
-
exports.remoteInternal = remoteInternal;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
6
|
const test_runners_1 = require("../../utils/test-runners");
|
|
@@ -10,27 +9,19 @@ const setup_mf_1 = require("../setup-mf/setup-mf");
|
|
|
10
9
|
const lib_1 = require("./lib");
|
|
11
10
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
12
11
|
const add_mf_env_to_inputs_1 = require("../utils/add-mf-env-to-inputs");
|
|
13
|
-
async function remote(tree,
|
|
14
|
-
return await remoteInternal(tree, {
|
|
15
|
-
projectNameAndRootFormat: 'derived',
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
async function remoteInternal(tree, schema) {
|
|
12
|
+
async function remote(tree, schema) {
|
|
20
13
|
const { typescriptConfiguration = true, ...options } = schema;
|
|
21
14
|
options.standalone = options.standalone ?? true;
|
|
22
15
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
23
16
|
if (options.host && !projects.has(options.host)) {
|
|
24
17
|
throw new Error(`The name of the application to be used as the host app does not exist. (${options.host})`);
|
|
25
18
|
}
|
|
26
|
-
|
|
19
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'application');
|
|
20
|
+
const { projectName: remoteProjectName } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
|
|
27
21
|
name: options.name,
|
|
28
22
|
projectType: 'application',
|
|
29
23
|
directory: options.directory,
|
|
30
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
31
|
-
callingGenerator: '@nx/angular:remote',
|
|
32
24
|
});
|
|
33
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
34
25
|
const port = options.port ?? (0, lib_1.findNextAvailablePort)(tree);
|
|
35
26
|
const appInstallTask = await (0, application_1.applicationGenerator)(tree, {
|
|
36
27
|
...options,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
2
|
import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
|
4
3
|
import type { Styles } from '../utils/types';
|
|
5
4
|
|
|
6
5
|
export interface Schema {
|
|
7
|
-
|
|
6
|
+
directory: string;
|
|
7
|
+
name?: string;
|
|
8
8
|
host?: string;
|
|
9
9
|
port?: number;
|
|
10
10
|
setParserOptionsProject?: boolean;
|
|
@@ -13,8 +13,6 @@ export interface Schema {
|
|
|
13
13
|
prefix?: string;
|
|
14
14
|
style?: Styles;
|
|
15
15
|
skipTests?: boolean;
|
|
16
|
-
directory?: string;
|
|
17
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
18
16
|
tags?: string;
|
|
19
17
|
linter?: Linter | LinterType;
|
|
20
18
|
unitTestRunner?: UnitTestRunner;
|
|
@@ -12,14 +12,20 @@
|
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"properties": {
|
|
15
|
-
"
|
|
15
|
+
"directory": {
|
|
16
|
+
"description": "The directory of the new application.",
|
|
16
17
|
"type": "string",
|
|
17
|
-
"description": "The name to give to the remote Angular app.",
|
|
18
18
|
"$default": {
|
|
19
19
|
"$source": "argv",
|
|
20
20
|
"index": 0
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
|
23
|
+
},
|
|
24
|
+
"name": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The name to give to the remote Angular app.",
|
|
27
|
+
"pattern": "^[a-zA-Z][^:]*$",
|
|
28
|
+
"x-priority": "important"
|
|
23
29
|
},
|
|
24
30
|
"host": {
|
|
25
31
|
"type": "string",
|
|
@@ -31,15 +37,6 @@
|
|
|
31
37
|
"type": "number",
|
|
32
38
|
"description": "The port on which this app should be served."
|
|
33
39
|
},
|
|
34
|
-
"directory": {
|
|
35
|
-
"description": "The directory of the new application.",
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"projectNameAndRootFormat": {
|
|
39
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"enum": ["as-provided", "derived"]
|
|
42
|
-
},
|
|
43
40
|
"style": {
|
|
44
41
|
"description": "The file extension to be used for style files.",
|
|
45
42
|
"type": "string",
|
|
@@ -174,5 +171,5 @@
|
|
|
174
171
|
}
|
|
175
172
|
},
|
|
176
173
|
"additionalProperties": false,
|
|
177
|
-
"required": ["
|
|
174
|
+
"required": ["directory"]
|
|
178
175
|
}
|
|
@@ -6,13 +6,8 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
async function normalizeOptions(tree, options) {
|
|
7
7
|
options.type ??= 'component';
|
|
8
8
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
9
|
-
artifactType: options.type,
|
|
10
|
-
callingGenerator: '@nx/angular:scam',
|
|
11
9
|
name: options.name,
|
|
12
|
-
|
|
13
|
-
flat: options.flat,
|
|
14
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
15
|
-
project: options.project,
|
|
10
|
+
path: options.path,
|
|
16
11
|
suffix: options.type ?? 'component',
|
|
17
12
|
});
|
|
18
13
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -13,8 +13,6 @@ async function scamGenerator(tree, rawOptions) {
|
|
|
13
13
|
export: false,
|
|
14
14
|
standalone: false,
|
|
15
15
|
skipFormat: true,
|
|
16
|
-
// options are already normalize, use them as is
|
|
17
|
-
nameAndDirectoryFormat: 'as-provided',
|
|
18
16
|
});
|
|
19
17
|
(0, lib_1.convertComponentToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
4
|
+
path: string;
|
|
5
|
+
name?: string;
|
|
7
6
|
displayBlock?: boolean;
|
|
8
7
|
inlineStyle?: boolean;
|
|
9
8
|
inlineTemplate?: boolean;
|
|
@@ -18,21 +17,10 @@ export interface Schema {
|
|
|
18
17
|
skipSelector?: boolean;
|
|
19
18
|
export?: boolean;
|
|
20
19
|
skipFormat?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
23
|
-
*/
|
|
24
|
-
flat?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
27
|
-
*/
|
|
28
|
-
path?: string;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
31
|
-
*/
|
|
32
|
-
project?: string;
|
|
33
20
|
}
|
|
34
21
|
|
|
35
22
|
export interface NormalizedSchema extends Schema {
|
|
23
|
+
name: string;
|
|
36
24
|
directory: string;
|
|
37
25
|
projectName: string;
|
|
38
26
|
fileName: string;
|