create-yeow 0.3.9 → 0.4.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/package.json
CHANGED
|
Binary file
|
|
@@ -284,7 +284,7 @@ export function makeAssetPlugin({ root, pkgJson, outDir, prepared }) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
// ── esbuild 插件:统一 yeow-api/yeow-
|
|
287
|
+
// ── esbuild 插件:统一 yeow-api/yeow-command/yeow-server 到主项目实例 ──
|
|
288
288
|
// 避免依赖包自带副本导致全局状态分裂(如 __yeowInitCbs 被覆盖)
|
|
289
289
|
// 注意:返回路径必须用正斜杠,否则 Windows 下 esbuild 解析失败
|
|
290
290
|
export function makeDedupePlugin(root) {
|
|
@@ -294,8 +294,11 @@ export function makeDedupePlugin(root) {
|
|
|
294
294
|
build.onResolve({ filter: /^yeow-api$/ }, () => ({
|
|
295
295
|
path: resolve(root, 'node_modules', 'yeow-api', 'src', 'index.ts').replace(/\\/g, '/'),
|
|
296
296
|
}));
|
|
297
|
-
build.onResolve({ filter: /^yeow-
|
|
298
|
-
path: resolve(root, 'node_modules', 'yeow-
|
|
297
|
+
build.onResolve({ filter: /^yeow-command$/ }, () => ({
|
|
298
|
+
path: resolve(root, 'node_modules', 'yeow-command', 'src', 'index.ts').replace(/\\/g, '/'),
|
|
299
|
+
}));
|
|
300
|
+
build.onResolve({ filter: /^yeow-server$/ }, () => ({
|
|
301
|
+
path: resolve(root, 'node_modules', 'yeow-server', 'src', 'index.ts').replace(/\\/g, '/'),
|
|
299
302
|
}));
|
|
300
303
|
},
|
|
301
304
|
};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
- **语言**:TypeScript / JavaScript(Node.js 18+,开发)
|
|
16
16
|
- **构建**:esbuild(bundle → IIFE,`target: esnext`),脚本在 `.yeow/build.js`
|
|
17
17
|
- **开发服务器**:`.yeow/dev-server.js`(下载并启动 Paper、WebSocket 热重载、source-map 错误定位)
|
|
18
|
-
- **API**:`yeow-api`(运行时 API:Player/World/Event/Command/Worker/fs/http
|
|
18
|
+
- **API**:`yeow-api`(运行时 API:Player/World/Event/Command/Worker/fs/http…)——打包进产物
|
|
19
19
|
- **运行时**:`yeow-runtime`(Java 21,Paper 插件)——仓库 `yeow-runtime/`;本模板 `.yeow/assets/` 内置其 jar
|
|
20
20
|
- **Worker(虚拟插件)**:`createWorker` 提供独立线程;配置见 `yeow.config.json` 的 `dev.worker`
|
|
21
21
|
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
| Advancement | `https://yexin.wiki/yeow/v1/api/advancement` | 进度:授予/撤销、进度查询、判据授予/撤销 |
|
|
53
53
|
| Recipe | `https://yexin.wiki/yeow/v1/api/recipe` | 配方:有序/无序合成、熔炉/高炉/烟熏/营火;添加/移除/按产物查询 |
|
|
54
54
|
| Event | `https://yexin.wiki/yeow/v1/api/event` | 事件订阅:`eventOn`/`eventOff`、自动/手动模式(取消、回写)、全事件字段表、消息(Message 对象) |
|
|
55
|
-
| Command | `https://yexin.wiki/yeow/v1/api/command` | 命令注册 + Tab 补全(含 yeow-
|
|
55
|
+
| Command | `https://yexin.wiki/yeow/v1/api/command` | 命令注册 + Tab 补全(含 yeow-command 重载式命令 Command.create 与模式化参数) |
|
|
56
56
|
| ItemStack | `https://yexin.wiki/yeow/v1/api/item` | 物品纯数据描述符:type/amount/meta(显示名/附魔/耐久/染色/药水/头颅/属性修饰符);构造工具(create/clone/equals);值语义(快照,不绑定真实物品) |
|
|
57
57
|
| Service | `https://yexin.wiki/yeow/v1/api/service` | 插件间服务(registerService/request/subscribe/publish)与原生服务(registerNativeService,spawn 子进程 + TCP 通信) |
|
|
58
58
|
| HTTP | `https://yexin.wiki/yeow/v1/api/http` | 底层 HTTP 客户端:request(异步)/requestSync(同步阻塞)/fetch |
|
|
59
|
-
| HTTP Server | `https://yexin.wiki/yeow/v1/api/http-server` | 高层 `createServer`(yeow-
|
|
59
|
+
| HTTP Server | `https://yexin.wiki/yeow/v1/api/http-server` | 高层 `createServer`(yeow-server):洋葱中间件、路由、mount/mountAssets 静态挂载、二进制响应(bodyBase64)、返回对象自动 JSON、资源包下载闭环 |
|
|
60
60
|
| Worker | `https://yexin.wiki/yeow/v1/api/worker` | 虚拟插件(独立线程):createWorker(仅注册)/load/unload/reload、双向 postMessage、Worker 侧 onMessage/postMessage;共享数据目录/权限、禁嵌套、/yeow 不覆盖 |
|
|
61
61
|
| FS | `https://yexin.wiki/yeow/v1/api/fs` | 文件系统:plugin/server/outer 三级(路径安全)、读写/追加/二进制、目录操作、systemPaths、path 工具 |
|
|
62
62
|
| Assets | `https://yexin.wiki/yeow/v1/api/assets` | 打包资源:`getAssetsPath`(yeow-dev,构建期注入命名空间)+ 读取/解压(单文件与目录) |
|