Open mysterycommand opened 3 years ago
I see that npm-packlist@3.0.0 landed in npm@8.1.0, but my in my repro repo (mysterycommand/multi-app-monorepo) I get the same result running either of npm pack -w apps/app-a
from the root, or simply npm pack
after cd apps/app-a
That is:
npm notice
npm notice 📦 @multi-app-monorepo/app-a@1.0.0
npm notice === Tarball Contents ===
npm notice 133B index.js
npm notice 705B package.json
npm notice === Tarball Details ===
npm notice name: @multi-app-monorepo/app-a
npm notice version: 1.0.0
npm notice filename: @multi-app-monorepo/app-a-1.0.0.tgz
npm notice package size: 500 B
npm notice unpacked size: 838 B
npm notice shasum: 4bd38bbbcc89e412082d48ef45849e53a3512f92
npm notice integrity: sha512-+sHhXSMqS8BCZ[...]SQ2k03Y7+FaWg==
npm notice total files: 2
npm notice
multi-app-monorepo-app-a-1.0.0.tgz
That last line (multi-app-monorepo-app-a-1.0.0.tgz
) appears to be the result of app a's prepare
script which is cd ../../pkgs/pkg-c ; npm run prepare
where pkg c's prepare
script is echo ${npm_package_name}
… which I guess now that I type it out makes sense. That environment variable must be set for the script of the "current" package, not the package in the current working directory.
Bringing this over from https://github.com/npm/feedback/discussions/582 per @MylesBorins direction (also, hi Myles!)
Following up on https://github.com/npm/rfcs/issues/463 and https://github.com/npm/rfcs/issues/470 (and the meeting notes here) … I'm a little unclear on the status of what's left to do here. I'm willing to help if I can!
There were a few action items created as part of that meeting:
Taking the second action item first, is that something I should take on? I think it might be blocked by the first item on the list because right now the suggested workaround (below) isn't working with npm@8 or npm@7 … yet?
Is there any eta on landing npm-packlist in the cli? I've created a demo repo here to test out the workaround and see if I could come up with a "hacky" implementation of running prepare scripts on local bundled deps, but currently when I run
npm pack --dry-run --json -w apps/app-a
in that repo, I get this output:I'd expect the package.json and index.js from pkgs/pkg-c to show up in the packed output of app-a (maybe under that
"bundled"
key?) … indeed I believe this is the point of the npm-packlist action item. Just wanting to make sure I'm not missing something.cc/ @isaacs who offered the workaround at the meeting and might have some ideas? 🤞