1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/cli/lsp
Nathan Whitaker ce7dc2be92
feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487)
Adds support for running npm package lifecycle scripts, opted into via a
new `--allow-scripts` flag.

With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno
install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run
lifecycle scripts attached to the given packages.

Note at the moment this only works when `nodeModulesDir` is true (using
the local resolver).

When a package with un-run lifecycle scripts is encountered, we emit a
warning suggesting things may not work and to try running lifecycle
scripts. Additionally, if a package script implicitly requires
`node-gyp` and it's not found on the system, we emit a warning.

Extra things in this PR:
- Extracted out bits of `task.rs` into a separate module for reuse
- Added a couple fields to `process.config` in order to support
`node-gyp` (it relies on a few variables being there)
- Drive by fix to downloading new npm packages to test registry

---

TODO:
- [x] validation for allow-scripts args (make sure it looks like an npm
package)
- [x] make allow-scripts matching smarter
- [ ] figure out what issues this closes

---
Review notes:
- This adds a bunch of deps to our test registry due to using
`node-gyp`, so it's pretty noisy
2024-07-10 03:06:08 +00:00
..
testing chore: upgrade to rust 1.79 (#24207) 2024-06-14 17:10:57 +05:30
analysis.rs fix(lsp): strip .js before probing for valid import fix (#24188) 2024-06-12 22:22:57 +01:00
cache.rs fix(lsp): don't use global cache paths for scope allocation (#24353) 2024-06-28 18:18:21 +01:00
capabilities.rs chore(lsp): rename client-side command invocations (#22140) 2024-01-28 21:56:45 +00:00
client.rs refactor(lsp): cleanup partially locking methods (#23723) 2024-05-08 06:34:42 +01:00
code_lens.rs feat(lsp): ts language service scopes (#24345) 2024-06-26 23:47:01 +01:00
completions.rs fix: better handling of npm resolution occurring on workers (#24094) 2024-06-05 17:04:16 +02:00
config.rs feat(workspace): support object config (#24483) 2024-07-09 17:06:50 -04:00
diagnostics.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
documents.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
jsr.rs feat(lsp): workspace jsr resolution (#24121) 2024-06-10 17:03:17 +01:00
language_server.rs fix(workspace): better cli file argument handling (#24447) 2024-07-08 14:12:10 +00:00
logging.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
lsp_custom.rs fix(lsp): don't normalize urls in cache command params (#22182) 2024-01-30 17:17:34 +00:00
mod.rs perf(lsp): lock out requests until init is complete (#23998) 2024-05-29 01:26:43 +01:00
npm.rs refactor: remove PermissionsContainer in deno_runtime (#24119) 2024-06-06 23:37:53 -04:00
parent_process_checker.rs fix(lsp): use a dedicated thread for the parent process checker (#21869) 2024-01-09 11:36:03 -05:00
path_to_regex.rs chore: upgrade to rust 1.79 (#24207) 2024-06-14 17:10:57 +05:30
performance.rs refactor(lsp): cleanup partially locking methods (#23723) 2024-05-08 06:34:42 +01:00
README.md docs: fix broken deno manual link (#20667) 2023-09-25 14:09:27 +02:00
refactor.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
registries.rs refactor: remove PermissionsContainer in deno_runtime (#24119) 2024-06-06 23:37:53 -04:00
repl.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
resolver.rs feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
search.rs feat(lsp): jsr specifier completions (#22612) 2024-02-29 03:54:16 +00:00
semantic_tokens.rs perf(lsp): Cache semantic tokens for open documents (#23799) 2024-05-15 01:51:48 +00:00
text.rs fix(lsp): handle multiline semantic tokens (#23691) 2024-05-04 21:48:06 +01:00
tsc.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
urls.rs feat(lsp): multi deno.json resolver scopes (#24206) 2024-06-17 21:54:23 +01:00

Deno Language Server

The Deno Language Server provides a server implementation of the Language Server Protocol which is specifically tailored to provide a Deno view of code. It is integrated into the command line and can be started via the lsp sub-command.

This documentation has been moved to the Deno manual.