1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

82 commits

Author SHA1 Message Date
David Sherret
84bafd11d5
fix: lazily surface errors in package.json deps parsing (#17974)
Closes #17941
2023-03-03 18:27:05 -04:00
David Sherret
033b70af19
fix(npm): lazily install package.json dependencies only when necessary (#17931)
This lazily does an "npm install" when any package name matches what's
found in the package.json or when running a script from package.json
with deno task.

Part of #17916

Closes #17928
2023-02-24 19:35:43 -05:00
David Sherret
6233c0aff0
fix(npm): support bare specifiers in package.json having a path (#17903)
For example `import * as test from "package/path.js"`
2023-02-23 17:33:23 +00:00
David Sherret
344317ec50
feat(npm): support bare specifiers from package.json in more subcommands and language server (#17891) 2023-02-23 10:58:10 -05: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
3479bc7661
fix(npm): improve peer dependency resolution (#17835)
This PR fixes peer dependency resolution to only resolve peers based on
the current graph traversal path. Previously, it would resolve a peers
by looking at a graph node's ancestors, which is not correct because
graph nodes are shared by different resolutions.

It also stores more information about peer dependency resolution in the
lockfile.
2023-02-21 12:03:48 -05:00
Bartek Iwańczuk
4d1a14ca7f
feat: auto-discover package.json for npm dependencies (#17272)
This commits adds auto-discovery of "package.json" file when running
"deno run" and "deno task" subcommands. In case of "deno run" the
"package.json" is being looked up starting from the directory of the
script that is being run, stopping early if "deno.json(c)" file is found
(ie. FS tree won't be traversed "up" from "deno.json").

When "package.json" is discovered the "--node-modules-dir" flag is
implied, leading to creation of local "node_modules/" directory - we
did that, because most tools relying on "package.json" will expect
"node_modules/" directory to be present (eg. Vite). Additionally 
"dependencies" and "devDependencies" specified in the "package.json"
are downloaded on startup. 

This is a stepping stone to supporting bare specifier imports, but
the actual integration will be done in a follow up commit.

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-20 19:14:06 +01:00
David Sherret
c4b9a91e27
refactor: use deno_graph's semver and npm structs (#17791) 2023-02-15 13:20:40 -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
b16a958c4f
fix(lsp): prevent crash analyzing module (#17642)
Closes #17640
2023-02-03 14:10:51 -05:00
David Sherret
fe11df09b1
fix(lsp): update document dependencies on configuration change (#17556) 2023-01-28 10:18:32 -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
Geert-Jan Zwiers
7f38f30a5c
refactor(lsp): fewer clones (#17551) 2023-01-26 23:24:03 +01:00
Bartek Iwańczuk
fc2e00152b
feat: support node built-in module imports (#17264)
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-24 09:05:54 -05:00
David Sherret
654e177c91
refactor(deno_graph): remove unused Resolved::Ok#kind usage (#17504)
See https://github.com/denoland/deno_graph/pull/205 for more details.
2023-01-24 08:23:19 -05:00
Geert-Jan Zwiers
e023a6e3f0
refactor(cli): fewer clones (#17450) 2023-01-16 15:27:41 -05:00
Bartek Iwańczuk
636352e0ca
fix(npm): allow to read package.json if permissions are granted (#17209)
This commit changes signature of "deno_core::ModuleLoader::resolve" to pass
an enum indicating whether or not we're resolving a specifier for dynamic import.

Additionally "CliModuleLoader" was changes to store both "parent permissions" (or
"root permissions") as well as "dynamic permissions" that allow to check for permissions
in top-level module load an dynamic imports.

Then all code paths that have anything to do with Node/npm compat are now checking
for permissions which are passed from module loader instance associated with given
worker.
2023-01-10 14:35:44 +01: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
David Sherret
423474caa8
fix(lsp/format): language formatter used should be based on language id (#17148)
Closes #11897
2022-12-20 15:19:35 -05:00
David Sherret
54d40e008a
perf(lsp): concurrent reads and exclusive writes (#17135) 2022-12-19 20:22:17 -05:00
linbingquan
f46df3e359
chore: update to Rust 1.66.0 (#17078) 2022-12-17 23:20:15 +01:00
Bartek Iwańczuk
435948e470
feat(repl): support npm packages (#16770)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-13 13:53:32 +01:00
David Sherret
3973ceb634
fix(npm): dependency types were sometimes not being resolved when package had no types entry (#16958)
Closes #16957
2022-12-05 20:09:31 -05:00
David Sherret
b1e29d1bd0
fix(npm): improve package.json exports support for types (#16880) 2022-11-30 23:07:32 +00:00
David Sherret
623dbe7a57
chore: remove unnecessary lifetimes (#16878)
It seems we don't really need to allow these clippy rules.
2022-11-30 19:19:32 +00:00
David Sherret
e2655c992e
fix(lsp): analyze fs dependencies of dependencies to find npm package requirements (#16866)
Closes #16867
2022-11-30 00:32:18 +00:00
David Sherret
2d4c46c975
refactor: create util folder, move nap_sym to napi/sym, move http_cache to cache folder (#16857) 2022-11-28 17:28:54 -05:00
Bartek Iwańczuk
630abb58b0
refactor: Combine ImportMapResolver and JsxResolver (#16508)
These resolvers are used in `deno_graph` APIs. Combining them removes a
lot of code and
unblocks me on https://github.com/denoland/deno/pull/16157
2022-11-02 15:47:02 +01:00
David Sherret
bcfe279fba
feat(unstable/npm): initial type checking of npm specifiers (#16332) 2022-10-21 15:20:18 +00:00
David Sherret
da906de184
fix(lsp): allow caching deps in non-saved files (#16353) 2022-10-20 13:23:21 -04:00
David Sherret
9e6917426a
fix: upgrade deno_ast to 0.19 (#15808) 2022-09-07 15:06:18 -04:00
Luca Casonato
33c4d45328
fix: resolve jsxImportSource relative to module (#15561)
Previously `jsxImportSource` was resolved relative to the config file
during graph building, and relative to the emitted module during
runtime.

This is now fixed so that the JSX import source is resolved relative to
the module both during graph building and at runtime.
2022-08-24 19:36:05 +02: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
Kitson Kelly
1c2ec1f48f
fix: update deno_graph to fix importing config as JSON module (#15388)
Ref: denoland/deno_graph#166
2022-08-10 07:27:22 +10:00
David Sherret
e1c90963fb
refactor: create args folder (#14982) 2022-06-27 16:54:09 -04:00
David Sherret
1fcecb6789
refactor: upgrade to deno_ast 0.15 (#14680) 2022-05-20 16:40:55 -04:00
David Sherret
eb5ffab1cb
fix(lsp): correct positions in some scenarios (#14359) 2022-05-15 14:41:37 -04:00
Jason
a6e4b4297d
refactor(lsp): migrate from lspower back to tower-lsp (#14163) 2022-04-03 14:17:30 +10:00
David Sherret
1c37ac3352
chore(tests): use custom temp dir creation for the tests (#14153) 2022-04-01 11:15:37 -04:00
David Sherret
53dac7451b
chore: remove all pub(crate)s from the cli crate (#14083) 2022-03-23 09:54:22 -04:00
David Sherret
e8c47755bb
chore(lsp): log more for "unexpected positions" lsp error (#13815)
Ref #13657
2022-03-03 08:06:38 +11:00
David Sherret
3b12afd072
chore: upgrade to Rust 1.59 (#13767) 2022-02-24 20:03:12 -05:00
Kitson Kelly
973fe6dd3a
refactor: remove dead code from lsp (#13743) 2022-02-24 08:01:20 +11:00
Kitson Kelly
26f5c223df
fix(lsp): properly display x-deno-warning with redirects (#13554)
Fixes: #13472
2022-02-02 13:04:26 +11:00
Kitson Kelly
7d356250e8
refactor: integrate deno_graph breaking changes (#13495)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-02-01 09:33:57 +11:00
David Sherret
0e12acc6ff
refactor(lsp): Documents - combine duplicate exists methods (#13479) 2022-01-25 09:21:59 -05:00
Kitson Kelly
1a3983a538
perf(lsp): improve some tsc op hot paths (#13473) 2022-01-24 19:01:33 +11:00
David Sherret
ad224f53c7
chore: upgrade to rust 1.58 (#13377) 2022-01-15 07:10:12 +01:00
Ryan Dahl
1fb5858009
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-07 22:09:52 -05:00