Skip to content

chore: migrate to the new moon project format#11

Merged
otnc merged 1 commit into
mainfrom
chore/moon-new-project-format
Jul 14, 2026
Merged

chore: migrate to the new moon project format#11
otnc merged 1 commit into
mainfrom
chore/moon-new-project-format

Conversation

@otnc

@otnc otnc commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Recent moon toolchains (feature flags rr_moon_mod / rr_moon_pkg) auto-migrate the project layout on moon info / moon fmt, so every contributor run currently produces unrelated migration noise. This PR commits the migration once:

  • moon.mod.jsonmoon.mod (all metadata — name, version, deps, license, keywords — preserved)
  • src/codegen/moon.pkg.jsonmoon.pkg; import aliases dropped where they match the last path segment
  • Commit the generated pkg.generated.mbti interface files (per AGENTS.md convention)
  • scripts/sync-version.js: read/write the new moon.mod format (regex on the version = "..." line instead of JSON.parse)
  • AGENTS.md / CONTRIBUTING(-ja).md: update file references

Verification

  • moon test --target js: 318 passed
  • moon build --target js + node scripts/build.js + pkg API smoke test (compile('const x be 42')) all work
  • node scripts/sync-version.js works against the new format
  • CI installs the latest moon via the official install script, so it runs the same toolchain

Merge order

.mbt sources are intentionally untouched to avoid conflicts with #8 / #9 / #10this PR can merge before or after them in any order. A follow-up moon fmt pass (which rewrites impl ... with outputwith fn output etc.) and an .mbti refresh should land after everything is merged.

Recent moon toolchains (with rr_moon_mod / rr_moon_pkg) migrate the
project layout automatically on `moon info` / `moon fmt`, which turns
every contributor run into unrelated noise. Commit the migration once:

- moon.mod.json -> moon.mod (all metadata preserved)
- src/codegen/moon.pkg.json -> moon.pkg; import aliases dropped where
  they match the last path segment
- commit the generated pkg.generated.mbti interface files
- scripts/sync-version.js: read/write the new moon.mod format
- AGENTS.md / CONTRIBUTING(-ja).md: update file references

Verified: moon test (318 passed), moon build --target js, scripts
build + sync-version, and the pkg API all work with the new layout.
CI installs the latest moon, so it uses the same toolchain.

Note: .mbt sources are intentionally untouched to avoid conflicts with
open PRs; a follow-up `moon fmt` pass can land after those merge.
@otnc
otnc merged commit 491743c into main Jul 14, 2026
1 check passed
@otnc
otnc deleted the chore/moon-new-project-format branch July 14, 2026 04:58
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