Commit graph

22 commits

Author SHA1 Message Date
David Sherret 4b7c6049ef
refactor: load bytes in deno_graph (#22212)
Upgrades deno_graph to 0.64 where deno_graph is now responsible for
turning bytes into a string. This is in preparation for Wasm modules.
2024-02-01 03:15:22 +00:00
David Sherret 7e72f3af61
chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
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
David Sherret 8f065a60e7
fix: improved using declaration support (#20959)
Upgrades to deno_ast 0.30.
2023-10-24 09:37:02 -04:00
David Sherret 306b51d772
fix(vendor): do not panic vendoring with jsxImportSource and no jsx files (#19837)
Closes #19833
2023-07-14 18:10:42 -04:00
David Sherret 2e7bcb422d
fix(vendor): support import mapped jsxImportSource (#19724)
Closes #16108
2023-07-05 12:43:22 -04:00
David Sherret cc406c8360
feat(vendor): support for npm specifiers (#19186)
We never properly added support for this. This fixes vendoring when it
has npm or node specifiers. Vendoring occurs by adding a
`"nodeModulesDir": true` property to deno.json then it uses a local
node_modules directory. This can be opted out by setting
`"nodeModulesDir": false` or running with `--node-modules-dir=false`.

Closes #18090
Closes #17210
Closes #17619
Closes #16778
2023-05-19 22:39:27 +00:00
David Sherret 50618fc0bc
fix(vendor): better handling of redirects (#19063)
Closes #17582
Closes #19057
2023-05-09 21:49:16 +00:00
David Sherret a6ca4d0d61
refactor: use deno_graph for npm specifiers (#17858)
This changes npm specifiers to be handled by deno_graph and resolved to
an npm package name and version when the specifier is encountered. It
also slightly changes how npm specifier resolution occurs—previously it
would collect all the npm specifiers and resolve them all at once, but
now it resolves them on the fly as they are encountered in the module
graph.

https://github.com/denoland/deno_graph/pull/232

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-22 14:15:25 -05:00
David Sherret b34e751a5b
refactor: make resolver required (#17783)
Makes the resolver required and prints a warning when vendoring and a
dynamic import can't be resolved.

Closes #16522
2023-02-15 11:30:54 -05:00
David Sherret b3e88e0681
refactor: deno_graph 0.43 upgrade (#17692) 2023-02-09 22:00:23 -05:00
David Sherret f5840bdcd3
chore: upgrade to Rust 1.67 (#17548)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-27 10:43:16 -05:00
David Sherret 10e4b2e140
chore: update copyright year to 2023 (#17247)
Yearly tradition of creating extra noise in git.
2023-01-02 21:00:42 +00:00
Sylvain Cau 9bb3ccbab2
fix(cli/vendor): handle assert type json during vendoring (#16059) 2022-09-27 14:01:43 -04:00
David Sherret 7a1a082876
perf: cache swc dependency analysis and don't hold onto ParsedSources in memory (#15502) 2022-08-22 12:14:59 -04:00
David Sherret 8f102e49c1
fix(vendor): existing import map with bare specifier in remote (#15390) 2022-08-04 09:39:14 -04:00
David Sherret 443041c23e
feat(vendor): support using an existing import map (#14836) 2022-06-14 10:05:37 -04:00
David Sherret d93b7627f0
fix(vendor): handle relative imports when mapped local folder name differs from remote's (#14465) 2022-05-23 12:49:28 -04:00
David Sherret 1fcecb6789
refactor: upgrade to deno_ast 0.15 (#14680) 2022-05-20 16:40:55 -04:00
David Sherret e099ddb87c
fix(vendor): do not panic on relative specifier with scheme-like folder name (#14453) 2022-05-02 09:07:41 -04:00
David Sherret 5d7e1229db
fix(vendor): do not add absolute specifiers to scopes (#13710) 2022-02-18 23:10:40 -05:00
David Sherret b98afb59ae
feat: deno vendor (#13670) 2022-02-16 13:14:19 -05:00