Skip to content

typescript(deno): what a stress test against deno info found: lockfile redirects, ^ in URLs, npm ranges, package.json deps, @types twins - #1986

Merged
swapnilpaliwal-sd merged 2 commits into
0.2.1from
fix/deno-stress-redirects-ranges
Oct 25, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
0.2.1from
fix/deno-stress-redirects-ranges

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Follow-up to #1984 / #1985.

Why

I checked six public Deno projects import by import against deno info --json, run from each file's own config directory (Deno finds its config from the working directory). The projects: two Hono apps (one on edge functions), a 14-config framework workspace, a 46-config workspace with Node-style members, an app with URL imports, and a Deno backend with a Vue front end. The checks found five gaps.

What changes

Gap Before Now
Deno 2 records a CDN redirect (<cdn>/[email protected] to [email protected]) only in deno.lock's redirects, with no cache entry of its own UNRESOLVED followed from the lock first, then from the cache's location
A URL with ^ in its path (pkg@^4.11.1) cache miss: the URL parser here escapes ^ to %5E, while Deno hashes the path as written both spellings tried
npm:pkg@^3 in a member's import map, with a hoisted node_modules/pkg at 4 the hoisted 4 the matching node_modules/.deno/[email protected]/node_modules/pkg (a package typed by its @types twin keeps the twin)
A bare specifier declared only in a member's package.json, nothing installed, "nodeModulesDir": "none" UNRESOLVED Deno's npm cache, as Deno serves it. Under manual (Deno's default beside a package.json), Deno refuses without node_modules, so we answer nothing too
A package in Deno's npm cache that ships only JavaScript the .js entry its cached @types twin

Also, --library auto now prints N Deno dependency import(s) resolve to nothing; ... run deno install instead of staging nothing silently. I hit this during the run: macOS purged Deno's cache in ~/Library/Caches under disk pressure, and discovery then reported 0 mirrors with no reason given.

Parser and plugin only.

Measured against deno info

project 0.2.1 agrees this branch agrees
Hono app (36 files) 155 / 155 155 / 155
Hono on edge functions (66 files) 544 / 549 549 / 549
URL-import app (67 files) 333 / 333 333 / 333
Deno backend + Vue front end 341 341 (unchanged; the 7 left are .vue files with a JavaScript <script>, which the JS front end reads, so not this change)
framework workspace (14 configs, manual) 1439 1442 (1 left: a standalone fixture config outside the workspace, where Deno uses its global cache)
workspace with Node-style members (46 configs, none) 8694 8830, plus 12 rows that now resolve to the @types declarations where deno info names the JS module

What's left on the large workspace: 132 imports of generated files that don't exist in a checkout, platform schemes Deno rejects as well (bun:, astro:, cloudflare:), #start/* subpath imports in one Node example app, and extensionless relative imports inside Node example apps (bundler semantics, not Deno's).

Controls, full IR diffed old parser against new:

  • a pnpm Node workspace (76 IR files): byte-identical
  • a Node app using the same web framework: byte-identical
  • the URL-import app and the 36-file Hono app: byte-identical
  • the Deno + Vue project: byte-identical. An ungated first version of the package.json rule changed 12 of its rows (its front end is manual), and that is why the rule is gated on nodeModulesDir.
  • the two fixed projects change only the rows in the table above (5 and 3).

End to end (axiomcode index . --library auto, then one edit and a rebuild):

project first index libraries boundary_lib rebuild
Hono app 20 s 1 mirror + 1 npm 103 12 s
Hono on edge functions 81 s 1 mirror + 12 npm 359 27 s

No library is recompiled on rebuild, and build.log shows no warnings.

Tests

  • parser/src/test/deno-tests.ts: 12 checks (was 9). New:
    • lockfile redirects and the ^ cache key
    • range selection over node_modules/.deno, keeping an @types twin
    • package.json dependencies under none, nothing under manual, and the @types twin from the npm cache
  • bin/axiomcode test parser: every suite passes (TypeScript 49/49, Deno 12/12, JavaScript 49/49, discovery, gradle, services).
  • tests/manifests.py: ok. OSS scrub gate: 0 hits on the changed files.

swapnilpaliwal-sd and others added 2 commits October 24, 2026 17:39
…er node_modules/.deno

Found by checking six public Deno projects import by import against deno info.

- A remote redirect Deno 2 recorded only in deno.lock (`<cdn>/[email protected]` to
  `[email protected]`) is followed; it often has no cache entry of its own.
- A URL with `^` in its path finds the cache entry: Deno hashes the path as
  written, the WHATWG parser here escapes `^` to `%5E`.
- An npm: range the hoisted node_modules copy does not satisfy resolves into the
  matching node_modules/.deno/<name>@<version> copy (`npm:pkg@^3` beside a
  hoisted 4). A package typed by its @types twin keeps the twin.
- `--library auto` says how many Deno dependency imports resolve to nothing and
  to run `deno install`, instead of staging nothing silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, and @types twins

- Under `"nodeModulesDir": "none"` (or `auto`), a bare specifier that no import
  map or member claims, but that the nearest package.json declares, resolves
  into Deno's npm cache, as Deno serves it. Under `manual`, Deno's default
  beside a package.json, Deno demands node_modules and refuses otherwise, so
  nothing is answered and the compiler's own resolution stands.
- A package in Deno's npm cache that ships only JavaScript resolves to its
  cached @types twin, the file Deno type-checks against.

On a 46-config Deno workspace whose Node-style members declare their
dependencies in package.json, this is most of what was left unresolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor Author

The largest project end to end: the 46-config workspace (~950 TypeScript files).

  • Without libraries: first index 89 s, 733 MB graph (known_edge 28,544, callback_registered 8,536, multi_inferred 7,134). A one-file rebuild took 104 s.
  • With --library auto:
    • It staged the mirror plus 94 npm packages, most of them imported only by the workspace's example apps. The first index took 893 s, and the library IR alone was about 6.5 GB.
    • The rebuild then ran out of disk at the final VACUUM. It failed cleanly ("indexing the new graph failed, the graph that was there is untouched").
    • The new hint fired: "26 Deno dependency import(s) resolve to nothing".
    • The library volume is a discovery-scope question for large workspaces, not a resolution bug, so it isn't part of this PR.

@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 7f3b91c into 0.2.1 Oct 25, 2026
13 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the fix/deno-stress-redirects-ranges branch October 25, 2026 01:43
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