Open mhassan1 opened 2 years ago
This issue reproduces on master:
Error: expect(received).toContain(expected) // indexOf
Expected substring: "dist/node_modules/file2.js"
Received string: "➤ YN0000: dist/file1.js
➤ YN0000: package.json
➤ YN0000: Done in 0s 35ms
"
at module.exports (evalmachine.<anonymous>:15:16)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:57:13
at async executeInTempDirectory (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:18:16)
at async executeRepro (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/executeRepro.js:25:12)
at async ExecCommand.execute (/github/workspace/.yarn/cache/@arcanis-sherlock-npm-2.0.3-558f52b79f-286d94b96d.zip/node_modules/@arcanis/sherlock/lib/commands/exec.js:26:38)
at async ExecCommand.validateAndExecute (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Command.js:161:26)
at async Cli.run (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:74:24)
at async Cli.runExit (/github/workspace/.yarn/cache/clipanion-npm-2.0.0-rc.16-b9444aaf89-4061026d74.zip/node_modules/clipanion/lib/advanced/Cli.js:83:28)
👋any update? Would you accept a patch that fixes this bug?
Self-service
Describe the bug
yarn pack
always ignores nestednode_modules
directories, which is unexpected and inconsistent withnpm pack
.To reproduce
Environment
Additional context
I noticed this bug(?) when I was using
@rollup/plugin-typescript
with PnP. That plugin uses therequire.resolve('tslib')
path as the place to includetslib
in thedist
, so I ended up with adist
that looks like this:Even though it's a weird
dist
, it's a validdist
, butyarn pack
(withfiles: ["dist"]
inpackage.json
) excludes the files insidenode_modules
because of this line: https://github.com/yarnpkg/berry/blob/2460dba707187d649048ab96bcad2e1e58ed5558/packages/plugin-pack/sources/packUtils.ts#L32I don't see a way to tell
yarn pack
to include the nestednode_modules
using thefiles
configuration inpackage.json
;npm pack
includes everything in thedist
directory, including the nestednode_modules
.I found a workaround for my situation (to bundle
tslib
separately from the plugin so I can control the path), but I wanted to raise this as a bug(?), at least so someone else who runs into this might benefit from the writeup.I know it's not a goal for
yarn pack
to have parity withnpm pack
, but I was surprised by this behavior ofyarn pack
.