Repository navigation
feat!: let plugins expose subpath entry points via plugin:<id>/<subpath> - #113
Merged
Merged
Conversation
Plugins declare extra entry modules in rpp.json `exports`, imported as `plugin:<name>/<subpath>` next to `plugin:<name>` for the config module. The SDK moves to `rpp`, `rpp:config` and `rpp:jsx`; internal virtual modules move under `rpp:internal/`. The `#rpp` and `#plugins/` specifiers no longer resolve, and bundle errors for them point at the new names. Closes #112
- Resolve chunk source map sources against the map's directory, so nested export maps point at the original files. - Bundle type-only entries, which produce no source map. - Resolve a plugin's own plugin:<id>[/<subpath>] modules when loading it without discovery, and map them in plugin-project codegen.
A plugin without discovery that imports its own config module needs the config SDK the module imports.
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.
A plugin could expose only one module to pack sources, its
config, so plugins with a larger authoring API couldn't split it into entry points. Window wants its low-level API atplugin:window/rawbesideplugin:window. The#specifiers also read like package-internal imports when they're really provided by the host.Plugins can now declare extra modules in
rpp.json:{ "config": "src/config.ts", "exports": { "./raw": "src/raw.ts" } }Pack sources and
rpp.config.tsimport them asplugin:<name>/<subpath>, andplugin:<name>still means the config module. Every import uses a scheme now:#rpprpp#rpp/configrpp:config#rpp/jsxrpp:jsx#plugins/<name>plugin:<name>This is a breaking change with no alias:
#rppand#plugins/no longer resolve. Bundle errors for them name the new specifiers. Published plugin archives import#rpp, so they have to be republished (Window included).Closes #112.
Details
exportskeys must be./<relative path>. Undeclared subpaths fail in both the bundler andtsc, since codegen writes one exactpathsentry per module. Entries that share a package directory bundle shared modules once.rpp plugin packbuilds each export todist/exports/<subpath>.js, adds a.d.tsstub and isolated declarations for it, aliasesplugin:<self>/<subpath>, and rewritesexportsin the packed manifest. Facade chunks (pure re-exports) no longer fail packing for lacking a source map.rpp:internal/*so they don't sit next to user-facingrpp:modules.pathsundermoduleResolution: "Bundler"on TypeScript 5 and 7, includingrpp:jsx/jsx-runtime.Validation
rpp-js,rpp --features jsandrpp-cli. New tests cover subpath module sharing, packing exports, importing a subpath from a discovered file, the rename hint, codegen paths and the packed manifest.just lint,just fmt-checkandjust check-featurespass. I didn't runverify-jvmlocally; the JVM example's import change is covered in CI.AGENTS.md still says the SDK is imported as
#rpp. I left it alone because it shouldn't change without being asked.🤖 Generated with Claude Code