Skip to content

chore: migrate TS execution to tsx and improve mustard-cli reliability#14

Open
linbudu599 wants to merge 4 commits intomainfrom
infra/ai
Open

chore: migrate TS execution to tsx and improve mustard-cli reliability#14
linbudu599 wants to merge 4 commits intomainfrom
infra/ai

Conversation

@linbudu599
Copy link
Copy Markdown
Member

@linbudu599 linbudu599 commented Mar 28, 2026

背景

这次合并后的单个提交整合了此前两次提交的改动,目标是:

  1. 去除实验性 Node 运行开关,统一 TypeScript 执行方式。
  2. 修复 mustard-cli 在新运行时下的兼容性问题,并提升测试稳定性与覆盖率。

主要改动

  • 运行时与脚手架模板统一迁移到 tsx

    • 移除了仓库内 --experimental-specifier-resolution=node
    • ts-node-esm 执行入口迁移为 tsx(包含主仓库、sample、create 模板、experimentals、测试集成执行入口)。
    • 更新相关文档示例与说明,避免继续依赖实验参数。
  • mustard-cli 源码兼容性修复

    • 调整 @Restrict 装饰器逻辑,使其不再依赖装饰器执行顺序。
    • 在当前 Node/TS 运行语义下恢复 Restrict 行为预期(非法值回退默认值)。
  • 测试与断言稳定性增强

    • 将脆弱的路径/行号型错误快照,替换为更稳健的错误类型与关键信息断言。
    • 扩展单元测试覆盖面(BuiltInCommands、CommandLine、Decorators、FieldsNormalizer、UsageGenerator、Utils、UtilsProvider、Validator、Errors 等)。
    • 保留并补强 execa 相关集成测试链路。

结果

  • mustard-cli 全量测试通过:17 passed | 1 skipped
  • 覆盖率显著提升:
    • Stmts: 98.95%
    • Branch: 89.97%
    • Funcs: 100%
    • Lines: 98.95%

测试命令

  • pnpm --filter mustard-cli test -- --run

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for mustard-cli failed.

Name Link
🔨 Latest commit 55702e7
🔍 Latest deploy log https://app.netlify.com/projects/mustard-cli/deploys/69c8c9331472520008d52869

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 28, 2026

⚠️ No Changeset found

Latest commit: 55702e7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "mustard-container" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Unify runtime/test tooling by removing experimental Node flags and replacing ts-node-esm with tsx across workspace templates, then strengthen mustard-cli behavior with decorator compatibility fixes and robust integration/unit coverage improvements.

Made-with: Cursor
@linbudu599 linbudu599 changed the title Infra: AI-first cli builder tool. chore: migrate TS execution to tsx and improve mustard-cli reliability Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant