-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Hi,
I use Pacote to install packages in electron during runtime. I just updated from 13.0.4 to 15.0.3 and one of my test cases now fails with the error: DirFetcher requires either a tree or an Arborist constructor to pack.
This test case takes a valid package (only package.json) from an existing folder and extracts it to the installation folder.
After looking in to your source code, I found that Arborist is now required for extracting a directory. Simply importing Arborist as a dependency and including it as an option in the extract call seems to solve my problem. However, I have no idea what this actually does. Is this the correct solution to my problem or will this cause other problems in production with other specifier types?
Expected Behavior
Calling extract with just a source dir as spec and destination dir as dest should successfully move a valid package from ./pluginsSrc to ./plugins.
Steps To Reproduce
- In a new npm project with pacoate as dependency, create a folder called pluginSrc and add a valid package.json in it.
- Create another folder in the test folder called pluginDest
- Execute the following js:
const { extract } = require("pacote")
extract('./pluginSrc', './ pluginDest')
Environment
- npm: 8.15.0
- Node: 16.17.0
- OS: Windows 10
- platform: ASUS Zenbook