jax-hono 1.0.17 → 1.0.18

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,8 +1,8 @@
1
1
  # Jax-hono
2
2
 
3
- Jax 是本项目的轻量框架层。完整说明见 [docs/jax.md](docs/jax.md)。
4
-
5
- 给 Codex、Claude 等代码代理看的维护说明见 [docs/agent.md](docs/agent.md)。
3
+ Jax 是本项目的轻量框架层。完整说明见 [docs/jax.md](docs/jax.md)。
4
+
5
+ 给 Codex、Claude 等代码代理看的维护说明见 [docs/agent.md](docs/agent.md)。
6
6
 
7
7
  维护 Jax 内部代码时按目录职责放置文件:
8
8
 
@@ -15,5 +15,18 @@ helpers/ 框架辅助函数
15
15
  utils/ 纯工具函数
16
16
  errors/ 统一错误类型
17
17
  types/ 框架公共类型
18
- generated/ 调用项目中自动生成的注册表,包内同名目录会链接到这里
18
+ ```
19
+
20
+ `.jax-hono` 目录只存在于调用项目中,不放在 `jax-hono` 包内,也不会从包内链接到某个项目。
21
+
22
+ 需要 `bun --compile` 的项目可以用 setup 包裹 Bun 构建命令:
23
+
24
+ ```powershell
25
+ bun node_modules/jax-hono/setup.ts src/index.ts -- bun build src/index.ts --compile --production --target=bun-windows-x64 --outfile dist/app.exe
26
+ ```
27
+
28
+ setup 会在执行命令期间临时把入口里对 `jax-hono` 的导入切到项目生成入口,命令结束后恢复源码。业务入口仍然写:
29
+
30
+ ```ts
31
+ import { config, createApp } from 'jax-hono';
19
32
  ```
package/bin/jax.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- import { cac } from "cac";
3
+ import { cac } from "cac";
4
4
  import { $ } from "bun";
5
5
  import path from "node:path";
6
6
  import { existsSync } from "node:fs";
@@ -98,6 +98,12 @@ ${modules.join('\n')}
98
98
 
99
99
  ${projectConfigType}
100
100
 
101
+ declare module 'jax-hono/core/generated' {
102
+ interface JaxGenerated {
103
+ config: ProjectConfig
104
+ }
105
+ }
106
+
101
107
  export default configModules
102
108
  `
103
109