@metagptx/web-sdk 0.0.53 → 0.0.55
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/plugins.d.ts +16 -5
- package/package.json +3 -1
package/dist/plugins.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Plugin } from "vite";
|
|
2
|
-
|
|
3
1
|
//#region src/types/plugins.d.ts
|
|
4
|
-
|
|
5
2
|
/**
|
|
6
3
|
* Vite 插件相关类型定义
|
|
7
4
|
*/
|
|
5
|
+
|
|
8
6
|
// ==================== vite-plugin-routes 类型 ====================
|
|
7
|
+
|
|
9
8
|
interface RouteInfo {
|
|
10
9
|
/** 完整路由路径 */
|
|
11
10
|
path: string;
|
|
@@ -106,6 +105,18 @@ interface AtomsPluginOptions {
|
|
|
106
105
|
}
|
|
107
106
|
//#endregion
|
|
108
107
|
//#region src/plugins/vite-plugin-atoms.d.ts
|
|
108
|
+
/**
|
|
109
|
+
* 与 Vite Plugin 结构兼容的类型,在 SDK 内定义以避免依赖具体 Vite 实例。
|
|
110
|
+
* 这样在 monorepo 或消费者自备 Vite 时,atoms() 的返回值可被任意 Vite 的 plugins 数组接受。
|
|
111
|
+
*/
|
|
112
|
+
type VitePluginCompatible = {
|
|
113
|
+
name: string;
|
|
114
|
+
enforce?: 'pre' | 'post';
|
|
115
|
+
apply?: 'build' | 'serve' | ((config: unknown, env: unknown) => boolean);
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
};
|
|
118
|
+
/** 单个插件或插件数组,可直接作为 plugins 数组的一项(如 atoms()) */
|
|
119
|
+
type VitePluginOption = VitePluginCompatible | VitePluginCompatible[];
|
|
109
120
|
/**
|
|
110
121
|
* Atoms Vite 插件容器
|
|
111
122
|
*
|
|
@@ -136,6 +147,6 @@ interface AtomsPluginOptions {
|
|
|
136
147
|
* })
|
|
137
148
|
* ```
|
|
138
149
|
*/
|
|
139
|
-
declare function atoms(options?: AtomsPluginOptions):
|
|
150
|
+
declare function atoms(options?: AtomsPluginOptions): VitePluginOption;
|
|
140
151
|
//#endregion
|
|
141
|
-
export { type AtomsPluginOptions, type AtomsPluginRoutesOptions, type Plugin404Options, type PluginRoutesOptions, type RouteInfo, type RoutesManifest, atoms };
|
|
152
|
+
export { type AtomsPluginOptions, type AtomsPluginRoutesOptions, type Plugin404Options, type PluginRoutesOptions, type RouteInfo, type RoutesManifest, type VitePluginCompatible, type VitePluginOption, atoms };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metagptx/web-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.55",
|
|
5
5
|
"packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b",
|
|
6
6
|
"description": "TypeScript SDK for interacting with FuncSea API",
|
|
7
7
|
"author": "MetaGPTX",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsdown",
|
|
34
34
|
"dev": "tsdown --watch",
|
|
35
|
+
"playground": "cd playground && pnpm run dev",
|
|
36
|
+
"playground:install": "cd playground && pnpm install",
|
|
35
37
|
"test": "vitest run",
|
|
36
38
|
"test:coverage": "vitest --coverage run",
|
|
37
39
|
"typecheck": "tsc --noEmit",
|