@nx/storybook 23.3.0-beta.0 → 23.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,19 +126,34 @@ async function buildStorybookTargets(configFilePath, projectRoot, options, conte
126
126
  // Falls back to the storybook build target, whose name is configurable, so
127
127
  // resolve it from the options rather than assuming the default.
128
128
  const browserTarget = `${projectName}:${angularBuildTarget ?? options.buildStorybookTargetName}`;
129
- targets[options.buildStorybookTargetName] = buildTarget(namedInputs, buildOutputs, projectRoot, frameworkIsAngular, browserTarget, configFilePath, hasTestRunner);
130
- targets[options.serveStorybookTargetName] = serveTarget(projectRoot, frameworkIsAngular, browserTarget, configFilePath);
129
+ const inputs = storybookInputs(namedInputs, frameworkIsAngular, hasTestRunner);
130
+ targets[options.buildStorybookTargetName] = buildTarget(inputs, buildOutputs, projectRoot, frameworkIsAngular, browserTarget, configFilePath);
131
+ targets[options.serveStorybookTargetName] = serveTarget(projectRoot, frameworkIsAngular, browserTarget, configFilePath, inputs);
131
132
  if (usesVitestAddon) {
132
133
  targets[options.testStorybookTargetName] = vitestTestTarget(projectRoot);
133
134
  }
134
135
  else if (hasTestRunner) {
135
136
  targets[options.testStorybookTargetName] = testTarget(projectRoot);
136
137
  }
137
- targets[options.staticStorybookTargetName] = serveStaticTarget(options, projectRoot);
138
+ targets[options.staticStorybookTargetName] = serveStaticTarget(options, projectRoot, inputs);
138
139
  (0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
139
140
  return targets;
140
141
  }
141
- function buildTarget(namedInputs, outputs, projectRoot, frameworkIsAngular, browserTarget, configFilePath, hasTestRunner) {
142
+ function storybookInputs(namedInputs, frameworkIsAngular, hasTestRunner) {
143
+ return [
144
+ ...('production' in namedInputs
145
+ ? ['production', '^production']
146
+ : ['default', '^default']),
147
+ {
148
+ externalDependencies: [
149
+ 'storybook',
150
+ frameworkIsAngular ? '@storybook/angular' : undefined,
151
+ hasTestRunner ? '@storybook/test-runner' : undefined,
152
+ ].filter(Boolean),
153
+ },
154
+ ];
155
+ }
156
+ function buildTarget(inputs, outputs, projectRoot, frameworkIsAngular, browserTarget, configFilePath) {
142
157
  let targetConfig;
143
158
  if (frameworkIsAngular) {
144
159
  targetConfig = {
@@ -151,18 +166,7 @@ function buildTarget(namedInputs, outputs, projectRoot, frameworkIsAngular, brow
151
166
  },
152
167
  cache: true,
153
168
  outputs,
154
- inputs: [
155
- ...('production' in namedInputs
156
- ? ['production', '^production']
157
- : ['default', '^default']),
158
- {
159
- externalDependencies: [
160
- 'storybook',
161
- '@storybook/angular',
162
- hasTestRunner ? '@storybook/test-runner' : undefined,
163
- ].filter(Boolean),
164
- },
165
- ],
169
+ inputs: [...inputs],
166
170
  };
167
171
  }
168
172
  else {
@@ -171,25 +175,16 @@ function buildTarget(namedInputs, outputs, projectRoot, frameworkIsAngular, brow
171
175
  options: { cwd: projectRoot },
172
176
  cache: true,
173
177
  outputs,
174
- inputs: [
175
- ...('production' in namedInputs
176
- ? ['production', '^production']
177
- : ['default', '^default']),
178
- {
179
- externalDependencies: [
180
- 'storybook',
181
- hasTestRunner ? '@storybook/test-runner' : undefined,
182
- ].filter(Boolean),
183
- },
184
- ],
178
+ inputs: [...inputs],
185
179
  };
186
180
  }
187
181
  return targetConfig;
188
182
  }
189
- function serveTarget(projectRoot, frameworkIsAngular, browserTarget, configFilePath) {
183
+ function serveTarget(projectRoot, frameworkIsAngular, browserTarget, configFilePath, inputs) {
190
184
  if (frameworkIsAngular) {
191
185
  return {
192
186
  continuous: true,
187
+ inputs: [...inputs],
193
188
  executor: '@storybook/angular:start-storybook',
194
189
  options: {
195
190
  configDir: `${(0, path_1.dirname)(configFilePath)}`,
@@ -204,6 +199,7 @@ function serveTarget(projectRoot, frameworkIsAngular, browserTarget, configFileP
204
199
  else {
205
200
  return {
206
201
  continuous: true,
202
+ inputs: [...inputs],
207
203
  command: `storybook dev`,
208
204
  options: { cwd: projectRoot },
209
205
  };
@@ -239,10 +235,11 @@ function vitestTestTarget(projectRoot) {
239
235
  };
240
236
  return targetConfig;
241
237
  }
242
- function serveStaticTarget(options, projectRoot) {
238
+ function serveStaticTarget(options, projectRoot, inputs) {
243
239
  const targetConfig = {
244
240
  dependsOn: [`${options.buildStorybookTargetName}`],
245
241
  continuous: true,
242
+ inputs: [...inputs],
246
243
  executor: '@nx/web:file-server',
247
244
  options: {
248
245
  buildTarget: `${options.buildStorybookTargetName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/storybook",
3
- "version": "23.3.0-beta.0",
3
+ "version": "23.3.0-beta.1",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -92,18 +92,18 @@
92
92
  "@phenomnomnominal/tsquery": "~6.2.0",
93
93
  "semver": "^7.6.3",
94
94
  "tslib": "^2.3.0",
95
- "@nx/devkit": "23.3.0-beta.0",
96
- "@nx/cypress": "23.3.0-beta.0",
97
- "@nx/js": "23.3.0-beta.0",
98
- "@nx/eslint": "23.3.0-beta.0"
95
+ "@nx/devkit": "23.3.0-beta.1",
96
+ "@nx/cypress": "23.3.0-beta.1",
97
+ "@nx/js": "23.3.0-beta.1",
98
+ "@nx/eslint": "23.3.0-beta.1"
99
99
  },
100
100
  "devDependencies": {
101
101
  "storybook": "9.0.6",
102
- "nx": "23.3.0-beta.0"
102
+ "nx": "23.3.0-beta.1"
103
103
  },
104
104
  "peerDependencies": {
105
105
  "storybook": ">=8.0.0 <11.0.0",
106
- "@nx/web": "23.3.0-beta.0"
106
+ "@nx/web": "23.3.0-beta.1"
107
107
  },
108
108
  "peerDependenciesMeta": {
109
109
  "@nx/web": {