-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"build" scripts should be using "prepare" #519
Comments
|
edit I mistook part of the docs based on the lifecycle ordering. The docs do actually state that prepack will run when installing as a git dep. @fregante So if it is a viable alternative, what is the rationale for prepack over prepare (or vice versa)? |
Never mind, honestly it's a mess. I'm sure that the docs suggested using
The advantage of
So for the time being if you need git installs you'll have to keep using prepare. |
Hmmm, I'm now doubting my own sanity (or npm's). I was reasonably confident that |
Yup, it's not us, it's them. I just tested it:
❯ npm -v
6.14.8
❯ npm pack
> content-scripts-register-polyfill@2.0.0 prepare /Volumes/Base/Users/rico/Web/projects-modules/content-scripts-register-polyfill
> tsc --sourceMap false
npm notice
npm notice 📦 content-scripts-register-polyfill@2.0.0
npm notice === Tarball Contents ===
npm notice 1.1kB license
npm notice 3.0kB index.js
npm notice 1.1kB package.json
npm notice 2.5kB readme.md
npm notice 360B globals.d.ts
npm notice 49B index.d.ts
npm notice === Tarball Details ===
npm notice name: content-scripts-register-polyfill
npm notice version: 2.0.0
npm notice filename: content-scripts-register-polyfill-2.0.0.tgz
npm notice package size: 3.3 kB
npm notice unpacked size: 8.2 kB
npm notice shasum: 4f9696fc998a9e2b190ea7fbe33ef05d1726f32a
npm notice integrity: sha512-7nQqZ+Kla7/h9[...]0QjALvfEdxyiA==
npm notice total files: 6
npm notice
content-scripts-register-polyfill-2.0.0.tgz ❯ npm -v
7.0.14
❯ npm pack
npm notice
npm notice 📦 content-scripts-register-polyfill@2.0.0
npm notice === Tarball Contents ===
npm notice 360B globals.d.ts
npm notice 49B index.d.ts
npm notice 3.0kB index.js
npm notice 1.1kB license
npm notice 1.1kB package.json
npm notice 2.5kB readme.md
npm notice === Tarball Details ===
npm notice name: content-scripts-register-polyfill
npm notice version: 2.0.0
npm notice filename: content-scripts-register-polyfill-2.0.0.tgz
npm notice package size: 3.3 kB
npm notice unpacked size: 8.2 kB
npm notice shasum: 8dd0d6780e9398f754f3968d6ff63d7b8c083482
npm notice integrity: sha512-J8XN9lnVtULwi[...]bztQO1WmSHI+g==
npm notice total files: 6
npm notice
content-scripts-register-polyfill-2.0.0.tgz |
Also I just tried installing something from GitHub and:
The |
Closing since this is a choice that each project gets to make. For example, I often have |
Agreed that each project can make their own choice. My suggestion here is for the docs and examples to impart some knowledge. Many/most node devs I've encountered have no idea that there are OOTB lifecycle hooks tailor-made for "building". And so in the wild, most projects will define a The suggestion here is that the docs can model more useful defaults (since most devs will just copy/paste from these examples) and end up with a more useful package without realizing it. And the eagle-eyed might just learn something. |
Shouldn't all the examples be using the
prepare
script to build/bundle? That way packages are built correctly (and automatically) during packing, publishing, and when installed as git deps directly from github.The text was updated successfully, but these errors were encountered: