@nx/storybook 0.0.0-pr-22179-271588f

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 (83) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +68 -0
  3. package/executors.json +14 -0
  4. package/generators.json +31 -0
  5. package/index.d.ts +4 -0
  6. package/index.js +12 -0
  7. package/migrations.json +968 -0
  8. package/package.json +46 -0
  9. package/plugin.d.ts +1 -0
  10. package/plugin.js +6 -0
  11. package/presets/cypress.d.ts +1 -0
  12. package/presets/cypress.js +11 -0
  13. package/src/executors/build-storybook/build-storybook.impl.d.ts +5 -0
  14. package/src/executors/build-storybook/build-storybook.impl.js +27 -0
  15. package/src/executors/build-storybook/schema.json +121 -0
  16. package/src/executors/storybook/schema.json +125 -0
  17. package/src/executors/storybook/storybook.impl.d.ts +9 -0
  18. package/src/executors/storybook/storybook.impl.js +30 -0
  19. package/src/generators/configuration/configuration.d.ts +5 -0
  20. package/src/generators/configuration/configuration.js +166 -0
  21. package/src/generators/configuration/lib/edit-root-tsconfig.d.ts +8 -0
  22. package/src/generators/configuration/lib/edit-root-tsconfig.js +35 -0
  23. package/src/generators/configuration/lib/ensure-dependencies.d.ts +6 -0
  24. package/src/generators/configuration/lib/ensure-dependencies.js +70 -0
  25. package/src/generators/configuration/lib/interaction-testing.utils.d.ts +5 -0
  26. package/src/generators/configuration/lib/interaction-testing.utils.js +62 -0
  27. package/src/generators/configuration/lib/util-functions.d.ts +35 -0
  28. package/src/generators/configuration/lib/util-functions.js +571 -0
  29. package/src/generators/configuration/project-files/.storybook/main.js__tmpl__ +63 -0
  30. package/src/generators/configuration/project-files/.storybook/preview.js__tmpl__ +0 -0
  31. package/src/generators/configuration/project-files/.storybook/tsconfig.json__tmpl__ +15 -0
  32. package/src/generators/configuration/project-files-ts/.storybook/main.ts__tmpl__ +63 -0
  33. package/src/generators/configuration/project-files-ts/.storybook/preview.ts__tmpl__ +0 -0
  34. package/src/generators/configuration/project-files-ts/.storybook/tsconfig.json__tmpl__ +16 -0
  35. package/src/generators/configuration/schema.d.ts +28 -0
  36. package/src/generators/configuration/schema.json +101 -0
  37. package/src/generators/cypress-project/cypress-project.d.ts +15 -0
  38. package/src/generators/cypress-project/cypress-project.js +118 -0
  39. package/src/generators/cypress-project/files/cypress.config.ts__tpl__ +6 -0
  40. package/src/generators/cypress-project/schema.json +54 -0
  41. package/src/generators/init/init.d.ts +5 -0
  42. package/src/generators/init/init.js +83 -0
  43. package/src/generators/init/lib/update-gitignore.d.ts +2 -0
  44. package/src/generators/init/lib/update-gitignore.js +16 -0
  45. package/src/generators/init/schema.d.ts +7 -0
  46. package/src/generators/init/schema.json +31 -0
  47. package/src/generators/migrate-7/calling-storybook-cli.d.ts +13 -0
  48. package/src/generators/migrate-7/calling-storybook-cli.js +86 -0
  49. package/src/generators/migrate-7/files/storybook-migration-summary.md__tmpl__ +80 -0
  50. package/src/generators/migrate-7/helper-functions.d.ts +69 -0
  51. package/src/generators/migrate-7/helper-functions.js +448 -0
  52. package/src/generators/migrate-7/migrate-7.d.ts +4 -0
  53. package/src/generators/migrate-7/migrate-7.js +68 -0
  54. package/src/generators/migrate-7/schema.d.ts +7 -0
  55. package/src/generators/migrate-7/schema.json +35 -0
  56. package/src/migrations/update-15-0-0/add-storybook-inputs.d.ts +2 -0
  57. package/src/migrations/update-15-0-0/add-storybook-inputs.js +41 -0
  58. package/src/migrations/update-15-4-6/refactor-executor-options.d.ts +2 -0
  59. package/src/migrations/update-15-4-6/refactor-executor-options.js +65 -0
  60. package/src/migrations/update-15-5-3/ensure-webpack-package.d.ts +2 -0
  61. package/src/migrations/update-15-5-3/ensure-webpack-package.js +29 -0
  62. package/src/migrations/update-15-7-0/add-addon-essentials-to-all.d.ts +24 -0
  63. package/src/migrations/update-15-7-0/add-addon-essentials-to-all.js +271 -0
  64. package/src/migrations/update-15-7-0/remove-root-config.d.ts +14 -0
  65. package/src/migrations/update-15-7-0/remove-root-config.js +205 -0
  66. package/src/migrations/update-16-0-0/update-sb-7.d.ts +2 -0
  67. package/src/migrations/update-16-0-0/update-sb-7.js +30 -0
  68. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  69. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
  70. package/src/migrations/update-16-1-0/eslint-ignore-react-plugin.d.ts +2 -0
  71. package/src/migrations/update-16-1-0/eslint-ignore-react-plugin.js +38 -0
  72. package/src/migrations/update-16-5-0/move-storybook-tsconfig.d.ts +2 -0
  73. package/src/migrations/update-16-5-0/move-storybook-tsconfig.js +20 -0
  74. package/src/plugins/plugin.d.ts +9 -0
  75. package/src/plugins/plugin.js +232 -0
  76. package/src/utils/models.d.ts +1 -0
  77. package/src/utils/models.js +2 -0
  78. package/src/utils/testing.d.ts +3 -0
  79. package/src/utils/testing.js +34 -0
  80. package/src/utils/utilities.d.ts +43 -0
  81. package/src/utils/utilities.js +246 -0
  82. package/src/utils/versions.d.ts +11 -0
  83. package/src/utils/versions.js +14 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2017-2023 Narwhal Technologies Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,68 @@
1
+ <p style="text-align: center;">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
+ <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
+ </picture>
6
+ </p>
7
+
8
+ <div style="text-align: center;">
9
+
10
+ [![CircleCI](https://circleci.com/gh/nrwl/nx.svg?style=svg)](https://circleci.com/gh/nrwl/nx)
11
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
12
+ [![NPM Version](https://badge.fury.io/js/%40nrwl%2Fworkspace.svg)](https://www.npmjs.com/@nx/workspace)
13
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
14
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
15
+ [![Join the chat at https://gitter.im/nrwl-nx/community](https://badges.gitter.im/nrwl-nx/community.svg)](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
16
+ [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
17
+
18
+ </div>
19
+
20
+
21
+ <hr>
22
+
23
+ # Nx: Smart Monorepos · Fast CI
24
+
25
+ Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
26
+
27
+ This package is a [Storybook plugin for Nx](https://nx.dev/packages/storybook).
28
+
29
+ ## Getting Started
30
+
31
+ ### Creating an Nx Workspace
32
+
33
+ **Using `npx`**
34
+
35
+ ```bash
36
+ npx create-nx-workspace
37
+ ```
38
+
39
+ **Using `npm init`**
40
+
41
+ ```bash
42
+ npm init nx-workspace
43
+ ```
44
+
45
+ **Using `yarn create`**
46
+
47
+ ```bash
48
+ yarn create nx-workspace
49
+ ```
50
+
51
+ ### Adding Nx to an Existing Repository
52
+
53
+ Run:
54
+
55
+ ```bash
56
+ npx nx@latest init
57
+ ```
58
+
59
+ ## Documentation & Resources
60
+
61
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
62
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
63
+ - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
64
+ - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
65
+
66
+ <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
67
+ width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
68
+
package/executors.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "executors": {
3
+ "storybook": {
4
+ "implementation": "./src/executors/storybook/storybook.impl",
5
+ "schema": "./src/executors/storybook/schema.json",
6
+ "description": "Serve Storybook."
7
+ },
8
+ "build": {
9
+ "implementation": "./src/executors/build-storybook/build-storybook.impl",
10
+ "schema": "./src/executors/build-storybook/schema.json",
11
+ "description": "Build Storybook."
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "Nx Storybook",
3
+ "version": "0.1",
4
+ "generators": {
5
+ "init": {
6
+ "factory": "./src/generators/init/init#initGeneratorInternal",
7
+ "schema": "./src/generators/init/schema.json",
8
+ "description": "Add Storybook configuration to the workspace.",
9
+ "aliases": ["ng-add"],
10
+ "hidden": true
11
+ },
12
+ "configuration": {
13
+ "factory": "./src/generators/configuration/configuration#configurationGeneratorInternal",
14
+ "schema": "./src/generators/configuration/schema.json",
15
+ "description": "Add Storybook configuration to a UI library or an application.",
16
+ "hidden": false
17
+ },
18
+ "cypress-project": {
19
+ "factory": "./src/generators/cypress-project/cypress-project",
20
+ "schema": "./src/generators/cypress-project/schema.json",
21
+ "description": "Add cypress e2e app to test a UI library that is set up for Storybook.",
22
+ "hidden": false
23
+ },
24
+ "migrate-7": {
25
+ "factory": "./src/generators/migrate-7/migrate-7",
26
+ "schema": "./src/generators/migrate-7/schema.json",
27
+ "description": "Migrate to Storybook version 7.",
28
+ "hidden": false
29
+ }
30
+ }
31
+ }
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { configurationGenerator } from './src/generators/configuration/configuration';
2
+ export { cypressProjectGenerator } from './src/generators/cypress-project/cypress-project';
3
+ export { storybookVersion } from './src/utils/versions';
4
+ export { interactionTestsDependencies, addInteractionsInAddons, } from './src/generators/configuration/lib/interaction-testing.utils';
package/index.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addInteractionsInAddons = exports.interactionTestsDependencies = exports.storybookVersion = exports.cypressProjectGenerator = exports.configurationGenerator = void 0;
4
+ var configuration_1 = require("./src/generators/configuration/configuration");
5
+ Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return configuration_1.configurationGenerator; } });
6
+ var cypress_project_1 = require("./src/generators/cypress-project/cypress-project");
7
+ Object.defineProperty(exports, "cypressProjectGenerator", { enumerable: true, get: function () { return cypress_project_1.cypressProjectGenerator; } });
8
+ var versions_1 = require("./src/utils/versions");
9
+ Object.defineProperty(exports, "storybookVersion", { enumerable: true, get: function () { return versions_1.storybookVersion; } });
10
+ var interaction_testing_utils_1 = require("./src/generators/configuration/lib/interaction-testing.utils");
11
+ Object.defineProperty(exports, "interactionTestsDependencies", { enumerable: true, get: function () { return interaction_testing_utils_1.interactionTestsDependencies; } });
12
+ Object.defineProperty(exports, "addInteractionsInAddons", { enumerable: true, get: function () { return interaction_testing_utils_1.addInteractionsInAddons; } });