1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00
denoland-deno/tests/integration
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
..
bench_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
bundle_tests.rs feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
cache_tests.rs chore: fix flaky net_listen_allow_localhost_4555 (#23726) 2024-05-07 17:21:56 +00:00
check_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
compile_tests.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
coverage_tests.rs fix(coverage): skip generating coverage json for http(s) scripts (#24008) 2024-05-28 20:25:46 +09:00
doc_tests.rs chore: update deno_doc (#24308) 2024-06-28 05:03:51 -07:00
eval_tests.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
flags_tests.rs feat: deprecate deno vendor (#22183) 2024-07-10 03:18:10 +02:00
fmt_tests.rs fix(publish): make include and exclude work (#22720) 2024-03-07 20:16:32 -05:00
info_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
init_tests.rs feat(init): use jsr specifier for @std/assert (#23073) 2024-03-27 18:51:52 +01:00
inspector_tests.rs fix(inspector): crash on "Debugger.setBlackboxPatterns" (#24204) 2024-06-14 23:52:21 +02:00
install_tests.rs feat(install): require -g / --global flag (#23060) 2024-03-27 23:45:57 +01:00
js_unit_tests.rs refactor(ext/tls): Implement required functionality for later SNI support (#23686) 2024-05-09 10:54:47 -06:00
jsr_tests.rs fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030) 2024-05-29 18:38:18 +00:00
jupyter_tests.rs refactor: remove custom utc_now in favor of chrono::Utc:now feature (#23888) 2024-05-23 13:59:11 +02:00
lint_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
lsp_tests.rs fix(lsp): do sloppy resolution for node-to-node imports in byonm (#24481) 2024-07-09 14:25:50 +01:00
mod.rs feat(serve): support --port 0 to use an open port (#23846) 2024-05-17 05:38:50 +00:00
node_compat_tests.rs fix(ext/node): dispatch beforeExit/exit events irrespective of listeners (#23382) 2024-04-16 13:45:41 +00:00
node_unit_tests.rs fix(node/assert): throws not checking error instance (#24466) 2024-07-08 21:28:39 +02:00
npm_tests.rs feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
pm_tests.rs fix(cli): avoid deno add and deno vendor errors when deno.json is empty (#23439) 2024-04-18 15:48:15 -04:00
publish_tests.rs chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
repl_tests.rs perf(repl): don't walk workspace in repl language server (#24037) 2024-05-29 21:31:09 +01:00
run_tests.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
serve_tests.rs fix: serve handler error with 0 arguments (#23652) 2024-05-17 18:05:19 +05:30
shared_library_tests.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
task_tests.rs feat(task): support running npm binary commands in deno.json (#23478) 2024-04-20 20:13:46 -04:00
test_tests.rs fix(cli/test): decoding percent-encoding(non-ASCII) file path correctly (#23200) 2024-05-28 13:34:57 +00:00
upgrade_tests.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
vendor_tests.rs feat: deprecate deno vendor (#22183) 2024-07-10 03:18:10 +02:00
watcher_tests.rs feat: npm workspace and better Deno workspace support (#24334) 2024-07-04 00:54:33 +00:00
worker_tests.rs refactor(tests): move worker_threads itests to spec tests (#23648) 2024-05-03 05:52:47 +00:00