Repository navigation
fix: declare the dependencies the npm package imports - #26
Merged
Merged
Conversation
The published package imports nine bare specifiers and declares none of
them, so nothing supplies them at resolution time. Three — @std/http,
@std/path and esbuild-deno-loader — are JSR-only and have no npm package
under that name, so no consumer can supply them either. Importing
@frontside/revolution fails on the first of them:
Could not find package '@std/http' from referrer
.../@frontside/revolution/esm/lib/sse.js
dnt 0.41.3 emitted the JSR specifiers verbatim. 0.44.0 vendors those
modules into the package and rewrites the imports to relative paths, and
it records the npm ones in package.json. That leaves effection, which
dnt would also vendor; a mapping keeps it a bare import backed by the
peer dependency, so revolution and its consumer share one copy and
contexts cross the boundary.
cowboyd
approved these changes
Oct 3, 2026
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.
Closes #25.
Motivation
@frontside/revolution@0.9.0cannot be imported. It ships 28 bare import statements across nine packages and declares none of them:There is no
deps/directory in the tarball, so every one of these has to resolve from the consumer'snode_modules. Three of them are JSR-only and have no npm package under that name, which means no consumer can satisfy them.@std/httpis simply the first one the module graph reaches:This is what currently keeps effection's website pinned to
deno.land/x/revolution@0.8.0instead of the published package.Approach
The cause is
tasks/build-npm.tsrunning dnt 0.41.3, which emits JSR specifiers verbatim. Bumping to 0.44.0 fixes it at the source: dnt vendors those modules intoesm/deps/jsr.io/…and rewrites the imports to relative paths, and it records the npm ones inpackage.json.dnt would vendor
effectionthe same way, which would quietly defeatpeerDependencies. Revolution would then run a private copy, so contexts and scopes would not cross the boundary into the consumer's effection. Amappingsentry keeps it a bare import backed by the peer dependency.haststays a bare import on purpose. dnt declares@types/hastfor it, which is how a declaration-only package is meant to be consumed — TypeScript errors if you import an@types/package by its own name.Result
Every remaining bare import is either a declared dependency or a
node:builtin, and noeffectionis vendored.Verification
Packed the build and installed it into a scratch project alongside
effection@4, then served a route and fetched it:deno checkon the consumer passes, including JSX types.node_modulesholds exactly oneeffection, resolved from the consumer.deno fmt --check,deno lintanddeno task test(6 passed, 26 steps) all pass.