Nx: @nrwl/storybook: migrate to new storybook configuration - >=5.3

Created on 13 May 2020  路  4Comments  路  Source: nrwl/nx

This is a feature request

things to be done:

  • update storybook schematics
  • provide migrations from old to new sb config

Expected Behavior

Use new storybook configuration (post v5.3) when running schematics
-> https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#to-mainjs-configuration

as the currently used is "soft-deprecated"

image

Current Behavior

schematics are using pre 5.3 configuration

Context

  @nrwl/angular : Not Found
  @nrwl/cli : 9.2.4
  @nrwl/cypress : 9.2.4
  @nrwl/eslint-plugin-nx : 9.2.4
  @nrwl/express : Not Found
  @nrwl/jest : 9.2.4
  @nrwl/linter : 9.2.4
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 9.2.4
  @nrwl/react : 9.2.4
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.2.4
  @nrwl/web : 9.2.4
  @nrwl/workspace : 9.2.4
  typescript : 3.8.3
storybook feature

Most helpful comment

Hi @Hotell ! We are working on the Storybook 6 upgrade at the moment! I think this will solve this issue! :) This is still a draft pull request!

All 4 comments

Agreed, the new storybook main.js setup is much cleaner and easier.

My new main main.js file (./storybook in the repo root)

module.exports = {
  stories: ['../src/**/*.stories.tsx'],
  addons: ['@storybook/addon-knobs'],
};

My new main.js file in the project that uses storybook:

const main = require('../../../../.storybook/main');
module.exports = main;

Should be a small change?
How would I got about making a PR? :)

Agreed too, new storybook configuration is much better and change should be done before current config become depreciated...

The change will be a possible breaking change to nx plugin without providing solid migrations ( which might be difficult to implement ).

What I propose instead:

  • create new opt in schematic config flag, that will generate new storybook config if provided or set within workspace.json

Hi @Hotell ! We are working on the Storybook 6 upgrade at the moment! I think this will solve this issue! :) This is still a draft pull request!

Was this page helpful?
0 / 5 - 0 ratings