@poveste/shared 0.17.0 → 0.17.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.
@@ -6,7 +6,7 @@ import type { InlineConfig as ViteInlineConfig, Plugin as VitePlugin } from 'vit
6
6
  import type { Awaitable } from '../type-utils.js';
7
7
  import type { PluginCommand } from './command.js';
8
8
  import type { ConfigMode, PovesteConfig } from './config.js';
9
- import type { ServerStory, ServerStoryFile, ServerVariant } from './story.js';
9
+ import type { ServerStory, ServerStoryFile, ServerVariant, Variant } from './story.js';
10
10
  /**
11
11
  * A framework's collection strategy: how a story file written for that framework
12
12
  * is imported and mounted. `@poveste/plugin-vue` and `@poveste/plugin-svelte`
@@ -19,6 +19,24 @@ export interface SupportPlugin {
19
19
  importStoriesPrepend?: string;
20
20
  importStoryComponent: (file: ServerStoryFile, index: number) => string;
21
21
  }
22
+ /**
23
+ * The client half of a {@link SupportPlugin}: the module the app loads through
24
+ * `virtual:$poveste-support-plugins-client` to mount a story, render one, and
25
+ * read a variant's source back out.
26
+ *
27
+ * `generateSourceCode` may return nothing. A framework that cannot recover source
28
+ * from a render tree is a supported shape — two plugins ship as one — and the app
29
+ * falls back to the story file (#1108).
30
+ *
31
+ * The components are whatever the app renders them with, so the app names that
32
+ * type and a plugin is held only to providing them: they are built against
33
+ * `@poveste/vendors/vue`, a separate copy of Vue's types from the app's own.
34
+ */
35
+ export interface ClientSupportPlugin<TComponent = unknown> {
36
+ MountStory: TComponent;
37
+ RenderStory: TComponent;
38
+ generateSourceCode: (variant: Variant) => Awaitable<string | undefined>;
39
+ }
22
40
  /**
23
41
  * A {@link SupportPlugin} after Poveste has resolved it. Identical to the
24
42
  * declared shape today; it exists so resolution can add fields without changing
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@poveste/shared",
3
3
  "type": "module",
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "description": "Shared utilities for Poveste",
6
6
  "author": {
7
7
  "name": "Sorin Gitlan",
@@ -39,7 +39,7 @@
39
39
  "vite": "^8.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@poveste/vendors": "^0.17.0",
42
+ "@poveste/vendors": "^0.17.1",
43
43
  "@types/fs-extra": "^11.0.4",
44
44
  "chokidar": "^5.0.0",
45
45
  "markdown-it": "^15.0.2",