create-koishi-ce 1.2.0 → 1.2.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.
package/lib/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { a as start } from "./src-BwIHbUAf.mjs";
2
+ import { a as start } from "./src-CwJZjC5d.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 start, i as renderManifest, n as getLocalRegistry, r as readNpmrcRegistry, t as detectAgent } from "./src-BwIHbUAf.mjs";
1
+ import { a as start, i as renderManifest, n as getLocalRegistry, r as readNpmrcRegistry, t as detectAgent } from "./src-CwJZjC5d.mjs";
2
2
  export { detectAgent, getLocalRegistry, readNpmrcRegistry, renderManifest, start };
@@ -11,7 +11,7 @@ import parse from "yargs-parser";
11
11
  var package_default = {
12
12
  name: "create-koishi-ce",
13
13
  description: "Setup a Koishi application",
14
- version: "1.2.0",
14
+ version: "1.2.1",
15
15
  type: "module",
16
16
  main: "./lib/index.mjs",
17
17
  module: "./lib/index.mjs",
@@ -147,7 +147,7 @@ bun run dev # 启动(开发模式,启用 HMR 热更新)
147
147
 
148
148
  推荐在控制台「插件市场」页安装(已预配 registry.koishi.chat 镜像源);也可以手动 \`bun add <包名>\` 后在 \`koishi.yml\` 中启用。
149
149
 
150
- 上游官方 adapter(如 adapter-discord / adapter-telegram)、数据库插件(如 database-sqlite)与社区 koishi-plugin-* 插件均可直接安装:根依赖中的四行 npm alias——\`"koishi": "npm:@koishi-ce/koishi-shim@^4.18.11"\`、\`"@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11"\`、\`"@koishijs/core": "npm:@koishi-ce/core-shim@4.18.11"\`、\`"@koishijs/loader": "npm:@koishi-ce/loader-shim@^4.6.11"\`——已把上游生态的 peer 依赖全部钉回 @koishi-ce 框架(**请勿删除或改写这四行**),不会形成第二份框架 / console / loader 副本。analytics 等依赖数据库的插件请先安装数据库插件,再去掉配置中对应的 \`~\` 前缀启用。
150
+ 上游官方 adapter(如 adapter-discord / adapter-telegram)、数据库插件(如 database-sqlite)与社区 koishi-plugin-* 插件均可直接安装:根依赖中的四行 npm alias——\`"koishi": "npm:@koishi-ce/koishi-shim@^4.18.11"\`、\`"@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11"\`、\`"@koishijs/core": "npm:@koishi-ce/koishi-shim@4.18.11"\`、\`"@koishijs/loader": "npm:@koishi-ce/koishi-shim@^4.18.11"\`——已把上游生态的 peer 依赖全部钉回 @koishi-ce 框架(前两行与后两行分别只涉及 koishi-shim / console-shim 两个包;**请勿删除或改写这四行**),不会形成第二份框架 / console / loader 副本。analytics 等依赖数据库的插件请先安装数据库插件,再去掉配置中对应的 \`~\` 前缀启用。
151
151
 
152
152
  ## 自定义插件
153
153
 
@@ -193,8 +193,8 @@ function baseManifest() {
193
193
  "@koishi-ce/plugin-status": "^1.0.0",
194
194
  koishi: "npm:@koishi-ce/koishi-shim@^4.18.11",
195
195
  "@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11",
196
- "@koishijs/core": "npm:@koishi-ce/core-shim@4.18.11",
197
- "@koishijs/loader": "npm:@koishi-ce/loader-shim@^4.6.11"
196
+ "@koishijs/core": "npm:@koishi-ce/koishi-shim@4.18.11",
197
+ "@koishijs/loader": "npm:@koishi-ce/koishi-shim@^4.18.11"
198
198
  },
199
199
  devDependencies: {
200
200
  "@koishi-ce/client": "^1.0.0",
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.2.0",
4
+ "version": "1.2.1",
5
5
  "type": "module",
6
6
  "main": "./lib/index.mjs",
7
7
  "module": "./lib/index.mjs",
@@ -37,11 +37,12 @@ test("内置模板钉住 console / core / loader 上游 peer 名,防 Bun 自
37
37
  );
38
38
  // @koishi-ce/loader 的 peer 精确锁 4.18.11:alias 必须逐字相等(不带 ^)
39
39
  expect(dependencies?.["@koishijs/core"]).toBe(
40
- "npm:@koishi-ce/core-shim@4.18.11",
40
+ "npm:@koishi-ce/koishi-shim@4.18.11",
41
41
  );
42
- // config / hmr 插件的 loader peer:alias 版本冻结 4.6.x 线
42
+ // config / hmr 插件的 loader peer:koishi-shim core + loader 的合并
43
+ // 再导出(与上游 koishi 主包同构),4.18.11 满足 ^4.6.11
43
44
  expect(dependencies?.["@koishijs/loader"]).toBe(
44
- "npm:@koishi-ce/loader-shim@^4.6.11",
45
+ "npm:@koishi-ce/koishi-shim@^4.18.11",
45
46
  );
46
47
  });
47
48
 
@@ -81,9 +82,9 @@ test("renderManifest 渲染内置模板:常规改写生效,prod 模式保留
81
82
  "npm:@koishi-ce/console-shim@^5.30.11",
82
83
  );
83
84
  expect(prod.dependencies["@koishijs/core"]).toBe(
84
- "npm:@koishi-ce/core-shim@4.18.11",
85
+ "npm:@koishi-ce/koishi-shim@4.18.11",
85
86
  );
86
87
  expect(prod.dependencies["@koishijs/loader"]).toBe(
87
- "npm:@koishi-ce/loader-shim@^4.6.11",
88
+ "npm:@koishi-ce/koishi-shim@^4.18.11",
88
89
  );
89
90
  });
package/src/template.ts CHANGED
@@ -10,9 +10,10 @@
10
10
  * 模板要点:
11
11
  * - 运行时 Bun:koishi CLI(@koishi-ce/koishi 的 bin)与 loader 插件加载链
12
12
  * 均以 Bun 为准(ESM-only 产物,Bun 原生加载 TS / yml);
13
- * - "koishi" 裸名用 npm alias 钉到 @koishi-ce/koishi-shim(4.18.x 冻结线,
14
- * packages/node/koishi-shim):上游官方 adapter / database 插件与社区
15
- * koishi-plugin-* peer `koishi ^4.x` 由此满足,不会拉入 npm 官方
13
+ * - "koishi" 裸名与 @koishijs/core / @koishijs/loader 上游名用 npm alias
14
+ * 钉到 @koishi-ce/koishi-shim(4.18.x 冻结线,见 packages/shim/koishi-shim):
15
+ * 上游官方 adapter / database 插件与社区
16
+ * koishi-plugin-* 的 peer `koishi ^4.x` 等由此满足,不会拉入 npm 官方
16
17
  * koishi 形成第二份框架副本;市场安装亦不改写该声明(installer 的
17
18
  * isGuardedRequest 护栏将 npm:@koishi-ce alias 与 workspace: 同等保护);
18
19
  * - 本仓没有 adapter / database 插件的再分发,模板不预装这两类;依赖数据库
@@ -107,7 +108,7 @@ bun run dev # 启动(开发模式,启用 HMR 热更新)
107
108
 
108
109
  推荐在控制台「插件市场」页安装(已预配 registry.koishi.chat 镜像源);也可以手动 \`bun add <包名>\` 后在 \`koishi.yml\` 中启用。
109
110
 
110
- 上游官方 adapter(如 adapter-discord / adapter-telegram)、数据库插件(如 database-sqlite)与社区 koishi-plugin-* 插件均可直接安装:根依赖中的四行 npm alias——\`"koishi": "npm:@koishi-ce/koishi-shim@^4.18.11"\`、\`"@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11"\`、\`"@koishijs/core": "npm:@koishi-ce/core-shim@4.18.11"\`、\`"@koishijs/loader": "npm:@koishi-ce/loader-shim@^4.6.11"\`——已把上游生态的 peer 依赖全部钉回 @koishi-ce 框架(**请勿删除或改写这四行**),不会形成第二份框架 / console / loader 副本。analytics 等依赖数据库的插件请先安装数据库插件,再去掉配置中对应的 \`~\` 前缀启用。
111
+ 上游官方 adapter(如 adapter-discord / adapter-telegram)、数据库插件(如 database-sqlite)与社区 koishi-plugin-* 插件均可直接安装:根依赖中的四行 npm alias——\`"koishi": "npm:@koishi-ce/koishi-shim@^4.18.11"\`、\`"@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11"\`、\`"@koishijs/core": "npm:@koishi-ce/koishi-shim@4.18.11"\`、\`"@koishijs/loader": "npm:@koishi-ce/koishi-shim@^4.18.11"\`——已把上游生态的 peer 依赖全部钉回 @koishi-ce 框架(前两行与后两行分别只涉及 koishi-shim / console-shim 两个包;**请勿删除或改写这四行**),不会形成第二份框架 / console / loader 副本。analytics 等依赖数据库的插件请先安装数据库插件,再去掉配置中对应的 \`~\` 前缀启用。
111
112
 
112
113
  ## 自定义插件
113
114
 
@@ -159,10 +160,13 @@ export function baseManifest(): Manifest {
159
160
  // 会自动装下 npm 官方 console 全家桶形成双实例;版本冻结 5.30.x
160
161
  "@koishijs/plugin-console": "npm:@koishi-ce/console-shim@^5.30.11",
161
162
  // 上游 core 名占位:@koishi-ce/loader 的 peer 精确锁 4.18.11,
162
- // alias 须逐字相等(不带 ^),版本冻结勿 bump
163
- "@koishijs/core": "npm:@koishi-ce/core-shim@4.18.11",
164
- // 上游 loader 名占位:config / hmr 插件的 peer;版本冻结 4.6.x
165
- "@koishijs/loader": "npm:@koishi-ce/loader-shim@^4.6.11",
163
+ // alias 须逐字相等(不带 ^),版本冻结勿 bump。core 与 loader
164
+ // 两个名字共用 koishi-shim:@koishi-ce/koishi 是 core + loader
165
+ // 的合并再导出(与上游 koishi 主包同构),named 导出全覆盖
166
+ "@koishijs/core": "npm:@koishi-ce/koishi-shim@4.18.11",
167
+ // 上游 loader 名占位:config / hmr 插件的 peer;同样指向
168
+ // koishi-shim(4.18.11 满足 ^4.6.11),勿指回已废弃的 loader-shim
169
+ "@koishijs/loader": "npm:@koishi-ce/koishi-shim@^4.18.11",
166
170
  },
167
171
  devDependencies: {
168
172
  "@koishi-ce/client": "^1.0.0",