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.
- package/dist/_virtual/rolldown_runtime.cjs +34 -20
- package/dist/addon/index.cjs +27 -22
- package/dist/addon/index.d.cts +5 -5
- package/dist/addon/index.d.mts +5 -5
- package/dist/addon/index.mjs +18 -18
- package/dist/addon/preset.cjs +3 -4
- package/dist/addon/preset.d.cts +3 -3
- package/dist/addon/preset.d.mts +3 -3
- package/dist/addon/preset.mjs +3 -3
- package/dist/addon/vitePlugin.cjs +22 -17
- package/dist/addon/vitePlugin.d.cts +6 -6
- package/dist/addon/vitePlugin.d.mts +6 -6
- package/dist/addon/vitePlugin.mjs +17 -14
- package/dist/blocks/DependencyPreviews.cjs +192 -66
- package/dist/blocks/DependencyPreviews.d.cts +4 -4
- package/dist/blocks/DependencyPreviews.d.mts +4 -4
- package/dist/blocks/DependencyPreviews.mjs +163 -63
- package/dist/blocks/index.cjs +1 -1
- package/dist/blocks/index.d.cts +1 -1
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.mjs +1 -1
- package/dist/cli/sb-deps.cjs +543 -469
- package/dist/cli/sb-deps.d.cts +1 -1
- package/dist/cli/sb-deps.d.mts +1 -1
- package/dist/cli/sb-deps.mjs +517 -461
- package/dist/cli/scripts/depcruise.config.cjs +19 -20
- package/dist/cli/scripts/depcruise.config.d.cts +4 -4
- package/dist/cli/scripts/depcruise.config.d.mts +4 -4
- package/dist/cli/scripts/depcruise.config.mjs +19 -19
- package/dist/cli/scripts/postprocess.cjs +125 -105
- package/dist/cli/scripts/postprocess.cjs.map +1 -1
- package/dist/cli/scripts/postprocess.d.cts +1 -1
- package/dist/cli/scripts/postprocess.d.mts +1 -1
- package/dist/cli/scripts/postprocess.mjs +116 -102
- package/dist/cli/scripts/postprocess.mjs.map +1 -1
- package/dist/cli/setup/detect.cjs +93 -78
- package/dist/cli/setup/detect.d.cts +43 -28
- package/dist/cli/setup/detect.d.mts +43 -28
- package/dist/cli/setup/detect.mjs +78 -74
- package/dist/cli/setup/index.cjs +233 -175
- package/dist/cli/setup/index.d.cts +3 -3
- package/dist/cli/setup/index.d.mts +3 -3
- package/dist/cli/setup/index.mjs +203 -162
- package/dist/cli/setup/install.cjs +59 -69
- package/dist/cli/setup/install.d.cts +30 -25
- package/dist/cli/setup/install.d.mts +30 -25
- package/dist/cli/setup/install.mjs +57 -67
- package/dist/cli/setup/patchers/main.cjs +130 -97
- package/dist/cli/setup/patchers/main.d.cts +17 -14
- package/dist/cli/setup/patchers/main.d.mts +17 -14
- package/dist/cli/setup/patchers/main.mjs +119 -94
- package/dist/cli/setup/patchers/packageJson.cjs +76 -67
- package/dist/cli/setup/patchers/packageJson.d.cts +31 -22
- package/dist/cli/setup/patchers/packageJson.d.mts +31 -22
- package/dist/cli/setup/patchers/packageJson.mjs +72 -63
- package/dist/cli/setup/patchers/preview.cjs +342 -229
- package/dist/cli/setup/patchers/preview.d.cts +51 -45
- package/dist/cli/setup/patchers/preview.d.mts +51 -45
- package/dist/cli/setup/patchers/preview.mjs +335 -226
- package/dist/cli/setup/prompt.cjs +28 -28
- package/dist/cli/setup/prompt.d.cts +14 -8
- package/dist/cli/setup/prompt.d.mts +14 -8
- package/dist/cli/setup/prompt.mjs +24 -24
- package/dist/cli/setup/util.cjs +274 -268
- package/dist/cli/setup/util.d.cts +28 -14
- package/dist/cli/setup/util.d.mts +28 -14
- package/dist/cli/setup/util.mjs +276 -262
- package/dist/components/ComponentSourceLink.cjs +53 -31
- package/dist/components/ComponentSourceLink.mjs +34 -24
- package/dist/components/CopyButton.cjs +98 -71
- package/dist/components/CopyButton.mjs +90 -67
- package/dist/components/CopyButton.module.css +3 -1
- package/dist/components/Expandable.cjs +62 -28
- package/dist/components/Expandable.mjs +52 -25
- package/dist/components/FullParityStory.cjs +31 -29
- package/dist/components/FullParityStory.mjs +26 -26
- package/dist/components/PathCopyMolecule.cjs +42 -14
- package/dist/components/PathCopyMolecule.mjs +28 -11
- package/dist/components/PrimaryPreview.cjs +47 -17
- package/dist/components/PrimaryPreview.mjs +39 -15
- package/dist/components/SbHeading.cjs +21 -9
- package/dist/components/SbHeading.mjs +10 -6
- package/dist/components/StoryLink.cjs +48 -27
- package/dist/components/StoryLink.mjs +37 -23
- package/dist/components/TooltipTrigger.cjs +125 -63
- package/dist/components/TooltipTrigger.mjs +108 -59
- package/dist/components/TooltipTrigger.module.css +3 -1
- package/dist/components/icons/ArrowToRectangleIcon.cjs +15 -11
- package/dist/components/icons/ArrowToRectangleIcon.mjs +13 -9
- package/dist/components/icons/BuildIcon.cjs +15 -11
- package/dist/components/icons/BuildIcon.mjs +13 -9
- package/dist/components/icons/CopyIcon.cjs +15 -11
- package/dist/components/icons/CopyIcon.mjs +13 -9
- package/dist/components/icons/CubeIcon.cjs +15 -11
- package/dist/components/icons/CubeIcon.mjs +13 -9
- package/dist/components/icons/DoubleChevronDown.cjs +15 -11
- package/dist/components/icons/DoubleChevronDown.mjs +13 -9
- package/dist/components/icons/ExternalLinkIcon.cjs +15 -11
- package/dist/components/icons/ExternalLinkIcon.mjs +13 -9
- package/dist/components/icons/EyeOpen.cjs +20 -15
- package/dist/components/icons/EyeOpen.mjs +18 -13
- package/dist/components/icons/LoadingRipples.cjs +87 -67
- package/dist/components/icons/LoadingRipples.mjs +85 -65
- package/dist/components/icons/SquaresPlus.cjs +15 -11
- package/dist/components/icons/SquaresPlus.mjs +13 -9
- package/dist/components/icons/Svg.cjs +27 -23
- package/dist/components/icons/Svg.mjs +25 -21
- package/dist/components/icons/X.cjs +15 -11
- package/dist/components/icons/X.mjs +13 -9
- package/dist/config.cjs +3 -4
- package/dist/config.d.cts +98 -87
- package/dist/config.d.mts +98 -87
- package/dist/config.mjs +3 -3
- package/dist/constants.cjs +5 -6
- package/dist/constants.mjs +4 -4
- package/dist/hooks/useDependencyGraph.cjs +53 -39
- package/dist/hooks/useDependencyGraph.mjs +53 -35
- package/dist/hooks/useDynamicStory.cjs +80 -55
- package/dist/hooks/useDynamicStory.mjs +77 -52
- package/dist/hooks/useStoryParams.cjs +12 -10
- package/dist/hooks/useStoryParams.mjs +8 -8
- package/dist/index.cjs +16 -13
- package/dist/index.d.cts +45 -8
- package/dist/index.d.mts +45 -8
- package/dist/index.mjs +18 -8
- package/dist/manager.cjs +25 -15
- package/dist/manager.d.cts +1 -1
- package/dist/manager.d.mts +1 -1
- package/dist/manager.mjs +16 -11
- package/dist/panels/DefaultAutoDocsLayout.cjs +66 -22
- package/dist/panels/DefaultAutoDocsLayout.d.cts +8 -8
- package/dist/panels/DefaultAutoDocsLayout.d.mts +8 -8
- package/dist/panels/DefaultAutoDocsLayout.mjs +42 -17
- package/dist/panels/GraphView.cjs +146 -46
- package/dist/panels/GraphView.d.cts +4 -4
- package/dist/panels/GraphView.d.mts +4 -4
- package/dist/panels/GraphView.mjs +135 -43
- package/dist/panels/index.cjs +3 -3
- package/dist/panels/index.d.cts +6 -3
- package/dist/panels/index.d.mts +6 -3
- package/dist/panels/index.mjs +6 -3
- package/dist/preview.cjs +17 -15
- package/dist/preview.d.cts +5 -5
- package/dist/preview.d.mts +6 -6
- package/dist/preview.mjs +15 -13
- package/dist/types.d.cts +127 -97
- package/dist/types.d.mts +127 -97
- 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 ===
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
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
|
package/dist/addon/index.cjs
CHANGED
|
@@ -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(
|
|
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)(
|
|
8
|
-
|
|
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 = [
|
|
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 = [
|
|
22
|
-
|
|
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
|
package/dist/addon/index.d.cts
CHANGED
|
@@ -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
|
package/dist/addon/index.d.mts
CHANGED
|
@@ -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
|
package/dist/addon/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { sbDepsVitePlugin } from
|
|
2
|
-
import { createRequire } from
|
|
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(
|
|
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 = [
|
|
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
|
package/dist/addon/preset.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/addon/preset.ts
|
|
3
|
-
const addons = [
|
|
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
|
package/dist/addon/preset.d.cts
CHANGED
package/dist/addon/preset.d.mts
CHANGED
package/dist/addon/preset.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/addon/preset.ts
|
|
2
|
-
const addons = [
|
|
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(
|
|
3
|
-
node_fs = require_rolldown_runtime.__toESM(node_fs)
|
|
4
|
-
let node_path = require(
|
|
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 =
|
|
10
|
-
const resolved =
|
|
9
|
+
const virtId = 'virtual:dependency-previews-json'
|
|
10
|
+
const resolved = '\0' + virtId
|
|
11
11
|
return {
|
|
12
|
-
name:
|
|
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)(
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
2
|
-
import { resolve } from
|
|
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 =
|
|
7
|
-
const resolved =
|
|
6
|
+
const virtId = 'virtual:dependency-previews-json'
|
|
7
|
+
const resolved = '\0' + virtId
|
|
8
8
|
return {
|
|
9
|
-
name:
|
|
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(
|
|
16
|
-
|
|
17
|
-
|
|
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
|