@baojiliu/iris-plugin-client 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -1,5 +1,146 @@
1
- # @baojiliu/iris-plugin-client
1
+ # iris-plugin-client
2
2
 
3
- Iris 前端插件与宿主共用的契约。插件从这里导入 `Context`,不在插件里再声明一份。宿主实现 `slots`、`sidebar` 和 `locale`,并在 `inject` 列出的服务就绪后调用 `apply(ctx)`。
3
+ Iris 前端插件与宿主共用的约定。插件用它把界面放进宿主、读取置顶、显示中英文案,并在构建时和宿主共用同一份 React。
4
4
 
5
- `@baojiliu/iris-plugin-client/vite` 导出 `irisPlugin()`。插件构建用它把 `react`、`react-dom`、`react/jsx-runtime` 换成宿主提供的同一份,并按 `peerDependencies` 写入口上的 `peers`。
5
+ ## 目录
6
+
7
+ - [安装](#安装)
8
+ - [插件怎么启动](#插件怎么启动)
9
+ - [能对宿主做什么](#能对宿主做什么)
10
+ - [放进宿主界面](#放进宿主界面)
11
+ - [知道自己有没有被置顶](#知道自己有没有被置顶)
12
+ - [按宿主语言显示文案](#按宿主语言显示文案)
13
+ - [插件内子路径](#插件内子路径)
14
+ - [打开时做事,卸下时清理](#打开时做事卸下时清理)
15
+ - [和宿主共用 React](#和宿主共用-react)
16
+ - [调用示例](#调用示例)
17
+
18
+ ## 安装
19
+
20
+ ```bash
21
+ npm install @baojiliu/iris-plugin-client
22
+ ```
23
+
24
+ 插件把它放在 `devDependencies`。类型只在编译时使用,不要打进插件产物。
25
+
26
+ ## 插件怎么启动
27
+
28
+ 入口导出三样东西:
29
+
30
+ | 导出 | 作用 |
31
+ | --- | --- |
32
+ | `inject` | 声明要用哪些宿主能力,只能是 `slots`、`sidebar`、`locale`、`router` |
33
+ | `apply(ctx)` | 启动时宿主调用一次。界面和文案都在这里登记 |
34
+ | `peers` | 声明能配合的 `react`、`react-dom` 版本 |
35
+
36
+ `peers` 的键必须正好是 `react` 和 `react-dom`,值是 semver 范围。少写、多写、范围罩不住宿主正在用的版本,或者没有这个字段,宿主都不会调用 `apply`。`react/jsx-runtime` 跟着 `react`,不要单独写。
37
+
38
+ ## 能对宿主做什么
39
+
40
+ 插件不改宿主的内部代码,只通过 `ctx` 使用下面这些能力。
41
+
42
+ ### 放进宿主界面
43
+
44
+ `ctx.slots` 用来把插件的界面放到宿主上。现在有两个位置:
45
+
46
+ - 左栏一行。标题由 `label()` 在每次绘制时给出。图标可用 `meta.icon`(Lucide React 导出名,如 `"Smile"`)由宿主绘制,也可在 `register` 时传入自定义 `render`(优先于 `icon`);都没有时宿主用默认占位。
47
+ - 主区。打开这一行时,宿主用插件提供的面板,并告诉它当前是否置顶。
48
+
49
+ 位置还没准备好时,登记会等到它出现再执行。同一行再次登记会换掉上一次放上去的内容。登记时返回的函数可以把这次放上去的界面撤掉。
50
+
51
+ ### 知道自己有没有被置顶
52
+
53
+ `ctx.sidebar.pinned(id)` 回答这一行现在是不是置顶。插件不能自己去改置顶。
54
+
55
+ 若要在用户点置顶的那一刻做别的事,用 `ctx.on("sidebar/pin", handler)`。刚订上时不会补报当前状态,当前是不是置顶用 `pinned` 读。左栏标题要随置顶变化,就在 `label()` 里每次读一次。
56
+
57
+ ### 按宿主语言显示文案
58
+
59
+ `ctx.locale.register` 交上一份中文和一份英文,键要成对,内容是纯文本。
60
+
61
+ `ctx.locale.bind` 得到 `t`。界面上显示哪一种语言由宿主决定,插件不能自己切换。主区面板拿到的 `t` 已经按这个插件的文案准备好了。
62
+
63
+ ### 插件内子路径
64
+
65
+ `ctx.router` 读写当前插件在宿主 URL 下的子路径(`pathname` 以 `/` 开头,根为 `/`)。在 `inject` 里加上 `router` 后,宿主会把浏览器地址里的 `/plugins/:id/...` 同步到这里。
66
+
67
+ - `ctx.router.pathname`:当前子路径。
68
+ - `ctx.router.navigate(to, { replace?: boolean })`:跳转到插件内另一段路径;`replace` 为真时替换历史记录。
69
+ - `ctx.router.listen(handler)`:子路径变化时回调,返回取消函数。
70
+
71
+ 未在 `inject` 里声明 `router` 时,宿主可提供 no-op(`pathname` 为 `/`,`navigate` 无效)。
72
+
73
+ ### 打开时做事,卸下时清理
74
+
75
+ `ctx.effect(setup)` 在 `apply` 里立刻执行。`setup` 如果返回一个函数,宿主会在插件卸下时调用它。
76
+
77
+ 用户只是离开主区,插件还在。已经放上的界面和文案会留着。
78
+
79
+ ## 和宿主共用 React
80
+
81
+ 插件源码照常 `import` React。构建时加上 `irisPlugin()`,它会改用宿主正在跑的那一份 React,避免插件再打包一份。
82
+
83
+ `package.json` 的 `peerDependencies` 写上 `react` 和 `react-dom` 的范围。`irisPlugin()` 会把这份范围写进入口的 `peers`。版本对不对,要等插件被打开时由宿主检查。
84
+
85
+ ## 调用示例
86
+
87
+ 把一行放进宿主左栏,标题随置顶切换:
88
+
89
+ ```tsx
90
+ // 只导入类型。这段在编译后会被擦掉,不会打进插件产物。
91
+ import type { Context } from "@baojiliu/iris-plugin-client"
92
+
93
+ // 本插件文案的命名空间,register 和 bind 要用同一个名字。
94
+ const NS = "showcase"
95
+
96
+ // 告诉宿主:这个插件会放界面、读置顶、注册文案。
97
+ // 名字只能是 slots、sidebar、locale、router。宿主确认这些能力就绪后才调用 apply。
98
+ export const inject = ["slots", "sidebar", "locale"] as const
99
+
100
+ // 插件启动。成功时宿主只调用一次。
101
+ export function apply(ctx: Context) {
102
+ // 立刻交上文案。返回的函数会在插件卸下时被宿主调用,用来撤掉这份文案。
103
+ // 用户只是离开主区时不会卸下。
104
+ ctx.effect(() => ctx.locale.register(NS, {
105
+ zh: { panel: "Showcase", pinned: "已置顶" },
106
+ en: { panel: "Showcase", pinned: "Pinned" },
107
+ }))
108
+
109
+ // 得到只查上面这份文案的 t。显示中文还是英文由宿主决定。
110
+ const t = ctx.locale.bind(NS)
111
+
112
+ // 把一行放进左栏。左栏这个位置还没准备好时会等到它出现再登记。
113
+ ctx.slots.inject("sidebar.panellist", () =>
114
+ ctx.slots.register(
115
+ {
116
+ // 固定写成左栏这个槽的名字。
117
+ name: "sidebar.panellist",
118
+ // 这一行的 id。同一 id 再次登记会换掉上一行。
119
+ id: "showcase",
120
+ // label 里 t 使用的文案命名空间。
121
+ locale: NS,
122
+ // 左栏每次绘制都会调用。置顶后换标题,就在这里读当前是否置顶。
123
+ label: () => t(ctx.sidebar.pinned("showcase") ? "pinned" : "panel"),
124
+ // Lucide 导出名;也可用 register 的第二个参数自定义 render(优先于 icon)。
125
+ icon: "Smile",
126
+ },
127
+ ),
128
+ )
129
+ }
130
+ ```
131
+
132
+ 构建时改用宿主的 React,并把 `peerDependencies` 里的版本范围写进入口:
133
+
134
+ ```ts
135
+ // 插件构建用的函数。它不出现在浏览器产物里。
136
+ import { irisPlugin } from "@baojiliu/iris-plugin-client/vite"
137
+ import react from "@vitejs/plugin-react"
138
+ import { defineConfig } from "vite"
139
+
140
+ export default defineConfig({
141
+ // react() 负责编译 JSX。
142
+ // irisPlugin() 把 react、react-dom、react/jsx-runtime 换成宿主正在跑的那一份,
143
+ // 并按 package.json 的 peerDependencies 生成入口上的 peers。
144
+ plugins: [react(), irisPlugin()],
145
+ })
146
+ ```
@@ -0,0 +1,36 @@
1
+ import type { Dispose } from "./dispose.ts";
2
+ import type { Locale } from "./locale.ts";
3
+ import type { Router } from "./router.ts";
4
+ import type { Sidebar, SidebarPinEvent } from "./sidebar.ts";
5
+ import type { Slots } from "./slots.ts";
6
+ /**
7
+ * 插件在 `apply` 里拿到的宿主能力。
8
+ * 插件只通过这个对象使用槽位、置顶和文案,不直接依赖宿主内部模块。
9
+ */
10
+ export interface Context {
11
+ /** 把界面贡献登记到左栏或主区。 */
12
+ slots: Slots;
13
+ /** 读取左栏置顶。不能在这里修改置顶。 */
14
+ sidebar: Sidebar;
15
+ /** 注册并读取本插件的文案。 */
16
+ locale: Locale;
17
+ /**
18
+ * 插件内子路径路由。
19
+ * `inject` 含 `router` 时由宿主绑定当前插件路径;未请求时宿主可挂 no-op,pathname 为 `/`。
20
+ */
21
+ router: Router;
22
+ /**
23
+ * 订阅宿主事件。
24
+ * 目前只有 `"sidebar/pin"`:某行置顶状态变化时调用。
25
+ * 订阅当下不会补发当前是否置顶,当前值用 `sidebar.pinned` 读。
26
+ * 返回的函数用来取消订阅。
27
+ */
28
+ on(name: "sidebar/pin", handler: (event: SidebarPinEvent) => void): Dispose;
29
+ /**
30
+ * 立刻执行 `setup`。
31
+ * 适合在 `apply` 里注册文案、槽位以外还需要成对清理的事情。
32
+ * 若 `setup` 返回函数,宿主在插件卸载时调用它。
33
+ * 离开主区不算卸载,已登记的槽和文案会保留。
34
+ */
35
+ effect(setup: () => void | Dispose): void;
36
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 取消登记时调用的函数,没有参数、没有返回值。
3
+ * `locale.register`、`slots.inject`、`slots.register`、`ctx.on`、`ctx.effect` 都会给出这样一个函数。
4
+ * 调用它只撤掉这一次登记,不影响插件的其他登记。
5
+ */
6
+ export type Dispose = () => void;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,68 +1,14 @@
1
1
  /**
2
- * Contract shared by the Iris host and frontend plugins.
3
- * Plugins depend on this package; they do not declare Context themselves.
2
+ * Iris 前端插件与宿主共用的契约。
3
+ * 插件从包入口导入这些类型,不要在插件仓库里再声明一份 `Context`。
4
+ * 宿主实现这些接口,并在 `inject` 列出的服务就绪、且 `peers` 通过之后调用 `apply`。
4
5
  */
5
- export type Dispose = () => void;
6
- /** Services a plugin may list in `inject`. The loader waits until each one exists. */
7
- export declare const serviceNames: readonly ["slots", "sidebar", "locale"];
8
- export type ServiceName = (typeof serviceNames)[number];
9
- export type Translate = (key: string) => string;
10
- export interface LocaleMessages {
11
- zh: Record<string, string>;
12
- en: Record<string, string>;
13
- }
14
- export interface Locale {
15
- register(namespace: string, messages: LocaleMessages): Dispose;
16
- bind(namespace: string): Translate;
17
- }
18
- export interface MainPanelProps {
19
- pinned: boolean;
20
- t: Translate;
21
- }
22
- export interface MainSlotMeta {
23
- name: "main";
24
- key: string;
25
- locale: string;
26
- inject: () => Record<string, never>;
27
- }
28
- export interface SidebarSlotMeta {
29
- name: "sidebar.panellist";
30
- id: string;
31
- order?: number;
32
- locale: string;
33
- /** Host calls this on each sidebar render. */
34
- label: () => string;
35
- }
36
- export interface SidebarIconProps {
37
- size: number;
38
- }
39
- export interface SidebarPinEvent {
40
- id: string;
41
- pinned: boolean;
42
- }
43
- /**
44
- * React slots. `inject` waits until the host has declared the slot, then runs `register`.
45
- * The function returned from `register` removes that contribution.
46
- */
47
- export interface Slots {
48
- inject(name: MainSlotMeta["name"] | SidebarSlotMeta["name"], register: () => Dispose): Dispose;
49
- register(meta: MainSlotMeta, render: (props: MainPanelProps) => unknown): Dispose;
50
- register(meta: SidebarSlotMeta, render: (props: SidebarIconProps) => unknown): Dispose;
51
- }
52
- /** Read-only view of sidebar pin state. Changes arrive through `ctx.on("sidebar/pin")`. */
53
- export interface Sidebar {
54
- pinned(id: string): boolean;
55
- }
56
- export interface Context {
57
- slots: Slots;
58
- sidebar: Sidebar;
59
- locale: Locale;
60
- on(name: "sidebar/pin", handler: (event: SidebarPinEvent) => void): Dispose;
61
- /** Runs `setup` now. If `setup` returns a function, the host calls it when the plugin unloads. */
62
- effect(setup: () => void | Dispose): void;
63
- }
64
- export interface PluginModule {
65
- inject: readonly ServiceName[];
66
- apply(ctx: Context): void;
67
- peers?: Record<string, string>;
68
- }
6
+ export type { Dispose } from "./dispose.ts";
7
+ export type { ServiceName } from "./serviceName.ts";
8
+ export { serviceNames } from "./serviceName.ts";
9
+ export type { Locale, LocaleMessages, Translate } from "./locale.ts";
10
+ export type { MainPanelProps, MainSlotMeta, Slots } from "./slots.ts";
11
+ export type { Sidebar, SidebarIconProps, SidebarPinEvent, SidebarSlotMeta } from "./sidebar.ts";
12
+ export type { Context } from "./context.ts";
13
+ export type { PluginModule } from "./pluginModule.ts";
14
+ export type { Router, RouterNavigateOptions } from "./router.ts";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Contract shared by the Iris host and frontend plugins.
3
- * Plugins depend on this package; they do not declare Context themselves.
2
+ * Iris 前端插件与宿主共用的契约。
3
+ * 插件从包入口导入这些类型,不要在插件仓库里再声明一份 `Context`。
4
+ * 宿主实现这些接口,并在 `inject` 列出的服务就绪、且 `peers` 通过之后调用 `apply`。
4
5
  */
5
- /** Services a plugin may list in `inject`. The loader waits until each one exists. */
6
- export const serviceNames = ["slots", "sidebar", "locale"];
6
+ export { serviceNames } from "./serviceName.js";
@@ -0,0 +1,29 @@
1
+ import type { Dispose } from "./dispose.ts";
2
+ /**
3
+ * 按当前宿主语言取出一条文案。
4
+ * 由 `locale.bind(namespace)` 得到,只查这个命名空间里注册过的键。
5
+ * 找不到键时由宿主决定回退,插件不要自己拼语言。
6
+ */
7
+ export type Translate = (key: string) => string;
8
+ /**
9
+ * 一个命名空间下的文案表。
10
+ * `zh` 和 `en` 的键要成对,值是给界面直接显示的字符串,不要放 HTML。
11
+ */
12
+ export interface LocaleMessages {
13
+ zh: Record<string, string>;
14
+ en: Record<string, string>;
15
+ }
16
+ /**
17
+ * 插件文案。
18
+ * 插件先 `register` 自己的命名空间,再用 `bind` 拿到 `t`。
19
+ * 宿主语言固定由壳决定,插件不能切换语言。
20
+ */
21
+ export interface Locale {
22
+ /**
23
+ * 注册一个命名空间。
24
+ * 返回的函数会卸下这次注册。同名再次注册会盖住上一份。
25
+ */
26
+ register(namespace: string, messages: LocaleMessages): Dispose;
27
+ /** 绑定命名空间,得到只查这份文案的 `t`。 */
28
+ bind(namespace: string): Translate;
29
+ }
package/dist/locale.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { Context } from "./context.ts";
2
+ import type { ServiceName } from "./serviceName.ts";
3
+ /**
4
+ * 插件入口模块必须导出的形状。
5
+ * 宿主 `import` 入口之后先看 `peers`,通过才调用 `apply`。
6
+ * `apply` 里才能登记槽位;入口文件顶层不要登记。
7
+ */
8
+ export interface PluginModule {
9
+ /**
10
+ * 本插件要使用的宿主服务。
11
+ * 每一项必须是 `serviceNames` 里的名字。宿主会据此确认服务已就绪。
12
+ */
13
+ inject: readonly ServiceName[];
14
+ /**
15
+ * 插件的启动函数,成功路径上只调用一次。
16
+ * 在这里 `locale.register`、`slots.inject`,并按需要 `on("sidebar/pin")`。
17
+ */
18
+ apply(ctx: Context): void;
19
+ /**
20
+ * 本插件声明能接受的共享库版本,值是 semver 范围。
21
+ * 键必须正好是 `react` 和 `react-dom`。
22
+ * 少一项、多一项、范围罩不住宿主正在跑的版本,或入口没有这个字段,宿主都不调用 `apply`。
23
+ * `react/jsx-runtime` 跟着 `react`,不要单独写进来。
24
+ */
25
+ peers?: Record<string, string>;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { Dispose } from "./dispose.ts";
2
+ export interface RouterNavigateOptions {
3
+ replace?: boolean;
4
+ }
5
+ /** 插件内路由。pathname 总是以 `/` 开头;根为 `/`。 */
6
+ export interface Router {
7
+ readonly pathname: string;
8
+ navigate(to: string, opts?: RouterNavigateOptions): void;
9
+ listen(handler: (pathname: string) => void): Dispose;
10
+ }
package/dist/router.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 宿主目前提供给插件的服务名。
3
+ * 插件在 `inject` 里列出的每一项都必须是这里的名字。
4
+ * 加载器会等这些服务都就绪后才调用 `apply`;出现未知名字则拒绝执行。
5
+ */
6
+ export declare const serviceNames: readonly ["slots", "sidebar", "locale", "router"];
7
+ /** `serviceNames` 里的某一个名字。 */
8
+ export type ServiceName = (typeof serviceNames)[number];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 宿主目前提供给插件的服务名。
3
+ * 插件在 `inject` 里列出的每一项都必须是这里的名字。
4
+ * 加载器会等这些服务都就绪后才调用 `apply`;出现未知名字则拒绝执行。
5
+ */
6
+ export const serviceNames = ["slots", "sidebar", "locale", "router"];
@@ -0,0 +1,50 @@
1
+ /**
2
+ * 左栏置顶的只读视图。
3
+ * `pinned` 只回答「现在是不是置顶」,不会在状态变化时回调。
4
+ * 变化要另用 `ctx.on("sidebar/pin")` 订阅;订阅时不会补发当前值。
5
+ * 插件不能自己改置顶,只能读。
6
+ */
7
+ export interface Sidebar {
8
+ /** `id` 是插件在左栏槽上登记的 id,通常等于插件 id。 */
9
+ pinned(id: string): boolean;
10
+ }
11
+ /**
12
+ * 左栏插件行的登记信息。
13
+ * `name` 固定是 `"sidebar.panellist"`,用来区分这是左栏槽而不是主区槽。
14
+ */
15
+ export interface SidebarSlotMeta {
16
+ name: "sidebar.panellist";
17
+ /** 这一行的 id。同一 id 再次登记会替换上一行。 */
18
+ id: string;
19
+ /** 多行时的排序。不写则由宿主按默认顺序排。 */
20
+ order?: number;
21
+ /** `label` 里用来取文案的命名空间,须已经 `locale.register`。 */
22
+ locale: string;
23
+ /**
24
+ * 左栏每次渲染都会调用,用返回值当这一行的标题。
25
+ * 置顶后的标题也在这里决定,例如读取 `sidebar.pinned(id)` 再选不同的文案键。
26
+ * 返回空白时,宿主改用插件目录里的标题。
27
+ */
28
+ label: () => string;
29
+ /**
30
+ * Lucide React 组件导出名(PascalCase),如 `"Smile"`、`"Puzzle"`。
31
+ * 宿主按名渲染;若同时传了 `register` 的 `render`,以 `render` 为准。
32
+ */
33
+ icon?: string;
34
+ }
35
+ /**
36
+ * 左栏图标组件收到的属性。
37
+ * `size` 是宿主给出的边长,图标按这个尺寸画,不要自己写死像素。
38
+ */
39
+ export interface SidebarIconProps {
40
+ size: number;
41
+ }
42
+ /**
43
+ * 置顶状态变化。
44
+ * `id` 是被切换的那一行,`pinned` 是切换后的值。
45
+ * 只在变化时发出,打开插件或刚订阅时不会收到当前状态。
46
+ */
47
+ export interface SidebarPinEvent {
48
+ id: string;
49
+ pinned: boolean;
50
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,50 @@
1
+ import type { Dispose } from "./dispose.ts";
2
+ import type { Translate } from "./locale.ts";
3
+ import type { SidebarIconProps, SidebarSlotMeta } from "./sidebar.ts";
4
+ /**
5
+ * 主区面板每次渲染时收到的属性。
6
+ * `pinned` 是当前是否置顶。`t` 是按该槽 `locale` 绑定好的翻译函数。
7
+ */
8
+ export interface MainPanelProps {
9
+ pinned: boolean;
10
+ t: Translate;
11
+ }
12
+ /**
13
+ * 主区槽的登记信息。
14
+ * `name` 固定是 `"main"`。`key` 用来标识这一份主区,同一 key 再次登记会替换上一份。
15
+ */
16
+ export interface MainSlotMeta {
17
+ name: "main";
18
+ key: string;
19
+ /** 主区 `t` 使用的文案命名空间。 */
20
+ locale: string;
21
+ /**
22
+ * 预留给主区额外注入的数据。
23
+ * 这一版宿主不往里放内容,插件返回空对象即可。
24
+ */
25
+ inject: () => Record<string, never>;
26
+ }
27
+ /**
28
+ * 宿主上的界面槽。
29
+ * 插件不能直接改宿主的 React 树,只能把贡献登记到已经声明的槽上。
30
+ *
31
+ * `inject` 会等到宿主声明了这个槽再执行 `register`。
32
+ * 槽已经声明过时,`register` 会在 `inject` 返回前同步执行。
33
+ * `register` 的返回值用来撤掉这一份贡献。
34
+ */
35
+ export interface Slots {
36
+ /**
37
+ * 等槽就绪后执行登记。
38
+ * `name` 只能是 `"main"` 或 `"sidebar.panellist"`。
39
+ * 返回的函数会取消这次等待;如果登记已经发生,则一并撤掉贡献。
40
+ */
41
+ inject(name: MainSlotMeta["name"] | SidebarSlotMeta["name"], register: () => Dispose): Dispose;
42
+ /** 登记主区。`render` 的返回值由宿主当作 React 节点渲染。 */
43
+ register(meta: MainSlotMeta, render: (props: MainPanelProps) => unknown): Dispose;
44
+ /**
45
+ * 登记左栏一行。
46
+ * 图标优先用可选的 `render`;否则宿主按 `meta.icon`(Lucide 导出名)渲染;
47
+ * 都没有时用宿主默认占位。`render` 收到宿主规定的图标尺寸。
48
+ */
49
+ register(meta: SidebarSlotMeta, render?: (props: SidebarIconProps) => unknown): Dispose;
50
+ }
package/dist/slots.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baojiliu/iris-plugin-client",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Iris 前端插件与宿主共用的契约,以及插件构建时使用的 Vite 插件。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -25,7 +25,7 @@
25
25
  "scripts": {
26
26
  "build": "tsc -p tsconfig.build.json",
27
27
  "prepublishOnly": "npm run build",
28
- "test": "node --test src/sharedRuntime.test.ts src/vite.test.ts"
28
+ "test": "node --test src/sharedRuntime.test.ts src/serviceName.test.ts src/vite.test.ts"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"