1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 12:58:54 -05:00
denoland-deno/cli/tools
David Sherret 890780a9e9
feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464)
Adds an `--unstable-sloppy-imports` flag which supports the
following for `file:` specifiers:

* Allows writing `./mod` in a specifier to do extension probing.
- ex. `import { Example } from "./example"` instead of `import { Example
} from "./example.ts"`
* Allows writing `./routes` to do directory extension probing for files
like `./routes/index.ts`
* Allows writing `./mod.js` for *mod.ts* files.

This functionality is **NOT RECOMMENDED** for general use with Deno:

1. It's not as optimal for perf:
https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-2/
1. It makes tooling in the ecosystem more complex in order to have to
understand this.
1. The "Deno way" is to be explicit about what you're doing. It's better
in the long run.
1. It doesn't work if published to the Deno registry because doing stuff
like extension probing with remote specifiers would be incredibly slow.

This is instead only recommended to help with migrating existing
projects to Deno. For example, it's very useful for getting CJS projects
written with import/export declaration working in Deno without modifying
module specifiers and for supporting TS ESM projects written with
`./mod.js` specifiers.

This feature will output warnings to guide the user towards correcting
their specifiers. Additionally, quick fixes are provided in the LSP to
update these specifiers:
2023-12-07 00:03:18 +00:00
..
bench refactor(cli): refactor bench/test for future module changes (#21460) 2023-12-05 09:26:06 -07:00
coverage refactor: unify CDP types in a single module (#21094) 2023-11-05 22:58:59 +00:00
init fix(init): skip existing files instead of erroring (#20434) 2023-09-12 12:55:26 +02:00
jupyter refactor: unify CDP types in a single module (#21094) 2023-11-05 22:58:59 +00:00
registry fix: error code used for duplicate version publish (#21457) 2023-12-04 15:19:01 +01:00
repl feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
run build(cli): allow to build without upgrade feature (#19910) 2023-11-29 18:52:25 +00:00
test refactor(cli): refactor bench/test for future module changes (#21460) 2023-12-05 09:26:06 -07:00
vendor feat(unstable): ability to resolve specifiers with no extension, specifiers for a directory, and TS files from JS extensions (#21464) 2023-12-07 00:03:18 +00:00
bundle.rs feat: deno run --unstable-hmr (#20876) 2023-10-31 01:25:58 +01:00
check.rs refactor(npm): break up NpmModuleLoader and move more methods into the managed CliNpmResolver (#20777) 2023-10-03 19:05:06 -04:00
compile.rs fix(compile/npm): ignore symlinks to non-existent paths in node_modules directory (#21479) 2023-12-06 16:25:24 -05:00
doc.rs feat(compile): support discovering modules for more dynamic arguments (#21381) 2023-12-01 20:12:10 +00:00
fmt.rs fix(fmt): "singleQuote": true should prefer single quote—not always use one (#21470) 2023-12-05 22:06:19 -05:00
info.rs fix: improve deno doc --lint error messages (#21156) 2023-11-10 18:40:39 +00:00
installer.rs fix(cli/installer): percent decode name (#21392) 2023-12-02 14:33:22 +01:00
lint.rs feat: deno run --unstable-hmr (#20876) 2023-10-31 01:25:58 +01:00
mod.rs feat(unstable): tar up directory with deno.json (#21228) 2023-11-23 23:38:07 +00:00
task.rs fix(task): handle node_modules/.bin directory with byonm (#21386) 2023-12-06 16:36:06 -05:00
upgrade.rs chore: add upgrade prompt integration test (#21273) 2023-11-23 16:20:40 +00:00