@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
|
@@ -6,41 +6,26 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"command": "nx g @nx/angular:scam my-
|
|
9
|
+
"command": "nx g @nx/angular:scam my-lib/src/lib/my-sample/my-sample",
|
|
10
10
|
"description": "Generate a `MySampleComponent` component in the `my-lib` library."
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
13
|
"description": "Creates a new Angular SCAM.",
|
|
14
14
|
"additionalProperties": false,
|
|
15
15
|
"properties": {
|
|
16
|
-
"
|
|
16
|
+
"path": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
18
|
+
"description": "The path at which to create the SCAM file, relative to the workspace root.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 0
|
|
22
22
|
},
|
|
23
|
-
"x-prompt": "What
|
|
24
|
-
},
|
|
25
|
-
"directory": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "The directory at which to create the SCAM files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
28
|
-
"aliases": ["dir", "path"],
|
|
29
|
-
"x-priority": "important"
|
|
30
|
-
},
|
|
31
|
-
"nameAndDirectoryFormat": {
|
|
32
|
-
"description": "Whether to generate the SCAM 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`).",
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": ["as-provided", "derived"]
|
|
23
|
+
"x-prompt": "What is the path of the new SCAM?"
|
|
35
24
|
},
|
|
36
|
-
"
|
|
25
|
+
"name": {
|
|
37
26
|
"type": "string",
|
|
38
|
-
"description": "The name of the
|
|
39
|
-
"
|
|
40
|
-
"$source": "projectName"
|
|
41
|
-
},
|
|
42
|
-
"x-dropdown": "projects",
|
|
43
|
-
"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."
|
|
27
|
+
"description": "The name of the component.",
|
|
28
|
+
"x-prompt": "What name would you like to use for the component?"
|
|
44
29
|
},
|
|
45
30
|
"displayBlock": {
|
|
46
31
|
"description": "Specifies if the style will contain `:host { display: block; }`.",
|
|
@@ -90,12 +75,6 @@
|
|
|
90
75
|
"default": true,
|
|
91
76
|
"x-priority": "important"
|
|
92
77
|
},
|
|
93
|
-
"flat": {
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"description": "Create the new files at the top level of the current project.",
|
|
96
|
-
"default": false,
|
|
97
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
98
|
-
},
|
|
99
78
|
"selector": {
|
|
100
79
|
"type": "string",
|
|
101
80
|
"format": "html-selector",
|
|
@@ -138,5 +117,5 @@
|
|
|
138
117
|
"x-priority": "internal"
|
|
139
118
|
}
|
|
140
119
|
},
|
|
141
|
-
"required": ["
|
|
120
|
+
"required": ["path"]
|
|
142
121
|
}
|
|
@@ -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: 'directive',
|
|
9
|
-
callingGenerator: '@nx/angular:scam-directive',
|
|
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: 'directive',
|
|
16
11
|
});
|
|
17
12
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -13,8 +13,6 @@ async function scamDirectiveGenerator(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.convertDirectiveToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,30 +1,18 @@
|
|
|
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
|
inlineScam?: boolean;
|
|
9
8
|
prefix?: string;
|
|
10
9
|
selector?: 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 {
|
|
15
|
+
name: string;
|
|
28
16
|
directory: string;
|
|
29
17
|
export: boolean;
|
|
30
18
|
fileName: string;
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
"description": "Creates a new, generic Angular directive definition in the given or default project.",
|
|
14
14
|
"additionalProperties": false,
|
|
15
15
|
"properties": {
|
|
16
|
-
"
|
|
16
|
+
"path": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
18
|
+
"description": "The path at which to create the SCAM Directive files, relative to the workspace root.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 0
|
|
22
22
|
},
|
|
23
|
+
"x-prompt": "What is the path of the new directive?"
|
|
24
|
+
},
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The name of the directive.",
|
|
23
28
|
"x-prompt": "What name would you like to use for the directive?",
|
|
24
29
|
"x-priority": "important"
|
|
25
30
|
},
|
|
@@ -92,5 +97,5 @@
|
|
|
92
97
|
"x-priority": "internal"
|
|
93
98
|
}
|
|
94
99
|
},
|
|
95
|
-
"required": ["
|
|
100
|
+
"required": ["path"]
|
|
96
101
|
}
|
|
@@ -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:scam-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);
|
|
@@ -13,8 +13,6 @@ async function scamPipeGenerator(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.convertPipeToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,28 +1,16 @@
|
|
|
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
|
inlineScam?: boolean;
|
|
9
8
|
export?: boolean;
|
|
10
9
|
skipFormat?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
13
|
-
*/
|
|
14
|
-
flat?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
17
|
-
*/
|
|
18
|
-
path?: string;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
21
|
-
*/
|
|
22
|
-
project?: string;
|
|
23
10
|
}
|
|
24
11
|
|
|
25
12
|
export interface NormalizedSchema extends Schema {
|
|
13
|
+
name: string;
|
|
26
14
|
directory: string;
|
|
27
15
|
export: boolean;
|
|
28
16
|
fileName: string;
|
|
@@ -6,43 +6,28 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"command": "nx g @nx/angular:scam-pipe
|
|
9
|
+
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/my-transformation/my-transformation",
|
|
10
10
|
"description": "Generates a `MyTransformationPipe` in a `my-transformation` folder in the `my-lib` project"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
13
|
"description": "Creates a new, generic Angular pipe definition in the given or default project.",
|
|
14
14
|
"additionalProperties": false,
|
|
15
15
|
"properties": {
|
|
16
|
-
"
|
|
16
|
+
"path": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
18
|
+
"description": "The path at which to create the pipe file, relative to the workspace root.",
|
|
19
19
|
"$default": {
|
|
20
20
|
"$source": "argv",
|
|
21
21
|
"index": 0
|
|
22
22
|
},
|
|
23
|
-
"x-prompt": "What
|
|
24
|
-
"x-priority": "important"
|
|
23
|
+
"x-prompt": "What is the path of the new pipe?"
|
|
25
24
|
},
|
|
26
|
-
"
|
|
25
|
+
"name": {
|
|
27
26
|
"type": "string",
|
|
28
|
-
"description": "The
|
|
29
|
-
"
|
|
27
|
+
"description": "The name of the pipe.",
|
|
28
|
+
"x-prompt": "What name would you like to use for the pipe?",
|
|
30
29
|
"x-priority": "important"
|
|
31
30
|
},
|
|
32
|
-
"nameAndDirectoryFormat": {
|
|
33
|
-
"description": "Whether to generate the component 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`).",
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": ["as-provided", "derived"]
|
|
36
|
-
},
|
|
37
|
-
"project": {
|
|
38
|
-
"type": "string",
|
|
39
|
-
"description": "The name of the project.",
|
|
40
|
-
"$default": {
|
|
41
|
-
"$source": "projectName"
|
|
42
|
-
},
|
|
43
|
-
"x-dropdown": "projects",
|
|
44
|
-
"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."
|
|
45
|
-
},
|
|
46
31
|
"skipTests": {
|
|
47
32
|
"type": "boolean",
|
|
48
33
|
"description": "Do not create `spec.ts` test files for the new pipe.",
|
|
@@ -73,5 +58,5 @@
|
|
|
73
58
|
"x-priority": "internal"
|
|
74
59
|
}
|
|
75
60
|
},
|
|
76
|
-
"required": ["
|
|
61
|
+
"required": ["path"]
|
|
77
62
|
}
|
|
@@ -25,16 +25,6 @@
|
|
|
25
25
|
"x-priority": "important",
|
|
26
26
|
"default": true
|
|
27
27
|
},
|
|
28
|
-
"generateCypressSpecs": {
|
|
29
|
-
"type": "boolean",
|
|
30
|
-
"description": "Specifies whether to automatically generate `*.spec.ts` files in the Cypress e2e app generated by the `cypress-configure` generator.",
|
|
31
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
32
|
-
},
|
|
33
|
-
"cypressProject": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"description": "The Cypress project to generate the stories under. This is inferred from `name` by default.",
|
|
36
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
37
|
-
},
|
|
38
28
|
"skipFormat": {
|
|
39
29
|
"description": "Skip formatting files.",
|
|
40
30
|
"type": "boolean",
|
|
@@ -3,26 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.angularStoriesGenerator = angularStoriesGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const component_cypress_spec_1 = tslib_1.__importDefault(require("../component-cypress-spec/component-cypress-spec"));
|
|
7
6
|
const component_story_1 = tslib_1.__importDefault(require("../component-story/component-story"));
|
|
8
7
|
const component_info_1 = require("../utils/storybook-ast/component-info");
|
|
9
8
|
const entry_point_1 = require("../utils/storybook-ast/entry-point");
|
|
10
|
-
const get_e2e_project_1 = require("./lib/get-e2e-project");
|
|
11
9
|
const module_info_1 = require("../utils/storybook-ast/module-info");
|
|
12
10
|
const minimatch_1 = require("minimatch");
|
|
13
11
|
const versions_1 = require("../../utils/versions");
|
|
14
12
|
async function angularStoriesGenerator(tree, options) {
|
|
15
|
-
const e2eProjectName = options.cypressProject ?? `${options.name}-e2e`;
|
|
16
|
-
const e2eProject = (0, get_e2e_project_1.getE2EProject)(tree, e2eProjectName);
|
|
17
13
|
const entryPoints = (0, entry_point_1.getProjectEntryPoints)(tree, options.name);
|
|
18
14
|
const componentsInfo = [];
|
|
19
15
|
for (const entryPoint of entryPoints) {
|
|
20
16
|
const moduleFilePaths = (0, module_info_1.getModuleFilePaths)(tree, entryPoint);
|
|
21
17
|
componentsInfo.push(...(0, component_info_1.getComponentsInfo)(tree, entryPoint, moduleFilePaths, options.name), ...(0, component_info_1.getStandaloneComponentsInfo)(tree, entryPoint));
|
|
22
18
|
}
|
|
23
|
-
if (options.generateCypressSpecs && !e2eProject) {
|
|
24
|
-
devkit_1.logger.info(`There was no e2e project "${e2eProjectName}" found, so cypress specs will not be generated. Pass "--cypressProject" to specify a different e2e project name.`);
|
|
25
|
-
}
|
|
26
19
|
const componentInfos = componentsInfo.filter((f) => !options.ignorePaths?.some((pattern) => {
|
|
27
20
|
const shouldIgnorePath = (0, minimatch_1.minimatch)((0, devkit_1.joinPathFragments)(f.moduleFolderPath, f.path, `${f.componentFileName}.ts`), pattern);
|
|
28
21
|
return shouldIgnorePath;
|
|
@@ -39,18 +32,6 @@ async function angularStoriesGenerator(tree, options) {
|
|
|
39
32
|
interactionTests: options.interactionTests ?? true,
|
|
40
33
|
skipFormat: true,
|
|
41
34
|
});
|
|
42
|
-
if (options.generateCypressSpecs && e2eProject) {
|
|
43
|
-
await (0, component_cypress_spec_1.default)(tree, {
|
|
44
|
-
projectName: options.name,
|
|
45
|
-
projectPath: info.moduleFolderPath,
|
|
46
|
-
cypressProject: options.cypressProject,
|
|
47
|
-
componentName: info.name,
|
|
48
|
-
componentPath: info.path,
|
|
49
|
-
componentFileName: info.componentFileName,
|
|
50
|
-
specDirectory: (0, devkit_1.joinPathFragments)(info.entryPointName, info.path),
|
|
51
|
-
skipFormat: true,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
35
|
}
|
|
55
36
|
const tasks = [];
|
|
56
37
|
if (options.interactionTests) {
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateStories = generateStories;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const versions_1 = require("../../../utils/versions");
|
|
6
5
|
const stories_1 = require("../../stories/stories");
|
|
7
6
|
async function generateStories(tree, options) {
|
|
8
7
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
|
-
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
10
|
-
const { getE2eProjectName } = require('@nx/cypress/src/utils/project-name');
|
|
11
|
-
const e2eProjectName = getE2eProjectName(options.project, project.root, options.cypressDirectory);
|
|
12
8
|
await (0, stories_1.angularStoriesGenerator)(tree, {
|
|
13
9
|
name: options.project,
|
|
14
|
-
generateCypressSpecs: options.configureCypress && options.generateCypressSpecs,
|
|
15
|
-
cypressProject: e2eProjectName,
|
|
16
10
|
ignorePaths: options.ignorePaths,
|
|
17
11
|
interactionTests: options.interactionTests,
|
|
18
12
|
skipFormat: true,
|
|
@@ -8,9 +8,7 @@ async function generateStorybookConfiguration(tree, options) {
|
|
|
8
8
|
return await configurationGenerator(tree, {
|
|
9
9
|
project: options.project,
|
|
10
10
|
uiFramework: '@storybook/angular',
|
|
11
|
-
configureCypress: options.configureCypress,
|
|
12
11
|
linter: options.linter,
|
|
13
|
-
cypressDirectory: options.cypressDirectory,
|
|
14
12
|
tsConfiguration: options.tsConfiguration,
|
|
15
13
|
interactionTests: options.interactionTests,
|
|
16
14
|
configureStaticServe: options.configureStaticServe,
|
|
@@ -26,11 +26,6 @@
|
|
|
26
26
|
"x-priority": "important",
|
|
27
27
|
"default": true
|
|
28
28
|
},
|
|
29
|
-
"configureCypress": {
|
|
30
|
-
"type": "boolean",
|
|
31
|
-
"description": "Specifies whether to configure Cypress or not.",
|
|
32
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
33
|
-
},
|
|
34
29
|
"generateStories": {
|
|
35
30
|
"type": "boolean",
|
|
36
31
|
"description": "Specifies whether to automatically generate `*.stories.ts` files for components declared in this project or not.",
|
|
@@ -38,11 +33,6 @@
|
|
|
38
33
|
"default": true,
|
|
39
34
|
"x-priority": "important"
|
|
40
35
|
},
|
|
41
|
-
"generateCypressSpecs": {
|
|
42
|
-
"type": "boolean",
|
|
43
|
-
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
|
44
|
-
"x-deprecated": "Use interactionTests instead. This option will be removed in v20."
|
|
45
|
-
},
|
|
46
36
|
"configureStaticServe": {
|
|
47
37
|
"type": "boolean",
|
|
48
38
|
"description": "Specifies whether to configure a static file server target for serving storybook. Helpful for speeding up CI build/test times.",
|
|
@@ -50,11 +40,6 @@
|
|
|
50
40
|
"default": true,
|
|
51
41
|
"x-priority": "important"
|
|
52
42
|
},
|
|
53
|
-
"cypressDirectory": {
|
|
54
|
-
"type": "string",
|
|
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 v20."
|
|
57
|
-
},
|
|
58
43
|
"linter": {
|
|
59
44
|
"description": "The tool to use for running lint checks.",
|
|
60
45
|
"type": "string",
|
|
@@ -6,11 +6,8 @@ const update_app_editor_tsconfig_excluded_files_1 = require("../utils/update-app
|
|
|
6
6
|
const assert_compatible_storybook_version_1 = require("./lib/assert-compatible-storybook-version");
|
|
7
7
|
const generate_stories_1 = require("./lib/generate-stories");
|
|
8
8
|
const generate_storybook_configuration_1 = require("./lib/generate-storybook-configuration");
|
|
9
|
-
const validate_options_1 = require("./lib/validate-options");
|
|
10
|
-
// TODO(katerina): Nx 19 -> remove Cypress
|
|
11
9
|
async function storybookConfigurationGenerator(tree, options) {
|
|
12
10
|
(0, assert_compatible_storybook_version_1.assertCompatibleStorybookVersion)();
|
|
13
|
-
(0, validate_options_1.validateOptions)(options);
|
|
14
11
|
const storybookGeneratorInstallTask = await (0, generate_storybook_configuration_1.generateStorybookConfiguration)(tree, {
|
|
15
12
|
...options,
|
|
16
13
|
interactionTests: options.interactionTests ?? true, // default is true
|
|
@@ -17,22 +17,20 @@ const remote_1 = require("../remote/remote");
|
|
|
17
17
|
async function generateTestApplication(tree, options) {
|
|
18
18
|
tree.write('.gitignore', '');
|
|
19
19
|
await (0, application_1.applicationGenerator)(tree, {
|
|
20
|
-
projectNameAndRootFormat: 'as-provided',
|
|
21
20
|
...options,
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
async function generateTestHostApplication(tree, options) {
|
|
25
24
|
tree.write('.gitignore', '');
|
|
26
|
-
await (0, host_1.host)(tree, {
|
|
25
|
+
await (0, host_1.host)(tree, { ...options });
|
|
27
26
|
}
|
|
28
27
|
async function generateTestRemoteApplication(tree, options) {
|
|
29
28
|
tree.write('.gitignore', '');
|
|
30
|
-
await (0, remote_1.remote)(tree, {
|
|
29
|
+
await (0, remote_1.remote)(tree, { ...options });
|
|
31
30
|
}
|
|
32
31
|
async function generateTestLibrary(tree, options) {
|
|
33
32
|
tree.write('.gitignore', '');
|
|
34
33
|
await (0, library_1.libraryGenerator)(tree, {
|
|
35
|
-
projectNameAndRootFormat: 'as-provided',
|
|
36
34
|
...options,
|
|
37
35
|
});
|
|
38
36
|
}
|
|
@@ -40,19 +38,18 @@ async function createStorybookTestWorkspaceForLib(libName) {
|
|
|
40
38
|
let tree = (0, testing_1.createTreeWithEmptyWorkspace)({ layout: 'apps-libs' });
|
|
41
39
|
tree.write('.gitignore', '');
|
|
42
40
|
await (0, library_1.libraryGenerator)(tree, {
|
|
43
|
-
|
|
41
|
+
directory: libName,
|
|
44
42
|
buildable: false,
|
|
45
43
|
linter: eslint_1.Linter.EsLint,
|
|
46
44
|
publishable: false,
|
|
47
45
|
simpleName: false,
|
|
48
46
|
skipFormat: true,
|
|
49
47
|
unitTestRunner: test_runners_1.UnitTestRunner.Jest,
|
|
50
|
-
projectNameAndRootFormat: 'as-provided',
|
|
51
48
|
standalone: false,
|
|
52
49
|
});
|
|
53
50
|
await (0, component_1.componentGenerator)(tree, {
|
|
54
51
|
name: 'test-button',
|
|
55
|
-
|
|
52
|
+
path: `${libName}/src/lib/test-button/test-button`,
|
|
56
53
|
standalone: false,
|
|
57
54
|
skipFormat: true,
|
|
58
55
|
});
|
|
@@ -82,8 +79,7 @@ export class TestButtonComponent {
|
|
|
82
79
|
});
|
|
83
80
|
await (0, component_1.componentGenerator)(tree, {
|
|
84
81
|
name: 'barrel-button',
|
|
85
|
-
|
|
86
|
-
path: `${libName}/src/lib/barrel`,
|
|
82
|
+
path: `${libName}/src/lib/barrel/barrel-button/barrel-button`,
|
|
87
83
|
module: 'barrel',
|
|
88
84
|
standalone: false,
|
|
89
85
|
skipFormat: true,
|
|
@@ -105,16 +101,14 @@ export class BarrelModule {}`);
|
|
|
105
101
|
});
|
|
106
102
|
await (0, component_1.componentGenerator)(tree, {
|
|
107
103
|
name: 'variable-declare-button',
|
|
108
|
-
|
|
109
|
-
path: `${libName}/src/lib/variable-declare`,
|
|
104
|
+
path: `${libName}/src/lib/variable-declare/variable-declare-button/variable-declare-button`,
|
|
110
105
|
module: 'variable-declare',
|
|
111
106
|
standalone: false,
|
|
112
107
|
skipFormat: true,
|
|
113
108
|
});
|
|
114
109
|
await (0, component_1.componentGenerator)(tree, {
|
|
115
110
|
name: 'variable-declare-view',
|
|
116
|
-
|
|
117
|
-
path: `${libName}/src/lib/variable-declare`,
|
|
111
|
+
path: `${libName}/src/lib/variable-declare/variable-declare-view/variable-declare-view`,
|
|
118
112
|
module: 'variable-declare',
|
|
119
113
|
standalone: false,
|
|
120
114
|
skipFormat: true,
|
|
@@ -142,24 +136,21 @@ export class VariableDeclareModule {}`);
|
|
|
142
136
|
});
|
|
143
137
|
await (0, component_1.componentGenerator)(tree, {
|
|
144
138
|
name: 'variable-spread-declare-button',
|
|
145
|
-
|
|
146
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
139
|
+
path: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-button/variable-spread-declare-button`,
|
|
147
140
|
module: 'variable-spread-declare',
|
|
148
141
|
standalone: false,
|
|
149
142
|
skipFormat: true,
|
|
150
143
|
});
|
|
151
144
|
await (0, component_1.componentGenerator)(tree, {
|
|
152
145
|
name: 'variable-spread-declare-view',
|
|
153
|
-
|
|
154
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
146
|
+
path: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-view/variable-spread-declare-view`,
|
|
155
147
|
module: 'variable-spread-declare',
|
|
156
148
|
standalone: false,
|
|
157
149
|
skipFormat: true,
|
|
158
150
|
});
|
|
159
151
|
await (0, component_1.componentGenerator)(tree, {
|
|
160
152
|
name: 'variable-spread-declare-anotherview',
|
|
161
|
-
|
|
162
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
153
|
+
path: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-anotherview/variable-spread-declare-anotherview`,
|
|
163
154
|
module: 'variable-spread-declare',
|
|
164
155
|
standalone: false,
|
|
165
156
|
skipFormat: true,
|
|
@@ -187,16 +178,14 @@ export class VariableSpreadDeclareModule {}`);
|
|
|
187
178
|
});
|
|
188
179
|
await (0, component_1.componentGenerator)(tree, {
|
|
189
180
|
name: 'cmp1',
|
|
190
|
-
|
|
191
|
-
path: `${libName}/src/lib/static-member-declarations`,
|
|
181
|
+
path: `${libName}/src/lib/static-member-declarations/cmp1/cmp1`,
|
|
192
182
|
module: 'static-member-declarations',
|
|
193
183
|
standalone: false,
|
|
194
184
|
skipFormat: true,
|
|
195
185
|
});
|
|
196
186
|
await (0, component_1.componentGenerator)(tree, {
|
|
197
187
|
name: 'cmp2',
|
|
198
|
-
|
|
199
|
-
path: `${libName}/src/lib/static-member-declarations`,
|
|
188
|
+
path: `${libName}/src/lib/static-member-declarations/cmp2/cmp2`,
|
|
200
189
|
module: 'static-member-declarations',
|
|
201
190
|
standalone: false,
|
|
202
191
|
skipFormat: true,
|
|
@@ -222,15 +211,14 @@ export class StaticMemberDeclarationsModule {
|
|
|
222
211
|
});
|
|
223
212
|
await (0, component_1.componentGenerator)(tree, {
|
|
224
213
|
name: 'nested-button',
|
|
225
|
-
project: libName,
|
|
226
214
|
module: 'nested',
|
|
227
|
-
path: `${libName}/src/lib/nested`,
|
|
215
|
+
path: `${libName}/src/lib/nested/nested-button/nested-button`,
|
|
228
216
|
standalone: false,
|
|
229
217
|
skipFormat: true,
|
|
230
218
|
});
|
|
231
219
|
await (0, component_1.componentGenerator)(tree, {
|
|
232
220
|
name: 'test-other',
|
|
233
|
-
|
|
221
|
+
path: `${libName}/src/lib/test-other/test-other`,
|
|
234
222
|
standalone: false,
|
|
235
223
|
skipFormat: true,
|
|
236
224
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CreateNodesV2 } from '@nx/devkit';
|
|
2
|
+
export interface AngularPluginOptions {
|
|
3
|
+
targetNamePrefix?: string;
|
|
4
|
+
}
|
|
5
|
+
type AngularTargetConfiguration = {
|
|
6
|
+
builder: string;
|
|
7
|
+
options?: Record<string, any>;
|
|
8
|
+
configurations?: Record<string, any>;
|
|
9
|
+
defaultConfiguration?: string;
|
|
10
|
+
};
|
|
11
|
+
export type AngularProjectConfiguration = {
|
|
12
|
+
projectType: 'application' | 'library';
|
|
13
|
+
root: string;
|
|
14
|
+
sourceRoot?: string;
|
|
15
|
+
architect?: Record<string, AngularTargetConfiguration>;
|
|
16
|
+
targets?: Record<string, AngularTargetConfiguration>;
|
|
17
|
+
};
|
|
18
|
+
export declare const createNodesV2: CreateNodesV2<AngularPluginOptions>;
|
|
19
|
+
export {};
|