feat: macro robustness & vendored runtime node_modules#8
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun""interpolator macro to handle nested macro contexts (e.g. inside utestTests{}) by walkingInlinedAST nodes instead of relying on pattern matchingBunPublishModulenow embeds resolvednode_modulesatMETA-INF/bun/node_modules/in published JARs — consumers receive exact packages automatically with zero lockfile management orbun installfor transitive published depsKey changes
BunVendoredNodeModulesutility: symlink-dereferencing copy, JAR/dir merge with conflict detectionBunPublishModule: newbunPublishedRuntimeInstallandbunVendoredRuntimeBundletasksBunScalaJSModule: conditionally skipsbun installwhen no deps, merges vendorednode_modulesfrom classpathbunFrozenLockfile,bunWorkspaceLockfile,bunUpdateLock— lockfile management is no longer neededTest plan
BunVendoredNodeModules(copy, merge from dir, merge from JAR, conflict detection)bun""literal compile-time rejection🤖 Generated with Claude Code