deno/cli/tools
Nathan Whitaker c36a20f6bb
feat(run): resolve main module with workspace resolver (#29928)
Closes https://github.com/denoland/deno/issues/29897.
Closes https://github.com/denoland/deno/issues/14066.
Closes https://github.com/denoland/deno/issues/19955.

With this PR we'll attempt to resolve bare specifiers passed to `run` or
`serve` with the workspace resolver. This means you can run specifiers
that are defined in your import map/package.json.

If the specifier looks like a path (starts with `.`, or is an absolute
path) then we won't try to resolve it via the import map.

This does have the potential to break someone, in the case that you have
something like

```
{
  "imports": { "foo.ts": "./bar.ts" }
}
```

and you have a file named `foo.ts`, previously `deno run foo.ts` would
run `./foo.ts`, now we would run `./bar.ts`. I can't see a way around
that without doing an extra stat to see if the file exists, or deferring
this to module load time (which seems complex). I don't think many
people would hit that, and if someone does there's a simple fix – just
add `./` to the front.

From my benchmarking, this change has no effect on startup time
2025-06-27 19:14:30 -07:00
..
bench fix(bench): Make output table markdown compatible (#29532) 2025-06-24 11:27:42 +02:00
bundle feat(bundle): support text and bytes imports in bundle (#29908) 2025-06-26 22:39:58 +00:00
coverage feat(cli): add --coverage flag to deno run command (#29329) 2025-06-25 13:34:30 +02:00
doc feat(doc): add darkmode for HTML output (#28989) 2025-04-21 13:02:50 -07:00
init refactor: add deno_npm_installer crate (#29319) 2025-05-16 18:11:05 -04:00
installer fix(install/global): resolve bin name from npm packument (#29884) 2025-06-25 15:10:26 -04:00
jupyter feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
lint feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
pm feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
publish fix(check): don't detect tsconfigs with no deno.json/package.json or --no-config (#29925) 2025-06-27 22:09:55 +00:00
repl feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
run feat(run): resolve main module with workspace resolver (#29928) 2025-06-27 19:14:30 -07:00
test chore: use aws_lc_rs (#28244) 2025-06-19 01:07:00 -07:00
check.rs refactor(cli): extract TypeChecker to separate module (#28235) 2025-02-21 21:00:29 +00:00
clean.rs fix: load changed non-remote dynamic imports at runtime (#29413) 2025-05-26 21:38:51 +00:00
compile.rs feat(check): tsconfig "references", "extends", "files", "include" and "exclude" (#29843) 2025-06-26 21:17:07 +00:00
deploy.rs feat(cli): add --coverage flag to deno run command (#29329) 2025-06-25 13:34:30 +02:00
doc.rs feat(unstable): bytes and text imports (#29855) 2025-06-26 11:21:16 -04:00
fmt.rs fix(fmt/css): prefer collapsing font-family values (#29864) 2025-06-24 20:28:53 +00:00
info.rs feat(unstable): bytes and text imports (#29855) 2025-06-26 11:21:16 -04:00
mod.rs feat(bundle, unstable): bundling backed by esbuild (#29470) 2025-06-07 21:20:10 +02:00
serve.rs fix: allow specifying otel config in --env-file (#29240) 2025-05-11 21:09:52 -04:00
task.rs fix(task): wildcard match starts at the beginning (#29343) 2025-05-17 13:12:31 +02:00
upgrade.rs fix(upgrade): skip version comparison when upgrading (#29112) 2025-05-13 14:58:57 -04:00