create-koishi-ce 1.6.2 → 1.6.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/lib/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { t as start } from "./src-bupbxcI6.mjs";
2
+ import { t as start } from "./src-C4V0N-Vc.mjs";
3
3
  //#region src/bin.ts
4
4
  /**
5
5
  * create-koishi-ce 的 CLI 可执行入口:shebang 由 rolldown 原样保留到
package/lib/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as renderManifest, i as readNpmrcRegistry, n as detectAgent, r as getLocalRegistry, t as start } from "./src-bupbxcI6.mjs";
1
+ import { a as renderManifest, i as readNpmrcRegistry, n as detectAgent, r as getLocalRegistry, t as start } from "./src-C4V0N-Vc.mjs";
2
2
  export { detectAgent, getLocalRegistry, readNpmrcRegistry, renderManifest, start };
@@ -9,7 +9,7 @@ import { downloadTemplate } from "giget";
9
9
  var package_default = {
10
10
  name: "create-koishi-ce",
11
11
  description: "Setup a Koishi application",
12
- version: "1.6.2",
12
+ version: "1.6.3",
13
13
  type: "module",
14
14
  main: "./lib/index.mjs",
15
15
  module: "./lib/index.mjs",
@@ -235,7 +235,11 @@ function baseManifest() {
235
235
  return {
236
236
  type: "module",
237
237
  packageManager: `bun@${Bun.version}`,
238
- workspaces: ["plugins/*", "external/*"],
238
+ workspaces: [
239
+ "plugins/*",
240
+ "external/**",
241
+ "!external/**/node_modules/**"
242
+ ],
239
243
  scripts: {
240
244
  start: "koishi start",
241
245
  dev: "NODE_ENV=development koishi start",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-koishi-ce",
3
3
  "description": "Setup a Koishi application",
4
- "version": "1.6.2",
4
+ "version": "1.6.3",
5
5
  "type": "module",
6
6
  "main": "./lib/index.mjs",
7
7
  "module": "./lib/index.mjs",
@@ -231,9 +231,12 @@ function expectTemplateFiles(dir: string): void {
231
231
  ) as Record<string, unknown>;
232
232
  expect(manifest["private"]).toBe(true);
233
233
  expect(manifest["version"]).toBe("0.0.0");
234
+ // globstar + 负向排除形态:external 任意深度(含克隆的 monorepo
235
+ // 子包)都是成员,node_modules 残留被排除(与 template.test.ts 同步)
234
236
  expect(manifest["workspaces"]).toEqual([
235
237
  "plugins/*",
236
- "external/*",
238
+ "external/**",
239
+ "!external/**/node_modules/**",
237
240
  ]);
238
241
  }
239
242
 
@@ -224,6 +224,14 @@ test("renderManifest 渲染内置模板:常规改写生效,prod 模式保留
224
224
  expect(output.dependencies.koishi).toBe(
225
225
  "npm:@koishi-ce/koishi-shim@^4.18.11",
226
226
  );
227
+ // workspaces 是 globstar + 负向排除形态:external 任意深度(含克隆的
228
+ // monorepo 子包)都是成员,node_modules 排除搬迁残留——配置页的
229
+ // 「添加插件」列表按同一份声明展开收录,写法回退即嵌套不可见
230
+ expect(output.workspaces).toEqual([
231
+ "plugins/*",
232
+ "external/**",
233
+ "!external/**/node_modules/**",
234
+ ]);
227
235
 
228
236
  const prod = JSON.parse(
229
237
  renderManifest(baseManifest(), "my-app", true),
@@ -43,7 +43,7 @@ bun run update # 安全更新:只更新 @koishi-ce/* 生态位依赖
43
43
  - `bun run new <名称>` —— 生成插件骨架到 `external/`(`--console` 附带控制台前端扩展)
44
44
  - `bun run clone <仓库>` —— 克隆已有插件源码到 `external/` 本地联动调试
45
45
 
46
- 两种来源的插件都在 `koishi.yml` 中以相对路径引用(如 `./plugins/my-plugin`、`./external/my-plugin`)即可启用;Bun 直接加载 TypeScript 源码,无需预编译。
46
+ 两种来源的插件都在 `koishi.yml` 中以相对路径引用(如 `./plugins/my-plugin`、`./external/my-plugin`)即可启用;Bun 直接加载 TypeScript 源码,无需预编译。克隆来的 **monorepo 形态插件仓库**(插件在 `packages/` 等子目录)无需平铺——`workspaces` 声明的 `external/**` 通配任意深度,控制台「添加插件」列表同样按此声明收录,子包直接可见可启用(搬迁自其它包管理器的仓库若带着旧 `node_modules`,负向声明已将其排除,建议顺手删除节省空间)。
47
47
 
48
48
  ## 插件构建与发布
49
49
 
package/src/template.ts CHANGED
@@ -92,7 +92,16 @@ export function baseManifest(): Manifest {
92
92
  type: "module",
93
93
  // 本项目只用 Bun:钉住创建时的 Bun 版本(bun run 亦据此选择解释器)
94
94
  packageManager: `bun@${Bun.version}`,
95
- workspaces: ["plugins/*", "external/*"],
95
+ // globstar + 负向排除(Bun workspaces 支持完整 glob 语法):external
96
+ // 下任意深度的插件包(含克隆来的 monorepo 形态 packages/ 子包)都是
97
+ // workspace 成员;node_modules 排除搬迁残留的依赖目录(包管理器
98
+ // 对其另有管理,混入成员会污染解析)。配置页的「添加插件」列表按
99
+ // 同一份声明展开收录,声明写多深列表就能看多深
100
+ workspaces: [
101
+ "plugins/*",
102
+ "external/**",
103
+ "!external/**/node_modules/**",
104
+ ],
96
105
  scripts: {
97
106
  start: "koishi start",
98
107
  // bun run 走 Bun Shell,`NODE_ENV=...` 前缀天然跨平台,无需 cross-env