Skip to content

feat: macro robustness & vendored runtime node_modules#8

Merged
arcaputo3 merged 5 commits into
mainfrom
feat/macro-robustness-vendored-runtime
Apr 7, 2026
Merged

feat: macro robustness & vendored runtime node_modules#8
arcaputo3 merged 5 commits into
mainfrom
feat/macro-robustness-vendored-runtime

Conversation

@arcaputo3
Copy link
Copy Markdown
Contributor

Summary

  • Macro robustness: Rewrote bun"" interpolator macro to handle nested macro contexts (e.g. inside utest Tests{}) by walking Inlined AST nodes instead of relying on pattern matching
  • Integration tests: Added integration tests for dependency manifests, vendored runtime flow, and compile-time bun literal validation
  • Vendored runtime deps: BunPublishModule now embeds resolved node_modules at META-INF/bun/node_modules/ in published JARs — consumers receive exact packages automatically with zero lockfile management or bun install for transitive published deps

Key changes

  • BunVendoredNodeModules utility: symlink-dereferencing copy, JAR/dir merge with conflict detection
  • BunPublishModule: new bunPublishedRuntimeInstall and bunVendoredRuntimeBundle tasks
  • BunScalaJSModule: conditionally skips bun install when no deps, merges vendored node_modules from classpath
  • Removed bunFrozenLockfile, bunWorkspaceLockfile, bunUpdateLock — lockfile management is no longer needed

Test plan

  • Unit tests for BunVendoredNodeModules (copy, merge from dir, merge from JAR, conflict detection)
  • Integration tests for published manifest content and vendored dep flow
  • Integration test for invalid bun"" literal compile-time rejection
  • Existing test suite passes

🤖 Generated with Claude Code

arcaputo3 and others added 5 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>
BunPublishModule now embeds resolved node_modules at
META-INF/bun/node_modules/ in published JARs. Consumers receive exact
packages automatically — no lockfile management or bun install needed
for transitive published deps.

- Add BunVendoredNodeModules for symlink-dereferencing copy and JAR/dir merge
- Add bunPublishedRuntimeInstall and bunVendoredRuntimeBundle tasks
- Skip BunPublishModule instances in local dep traversal (vendored instead)
- Conditionally skip bun install when no deps declared

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Classpath manifest scanning now skips entries with vendored node_modules
  (handled by mergeVendoredNodeModules) and falls back to manifest-based
  dep resolution for legacy JARs without a vendored tree
- Restore devDependencies in published manifests as metadata
- Guard bun install against bunPackageJsonExtras supplying deps outside
  the typed task API (in both bunInstall and bunPublishedRuntimeInstall)
- Add hasVendoredNodeModules detection tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make vendored node_modules opt-in via bunPublishVendoredRuntime (default
false) since published JARs are cross-platform but bun installs can
materialize host-specific binaries. Manifests are always published.

- BunPublishModule reads dep fields from bunPackageJsonExtras with
  manifestField helper, falling back to typed tasks
- resolvedPublishedManifest centralizes manifest construction
- Add RecordingStubBunModule for integration tests that simulate installs
- New integration tests: extras-only install, vendored opt-in publishing,
  consumer merging of vendored tree, manifest-only default verification

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arcaputo3 arcaputo3 merged commit b0fb677 into main Apr 7, 2026
2 checks passed
@arcaputo3 arcaputo3 deleted the feat/macro-robustness-vendored-runtime branch April 7, 2026 21:39
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