Skip to content

feat: macro robustness, integration tests, and project-level lockfile management#7

Closed
arcaputo3 wants to merge 3 commits into
mainfrom
feat/macro-robustness-lockfile-management
Closed

feat: macro robustness, integration tests, and project-level lockfile management#7
arcaputo3 wants to merge 3 commits into
mainfrom
feat/macro-robustness-lockfile-management

Conversation

@arcaputo3
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #6. Three workstreams combined into one PR:

  • Macro robustness: Rewrites bun"..." string interpolator from Expr pattern matching to TASTy tree inspection, fixing breakage inside nested macro contexts (e.g., utest Tests{}). Also fixes validation bug where @/bad (empty scope) passed validation.
  • Integration tests: Adds BunDependencyManifestIntegrationTests covering invalid literal detection, manifest embedding in published JARs, and transitive dep flow through classpath scanning. Uses StubBunModule pattern to avoid needing real Bun.
  • Project-level lockfile management: Developers can now commit bun.lock at workspace root for deterministic builds. New bunUpdateLock command regenerates the lockfile, and bunInstall/npmInstall seed from it when present.

Lockfile workflow

mill myApp.bunUpdateLock   # generates bun.lock at workspace root
git add bun.lock && git commit -m "pin JS deps"

# CI: override bunFrozenLockfile = true to enforce

Applied symmetrically to BunScalaJSModule and BunTypeScriptModule.

Test plan

  • ./mill millbun.compile — compiles cleanly
  • ./mill millbun.test — all 30 unit tests pass
  • ./mill millbun.integration — integration tests (manifest + invalid literal)
  • Manual: bunUpdateLock writes bun.lock to workspace root
  • Manual: bunFrozenLockfile = true + stale lockfile → install fails

🤖 Generated with Claude Code

arcaputo3 and others added 3 commits April 7, 2026 15:32
…ntexts

The Expr pattern matching approach (.matches, Varargs) broke when
bun"..." was used inside another macro's generated code (e.g., utest
Tests{}). Rewrite to direct TASTy tree inspection which handles
Inlined/Typed/Repeated wrappers from macro expansion.

Also fix validation bug: @/bad (empty scope name) was not caught
because only the package name after the slash was checked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…validation

- invalid-bun-literal: verifies bun"" fails compilation in a real
  build.mill context (validates macro error reporting end-to-end)
- scalajs-dependency-manifests: tests manifest embedding in published
  JARs, local optional dep flow, and classpath manifest scanning for
  dev + optional deps
- StubBunModule pattern overrides runBun to avoid needing real Bun

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Developers can now commit bun.lock at the workspace root for
deterministic JS dependency resolution across clean builds and CI.

- bunWorkspaceLockfile (BunToolchainModule): Task.Input that detects
  bun.lock at workspace root and triggers re-evaluation on changes
- bunInstall/npmInstall: seed from workspace lockfile when present,
  giving bun a known-good resolution baseline
- bunUpdateLock command: runs bun install without --frozen-lockfile,
  copies generated lockfile back to workspace root for committing
- Applied symmetrically to BunScalaJSModule and BunTypeScriptModule
  (including test module inner npmInstall)

Workflow:
  mill myApp.bunUpdateLock   # generate/update bun.lock
  git add bun.lock && git commit
  # CI: override bunFrozenLockfile = true to enforce

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arcaputo3 arcaputo3 closed this Apr 7, 2026
@arcaputo3 arcaputo3 deleted the feat/macro-robustness-lockfile-management branch April 7, 2026 22:11
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