Skip to content

refactor(codegen): distribute generator through moonx - #115

Merged
Milky2018 merged 2 commits into
mainfrom
milky/codegen-moonx
Aug 13, 2026
Merged

refactor(codegen): distribute generator through moonx#115
Milky2018 merged 2 commits into
mainfrom
milky/codegen-moonx

Conversation

@Milky2018

Copy link
Copy Markdown
Contributor

Summary

  • split typed command generation out of proton_cli into the independently published moonbit-community/proton_codegen module
  • ship proton_codegen as a WASM executable and invoke it through a pinned moonx coordinate from generated Moon prebuild rules
  • remove CLI-owned codegen commands and update repository generation, release, CI, and scaffold smoke coverage

Why

Code generation is a build dependency of MoonBit packages, not an implicit responsibility of proton_cli build, dev, or package. Making it an explicit dev_build rule gives Moon the real input/output graph, regenerates output for every normal Moon build path, and avoids directory scanning or CLI lifecycle coupling.

Validation

  • moon fmt
  • moon info
  • moon -C codegen check --target wasm --deny-warn
  • moon -C codegen test lib --target wasm --diagnostic-limit 80
  • moon -C cli test new --target native --diagnostic-limit 80
  • node scripts/verify_generated.mjs --skip-prebuilt-abi
  • moon check --target native --deny-warn
  • PROTON_NATIVE_DIST=$PWD/native/dist node scripts/e2e_scaffold_source_smoke.mjs
  • moon -C codegen publish --dry-run completed package creation and extracted-package validation; registry upload was denied because the local account is not the moonbit-community publisher

@Milky2018
Milky2018 merged commit 42739ff into main Aug 13, 2026
4 checks passed
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