feat: cli 包完整 build 支持(tsc emit + Node 兼容) #61

Merged
xiaomo merged 1 commits from feat/58-cli-build into main 2026-06-03 03:28:32 +00:00
Owner

What

让 @ocas/cli 支持完整 tsc build,可在 Node.js 下运行。

Why

proman type system 引入后,cli type 走 tsc --build,但 cli 包原来是 noEmit,且用了 Bun 专有 API。

Changes

  • tsconfig: 启用 emit + project references
  • shebang: bun → node
  • bin: src/index.ts → dist/index.js
  • import.meta.dir → import.meta.dirname
  • prompts 目录移到包根
  • 修复 exactOptionalPropertyTypes 类型错误

Verification

node dist/index.js 下所有命令正常,bun test 零新增 fail。

Fixes #58


小橘 🍊(NEKO Team)

## What 让 @ocas/cli 支持完整 tsc build,可在 Node.js 下运行。 ## Why proman type system 引入后,cli type 走 tsc --build,但 cli 包原来是 noEmit,且用了 Bun 专有 API。 ## Changes - tsconfig: 启用 emit + project references - shebang: bun → node - bin: src/index.ts → dist/index.js - import.meta.dir → import.meta.dirname - prompts 目录移到包根 - 修复 exactOptionalPropertyTypes 类型错误 ## Verification node dist/index.js 下所有命令正常,bun test 零新增 fail。 Fixes #58 --- 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-06-03 02:29:45 +00:00
- tsconfig: 启用 emit (rootDir/outDir/composite), 添加 project references
- shebang: bun → node
- bin: src/index.ts → dist/index.js
- import.meta.dir → import.meta.dirname (去掉 Bun 专有 API)
- prompts 目录移到包根, src/dist 路径统一
- 修复 exactOptionalPropertyTypes 类型错误

Fixes #58
xiaomo approved these changes 2026-06-03 03:28:29 +00:00
xiaomo left a comment
Owner

LGTM

tsc emit + Node 兼容正确。import.meta.dir → import.meta.dirname 全部替换,prompts 路径从 dist/ 回退正确。

Minor:确认 dist/ 已 gitignore,以及 core/fs tsconfig 有 composite: true。

LGTM ✅ tsc emit + Node 兼容正确。import.meta.dir → import.meta.dirname 全部替换,prompts 路径从 dist/ 回退正确。 Minor:确认 dist/ 已 gitignore,以及 core/fs tsconfig 有 composite: true。
xiaomo merged commit 3cfcf6db89 into main 2026-06-03 03:28:32 +00:00
xiaomo deleted branch feat/58-cli-build 2026-06-03 03:28:32 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#61