@nrwl/storybook 14.4.2 → 14.5.0-beta.0
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/CHANGELOG.md +1 -1
- package/package.json +6 -6
- package/src/generators/change-storybook-targets/change-storybook-targets.js +15 -10
- package/src/generators/change-storybook-targets/change-storybook-targets.js.map +1 -1
- package/src/generators/change-storybook-targets/test-configs/no-build-storybook-target.json +60 -0
- package/src/generators/change-storybook-targets/test-configs/no-storybook-targets.json +34 -0
- package/.eslintrc.json +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [14.5.0-beta.0](https://github.com/nrwl/nx/compare/14.4.2...14.5.0-beta.0) (2022-07-11)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/storybook
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/storybook",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.0-beta.0",
|
|
4
4
|
"description": "The Nx Plugin for Storybook that contains executors and generators for allowing your workspace to use the powerful Storybook integration testing & documenting capabilities.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"migrations": "./migrations.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nrwl/cypress": "14.
|
|
33
|
-
"@nrwl/devkit": "14.
|
|
34
|
-
"@nrwl/linter": "14.
|
|
35
|
-
"@nrwl/workspace": "14.
|
|
32
|
+
"@nrwl/cypress": "14.5.0-beta.0",
|
|
33
|
+
"@nrwl/devkit": "14.5.0-beta.0",
|
|
34
|
+
"@nrwl/linter": "14.5.0-beta.0",
|
|
35
|
+
"@nrwl/workspace": "14.5.0-beta.0",
|
|
36
36
|
"core-js": "^3.6.5",
|
|
37
37
|
"semver": "7.3.4",
|
|
38
38
|
"ts-loader": "^9.2.6",
|
|
39
39
|
"tsconfig-paths-webpack-plugin": "3.5.2"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "438ea6cdfed60dc0f7f358e967650f004f2e7c42"
|
|
42
42
|
}
|
|
@@ -20,8 +20,13 @@ function changeStorybookTargetsGenerator(tree) {
|
|
|
20
20
|
projectConfiguration.targets[storybookTarget] = updateStorybookTarget(projectConfiguration, storybookTarget, projectName, ngBuildTarget, storybookBuildTarget);
|
|
21
21
|
changesMade = true;
|
|
22
22
|
changesMadeToAtLeastOne = true;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
if (storybookBuildTarget) {
|
|
24
|
+
projectConfiguration.targets[storybookBuildTarget] =
|
|
25
|
+
updateStorybookBuildTarget(projectConfiguration, projectName, ngBuildTarget, storybookBuildTarget);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
devkit_1.logger.info(`Project ${projectName} does not have a build target configured for Storybook.`);
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
else {
|
|
27
32
|
devkit_1.logger.warn(`Could not find a Storybook target for ${projectName}.`);
|
|
@@ -37,13 +42,13 @@ function changeStorybookTargetsGenerator(tree) {
|
|
|
37
42
|
}
|
|
38
43
|
exports.changeStorybookTargetsGenerator = changeStorybookTargetsGenerator;
|
|
39
44
|
function updateStorybookTarget(projectConfiguration, storybookTarget, projectName, buildTarget, storybookBuildTarget) {
|
|
40
|
-
var _a
|
|
41
|
-
const oldStorybookTargetConfig =
|
|
45
|
+
var _a;
|
|
46
|
+
const oldStorybookTargetConfig = projectConfiguration.targets[storybookTarget];
|
|
42
47
|
const newStorybookTargetConfig = {
|
|
43
48
|
executor: '@storybook/angular:start-storybook',
|
|
44
49
|
options: {
|
|
45
50
|
port: oldStorybookTargetConfig.options.port,
|
|
46
|
-
configDir: (
|
|
51
|
+
configDir: (_a = oldStorybookTargetConfig.options.config) === null || _a === void 0 ? void 0 : _a.configFolder,
|
|
47
52
|
browserTarget: undefined,
|
|
48
53
|
compodoc: false,
|
|
49
54
|
},
|
|
@@ -57,19 +62,19 @@ function updateStorybookTarget(projectConfiguration, storybookTarget, projectNam
|
|
|
57
62
|
else {
|
|
58
63
|
newStorybookTargetConfig.options.browserTarget = `${projectName}:${buildTarget ? buildTarget : storybookBuildTarget}`;
|
|
59
64
|
}
|
|
60
|
-
const
|
|
65
|
+
const _b = oldStorybookTargetConfig.options, { uiFramework, outputPath, config, projectBuildConfig } = _b, optionsToCopy = tslib_1.__rest(_b, ["uiFramework", "outputPath", "config", "projectBuildConfig"]);
|
|
61
66
|
newStorybookTargetConfig.options = Object.assign(Object.assign({}, optionsToCopy), newStorybookTargetConfig.options);
|
|
62
67
|
return newStorybookTargetConfig;
|
|
63
68
|
}
|
|
64
69
|
function updateStorybookBuildTarget(projectConfiguration, projectName, buildTarget, storybookBuildTarget) {
|
|
65
|
-
var _a
|
|
66
|
-
const oldStorybookBuildTargetConfig =
|
|
70
|
+
var _a;
|
|
71
|
+
const oldStorybookBuildTargetConfig = projectConfiguration.targets[storybookBuildTarget];
|
|
67
72
|
const newStorybookBuildTargetConfig = {
|
|
68
73
|
executor: '@storybook/angular:build-storybook',
|
|
69
74
|
outputs: oldStorybookBuildTargetConfig.outputs,
|
|
70
75
|
options: {
|
|
71
76
|
outputDir: oldStorybookBuildTargetConfig.options.outputPath,
|
|
72
|
-
configDir: (
|
|
77
|
+
configDir: (_a = oldStorybookBuildTargetConfig.options.config) === null || _a === void 0 ? void 0 : _a.configFolder,
|
|
73
78
|
browserTarget: undefined,
|
|
74
79
|
compodoc: false,
|
|
75
80
|
},
|
|
@@ -83,7 +88,7 @@ function updateStorybookBuildTarget(projectConfiguration, projectName, buildTarg
|
|
|
83
88
|
else {
|
|
84
89
|
newStorybookBuildTargetConfig.options.browserTarget = `${projectName}:${buildTarget ? buildTarget : storybookBuildTarget}`;
|
|
85
90
|
}
|
|
86
|
-
const
|
|
91
|
+
const _b = oldStorybookBuildTargetConfig.options, { uiFramework, outputPath, config, projectBuildConfig } = _b, optionsToCopy = tslib_1.__rest(_b, ["uiFramework", "outputPath", "config", "projectBuildConfig"]);
|
|
87
92
|
newStorybookBuildTargetConfig.options = Object.assign(Object.assign({}, optionsToCopy), newStorybookBuildTargetConfig.options);
|
|
88
93
|
return newStorybookBuildTargetConfig;
|
|
89
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-storybook-targets.js","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/change-storybook-targets/change-storybook-targets.ts"],"names":[],"mappings":";;;;AAAA,yCAUsB;AACtB,qDAAgF;AAEhF,SAAsB,+BAA+B,CAAC,IAAU;;QAC9D,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,uBAAuB,GAAG,KAAK,CAAC;QACpC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,oBAAoB,CAAC,EAAE,EAAE;;YACtE,WAAW,GAAG,KAAK,CAAC;YACpB,MAAM,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,GAC5D,IAAA,mDAAuC,EAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACxE,IACE,WAAW;gBACX,eAAe;gBACf,CAAA,MAAA,MAAA,MAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,OAAO,0CAAG,eAAe,CAAC,0CAAE,OAAO,0CAAE,WAAW;oBACpE,oBAAoB,EACtB;gBACA,oBAAoB,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,qBAAqB,CACnE,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,aAAa,EACb,oBAAoB,CACrB,CAAC;gBACF,WAAW,GAAG,IAAI,CAAC;gBACnB,uBAAuB,GAAG,IAAI,CAAC;gBAC/B,oBAAoB,CAAC,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"change-storybook-targets.js","sourceRoot":"","sources":["../../../../../../packages/storybook/src/generators/change-storybook-targets/change-storybook-targets.ts"],"names":[],"mappings":";;;;AAAA,yCAUsB;AACtB,qDAAgF;AAEhF,SAAsB,+BAA+B,CAAC,IAAU;;QAC9D,IAAI,WAAW,GAAG,KAAK,CAAC;QACxB,IAAI,uBAAuB,GAAG,KAAK,CAAC;QACpC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE,oBAAoB,CAAC,EAAE,EAAE;;YACtE,WAAW,GAAG,KAAK,CAAC;YACpB,MAAM,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,GAC5D,IAAA,mDAAuC,EAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YACxE,IACE,WAAW;gBACX,eAAe;gBACf,CAAA,MAAA,MAAA,MAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,OAAO,0CAAG,eAAe,CAAC,0CAAE,OAAO,0CAAE,WAAW;oBACpE,oBAAoB,EACtB;gBACA,oBAAoB,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,qBAAqB,CACnE,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,aAAa,EACb,oBAAoB,CACrB,CAAC;gBACF,WAAW,GAAG,IAAI,CAAC;gBACnB,uBAAuB,GAAG,IAAI,CAAC;gBAC/B,IAAI,oBAAoB,EAAE;oBACxB,oBAAoB,CAAC,OAAO,CAAC,oBAAoB,CAAC;wBAChD,0BAA0B,CACxB,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,oBAAoB,C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kBAAkB,OAEqB,EADpC,aAAa,sBALZ,6DAML,CAAwC,CAAC;IAE1C,6BAA6B,CAAC,OAAO,mCAChC,aAAa,GACb,6BAA6B,CAAC,OAAO,CACzC,CAAC;IAEF,OAAO,6BAA6B,CAAC;AACvC,CAAC;AAED,SAAS,uBAAuB,CAAC,YAAoB;IACnD,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEjE,OAAO;QACL,OAAO;QACP,MAAM;QACN,aAAa;KACd,CAAC;AACJ,CAAC;AAED,kBAAe,+BAA+B,CAAC;AAClC,QAAA,+BAA+B,GAAG,IAAA,2BAAkB,EAC/D,+BAA+B,CAChC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projects": {
|
|
3
|
+
"main-app": {
|
|
4
|
+
"projectType": "application",
|
|
5
|
+
"root": "apps/main-app",
|
|
6
|
+
"sourceRoot": "apps/main-app/src",
|
|
7
|
+
"prefix": "katst",
|
|
8
|
+
"architect": {
|
|
9
|
+
"build": {
|
|
10
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
11
|
+
"outputs": ["{options.outputPath}"]
|
|
12
|
+
},
|
|
13
|
+
"storybook": {
|
|
14
|
+
"builder": "@nrwl/storybook:storybook",
|
|
15
|
+
"options": {
|
|
16
|
+
"uiFramework": "@storybook/angular",
|
|
17
|
+
"port": 4400,
|
|
18
|
+
"config": {
|
|
19
|
+
"configFolder": "apps/main-app/.storybook"
|
|
20
|
+
},
|
|
21
|
+
"projectBuildConfig": "main-app"
|
|
22
|
+
},
|
|
23
|
+
"configurations": {
|
|
24
|
+
"ci": {
|
|
25
|
+
"quiet": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"other-app": {
|
|
32
|
+
"projectType": "application",
|
|
33
|
+
"root": "apps/other-app",
|
|
34
|
+
"sourceRoot": "apps/other-app/src",
|
|
35
|
+
"prefix": "katst",
|
|
36
|
+
"architect": {
|
|
37
|
+
"build": {
|
|
38
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
39
|
+
"outputs": ["{options.outputPath}"]
|
|
40
|
+
},
|
|
41
|
+
"storybook": {
|
|
42
|
+
"builder": "@nrwl/storybook:storybook",
|
|
43
|
+
"options": {
|
|
44
|
+
"uiFramework": "@storybook/angular",
|
|
45
|
+
"port": 4400,
|
|
46
|
+
"config": {
|
|
47
|
+
"configFolder": "apps/other-app/.storybook"
|
|
48
|
+
},
|
|
49
|
+
"projectBuildConfig": "other-app"
|
|
50
|
+
},
|
|
51
|
+
"configurations": {
|
|
52
|
+
"ci": {
|
|
53
|
+
"quiet": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projects": {
|
|
3
|
+
"ui-one": {
|
|
4
|
+
"projectType": "library",
|
|
5
|
+
"root": "libs/ui/one",
|
|
6
|
+
"sourceRoot": "libs/ui/one/src",
|
|
7
|
+
"targets": {}
|
|
8
|
+
},
|
|
9
|
+
"ui-two": {
|
|
10
|
+
"projectType": "library",
|
|
11
|
+
"root": "libs/ui/two",
|
|
12
|
+
"sourceRoot": "libs/ui/two/src",
|
|
13
|
+
"targets": {}
|
|
14
|
+
},
|
|
15
|
+
"ui-three": {
|
|
16
|
+
"projectType": "library",
|
|
17
|
+
"root": "libs/ui/three",
|
|
18
|
+
"sourceRoot": "libs/ui/three/src",
|
|
19
|
+
"targets": {}
|
|
20
|
+
},
|
|
21
|
+
"main-app": {
|
|
22
|
+
"projectType": "application",
|
|
23
|
+
"root": "apps/main-app",
|
|
24
|
+
"sourceRoot": "apps/main-app/src",
|
|
25
|
+
"prefix": "katst",
|
|
26
|
+
"architect": {
|
|
27
|
+
"build": {
|
|
28
|
+
"builder": "@angular-devkit/build-angular:browser",
|
|
29
|
+
"outputs": ["{options.outputPath}"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/.eslintrc.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc",
|
|
3
|
-
"rules": {},
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
-
"rules": {}
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"files": ["**/*.ts"],
|
|
11
|
-
"excludedFiles": ["./src/migrations/**", "./src/utils/testing.ts"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"no-restricted-imports": [
|
|
14
|
-
"error",
|
|
15
|
-
"@nrwl/workspace",
|
|
16
|
-
"@angular-devkit/core",
|
|
17
|
-
"@angular-devkit/schematics",
|
|
18
|
-
"@angular-devkit/architect"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"files": [
|
|
24
|
-
"./package.json",
|
|
25
|
-
"./generators.json",
|
|
26
|
-
"./executors.json",
|
|
27
|
-
"./migrations.json"
|
|
28
|
-
],
|
|
29
|
-
"parser": "jsonc-eslint-parser",
|
|
30
|
-
"rules": {
|
|
31
|
-
"@nrwl/nx/nx-plugin-checks": "error"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"ignorePatterns": ["!**/*"]
|
|
36
|
-
}
|