Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nrwl/storybook Set Project/App to take build config #3655

Closed
ChazUK opened this issue Sep 4, 2020 · 10 comments · Fixed by #4099
Closed

@nrwl/storybook Set Project/App to take build config #3655

ChazUK opened this issue Sep 4, 2020 · 10 comments · Fixed by #4099
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: question / discussion

Comments

@ChazUK
Copy link

ChazUK commented Sep 4, 2020

I'm running Storybook on an Angular project for a UI library. When running nx run ui:storybook the build configuration is taken from the defaultProject property in angular.json

info => Using angular project 'default-app' for configuring Storybook.

Is it possible to set build configs for each storybook implementation, or point the builder to a specifically configure app within the monorepo?

@webberwang
Copy link
Contributor

Couldn't you modify workspace.json storybook.builder?

@ChazUK
Copy link
Author

ChazUK commented Sep 10, 2020

@webberwang I'm using Angular, so I'm guessing you mean angular.json in the root.

my build config is

"storybook": {
  "builder": "@nrwl/storybook:build",
  "options": {
    "uiFramework": "@storybook/angular",
    "outputPath": "dist/libs/ui/dist/storybook",
    "config": {
      "configFolder": "libs/ui/.storybook"
    }
  },
  "configurations": {
    "ci": {
      "quiet": true
    }
  }
},

From what I can tell there is no option to select a specific application to use as it's default config https://github.com/nrwl/nx/blob/master/packages/storybook/src/builders/build-storybook/schema.json

@vsavkin vsavkin added type: question / discussion scope: storybook Issues related to Storybook support in Nx and removed type: bug labels Sep 15, 2020
@wontondon
Copy link

Something is off about the way the workspace.json generated by nx is used with @storybook/angular. I have tracked it down and storybook is looking for a project to load its configuration by looking for a project called storybook, then the workspace/angular default, and finally falling back to the first project in the list. https://github.com/storybookjs/storybook/blob/v6.0.28/app/angular/src/server/angular-cli_config.ts#L63

Locally I skipped this logic and when you return null it loads the custom configuration that nx generated. In my env I was getting an error and storybook was working at all before I made these local changes.

@hiepxanh
Copy link
Contributor

I belive this issues belong to this storybookjs/storybook#12565

image

currently it's 6.1.0-rc.4

@hiepxanh
Copy link
Contributor

BTW PR is storybookjs/storybook#12565

@hiepxanh
Copy link
Contributor

It look like not really play nice with NX
https://github.com/storybookjs/storybook/pull/12565/files#diff-06da7c89bd3e3f47d96985acf2534485007ca1bb0225582f43f694a7862a6a70R73-R82
He is trying to use enviroment variable
image

What is NX using to define the current project name sir? @vsavkin

@hiepxanh
Copy link
Contributor

Awww, found this, creating my own enviroment variable match with that PR and voila 😄
image

@bopm
Copy link

bopm commented Dec 18, 2020

@vsavkin any news on this one? I just wasted a good hour on finding this one at all.

@hiepxanh
Copy link
Contributor

hiepxanh commented Dec 19, 2020

I created PR but it still delay for a month, no one merge this

@juristr juristr self-assigned this Jan 8, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: question / discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants