storybook-addon-dependency-previews 0.3.0 → 0.3.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.
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/blocks/DependencyPreviews.d.ts
4
- declare function DependencyPreviews(): react_jsx_runtime1.JSX.Element;
4
+ declare function DependencyPreviews(): react_jsx_runtime0.JSX.Element;
5
5
  //#endregion
6
6
  export { DependencyPreviews };
7
7
  //# sourceMappingURL=DependencyPreviews.d.cts.map
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/blocks/DependencyPreviews.d.ts
4
- declare function DependencyPreviews(): react_jsx_runtime1.JSX.Element;
4
+ declare function DependencyPreviews(): react_jsx_runtime0.JSX.Element;
5
5
  //#endregion
6
6
  export { DependencyPreviews };
7
7
  //# sourceMappingURL=DependencyPreviews.d.mts.map
@@ -681,10 +681,11 @@ async function startStorybook() {
681
681
  const isWin = process.platform === "win32";
682
682
  let cmd;
683
683
  let args;
684
+ let shellMode;
684
685
  if (SB_CUSTOM_CMD) {
685
- const parts = SB_CUSTOM_CMD.split(" ");
686
- cmd = parts[0];
687
- args = parts.slice(1);
686
+ cmd = SB_CUSTOM_CMD;
687
+ args = [];
688
+ shellMode = true;
688
689
  } else {
689
690
  cmd = "npx";
690
691
  args = [
@@ -694,12 +695,13 @@ async function startStorybook() {
694
695
  "-p",
695
696
  String(SB_PORT)
696
697
  ];
698
+ shellMode = isWin;
697
699
  }
698
700
  info(`[sb-deps] launching: ${cmd} ${args.join(" ")}`);
699
701
  sbChild = (0, node_child_process.spawn)(cmd, args, {
700
702
  cwd: projectRoot,
701
703
  stdio: "inherit",
702
- shell: isWin,
704
+ shell: shellMode,
703
705
  env: process.env
704
706
  });
705
707
  sbChild.on("error", (err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"sb-deps.cjs","names":["__filename","__dirname","SCAFFOLD_CONFIG: SbDepsConfig['scaffold']","best: null | { val: string; idx: number }","sep","posix","unitSize: number","unitChar: string","knownMappings: Array<[number, number]>","htmlContent: string | null","timer: NodeJS.Timeout | null","watcherParcel","sbChild: ChildProcess | null","cmd: string","args: string[]","watcher: watcherParcel.AsyncSubscription | null"],"sources":["../../cli/sb-deps.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/* eslint-disable no-console */\nimport watcherParcel from '@parcel/watcher'\nimport micromatch from 'micromatch'\nimport { execSync, spawn, type ChildProcess } from 'node:child_process'\nimport {\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\tstatSync,\n\twriteFileSync,\n} from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, posix, resolve, sep } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport type { SbDepsConfig } from '../src/config.js'\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Args\n// ───────────────────────────────────────────────────────────────────────────────\nconst argv = process.argv.slice(2)\nconst WATCH = argv.includes('--watch')\nconst RUN_SB_IDX = argv.indexOf('--run-storybook')\nconst RUN_SB = RUN_SB_IDX !== -1\nconst _RUN_SB_NEXT = RUN_SB ? argv[RUN_SB_IDX + 1] : undefined\nconst SB_CUSTOM_CMD =\n\t_RUN_SB_NEXT && !_RUN_SB_NEXT.startsWith('--') ? _RUN_SB_NEXT : undefined\nconst PORT_ARGI = Math.max(argv.indexOf('--sb-port'), 0)\nconst SB_PORT =\n\tPORT_ARGI && argv[PORT_ARGI + 1]\n\t\t? Number(argv[PORT_ARGI + 1]) || 6006\n\t\t: 6006\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Paths\n// ───────────────────────────────────────────────────────────────────────────────\nconst projectRoot = process.cwd()\nconst outDir = resolve(projectRoot, '.storybook')\nconst rawPath = join(outDir, 'dependency-previews.raw.json')\nconst cookedPath = join(outDir, 'dependency-previews.json')\n\nif (!existsSync(outDir)) mkdirSync(outDir, { recursive: true })\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\n// Resolve depcruise config: prefer project overrides, else bundled default\nconst pkgDefault = resolve(__dirname, 'scripts', 'depcruise.config.cjs')\nconst overrideCandidates = [\n\tresolve(projectRoot, 'depcruise.config.cjs'),\n\tresolve(projectRoot, '.dependency-cruiser.js'),\n\tresolve(projectRoot, '.dependency-cruiser.cjs'),\n]\nconst configPath =\n\toverrideCandidates.find((p) => existsSync(p)) ||\n\t(existsSync(pkgDefault) ? pkgDefault : null)\n\n// Path to postprocess helper (built as ESM)\nconst post = resolve(__dirname, 'scripts', 'postprocess.mjs')\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Config\n// ───────────────────────────────────────────────────────────────────────────────\nfunction checkIsProjectEsm(): boolean {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(resolve(projectRoot, 'package.json'), 'utf8'),\n\t\t)\n\t\treturn pkg.type === 'module'\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function loadSbDepsConfig(): Promise<SbDepsConfig> {\n\tconst candidates = [\n\t\t{\n\t\t\tpath: resolve(projectRoot, 'sb-deps.config.js'),\n\t\t\tisEsm: checkIsProjectEsm(),\n\t\t},\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.mjs'), isEsm: true },\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.cjs'), isEsm: false },\n\t]\n\tfor (const { path: cfgPath, isEsm } of candidates) {\n\t\tif (!existsSync(cfgPath)) continue\n\t\ttry {\n\t\t\tif (isEsm) {\n\t\t\t\tconst mod = await import(pathToFileURL(cfgPath).href)\n\t\t\t\treturn (mod.default ?? mod) as SbDepsConfig\n\t\t\t} else {\n\t\t\t\tconst req = createRequire(import.meta.url)\n\t\t\t\tconst mod = req(cfgPath)\n\t\t\t\treturn (mod?.default ?? mod) as SbDepsConfig\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror(`failed to load sb-deps config: ${e}`)\n\t\t}\n\t}\n\treturn {}\n}\n\nlet ANGULAR_SELECTOR_PREFIX = 'app-'\nlet SCAFFOLD_CONFIG: SbDepsConfig['scaffold'] = {}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Runners\n// ───────────────────────────────────────────────────────────────────────────────\nfunction runDepCruiseOnce() {\n\tconst cfgFlag = configPath ? `--config \"${configPath}\"` : '--no-config'\n\tconst cmd = `npx depcruise . ${cfgFlag} --output-type json`\n\tconst start = Date.now()\n\tconst stdout = execSync(cmd, {\n\t\tcwd: projectRoot,\n\t\tstdio: ['ignore', 'pipe', 'inherit'],\n\t\tencoding: 'utf8',\n\t})\n\twriteFileSync(rawPath, stdout, 'utf8')\n\tinfo(`graph ✓ (${ms(Date.now() - start)})`)\n}\n\nfunction postprocessOnce() {\n\tconst start = Date.now()\n\tconst postCmd = `node \"${post}\" \"${rawPath}\" \"${cookedPath}\"`\n\texecSync(postCmd, { cwd: projectRoot, stdio: 'inherit' })\n\tinfo(`compiled ✓ → ${rel(cookedPath)} (${ms(Date.now() - start)})`)\n}\n\nfunction buildOnce() {\n\ttry {\n\t\trunDepCruiseOnce()\n\t\tpostprocessOnce()\n\t} catch (e) {\n\t\terror('build failed')\n\t\tif (!WATCH) throw e\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// String utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction toWords(input: string) {\n\treturn String(input)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t.replace(/[_\\-./]+/g, ' ')\n\t\t.trim()\n\t\t.split(/\\s+/)\n}\nfunction toTitleCase(words: Array<string>) {\n\treturn words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')\n}\nfunction toPascalCase(input: string) {\n\treturn toTitleCase(toWords(input)).replace(/\\s+/g, '')\n}\nfunction toKebabCase(input: string) {\n\treturn toWords(input)\n\t\t.map((w) => w.toLowerCase())\n\t\t.join('-')\n}\n\nfunction isEmptyOrWhitespace(absPath: string) {\n\ttry {\n\t\tconst s = statSync(absPath)\n\t\tif (s.size === 0) return true\n\t\tconst txt = readFileSync(absPath, 'utf8')\n\t\treturn !txt.trim()\n\t} catch {\n\t\treturn true\n\t}\n}\n\n// src/components/**/Thing.tsx ? (and not a story file)\nfunction isComponentsTsx(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.tsx$/i.test(norm) &&\n\t\t!/\\.stories?\\.tsx$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.svelte ? (and not a story file)\nfunction isComponentsSvelte(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.svelte$/i.test(norm) &&\n\t\t!/\\.stories?\\.svelte$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.component.ts ? (and not a story file)\nfunction isComponentsAngularTs(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.ts$/i.test(norm)\n}\n\n// src/components/**/Thing.component.html ?\nfunction isComponentsAngularHtml(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.html$/i.test(norm)\n}\n\nfunction componentBaseFromComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.tsx')\n}\n\nfunction componentBaseFromSvelteComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.svelte')\n}\n\nfunction componentBaseFromAngularComponent(absCompPath: string) {\n\treturn basename(absCompPath).replace(/\\.component\\.(ts|html)$/i, '')\n}\n\nfunction angularComponentTsPath(absPath: string) {\n\tconst base = componentBaseFromAngularComponent(absPath)\n\treturn join(dirname(absPath), `${base}.component.ts`)\n}\n\nfunction detectAtomicTag(absPath: string) {\n\tconst adaptedPath = absPath.toLowerCase().replace(/\\\\/g, '/')\n\tconst tokens = ['atom', 'molecule', 'organism', 'template', 'page', 'icon']\n\tlet best: null | { val: string; idx: number } = null\n\tfor (const t of tokens) {\n\t\tconst idx = adaptedPath.lastIndexOf(t)\n\t\tif (idx !== -1 && (best === null || idx > best.idx))\n\t\t\tbest = { val: t, idx }\n\t}\n\treturn best ? best.val : null\n}\n\nfunction storyPathForComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromComponent(absCompPath)\n\treturn join(dir, `${base}.stories.tsx`)\n}\n\nfunction storyPathForSvelteComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\treturn join(dir, `${base}.stories.svelte`)\n}\n\nfunction makeTitleFromComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Story & component scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.react?.component?.({ componentName, propsName }) ??\n\t\t`import type { ReactNode } from 'react'\n\nexport interface ${propsName} {\n children?: ReactNode\n}\n\nexport function ${componentName}({ children }: ${propsName}) {\n return (\n <div className=\"${componentName}\">\n <p>${componentName}</p>\n {children}\n </div>\n )\n}\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded component → \\${rel(absCompPath)}`)\n}\n\nfunction scaffoldStoryForComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\tconst title = makeTitleFromComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.react?.story?.({\n\t\t\tcomponentName,\n\t\t\tpropsName,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t\tbase,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/react-vite'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${componentName}, type ${propsName} } from './${componentName}'\n\nconst meta: Meta<typeof ${componentName}> = {\n title: '${title}',\n component: ${componentName},\n tags: ${JSON.stringify(tags)},\n parameters: {\n layout: 'padded',\n __filePath: import.meta.url,\n } satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Primary: Story = {\n args: {} satisfies ${propsName},\n}\n`\n\tconst storyPath = storyPathForComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded story → \\${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForComponent(absCompPath: string) {\n\tconst sPath = storyPathForComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Svelte scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.component?.({ componentName }) ??\n\t\t`<script lang=\"ts\">\n\timport type { Snippet } from 'svelte';\n\n\texport interface PropsFor${componentName} {\n\t\tchildren?: Snippet;\n\t}\n\n\tconst { children }: PropsFor${componentName} = $props();\n</script>\n\n<div class=\"${componentName}\">\n\t<p>${componentName}</p>\n\t{@render children?.()}\n</div>\n\n<style>\n\t.${componentName} {\n\t\t/* styles go here */\n\t}\n</style>\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded svelte component → ${rel(absCompPath)}`)\n}\n\nfunction makeTitleFromSvelteComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromSvelteComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction scaffoldStoryForSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst title = makeTitleFromSvelteComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.story?.({ componentName, title, tags }) ??\n\t\t`<script lang=\"ts\" module>\n\timport type { StoryParameters } from 'storybook-addon-dependency-previews'\n\timport ${componentName}, { type PropsFor${componentName} } from './${componentName}.svelte'\n\timport { defineMeta } from '@storybook/addon-svelte-csf';\n\n\tconst { Story } = defineMeta({\n\t\ttitle: '${title}',\n\t\tcomponent: ${componentName},\n\t\ttags: [${tags.map((t) => `'${t}'`).join(', ')}],\n\t\tparameters: {\n\t\t\tlayout: 'padded',\n\t\t\t__filePath: import.meta.url,\n\t\t} satisfies StoryParameters,\n\t})\n\ttype Args = Omit<PropsFor${componentName}, 'children'>;\n</script>\n\n<Story name=\"Primary\" args={{} satisfies Args}>\n\t<p>${title}</p>\n</Story>\n`\n\tconst storyPath = storyPathForSvelteComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded svelte story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForSvelteComponent(absCompPath: string) {\n\tconst sPath = storyPathForSvelteComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForSvelteComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Angular scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction storyPathForAngularComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\treturn join(dir, `${base}.stories.ts`)\n}\n\nfunction makeTitleFromAngularComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromAngularComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction gcd(a: number, b: number): number {\n\treturn b === 0 ? a : gcd(b, a % b)\n}\n\n/**\n * Re-indents extracted HTML so that each indent level is exactly one unit deep.\n * Detects whether the content uses tabs or spaces (and how many spaces per level)\n * and enforces that indentation only ever increases by one level at a time.\n */\nfunction normalizeHtmlIndentation(html: string): string {\n\tconst lines = html.split('\\n')\n\tconst indentedLines = lines.filter((l) => l.trim() && /^\\s/.test(l))\n\tif (indentedLines.length === 0) return html\n\n\tconst usesTabs = indentedLines.some((l) => l.startsWith('\\t'))\n\tlet unitSize: number\n\tlet unitChar: string\n\n\tif (usesTabs) {\n\t\tunitSize = 1\n\t\tunitChar = '\\t'\n\t} else {\n\t\tconst spaceCounts = indentedLines\n\t\t\t.map((l) => (l.match(/^ +/) ?? [''])[0].length)\n\t\t\t.filter((n) => n > 0)\n\t\tconst g = spaceCounts.reduce((a, b) => gcd(a, b), spaceCounts[0])\n\t\tunitSize = g\n\t\tunitChar = ' '.repeat(g)\n\t}\n\n\tconst rawLevels = lines.map((line) => {\n\t\tif (!line.trim()) return -1\n\t\tconst ws = line.match(/^(\\s*)/)?.[1] ?? ''\n\t\tif (usesTabs) return [...ws].filter((c) => c === '\\t').length\n\t\treturn Math.round(ws.length / unitSize)\n\t})\n\n\t// Normalize: enforce max +1 increase per step.\n\t// knownMappings stays sorted by rawLevel.\n\tconst knownMappings: Array<[number, number]> = [[0, 0]]\n\tlet prevRaw = 0\n\tlet prevNorm = 0\n\n\tconst normLevels = rawLevels.map((raw) => {\n\t\tif (raw === -1) return -1\n\t\tif (raw === prevRaw) return prevNorm\n\n\t\tif (raw > prevRaw) {\n\t\t\tconst existing = knownMappings.find(([r]) => r === raw)\n\t\t\tif (existing) {\n\t\t\t\t;[prevRaw, prevNorm] = [raw, existing[1]]\n\t\t\t\treturn prevNorm\n\t\t\t}\n\t\t\tprevNorm += 1\n\t\t\tprevRaw = raw\n\t\t\tconst insertIdx = knownMappings.findIndex(([r]) => r > raw)\n\t\t\tif (insertIdx === -1) knownMappings.push([raw, prevNorm])\n\t\t\telse knownMappings.splice(insertIdx, 0, [raw, prevNorm])\n\t\t\treturn prevNorm\n\t\t}\n\n\t\t// Decrease: find the largest known rawLevel <= current\n\t\tconst below = knownMappings.filter(([r]) => r <= raw)\n\t\tconst norm = below.length > 0 ? below[below.length - 1][1] : 0\n\t\t;[prevRaw, prevNorm] = [raw, norm]\n\t\treturn norm\n\t})\n\n\treturn lines\n\t\t.map((line, i) => {\n\t\t\tif (normLevels[i] === -1) return ''\n\t\t\treturn unitChar.repeat(normLevels[i]) + line.trimStart()\n\t\t})\n\t\t.join('\\n')\n}\n\nfunction defaultAngularHtmlTemplate(componentName: string) {\n\treturn (\n\t\tSCAFFOLD_CONFIG?.angular?.componentHtml?.({ componentName }) ??\n\t\t`<p>${componentName}</p>\n\t<ng-content />\n`\n\t)\n}\n\nfunction scaffoldAngularComponent(\n\tabsCompPath: string,\n\ttemplateLocation: 'internal' | 'external',\n) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst selector = ANGULAR_SELECTOR_PREFIX + toKebabCase(componentName)\n\tconst dir = dirname(absCompPath)\n\tconst tsPath = join(dir, `${base}.component.ts`)\n\tconst htmlPath = join(dir, `${base}.component.html`)\n\n\tif (!existsSync(tsPath) || isEmptyOrWhitespace(tsPath)) {\n\t\tconst defaultTsTpl =\n\t\t\ttemplateLocation === 'external'\n\t\t\t\t? `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplateUrl: './${base}.component.html',\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n class = input<string>('');\n}\n`\n\t\t\t\t: `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplate: \\`\n\t\t<p>${componentName}</p>\n\t\t<ng-content />\n\t\\`,\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n\tclass = input<string>('');\n}\n`\n\t\tconst tsTpl =\n\t\t\tSCAFFOLD_CONFIG?.angular?.component?.({\n\t\t\t\tcomponentName,\n\t\t\t\tclassName,\n\t\t\t\tselector,\n\t\t\t\tbase,\n\t\t\t\ttemplateLocation,\n\t\t\t}) ?? defaultTsTpl\n\t\twriteFileSync(tsPath, tsTpl, 'utf8')\n\t\tinfo(`scaffolded angular component → ${rel(tsPath)}`)\n\t}\n\n\t// Only scaffold the HTML file when using an external template\n\tif (\n\t\ttemplateLocation === 'external' &&\n\t\t(!existsSync(htmlPath) || isEmptyOrWhitespace(htmlPath))\n\t) {\n\t\twriteFileSync(\n\t\t\thtmlPath,\n\t\t\tdefaultAngularHtmlTemplate(componentName),\n\t\t\t'utf8',\n\t\t)\n\t\tinfo(`scaffolded angular template → ${rel(htmlPath)}`)\n\t}\n}\n\nfunction scaffoldAngularHtmlFromTs(absHtmlPath: string, absTsPath: string) {\n\tconst base = componentBaseFromAngularComponent(absHtmlPath)\n\tconst componentName = toPascalCase(base)\n\n\tlet htmlContent: string | null = null\n\n\t// Try to extract inline template from the existing .ts file\n\tif (existsSync(absTsPath) && !isEmptyOrWhitespace(absTsPath)) {\n\t\tconst tsContent = readFileSync(absTsPath, 'utf8')\n\t\tconst match = tsContent.match(/template:\\s*`([\\s\\S]*?)`/)\n\t\tif (match) {\n\t\t\thtmlContent = normalizeHtmlIndentation(match[1].trim()) + '\\n'\n\t\t\t// Swap template: `...` → templateUrl in the .ts file\n\t\t\tconst updated = tsContent.replace(\n\t\t\t\t/template:\\s*`[\\s\\S]*?`/,\n\t\t\t\t`templateUrl: './${base}.component.html'`,\n\t\t\t)\n\t\t\twriteFileSync(absTsPath, updated, 'utf8')\n\t\t\tinfo(\n\t\t\t\t`updated angular component to use templateUrl → ${rel(absTsPath)}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Fall back to default scaffold\n\tif (htmlContent === null) {\n\t\thtmlContent = defaultAngularHtmlTemplate(componentName)\n\t}\n\n\twriteFileSync(absHtmlPath, htmlContent, 'utf8')\n\tinfo(`scaffolded angular template → ${rel(absHtmlPath)}`)\n}\n\nfunction scaffoldStoryForAngularComponent(absCompPath: string) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst title = makeTitleFromAngularComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.angular?.story?.({\n\t\t\tcomponentName,\n\t\t\tclassName,\n\t\t\tbase,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/angular'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${className} } from './${base}.component'\n\nconst meta: Meta<${className}> = {\n\ttitle: '${title}',\n\tcomponent: ${className},\n\ttags: ${JSON.stringify(tags)},\n\tparameters: {\n\t\tlayout: 'padded',\n\t\t__filePath: import.meta.url,\n\t} satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<${className}>\n\nexport const Primary: Story = {\n\targs: {},\n}\n`\n\tconst storyPath = storyPathForAngularComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded angular story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForAngularComponent(absCompPath: string) {\n\tconst sPath = storyPathForAngularComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForAngularComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Watcher\n// ───────────────────────────────────────────────────────────────────────────────\nfunction startWatcher() {\n\tconst root = projectRoot\n\tconst includeGlobs = [\n\t\t'**/*.stories.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'**/*.story.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'src/**/*.{ts,tsx,js,jsx,svelte}',\n\t\t'src/**/*.component.html',\n\t\t'depcruise.config.cjs',\n\t\t'.dependency-cruiser.{js,cjs}',\n\t]\n\tconst ignoreGlobs = [\n\t\t'node_modules/**',\n\t\t'.git/**',\n\t\t'.storybook/**',\n\t\t'**/.cache/**',\n\t\t'**/dist/**',\n\t\t'**/build/**',\n\t]\n\n\tlet pending = false\n\tlet timer: NodeJS.Timeout | null = null\n\tlet isDeletingFile = false\n\n\tfunction kick(reason: string, absPath: string) {\n\t\tif (pending) return\n\t\tpending = true\n\t\tif (timer) clearTimeout(timer)\n\t\ttimer = setTimeout(() => {\n\t\t\tinfo(`${reason}: ${rel(absPath)}`)\n\t\t\tbuildOnce()\n\t\t\tpending = false\n\t\t}, 120)\n\t}\n\n\treturn watcherParcel\n\t\t.subscribe(\n\t\t\troot,\n\t\t\tasync (err, events) => {\n\t\t\t\tif (err) {\n\t\t\t\t\terror(`watch error ${err?.message || err}`)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const ev of events) {\n\t\t\t\t\tconst abs = ev.path\n\t\t\t\t\tconst relPath = rel(abs)\n\t\t\t\t\tif (!micromatch.isMatch(relPath, includeGlobs)) continue\n\n\t\t\t\t\tif (ev.type === 'delete') {\n\t\t\t\t\t\tconsole.log('Deleted:', relPath)\n\t\t\t\t\t\tisDeletingFile = true\n\t\t\t\t\t\tkick('unlink', abs)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsTsx(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// SVELTE COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsSvelte(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleSvelteComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.ts CREATE — scaffold with inline template\n\t\t\t\t\tif (isComponentsAngularTs(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\tabs,\n\t\t\t\t\t\t\trelPath,\n\t\t\t\t\t\t\t'internal',\n\t\t\t\t\t\t)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.html CREATE\n\t\t\t\t\tif (isComponentsAngularHtml(abs) && ev.type === 'create') {\n\t\t\t\t\t\tconst tsPath = angularComponentTsPath(abs)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\texistsSync(tsPath) &&\n\t\t\t\t\t\t\t!isEmptyOrWhitespace(tsPath)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// .ts already exists — scaffold HTML from it (migrate inline template if present)\n\t\t\t\t\t\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\t\t\t\t\t\tscaffoldAngularHtmlFromTs(abs, tsPath)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t'Angular component creation detected:',\n\t\t\t\t\t\t\t\trel(abs),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst createdStory =\n\t\t\t\t\t\t\t\tensureStoryForAngularComponent(tsPath)\n\t\t\t\t\t\t\tif (createdStory) {\n\t\t\t\t\t\t\t\tkick('create:story', createdStory)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// .ts doesn't exist yet — existing behavior: scaffold both with external templateUrl\n\t\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\t\ttsPath,\n\t\t\t\t\t\t\t\trel(tsPath),\n\t\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// normal rebuild\n\t\t\t\t\tkick(ev.type, abs)\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore: ignoreGlobs },\n\t\t)\n\t\t.then((result) => {\n\t\t\tinfo('watching… (ready)')\n\t\t\treturn result\n\t\t})\n\t\t.catch((e) => error(`watch init failed ${e?.message || e}`))\n\n\tasync function handleComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldComponent(abs)\n\t\t}\n\n\t\tconsole.log('Component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleSvelteComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldSvelteComponent(abs)\n\t\t}\n\n\t\tconst createdStory = ensureStoryForSvelteComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleAngularComponentCreation(\n\t\tabs: string,\n\t\trelPath: string,\n\t\ttemplateStyle: 'internal' | 'external',\n\t) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldAngularComponent(abs, templateStyle)\n\t\t}\n\n\t\tconsole.log('Angular component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForAngularComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Storybook child\n// ───────────────────────────────────────────────────────────────────────────────\nlet sbChild: ChildProcess | null = null\nasync function startStorybook() {\n\tconst isWin = process.platform === 'win32'\n\tlet cmd: string\n\tlet args: string[]\n\tif (SB_CUSTOM_CMD) {\n\t\tconst parts = SB_CUSTOM_CMD.split(' ')\n\t\tcmd = parts[0]\n\t\targs = parts.slice(1)\n\t} else {\n\t\tcmd = 'npx'\n\t\targs = ['-y', 'storybook', 'dev', '-p', String(SB_PORT)]\n\t}\n\n\tinfo(`[sb-deps] launching: ${cmd} ${args.join(' ')}`)\n\n\tsbChild = spawn(cmd, args, {\n\t\tcwd: projectRoot,\n\t\tstdio: 'inherit',\n\t\tshell: isWin, // ← critical to avoid EINVAL on Win + Git Bash\n\t\tenv: process.env,\n\t})\n\n\tsbChild.on('error', (err: any) => {\n\t\terror(`spawn failed: ${err?.message || err}`)\n\t})\n\n\tsbChild.on('exit', (code, sig) => {\n\t\tinfo(`storybook exited (${sig || code})`)\n\t\tsbChild = null\n\t})\n\n\tinfo(`storybook running on http://localhost:${SB_PORT}`)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Boot\n// ───────────────────────────────────────────────────────────────────────────────\n;(async () => {\n\tconst cfg = await loadSbDepsConfig()\n\tANGULAR_SELECTOR_PREFIX = cfg.angularSelectorPrefix ?? 'app-'\n\tSCAFFOLD_CONFIG = cfg.scaffold ?? {}\n\n\tbanner('sb-deps')\n\tinfo(`outDir: ${rel(outDir)}`)\n\tinfo(configPath ? `config: ${rel(configPath)}` : 'config: (none)')\n\tbuildOnce()\n\n\tlet watcher: watcherParcel.AsyncSubscription | null = null\n\tif (WATCH) startWatcher().then((w) => (watcher = w || null))\n\tif (RUN_SB) startStorybook()\n\n\tprocess.on('SIGINT', async () => {\n\t\tinfo('shutting down…')\n\t\tawait watcher?.unsubscribe()\n\t\tsbChild?.kill('SIGINT')\n\t\tprocess.exit(0)\n\t})\n})()\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction rel(p: string) {\n\t// remove the projectRoot prefix and normalize slashes for logs\n\tconst prefix = resolve(projectRoot) + sep\n\treturn p.replace(prefix, '')\n}\nfunction ms(n: number) {\n\treturn `${Math.max(1, Math.round(n))}ms`\n}\nfunction info(msg: string) {\n\tconsole.log('[sb-deps]', msg)\n}\nfunction error(msg: string) {\n\tconsole.error('[sb-deps]', msg)\n}\nfunction banner(title: string) {\n\tconsole.log(`\\n${title} – dependency previews\\n`)\n}\nfunction wait(time = 500) {\n\treturn new Promise((r) => setTimeout(r, time))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAClC,MAAM,QAAQ,KAAK,SAAS,UAAU;AACtC,MAAM,aAAa,KAAK,QAAQ,kBAAkB;AAClD,MAAM,SAAS,eAAe,CAAC;AAC/B,MAAM,eAAe,SAAS,KAAK,aAAa,KAAK;AACrD,MAAM,gBACL,gBAAgB,CAAC,aAAa,WAAW,KAAK,GAAG,eAAe;AACjE,MAAM,YAAY,KAAK,IAAI,KAAK,QAAQ,YAAY,EAAE,EAAE;AACxD,MAAM,UACL,aAAa,KAAK,YAAY,KAC3B,OAAO,KAAK,YAAY,GAAG,IAAI,OAC/B;AAKJ,MAAM,cAAc,QAAQ,KAAK;AACjC,MAAM,gCAAiB,aAAa,aAAa;AACjD,MAAM,8BAAe,QAAQ,+BAA+B;AAC5D,MAAM,iCAAkB,QAAQ,2BAA2B;AAE3D,IAAI,yBAAY,OAAO,CAAE,wBAAU,QAAQ,EAA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cjs","names":["__filename","__dirname","SCAFFOLD_CONFIG: SbDepsConfig['scaffold']","best: null | { val: string; idx: number }","sep","posix","unitSize: number","unitChar: string","knownMappings: Array<[number, number]>","htmlContent: string | null","timer: NodeJS.Timeout | null","watcherParcel","sbChild: ChildProcess | null","cmd: string","args: string[]","shellMode: boolean","watcher: watcherParcel.AsyncSubscription | null"],"sources":["../../cli/sb-deps.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/* eslint-disable no-console */\nimport watcherParcel from '@parcel/watcher'\nimport micromatch from 'micromatch'\nimport { execSync, spawn, type ChildProcess } from 'node:child_process'\nimport {\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\tstatSync,\n\twriteFileSync,\n} from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, posix, resolve, sep } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport type { SbDepsConfig } from '../src/config.js'\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Args\n// ───────────────────────────────────────────────────────────────────────────────\nconst argv = process.argv.slice(2)\nconst WATCH = argv.includes('--watch')\nconst RUN_SB_IDX = argv.indexOf('--run-storybook')\nconst RUN_SB = RUN_SB_IDX !== -1\nconst _RUN_SB_NEXT = RUN_SB ? argv[RUN_SB_IDX + 1] : undefined\nconst SB_CUSTOM_CMD =\n\t_RUN_SB_NEXT && !_RUN_SB_NEXT.startsWith('--') ? _RUN_SB_NEXT : undefined\nconst PORT_ARGI = Math.max(argv.indexOf('--sb-port'), 0)\nconst SB_PORT =\n\tPORT_ARGI && argv[PORT_ARGI + 1]\n\t\t? Number(argv[PORT_ARGI + 1]) || 6006\n\t\t: 6006\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Paths\n// ───────────────────────────────────────────────────────────────────────────────\nconst projectRoot = process.cwd()\nconst outDir = resolve(projectRoot, '.storybook')\nconst rawPath = join(outDir, 'dependency-previews.raw.json')\nconst cookedPath = join(outDir, 'dependency-previews.json')\n\nif (!existsSync(outDir)) mkdirSync(outDir, { recursive: true })\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\n// Resolve depcruise config: prefer project overrides, else bundled default\nconst pkgDefault = resolve(__dirname, 'scripts', 'depcruise.config.cjs')\nconst overrideCandidates = [\n\tresolve(projectRoot, 'depcruise.config.cjs'),\n\tresolve(projectRoot, '.dependency-cruiser.js'),\n\tresolve(projectRoot, '.dependency-cruiser.cjs'),\n]\nconst configPath =\n\toverrideCandidates.find((p) => existsSync(p)) ||\n\t(existsSync(pkgDefault) ? pkgDefault : null)\n\n// Path to postprocess helper (built as ESM)\nconst post = resolve(__dirname, 'scripts', 'postprocess.mjs')\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Config\n// ───────────────────────────────────────────────────────────────────────────────\nfunction checkIsProjectEsm(): boolean {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(resolve(projectRoot, 'package.json'), 'utf8'),\n\t\t)\n\t\treturn pkg.type === 'module'\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function loadSbDepsConfig(): Promise<SbDepsConfig> {\n\tconst candidates = [\n\t\t{\n\t\t\tpath: resolve(projectRoot, 'sb-deps.config.js'),\n\t\t\tisEsm: checkIsProjectEsm(),\n\t\t},\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.mjs'), isEsm: true },\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.cjs'), isEsm: false },\n\t]\n\tfor (const { path: cfgPath, isEsm } of candidates) {\n\t\tif (!existsSync(cfgPath)) continue\n\t\ttry {\n\t\t\tif (isEsm) {\n\t\t\t\tconst mod = await import(pathToFileURL(cfgPath).href)\n\t\t\t\treturn (mod.default ?? mod) as SbDepsConfig\n\t\t\t} else {\n\t\t\t\tconst req = createRequire(import.meta.url)\n\t\t\t\tconst mod = req(cfgPath)\n\t\t\t\treturn (mod?.default ?? mod) as SbDepsConfig\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror(`failed to load sb-deps config: ${e}`)\n\t\t}\n\t}\n\treturn {}\n}\n\nlet ANGULAR_SELECTOR_PREFIX = 'app-'\nlet SCAFFOLD_CONFIG: SbDepsConfig['scaffold'] = {}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Runners\n// ───────────────────────────────────────────────────────────────────────────────\nfunction runDepCruiseOnce() {\n\tconst cfgFlag = configPath ? `--config \"${configPath}\"` : '--no-config'\n\tconst cmd = `npx depcruise . ${cfgFlag} --output-type json`\n\tconst start = Date.now()\n\tconst stdout = execSync(cmd, {\n\t\tcwd: projectRoot,\n\t\tstdio: ['ignore', 'pipe', 'inherit'],\n\t\tencoding: 'utf8',\n\t})\n\twriteFileSync(rawPath, stdout, 'utf8')\n\tinfo(`graph ✓ (${ms(Date.now() - start)})`)\n}\n\nfunction postprocessOnce() {\n\tconst start = Date.now()\n\tconst postCmd = `node \"${post}\" \"${rawPath}\" \"${cookedPath}\"`\n\texecSync(postCmd, { cwd: projectRoot, stdio: 'inherit' })\n\tinfo(`compiled ✓ → ${rel(cookedPath)} (${ms(Date.now() - start)})`)\n}\n\nfunction buildOnce() {\n\ttry {\n\t\trunDepCruiseOnce()\n\t\tpostprocessOnce()\n\t} catch (e) {\n\t\terror('build failed')\n\t\tif (!WATCH) throw e\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// String utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction toWords(input: string) {\n\treturn String(input)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t.replace(/[_\\-./]+/g, ' ')\n\t\t.trim()\n\t\t.split(/\\s+/)\n}\nfunction toTitleCase(words: Array<string>) {\n\treturn words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')\n}\nfunction toPascalCase(input: string) {\n\treturn toTitleCase(toWords(input)).replace(/\\s+/g, '')\n}\nfunction toKebabCase(input: string) {\n\treturn toWords(input)\n\t\t.map((w) => w.toLowerCase())\n\t\t.join('-')\n}\n\nfunction isEmptyOrWhitespace(absPath: string) {\n\ttry {\n\t\tconst s = statSync(absPath)\n\t\tif (s.size === 0) return true\n\t\tconst txt = readFileSync(absPath, 'utf8')\n\t\treturn !txt.trim()\n\t} catch {\n\t\treturn true\n\t}\n}\n\n// src/components/**/Thing.tsx ? (and not a story file)\nfunction isComponentsTsx(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.tsx$/i.test(norm) &&\n\t\t!/\\.stories?\\.tsx$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.svelte ? (and not a story file)\nfunction isComponentsSvelte(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.svelte$/i.test(norm) &&\n\t\t!/\\.stories?\\.svelte$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.component.ts ? (and not a story file)\nfunction isComponentsAngularTs(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.ts$/i.test(norm)\n}\n\n// src/components/**/Thing.component.html ?\nfunction isComponentsAngularHtml(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.html$/i.test(norm)\n}\n\nfunction componentBaseFromComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.tsx')\n}\n\nfunction componentBaseFromSvelteComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.svelte')\n}\n\nfunction componentBaseFromAngularComponent(absCompPath: string) {\n\treturn basename(absCompPath).replace(/\\.component\\.(ts|html)$/i, '')\n}\n\nfunction angularComponentTsPath(absPath: string) {\n\tconst base = componentBaseFromAngularComponent(absPath)\n\treturn join(dirname(absPath), `${base}.component.ts`)\n}\n\nfunction detectAtomicTag(absPath: string) {\n\tconst adaptedPath = absPath.toLowerCase().replace(/\\\\/g, '/')\n\tconst tokens = ['atom', 'molecule', 'organism', 'template', 'page', 'icon']\n\tlet best: null | { val: string; idx: number } = null\n\tfor (const t of tokens) {\n\t\tconst idx = adaptedPath.lastIndexOf(t)\n\t\tif (idx !== -1 && (best === null || idx > best.idx))\n\t\t\tbest = { val: t, idx }\n\t}\n\treturn best ? best.val : null\n}\n\nfunction storyPathForComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromComponent(absCompPath)\n\treturn join(dir, `${base}.stories.tsx`)\n}\n\nfunction storyPathForSvelteComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\treturn join(dir, `${base}.stories.svelte`)\n}\n\nfunction makeTitleFromComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Story & component scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.react?.component?.({ componentName, propsName }) ??\n\t\t`import type { ReactNode } from 'react'\n\nexport interface ${propsName} {\n children?: ReactNode\n}\n\nexport function ${componentName}({ children }: ${propsName}) {\n return (\n <div className=\"${componentName}\">\n <p>${componentName}</p>\n {children}\n </div>\n )\n}\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded component → \\${rel(absCompPath)}`)\n}\n\nfunction scaffoldStoryForComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\tconst title = makeTitleFromComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.react?.story?.({\n\t\t\tcomponentName,\n\t\t\tpropsName,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t\tbase,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/react-vite'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${componentName}, type ${propsName} } from './${componentName}'\n\nconst meta: Meta<typeof ${componentName}> = {\n title: '${title}',\n component: ${componentName},\n tags: ${JSON.stringify(tags)},\n parameters: {\n layout: 'padded',\n __filePath: import.meta.url,\n } satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Primary: Story = {\n args: {} satisfies ${propsName},\n}\n`\n\tconst storyPath = storyPathForComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded story → \\${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForComponent(absCompPath: string) {\n\tconst sPath = storyPathForComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Svelte scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.component?.({ componentName }) ??\n\t\t`<script lang=\"ts\">\n\timport type { Snippet } from 'svelte';\n\n\texport interface PropsFor${componentName} {\n\t\tchildren?: Snippet;\n\t}\n\n\tconst { children }: PropsFor${componentName} = $props();\n</script>\n\n<div class=\"${componentName}\">\n\t<p>${componentName}</p>\n\t{@render children?.()}\n</div>\n\n<style>\n\t.${componentName} {\n\t\t/* styles go here */\n\t}\n</style>\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded svelte component → ${rel(absCompPath)}`)\n}\n\nfunction makeTitleFromSvelteComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromSvelteComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction scaffoldStoryForSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst title = makeTitleFromSvelteComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.story?.({ componentName, title, tags }) ??\n\t\t`<script lang=\"ts\" module>\n\timport type { StoryParameters } from 'storybook-addon-dependency-previews'\n\timport ${componentName}, { type PropsFor${componentName} } from './${componentName}.svelte'\n\timport { defineMeta } from '@storybook/addon-svelte-csf';\n\n\tconst { Story } = defineMeta({\n\t\ttitle: '${title}',\n\t\tcomponent: ${componentName},\n\t\ttags: [${tags.map((t) => `'${t}'`).join(', ')}],\n\t\tparameters: {\n\t\t\tlayout: 'padded',\n\t\t\t__filePath: import.meta.url,\n\t\t} satisfies StoryParameters,\n\t})\n\ttype Args = Omit<PropsFor${componentName}, 'children'>;\n</script>\n\n<Story name=\"Primary\" args={{} satisfies Args}>\n\t<p>${title}</p>\n</Story>\n`\n\tconst storyPath = storyPathForSvelteComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded svelte story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForSvelteComponent(absCompPath: string) {\n\tconst sPath = storyPathForSvelteComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForSvelteComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Angular scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction storyPathForAngularComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\treturn join(dir, `${base}.stories.ts`)\n}\n\nfunction makeTitleFromAngularComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromAngularComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction gcd(a: number, b: number): number {\n\treturn b === 0 ? a : gcd(b, a % b)\n}\n\n/**\n * Re-indents extracted HTML so that each indent level is exactly one unit deep.\n * Detects whether the content uses tabs or spaces (and how many spaces per level)\n * and enforces that indentation only ever increases by one level at a time.\n */\nfunction normalizeHtmlIndentation(html: string): string {\n\tconst lines = html.split('\\n')\n\tconst indentedLines = lines.filter((l) => l.trim() && /^\\s/.test(l))\n\tif (indentedLines.length === 0) return html\n\n\tconst usesTabs = indentedLines.some((l) => l.startsWith('\\t'))\n\tlet unitSize: number\n\tlet unitChar: string\n\n\tif (usesTabs) {\n\t\tunitSize = 1\n\t\tunitChar = '\\t'\n\t} else {\n\t\tconst spaceCounts = indentedLines\n\t\t\t.map((l) => (l.match(/^ +/) ?? [''])[0].length)\n\t\t\t.filter((n) => n > 0)\n\t\tconst g = spaceCounts.reduce((a, b) => gcd(a, b), spaceCounts[0])\n\t\tunitSize = g\n\t\tunitChar = ' '.repeat(g)\n\t}\n\n\tconst rawLevels = lines.map((line) => {\n\t\tif (!line.trim()) return -1\n\t\tconst ws = line.match(/^(\\s*)/)?.[1] ?? ''\n\t\tif (usesTabs) return [...ws].filter((c) => c === '\\t').length\n\t\treturn Math.round(ws.length / unitSize)\n\t})\n\n\t// Normalize: enforce max +1 increase per step.\n\t// knownMappings stays sorted by rawLevel.\n\tconst knownMappings: Array<[number, number]> = [[0, 0]]\n\tlet prevRaw = 0\n\tlet prevNorm = 0\n\n\tconst normLevels = rawLevels.map((raw) => {\n\t\tif (raw === -1) return -1\n\t\tif (raw === prevRaw) return prevNorm\n\n\t\tif (raw > prevRaw) {\n\t\t\tconst existing = knownMappings.find(([r]) => r === raw)\n\t\t\tif (existing) {\n\t\t\t\t;[prevRaw, prevNorm] = [raw, existing[1]]\n\t\t\t\treturn prevNorm\n\t\t\t}\n\t\t\tprevNorm += 1\n\t\t\tprevRaw = raw\n\t\t\tconst insertIdx = knownMappings.findIndex(([r]) => r > raw)\n\t\t\tif (insertIdx === -1) knownMappings.push([raw, prevNorm])\n\t\t\telse knownMappings.splice(insertIdx, 0, [raw, prevNorm])\n\t\t\treturn prevNorm\n\t\t}\n\n\t\t// Decrease: find the largest known rawLevel <= current\n\t\tconst below = knownMappings.filter(([r]) => r <= raw)\n\t\tconst norm = below.length > 0 ? below[below.length - 1][1] : 0\n\t\t;[prevRaw, prevNorm] = [raw, norm]\n\t\treturn norm\n\t})\n\n\treturn lines\n\t\t.map((line, i) => {\n\t\t\tif (normLevels[i] === -1) return ''\n\t\t\treturn unitChar.repeat(normLevels[i]) + line.trimStart()\n\t\t})\n\t\t.join('\\n')\n}\n\nfunction defaultAngularHtmlTemplate(componentName: string) {\n\treturn (\n\t\tSCAFFOLD_CONFIG?.angular?.componentHtml?.({ componentName }) ??\n\t\t`<p>${componentName}</p>\n\t<ng-content />\n`\n\t)\n}\n\nfunction scaffoldAngularComponent(\n\tabsCompPath: string,\n\ttemplateLocation: 'internal' | 'external',\n) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst selector = ANGULAR_SELECTOR_PREFIX + toKebabCase(componentName)\n\tconst dir = dirname(absCompPath)\n\tconst tsPath = join(dir, `${base}.component.ts`)\n\tconst htmlPath = join(dir, `${base}.component.html`)\n\n\tif (!existsSync(tsPath) || isEmptyOrWhitespace(tsPath)) {\n\t\tconst defaultTsTpl =\n\t\t\ttemplateLocation === 'external'\n\t\t\t\t? `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplateUrl: './${base}.component.html',\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n class = input<string>('');\n}\n`\n\t\t\t\t: `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplate: \\`\n\t\t<p>${componentName}</p>\n\t\t<ng-content />\n\t\\`,\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n\tclass = input<string>('');\n}\n`\n\t\tconst tsTpl =\n\t\t\tSCAFFOLD_CONFIG?.angular?.component?.({\n\t\t\t\tcomponentName,\n\t\t\t\tclassName,\n\t\t\t\tselector,\n\t\t\t\tbase,\n\t\t\t\ttemplateLocation,\n\t\t\t}) ?? defaultTsTpl\n\t\twriteFileSync(tsPath, tsTpl, 'utf8')\n\t\tinfo(`scaffolded angular component → ${rel(tsPath)}`)\n\t}\n\n\t// Only scaffold the HTML file when using an external template\n\tif (\n\t\ttemplateLocation === 'external' &&\n\t\t(!existsSync(htmlPath) || isEmptyOrWhitespace(htmlPath))\n\t) {\n\t\twriteFileSync(\n\t\t\thtmlPath,\n\t\t\tdefaultAngularHtmlTemplate(componentName),\n\t\t\t'utf8',\n\t\t)\n\t\tinfo(`scaffolded angular template → ${rel(htmlPath)}`)\n\t}\n}\n\nfunction scaffoldAngularHtmlFromTs(absHtmlPath: string, absTsPath: string) {\n\tconst base = componentBaseFromAngularComponent(absHtmlPath)\n\tconst componentName = toPascalCase(base)\n\n\tlet htmlContent: string | null = null\n\n\t// Try to extract inline template from the existing .ts file\n\tif (existsSync(absTsPath) && !isEmptyOrWhitespace(absTsPath)) {\n\t\tconst tsContent = readFileSync(absTsPath, 'utf8')\n\t\tconst match = tsContent.match(/template:\\s*`([\\s\\S]*?)`/)\n\t\tif (match) {\n\t\t\thtmlContent = normalizeHtmlIndentation(match[1].trim()) + '\\n'\n\t\t\t// Swap template: `...` → templateUrl in the .ts file\n\t\t\tconst updated = tsContent.replace(\n\t\t\t\t/template:\\s*`[\\s\\S]*?`/,\n\t\t\t\t`templateUrl: './${base}.component.html'`,\n\t\t\t)\n\t\t\twriteFileSync(absTsPath, updated, 'utf8')\n\t\t\tinfo(\n\t\t\t\t`updated angular component to use templateUrl → ${rel(absTsPath)}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Fall back to default scaffold\n\tif (htmlContent === null) {\n\t\thtmlContent = defaultAngularHtmlTemplate(componentName)\n\t}\n\n\twriteFileSync(absHtmlPath, htmlContent, 'utf8')\n\tinfo(`scaffolded angular template → ${rel(absHtmlPath)}`)\n}\n\nfunction scaffoldStoryForAngularComponent(absCompPath: string) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst title = makeTitleFromAngularComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.angular?.story?.({\n\t\t\tcomponentName,\n\t\t\tclassName,\n\t\t\tbase,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/angular'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${className} } from './${base}.component'\n\nconst meta: Meta<${className}> = {\n\ttitle: '${title}',\n\tcomponent: ${className},\n\ttags: ${JSON.stringify(tags)},\n\tparameters: {\n\t\tlayout: 'padded',\n\t\t__filePath: import.meta.url,\n\t} satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<${className}>\n\nexport const Primary: Story = {\n\targs: {},\n}\n`\n\tconst storyPath = storyPathForAngularComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded angular story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForAngularComponent(absCompPath: string) {\n\tconst sPath = storyPathForAngularComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForAngularComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Watcher\n// ───────────────────────────────────────────────────────────────────────────────\nfunction startWatcher() {\n\tconst root = projectRoot\n\tconst includeGlobs = [\n\t\t'**/*.stories.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'**/*.story.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'src/**/*.{ts,tsx,js,jsx,svelte}',\n\t\t'src/**/*.component.html',\n\t\t'depcruise.config.cjs',\n\t\t'.dependency-cruiser.{js,cjs}',\n\t]\n\tconst ignoreGlobs = [\n\t\t'node_modules/**',\n\t\t'.git/**',\n\t\t'.storybook/**',\n\t\t'**/.cache/**',\n\t\t'**/dist/**',\n\t\t'**/build/**',\n\t]\n\n\tlet pending = false\n\tlet timer: NodeJS.Timeout | null = null\n\tlet isDeletingFile = false\n\n\tfunction kick(reason: string, absPath: string) {\n\t\tif (pending) return\n\t\tpending = true\n\t\tif (timer) clearTimeout(timer)\n\t\ttimer = setTimeout(() => {\n\t\t\tinfo(`${reason}: ${rel(absPath)}`)\n\t\t\tbuildOnce()\n\t\t\tpending = false\n\t\t}, 120)\n\t}\n\n\treturn watcherParcel\n\t\t.subscribe(\n\t\t\troot,\n\t\t\tasync (err, events) => {\n\t\t\t\tif (err) {\n\t\t\t\t\terror(`watch error ${err?.message || err}`)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const ev of events) {\n\t\t\t\t\tconst abs = ev.path\n\t\t\t\t\tconst relPath = rel(abs)\n\t\t\t\t\tif (!micromatch.isMatch(relPath, includeGlobs)) continue\n\n\t\t\t\t\tif (ev.type === 'delete') {\n\t\t\t\t\t\tconsole.log('Deleted:', relPath)\n\t\t\t\t\t\tisDeletingFile = true\n\t\t\t\t\t\tkick('unlink', abs)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsTsx(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// SVELTE COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsSvelte(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleSvelteComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.ts CREATE — scaffold with inline template\n\t\t\t\t\tif (isComponentsAngularTs(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\tabs,\n\t\t\t\t\t\t\trelPath,\n\t\t\t\t\t\t\t'internal',\n\t\t\t\t\t\t)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.html CREATE\n\t\t\t\t\tif (isComponentsAngularHtml(abs) && ev.type === 'create') {\n\t\t\t\t\t\tconst tsPath = angularComponentTsPath(abs)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\texistsSync(tsPath) &&\n\t\t\t\t\t\t\t!isEmptyOrWhitespace(tsPath)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// .ts already exists — scaffold HTML from it (migrate inline template if present)\n\t\t\t\t\t\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\t\t\t\t\t\tscaffoldAngularHtmlFromTs(abs, tsPath)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t'Angular component creation detected:',\n\t\t\t\t\t\t\t\trel(abs),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst createdStory =\n\t\t\t\t\t\t\t\tensureStoryForAngularComponent(tsPath)\n\t\t\t\t\t\t\tif (createdStory) {\n\t\t\t\t\t\t\t\tkick('create:story', createdStory)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// .ts doesn't exist yet — existing behavior: scaffold both with external templateUrl\n\t\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\t\ttsPath,\n\t\t\t\t\t\t\t\trel(tsPath),\n\t\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// normal rebuild\n\t\t\t\t\tkick(ev.type, abs)\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore: ignoreGlobs },\n\t\t)\n\t\t.then((result) => {\n\t\t\tinfo('watching… (ready)')\n\t\t\treturn result\n\t\t})\n\t\t.catch((e) => error(`watch init failed ${e?.message || e}`))\n\n\tasync function handleComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldComponent(abs)\n\t\t}\n\n\t\tconsole.log('Component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleSvelteComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldSvelteComponent(abs)\n\t\t}\n\n\t\tconst createdStory = ensureStoryForSvelteComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleAngularComponentCreation(\n\t\tabs: string,\n\t\trelPath: string,\n\t\ttemplateStyle: 'internal' | 'external',\n\t) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldAngularComponent(abs, templateStyle)\n\t\t}\n\n\t\tconsole.log('Angular component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForAngularComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Storybook child\n// ───────────────────────────────────────────────────────────────────────────────\nlet sbChild: ChildProcess | null = null\nasync function startStorybook() {\n\tconst isWin = process.platform === 'win32'\n\tlet cmd: string\n\tlet args: string[]\n\tlet shellMode: boolean\n\tif (SB_CUSTOM_CMD) {\n\t\tcmd = SB_CUSTOM_CMD\n\t\targs = []\n\t\tshellMode = true // shell:true handles quoted args and paths with spaces\n\t} else {\n\t\tcmd = 'npx'\n\t\targs = ['-y', 'storybook', 'dev', '-p', String(SB_PORT)]\n\t\tshellMode = isWin // ← critical to avoid EINVAL on Win + Git Bash\n\t}\n\n\tinfo(`[sb-deps] launching: ${cmd} ${args.join(' ')}`)\n\n\tsbChild = spawn(cmd, args, {\n\t\tcwd: projectRoot,\n\t\tstdio: 'inherit',\n\t\tshell: shellMode,\n\t\tenv: process.env,\n\t})\n\n\tsbChild.on('error', (err: any) => {\n\t\terror(`spawn failed: ${err?.message || err}`)\n\t})\n\n\tsbChild.on('exit', (code, sig) => {\n\t\tinfo(`storybook exited (${sig || code})`)\n\t\tsbChild = null\n\t})\n\n\tinfo(`storybook running on http://localhost:${SB_PORT}`)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Boot\n// ───────────────────────────────────────────────────────────────────────────────\n;(async () => {\n\tconst cfg = await loadSbDepsConfig()\n\tANGULAR_SELECTOR_PREFIX = cfg.angularSelectorPrefix ?? 'app-'\n\tSCAFFOLD_CONFIG = cfg.scaffold ?? {}\n\n\tbanner('sb-deps')\n\tinfo(`outDir: ${rel(outDir)}`)\n\tinfo(configPath ? `config: ${rel(configPath)}` : 'config: (none)')\n\tbuildOnce()\n\n\tlet watcher: watcherParcel.AsyncSubscription | null = null\n\tif (WATCH) startWatcher().then((w) => (watcher = w || null))\n\tif (RUN_SB) startStorybook()\n\n\tprocess.on('SIGINT', async () => {\n\t\tinfo('shutting down…')\n\t\tawait watcher?.unsubscribe()\n\t\tsbChild?.kill('SIGINT')\n\t\tprocess.exit(0)\n\t})\n})()\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction rel(p: string) {\n\t// remove the projectRoot prefix and normalize slashes for logs\n\tconst prefix = resolve(projectRoot) + sep\n\treturn p.replace(prefix, '')\n}\nfunction ms(n: number) {\n\treturn `${Math.max(1, Math.round(n))}ms`\n}\nfunction info(msg: string) {\n\tconsole.log('[sb-deps]', msg)\n}\nfunction error(msg: string) {\n\tconsole.error('[sb-deps]', msg)\n}\nfunction banner(title: string) {\n\tconsole.log(`\\n${title} – dependency previews\\n`)\n}\nfunction wait(time = 500) {\n\treturn new Promise((r) => setTimeout(r, time))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAClC,MAAM,QAAQ,KAAK,SAAS,UAAU;AACtC,MAAM,aAAa,KAAK,QAAQ,kBAAkB;AAClD,MAAM,SAAS,eAAe,CAAC;AAC/B,MAAM,eAAe,SAAS,KAAK,aAAa,KAAK;AACrD,MAAM,gBACL,gBAAgB,CAAC,aAAa,WAAW,KAAK,GAAG,eAAe;AACjE,MAAM,YAAY,KAAK,IAAI,KAAK,QAAQ,YAAY,EAAE,EAAE;AACxD,MAAM,UACL,aAAa,KAAK,YAAY,KAC3B,OAAO,KAAK,YAAY,GAAG,IAAI,OAC/B;AAKJ,MAAM,cAAc,QAAQ,KAAK;AACjC,MAAM,gCAAiB,aAAa,aAAa;AACjD,MAAM,8BAAe,QAAQ,+BAA+B;AAC5D,MAAM,iCAAkB,QAAQ,2BAA2B;AAE3D,IAAI,yBAAY,OAAO,CAAE,wBAAU,QAAQ,EAAE,WAAW,MAAM,CAAC;AAE/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
675
  let args;
676
+ let shellMode;
676
677
  if (SB_CUSTOM_CMD) {
677
- const parts = SB_CUSTOM_CMD.split(" ");
678
- cmd = parts[0];
679
- args = parts.slice(1);
678
+ cmd = SB_CUSTOM_CMD;
679
+ args = [];
680
+ shellMode = true;
680
681
  } else {
681
682
  cmd = "npx";
682
683
  args = [
@@ -686,12 +687,13 @@ async function startStorybook() {
686
687
  "-p",
687
688
  String(SB_PORT)
688
689
  ];
690
+ shellMode = isWin;
689
691
  }
690
692
  info(`[sb-deps] launching: ${cmd} ${args.join(" ")}`);
691
693
  sbChild = spawn(cmd, args, {
692
694
  cwd: projectRoot,
693
695
  stdio: "inherit",
694
- shell: isWin,
696
+ shell: shellMode,
695
697
  env: process.env
696
698
  });
697
699
  sbChild.on("error", (err) => {
@@ -1 +1 @@
1
- {"version":3,"file":"sb-deps.mjs","names":["SCAFFOLD_CONFIG: SbDepsConfig['scaffold']","best: null | { val: string; idx: number }","unitSize: number","unitChar: string","knownMappings: Array<[number, number]>","htmlContent: string | null","timer: NodeJS.Timeout | null","sbChild: ChildProcess | null","cmd: string","args: string[]","watcher: watcherParcel.AsyncSubscription | null"],"sources":["../../cli/sb-deps.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/* eslint-disable no-console */\nimport watcherParcel from '@parcel/watcher'\nimport micromatch from 'micromatch'\nimport { execSync, spawn, type ChildProcess } from 'node:child_process'\nimport {\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\tstatSync,\n\twriteFileSync,\n} from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, posix, resolve, sep } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport type { SbDepsConfig } from '../src/config.js'\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Args\n// ───────────────────────────────────────────────────────────────────────────────\nconst argv = process.argv.slice(2)\nconst WATCH = argv.includes('--watch')\nconst RUN_SB_IDX = argv.indexOf('--run-storybook')\nconst RUN_SB = RUN_SB_IDX !== -1\nconst _RUN_SB_NEXT = RUN_SB ? argv[RUN_SB_IDX + 1] : undefined\nconst SB_CUSTOM_CMD =\n\t_RUN_SB_NEXT && !_RUN_SB_NEXT.startsWith('--') ? _RUN_SB_NEXT : undefined\nconst PORT_ARGI = Math.max(argv.indexOf('--sb-port'), 0)\nconst SB_PORT =\n\tPORT_ARGI && argv[PORT_ARGI + 1]\n\t\t? Number(argv[PORT_ARGI + 1]) || 6006\n\t\t: 6006\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Paths\n// ───────────────────────────────────────────────────────────────────────────────\nconst projectRoot = process.cwd()\nconst outDir = resolve(projectRoot, '.storybook')\nconst rawPath = join(outDir, 'dependency-previews.raw.json')\nconst cookedPath = join(outDir, 'dependency-previews.json')\n\nif (!existsSync(outDir)) mkdirSync(outDir, { recursive: true })\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\n// Resolve depcruise config: prefer project overrides, else bundled default\nconst pkgDefault = resolve(__dirname, 'scripts', 'depcruise.config.cjs')\nconst overrideCandidates = [\n\tresolve(projectRoot, 'depcruise.config.cjs'),\n\tresolve(projectRoot, '.dependency-cruiser.js'),\n\tresolve(projectRoot, '.dependency-cruiser.cjs'),\n]\nconst configPath =\n\toverrideCandidates.find((p) => existsSync(p)) ||\n\t(existsSync(pkgDefault) ? pkgDefault : null)\n\n// Path to postprocess helper (built as ESM)\nconst post = resolve(__dirname, 'scripts', 'postprocess.mjs')\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Config\n// ───────────────────────────────────────────────────────────────────────────────\nfunction checkIsProjectEsm(): boolean {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(resolve(projectRoot, 'package.json'), 'utf8'),\n\t\t)\n\t\treturn pkg.type === 'module'\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function loadSbDepsConfig(): Promise<SbDepsConfig> {\n\tconst candidates = [\n\t\t{\n\t\t\tpath: resolve(projectRoot, 'sb-deps.config.js'),\n\t\t\tisEsm: checkIsProjectEsm(),\n\t\t},\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.mjs'), isEsm: true },\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.cjs'), isEsm: false },\n\t]\n\tfor (const { path: cfgPath, isEsm } of candidates) {\n\t\tif (!existsSync(cfgPath)) continue\n\t\ttry {\n\t\t\tif (isEsm) {\n\t\t\t\tconst mod = await import(pathToFileURL(cfgPath).href)\n\t\t\t\treturn (mod.default ?? mod) as SbDepsConfig\n\t\t\t} else {\n\t\t\t\tconst req = createRequire(import.meta.url)\n\t\t\t\tconst mod = req(cfgPath)\n\t\t\t\treturn (mod?.default ?? mod) as SbDepsConfig\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror(`failed to load sb-deps config: ${e}`)\n\t\t}\n\t}\n\treturn {}\n}\n\nlet ANGULAR_SELECTOR_PREFIX = 'app-'\nlet SCAFFOLD_CONFIG: SbDepsConfig['scaffold'] = {}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Runners\n// ───────────────────────────────────────────────────────────────────────────────\nfunction runDepCruiseOnce() {\n\tconst cfgFlag = configPath ? `--config \"${configPath}\"` : '--no-config'\n\tconst cmd = `npx depcruise . ${cfgFlag} --output-type json`\n\tconst start = Date.now()\n\tconst stdout = execSync(cmd, {\n\t\tcwd: projectRoot,\n\t\tstdio: ['ignore', 'pipe', 'inherit'],\n\t\tencoding: 'utf8',\n\t})\n\twriteFileSync(rawPath, stdout, 'utf8')\n\tinfo(`graph ✓ (${ms(Date.now() - start)})`)\n}\n\nfunction postprocessOnce() {\n\tconst start = Date.now()\n\tconst postCmd = `node \"${post}\" \"${rawPath}\" \"${cookedPath}\"`\n\texecSync(postCmd, { cwd: projectRoot, stdio: 'inherit' })\n\tinfo(`compiled ✓ → ${rel(cookedPath)} (${ms(Date.now() - start)})`)\n}\n\nfunction buildOnce() {\n\ttry {\n\t\trunDepCruiseOnce()\n\t\tpostprocessOnce()\n\t} catch (e) {\n\t\terror('build failed')\n\t\tif (!WATCH) throw e\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// String utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction toWords(input: string) {\n\treturn String(input)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t.replace(/[_\\-./]+/g, ' ')\n\t\t.trim()\n\t\t.split(/\\s+/)\n}\nfunction toTitleCase(words: Array<string>) {\n\treturn words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')\n}\nfunction toPascalCase(input: string) {\n\treturn toTitleCase(toWords(input)).replace(/\\s+/g, '')\n}\nfunction toKebabCase(input: string) {\n\treturn toWords(input)\n\t\t.map((w) => w.toLowerCase())\n\t\t.join('-')\n}\n\nfunction isEmptyOrWhitespace(absPath: string) {\n\ttry {\n\t\tconst s = statSync(absPath)\n\t\tif (s.size === 0) return true\n\t\tconst txt = readFileSync(absPath, 'utf8')\n\t\treturn !txt.trim()\n\t} catch {\n\t\treturn true\n\t}\n}\n\n// src/components/**/Thing.tsx ? (and not a story file)\nfunction isComponentsTsx(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.tsx$/i.test(norm) &&\n\t\t!/\\.stories?\\.tsx$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.svelte ? (and not a story file)\nfunction isComponentsSvelte(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.svelte$/i.test(norm) &&\n\t\t!/\\.stories?\\.svelte$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.component.ts ? (and not a story file)\nfunction isComponentsAngularTs(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.ts$/i.test(norm)\n}\n\n// src/components/**/Thing.component.html ?\nfunction isComponentsAngularHtml(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.html$/i.test(norm)\n}\n\nfunction componentBaseFromComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.tsx')\n}\n\nfunction componentBaseFromSvelteComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.svelte')\n}\n\nfunction componentBaseFromAngularComponent(absCompPath: string) {\n\treturn basename(absCompPath).replace(/\\.component\\.(ts|html)$/i, '')\n}\n\nfunction angularComponentTsPath(absPath: string) {\n\tconst base = componentBaseFromAngularComponent(absPath)\n\treturn join(dirname(absPath), `${base}.component.ts`)\n}\n\nfunction detectAtomicTag(absPath: string) {\n\tconst adaptedPath = absPath.toLowerCase().replace(/\\\\/g, '/')\n\tconst tokens = ['atom', 'molecule', 'organism', 'template', 'page', 'icon']\n\tlet best: null | { val: string; idx: number } = null\n\tfor (const t of tokens) {\n\t\tconst idx = adaptedPath.lastIndexOf(t)\n\t\tif (idx !== -1 && (best === null || idx > best.idx))\n\t\t\tbest = { val: t, idx }\n\t}\n\treturn best ? best.val : null\n}\n\nfunction storyPathForComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromComponent(absCompPath)\n\treturn join(dir, `${base}.stories.tsx`)\n}\n\nfunction storyPathForSvelteComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\treturn join(dir, `${base}.stories.svelte`)\n}\n\nfunction makeTitleFromComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Story & component scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.react?.component?.({ componentName, propsName }) ??\n\t\t`import type { ReactNode } from 'react'\n\nexport interface ${propsName} {\n children?: ReactNode\n}\n\nexport function ${componentName}({ children }: ${propsName}) {\n return (\n <div className=\"${componentName}\">\n <p>${componentName}</p>\n {children}\n </div>\n )\n}\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded component → \\${rel(absCompPath)}`)\n}\n\nfunction scaffoldStoryForComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\tconst title = makeTitleFromComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.react?.story?.({\n\t\t\tcomponentName,\n\t\t\tpropsName,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t\tbase,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/react-vite'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${componentName}, type ${propsName} } from './${componentName}'\n\nconst meta: Meta<typeof ${componentName}> = {\n title: '${title}',\n component: ${componentName},\n tags: ${JSON.stringify(tags)},\n parameters: {\n layout: 'padded',\n __filePath: import.meta.url,\n } satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Primary: Story = {\n args: {} satisfies ${propsName},\n}\n`\n\tconst storyPath = storyPathForComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded story → \\${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForComponent(absCompPath: string) {\n\tconst sPath = storyPathForComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Svelte scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.component?.({ componentName }) ??\n\t\t`<script lang=\"ts\">\n\timport type { Snippet } from 'svelte';\n\n\texport interface PropsFor${componentName} {\n\t\tchildren?: Snippet;\n\t}\n\n\tconst { children }: PropsFor${componentName} = $props();\n</script>\n\n<div class=\"${componentName}\">\n\t<p>${componentName}</p>\n\t{@render children?.()}\n</div>\n\n<style>\n\t.${componentName} {\n\t\t/* styles go here */\n\t}\n</style>\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded svelte component → ${rel(absCompPath)}`)\n}\n\nfunction makeTitleFromSvelteComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromSvelteComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction scaffoldStoryForSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst title = makeTitleFromSvelteComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.story?.({ componentName, title, tags }) ??\n\t\t`<script lang=\"ts\" module>\n\timport type { StoryParameters } from 'storybook-addon-dependency-previews'\n\timport ${componentName}, { type PropsFor${componentName} } from './${componentName}.svelte'\n\timport { defineMeta } from '@storybook/addon-svelte-csf';\n\n\tconst { Story } = defineMeta({\n\t\ttitle: '${title}',\n\t\tcomponent: ${componentName},\n\t\ttags: [${tags.map((t) => `'${t}'`).join(', ')}],\n\t\tparameters: {\n\t\t\tlayout: 'padded',\n\t\t\t__filePath: import.meta.url,\n\t\t} satisfies StoryParameters,\n\t})\n\ttype Args = Omit<PropsFor${componentName}, 'children'>;\n</script>\n\n<Story name=\"Primary\" args={{} satisfies Args}>\n\t<p>${title}</p>\n</Story>\n`\n\tconst storyPath = storyPathForSvelteComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded svelte story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForSvelteComponent(absCompPath: string) {\n\tconst sPath = storyPathForSvelteComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForSvelteComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Angular scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction storyPathForAngularComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\treturn join(dir, `${base}.stories.ts`)\n}\n\nfunction makeTitleFromAngularComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromAngularComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction gcd(a: number, b: number): number {\n\treturn b === 0 ? a : gcd(b, a % b)\n}\n\n/**\n * Re-indents extracted HTML so that each indent level is exactly one unit deep.\n * Detects whether the content uses tabs or spaces (and how many spaces per level)\n * and enforces that indentation only ever increases by one level at a time.\n */\nfunction normalizeHtmlIndentation(html: string): string {\n\tconst lines = html.split('\\n')\n\tconst indentedLines = lines.filter((l) => l.trim() && /^\\s/.test(l))\n\tif (indentedLines.length === 0) return html\n\n\tconst usesTabs = indentedLines.some((l) => l.startsWith('\\t'))\n\tlet unitSize: number\n\tlet unitChar: string\n\n\tif (usesTabs) {\n\t\tunitSize = 1\n\t\tunitChar = '\\t'\n\t} else {\n\t\tconst spaceCounts = indentedLines\n\t\t\t.map((l) => (l.match(/^ +/) ?? [''])[0].length)\n\t\t\t.filter((n) => n > 0)\n\t\tconst g = spaceCounts.reduce((a, b) => gcd(a, b), spaceCounts[0])\n\t\tunitSize = g\n\t\tunitChar = ' '.repeat(g)\n\t}\n\n\tconst rawLevels = lines.map((line) => {\n\t\tif (!line.trim()) return -1\n\t\tconst ws = line.match(/^(\\s*)/)?.[1] ?? ''\n\t\tif (usesTabs) return [...ws].filter((c) => c === '\\t').length\n\t\treturn Math.round(ws.length / unitSize)\n\t})\n\n\t// Normalize: enforce max +1 increase per step.\n\t// knownMappings stays sorted by rawLevel.\n\tconst knownMappings: Array<[number, number]> = [[0, 0]]\n\tlet prevRaw = 0\n\tlet prevNorm = 0\n\n\tconst normLevels = rawLevels.map((raw) => {\n\t\tif (raw === -1) return -1\n\t\tif (raw === prevRaw) return prevNorm\n\n\t\tif (raw > prevRaw) {\n\t\t\tconst existing = knownMappings.find(([r]) => r === raw)\n\t\t\tif (existing) {\n\t\t\t\t;[prevRaw, prevNorm] = [raw, existing[1]]\n\t\t\t\treturn prevNorm\n\t\t\t}\n\t\t\tprevNorm += 1\n\t\t\tprevRaw = raw\n\t\t\tconst insertIdx = knownMappings.findIndex(([r]) => r > raw)\n\t\t\tif (insertIdx === -1) knownMappings.push([raw, prevNorm])\n\t\t\telse knownMappings.splice(insertIdx, 0, [raw, prevNorm])\n\t\t\treturn prevNorm\n\t\t}\n\n\t\t// Decrease: find the largest known rawLevel <= current\n\t\tconst below = knownMappings.filter(([r]) => r <= raw)\n\t\tconst norm = below.length > 0 ? below[below.length - 1][1] : 0\n\t\t;[prevRaw, prevNorm] = [raw, norm]\n\t\treturn norm\n\t})\n\n\treturn lines\n\t\t.map((line, i) => {\n\t\t\tif (normLevels[i] === -1) return ''\n\t\t\treturn unitChar.repeat(normLevels[i]) + line.trimStart()\n\t\t})\n\t\t.join('\\n')\n}\n\nfunction defaultAngularHtmlTemplate(componentName: string) {\n\treturn (\n\t\tSCAFFOLD_CONFIG?.angular?.componentHtml?.({ componentName }) ??\n\t\t`<p>${componentName}</p>\n\t<ng-content />\n`\n\t)\n}\n\nfunction scaffoldAngularComponent(\n\tabsCompPath: string,\n\ttemplateLocation: 'internal' | 'external',\n) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst selector = ANGULAR_SELECTOR_PREFIX + toKebabCase(componentName)\n\tconst dir = dirname(absCompPath)\n\tconst tsPath = join(dir, `${base}.component.ts`)\n\tconst htmlPath = join(dir, `${base}.component.html`)\n\n\tif (!existsSync(tsPath) || isEmptyOrWhitespace(tsPath)) {\n\t\tconst defaultTsTpl =\n\t\t\ttemplateLocation === 'external'\n\t\t\t\t? `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplateUrl: './${base}.component.html',\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n class = input<string>('');\n}\n`\n\t\t\t\t: `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplate: \\`\n\t\t<p>${componentName}</p>\n\t\t<ng-content />\n\t\\`,\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n\tclass = input<string>('');\n}\n`\n\t\tconst tsTpl =\n\t\t\tSCAFFOLD_CONFIG?.angular?.component?.({\n\t\t\t\tcomponentName,\n\t\t\t\tclassName,\n\t\t\t\tselector,\n\t\t\t\tbase,\n\t\t\t\ttemplateLocation,\n\t\t\t}) ?? defaultTsTpl\n\t\twriteFileSync(tsPath, tsTpl, 'utf8')\n\t\tinfo(`scaffolded angular component → ${rel(tsPath)}`)\n\t}\n\n\t// Only scaffold the HTML file when using an external template\n\tif (\n\t\ttemplateLocation === 'external' &&\n\t\t(!existsSync(htmlPath) || isEmptyOrWhitespace(htmlPath))\n\t) {\n\t\twriteFileSync(\n\t\t\thtmlPath,\n\t\t\tdefaultAngularHtmlTemplate(componentName),\n\t\t\t'utf8',\n\t\t)\n\t\tinfo(`scaffolded angular template → ${rel(htmlPath)}`)\n\t}\n}\n\nfunction scaffoldAngularHtmlFromTs(absHtmlPath: string, absTsPath: string) {\n\tconst base = componentBaseFromAngularComponent(absHtmlPath)\n\tconst componentName = toPascalCase(base)\n\n\tlet htmlContent: string | null = null\n\n\t// Try to extract inline template from the existing .ts file\n\tif (existsSync(absTsPath) && !isEmptyOrWhitespace(absTsPath)) {\n\t\tconst tsContent = readFileSync(absTsPath, 'utf8')\n\t\tconst match = tsContent.match(/template:\\s*`([\\s\\S]*?)`/)\n\t\tif (match) {\n\t\t\thtmlContent = normalizeHtmlIndentation(match[1].trim()) + '\\n'\n\t\t\t// Swap template: `...` → templateUrl in the .ts file\n\t\t\tconst updated = tsContent.replace(\n\t\t\t\t/template:\\s*`[\\s\\S]*?`/,\n\t\t\t\t`templateUrl: './${base}.component.html'`,\n\t\t\t)\n\t\t\twriteFileSync(absTsPath, updated, 'utf8')\n\t\t\tinfo(\n\t\t\t\t`updated angular component to use templateUrl → ${rel(absTsPath)}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Fall back to default scaffold\n\tif (htmlContent === null) {\n\t\thtmlContent = defaultAngularHtmlTemplate(componentName)\n\t}\n\n\twriteFileSync(absHtmlPath, htmlContent, 'utf8')\n\tinfo(`scaffolded angular template → ${rel(absHtmlPath)}`)\n}\n\nfunction scaffoldStoryForAngularComponent(absCompPath: string) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst title = makeTitleFromAngularComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.angular?.story?.({\n\t\t\tcomponentName,\n\t\t\tclassName,\n\t\t\tbase,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/angular'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${className} } from './${base}.component'\n\nconst meta: Meta<${className}> = {\n\ttitle: '${title}',\n\tcomponent: ${className},\n\ttags: ${JSON.stringify(tags)},\n\tparameters: {\n\t\tlayout: 'padded',\n\t\t__filePath: import.meta.url,\n\t} satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<${className}>\n\nexport const Primary: Story = {\n\targs: {},\n}\n`\n\tconst storyPath = storyPathForAngularComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded angular story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForAngularComponent(absCompPath: string) {\n\tconst sPath = storyPathForAngularComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForAngularComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Watcher\n// ───────────────────────────────────────────────────────────────────────────────\nfunction startWatcher() {\n\tconst root = projectRoot\n\tconst includeGlobs = [\n\t\t'**/*.stories.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'**/*.story.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'src/**/*.{ts,tsx,js,jsx,svelte}',\n\t\t'src/**/*.component.html',\n\t\t'depcruise.config.cjs',\n\t\t'.dependency-cruiser.{js,cjs}',\n\t]\n\tconst ignoreGlobs = [\n\t\t'node_modules/**',\n\t\t'.git/**',\n\t\t'.storybook/**',\n\t\t'**/.cache/**',\n\t\t'**/dist/**',\n\t\t'**/build/**',\n\t]\n\n\tlet pending = false\n\tlet timer: NodeJS.Timeout | null = null\n\tlet isDeletingFile = false\n\n\tfunction kick(reason: string, absPath: string) {\n\t\tif (pending) return\n\t\tpending = true\n\t\tif (timer) clearTimeout(timer)\n\t\ttimer = setTimeout(() => {\n\t\t\tinfo(`${reason}: ${rel(absPath)}`)\n\t\t\tbuildOnce()\n\t\t\tpending = false\n\t\t}, 120)\n\t}\n\n\treturn watcherParcel\n\t\t.subscribe(\n\t\t\troot,\n\t\t\tasync (err, events) => {\n\t\t\t\tif (err) {\n\t\t\t\t\terror(`watch error ${err?.message || err}`)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const ev of events) {\n\t\t\t\t\tconst abs = ev.path\n\t\t\t\t\tconst relPath = rel(abs)\n\t\t\t\t\tif (!micromatch.isMatch(relPath, includeGlobs)) continue\n\n\t\t\t\t\tif (ev.type === 'delete') {\n\t\t\t\t\t\tconsole.log('Deleted:', relPath)\n\t\t\t\t\t\tisDeletingFile = true\n\t\t\t\t\t\tkick('unlink', abs)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsTsx(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// SVELTE COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsSvelte(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleSvelteComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.ts CREATE — scaffold with inline template\n\t\t\t\t\tif (isComponentsAngularTs(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\tabs,\n\t\t\t\t\t\t\trelPath,\n\t\t\t\t\t\t\t'internal',\n\t\t\t\t\t\t)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.html CREATE\n\t\t\t\t\tif (isComponentsAngularHtml(abs) && ev.type === 'create') {\n\t\t\t\t\t\tconst tsPath = angularComponentTsPath(abs)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\texistsSync(tsPath) &&\n\t\t\t\t\t\t\t!isEmptyOrWhitespace(tsPath)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// .ts already exists — scaffold HTML from it (migrate inline template if present)\n\t\t\t\t\t\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\t\t\t\t\t\tscaffoldAngularHtmlFromTs(abs, tsPath)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t'Angular component creation detected:',\n\t\t\t\t\t\t\t\trel(abs),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst createdStory =\n\t\t\t\t\t\t\t\tensureStoryForAngularComponent(tsPath)\n\t\t\t\t\t\t\tif (createdStory) {\n\t\t\t\t\t\t\t\tkick('create:story', createdStory)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// .ts doesn't exist yet — existing behavior: scaffold both with external templateUrl\n\t\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\t\ttsPath,\n\t\t\t\t\t\t\t\trel(tsPath),\n\t\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// normal rebuild\n\t\t\t\t\tkick(ev.type, abs)\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore: ignoreGlobs },\n\t\t)\n\t\t.then((result) => {\n\t\t\tinfo('watching… (ready)')\n\t\t\treturn result\n\t\t})\n\t\t.catch((e) => error(`watch init failed ${e?.message || e}`))\n\n\tasync function handleComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldComponent(abs)\n\t\t}\n\n\t\tconsole.log('Component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleSvelteComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldSvelteComponent(abs)\n\t\t}\n\n\t\tconst createdStory = ensureStoryForSvelteComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleAngularComponentCreation(\n\t\tabs: string,\n\t\trelPath: string,\n\t\ttemplateStyle: 'internal' | 'external',\n\t) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldAngularComponent(abs, templateStyle)\n\t\t}\n\n\t\tconsole.log('Angular component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForAngularComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Storybook child\n// ───────────────────────────────────────────────────────────────────────────────\nlet sbChild: ChildProcess | null = null\nasync function startStorybook() {\n\tconst isWin = process.platform === 'win32'\n\tlet cmd: string\n\tlet args: string[]\n\tif (SB_CUSTOM_CMD) {\n\t\tconst parts = SB_CUSTOM_CMD.split(' ')\n\t\tcmd = parts[0]\n\t\targs = parts.slice(1)\n\t} else {\n\t\tcmd = 'npx'\n\t\targs = ['-y', 'storybook', 'dev', '-p', String(SB_PORT)]\n\t}\n\n\tinfo(`[sb-deps] launching: ${cmd} ${args.join(' ')}`)\n\n\tsbChild = spawn(cmd, args, {\n\t\tcwd: projectRoot,\n\t\tstdio: 'inherit',\n\t\tshell: isWin, // ← critical to avoid EINVAL on Win + Git Bash\n\t\tenv: process.env,\n\t})\n\n\tsbChild.on('error', (err: any) => {\n\t\terror(`spawn failed: ${err?.message || err}`)\n\t})\n\n\tsbChild.on('exit', (code, sig) => {\n\t\tinfo(`storybook exited (${sig || code})`)\n\t\tsbChild = null\n\t})\n\n\tinfo(`storybook running on http://localhost:${SB_PORT}`)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Boot\n// ───────────────────────────────────────────────────────────────────────────────\n;(async () => {\n\tconst cfg = await loadSbDepsConfig()\n\tANGULAR_SELECTOR_PREFIX = cfg.angularSelectorPrefix ?? 'app-'\n\tSCAFFOLD_CONFIG = cfg.scaffold ?? {}\n\n\tbanner('sb-deps')\n\tinfo(`outDir: ${rel(outDir)}`)\n\tinfo(configPath ? `config: ${rel(configPath)}` : 'config: (none)')\n\tbuildOnce()\n\n\tlet watcher: watcherParcel.AsyncSubscription | null = null\n\tif (WATCH) startWatcher().then((w) => (watcher = w || null))\n\tif (RUN_SB) startStorybook()\n\n\tprocess.on('SIGINT', async () => {\n\t\tinfo('shutting down…')\n\t\tawait watcher?.unsubscribe()\n\t\tsbChild?.kill('SIGINT')\n\t\tprocess.exit(0)\n\t})\n})()\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction rel(p: string) {\n\t// remove the projectRoot prefix and normalize slashes for logs\n\tconst prefix = resolve(projectRoot) + sep\n\treturn p.replace(prefix, '')\n}\nfunction ms(n: number) {\n\treturn `${Math.max(1, Math.round(n))}ms`\n}\nfunction info(msg: string) {\n\tconsole.log('[sb-deps]', msg)\n}\nfunction error(msg: string) {\n\tconsole.error('[sb-deps]', msg)\n}\nfunction banner(title: string) {\n\tconsole.log(`\\n${title} – dependency previews\\n`)\n}\nfunction wait(time = 500) {\n\treturn new Promise((r) => setTimeout(r, time))\n}\n"],"mappings":";;;;;;;;;;AAqBA,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE;AAClC,MAAM,QAAQ,KAAK,SAAS,UAAU;AACtC,MAAM,aAAa,KAAK,QAAQ,kBAAkB;AAClD,MAAM,SAAS,eAAe,CAAC;AAC/B,MAAM,eAAe,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AK,KAAM;AAC5D,KAAI,OAAQ,iBAAgB;AAE5B,SAAQ,GAAG,UAAU,YAAY;AAChC,OAAK,iBAAiB;AACtB,QAAM,SAAS,aAAa;AAC5B,WAAS,KAAK,SAAS;AACvB,UAAQ,KAAK,EAAE;GACd;IACC;AAKJ,SAAS,IAAI,GAAW;CAEvB,MAAM,SAAS,QAAQ,YAAY,GAAG;AACtC,QAAO,EAAE,QAAQ,QAAQ,GAAG;;AAE7B,SAAS,GAAG,GAAW;AACtB,QAAO,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC,CAAC;;AAEtC,SAAS,KAAK,KAAa;AAC1B,SAAQ,IAAI,aAAa,IAAI;;AAE9B,SAAS,MAAM,KAAa;AAC3B,SAAQ,MAAM,aAAa,IAAI;;AAEhC,SAAS,OAAO,OAAe;AAC9B,SAAQ,IAAI,KAAK,MAAM,0BAA0B;;AAElD,SAAS,KAAK,OAAO,KAAK;AACzB,QAAO,IAAI,SAAS,MAAM,WAAW,GAAG,KAAK,CAAC"}
1
+ {"version":3,"file":"sb-deps.mjs","names":["SCAFFOLD_CONFIG: SbDepsConfig['scaffold']","best: null | { val: string; idx: number }","unitSize: number","unitChar: string","knownMappings: Array<[number, number]>","htmlContent: string | null","timer: NodeJS.Timeout | null","sbChild: ChildProcess | null","cmd: string","args: string[]","shellMode: boolean","watcher: watcherParcel.AsyncSubscription | null"],"sources":["../../cli/sb-deps.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/* eslint-disable no-console */\nimport watcherParcel from '@parcel/watcher'\nimport micromatch from 'micromatch'\nimport { execSync, spawn, type ChildProcess } from 'node:child_process'\nimport {\n\texistsSync,\n\tmkdirSync,\n\treadFileSync,\n\tstatSync,\n\twriteFileSync,\n} from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { basename, dirname, join, posix, resolve, sep } from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport type { SbDepsConfig } from '../src/config.js'\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Args\n// ───────────────────────────────────────────────────────────────────────────────\nconst argv = process.argv.slice(2)\nconst WATCH = argv.includes('--watch')\nconst RUN_SB_IDX = argv.indexOf('--run-storybook')\nconst RUN_SB = RUN_SB_IDX !== -1\nconst _RUN_SB_NEXT = RUN_SB ? argv[RUN_SB_IDX + 1] : undefined\nconst SB_CUSTOM_CMD =\n\t_RUN_SB_NEXT && !_RUN_SB_NEXT.startsWith('--') ? _RUN_SB_NEXT : undefined\nconst PORT_ARGI = Math.max(argv.indexOf('--sb-port'), 0)\nconst SB_PORT =\n\tPORT_ARGI && argv[PORT_ARGI + 1]\n\t\t? Number(argv[PORT_ARGI + 1]) || 6006\n\t\t: 6006\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Paths\n// ───────────────────────────────────────────────────────────────────────────────\nconst projectRoot = process.cwd()\nconst outDir = resolve(projectRoot, '.storybook')\nconst rawPath = join(outDir, 'dependency-previews.raw.json')\nconst cookedPath = join(outDir, 'dependency-previews.json')\n\nif (!existsSync(outDir)) mkdirSync(outDir, { recursive: true })\n\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = dirname(__filename)\n\n// Resolve depcruise config: prefer project overrides, else bundled default\nconst pkgDefault = resolve(__dirname, 'scripts', 'depcruise.config.cjs')\nconst overrideCandidates = [\n\tresolve(projectRoot, 'depcruise.config.cjs'),\n\tresolve(projectRoot, '.dependency-cruiser.js'),\n\tresolve(projectRoot, '.dependency-cruiser.cjs'),\n]\nconst configPath =\n\toverrideCandidates.find((p) => existsSync(p)) ||\n\t(existsSync(pkgDefault) ? pkgDefault : null)\n\n// Path to postprocess helper (built as ESM)\nconst post = resolve(__dirname, 'scripts', 'postprocess.mjs')\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Config\n// ───────────────────────────────────────────────────────────────────────────────\nfunction checkIsProjectEsm(): boolean {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(resolve(projectRoot, 'package.json'), 'utf8'),\n\t\t)\n\t\treturn pkg.type === 'module'\n\t} catch {\n\t\treturn false\n\t}\n}\n\nasync function loadSbDepsConfig(): Promise<SbDepsConfig> {\n\tconst candidates = [\n\t\t{\n\t\t\tpath: resolve(projectRoot, 'sb-deps.config.js'),\n\t\t\tisEsm: checkIsProjectEsm(),\n\t\t},\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.mjs'), isEsm: true },\n\t\t{ path: resolve(projectRoot, 'sb-deps.config.cjs'), isEsm: false },\n\t]\n\tfor (const { path: cfgPath, isEsm } of candidates) {\n\t\tif (!existsSync(cfgPath)) continue\n\t\ttry {\n\t\t\tif (isEsm) {\n\t\t\t\tconst mod = await import(pathToFileURL(cfgPath).href)\n\t\t\t\treturn (mod.default ?? mod) as SbDepsConfig\n\t\t\t} else {\n\t\t\t\tconst req = createRequire(import.meta.url)\n\t\t\t\tconst mod = req(cfgPath)\n\t\t\t\treturn (mod?.default ?? mod) as SbDepsConfig\n\t\t\t}\n\t\t} catch (e) {\n\t\t\terror(`failed to load sb-deps config: ${e}`)\n\t\t}\n\t}\n\treturn {}\n}\n\nlet ANGULAR_SELECTOR_PREFIX = 'app-'\nlet SCAFFOLD_CONFIG: SbDepsConfig['scaffold'] = {}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Runners\n// ───────────────────────────────────────────────────────────────────────────────\nfunction runDepCruiseOnce() {\n\tconst cfgFlag = configPath ? `--config \"${configPath}\"` : '--no-config'\n\tconst cmd = `npx depcruise . ${cfgFlag} --output-type json`\n\tconst start = Date.now()\n\tconst stdout = execSync(cmd, {\n\t\tcwd: projectRoot,\n\t\tstdio: ['ignore', 'pipe', 'inherit'],\n\t\tencoding: 'utf8',\n\t})\n\twriteFileSync(rawPath, stdout, 'utf8')\n\tinfo(`graph ✓ (${ms(Date.now() - start)})`)\n}\n\nfunction postprocessOnce() {\n\tconst start = Date.now()\n\tconst postCmd = `node \"${post}\" \"${rawPath}\" \"${cookedPath}\"`\n\texecSync(postCmd, { cwd: projectRoot, stdio: 'inherit' })\n\tinfo(`compiled ✓ → ${rel(cookedPath)} (${ms(Date.now() - start)})`)\n}\n\nfunction buildOnce() {\n\ttry {\n\t\trunDepCruiseOnce()\n\t\tpostprocessOnce()\n\t} catch (e) {\n\t\terror('build failed')\n\t\tif (!WATCH) throw e\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// String utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction toWords(input: string) {\n\treturn String(input)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n\t\t.replace(/[_\\-./]+/g, ' ')\n\t\t.trim()\n\t\t.split(/\\s+/)\n}\nfunction toTitleCase(words: Array<string>) {\n\treturn words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ')\n}\nfunction toPascalCase(input: string) {\n\treturn toTitleCase(toWords(input)).replace(/\\s+/g, '')\n}\nfunction toKebabCase(input: string) {\n\treturn toWords(input)\n\t\t.map((w) => w.toLowerCase())\n\t\t.join('-')\n}\n\nfunction isEmptyOrWhitespace(absPath: string) {\n\ttry {\n\t\tconst s = statSync(absPath)\n\t\tif (s.size === 0) return true\n\t\tconst txt = readFileSync(absPath, 'utf8')\n\t\treturn !txt.trim()\n\t} catch {\n\t\treturn true\n\t}\n}\n\n// src/components/**/Thing.tsx ? (and not a story file)\nfunction isComponentsTsx(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.tsx$/i.test(norm) &&\n\t\t!/\\.stories?\\.tsx$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.svelte ? (and not a story file)\nfunction isComponentsSvelte(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn (\n\t\t/(?:^|\\/)src\\/components\\/.+\\.svelte$/i.test(norm) &&\n\t\t!/\\.stories?\\.svelte$/i.test(norm)\n\t)\n}\n\n// src/components/**/Thing.component.ts ? (and not a story file)\nfunction isComponentsAngularTs(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.ts$/i.test(norm)\n}\n\n// src/components/**/Thing.component.html ?\nfunction isComponentsAngularHtml(absPath: string) {\n\tconst norm = absPath.replace(/\\\\/g, '/')\n\treturn /(?:^|\\/)src\\/components\\/.+\\.component\\.html$/i.test(norm)\n}\n\nfunction componentBaseFromComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.tsx')\n}\n\nfunction componentBaseFromSvelteComponent(absCompPath: string) {\n\treturn basename(absCompPath, '.svelte')\n}\n\nfunction componentBaseFromAngularComponent(absCompPath: string) {\n\treturn basename(absCompPath).replace(/\\.component\\.(ts|html)$/i, '')\n}\n\nfunction angularComponentTsPath(absPath: string) {\n\tconst base = componentBaseFromAngularComponent(absPath)\n\treturn join(dirname(absPath), `${base}.component.ts`)\n}\n\nfunction detectAtomicTag(absPath: string) {\n\tconst adaptedPath = absPath.toLowerCase().replace(/\\\\/g, '/')\n\tconst tokens = ['atom', 'molecule', 'organism', 'template', 'page', 'icon']\n\tlet best: null | { val: string; idx: number } = null\n\tfor (const t of tokens) {\n\t\tconst idx = adaptedPath.lastIndexOf(t)\n\t\tif (idx !== -1 && (best === null || idx > best.idx))\n\t\t\tbest = { val: t, idx }\n\t}\n\treturn best ? best.val : null\n}\n\nfunction storyPathForComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromComponent(absCompPath)\n\treturn join(dir, `${base}.stories.tsx`)\n}\n\nfunction storyPathForSvelteComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\treturn join(dir, `${base}.stories.svelte`)\n}\n\nfunction makeTitleFromComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Story & component scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.react?.component?.({ componentName, propsName }) ??\n\t\t`import type { ReactNode } from 'react'\n\nexport interface ${propsName} {\n children?: ReactNode\n}\n\nexport function ${componentName}({ children }: ${propsName}) {\n return (\n <div className=\"${componentName}\">\n <p>${componentName}</p>\n {children}\n </div>\n )\n}\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded component → \\${rel(absCompPath)}`)\n}\n\nfunction scaffoldStoryForComponent(absCompPath: string) {\n\tconst base = componentBaseFromComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst propsName = `PropsFor${componentName}`\n\tconst title = makeTitleFromComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.react?.story?.({\n\t\t\tcomponentName,\n\t\t\tpropsName,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t\tbase,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/react-vite'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${componentName}, type ${propsName} } from './${componentName}'\n\nconst meta: Meta<typeof ${componentName}> = {\n title: '${title}',\n component: ${componentName},\n tags: ${JSON.stringify(tags)},\n parameters: {\n layout: 'padded',\n __filePath: import.meta.url,\n } satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Primary: Story = {\n args: {} satisfies ${propsName},\n}\n`\n\tconst storyPath = storyPathForComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded story → \\${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForComponent(absCompPath: string) {\n\tconst sPath = storyPathForComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Svelte scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction scaffoldSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\n\tconst tpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.component?.({ componentName }) ??\n\t\t`<script lang=\"ts\">\n\timport type { Snippet } from 'svelte';\n\n\texport interface PropsFor${componentName} {\n\t\tchildren?: Snippet;\n\t}\n\n\tconst { children }: PropsFor${componentName} = $props();\n</script>\n\n<div class=\"${componentName}\">\n\t<p>${componentName}</p>\n\t{@render children?.()}\n</div>\n\n<style>\n\t.${componentName} {\n\t\t/* styles go here */\n\t}\n</style>\n`\n\twriteFileSync(absCompPath, tpl, 'utf8')\n\tinfo(`scaffolded svelte component → ${rel(absCompPath)}`)\n}\n\nfunction makeTitleFromSvelteComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromSvelteComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction scaffoldStoryForSvelteComponent(absCompPath: string) {\n\tconst base = componentBaseFromSvelteComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst title = makeTitleFromSvelteComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.svelte?.story?.({ componentName, title, tags }) ??\n\t\t`<script lang=\"ts\" module>\n\timport type { StoryParameters } from 'storybook-addon-dependency-previews'\n\timport ${componentName}, { type PropsFor${componentName} } from './${componentName}.svelte'\n\timport { defineMeta } from '@storybook/addon-svelte-csf';\n\n\tconst { Story } = defineMeta({\n\t\ttitle: '${title}',\n\t\tcomponent: ${componentName},\n\t\ttags: [${tags.map((t) => `'${t}'`).join(', ')}],\n\t\tparameters: {\n\t\t\tlayout: 'padded',\n\t\t\t__filePath: import.meta.url,\n\t\t} satisfies StoryParameters,\n\t})\n\ttype Args = Omit<PropsFor${componentName}, 'children'>;\n</script>\n\n<Story name=\"Primary\" args={{} satisfies Args}>\n\t<p>${title}</p>\n</Story>\n`\n\tconst storyPath = storyPathForSvelteComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded svelte story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForSvelteComponent(absCompPath: string) {\n\tconst sPath = storyPathForSvelteComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForSvelteComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Angular scaffolding\n// ───────────────────────────────────────────────────────────────────────────────\nfunction storyPathForAngularComponent(absCompPath: string) {\n\tconst dir = dirname(absCompPath)\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\treturn join(dir, `${base}.stories.ts`)\n}\n\nfunction makeTitleFromAngularComponent(absCompPath: string) {\n\tconst srcRoot = join(projectRoot, 'src') + sep\n\tconst normAbs = absCompPath.replace(/\\\\/g, '/')\n\tconst relFromSrc = normAbs.startsWith(srcRoot.replace(/\\\\/g, '/'))\n\t\t? normAbs.slice(srcRoot.length)\n\t\t: absCompPath.replace(projectRoot + sep, '').replace(/\\\\/g, '/')\n\n\tconst dir = posix.dirname(relFromSrc)\n\tlet segments = dir.split('/').filter(Boolean)\n\tif (segments[0] && /^components?$/i.test(segments[0]))\n\t\tsegments = segments.slice(1)\n\n\tconst titledFolders = segments.map((s) => toTitleCase(toWords(s)))\n\tconst compName = componentBaseFromAngularComponent(absCompPath)\n\tconst compTitle = toTitleCase(toWords(compName))\n\n\tconst fullStoryPath = [...titledFolders, compTitle].filter(Boolean)\n\n\t// remove duplicates (e.g. Folder/Thing/Thing => Folder/Thing)\n\tconst dedupedStoryPath = [...new Set(fullStoryPath)]\n\n\treturn dedupedStoryPath.join(' / ')\n}\n\nfunction gcd(a: number, b: number): number {\n\treturn b === 0 ? a : gcd(b, a % b)\n}\n\n/**\n * Re-indents extracted HTML so that each indent level is exactly one unit deep.\n * Detects whether the content uses tabs or spaces (and how many spaces per level)\n * and enforces that indentation only ever increases by one level at a time.\n */\nfunction normalizeHtmlIndentation(html: string): string {\n\tconst lines = html.split('\\n')\n\tconst indentedLines = lines.filter((l) => l.trim() && /^\\s/.test(l))\n\tif (indentedLines.length === 0) return html\n\n\tconst usesTabs = indentedLines.some((l) => l.startsWith('\\t'))\n\tlet unitSize: number\n\tlet unitChar: string\n\n\tif (usesTabs) {\n\t\tunitSize = 1\n\t\tunitChar = '\\t'\n\t} else {\n\t\tconst spaceCounts = indentedLines\n\t\t\t.map((l) => (l.match(/^ +/) ?? [''])[0].length)\n\t\t\t.filter((n) => n > 0)\n\t\tconst g = spaceCounts.reduce((a, b) => gcd(a, b), spaceCounts[0])\n\t\tunitSize = g\n\t\tunitChar = ' '.repeat(g)\n\t}\n\n\tconst rawLevels = lines.map((line) => {\n\t\tif (!line.trim()) return -1\n\t\tconst ws = line.match(/^(\\s*)/)?.[1] ?? ''\n\t\tif (usesTabs) return [...ws].filter((c) => c === '\\t').length\n\t\treturn Math.round(ws.length / unitSize)\n\t})\n\n\t// Normalize: enforce max +1 increase per step.\n\t// knownMappings stays sorted by rawLevel.\n\tconst knownMappings: Array<[number, number]> = [[0, 0]]\n\tlet prevRaw = 0\n\tlet prevNorm = 0\n\n\tconst normLevels = rawLevels.map((raw) => {\n\t\tif (raw === -1) return -1\n\t\tif (raw === prevRaw) return prevNorm\n\n\t\tif (raw > prevRaw) {\n\t\t\tconst existing = knownMappings.find(([r]) => r === raw)\n\t\t\tif (existing) {\n\t\t\t\t;[prevRaw, prevNorm] = [raw, existing[1]]\n\t\t\t\treturn prevNorm\n\t\t\t}\n\t\t\tprevNorm += 1\n\t\t\tprevRaw = raw\n\t\t\tconst insertIdx = knownMappings.findIndex(([r]) => r > raw)\n\t\t\tif (insertIdx === -1) knownMappings.push([raw, prevNorm])\n\t\t\telse knownMappings.splice(insertIdx, 0, [raw, prevNorm])\n\t\t\treturn prevNorm\n\t\t}\n\n\t\t// Decrease: find the largest known rawLevel <= current\n\t\tconst below = knownMappings.filter(([r]) => r <= raw)\n\t\tconst norm = below.length > 0 ? below[below.length - 1][1] : 0\n\t\t;[prevRaw, prevNorm] = [raw, norm]\n\t\treturn norm\n\t})\n\n\treturn lines\n\t\t.map((line, i) => {\n\t\t\tif (normLevels[i] === -1) return ''\n\t\t\treturn unitChar.repeat(normLevels[i]) + line.trimStart()\n\t\t})\n\t\t.join('\\n')\n}\n\nfunction defaultAngularHtmlTemplate(componentName: string) {\n\treturn (\n\t\tSCAFFOLD_CONFIG?.angular?.componentHtml?.({ componentName }) ??\n\t\t`<p>${componentName}</p>\n\t<ng-content />\n`\n\t)\n}\n\nfunction scaffoldAngularComponent(\n\tabsCompPath: string,\n\ttemplateLocation: 'internal' | 'external',\n) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst selector = ANGULAR_SELECTOR_PREFIX + toKebabCase(componentName)\n\tconst dir = dirname(absCompPath)\n\tconst tsPath = join(dir, `${base}.component.ts`)\n\tconst htmlPath = join(dir, `${base}.component.html`)\n\n\tif (!existsSync(tsPath) || isEmptyOrWhitespace(tsPath)) {\n\t\tconst defaultTsTpl =\n\t\t\ttemplateLocation === 'external'\n\t\t\t\t? `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplateUrl: './${base}.component.html',\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n class = input<string>('');\n}\n`\n\t\t\t\t: `import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: '${selector}',\n\thost: { '[class]': '[\"${componentName}\", class()].join(\" \")' },\n\ttemplate: \\`\n\t\t<p>${componentName}</p>\n\t\t<ng-content />\n\t\\`,\n\tstandalone: true,\n\timports: [],\n})\nexport class ${className} {\n\tclass = input<string>('');\n}\n`\n\t\tconst tsTpl =\n\t\t\tSCAFFOLD_CONFIG?.angular?.component?.({\n\t\t\t\tcomponentName,\n\t\t\t\tclassName,\n\t\t\t\tselector,\n\t\t\t\tbase,\n\t\t\t\ttemplateLocation,\n\t\t\t}) ?? defaultTsTpl\n\t\twriteFileSync(tsPath, tsTpl, 'utf8')\n\t\tinfo(`scaffolded angular component → ${rel(tsPath)}`)\n\t}\n\n\t// Only scaffold the HTML file when using an external template\n\tif (\n\t\ttemplateLocation === 'external' &&\n\t\t(!existsSync(htmlPath) || isEmptyOrWhitespace(htmlPath))\n\t) {\n\t\twriteFileSync(\n\t\t\thtmlPath,\n\t\t\tdefaultAngularHtmlTemplate(componentName),\n\t\t\t'utf8',\n\t\t)\n\t\tinfo(`scaffolded angular template → ${rel(htmlPath)}`)\n\t}\n}\n\nfunction scaffoldAngularHtmlFromTs(absHtmlPath: string, absTsPath: string) {\n\tconst base = componentBaseFromAngularComponent(absHtmlPath)\n\tconst componentName = toPascalCase(base)\n\n\tlet htmlContent: string | null = null\n\n\t// Try to extract inline template from the existing .ts file\n\tif (existsSync(absTsPath) && !isEmptyOrWhitespace(absTsPath)) {\n\t\tconst tsContent = readFileSync(absTsPath, 'utf8')\n\t\tconst match = tsContent.match(/template:\\s*`([\\s\\S]*?)`/)\n\t\tif (match) {\n\t\t\thtmlContent = normalizeHtmlIndentation(match[1].trim()) + '\\n'\n\t\t\t// Swap template: `...` → templateUrl in the .ts file\n\t\t\tconst updated = tsContent.replace(\n\t\t\t\t/template:\\s*`[\\s\\S]*?`/,\n\t\t\t\t`templateUrl: './${base}.component.html'`,\n\t\t\t)\n\t\t\twriteFileSync(absTsPath, updated, 'utf8')\n\t\t\tinfo(\n\t\t\t\t`updated angular component to use templateUrl → ${rel(absTsPath)}`,\n\t\t\t)\n\t\t}\n\t}\n\n\t// Fall back to default scaffold\n\tif (htmlContent === null) {\n\t\thtmlContent = defaultAngularHtmlTemplate(componentName)\n\t}\n\n\twriteFileSync(absHtmlPath, htmlContent, 'utf8')\n\tinfo(`scaffolded angular template → ${rel(absHtmlPath)}`)\n}\n\nfunction scaffoldStoryForAngularComponent(absCompPath: string) {\n\tconst base = componentBaseFromAngularComponent(absCompPath)\n\tconst componentName = toPascalCase(base)\n\tconst className = `${componentName}Component`\n\tconst title = makeTitleFromAngularComponent(absCompPath)\n\tconst atomic = detectAtomicTag(absCompPath)\n\tconst tags = ['autodocs']\n\tif (atomic) tags.push(atomic)\n\n\tconst storyTpl =\n\t\tSCAFFOLD_CONFIG?.angular?.story?.({\n\t\t\tcomponentName,\n\t\t\tclassName,\n\t\t\tbase,\n\t\t\ttitle,\n\t\t\ttags,\n\t\t}) ??\n\t\t`import type { Meta, StoryObj } from '@storybook/angular'\nimport type { StoryParameters } from 'storybook-addon-dependency-previews'\nimport { ${className} } from './${base}.component'\n\nconst meta: Meta<${className}> = {\n\ttitle: '${title}',\n\tcomponent: ${className},\n\ttags: ${JSON.stringify(tags)},\n\tparameters: {\n\t\tlayout: 'padded',\n\t\t__filePath: import.meta.url,\n\t} satisfies StoryParameters,\n}\n\nexport default meta\n\ntype Story = StoryObj<${className}>\n\nexport const Primary: Story = {\n\targs: {},\n}\n`\n\tconst storyPath = storyPathForAngularComponent(absCompPath)\n\twriteFileSync(storyPath, storyTpl, 'utf8')\n\tinfo(`scaffolded angular story → ${rel(storyPath)}`)\n\treturn storyPath\n}\n\nfunction ensureStoryForAngularComponent(absCompPath: string) {\n\tconst sPath = storyPathForAngularComponent(absCompPath)\n\tif (existsSync(sPath)) return null\n\treturn scaffoldStoryForAngularComponent(absCompPath)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Watcher\n// ───────────────────────────────────────────────────────────────────────────────\nfunction startWatcher() {\n\tconst root = projectRoot\n\tconst includeGlobs = [\n\t\t'**/*.stories.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'**/*.story.{ts,tsx,js,jsx,mdx,svelte}',\n\t\t'src/**/*.{ts,tsx,js,jsx,svelte}',\n\t\t'src/**/*.component.html',\n\t\t'depcruise.config.cjs',\n\t\t'.dependency-cruiser.{js,cjs}',\n\t]\n\tconst ignoreGlobs = [\n\t\t'node_modules/**',\n\t\t'.git/**',\n\t\t'.storybook/**',\n\t\t'**/.cache/**',\n\t\t'**/dist/**',\n\t\t'**/build/**',\n\t]\n\n\tlet pending = false\n\tlet timer: NodeJS.Timeout | null = null\n\tlet isDeletingFile = false\n\n\tfunction kick(reason: string, absPath: string) {\n\t\tif (pending) return\n\t\tpending = true\n\t\tif (timer) clearTimeout(timer)\n\t\ttimer = setTimeout(() => {\n\t\t\tinfo(`${reason}: ${rel(absPath)}`)\n\t\t\tbuildOnce()\n\t\t\tpending = false\n\t\t}, 120)\n\t}\n\n\treturn watcherParcel\n\t\t.subscribe(\n\t\t\troot,\n\t\t\tasync (err, events) => {\n\t\t\t\tif (err) {\n\t\t\t\t\terror(`watch error ${err?.message || err}`)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor (const ev of events) {\n\t\t\t\t\tconst abs = ev.path\n\t\t\t\t\tconst relPath = rel(abs)\n\t\t\t\t\tif (!micromatch.isMatch(relPath, includeGlobs)) continue\n\n\t\t\t\t\tif (ev.type === 'delete') {\n\t\t\t\t\t\tconsole.log('Deleted:', relPath)\n\t\t\t\t\t\tisDeletingFile = true\n\t\t\t\t\t\tkick('unlink', abs)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsTsx(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// SVELTE COMPONENT CREATE — scaffold if empty and ensure story\n\t\t\t\t\tif (isComponentsSvelte(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleSvelteComponentCreation(abs, relPath)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.ts CREATE — scaffold with inline template\n\t\t\t\t\tif (isComponentsAngularTs(abs) && ev.type === 'create') {\n\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\tabs,\n\t\t\t\t\t\t\trelPath,\n\t\t\t\t\t\t\t'internal',\n\t\t\t\t\t\t)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// ANGULAR .component.html CREATE\n\t\t\t\t\tif (isComponentsAngularHtml(abs) && ev.type === 'create') {\n\t\t\t\t\t\tconst tsPath = angularComponentTsPath(abs)\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\texistsSync(tsPath) &&\n\t\t\t\t\t\t\t!isEmptyOrWhitespace(tsPath)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// .ts already exists — scaffold HTML from it (migrate inline template if present)\n\t\t\t\t\t\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\t\t\t\t\t\tscaffoldAngularHtmlFromTs(abs, tsPath)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t\t\t'Angular component creation detected:',\n\t\t\t\t\t\t\t\trel(abs),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tconst createdStory =\n\t\t\t\t\t\t\t\tensureStoryForAngularComponent(tsPath)\n\t\t\t\t\t\t\tif (createdStory) {\n\t\t\t\t\t\t\t\tkick('create:story', createdStory)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// .ts doesn't exist yet — existing behavior: scaffold both with external templateUrl\n\t\t\t\t\t\t\tawait handleAngularComponentCreation(\n\t\t\t\t\t\t\t\ttsPath,\n\t\t\t\t\t\t\t\trel(tsPath),\n\t\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\t// normal rebuild\n\t\t\t\t\tkick(ev.type, abs)\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ ignore: ignoreGlobs },\n\t\t)\n\t\t.then((result) => {\n\t\t\tinfo('watching… (ready)')\n\t\t\treturn result\n\t\t})\n\t\t.catch((e) => error(`watch init failed ${e?.message || e}`))\n\n\tasync function handleComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldComponent(abs)\n\t\t}\n\n\t\tconsole.log('Component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleSvelteComponentCreation(abs: string, relPath: string) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldSvelteComponent(abs)\n\t\t}\n\n\t\tconst createdStory = ensureStoryForSvelteComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n\n\tasync function handleAngularComponentCreation(\n\t\tabs: string,\n\t\trelPath: string,\n\t\ttemplateStyle: 'internal' | 'external',\n\t) {\n\t\tif (isEmptyOrWhitespace(abs)) {\n\t\t\tscaffoldAngularComponent(abs, templateStyle)\n\t\t}\n\n\t\tconsole.log('Angular component creation detected:', relPath)\n\t\tconst createdStory = ensureStoryForAngularComponent(abs)\n\t\tif (createdStory) {\n\t\t\tkick('create:story', createdStory)\n\t\t}\n\t}\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Storybook child\n// ───────────────────────────────────────────────────────────────────────────────\nlet sbChild: ChildProcess | null = null\nasync function startStorybook() {\n\tconst isWin = process.platform === 'win32'\n\tlet cmd: string\n\tlet args: string[]\n\tlet shellMode: boolean\n\tif (SB_CUSTOM_CMD) {\n\t\tcmd = SB_CUSTOM_CMD\n\t\targs = []\n\t\tshellMode = true // shell:true handles quoted args and paths with spaces\n\t} else {\n\t\tcmd = 'npx'\n\t\targs = ['-y', 'storybook', 'dev', '-p', String(SB_PORT)]\n\t\tshellMode = isWin // ← critical to avoid EINVAL on Win + Git Bash\n\t}\n\n\tinfo(`[sb-deps] launching: ${cmd} ${args.join(' ')}`)\n\n\tsbChild = spawn(cmd, args, {\n\t\tcwd: projectRoot,\n\t\tstdio: 'inherit',\n\t\tshell: shellMode,\n\t\tenv: process.env,\n\t})\n\n\tsbChild.on('error', (err: any) => {\n\t\terror(`spawn failed: ${err?.message || err}`)\n\t})\n\n\tsbChild.on('exit', (code, sig) => {\n\t\tinfo(`storybook exited (${sig || code})`)\n\t\tsbChild = null\n\t})\n\n\tinfo(`storybook running on http://localhost:${SB_PORT}`)\n}\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Boot\n// ───────────────────────────────────────────────────────────────────────────────\n;(async () => {\n\tconst cfg = await loadSbDepsConfig()\n\tANGULAR_SELECTOR_PREFIX = cfg.angularSelectorPrefix ?? 'app-'\n\tSCAFFOLD_CONFIG = cfg.scaffold ?? {}\n\n\tbanner('sb-deps')\n\tinfo(`outDir: ${rel(outDir)}`)\n\tinfo(configPath ? `config: ${rel(configPath)}` : 'config: (none)')\n\tbuildOnce()\n\n\tlet watcher: watcherParcel.AsyncSubscription | null = null\n\tif (WATCH) startWatcher().then((w) => (watcher = w || null))\n\tif (RUN_SB) startStorybook()\n\n\tprocess.on('SIGINT', async () => {\n\t\tinfo('shutting down…')\n\t\tawait watcher?.unsubscribe()\n\t\tsbChild?.kill('SIGINT')\n\t\tprocess.exit(0)\n\t})\n})()\n\n// ───────────────────────────────────────────────────────────────────────────────\n// Utils\n// ───────────────────────────────────────────────────────────────────────────────\nfunction rel(p: string) {\n\t// remove the projectRoot prefix and normalize slashes for logs\n\tconst prefix = resolve(projectRoot) + sep\n\treturn p.replace(prefix, '')\n}\nfunction ms(n: number) {\n\treturn `${Math.max(1, Math.round(n))}ms`\n}\nfunction info(msg: string) {\n\tconsole.log('[sb-deps]', msg)\n}\nfunction error(msg: string) {\n\tconsole.error('[sb-deps]', msg)\n}\nfunction banner(title: string) {\n\tconsole.log(`\\n${title} – dependency previews\\n`)\n}\nfunction wait(time = 500) {\n\treturn new Promise((r) => setTimeout(r, time))\n}\n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ACjB,MAAK,WAAW,IAAI,OAAO,GAAG;AAC9B,MAAK,aAAa,WAAW,IAAI,WAAW,KAAK,iBAAiB;AAClE,YAAW;CAEX,IAAIC,UAAkD;AACtD,KAAI,MAAO,eAAc,CAAC,MAAM,MAAO,UAAU,KAAK,KAAM;AAC5D,KAAI,OAAQ,iBAAgB;AAE5B,SAAQ,GAAG,UAAU,YAAY;AAChC,OAAK,iBAAiB;AACtB,QAAM,SAAS,aAAa;AAC5B,WAAS,KAAK,SAAS;AACvB,UAAQ,KAAK,EAAE;GACd;IACC;AAKJ,SAAS,IAAI,GAAW;CAEvB,MAAM,SAAS,QAAQ,YAAY,GAAG;AACtC,QAAO,EAAE,QAAQ,QAAQ,GAAG;;AAE7B,SAAS,GAAG,GAAW;AACtB,QAAO,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC,CAAC;;AAEtC,SAAS,KAAK,KAAa;AAC1B,SAAQ,IAAI,aAAa,IAAI;;AAE9B,SAAS,MAAM,KAAa;AAC3B,SAAQ,MAAM,aAAa,IAAI;;AAEhC,SAAS,OAAO,OAAe;AAC9B,SAAQ,IAAI,KAAK,MAAM,0BAA0B;;AAElD,SAAS,KAAK,OAAO,KAAK;AACzB,QAAO,IAAI,SAAS,MAAM,WAAW,GAAG,KAAK,CAAC"}
@@ -5,8 +5,20 @@ let __storybook_addon_docs_blocks = require("@storybook/addon-docs/blocks");
5
5
  __storybook_addon_docs_blocks = require_rolldown_runtime.__toESM(__storybook_addon_docs_blocks);
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
7
  react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
8
+ let storybook_theming = require("storybook/theming");
9
+ storybook_theming = require_rolldown_runtime.__toESM(storybook_theming);
8
10
 
9
11
  //#region src/panels/DefaultAutoDocsLayout.tsx
12
+ const sbTheme = (0, storybook_theming.convert)((0, storybook_theming.create)({ base: "light" }));
13
+ function ThemedDocsContainer({ children,...props }) {
14
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(storybook_theming.ThemeProvider, {
15
+ theme: sbTheme,
16
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__storybook_addon_docs_blocks.DocsContainer, {
17
+ ...props,
18
+ children
19
+ })
20
+ });
21
+ }
10
22
  function DefaultAutoDocsLayout() {
11
23
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
12
24
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__storybook_addon_docs_blocks.Title, {}),
@@ -18,7 +30,11 @@ function DefaultAutoDocsLayout() {
18
30
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__storybook_addon_docs_blocks.Stories, {})
19
31
  ] });
20
32
  }
21
- const defaultPreviewParameters = { docs: { page: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultAutoDocsLayout, {}) } };
33
+ const defaultPreviewParameters = { docs: {
34
+ page: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultAutoDocsLayout, {}),
35
+ theme: (0, storybook_theming.create)({ base: "light" }),
36
+ container: ThemedDocsContainer
37
+ } };
22
38
 
23
39
  //#endregion
24
40
  exports.DefaultAutoDocsLayout = DefaultAutoDocsLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultAutoDocsLayout.cjs","names":["Title","Subtitle","Description","Primary","Controls","DependencyPreviews","Stories","defaultPreviewParameters: StorybookParameters"],"sources":["../../src/panels/DefaultAutoDocsLayout.tsx"],"sourcesContent":["import {\n\tControls,\n\tDescription,\n\tPrimary,\n\tStories,\n\tSubtitle,\n\tTitle,\n} from '@storybook/addon-docs/blocks'\nimport { DependencyPreviews } from '../blocks'\nimport type { StorybookParameters } from '../types'\n\nexport { DependencyPreviews }\n\nexport function DefaultAutoDocsLayout() {\n\treturn (\n\t\t<>\n\t\t\t<Title />\n\t\t\t<Subtitle />\n\t\t\t<Description />\n\t\t\t<Primary />\n\t\t\t<Controls />\n\t\t\t<DependencyPreviews />\n\t\t\t<Stories />\n\t\t</>\n\t)\n}\n\nexport const defaultPreviewParameters: StorybookParameters = {\n\tdocs: {\n\t\tpage: () => <DefaultAutoDocsLayout />,\n\t},\n}\n"],"mappings":";;;;;;;;;AAaA,SAAgB,wBAAwB;AACvC,QACC;EACC,2CAACA,wCAAQ;EACT,2CAACC,2CAAW;EACZ,2CAACC,8CAAc;EACf,2CAACC,0CAAU;EACX,2CAACC,2CAAW;EACZ,2CAACC,kDAAqB;EACtB,2CAACC,0CAAU;KACT;;AAIL,MAAaC,2BAAgD,EAC5D,MAAM,EACL,YAAY,2CAAC,0BAAwB,EACrC,EACD"}
1
+ {"version":3,"file":"DefaultAutoDocsLayout.cjs","names":["ThemeProvider","DocsContainer","Title","Subtitle","Description","Primary","Controls","DependencyPreviews","Stories","defaultPreviewParameters: StorybookParameters"],"sources":["../../src/panels/DefaultAutoDocsLayout.tsx"],"sourcesContent":["import {\n\tControls,\n\tDescription,\n\tDocsContainer,\n\ttype DocsContainerProps,\n\tPrimary,\n\tStories,\n\tSubtitle,\n\tTitle,\n} from '@storybook/addon-docs/blocks'\nimport type { PropsWithChildren } from 'react'\nimport { convert, create, ThemeProvider } from 'storybook/theming'\nimport { DependencyPreviews } from '../blocks'\nimport type { StorybookParameters } from '../types'\n\nexport { DependencyPreviews }\n\nconst sbTheme = convert(create({ base: 'light' }))\n\n// Storybook's DocsContainer already provides a theme via its own styled-components\n// context. However, in Vite production builds, styled-components ends up in two\n// separate bundles (iframe and DocsRenderer), each with their own ThemeContext.\n// DocsContainer only covers the DocsRenderer context (Il). This wrapper adds a\n// ThemeProvider that uses the iframe bundle's styled-components context (Ua),\n// so that docs UI components like ActionButton also receive the theme.\nfunction ThemedDocsContainer({\n\tchildren,\n\t...props\n}: PropsWithChildren<DocsContainerProps>) {\n\treturn (\n\t\t<ThemeProvider theme={sbTheme}>\n\t\t\t<DocsContainer {...props}>{children}</DocsContainer>\n\t\t</ThemeProvider>\n\t)\n}\n\nexport function DefaultAutoDocsLayout() {\n\treturn (\n\t\t<>\n\t\t\t<Title />\n\t\t\t<Subtitle />\n\t\t\t<Description />\n\t\t\t<Primary />\n\t\t\t<Controls />\n\t\t\t<DependencyPreviews />\n\t\t\t<Stories />\n\t\t</>\n\t)\n}\n\nexport const defaultPreviewParameters: StorybookParameters = {\n\tdocs: {\n\t\tpage: () => <DefaultAutoDocsLayout />,\n\t\ttheme: create({ base: 'light' }),\n\t\tcontainer: ThemedDocsContainer,\n\t},\n}\n"],"mappings":";;;;;;;;;;;AAiBA,MAAM,uEAAyB,EAAE,MAAM,SAAS,CAAC,CAAC;AAQlD,SAAS,oBAAoB,EAC5B,SACA,GAAG,SACsC;AACzC,QACC,2CAACA;EAAc,OAAO;YACrB,2CAACC;GAAc,GAAI;GAAQ;IAAyB;GACrC;;AAIlB,SAAgB,wBAAwB;AACvC,QACC;EACC,2CAACC,wCAAQ;EACT,2CAACC,2CAAW;EACZ,2CAACC,8CAAc;EACf,2CAACC,0CAAU;EACX,2CAACC,2CAAW;EACZ,2CAACC,kDAAqB;EACtB,2CAACC,0CAAU;KACT;;AAIL,MAAaC,2BAAgD,EAC5D,MAAM;CACL,YAAY,2CAAC,0BAAwB;CACrC,qCAAc,EAAE,MAAM,SAAS,CAAC;CAChC,WAAW;CACX,EACD"}
@@ -1,10 +1,10 @@
1
1
  import { DependencyPreviews } from "../blocks/DependencyPreviews.cjs";
2
2
  import "../blocks/index.cjs";
3
3
  import { StorybookParameters } from "../types.cjs";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/panels/DefaultAutoDocsLayout.d.ts
7
- declare function DefaultAutoDocsLayout(): react_jsx_runtime0.JSX.Element;
7
+ declare function DefaultAutoDocsLayout(): react_jsx_runtime1.JSX.Element;
8
8
  declare const defaultPreviewParameters: StorybookParameters;
9
9
  //#endregion
10
10
  export { DefaultAutoDocsLayout, defaultPreviewParameters };
@@ -1,10 +1,10 @@
1
1
  import { DependencyPreviews } from "../blocks/DependencyPreviews.mjs";
2
2
  import "../blocks/index.mjs";
3
3
  import { StorybookParameters } from "../types.mjs";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
5
5
 
6
6
  //#region src/panels/DefaultAutoDocsLayout.d.ts
7
- declare function DefaultAutoDocsLayout(): react_jsx_runtime0.JSX.Element;
7
+ declare function DefaultAutoDocsLayout(): react_jsx_runtime1.JSX.Element;
8
8
  declare const defaultPreviewParameters: StorybookParameters;
9
9
  //#endregion
10
10
  export { DefaultAutoDocsLayout, defaultPreviewParameters };
@@ -1,9 +1,20 @@
1
1
  import { DependencyPreviews } from "../blocks/DependencyPreviews.mjs";
2
2
  import "../blocks/index.mjs";
3
- import { Controls, Description, Primary, Stories, Subtitle, Title } from "@storybook/addon-docs/blocks";
3
+ import { Controls, Description, DocsContainer, Primary, Stories, Subtitle, Title } from "@storybook/addon-docs/blocks";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { ThemeProvider, convert, create } from "storybook/theming";
5
6
 
6
7
  //#region src/panels/DefaultAutoDocsLayout.tsx
8
+ const sbTheme = convert(create({ base: "light" }));
9
+ function ThemedDocsContainer({ children,...props }) {
10
+ return /* @__PURE__ */ jsx(ThemeProvider, {
11
+ theme: sbTheme,
12
+ children: /* @__PURE__ */ jsx(DocsContainer, {
13
+ ...props,
14
+ children
15
+ })
16
+ });
17
+ }
7
18
  function DefaultAutoDocsLayout() {
8
19
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9
20
  /* @__PURE__ */ jsx(Title, {}),
@@ -15,7 +26,11 @@ function DefaultAutoDocsLayout() {
15
26
  /* @__PURE__ */ jsx(Stories, {})
16
27
  ] });
17
28
  }
18
- const defaultPreviewParameters = { docs: { page: () => /* @__PURE__ */ jsx(DefaultAutoDocsLayout, {}) } };
29
+ const defaultPreviewParameters = { docs: {
30
+ page: () => /* @__PURE__ */ jsx(DefaultAutoDocsLayout, {}),
31
+ theme: create({ base: "light" }),
32
+ container: ThemedDocsContainer
33
+ } };
19
34
 
20
35
  //#endregion
21
36
  export { DefaultAutoDocsLayout, defaultPreviewParameters };
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultAutoDocsLayout.mjs","names":["defaultPreviewParameters: StorybookParameters"],"sources":["../../src/panels/DefaultAutoDocsLayout.tsx"],"sourcesContent":["import {\n\tControls,\n\tDescription,\n\tPrimary,\n\tStories,\n\tSubtitle,\n\tTitle,\n} from '@storybook/addon-docs/blocks'\nimport { DependencyPreviews } from '../blocks'\nimport type { StorybookParameters } from '../types'\n\nexport { DependencyPreviews }\n\nexport function DefaultAutoDocsLayout() {\n\treturn (\n\t\t<>\n\t\t\t<Title />\n\t\t\t<Subtitle />\n\t\t\t<Description />\n\t\t\t<Primary />\n\t\t\t<Controls />\n\t\t\t<DependencyPreviews />\n\t\t\t<Stories />\n\t\t</>\n\t)\n}\n\nexport const defaultPreviewParameters: StorybookParameters = {\n\tdocs: {\n\t\tpage: () => <DefaultAutoDocsLayout />,\n\t},\n}\n"],"mappings":";;;;;;AAaA,SAAgB,wBAAwB;AACvC,QACC;EACC,oBAAC,UAAQ;EACT,oBAAC,aAAW;EACZ,oBAAC,gBAAc;EACf,oBAAC,YAAU;EACX,oBAAC,aAAW;EACZ,oBAAC,uBAAqB;EACtB,oBAAC,YAAU;KACT;;AAIL,MAAaA,2BAAgD,EAC5D,MAAM,EACL,YAAY,oBAAC,0BAAwB,EACrC,EACD"}
1
+ {"version":3,"file":"DefaultAutoDocsLayout.mjs","names":["defaultPreviewParameters: StorybookParameters"],"sources":["../../src/panels/DefaultAutoDocsLayout.tsx"],"sourcesContent":["import {\n\tControls,\n\tDescription,\n\tDocsContainer,\n\ttype DocsContainerProps,\n\tPrimary,\n\tStories,\n\tSubtitle,\n\tTitle,\n} from '@storybook/addon-docs/blocks'\nimport type { PropsWithChildren } from 'react'\nimport { convert, create, ThemeProvider } from 'storybook/theming'\nimport { DependencyPreviews } from '../blocks'\nimport type { StorybookParameters } from '../types'\n\nexport { DependencyPreviews }\n\nconst sbTheme = convert(create({ base: 'light' }))\n\n// Storybook's DocsContainer already provides a theme via its own styled-components\n// context. However, in Vite production builds, styled-components ends up in two\n// separate bundles (iframe and DocsRenderer), each with their own ThemeContext.\n// DocsContainer only covers the DocsRenderer context (Il). This wrapper adds a\n// ThemeProvider that uses the iframe bundle's styled-components context (Ua),\n// so that docs UI components like ActionButton also receive the theme.\nfunction ThemedDocsContainer({\n\tchildren,\n\t...props\n}: PropsWithChildren<DocsContainerProps>) {\n\treturn (\n\t\t<ThemeProvider theme={sbTheme}>\n\t\t\t<DocsContainer {...props}>{children}</DocsContainer>\n\t\t</ThemeProvider>\n\t)\n}\n\nexport function DefaultAutoDocsLayout() {\n\treturn (\n\t\t<>\n\t\t\t<Title />\n\t\t\t<Subtitle />\n\t\t\t<Description />\n\t\t\t<Primary />\n\t\t\t<Controls />\n\t\t\t<DependencyPreviews />\n\t\t\t<Stories />\n\t\t</>\n\t)\n}\n\nexport const defaultPreviewParameters: StorybookParameters = {\n\tdocs: {\n\t\tpage: () => <DefaultAutoDocsLayout />,\n\t\ttheme: create({ base: 'light' }),\n\t\tcontainer: ThemedDocsContainer,\n\t},\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,UAAU,QAAQ,OAAO,EAAE,MAAM,SAAS,CAAC,CAAC;AAQlD,SAAS,oBAAoB,EAC5B,SACA,GAAG,SACsC;AACzC,QACC,oBAAC;EAAc,OAAO;YACrB,oBAAC;GAAc,GAAI;GAAQ;IAAyB;GACrC;;AAIlB,SAAgB,wBAAwB;AACvC,QACC;EACC,oBAAC,UAAQ;EACT,oBAAC,aAAW;EACZ,oBAAC,gBAAc;EACf,oBAAC,YAAU;EACX,oBAAC,aAAW;EACZ,oBAAC,uBAAqB;EACtB,oBAAC,YAAU;KACT;;AAIL,MAAaA,2BAAgD,EAC5D,MAAM;CACL,YAAY,oBAAC,0BAAwB;CACrC,OAAO,OAAO,EAAE,MAAM,SAAS,CAAC;CAChC,WAAW;CACX,EACD"}
package/dist/types.d.cts CHANGED
@@ -102,10 +102,12 @@ type DecoratorFn = (Story: (ctx: StoryContext) => ReactNode, ctx: StoryContext)
102
102
  type _InputSignalValue<T> = T extends (() => infer U) ? U : never;
103
103
  type _InputSignalKeys<T> = { [K in keyof T]: T[K] extends (() => unknown) ? K : never }[keyof T];
104
104
  /**
105
- * Extracts plain prop types from an Angular component's input signals.
105
+ * Extracts plain prop types from an Angular component's signal-based inputs.
106
106
  *
107
- * Filters to only callable signal properties (InputSignal / ModelSignal),
108
- * mapping each to its unwrapped value type.
107
+ * Uses a structural match (`() => unknown`) to identify callable properties,
108
+ * which covers `input()` and `model()` signals but will also match computed
109
+ * signals and zero-arg methods. Use `ExcludeKeys` to omit any non-input
110
+ * properties (e.g. `'class'`, lifecycle hooks).
109
111
  *
110
112
  * @example
111
113
  * export type PropsForCardMolecule = AngularComponentProps<CardMoleculeComponent, 'class'>
package/dist/types.d.mts CHANGED
@@ -102,10 +102,12 @@ type DecoratorFn = (Story: (ctx: StoryContext) => ReactNode, ctx: StoryContext)
102
102
  type _InputSignalValue<T> = T extends (() => infer U) ? U : never;
103
103
  type _InputSignalKeys<T> = { [K in keyof T]: T[K] extends (() => unknown) ? K : never }[keyof T];
104
104
  /**
105
- * Extracts plain prop types from an Angular component's input signals.
105
+ * Extracts plain prop types from an Angular component's signal-based inputs.
106
106
  *
107
- * Filters to only callable signal properties (InputSignal / ModelSignal),
108
- * mapping each to its unwrapped value type.
107
+ * Uses a structural match (`() => unknown`) to identify callable properties,
108
+ * which covers `input()` and `model()` signals but will also match computed
109
+ * signals and zero-arg methods. Use `ExcludeKeys` to omit any non-input
110
+ * properties (e.g. `'class'`, lifecycle hooks).
109
111
  *
110
112
  * @example
111
113
  * export type PropsForCardMolecule = AngularComponentProps<CardMoleculeComponent, 'class'>
package/package.json CHANGED
@@ -1,122 +1,122 @@
1
1
  {
2
- "name": "storybook-addon-dependency-previews",
3
- "description": "A Storybook 10 addon to automatically generate a visual dependency tree for your components.",
4
- "version": "0.3.0",
5
- "private": false,
6
- "license": "Apache-2.0",
7
- "homepage": "https://dependency-previews-storybook.netlify.app/?path=/docs/04-templates-home-template--docs",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/Dan503/storybook-addon-dependency-previews.git"
11
- },
12
- "bugs": {
13
- "url": "https://github.com/Dan503/storybook-addon-dependency-previews/issues"
14
- },
15
- "keywords": [
16
- "storybook",
17
- "storybook-addon",
18
- "dependency-previews",
19
- "dependency-cruiser",
20
- "react",
21
- "components",
22
- "ui",
23
- "design-system"
24
- ],
25
- "author": {
26
- "name": "Daniel Tonon"
27
- },
28
- "type": "module",
29
- "main": "dist/index.cjs",
30
- "module": "dist/index.js",
31
- "types": "dist/index.d.ts",
32
- "exports": {
33
- ".": {
34
- "import": "./dist/index.mjs",
35
- "require": "./dist/index.cjs",
36
- "types": "./dist/index.d.mts"
37
- },
38
- "./addon": {
39
- "import": "./dist/addon/index.mjs",
40
- "require": "./dist/addon/index.cjs",
41
- "types": "./dist/addon/index.d.mts"
42
- },
43
- "./config": {
44
- "import": "./dist/config.mjs",
45
- "require": "./dist/config.cjs",
46
- "types": "./dist/config.d.mts"
47
- },
48
- "./cli/sb-deps": {
49
- "import": "./dist/cli/sb-deps.mjs",
50
- "require": "./dist/cli/sb-deps.cjs",
51
- "types": "./dist/cli/sb-deps.d.mts"
52
- }
53
- },
54
- "bin": {
55
- "sb-deps": "./dist/cli/sb-deps.cjs"
56
- },
57
- "typesVersions": {
58
- "*": {
59
- "blocks": [
60
- "dist/blocks/index.d.ts"
61
- ]
62
- }
63
- },
64
- "sideEffects": [
65
- "**/*.css"
66
- ],
67
- "files": [
68
- "dist/**"
69
- ],
70
- "scripts": {
71
- "copy-css": "cpx \"src/**/*.module.css\" dist",
72
- "build": "rm -rf dist && tsdown && npm run copy-css && npm run typecheck",
73
- "dev": "npm-watch",
74
- "typecheck": "cross-env FORCE_COLOR=1 npm_config_color=always tsc -p tsconfig.json --noEmit --pretty true && tsc -p ./cli/tsconfig.json --noEmit --pretty true"
75
- },
76
- "watch": {
77
- "build": {
78
- "patterns": [
79
- "src",
80
- "cli"
81
- ],
82
- "extensions": "ts,tsx,css",
83
- "delay": 200
84
- }
85
- },
86
- "peerDependencies": {
87
- "@storybook/addon-docs": "^10.0.2",
88
- "@storybook/addon-links": "^10.0.2",
89
- "dependency-cruiser": "^17.3.8",
90
- "react": ">=18",
91
- "react-dom": ">=18",
92
- "storybook": "^10.0.2"
93
- },
94
- "devDependencies": {
95
- "@storybook/csf": "^0.1.13",
96
- "@types/cross-spawn": "^6.0.6",
97
- "@types/micromatch": "^4.0.9",
98
- "@types/node": "^24.7.2",
99
- "@types/react": "^19.1.13",
100
- "@types/react-dom": "^19.1.9",
101
- "concurrently": "^9.2.1",
102
- "cpx2": "^8.0.0",
103
- "cross-env": "^10.1.0",
104
- "cross-spawn": "^7.0.6",
105
- "dependency-cruiser": "^17.3.8",
106
- "npm-watch": "^0.13.0",
107
- "storybook": "^10.2.0",
108
- "ts-dedent": "^2.2.0",
109
- "tsdown": "^0.15.12",
110
- "typescript": "^5.6.3",
111
- "vite": "^7.1.7"
112
- },
113
- "dependencies": {
114
- "@iframe-resizer/child": "^5.5.7",
115
- "@iframe-resizer/react": "^5.5.7",
116
- "@parcel/watcher": "^2.5.1",
117
- "micromatch": "^4.0.8"
118
- },
119
- "storybook-addon": {
120
- "preset": "dist/addon/preset.cjs"
121
- }
122
- }
2
+ "name": "storybook-addon-dependency-previews",
3
+ "description": "A Storybook 10 addon to automatically generate a visual dependency tree for your components.",
4
+ "version": "0.3.1",
5
+ "private": false,
6
+ "license": "Apache-2.0",
7
+ "homepage": "https://dependency-previews-storybook.netlify.app/?path=/docs/04-templates-home-template--docs",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Dan503/storybook-addon-dependency-previews.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/Dan503/storybook-addon-dependency-previews/issues"
14
+ },
15
+ "keywords": [
16
+ "storybook",
17
+ "storybook-addon",
18
+ "dependency-previews",
19
+ "dependency-cruiser",
20
+ "react",
21
+ "components",
22
+ "ui",
23
+ "design-system"
24
+ ],
25
+ "author": {
26
+ "name": "Daniel Tonon"
27
+ },
28
+ "type": "module",
29
+ "main": "dist/index.cjs",
30
+ "module": "dist/index.js",
31
+ "types": "dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.cjs",
36
+ "types": "./dist/index.d.mts"
37
+ },
38
+ "./addon": {
39
+ "import": "./dist/addon/index.mjs",
40
+ "require": "./dist/addon/index.cjs",
41
+ "types": "./dist/addon/index.d.mts"
42
+ },
43
+ "./config": {
44
+ "import": "./dist/config.mjs",
45
+ "require": "./dist/config.cjs",
46
+ "types": "./dist/config.d.mts"
47
+ },
48
+ "./cli/sb-deps": {
49
+ "import": "./dist/cli/sb-deps.mjs",
50
+ "require": "./dist/cli/sb-deps.cjs",
51
+ "types": "./dist/cli/sb-deps.d.mts"
52
+ }
53
+ },
54
+ "bin": {
55
+ "sb-deps": "./dist/cli/sb-deps.cjs"
56
+ },
57
+ "typesVersions": {
58
+ "*": {
59
+ "blocks": [
60
+ "dist/blocks/index.d.ts"
61
+ ]
62
+ }
63
+ },
64
+ "sideEffects": [
65
+ "**/*.css"
66
+ ],
67
+ "files": [
68
+ "dist/**"
69
+ ],
70
+ "watch": {
71
+ "build": {
72
+ "patterns": [
73
+ "src",
74
+ "cli"
75
+ ],
76
+ "extensions": "ts,tsx,css",
77
+ "delay": 200
78
+ }
79
+ },
80
+ "peerDependencies": {
81
+ "@storybook/addon-docs": "^10.0.2",
82
+ "@storybook/addon-links": "^10.0.2",
83
+ "dependency-cruiser": "^17.3.8",
84
+ "react": ">=18",
85
+ "react-dom": ">=18",
86
+ "storybook": "^10.0.2"
87
+ },
88
+ "devDependencies": {
89
+ "@storybook/csf": "^0.1.13",
90
+ "@types/cross-spawn": "^6.0.6",
91
+ "@types/micromatch": "^4.0.9",
92
+ "@types/node": "^24.7.2",
93
+ "@types/react": "^19.1.13",
94
+ "@types/react-dom": "^19.1.9",
95
+ "concurrently": "^9.2.1",
96
+ "cpx2": "^8.0.0",
97
+ "cross-env": "^10.1.0",
98
+ "cross-spawn": "^7.0.6",
99
+ "dependency-cruiser": "^17.3.8",
100
+ "npm-watch": "^0.13.0",
101
+ "storybook": "^10.2.0",
102
+ "ts-dedent": "^2.2.0",
103
+ "tsdown": "^0.15.12",
104
+ "typescript": "^5.6.3",
105
+ "vite": "^7.1.7"
106
+ },
107
+ "dependencies": {
108
+ "@iframe-resizer/child": "^5.5.7",
109
+ "@iframe-resizer/react": "^5.5.7",
110
+ "@parcel/watcher": "^2.5.1",
111
+ "micromatch": "^4.0.8"
112
+ },
113
+ "storybook-addon": {
114
+ "preset": "dist/addon/preset.cjs"
115
+ },
116
+ "scripts": {
117
+ "copy-css": "cpx \"src/**/*.module.css\" dist",
118
+ "build": "rm -rf dist && tsdown && npm run copy-css && npm run typecheck",
119
+ "dev": "npm-watch",
120
+ "typecheck": "cross-env FORCE_COLOR=1 npm_config_color=always tsc -p tsconfig.json --noEmit --pretty true && tsc -p ./cli/tsconfig.json --noEmit --pretty true"
121
+ }
122
+ }