@nx/angular 0.0.0-pr-27957-a99d5ea → 0.0.0-pr-28218-5048fd1
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 +28 -2
- 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 +0 -1
- 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 -5
- package/src/generators/component/schema.d.ts +0 -13
- package/src/generators/component/schema.json +0 -15
- 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 -5
- package/src/generators/directive/schema.d.ts +0 -12
- package/src/generators/directive/schema.json +0 -15
- package/src/generators/federate-module/lib/add-remote.js +2 -3
- package/src/generators/host/host.d.ts +1 -2
- package/src/generators/host/host.js +7 -20
- package/src/generators/init/init.js +12 -0
- package/src/generators/init/schema.d.ts +3 -0
- package/src/generators/library/lib/normalize-options.js +0 -1
- package/src/generators/library/library.d.ts +0 -1
- package/src/generators/library/library.js +0 -9
- package/src/generators/move/move.d.ts +0 -1
- package/src/generators/move/move.js +1 -8
- package/src/generators/pipe/lib/normalize-options.js +1 -5
- package/src/generators/pipe/schema.d.ts +0 -12
- package/src/generators/pipe/schema.json +0 -6
- package/src/generators/remote/remote.d.ts +1 -2
- package/src/generators/remote/remote.js +1 -9
- package/src/generators/scam/lib/normalize-options.js +1 -5
- package/src/generators/scam/schema.d.ts +0 -12
- package/src/generators/scam/schema.json +0 -6
- package/src/generators/scam-directive/lib/normalize-options.js +1 -5
- package/src/generators/scam-directive/schema.d.ts +0 -12
- package/src/generators/scam-pipe/lib/normalize-options.js +1 -5
- package/src/generators/scam-pipe/schema.d.ts +0 -12
- 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 +11 -20
- 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
|
@@ -10,18 +10,6 @@ export interface Schema {
|
|
|
10
10
|
module?: string;
|
|
11
11
|
export?: boolean;
|
|
12
12
|
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
13
|
}
|
|
26
14
|
|
|
27
15
|
export interface NormalizedSchema extends Schema {
|
|
@@ -36,12 +36,6 @@
|
|
|
36
36
|
"x-dropdown": "projects",
|
|
37
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
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."
|
|
44
|
-
},
|
|
45
39
|
"skipTests": {
|
|
46
40
|
"type": "boolean",
|
|
47
41
|
"description": "Do not create \"spec.ts\" test files for the new pipe.",
|
|
@@ -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,13 +9,7 @@ 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);
|
|
@@ -28,7 +21,6 @@ async function remoteInternal(tree, schema) {
|
|
|
28
21
|
projectType: 'application',
|
|
29
22
|
directory: options.directory,
|
|
30
23
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
31
|
-
callingGenerator: '@nx/angular:remote',
|
|
32
24
|
});
|
|
33
25
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
34
26
|
const port = options.port ?? (0, lib_1.findNextAvailablePort)(tree);
|
|
@@ -6,13 +6,9 @@ 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
|
-
directory: options.directory
|
|
13
|
-
flat: options.flat,
|
|
10
|
+
directory: options.directory,
|
|
14
11
|
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
15
|
-
project: options.project,
|
|
16
12
|
suffix: options.type ?? 'component',
|
|
17
13
|
});
|
|
18
14
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -18,18 +18,6 @@ export interface Schema {
|
|
|
18
18
|
skipSelector?: boolean;
|
|
19
19
|
export?: boolean;
|
|
20
20
|
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
21
|
}
|
|
34
22
|
|
|
35
23
|
export interface NormalizedSchema extends Schema {
|
|
@@ -90,12 +90,6 @@
|
|
|
90
90
|
"default": true,
|
|
91
91
|
"x-priority": "important"
|
|
92
92
|
},
|
|
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
93
|
"selector": {
|
|
100
94
|
"type": "string",
|
|
101
95
|
"format": "html-selector",
|
|
@@ -5,13 +5,9 @@ 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
|
-
directory: options.directory
|
|
12
|
-
flat: options.flat,
|
|
9
|
+
directory: options.directory,
|
|
13
10
|
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
14
|
-
project: options.project,
|
|
15
11
|
suffix: 'directive',
|
|
16
12
|
});
|
|
17
13
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -10,18 +10,6 @@ export interface Schema {
|
|
|
10
10
|
selector?: string;
|
|
11
11
|
export?: boolean;
|
|
12
12
|
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
13
|
}
|
|
26
14
|
|
|
27
15
|
export interface NormalizedSchema extends Schema {
|
|
@@ -5,13 +5,9 @@ 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
|
-
directory: options.directory
|
|
12
|
-
flat: options.flat,
|
|
9
|
+
directory: options.directory,
|
|
13
10
|
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
14
|
-
project: options.project,
|
|
15
11
|
suffix: 'pipe',
|
|
16
12
|
});
|
|
17
13
|
const { className } = (0, devkit_1.names)(name);
|
|
@@ -8,18 +8,6 @@ export interface Schema {
|
|
|
8
8
|
inlineScam?: boolean;
|
|
9
9
|
export?: boolean;
|
|
10
10
|
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
11
|
}
|
|
24
12
|
|
|
25
13
|
export interface NormalizedSchema extends Schema {
|
|
@@ -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
|
|
@@ -52,7 +52,7 @@ async function createStorybookTestWorkspaceForLib(libName) {
|
|
|
52
52
|
});
|
|
53
53
|
await (0, component_1.componentGenerator)(tree, {
|
|
54
54
|
name: 'test-button',
|
|
55
|
-
|
|
55
|
+
directory: `${libName}/src/lib/test-button`,
|
|
56
56
|
standalone: false,
|
|
57
57
|
skipFormat: true,
|
|
58
58
|
});
|
|
@@ -82,8 +82,7 @@ export class TestButtonComponent {
|
|
|
82
82
|
});
|
|
83
83
|
await (0, component_1.componentGenerator)(tree, {
|
|
84
84
|
name: 'barrel-button',
|
|
85
|
-
|
|
86
|
-
path: `${libName}/src/lib/barrel`,
|
|
85
|
+
directory: `${libName}/src/lib/barrel/barrel-button`,
|
|
87
86
|
module: 'barrel',
|
|
88
87
|
standalone: false,
|
|
89
88
|
skipFormat: true,
|
|
@@ -105,16 +104,14 @@ export class BarrelModule {}`);
|
|
|
105
104
|
});
|
|
106
105
|
await (0, component_1.componentGenerator)(tree, {
|
|
107
106
|
name: 'variable-declare-button',
|
|
108
|
-
|
|
109
|
-
path: `${libName}/src/lib/variable-declare`,
|
|
107
|
+
directory: `${libName}/src/lib/variable-declare/variable-declare-button`,
|
|
110
108
|
module: 'variable-declare',
|
|
111
109
|
standalone: false,
|
|
112
110
|
skipFormat: true,
|
|
113
111
|
});
|
|
114
112
|
await (0, component_1.componentGenerator)(tree, {
|
|
115
113
|
name: 'variable-declare-view',
|
|
116
|
-
|
|
117
|
-
path: `${libName}/src/lib/variable-declare`,
|
|
114
|
+
directory: `${libName}/src/lib/variable-declare/variable-declare-view`,
|
|
118
115
|
module: 'variable-declare',
|
|
119
116
|
standalone: false,
|
|
120
117
|
skipFormat: true,
|
|
@@ -142,24 +139,21 @@ export class VariableDeclareModule {}`);
|
|
|
142
139
|
});
|
|
143
140
|
await (0, component_1.componentGenerator)(tree, {
|
|
144
141
|
name: 'variable-spread-declare-button',
|
|
145
|
-
|
|
146
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
142
|
+
directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-button`,
|
|
147
143
|
module: 'variable-spread-declare',
|
|
148
144
|
standalone: false,
|
|
149
145
|
skipFormat: true,
|
|
150
146
|
});
|
|
151
147
|
await (0, component_1.componentGenerator)(tree, {
|
|
152
148
|
name: 'variable-spread-declare-view',
|
|
153
|
-
|
|
154
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
149
|
+
directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-view`,
|
|
155
150
|
module: 'variable-spread-declare',
|
|
156
151
|
standalone: false,
|
|
157
152
|
skipFormat: true,
|
|
158
153
|
});
|
|
159
154
|
await (0, component_1.componentGenerator)(tree, {
|
|
160
155
|
name: 'variable-spread-declare-anotherview',
|
|
161
|
-
|
|
162
|
-
path: `${libName}/src/lib/variable-spread-declare`,
|
|
156
|
+
directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-anotherview`,
|
|
163
157
|
module: 'variable-spread-declare',
|
|
164
158
|
standalone: false,
|
|
165
159
|
skipFormat: true,
|
|
@@ -187,16 +181,14 @@ export class VariableSpreadDeclareModule {}`);
|
|
|
187
181
|
});
|
|
188
182
|
await (0, component_1.componentGenerator)(tree, {
|
|
189
183
|
name: 'cmp1',
|
|
190
|
-
|
|
191
|
-
path: `${libName}/src/lib/static-member-declarations`,
|
|
184
|
+
directory: `${libName}/src/lib/static-member-declarations/cmp1`,
|
|
192
185
|
module: 'static-member-declarations',
|
|
193
186
|
standalone: false,
|
|
194
187
|
skipFormat: true,
|
|
195
188
|
});
|
|
196
189
|
await (0, component_1.componentGenerator)(tree, {
|
|
197
190
|
name: 'cmp2',
|
|
198
|
-
|
|
199
|
-
path: `${libName}/src/lib/static-member-declarations`,
|
|
191
|
+
directory: `${libName}/src/lib/static-member-declarations/cmp2`,
|
|
200
192
|
module: 'static-member-declarations',
|
|
201
193
|
standalone: false,
|
|
202
194
|
skipFormat: true,
|
|
@@ -222,15 +214,14 @@ export class StaticMemberDeclarationsModule {
|
|
|
222
214
|
});
|
|
223
215
|
await (0, component_1.componentGenerator)(tree, {
|
|
224
216
|
name: 'nested-button',
|
|
225
|
-
project: libName,
|
|
226
217
|
module: 'nested',
|
|
227
|
-
|
|
218
|
+
directory: `${libName}/src/lib/nested/nested-button`,
|
|
228
219
|
standalone: false,
|
|
229
220
|
skipFormat: true,
|
|
230
221
|
});
|
|
231
222
|
await (0, component_1.componentGenerator)(tree, {
|
|
232
223
|
name: 'test-other',
|
|
233
|
-
|
|
224
|
+
directory: `${libName}/src/lib/test-other`,
|
|
234
225
|
standalone: false,
|
|
235
226
|
skipFormat: true,
|
|
236
227
|
});
|
|
@@ -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 {};
|