Commit 3f57d39
committed
feat(dlx): add @npmcli/arborist for dependency installation
Add Arborist to properly install package dependencies after extraction.
pacote.extract() only extracts the package tarball but does NOT install
dependencies. We must use Arborist to install dependencies for dlx packages.
Changes:
- Add @npmcli/arborist to build-externals config
- Add arborist type definitions and stub
- Use Arborist.buildIdealTree() and reify() after pacote extraction
- Configure arborist with same cache path as pacote for consistency
- Skip devDependencies (production-only, matching npx behavior)
This ensures dlx packages have their dependencies properly installed.
chore(deps): update tooling versions and add @npmcli/arborist
- Update pnpm: 10.21.0 → 10.22.0
- Update Node.js minimum: >=18 → >=22
- Add @npmcli/arborist@9.1.4 to devDependencies
- Add @yarnpkg/core@4.5.0 to devDependencies
- Update pnpm-lock.yaml with new dependencies
test: add @npmcli/arborist to external bundling tests
Add test validation for @npmcli/arborist in dist/external/ to ensure:
- Package is properly bundled (file exists and > 1KB)
- Package is not a stub re-export
- Package exports are correctly transformed
Follows the same pattern as existing @InQuirer module tests.
fix(dlx): prevent post-install scripts from running
Add ignoreScripts: true to Arborist options to prevent install and
post-install scripts from running during dlx package installation.
This is a security measure to prevent potentially malicious scripts
from executing during dependency installation.1 parent 76b0af4 commit 3f57d39
7 files changed
Lines changed: 249 additions & 18 deletions
File tree
- scripts/build-externals
- src
- external/@npmcli
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
| 683 | + | |
683 | 684 | | |
684 | 685 | | |
685 | 686 | | |
| |||
690 | 691 | | |
691 | 692 | | |
692 | 693 | | |
| 694 | + | |
693 | 695 | | |
694 | 696 | | |
695 | 697 | | |
| |||
0 commit comments