storybook-addon-dependency-previews 0.4.0-beta.6 → 0.4.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.
Files changed (148) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +34 -20
  2. package/dist/addon/index.cjs +27 -22
  3. package/dist/addon/index.d.cts +5 -5
  4. package/dist/addon/index.d.mts +5 -5
  5. package/dist/addon/index.mjs +18 -18
  6. package/dist/addon/preset.cjs +3 -4
  7. package/dist/addon/preset.d.cts +3 -3
  8. package/dist/addon/preset.d.mts +3 -3
  9. package/dist/addon/preset.mjs +3 -3
  10. package/dist/addon/vitePlugin.cjs +22 -17
  11. package/dist/addon/vitePlugin.d.cts +6 -6
  12. package/dist/addon/vitePlugin.d.mts +6 -6
  13. package/dist/addon/vitePlugin.mjs +17 -14
  14. package/dist/blocks/DependencyPreviews.cjs +192 -66
  15. package/dist/blocks/DependencyPreviews.d.cts +4 -4
  16. package/dist/blocks/DependencyPreviews.d.mts +4 -4
  17. package/dist/blocks/DependencyPreviews.mjs +163 -63
  18. package/dist/blocks/index.cjs +1 -1
  19. package/dist/blocks/index.d.cts +1 -1
  20. package/dist/blocks/index.d.mts +1 -1
  21. package/dist/blocks/index.mjs +1 -1
  22. package/dist/cli/sb-deps.cjs +543 -469
  23. package/dist/cli/sb-deps.d.cts +1 -1
  24. package/dist/cli/sb-deps.d.mts +1 -1
  25. package/dist/cli/sb-deps.mjs +517 -461
  26. package/dist/cli/scripts/depcruise.config.cjs +19 -20
  27. package/dist/cli/scripts/depcruise.config.d.cts +4 -4
  28. package/dist/cli/scripts/depcruise.config.d.mts +4 -4
  29. package/dist/cli/scripts/depcruise.config.mjs +19 -19
  30. package/dist/cli/scripts/postprocess.cjs +125 -105
  31. package/dist/cli/scripts/postprocess.cjs.map +1 -1
  32. package/dist/cli/scripts/postprocess.d.cts +1 -1
  33. package/dist/cli/scripts/postprocess.d.mts +1 -1
  34. package/dist/cli/scripts/postprocess.mjs +116 -102
  35. package/dist/cli/scripts/postprocess.mjs.map +1 -1
  36. package/dist/cli/setup/detect.cjs +93 -78
  37. package/dist/cli/setup/detect.d.cts +43 -28
  38. package/dist/cli/setup/detect.d.mts +43 -28
  39. package/dist/cli/setup/detect.mjs +78 -74
  40. package/dist/cli/setup/index.cjs +233 -175
  41. package/dist/cli/setup/index.d.cts +3 -3
  42. package/dist/cli/setup/index.d.mts +3 -3
  43. package/dist/cli/setup/index.mjs +203 -162
  44. package/dist/cli/setup/install.cjs +59 -69
  45. package/dist/cli/setup/install.d.cts +30 -25
  46. package/dist/cli/setup/install.d.mts +30 -25
  47. package/dist/cli/setup/install.mjs +57 -67
  48. package/dist/cli/setup/patchers/main.cjs +130 -97
  49. package/dist/cli/setup/patchers/main.d.cts +17 -14
  50. package/dist/cli/setup/patchers/main.d.mts +17 -14
  51. package/dist/cli/setup/patchers/main.mjs +119 -94
  52. package/dist/cli/setup/patchers/packageJson.cjs +76 -67
  53. package/dist/cli/setup/patchers/packageJson.d.cts +31 -22
  54. package/dist/cli/setup/patchers/packageJson.d.mts +31 -22
  55. package/dist/cli/setup/patchers/packageJson.mjs +72 -63
  56. package/dist/cli/setup/patchers/preview.cjs +342 -229
  57. package/dist/cli/setup/patchers/preview.d.cts +51 -45
  58. package/dist/cli/setup/patchers/preview.d.mts +51 -45
  59. package/dist/cli/setup/patchers/preview.mjs +335 -226
  60. package/dist/cli/setup/prompt.cjs +28 -28
  61. package/dist/cli/setup/prompt.d.cts +14 -8
  62. package/dist/cli/setup/prompt.d.mts +14 -8
  63. package/dist/cli/setup/prompt.mjs +24 -24
  64. package/dist/cli/setup/util.cjs +274 -268
  65. package/dist/cli/setup/util.d.cts +28 -14
  66. package/dist/cli/setup/util.d.mts +28 -14
  67. package/dist/cli/setup/util.mjs +276 -262
  68. package/dist/components/ComponentSourceLink.cjs +53 -31
  69. package/dist/components/ComponentSourceLink.mjs +34 -24
  70. package/dist/components/CopyButton.cjs +98 -71
  71. package/dist/components/CopyButton.mjs +90 -67
  72. package/dist/components/CopyButton.module.css +3 -1
  73. package/dist/components/Expandable.cjs +62 -28
  74. package/dist/components/Expandable.mjs +52 -25
  75. package/dist/components/FullParityStory.cjs +31 -29
  76. package/dist/components/FullParityStory.mjs +26 -26
  77. package/dist/components/PathCopyMolecule.cjs +42 -14
  78. package/dist/components/PathCopyMolecule.mjs +28 -11
  79. package/dist/components/PrimaryPreview.cjs +47 -17
  80. package/dist/components/PrimaryPreview.mjs +39 -15
  81. package/dist/components/SbHeading.cjs +21 -9
  82. package/dist/components/SbHeading.mjs +10 -6
  83. package/dist/components/StoryLink.cjs +48 -27
  84. package/dist/components/StoryLink.mjs +37 -23
  85. package/dist/components/TooltipTrigger.cjs +125 -63
  86. package/dist/components/TooltipTrigger.mjs +108 -59
  87. package/dist/components/TooltipTrigger.module.css +3 -1
  88. package/dist/components/icons/ArrowToRectangleIcon.cjs +15 -11
  89. package/dist/components/icons/ArrowToRectangleIcon.mjs +13 -9
  90. package/dist/components/icons/BuildIcon.cjs +15 -11
  91. package/dist/components/icons/BuildIcon.mjs +13 -9
  92. package/dist/components/icons/CopyIcon.cjs +15 -11
  93. package/dist/components/icons/CopyIcon.mjs +13 -9
  94. package/dist/components/icons/CubeIcon.cjs +15 -11
  95. package/dist/components/icons/CubeIcon.mjs +13 -9
  96. package/dist/components/icons/DoubleChevronDown.cjs +15 -11
  97. package/dist/components/icons/DoubleChevronDown.mjs +13 -9
  98. package/dist/components/icons/ExternalLinkIcon.cjs +15 -11
  99. package/dist/components/icons/ExternalLinkIcon.mjs +13 -9
  100. package/dist/components/icons/EyeOpen.cjs +20 -15
  101. package/dist/components/icons/EyeOpen.mjs +18 -13
  102. package/dist/components/icons/LoadingRipples.cjs +87 -67
  103. package/dist/components/icons/LoadingRipples.mjs +85 -65
  104. package/dist/components/icons/SquaresPlus.cjs +15 -11
  105. package/dist/components/icons/SquaresPlus.mjs +13 -9
  106. package/dist/components/icons/Svg.cjs +27 -23
  107. package/dist/components/icons/Svg.mjs +25 -21
  108. package/dist/components/icons/X.cjs +15 -11
  109. package/dist/components/icons/X.mjs +13 -9
  110. package/dist/config.cjs +3 -4
  111. package/dist/config.d.cts +98 -87
  112. package/dist/config.d.mts +98 -87
  113. package/dist/config.mjs +3 -3
  114. package/dist/constants.cjs +5 -6
  115. package/dist/constants.mjs +4 -4
  116. package/dist/hooks/useDependencyGraph.cjs +53 -39
  117. package/dist/hooks/useDependencyGraph.mjs +53 -35
  118. package/dist/hooks/useDynamicStory.cjs +80 -55
  119. package/dist/hooks/useDynamicStory.mjs +77 -52
  120. package/dist/hooks/useStoryParams.cjs +12 -10
  121. package/dist/hooks/useStoryParams.mjs +8 -8
  122. package/dist/index.cjs +16 -13
  123. package/dist/index.d.cts +45 -8
  124. package/dist/index.d.mts +45 -8
  125. package/dist/index.mjs +18 -8
  126. package/dist/manager.cjs +25 -15
  127. package/dist/manager.d.cts +1 -1
  128. package/dist/manager.d.mts +1 -1
  129. package/dist/manager.mjs +16 -11
  130. package/dist/panels/DefaultAutoDocsLayout.cjs +66 -22
  131. package/dist/panels/DefaultAutoDocsLayout.d.cts +8 -8
  132. package/dist/panels/DefaultAutoDocsLayout.d.mts +8 -8
  133. package/dist/panels/DefaultAutoDocsLayout.mjs +42 -17
  134. package/dist/panels/GraphView.cjs +146 -46
  135. package/dist/panels/GraphView.d.cts +4 -4
  136. package/dist/panels/GraphView.d.mts +4 -4
  137. package/dist/panels/GraphView.mjs +135 -43
  138. package/dist/panels/index.cjs +3 -3
  139. package/dist/panels/index.d.cts +6 -3
  140. package/dist/panels/index.d.mts +6 -3
  141. package/dist/panels/index.mjs +6 -3
  142. package/dist/preview.cjs +17 -15
  143. package/dist/preview.d.cts +5 -5
  144. package/dist/preview.d.mts +6 -6
  145. package/dist/preview.mjs +15 -13
  146. package/dist/types.d.cts +127 -97
  147. package/dist/types.d.mts +127 -97
  148. package/package.json +122 -121
@@ -1,25 +1,39 @@
1
1
  //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
2
+ var __create = Object.create
3
+ var __defProp = Object.defineProperty
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
5
+ var __getOwnPropNames = Object.getOwnPropertyNames
6
+ var __getProtoOf = Object.getPrototypeOf
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty
8
8
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
9
+ if ((from && typeof from === 'object') || typeof from === 'function')
10
+ for (
11
+ var keys = __getOwnPropNames(from), i = 0, n = keys.length, key;
12
+ i < n;
13
+ i++
14
+ ) {
15
+ key = keys[i]
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, {
18
+ get: ((k) => from[k]).bind(null, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
20
+ })
21
+ }
22
+ return to
23
+ }
24
+ var __toESM = (mod, isNodeMode, target) => (
25
+ (target = mod != null ? __create(__getProtoOf(mod)) : {}),
26
+ __copyProps(
27
+ isNodeMode || !mod || !mod.__esModule
28
+ ? __defProp(target, 'default', {
29
+ value: mod,
30
+ enumerable: true,
31
+ })
32
+ : target,
33
+ mod,
34
+ )
35
+ )
22
36
 
23
37
  //#endregion
24
38
 
25
- exports.__toESM = __toESM;
39
+ exports.__toESM = __toESM
@@ -1,29 +1,34 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_addon_vitePlugin = require('./vitePlugin.cjs');
3
- let module$1 = require("module");
4
- module$1 = require_rolldown_runtime.__toESM(module$1);
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs')
2
+ const require_addon_vitePlugin = require('./vitePlugin.cjs')
3
+ let module$1 = require('module')
4
+ module$1 = require_rolldown_runtime.__toESM(module$1)
5
5
 
6
6
  //#region src/addon/index.ts
7
- const require$1 = (0, module$1.createRequire)(require("url").pathToFileURL(__filename).href);
8
- const managerEntries = [require$1.resolve("../manager.mjs")];
7
+ const require$1 = (0, module$1.createRequire)(
8
+ require('url').pathToFileURL(__filename).href,
9
+ )
10
+ const managerEntries = [require$1.resolve('../manager.mjs')]
9
11
  /**
10
- * Storybook addons that this addon depends on. Registering these here means
11
- * users only need to add `'storybook-addon-dependency-previews/addon'` to
12
- * their `main.ts` `addons` array — the docs/links addons are auto-registered.
13
- *
14
- * This must live on the same preset module that Storybook actually loads.
15
- * When users register us via the `/addon` subpath, Storybook loads this file
16
- * directly and ignores `package.json`'s `storybook-addon.preset` field, so
17
- * exporting `addons` only from `preset.ts` is not sufficient.
18
- */
19
- const addons = ["@storybook/addon-docs", "@storybook/addon-links"];
12
+ * Storybook addons that this addon depends on. Registering these here means
13
+ * users only need to add `'storybook-addon-dependency-previews/addon'` to
14
+ * their `main.ts` `addons` array — the docs/links addons are auto-registered.
15
+ *
16
+ * This must live on the same preset module that Storybook actually loads.
17
+ * When users register us via the `/addon` subpath, Storybook loads this file
18
+ * directly and ignores `package.json`'s `storybook-addon.preset` field, so
19
+ * exporting `addons` only from `preset.ts` is not sufficient.
20
+ */
21
+ const addons = ['@storybook/addon-docs', '@storybook/addon-links']
20
22
  async function viteFinal(config) {
21
- config.plugins = [...config.plugins ?? [], require_addon_vitePlugin.sbDepsVitePlugin()];
22
- return config;
23
+ config.plugins = [
24
+ ...(config.plugins ?? []),
25
+ require_addon_vitePlugin.sbDepsVitePlugin(),
26
+ ]
27
+ return config
23
28
  }
24
29
 
25
30
  //#endregion
26
- exports.addons = addons;
27
- exports.managerEntries = managerEntries;
28
- exports.viteFinal = viteFinal;
29
- //# sourceMappingURL=index.cjs.map
31
+ exports.addons = addons
32
+ exports.managerEntries = managerEntries
33
+ exports.viteFinal = viteFinal
34
+ //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  //#region src/addon/index.d.ts
2
- declare const managerEntries: string[];
2
+ declare const managerEntries: string[]
3
3
  /**
4
4
  * Storybook addons that this addon depends on. Registering these here means
5
5
  * users only need to add `'storybook-addon-dependency-previews/addon'` to
@@ -10,8 +10,8 @@ declare const managerEntries: string[];
10
10
  * directly and ignores `package.json`'s `storybook-addon.preset` field, so
11
11
  * exporting `addons` only from `preset.ts` is not sufficient.
12
12
  */
13
- declare const addons: string[];
14
- declare function viteFinal(config: any): Promise<any>;
13
+ declare const addons: string[]
14
+ declare function viteFinal(config: any): Promise<any>
15
15
  //#endregion
16
- export { addons, managerEntries, viteFinal };
17
- //# sourceMappingURL=index.d.cts.map
16
+ export { addons, managerEntries, viteFinal }
17
+ //# sourceMappingURL=index.d.cts.map
@@ -1,5 +1,5 @@
1
1
  //#region src/addon/index.d.ts
2
- declare const managerEntries: string[];
2
+ declare const managerEntries: string[]
3
3
  /**
4
4
  * Storybook addons that this addon depends on. Registering these here means
5
5
  * users only need to add `'storybook-addon-dependency-previews/addon'` to
@@ -10,8 +10,8 @@ declare const managerEntries: string[];
10
10
  * directly and ignores `package.json`'s `storybook-addon.preset` field, so
11
11
  * exporting `addons` only from `preset.ts` is not sufficient.
12
12
  */
13
- declare const addons: string[];
14
- declare function viteFinal(config: any): Promise<any>;
13
+ declare const addons: string[]
14
+ declare function viteFinal(config: any): Promise<any>
15
15
  //#endregion
16
- export { addons, managerEntries, viteFinal };
17
- //# sourceMappingURL=index.d.mts.map
16
+ export { addons, managerEntries, viteFinal }
17
+ //# sourceMappingURL=index.d.mts.map
@@ -1,25 +1,25 @@
1
- import { sbDepsVitePlugin } from "./vitePlugin.mjs";
2
- import { createRequire } from "module";
1
+ import { sbDepsVitePlugin } from './vitePlugin.mjs'
2
+ import { createRequire } from 'module'
3
3
 
4
4
  //#region src/addon/index.ts
5
- const require = createRequire(import.meta.url);
6
- const managerEntries = [require.resolve("../manager.mjs")];
5
+ const require = createRequire(import.meta.url)
6
+ const managerEntries = [require.resolve('../manager.mjs')]
7
7
  /**
8
- * Storybook addons that this addon depends on. Registering these here means
9
- * users only need to add `'storybook-addon-dependency-previews/addon'` to
10
- * their `main.ts` `addons` array — the docs/links addons are auto-registered.
11
- *
12
- * This must live on the same preset module that Storybook actually loads.
13
- * When users register us via the `/addon` subpath, Storybook loads this file
14
- * directly and ignores `package.json`'s `storybook-addon.preset` field, so
15
- * exporting `addons` only from `preset.ts` is not sufficient.
16
- */
17
- const addons = ["@storybook/addon-docs", "@storybook/addon-links"];
8
+ * Storybook addons that this addon depends on. Registering these here means
9
+ * users only need to add `'storybook-addon-dependency-previews/addon'` to
10
+ * their `main.ts` `addons` array — the docs/links addons are auto-registered.
11
+ *
12
+ * This must live on the same preset module that Storybook actually loads.
13
+ * When users register us via the `/addon` subpath, Storybook loads this file
14
+ * directly and ignores `package.json`'s `storybook-addon.preset` field, so
15
+ * exporting `addons` only from `preset.ts` is not sufficient.
16
+ */
17
+ const addons = ['@storybook/addon-docs', '@storybook/addon-links']
18
18
  async function viteFinal(config) {
19
- config.plugins = [...config.plugins ?? [], sbDepsVitePlugin()];
20
- return config;
19
+ config.plugins = [...(config.plugins ?? []), sbDepsVitePlugin()]
20
+ return config
21
21
  }
22
22
 
23
23
  //#endregion
24
- export { addons, managerEntries, viteFinal };
25
- //# sourceMappingURL=index.mjs.map
24
+ export { addons, managerEntries, viteFinal }
25
+ //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,6 @@
1
-
2
1
  //#region src/addon/preset.ts
3
- const addons = ["@storybook/addon-docs", "@storybook/addon-links"];
2
+ const addons = ['@storybook/addon-docs', '@storybook/addon-links']
4
3
 
5
4
  //#endregion
6
- exports.addons = addons;
7
- //# sourceMappingURL=preset.cjs.map
5
+ exports.addons = addons
6
+ //# sourceMappingURL=preset.cjs.map
@@ -1,5 +1,5 @@
1
1
  //#region src/addon/preset.d.ts
2
- declare const addons: Array<string>;
2
+ declare const addons: Array<string>
3
3
  //#endregion
4
- export { addons };
5
- //# sourceMappingURL=preset.d.cts.map
4
+ export { addons }
5
+ //# sourceMappingURL=preset.d.cts.map
@@ -1,5 +1,5 @@
1
1
  //#region src/addon/preset.d.ts
2
- declare const addons: Array<string>;
2
+ declare const addons: Array<string>
3
3
  //#endregion
4
- export { addons };
5
- //# sourceMappingURL=preset.d.mts.map
4
+ export { addons }
5
+ //# sourceMappingURL=preset.d.mts.map
@@ -1,6 +1,6 @@
1
1
  //#region src/addon/preset.ts
2
- const addons = ["@storybook/addon-docs", "@storybook/addon-links"];
2
+ const addons = ['@storybook/addon-docs', '@storybook/addon-links']
3
3
 
4
4
  //#endregion
5
- export { addons };
6
- //# sourceMappingURL=preset.mjs.map
5
+ export { addons }
6
+ //# sourceMappingURL=preset.mjs.map
@@ -1,27 +1,32 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let node_fs = require("node:fs");
3
- node_fs = require_rolldown_runtime.__toESM(node_fs);
4
- let node_path = require("node:path");
5
- node_path = require_rolldown_runtime.__toESM(node_path);
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs')
2
+ let node_fs = require('node:fs')
3
+ node_fs = require_rolldown_runtime.__toESM(node_fs)
4
+ let node_path = require('node:path')
5
+ node_path = require_rolldown_runtime.__toESM(node_path)
6
6
 
7
7
  //#region src/addon/vitePlugin.ts
8
8
  function sbDepsVitePlugin() {
9
- const virtId = "virtual:dependency-previews-json";
10
- const resolved = "\0" + virtId;
9
+ const virtId = 'virtual:dependency-previews-json'
10
+ const resolved = '\0' + virtId
11
11
  return {
12
- name: "sb-deps",
12
+ name: 'sb-deps',
13
13
  resolveId(id) {
14
- return id === virtId ? resolved : null;
14
+ return id === virtId ? resolved : null
15
15
  },
16
16
  load(id) {
17
- if (id !== resolved) return null;
18
- const jsonPath = (0, node_path.resolve)(process.cwd(), ".storybook/dependency-previews.json");
19
- const json = (0, node_fs.existsSync)(jsonPath) ? (0, node_fs.readFileSync)(jsonPath, "utf8") : "{}";
20
- return `export default ${json};`;
21
- }
22
- };
17
+ if (id !== resolved) return null
18
+ const jsonPath = (0, node_path.resolve)(
19
+ process.cwd(),
20
+ '.storybook/dependency-previews.json',
21
+ )
22
+ const json = (0, node_fs.existsSync)(jsonPath)
23
+ ? (0, node_fs.readFileSync)(jsonPath, 'utf8')
24
+ : '{}'
25
+ return `export default ${json};`
26
+ },
27
+ }
23
28
  }
24
29
 
25
30
  //#endregion
26
- exports.sbDepsVitePlugin = sbDepsVitePlugin;
27
- //# sourceMappingURL=vitePlugin.cjs.map
31
+ exports.sbDepsVitePlugin = sbDepsVitePlugin
32
+ //# sourceMappingURL=vitePlugin.cjs.map
@@ -1,9 +1,9 @@
1
1
  //#region src/addon/vitePlugin.d.ts
2
2
  declare function sbDepsVitePlugin(): {
3
- name: string;
4
- resolveId(id: string): string | null;
5
- load(id: string): string | null;
6
- };
3
+ name: string
4
+ resolveId(id: string): string | null
5
+ load(id: string): string | null
6
+ }
7
7
  //#endregion
8
- export { sbDepsVitePlugin };
9
- //# sourceMappingURL=vitePlugin.d.cts.map
8
+ export { sbDepsVitePlugin }
9
+ //# sourceMappingURL=vitePlugin.d.cts.map
@@ -1,9 +1,9 @@
1
1
  //#region src/addon/vitePlugin.d.ts
2
2
  declare function sbDepsVitePlugin(): {
3
- name: string;
4
- resolveId(id: string): string | null;
5
- load(id: string): string | null;
6
- };
3
+ name: string
4
+ resolveId(id: string): string | null
5
+ load(id: string): string | null
6
+ }
7
7
  //#endregion
8
- export { sbDepsVitePlugin };
9
- //# sourceMappingURL=vitePlugin.d.mts.map
8
+ export { sbDepsVitePlugin }
9
+ //# sourceMappingURL=vitePlugin.d.mts.map
@@ -1,24 +1,27 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { resolve } from "node:path";
1
+ import { existsSync, readFileSync } from 'node:fs'
2
+ import { resolve } from 'node:path'
3
3
 
4
4
  //#region src/addon/vitePlugin.ts
5
5
  function sbDepsVitePlugin() {
6
- const virtId = "virtual:dependency-previews-json";
7
- const resolved = "\0" + virtId;
6
+ const virtId = 'virtual:dependency-previews-json'
7
+ const resolved = '\0' + virtId
8
8
  return {
9
- name: "sb-deps",
9
+ name: 'sb-deps',
10
10
  resolveId(id) {
11
- return id === virtId ? resolved : null;
11
+ return id === virtId ? resolved : null
12
12
  },
13
13
  load(id) {
14
- if (id !== resolved) return null;
15
- const jsonPath = resolve(process.cwd(), ".storybook/dependency-previews.json");
16
- const json = existsSync(jsonPath) ? readFileSync(jsonPath, "utf8") : "{}";
17
- return `export default ${json};`;
18
- }
19
- };
14
+ if (id !== resolved) return null
15
+ const jsonPath = resolve(
16
+ process.cwd(),
17
+ '.storybook/dependency-previews.json',
18
+ )
19
+ const json = existsSync(jsonPath) ? readFileSync(jsonPath, 'utf8') : '{}'
20
+ return `export default ${json};`
21
+ },
22
+ }
20
23
  }
21
24
 
22
25
  //#endregion
23
- export { sbDepsVitePlugin };
24
- //# sourceMappingURL=vitePlugin.mjs.map
26
+ export { sbDepsVitePlugin }
27
+ //# sourceMappingURL=vitePlugin.mjs.map