@nx/storybook 16.0.0-beta.1

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -0
  3. package/README.md +63 -0
  4. package/executors.json +26 -0
  5. package/generators.json +58 -0
  6. package/index.d.ts +3 -0
  7. package/index.js +10 -0
  8. package/index.js.map +1 -0
  9. package/migrations.json +294 -0
  10. package/package.json +49 -0
  11. package/presets/cypress.d.ts +22 -0
  12. package/presets/cypress.js +9 -0
  13. package/presets/cypress.js.map +1 -0
  14. package/src/executors/build-storybook/build-storybook.impl.d.ts +7 -0
  15. package/src/executors/build-storybook/build-storybook.impl.js +58 -0
  16. package/src/executors/build-storybook/build-storybook.impl.js.map +1 -0
  17. package/src/executors/build-storybook/compat.d.ts +2 -0
  18. package/src/executors/build-storybook/compat.js +6 -0
  19. package/src/executors/build-storybook/compat.js.map +1 -0
  20. package/src/executors/build-storybook/schema.json +122 -0
  21. package/src/executors/storybook/compat.d.ts +2 -0
  22. package/src/executors/storybook/compat.js +6 -0
  23. package/src/executors/storybook/compat.js.map +1 -0
  24. package/src/executors/storybook/schema.json +94 -0
  25. package/src/executors/storybook/storybook.impl.d.ts +11 -0
  26. package/src/executors/storybook/storybook.impl.js +53 -0
  27. package/src/executors/storybook/storybook.impl.js.map +1 -0
  28. package/src/executors/utils.d.ts +12 -0
  29. package/src/executors/utils.js +148 -0
  30. package/src/executors/utils.js.map +1 -0
  31. package/src/generators/configuration/configuration.d.ts +5 -0
  32. package/src/generators/configuration/configuration.js +191 -0
  33. package/src/generators/configuration/configuration.js.map +1 -0
  34. package/src/generators/configuration/lib/user-prompts.d.ts +6 -0
  35. package/src/generators/configuration/lib/user-prompts.js +90 -0
  36. package/src/generators/configuration/lib/user-prompts.js.map +1 -0
  37. package/src/generators/configuration/lib/util-functions.d.ts +27 -0
  38. package/src/generators/configuration/lib/util-functions.js +359 -0
  39. package/src/generators/configuration/lib/util-functions.js.map +1 -0
  40. package/src/generators/configuration/project-files/.storybook/main.js__tmpl__ +46 -0
  41. package/src/generators/configuration/project-files/.storybook/preview.js__tmpl__ +0 -0
  42. package/src/generators/configuration/project-files/.storybook/tsconfig.json__tmpl__ +26 -0
  43. package/src/generators/configuration/project-files-7/.storybook/main.js__tmpl__ +34 -0
  44. package/src/generators/configuration/project-files-7/.storybook/preview.js__tmpl__ +0 -0
  45. package/src/generators/configuration/project-files-7/.storybook/tsconfig.json__tmpl__ +26 -0
  46. package/src/generators/configuration/project-files-7-ts/.storybook/main.ts__tmpl__ +36 -0
  47. package/src/generators/configuration/project-files-7-ts/.storybook/preview.ts__tmpl__ +0 -0
  48. package/src/generators/configuration/project-files-7-ts/.storybook/tsconfig.json__tmpl__ +28 -0
  49. package/src/generators/configuration/project-files-ts/.storybook/main.ts__tmpl__ +49 -0
  50. package/src/generators/configuration/project-files-ts/.storybook/preview.ts__tmpl__ +0 -0
  51. package/src/generators/configuration/project-files-ts/.storybook/tsconfig.json__tmpl__ +28 -0
  52. package/src/generators/configuration/schema.d.ts +19 -0
  53. package/src/generators/configuration/schema.json +124 -0
  54. package/src/generators/cypress-project/cypress-project.d.ts +14 -0
  55. package/src/generators/cypress-project/cypress-project.js +98 -0
  56. package/src/generators/cypress-project/cypress-project.js.map +1 -0
  57. package/src/generators/cypress-project/files/cypress.config.ts__tpl__ +6 -0
  58. package/src/generators/cypress-project/schema.json +55 -0
  59. package/src/generators/init/init.d.ts +5 -0
  60. package/src/generators/init/init.js +181 -0
  61. package/src/generators/init/init.js.map +1 -0
  62. package/src/generators/init/schema.d.ts +8 -0
  63. package/src/generators/init/schema.json +60 -0
  64. package/src/generators/migrate-7/calling-storybook-cli.d.ts +13 -0
  65. package/src/generators/migrate-7/calling-storybook-cli.js +85 -0
  66. package/src/generators/migrate-7/calling-storybook-cli.js.map +1 -0
  67. package/src/generators/migrate-7/files/storybook-migration-summary.md__tmpl__ +80 -0
  68. package/src/generators/migrate-7/helper-functions.d.ts +69 -0
  69. package/src/generators/migrate-7/helper-functions.js +449 -0
  70. package/src/generators/migrate-7/helper-functions.js.map +1 -0
  71. package/src/generators/migrate-7/migrate-7.d.ts +5 -0
  72. package/src/generators/migrate-7/migrate-7.js +73 -0
  73. package/src/generators/migrate-7/migrate-7.js.map +1 -0
  74. package/src/generators/migrate-7/schema.d.ts +9 -0
  75. package/src/generators/migrate-7/schema.json +35 -0
  76. package/src/migrations/update-13-4-6/set-project-build-config.d.ts +2 -0
  77. package/src/migrations/update-13-4-6/set-project-build-config.js +61 -0
  78. package/src/migrations/update-13-4-6/set-project-build-config.js.map +1 -0
  79. package/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.d.ts +6 -0
  80. package/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.js +120 -0
  81. package/src/migrations/update-14-0-0/migrate-defaults-5-to-6/migrate-defaults-5-to-6.js.map +1 -0
  82. package/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.d.ts +8 -0
  83. package/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.js +294 -0
  84. package/src/migrations/update-14-0-0/migrate-stories-to-6-2/migrate-stories-to-6-2.js.map +1 -0
  85. package/src/migrations/update-14-0-0/migrate-to-storybook-6.d.ts +2 -0
  86. package/src/migrations/update-14-0-0/migrate-to-storybook-6.js +13 -0
  87. package/src/migrations/update-14-0-0/migrate-to-storybook-6.js.map +1 -0
  88. package/src/migrations/update-14-1-8/change-storybook-targets-generator.d.ts +4 -0
  89. package/src/migrations/update-14-1-8/change-storybook-targets-generator.js +105 -0
  90. package/src/migrations/update-14-1-8/change-storybook-targets-generator.js.map +1 -0
  91. package/src/migrations/update-14-1-8/change-storybook-targets.d.ts +2 -0
  92. package/src/migrations/update-14-1-8/change-storybook-targets.js +11 -0
  93. package/src/migrations/update-14-1-8/change-storybook-targets.js.map +1 -0
  94. package/src/migrations/update-15-0-0/add-storybook-inputs.d.ts +2 -0
  95. package/src/migrations/update-15-0-0/add-storybook-inputs.js +47 -0
  96. package/src/migrations/update-15-0-0/add-storybook-inputs.js.map +1 -0
  97. package/src/migrations/update-15-4-6/refactor-executor-options.d.ts +2 -0
  98. package/src/migrations/update-15-4-6/refactor-executor-options.js +67 -0
  99. package/src/migrations/update-15-4-6/refactor-executor-options.js.map +1 -0
  100. package/src/migrations/update-15-5-3/ensure-webpack-package.d.ts +2 -0
  101. package/src/migrations/update-15-5-3/ensure-webpack-package.js +33 -0
  102. package/src/migrations/update-15-5-3/ensure-webpack-package.js.map +1 -0
  103. package/src/migrations/update-15-7-0/add-addon-essentials-to-all.d.ts +24 -0
  104. package/src/migrations/update-15-7-0/add-addon-essentials-to-all.js +278 -0
  105. package/src/migrations/update-15-7-0/add-addon-essentials-to-all.js.map +1 -0
  106. package/src/migrations/update-15-7-0/remove-root-config.d.ts +14 -0
  107. package/src/migrations/update-15-7-0/remove-root-config.js +210 -0
  108. package/src/migrations/update-15-7-0/remove-root-config.js.map +1 -0
  109. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  110. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
  111. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
  112. package/src/utils/models.d.ts +5 -0
  113. package/src/utils/models.js +3 -0
  114. package/src/utils/models.js.map +1 -0
  115. package/src/utils/test-configs/.storybook/main.js +8 -0
  116. package/src/utils/test-configs/.storybook/tsconfig.json +19 -0
  117. package/src/utils/testing.d.ts +3 -0
  118. package/src/utils/testing.js +38 -0
  119. package/src/utils/testing.js.map +1 -0
  120. package/src/utils/utilities.d.ts +53 -0
  121. package/src/utils/utilities.js +255 -0
  122. package/src/utils/utilities.js.map +1 -0
  123. package/src/utils/versions.d.ts +20 -0
  124. package/src/utils/versions.js +24 -0
  125. package/src/utils/versions.js.map +1 -0
@@ -0,0 +1,14 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * The purpose of this migrator is to help users move away
4
+ * from the root .storybook/ configuration folder and files.
5
+ *
6
+ * This is the second part of the migrator.
7
+ *
8
+ * If the root main.js file is empty, then we can safely delete it
9
+ * and also remove all the references to it from the project-level
10
+ * Storybook configuration files.
11
+ *
12
+ * Point the user to a guide that explains how to all these things.
13
+ */
14
+ export declare function removeRootConfig(tree: Tree, rootMainJsTsPath: string): boolean;
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeRootConfig = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
7
+ const add_addon_essentials_to_all_1 = require("./add-addon-essentials-to-all");
8
+ const ts = require("typescript");
9
+ /**
10
+ * The purpose of this migrator is to help users move away
11
+ * from the root .storybook/ configuration folder and files.
12
+ *
13
+ * This is the second part of the migrator.
14
+ *
15
+ * If the root main.js file is empty, then we can safely delete it
16
+ * and also remove all the references to it from the project-level
17
+ * Storybook configuration files.
18
+ *
19
+ * Point the user to a guide that explains how to all these things.
20
+ */
21
+ function removeRootConfig(tree, rootMainJsTsPath) {
22
+ if (checkIfRootMainJsTsIsEmpty(tree, rootMainJsTsPath)) {
23
+ const hasRemainingRootMainJsReferences = removeImportFromAllFiles(tree);
24
+ tree.delete(rootMainJsTsPath);
25
+ devkit_1.logger.warn(`
26
+ We removed the root ${rootMainJsTsPath} file and we also
27
+ removed all it's imports from all project-level Storybook configuration files.
28
+ `);
29
+ if (hasRemainingRootMainJsReferences.length) {
30
+ devkit_1.logger.warn(`
31
+ However, there are still other references to the root .storybook/main.js|ts file
32
+ in the following files:
33
+
34
+ ${hasRemainingRootMainJsReferences.join('\n')}
35
+
36
+ Please remove them manually.
37
+ `);
38
+ }
39
+ return true;
40
+ }
41
+ }
42
+ exports.removeRootConfig = removeRootConfig;
43
+ function removeImportFromAllFiles(tree) {
44
+ const hasRemainingRootMainJsReferences = [];
45
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/storybook:build', (options) => {
46
+ const hasRemainingReference = makeTheChanges(tree, options);
47
+ if (hasRemainingReference) {
48
+ hasRemainingRootMainJsReferences.push(hasRemainingReference);
49
+ }
50
+ });
51
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@storybook/angular:build-storybook', (options) => {
52
+ const hasRemainingReference = makeTheChanges(tree, options);
53
+ if (hasRemainingReference) {
54
+ hasRemainingRootMainJsReferences.push(hasRemainingReference);
55
+ }
56
+ });
57
+ return hasRemainingRootMainJsReferences;
58
+ }
59
+ function makeTheChanges(tree, options) {
60
+ const storybookDir = options === null || options === void 0 ? void 0 : options['configDir'];
61
+ if (storybookDir) {
62
+ const mainJsTsPath = tree.exists(`${storybookDir}/main.js`)
63
+ ? `${storybookDir}/main.js`
64
+ : tree.exists(`${storybookDir}/main.ts`)
65
+ ? `${storybookDir}/main.ts`
66
+ : undefined;
67
+ if (mainJsTsPath) {
68
+ let mainJsTs = tree.read(mainJsTsPath, 'utf-8');
69
+ const { rootMainVariableName, importExpression } = (0, add_addon_essentials_to_all_1.getRootMainVariableName)(mainJsTs);
70
+ if (importExpression && rootMainVariableName) {
71
+ const changesToBeMade = [
72
+ {
73
+ type: devkit_1.ChangeType.Delete,
74
+ start: importExpression.getStart(),
75
+ length: importExpression.getText().length,
76
+ },
77
+ ];
78
+ const spreadElements = tsquery_1.tsquery.query(mainJsTs, `SpreadElement:has(Identifier[name="${rootMainVariableName}"])`);
79
+ spreadElements.forEach((spreadElement) => {
80
+ changesToBeMade.push({
81
+ type: devkit_1.ChangeType.Delete,
82
+ start: spreadElement.getStart(),
83
+ length: mainJsTs[spreadElement.getEnd()] === ','
84
+ ? spreadElement.getText().length + 1
85
+ : spreadElement.getText().length,
86
+ });
87
+ });
88
+ const spreadAssignments = tsquery_1.tsquery.query(mainJsTs, `SpreadAssignment:has(Identifier[name="${rootMainVariableName}"])`);
89
+ spreadAssignments.forEach((spreadAssignment) => {
90
+ changesToBeMade.push({
91
+ type: devkit_1.ChangeType.Delete,
92
+ start: spreadAssignment.getStart(),
93
+ length: mainJsTs[spreadAssignment.getEnd()] === ','
94
+ ? spreadAssignment.getText().length + 1
95
+ : spreadAssignment.getText().length,
96
+ });
97
+ });
98
+ const findOtherRootMainUses = tsquery_1.tsquery.query(mainJsTs, `Identifier[name="${rootMainVariableName}"]`);
99
+ findOtherRootMainUses.forEach((otherRootMainUse) => {
100
+ var _a;
101
+ /**
102
+ * This would be mainly to remove the legacy
103
+ *
104
+ * if (rootMain.webpackFinal) {
105
+ * config = await rootMain.webpackFinal(config, { configType });
106
+ * }
107
+ */
108
+ if (otherRootMainUse.parent.kind ===
109
+ ts.SyntaxKind.PropertyAccessExpression &&
110
+ ((_a = otherRootMainUse.parent.parent) === null || _a === void 0 ? void 0 : _a.kind) === ts.SyntaxKind.IfStatement) {
111
+ changesToBeMade.push({
112
+ type: devkit_1.ChangeType.Delete,
113
+ start: otherRootMainUse.parent.parent.getStart(),
114
+ length: otherRootMainUse.parent.parent.getText().length + 1,
115
+ });
116
+ }
117
+ });
118
+ mainJsTs = (0, devkit_1.applyChangesToString)(mainJsTs, [...changesToBeMade]);
119
+ tree.write(mainJsTsPath, mainJsTs);
120
+ if (hasMoreRootMainUses(tree, mainJsTsPath, rootMainVariableName)) {
121
+ if (checkIfUsesOldSyntaxAndUpdate(tree, mainJsTsPath, rootMainVariableName)) {
122
+ return undefined;
123
+ }
124
+ return mainJsTsPath;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ function checkIfUsesOldSyntaxAndUpdate(tree, filePath, rootMainVariableName) {
131
+ const mainJsTs = tree.read(filePath, 'utf-8');
132
+ const changesToBeMade = [];
133
+ const { stringArray: addonsArrayString, expressionToDelete: addonsToDelete } = getPropertyArray('addons', mainJsTs, rootMainVariableName);
134
+ const { stringArray: storiesArrayString, expressionToDelete: storiesToDelete, } = getPropertyArray('stories', mainJsTs, rootMainVariableName);
135
+ if (storiesToDelete) {
136
+ changesToBeMade.push(storiesToDelete);
137
+ }
138
+ if (addonsToDelete) {
139
+ changesToBeMade.push(addonsToDelete);
140
+ }
141
+ if (addArrayToModuleExports('addons', mainJsTs, addonsArrayString)) {
142
+ changesToBeMade.push(addArrayToModuleExports('addons', mainJsTs, addonsArrayString));
143
+ }
144
+ if (addArrayToModuleExports('stories', mainJsTs, storiesArrayString)) {
145
+ changesToBeMade.push(addArrayToModuleExports('stories', mainJsTs, storiesArrayString));
146
+ }
147
+ if (changesToBeMade.length) {
148
+ tree.write(filePath, (0, devkit_1.applyChangesToString)(mainJsTs, changesToBeMade));
149
+ return true;
150
+ }
151
+ }
152
+ function addArrayToModuleExports(propertyName, mainJsTs, arrayString) {
153
+ var _a, _b;
154
+ if (!arrayString) {
155
+ return;
156
+ }
157
+ const moduleExports = (_a = tsquery_1.tsquery.query(mainJsTs, `PropertyAccessExpression:has([expression.name="module"]):has([name="exports"]):has([name="${propertyName}"])`)) === null || _a === void 0 ? void 0 : _a[0];
158
+ if (moduleExports) {
159
+ const parentBinaryExpression = moduleExports.parent;
160
+ const arrayExpression = (_b = tsquery_1.tsquery.query(parentBinaryExpression, `ArrayLiteralExpression`)) === null || _b === void 0 ? void 0 : _b[0];
161
+ return {
162
+ type: devkit_1.ChangeType.Insert,
163
+ index: arrayExpression.getStart() + 1,
164
+ text: arrayString,
165
+ };
166
+ }
167
+ else {
168
+ return {
169
+ type: devkit_1.ChangeType.Insert,
170
+ index: mainJsTs.length,
171
+ text: `module.exports.${propertyName} = [${arrayString}];\n`,
172
+ };
173
+ }
174
+ }
175
+ function getPropertyArray(propertyName, mainJsTs, rootMainVariableName) {
176
+ var _a;
177
+ const propertyAccessExpression = (_a = tsquery_1.tsquery.query(mainJsTs, `PropertyAccessExpression:has([expression.name="${rootMainVariableName}"]):has([name="${propertyName}"])`)) === null || _a === void 0 ? void 0 : _a[0];
178
+ if (propertyAccessExpression) {
179
+ if ((propertyAccessExpression === null || propertyAccessExpression === void 0 ? void 0 : propertyAccessExpression.getText()) ===
180
+ `${rootMainVariableName}.${propertyName}.push`) {
181
+ const parentCallExpression = propertyAccessExpression.parent;
182
+ const stringPropertyArray = tsquery_1.tsquery
183
+ .query(parentCallExpression, `StringLiteral`)
184
+ .map((stringLiteral) => stringLiteral === null || stringLiteral === void 0 ? void 0 : stringLiteral.getText());
185
+ return {
186
+ stringArray: `${stringPropertyArray.join(', ')}`,
187
+ expressionToDelete: {
188
+ type: devkit_1.ChangeType.Delete,
189
+ start: parentCallExpression.getStart(),
190
+ length: parentCallExpression.getText().length + 1,
191
+ },
192
+ };
193
+ }
194
+ }
195
+ }
196
+ function hasMoreRootMainUses(tree, filePath, rootMainVariableName) {
197
+ const mainJsTs = tree.read(filePath, 'utf-8');
198
+ const findRemainingRootMainUses = tsquery_1.tsquery.query(mainJsTs, `Identifier[name="${rootMainVariableName}"]`);
199
+ return (findRemainingRootMainUses === null || findRemainingRootMainUses === void 0 ? void 0 : findRemainingRootMainUses.length) > 0;
200
+ }
201
+ function checkIfRootMainJsTsIsEmpty(tree, rootMainJsTsPath) {
202
+ var _a, _b;
203
+ const rootMainJsTs = tree.read(rootMainJsTsPath, 'utf-8');
204
+ const mainConfigObject = tsquery_1.tsquery.query(rootMainJsTs, 'ObjectLiteralExpression');
205
+ if ((mainConfigObject === null || mainConfigObject === void 0 ? void 0 : mainConfigObject.length) === 1 &&
206
+ ((_b = (_a = mainConfigObject[0]) === null || _a === void 0 ? void 0 : _a.getText()) === null || _b === void 0 ? void 0 : _b.replace(/\s/g, '')) === '{}') {
207
+ return true;
208
+ }
209
+ }
210
+ //# sourceMappingURL=remove-root-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-root-config.js","sourceRoot":"","sources":["../../../../../../packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts"],"names":[],"mappings":";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,EACZ,yBAAyB,CAC1B,CAAC;IAEF,IACE,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,MAAM,MAAK,CAAC;QAC9B,CAAA,MAAA,MAAA,gBAAgB,CAAC,CAAC,CAAC,0CAAE,OAAO,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,MAAK,IAAI,EAC3D;QACA,OAAO,IAAI,CAAC;KACb;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export default function replacePackage(tree: Tree): Promise<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
6
+ function replacePackage(tree) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ yield (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/storybook', '@nx/storybook');
9
+ yield (0, devkit_1.formatFiles)(tree);
10
+ });
11
+ }
12
+ exports.default = replacePackage;
13
+ //# sourceMappingURL=update-16-0-0-add-nx-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-16-0-0-add-nx-packages.js","sourceRoot":"","sources":["../../../../../../packages/storybook/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAC/C,0EAAuF;AAEvF,SAA8B,cAAc,CAAC,IAAU;;QACrD,MAAM,IAAA,iDAA+B,EACnC,IAAI,EACJ,iBAAiB,EACjB,eAAe,CAChB,CAAC;QAEF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AARD,iCAQC"}
@@ -0,0 +1,5 @@
1
+ export interface CommonNxStorybookConfig {
2
+ uiFramework?: UiFramework;
3
+ }
4
+ export type UiFramework7 = '@storybook/angular' | '@storybook/html-webpack5' | '@storybook/nextjs' | '@storybook/preact-webpack5' | '@storybook/react-webpack5' | '@storybook/react-vite' | '@storybook/server-webpack5' | '@storybook/svelte-webpack5' | '@storybook/svelte-vite' | '@storybook/sveltekit' | '@storybook/vue-webpack5' | '@storybook/vue-vite' | '@storybook/vue3-webpack5' | '@storybook/vue3-vite' | '@storybook/web-components-webpack5' | '@storybook/web-components-vite';
5
+ export type UiFramework = '@storybook/angular' | '@storybook/react' | '@storybook/html' | '@storybook/web-components' | '@storybook/vue' | '@storybook/vue3' | '@storybook/svelte' | '@storybook/react-native';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../packages/storybook/src/utils/models.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ core: { builder: 'webpack5' },
3
+ stories: [
4
+ '../src/app/**/*.stories.mdx',
5
+ '../src/app/**/*.stories.@(js|jsx|ts|tsx)',
6
+ ],
7
+ addons: ['@storybook/addon-essentials', '@nrwl/react/plugins/storybook'],
8
+ };
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": ""
4
+ },
5
+ "exclude": [
6
+ "../**/*.spec.ts",
7
+ "../**/*.spec.js",
8
+ "../**/*.spec.tsx",
9
+ "../**/*.spec.jsx"
10
+ ],
11
+ "include": [
12
+ "../src/**/*.stories.ts",
13
+ "../src/**/*.stories.js",
14
+ "../src/**/*.stories.jsx",
15
+ "../src/**/*.stories.tsx",
16
+ "../src/**/*.stories.mdx",
17
+ "*.js"
18
+ ]
19
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function createTestUILibNoNgDevkit(appTree: Tree, libName: string): Promise<Tree>;
3
+ export declare function deleteNewConfigurationAndCreateNew(appTree: Tree, projectStorybookRoot: string): Tree;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteNewConfigurationAndCreateNew = exports.createTestUILibNoNgDevkit = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const js_1 = require("@nx/js");
6
+ const linter_1 = require("@nx/linter");
7
+ function createTestUILibNoNgDevkit(appTree, libName) {
8
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
+ yield (0, js_1.libraryGenerator)(appTree, {
10
+ linter: linter_1.Linter.EsLint,
11
+ skipFormat: true,
12
+ skipTsConfig: false,
13
+ unitTestRunner: 'none',
14
+ name: libName,
15
+ });
16
+ return appTree;
17
+ });
18
+ }
19
+ exports.createTestUILibNoNgDevkit = createTestUILibNoNgDevkit;
20
+ function deleteNewConfigurationAndCreateNew(appTree, projectStorybookRoot) {
21
+ // Remove new Storybook configuration
22
+ appTree.delete(`.storybook/main.js`);
23
+ appTree.delete(`.storybook/tsconfig.json`);
24
+ appTree.delete(`${projectStorybookRoot}/main.js`);
25
+ appTree.delete(`${projectStorybookRoot}/preview.js`);
26
+ appTree.delete(`${projectStorybookRoot}/tsconfig.json`);
27
+ // Create old Storybook configuration
28
+ appTree.write(`.storybook/addons.js`, 'console.log("hello")');
29
+ appTree.write(`.storybook/webpack.config.js`, 'console.log("hello")');
30
+ appTree.write(`.storybook/tsconfig.json`, '{"test": "hello"}');
31
+ appTree.write(`${projectStorybookRoot}/config.js`, 'console.log("hello")');
32
+ appTree.write(`${projectStorybookRoot}/addons.js`, 'console.log("hello")');
33
+ appTree.write(`${projectStorybookRoot}/webpack.config.js`, 'console.log("hello")');
34
+ appTree.write(`${projectStorybookRoot}/tsconfig.json`, '{"test": "hello"}');
35
+ return appTree;
36
+ }
37
+ exports.deleteNewConfigurationAndCreateNew = deleteNewConfigurationAndCreateNew;
38
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../pack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B,CAAC,CAAC;IAE5E,OAAO,OAAO,CAAC;AACjB,CAAC;AAxBD,gFAwBC"}
@@ -0,0 +1,53 @@
1
+ import { TargetConfiguration, Tree } from '@nx/devkit';
2
+ import { CompilerOptions } from 'typescript';
3
+ import ts = require('typescript');
4
+ export declare const Constants: {
5
+ addonDependencies: string[];
6
+ tsConfigExclusions: string[];
7
+ pkgJsonScripts: {
8
+ storybook: string;
9
+ };
10
+ jsonIndentLevel: number;
11
+ coreAddonPrefix: string;
12
+ uiFrameworks: {
13
+ readonly angular: "@storybook/angular";
14
+ readonly react: "@storybook/react";
15
+ readonly html: "@storybook/html";
16
+ readonly 'web-components': "@storybook/web-components";
17
+ readonly vue: "@storybook/vue";
18
+ readonly vue3: "@storybook/vue3";
19
+ readonly svelte: "@storybook/svelte";
20
+ readonly 'react-native': "@storybook/react-native";
21
+ };
22
+ uiFrameworks7: string[];
23
+ };
24
+ export declare function isStorybookV7(): boolean;
25
+ export declare function storybookMajorVersion(): number;
26
+ export declare function safeFileDelete(tree: Tree, path: string): boolean;
27
+ export declare function readCurrentWorkspaceStorybookVersionFromGenerator(tree: Tree): string;
28
+ export declare function readCurrentWorkspaceStorybookVersionFromExecutor(): string;
29
+ export type TsConfig = {
30
+ extends: string;
31
+ compilerOptions: CompilerOptions;
32
+ files?: string[];
33
+ include?: string[];
34
+ exclude?: string[];
35
+ references?: Array<{
36
+ path: string;
37
+ }>;
38
+ };
39
+ export declare function storybookConfigExistsCheck(config: string, projectName: string): void;
40
+ export declare function dedupe(arr: string[]): string[];
41
+ export declare function findStorybookAndBuildTargetsAndCompiler(targets: {
42
+ [targetName: string]: TargetConfiguration;
43
+ }): {
44
+ storybookBuildTarget?: string;
45
+ storybookTarget?: string;
46
+ ngBuildTarget?: string;
47
+ nextBuildTarget?: string;
48
+ viteBuildTarget?: string;
49
+ otherBuildTarget?: string;
50
+ compiler?: string;
51
+ };
52
+ export declare function isTheFileAStory(tree: Tree, path: string): boolean;
53
+ export declare function getTsSourceFile(host: Tree, path: string): ts.SourceFile;