nx-plus icon indicating copy to clipboard operation
nx-plus copied to clipboard

Add Storybook support

Open mehrad-rafigh opened this issue 4 years ago • 11 comments

Description

I would to use storybook with nx-plus and vue

Motivation

Nx supports storybook for angular and react

Suggested Implementation

We can take inspiration from nx and the way they implemented the schematics and builder

mehrad-rafigh avatar Jan 18 '21 10:01 mehrad-rafigh

@BuckyMaler @ZachJW34 I would like to add the ability. Is that ok?

mehrad-rafigh avatar Jan 19 '21 14:01 mehrad-rafigh

@mehrad-rafigh Go for it! Reach out if you have any questions.

ZachJW34 avatar Jan 19 '21 15:01 ZachJW34

@mehrad-rafigh any update on this? Need any help in developing the feature?

LuckeeDev avatar Apr 27 '21 11:04 LuckeeDev

@LuckeeDev I have not found the time to develop this. You can grab this issue and start programming :)

mehrad-rafigh avatar Apr 27 '21 13:04 mehrad-rafigh

@mehrad-rafigh yes, I can take a look at it!

LuckeeDev avatar Apr 27 '21 14:04 LuckeeDev

do you have a repo that you have successfully configure storybook for a vue library in nx that can be used as a template for future development?

JoA-MoS avatar Jun 09 '21 03:06 JoA-MoS

I am currently working on a PoC to migrate to Nx and possibly convince of its benefits but this is a show stopper, @LuckeeDev any help needed, are you currently working on this?

danielquintero avatar Jun 30 '21 19:06 danielquintero

@danielquintero sadly, I've not had the time to work on this :(

LuckeeDev avatar Jul 01 '21 10:07 LuckeeDev

Is there an estimate if and when this feature will be available? I would like to do something for it myself, but my skills are not enough.

SvenBudak avatar Jul 21 '21 10:07 SvenBudak

The solution is pretty easy (for nuxt), but it took me several hours to get there.

  1. Install nuxt/Storybook as mentioned here: https://storybook.nuxtjs.org/getting-started/installation/
  2. Add the following to your nuxt-targets in workspace.json|angular.json|project.json (replace the value of cwd with the path of your app):
    "storybook": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "cwd": "apps/cockpit-app",
        "command": "npx nuxt storybook --ci",
        "parallel": false
      }
    },
    "build-storybook": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "cwd": "apps/cockpit-app",
        "command": "npx nuxt storybook build",
        "parallel": false
      }
    }
  1. Add "build-storybook" to tasksRunnerOptions.default.options.cacheableOperations in nx.json
  2. If you want to have your storybook-builds in dist you can achieve that with -o. In my case I replaced the command of build-storybook with npx nuxt storybook build -o ../../dist/apps/cockpit-app-storybook

nidomiro avatar Aug 14 '21 06:08 nidomiro

Please do it someone, who has the time for it, really cool and important thing

TrayHard avatar Mar 31 '22 13:03 TrayHard