@storybook/tanstack-react 10.4.0-alpha.18 → 10.4.0-beta.0

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.
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_846xwv5762j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_846xwv5762j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_846xwv5762j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_5ps5vfkz92i from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_5ps5vfkz92i from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_5ps5vfkz92i from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_846xwv5762j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_846xwv5762j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_846xwv5762j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_5ps5vfkz92i.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_5ps5vfkz92i.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_5ps5vfkz92i.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_846xwv5762j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_846xwv5762j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_846xwv5762j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_5ps5vfkz92i from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_5ps5vfkz92i from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_5ps5vfkz92i from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_846xwv5762j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_846xwv5762j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_846xwv5762j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_5ps5vfkz92i.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_5ps5vfkz92i.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_5ps5vfkz92i.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -215,21 +215,49 @@ function stripServerOption(options) {
215
215
  return (t.isIdentifier(key) ? key.name : void 0) !== "server";
216
216
  }), options.properties.length !== initialLength;
217
217
  }
218
- function eliminateDeadImports(programPath) {
219
- let referencedIdentifiers = /* @__PURE__ */ new Set();
220
- programPath.traverse({
218
+ function collectReferencedIdentifiers(programPath) {
219
+ let referenced = /* @__PURE__ */ new Set();
220
+ return programPath.traverse({
221
221
  enter(path2) {
222
222
  let { node } = path2;
223
- !t.isIdentifier(node) || path2.isBindingIdentifier() || path2.findParent((p) => p.isImportDeclaration()) || referencedIdentifiers.add(node.name);
223
+ !t.isIdentifier(node) || path2.isBindingIdentifier() || path2.findParent((p) => p.isImportDeclaration()) || referenced.add(node.name);
224
+ }
225
+ }), referenced;
226
+ }
227
+ function removeDeadTopLevelDeclarations(programPath) {
228
+ let referenced = collectReferencedIdentifiers(programPath), removed = !1;
229
+ for (let stmtPath of programPath.get("body"))
230
+ if (!(stmtPath.isImportDeclaration() || stmtPath.isExportDeclaration())) {
231
+ if (stmtPath.isFunctionDeclaration()) {
232
+ let id = stmtPath.node.id;
233
+ id && !referenced.has(id.name) && (stmtPath.remove(), removed = !0);
234
+ continue;
235
+ }
236
+ stmtPath.isVariableDeclaration() && stmtPath.get("declarations").every((declPath) => {
237
+ if (!t.isIdentifier(declPath.node.id) || referenced.has(declPath.node.id.name)) return !1;
238
+ let initPath = declPath.get("init");
239
+ return !declPath.node.init || initPath.isPure();
240
+ }) && (stmtPath.remove(), removed = !0);
224
241
  }
225
- }), programPath.traverse({
242
+ return removed;
243
+ }
244
+ function removeDeadImportSpecifiers(programPath) {
245
+ let referenced = collectReferencedIdentifiers(programPath), removed = !1;
246
+ return programPath.traverse({
226
247
  ImportDeclaration(path2) {
227
- let specifiers = path2.node.specifiers.filter(
228
- (spec) => referencedIdentifiers.has(spec.local.name)
229
- );
230
- specifiers.length === 0 ? path2.remove() : specifiers.length !== path2.node.specifiers.length && (path2.node.specifiers = specifiers);
248
+ if (path2.node.specifiers.length === 0)
249
+ return;
250
+ let specifiers = path2.node.specifiers.filter((spec) => referenced.has(spec.local.name));
251
+ specifiers.length === 0 ? (path2.remove(), removed = !0) : specifiers.length !== path2.node.specifiers.length && (path2.node.specifiers = specifiers, removed = !0);
231
252
  }
232
- });
253
+ }), removed;
254
+ }
255
+ function eliminateDeadImports(programPath) {
256
+ let changed = !0;
257
+ for (; changed; ) {
258
+ let d = removeDeadTopLevelDeclarations(programPath), i = removeDeadImportSpecifiers(programPath);
259
+ changed = d || i;
260
+ }
233
261
  }
234
262
 
235
263
  // src/plugins/server-only-stub.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/tanstack-react",
3
- "version": "10.4.0-alpha.18",
3
+ "version": "10.4.0-beta.0",
4
4
  "description": "Storybook for TanStack (React, Vite): Router and Start ready Storybook framework",
5
5
  "keywords": [
6
6
  "storybook",
@@ -75,9 +75,9 @@
75
75
  "!src/**/*"
76
76
  ],
77
77
  "dependencies": {
78
- "@storybook/builder-vite": "10.4.0-alpha.18",
79
- "@storybook/react": "10.4.0-alpha.18",
80
- "@storybook/react-vite": "10.4.0-alpha.18"
78
+ "@storybook/builder-vite": "10.4.0-beta.0",
79
+ "@storybook/react": "10.4.0-beta.0",
80
+ "@storybook/react-vite": "10.4.0-beta.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@tanstack/react-router": "^1.168.10",
@@ -95,7 +95,7 @@
95
95
  "@tanstack/start-client-core": "^1.167.9",
96
96
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
97
97
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
98
- "storybook": "^10.4.0-alpha.18",
98
+ "storybook": "^10.4.0-beta.0",
99
99
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
100
100
  },
101
101
  "peerDependenciesMeta": {