1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 01:59:06 -05:00
denoland-deno/tests/registry/npm/@denotest
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
..
add/1.0.0 feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
better-say-hello/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
bin fix(cli): Prefer npm bin entries provided by packages closer to the root (#24024) 2024-05-29 17:45:22 -07:00
binary-package/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
binary-package-linux/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
binary-package-mac/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
binary-package-windows/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
breaking-change-between-versions chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
builtin-module-module/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
CAPITALS/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
check-error/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
child-process-fork/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-default-export/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-internal-types-default-export/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-invalid-name-exports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-local-global-decls/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-module-export-assignment/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-module-export-assignment-number/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-pkg-imports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-reexport-collision/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-reexport-same-specifier-in-sub-folder/1.0.0 fix(node): better cjs re-export handling (#23760) 2024-05-10 09:55:20 -04:00
cjs-require-esm-error/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-this-in-exports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
cjs-with-file-stem/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
conditional-exports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
conditional-exports-strict/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
create-require/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
css-export/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
d-ext/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
dep-cannot-parse/1.0.0 fix(npm): resolve dynamic npm imports individually (#24170) 2024-06-11 08:55:12 -04:00
different-nested-dep/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
different-nested-dep-child chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
dual-cjs-esm/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
dual-cjs-esm-dep/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
dual-cjs-esm-dep-missing/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
dynamic-import/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
env-var-re-export/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
esm-basic/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
esm-import-cjs-default/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
file-dts-dmts-dcts/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
globals/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
imports-package-json/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
lossy-utf8-module/1.0.0 fix(ext/node): lossy UTF-8 read node_modules files (#24140) 2024-06-08 18:36:13 +02:00
lossy-utf8-package-json/1.0.0 fix(ext/node): lossy UTF-8 read node_modules files (#24140) 2024-06-08 18:36:13 +02:00
lossy-utf8-script/1.0.0 fix(ext/node): lossy UTF-8 read node_modules files (#24140) 2024-06-08 18:36:13 +02:00
MixedCase/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
monaco-editor/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
no-types-cjs/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
no-types-in-conditional-exports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
node-addon/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
node-addon-implicit-node-gyp/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
node-lifecycle-scripts/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
non-existent-dep/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
non-existent-dep-version/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
peer-dep-test-child chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
peer-dep-test-grandchild/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
peer-dep-test-peer chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
permissions-outside-package/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
require-added-nm-folder/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
require-resolve/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
reserved-word-exports/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
say-hello/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
say-hello-on-install/1.0.0 feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487) 2024-07-10 03:06:08 +00:00
special-chars-in-bin-name/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
sub-folders/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
subtract/1.0.0 feat(vendor): support modifying remote files in vendor folder without checksum errors (#23979) 2024-05-28 14:58:43 -04:00
tarballs-privateserver2/1.0.0 fix(npm): use configured auth for tarball urls instead of scope auth (#24111) 2024-06-05 21:24:52 +00:00
transitive-bin/1.0.0 fix(cli): Prefer npm bin entries provided by packages closer to the root (#24024) 2024-05-29 17:45:22 -07:00
types/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-ambient/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-entry-value-not-exists/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-exports-import-types/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-exports-subpaths/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-nested-js-dts/1.0.0 fix(cli): use CliNodeResolver::resolve() for managed node_modules (#23902) 2024-05-21 17:54:15 +01:00
types-no-types-entry/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types-pkg-json-import/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
types_imported/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00
typescript-file/1.0.0 chore(test): move npm registries to separate servers and to the tests/registry folder (#23717) 2024-05-07 01:06:01 +00:00