Skip to content

docs: correct deno compile sloppy imports and pnpm workspace exclusion claims - #3435

Open
davidpavlovschi wants to merge 1 commit into
denoland:mainfrom
davidpavlovschi:docs/fix-sloppy-compile-and-pnpm-exclusions
Open

docs: correct deno compile sloppy imports and pnpm workspace exclusion claims#3435
davidpavlovschi wants to merge 1 commit into
denoland:mainfrom
davidpavlovschi:docs/fix-sloppy-compile-and-pnpm-exclusions

Conversation

@davidpavlovschi

@davidpavlovschi davidpavlovschi commented Aug 2, 2026

Copy link
Copy Markdown

Two pages state behavior that the current Deno CLI contradicts. Both statements
are the only place in the repo that makes the claim, so this is a prose-only fix
to those two spots.

1. deno compile does support sloppy imports

runtime/reference/cli/unstable_flags.md ends the --unstable-sloppy-imports
section with:

deno compile does not support sloppy imports.

Support landed in denoland/deno#27944 (feat(compile): support sloppy imports,
merged 2025-02-03, shipped in Deno 2.2) and denoland/deno#34569 added further
test coverage in 2026. Verified against Deno 2.9.2 with the exact foo.ts /
bar.ts snippet already on that page:

$ deno compile --unstable-sloppy-imports -o fooapp foo.ts
Check foo.ts
Compile foo.ts to fooapp

Embedded Files

fooapp
├── bar.ts (34B)
└── foo.ts (55B)

Files: 1.61KB
Metadata: 1.39KB
Remote modules: 12B

$ ./fooapp
Example

The same works through the config file ({"unstable": ["sloppy-imports"]}), and
without the flag the compile still fails, so the flag is doing the work. The
behavior predates the previous major release, so per AGENTS.md I did not add a
version marker.

2. pnpm workspace exclusions do have an equivalent

runtime/migrate/migrate_from_pnpm.md tells readers that Deno's workspace
field has no ** glob and no exclusions:

Exclusions are not supported. pnpm's !packages/excluded negation has no
equivalent in the workspace field […]

This contradicts the reference page in this same repo, which documents both
Recursive matching
and
Excluding members.
The reference page is the correct one. Verified on Deno 2.9.2 with a scratch
workspace containing packages/a, packages/b, packages/excluded:

  • With "workspace": ["packages/*", "!packages/excluded"], importing
    @acme/a and @acme/b resolves and prints a b, while importing
    @acme/excluded errors with Import "@acme/excluded" not a dependency and not in import map.
  • Dropping the ! line makes @acme/excluded resolve again, so the negation is
    what excludes it rather than an unrelated failure.
  • Listing the ! pattern before the wildcard behaves identically, so the fixed
    prose does not claim an ordering requirement. (The reference section says "an
    earlier pattern"; observed behavior on 2.9.2 is order-independent, so the
    guide says "another pattern" — the looser reference wording may deserve its
    own follow-up.)
  • "workspace": ["packages/**"] picks up packages/foo/sub, confirming the
    recursive glob works too.

Both bullets sit in the same two-item list, so I corrected them together and
pointed each at the reference section that enumerates the detail, following the
"guides teach, reference enumerates" rule in AGENTS.md.

Note: open PR #3383 touches migrate_from_pnpm.md too, but only a link on line
166 — no overlap with this hunk.

Checks

Per AGENTS.md, run against this branch on macOS with Deno 2.9.2:

  • deno fmt - clean (Checked 885 files, deno fmt --check passes)
  • deno test -A frontmatter_test.ts sidebar_test.ts -
    ok | 8 passed (646 steps) | 0 failed
  • deno task check:freshness -
    Freshness check passed: all changed pages have a fresh 'last_modified'.
  • deno task build:light - 1109 files generated, no broken links or invalid
    MDX; confirmed the new #excluding-members link resolves to a real anchor in
    the built workspaces page
  • deno lint - reports 172 pre-existing problems in TypeScript files; identical
    count on unmodified main, and this PR touches only markdown

last_modified is bumped to 2026-08-01 on both pages.

Disclosure

I prepared this change with an AI coding agent (Claude Code). The agent read the
two pages, ran every command quoted above against Deno 2.9.2 on my machine, and
wrote the prose. I have not independently audited the Deno source beyond the
linked upstream PRs and the CLI behavior reproduced above.

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