Skip to content

Commit

Permalink
feat(storybook): infer continuous tasks for storybook serve and serve…
Browse files Browse the repository at this point in the history
…-static
  • Loading branch information
Coly010 committed Feb 17, 2025
1 parent 7078e97 commit 1f91f15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/storybook/src/plugins/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ describe('@nx/storybook/plugin', () => {
},
"serve-storybook": {
"command": "storybook dev",
"continuous": true,
"options": {
"cwd": "my-app",
},
},
"static-storybook": {
"continuous": true,
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "build-storybook",
Expand Down Expand Up @@ -175,6 +177,7 @@ describe('@nx/storybook/plugin', () => {
],
},
"serve-storybook": {
"continuous": true,
"executor": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "my-ng-app:build-storybook",
Expand All @@ -183,6 +186,7 @@ describe('@nx/storybook/plugin', () => {
},
},
"static-storybook": {
"continuous": true,
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "build-storybook",
Expand Down Expand Up @@ -257,11 +261,13 @@ describe('@nx/storybook/plugin', () => {
},
"serve-storybook": {
"command": "storybook dev",
"continuous": true,
"options": {
"cwd": "my-react-lib",
},
},
"static-storybook": {
"continuous": true,
"executor": "@nx/web:file-server",
"options": {
"buildTarget": "build-storybook",
Expand Down
3 changes: 3 additions & 0 deletions packages/storybook/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ function serveTarget(
) {
if (frameworkIsAngular) {
return {
continuous: true,
executor: '@storybook/angular:start-storybook',
options: {
configDir: `${dirname(configFilePath)}`,
Expand All @@ -286,6 +287,7 @@ function serveTarget(
};
} else {
return {
continuous: true,
command: `storybook dev`,
options: { cwd: projectRoot },
};
Expand All @@ -311,6 +313,7 @@ function serveStaticTarget(
projectRoot: string
) {
const targetConfig: TargetConfiguration = {
continuous: true,
executor: '@nx/web:file-server',
options: {
buildTarget: `${options.buildStorybookTargetName}`,
Expand Down

0 comments on commit 1f91f15

Please sign in to comment.