@storybook-astro/framework 1.3.0-canary.4 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,55 +3,12 @@ export { ArgTypes, Args, Parameters, ProjectAnnotations, StrictArgs } from 'stor
3
3
  import { PreviewAddon, Preview as Preview$1, InferTypes } from 'storybook/internal/csf';
4
4
  import { A as AstroRenderer } from './portable-stories-DXT_GOf6.js';
5
5
  export { c as composeStories, a as composeStory, s as setProjectAnnotations } from './portable-stories-DXT_GOf6.js';
6
- import { R as RenderStoryInput } from './types-C846M_tS.js';
7
- export { F as FrameworkOptions, a as RenderMode, S as SanitizationOptions, b as ServerBuildOptions, c as StoryRulesOptions, d as StorybookConfig } from './types-C846M_tS.js';
6
+ export { F as FrameworkOptions, R as RenderMode, a as RenderStoryInput, S as SanitizationOptions, b as ServerBuildOptions, c as StoryRulesOptions, d as StorybookConfig } from './types-BCpJLSTo.js';
8
7
  import 'vite';
9
8
  import './base-DT67T5pi.js';
10
9
  import 'astro';
11
10
  import 'sanitize-html';
12
11
 
13
- type StoryModuleMockEntry = {
14
- replacement: string;
15
- inlineModuleId?: string;
16
- };
17
- type StoryModuleMockFactoryResult = Record<string, unknown>;
18
-
19
- type StoryRuleCleanup = () => void | Promise<void>;
20
- type StoryRuleUseResult = void | StoryRuleCleanup | Promise<void | StoryRuleCleanup>;
21
- type StoryRuleMockFactory = () => StoryModuleMockFactoryResult | Promise<StoryModuleMockFactoryResult>;
22
- type StoryRuleMock = {
23
- (specifier: string, replacement: string): void;
24
- (specifier: string, factory: StoryRuleMockFactory): void;
25
- };
26
- type StoryRuleUseContext = {
27
- story: StoryRuleStory;
28
- mock: StoryRuleMock;
29
- };
30
- type StoryRuleUse = (context: StoryRuleUseContext) => StoryRuleUseResult;
31
- type StoryRule = {
32
- match: string | string[];
33
- use: StoryRuleUse | StoryRuleUse[];
34
- };
35
- type StoryRulesConfig = {
36
- rules: StoryRule[];
37
- };
38
- type StoryRuleStory = {
39
- id: string;
40
- title?: string;
41
- name?: string;
42
- keys: string[];
43
- };
44
- type StoryRuleSelectionInput = {
45
- configModule: unknown;
46
- configFilePath?: string;
47
- story?: RenderStoryInput;
48
- };
49
- type StoryRuleSelection = {
50
- moduleMocks: Map<string, StoryModuleMockEntry>;
51
- cleanups: StoryRuleCleanup[];
52
- };
53
- declare function defineStoryRules(config: StoryRulesConfig): StoryRulesConfig;
54
-
55
12
  /**
56
13
  * Preview configuration type for `.storybook/preview.ts` in Astro projects.
57
14
  * Reflects the full type returned by `definePreview`, including addon type extensions.
@@ -69,4 +26,4 @@ declare function definePreview<Addons extends PreviewAddon<never>[] = []>(input:
69
26
  addons?: Addons;
70
27
  }): Preview$1<AstroRenderer & InferTypes<Addons>>;
71
28
 
72
- export { AstroRenderer, type Preview, RenderStoryInput, type StoryRule, type StoryRuleCleanup, type StoryRuleMock, type StoryRuleMockFactory, type StoryRuleSelection, type StoryRuleSelectionInput, type StoryRuleStory, type StoryRuleUse, type StoryRuleUseContext, type StoryRulesConfig, definePreview, defineStoryRules };
29
+ export { AstroRenderer, type Preview, definePreview };
package/dist/index.js CHANGED
@@ -1,12 +1,8 @@
1
- import {
2
- defineStoryRules
3
- } from "./chunk-ZIDMHD4S.js";
4
1
  import {
5
2
  composeStories,
6
3
  composeStory,
7
4
  setProjectAnnotations
8
5
  } from "./chunk-KXAAX3GN.js";
9
- import "./chunk-B5HHF6FC.js";
10
6
  import "./chunk-G3PMV62Z.js";
11
7
 
12
8
  // src/index.ts
@@ -18,7 +14,6 @@ export {
18
14
  composeStories,
19
15
  composeStory,
20
16
  definePreview,
21
- defineStoryRules,
22
17
  setProjectAnnotations
23
18
  };
24
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Re-export types from storybook internal\nexport type {\n Args,\n ArgTypes,\n Parameters,\n ProjectAnnotations,\n StrictArgs\n} from 'storybook/internal/types';\n\nimport { definePreview as definePreviewBase, type PreviewAddon, type InferTypes, type Preview as CsfPreview } from 'storybook/internal/csf';\nimport type { ProjectAnnotations } from 'storybook/internal/types';\nimport type { AstroRenderer } from './portable-stories.ts';\n\n/**\n * Preview configuration type for `.storybook/preview.ts` in Astro projects.\n * Reflects the full type returned by `definePreview`, including addon type extensions.\n * Use this to annotate your preview module when needed:\n *\n * ```ts\n * import type { Preview } from '@storybook-astro/framework';\n * const preview: Preview = { ... };\n * export default preview;\n * ```\n */\nexport type Preview<Addons extends PreviewAddon<never>[] = []> = CsfPreview<AstroRenderer & InferTypes<Addons>>;\n\n// Export portable stories functionality\nexport {\n composeStories,\n composeStory,\n setProjectAnnotations,\n type AstroRenderer\n} from './portable-stories.ts';\n\n// Export framework types\nexport type {\n FrameworkOptions,\n RenderMode,\n RenderStoryInput,\n ServerBuildOptions,\n SanitizationOptions,\n StoryRulesOptions,\n StorybookConfig\n} from './types.ts';\nexport type {\n StoryRuleCleanup,\n StoryRuleMock,\n StoryRuleMockFactory,\n StoryRule,\n StoryRulesConfig,\n StoryRuleSelection,\n StoryRuleSelectionInput,\n StoryRuleStory,\n StoryRuleUse,\n StoryRuleUseContext\n} from './rules.ts';\nexport { defineStoryRules } from './rules.ts';\n\n// Preview configuration helper\nexport function definePreview<Addons extends PreviewAddon<never>[] = []>(\n input: ProjectAnnotations<AstroRenderer> & { addons?: Addons }\n): CsfPreview<AstroRenderer & InferTypes<Addons>> {\n return definePreviewBase<AstroRenderer, Addons>(input);\n}\n"],"mappings":";;;;;;;;;;;;AASA,SAAS,iBAAiB,yBAAyF;AAkD5G,SAAS,cACd,OACgD;AAChD,SAAO,kBAAyC,KAAK;AACvD;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Re-export types from storybook internal\nexport type {\n Args,\n ArgTypes,\n Parameters,\n ProjectAnnotations,\n StrictArgs\n} from 'storybook/internal/types';\n\nimport { definePreview as definePreviewBase, type PreviewAddon, type InferTypes, type Preview as CsfPreview } from 'storybook/internal/csf';\nimport type { ProjectAnnotations } from 'storybook/internal/types';\nimport type { AstroRenderer } from './portable-stories.ts';\n\n/**\n * Preview configuration type for `.storybook/preview.ts` in Astro projects.\n * Reflects the full type returned by `definePreview`, including addon type extensions.\n * Use this to annotate your preview module when needed:\n *\n * ```ts\n * import type { Preview } from '@storybook-astro/framework';\n * const preview: Preview = { ... };\n * export default preview;\n * ```\n */\nexport type Preview<Addons extends PreviewAddon<never>[] = []> = CsfPreview<AstroRenderer & InferTypes<Addons>>;\n\n// Export portable stories functionality\nexport {\n composeStories,\n composeStory,\n setProjectAnnotations,\n type AstroRenderer\n} from './portable-stories.ts';\n\n// Export framework types\nexport type {\n FrameworkOptions,\n RenderMode,\n RenderStoryInput,\n ServerBuildOptions,\n SanitizationOptions,\n StoryRulesOptions,\n StorybookConfig\n} from './types.ts';\n\n// Preview configuration helper\nexport function definePreview<Addons extends PreviewAddon<never>[] = []>(\n input: ProjectAnnotations<AstroRenderer> & { addons?: Addons }\n): CsfPreview<AstroRenderer & InferTypes<Addons>> {\n return definePreviewBase<AstroRenderer, Addons>(input);\n}\n"],"mappings":";;;;;;;;AASA,SAAS,iBAAiB,yBAAyF;AAqC5G,SAAS,cACd,OACgD;AAChD,SAAO,kBAAyC,KAAK;AACvD;","names":[]}
@@ -1,10 +1,52 @@
1
- import { d as StorybookConfig } from '../types-C846M_tS.js';
1
+ import { a as RenderStoryInput, d as StorybookConfig } from '../types-BCpJLSTo.js';
2
2
  import 'storybook/internal/types';
3
3
  import 'vite';
4
4
  import '../base-DT67T5pi.js';
5
5
  import 'astro';
6
6
  import 'sanitize-html';
7
7
 
8
+ type StoryModuleMockEntry = {
9
+ replacement: string;
10
+ inlineModuleId?: string;
11
+ };
12
+ type StoryModuleMockFactoryResult = Record<string, unknown>;
13
+
14
+ type StoryRuleCleanup = () => void | Promise<void>;
15
+ type StoryRuleUseResult = void | StoryRuleCleanup | Promise<void | StoryRuleCleanup>;
16
+ type StoryRuleMockFactory = () => StoryModuleMockFactoryResult | Promise<StoryModuleMockFactoryResult>;
17
+ type StoryRuleMock = {
18
+ (specifier: string, replacement: string): void;
19
+ (specifier: string, factory: StoryRuleMockFactory): void;
20
+ };
21
+ type StoryRuleUseContext = {
22
+ story: StoryRuleStory;
23
+ mock: StoryRuleMock;
24
+ };
25
+ type StoryRuleUse = (context: StoryRuleUseContext) => StoryRuleUseResult;
26
+ type StoryRule = {
27
+ match: string | string[];
28
+ use: StoryRuleUse | StoryRuleUse[];
29
+ };
30
+ type StoryRulesConfig = {
31
+ rules: StoryRule[];
32
+ };
33
+ type StoryRuleStory = {
34
+ id: string;
35
+ title?: string;
36
+ name?: string;
37
+ keys: string[];
38
+ };
39
+ type StoryRuleSelectionInput = {
40
+ configModule: unknown;
41
+ configFilePath?: string;
42
+ story?: RenderStoryInput;
43
+ };
44
+ type StoryRuleSelection = {
45
+ moduleMocks: Map<string, StoryModuleMockEntry>;
46
+ cleanups: StoryRuleCleanup[];
47
+ };
48
+ declare function defineStoryRules(config: StoryRulesConfig): StoryRulesConfig;
49
+
8
50
  declare function defineMain(config: StorybookConfig): StorybookConfig;
9
51
 
10
- export { StorybookConfig, defineMain };
52
+ export { type StoryRule, type StoryRuleCleanup, type StoryRuleMock, type StoryRuleMockFactory, type StoryRuleSelection, type StoryRuleSelectionInput, type StoryRuleStory, type StoryRuleUse, type StoryRuleUseContext, type StoryRulesConfig, StorybookConfig, defineMain, defineStoryRules };
@@ -1,3 +1,7 @@
1
+ import {
2
+ defineStoryRules
3
+ } from "../chunk-ZIDMHD4S.js";
4
+ import "../chunk-B5HHF6FC.js";
1
5
  import "../chunk-G3PMV62Z.js";
2
6
 
3
7
  // src/node/index.ts
@@ -5,6 +9,7 @@ function defineMain(config) {
5
9
  return config;
6
10
  }
7
11
  export {
8
- defineMain
12
+ defineMain,
13
+ defineStoryRules
9
14
  };
10
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["import type { StorybookConfig } from '../types.ts';\n\nexport function defineMain(config: StorybookConfig): StorybookConfig {\n return config;\n}\n\nexport type { StorybookConfig };\n"],"mappings":";;;AAEO,SAAS,WAAW,QAA0C;AACnE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/node/index.ts"],"sourcesContent":["import type { StorybookConfig } from '../types.ts';\n\nexport function defineMain(config: StorybookConfig): StorybookConfig {\n return config;\n}\n\nexport type { StorybookConfig };\n\nexport { defineStoryRules } from '../rules.ts';\nexport type {\n StoryRuleCleanup,\n StoryRuleMock,\n StoryRuleMockFactory,\n StoryRule,\n StoryRulesConfig,\n StoryRuleSelection,\n StoryRuleSelectionInput,\n StoryRuleStory,\n StoryRuleUse,\n StoryRuleUseContext\n} from '../rules.ts';\n"],"mappings":";;;;;;;AAEO,SAAS,WAAW,QAA0C;AACnE,SAAO;AACT;","names":[]}
package/dist/preset.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { e as StorybookConfigVite } from './types-C846M_tS.js';
1
+ import { e as StorybookConfigVite } from './types-BCpJLSTo.js';
2
2
  import 'storybook/internal/types';
3
3
  import 'vite';
4
4
  import './base-DT67T5pi.js';
package/dist/preset.js CHANGED
@@ -7,7 +7,6 @@ import {
7
7
  resolveSanitizationOptions,
8
8
  serializeSanitizationOptions
9
9
  } from "./chunk-N3WTUD2A.js";
10
- import "./chunk-ZIDMHD4S.js";
11
10
  import {
12
11
  createVirtualModule,
13
12
  resolveRulesConfigFilePath,
@@ -23,6 +22,7 @@ import {
23
22
  import {
24
23
  importAstroConfig
25
24
  } from "./chunk-PUTCAN6X.js";
25
+ import "./chunk-ZIDMHD4S.js";
26
26
  import {
27
27
  resolveStoryModuleMock
28
28
  } from "./chunk-B5HHF6FC.js";
package/dist/testing.js CHANGED
@@ -14,8 +14,8 @@ import {
14
14
  ssrLoadModuleWithFsFallback
15
15
  } from "./chunk-AYYMNFI6.js";
16
16
  import "./chunk-PUTCAN6X.js";
17
- import "./chunk-B5HHF6FC.js";
18
17
  import "./chunk-7YBE4TTI.js";
18
+ import "./chunk-B5HHF6FC.js";
19
19
  import "./chunk-G3PMV62Z.js";
20
20
 
21
21
  // src/testing/story-composition.ts
@@ -55,4 +55,4 @@ type StorybookConfigVite = {
55
55
  };
56
56
  type StorybookConfig = Omit<StorybookConfig$1, 'framework'> & StorybookConfigFramework & StorybookConfigVite;
57
57
 
58
- export type { FrameworkOptions as F, RenderStoryInput as R, SanitizationOptions as S, RenderMode as a, ServerBuildOptions as b, StoryRulesOptions as c, StorybookConfig as d, StorybookConfigVite as e };
58
+ export type { FrameworkOptions as F, RenderMode as R, SanitizationOptions as S, RenderStoryInput as a, ServerBuildOptions as b, StoryRulesOptions as c, StorybookConfig as d, StorybookConfigVite as e };
@@ -5,8 +5,8 @@ import {
5
5
  import "../chunk-WUTCMEF5.js";
6
6
  import "../chunk-AYYMNFI6.js";
7
7
  import "../chunk-PUTCAN6X.js";
8
- import "../chunk-B5HHF6FC.js";
9
8
  import "../chunk-7YBE4TTI.js";
9
+ import "../chunk-B5HHF6FC.js";
10
10
  import "../chunk-G3PMV62Z.js";
11
11
 
12
12
  // src/vitest/global-setup.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook-astro/framework",
3
- "version": "1.3.0-canary.4",
3
+ "version": "1.3.0",
4
4
  "description": "Community-supported Storybook framework for Astro 5 & 6 components",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -142,7 +142,7 @@
142
142
  }
143
143
  },
144
144
  "dependencies": {
145
- "@storybook-astro/renderer": "1.3.0-canary.4",
145
+ "@storybook-astro/renderer": "1.3.0",
146
146
  "hono": "^4.11.12",
147
147
  "sanitize-html": "^2.17.0",
148
148
  "vite": "^6.4.1 || ^7.0.0 || ^8.0.0"
package/src/index.ts CHANGED
@@ -42,19 +42,6 @@ export type {
42
42
  StoryRulesOptions,
43
43
  StorybookConfig
44
44
  } from './types.ts';
45
- export type {
46
- StoryRuleCleanup,
47
- StoryRuleMock,
48
- StoryRuleMockFactory,
49
- StoryRule,
50
- StoryRulesConfig,
51
- StoryRuleSelection,
52
- StoryRuleSelectionInput,
53
- StoryRuleStory,
54
- StoryRuleUse,
55
- StoryRuleUseContext
56
- } from './rules.ts';
57
- export { defineStoryRules } from './rules.ts';
58
45
 
59
46
  // Preview configuration helper
60
47
  export function definePreview<Addons extends PreviewAddon<never>[] = []>(
package/src/node/index.ts CHANGED
@@ -5,3 +5,17 @@ export function defineMain(config: StorybookConfig): StorybookConfig {
5
5
  }
6
6
 
7
7
  export type { StorybookConfig };
8
+
9
+ export { defineStoryRules } from '../rules.ts';
10
+ export type {
11
+ StoryRuleCleanup,
12
+ StoryRuleMock,
13
+ StoryRuleMockFactory,
14
+ StoryRule,
15
+ StoryRulesConfig,
16
+ StoryRuleSelection,
17
+ StoryRuleSelectionInput,
18
+ StoryRuleStory,
19
+ StoryRuleUse,
20
+ StoryRuleUseContext
21
+ } from '../rules.ts';