nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.63k stars 2.36k forks source link

storybook-configuration generator is not generating global config files #10295

Closed DzmVasileusky closed 2 years ago

DzmVasileusky commented 2 years ago

https://nx.dev/storybook/overview-angular docs here says

When running the Nx Storybook generator, it'll configure the Nx workspace to be able to run Storybook seamlessly. It'll create a global Storybook configuration a project specific Storybook configuration

Current Behavior

No global configuration created. Just empty .storybook folder in root directory

Expected Behavior

<workspace name>/
├── .storybook/
│   ├── main.js
│   ├── tsconfig.json
├── apps/
├── libs/
├── nx.json
├── package.json
├── README.md
└── etc...

is added to the root folder

Steps to Reproduce

Create a project with nx and angular. Create lib project there. Run nx g @nrwl/angular:storybook-configuration <project-name>

Failure Logs

dvasilevsky:web dzmvasilevsky$ nx g @nrwl/angular:storybook-configuration ui-kit
✔ Configure a Cypress e2e app to run against the storybook instance? (Y/n) · false
✔ Automatically generate *.stories.ts files for components declared in this project? (Y/n) · true
✔ Automatically generate *.spec.ts files in the generated Cypress e2e app? (Y/n) · false
.storybook folder already exists at root! Skipping generating files in it.
adding .storybook folder to lib - using Storybook version 6
UPDATE package.json
UPDATE nx.json
CREATE libs/ui-kit/.storybook/main.js
CREATE libs/ui-kit/.storybook/preview.js
CREATE libs/ui-kit/.storybook/tsconfig.json
UPDATE libs/ui-kit/tsconfig.lib.json
UPDATE libs/ui-kit/tsconfig.json
UPDATE libs/ui-kit/project.json
UPDATE tsconfig.base.json
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'crexi@13.3.0',
npm WARN EBADENGINE   required: { node: '16.15.0', npm: '8.10.0' },
npm WARN EBADENGINE   current: { node: 'v17.2.0', npm: '8.1.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'cypress-localstorage-commands@1.5.0',
npm WARN EBADENGINE   required: { node: '10.x || 12.x || 14.x || 15.x || 16.x' },
npm WARN EBADENGINE   current: { node: 'v17.2.0', npm: '8.1.4' }
npm WARN EBADENGINE }
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> crexi@13.3.0 postinstall
> ngcc --create-ivy-entry-points && node ./tools/decorate-angular-cli

 >  NX   Angular CLI has been decorated to enable computation caching.

> crexi@13.3.0 prepare
> husky install

husky - Git hooks installed

added 1247 packages, removed 5 packages, changed 4 packages, and audited 3600 packages in 2m

331 packages are looking for funding
  run `npm fund` for details

25 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
dvasilevsky:web dzmvasilevsky$ nx run ui-kit:storybook

> nx run ui-kit:storybook

Error: Cannot find module '../../../.storybook/main'
Require stack:
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/libs/ui-kit/.storybook/main.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@storybook/core-common/dist/cjs/utils/interpret-require.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@storybook/core-common/dist/cjs/utils/load-custom-presets.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@storybook/core-common/dist/cjs/presets.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@storybook/core-common/dist/cjs/index.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@storybook/core-server/dist/cjs/index.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/@nrwl/storybook/src/executors/storybook/storybook.impl.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/nx/src/config/workspaces.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/nx/src/command-line/run.js
- /Users/dzmvasilevsky/Work/TulaCo/crexi/web/node_modules/nx/bin/run-executor.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/dzmvasilevsky/Work/TulaCo/crexi/web/libs/ui-kit/.storybook/main.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)

          Broken build, fix the error above.
          You may need to refresh the browser.

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target "ui-kit:storybook" failed

   Failed tasks:

   - ui-kit:storybook

   Hint: run the command with --verbose for more details.

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 17.2.0
   OS   : darwin x64
   npm  : 8.1.4

   nx : 13.10.2
   @nrwl/angular : 13.10.2
   @nrwl/cypress : 13.10.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.10.2
   @nrwl/eslint-plugin-nx : 13.10.2
   @nrwl/express : Not Found
   @nrwl/jest : 13.10.2
   @nrwl/js : Not Found
   @nrwl/linter : 13.10.2
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 13.3.1
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.1.5
   @nrwl/web : Not Found
   @nrwl/workspace : 13.10.2
   typescript : 4.6.3
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
     @ng-bootstrap/ng-bootstrap: 6.2.0
     @ngrx/component-store: 13.0.2
     @ngrx/effects: 13.0.2
     @ngrx/entity: 13.0.2
     @ngrx/router-store: 13.0.2
     @ngrx/store: 13.0.2
     @ngrx/store-devtools: 13.0.2
     @nguniversal/builders: 13.1.0
     @nguniversal/express-engine: 13.1.0
     @storybook/angular: 6.4.22
     ng-mocks: 13.4.2
DzmVasileusky commented 2 years ago

The problem was in empty .storybook folder inside root. That's why generator skipped creating it.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.