question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lerna pack <...args> to generate local tarballs

See original GitHub issue

Did a fair amount of searching within open & closed issues before opening this. If I have over looked something obvious please let me know.

Hi. Long time lurker, first time poster. Very comfortable with npm pack behavior:

$ npm pack
npm info it worked if it ends with ok
npm info using npm@6.4.1
npm info using node@v10.15.3
npm info lifecycle triple-beam@1.3.0~prepublish: triple-beam@1.3.0
npm info lifecycle triple-beam@1.3.0~prepare: triple-beam@1.3.0
npm info lifecycle triple-beam@1.3.0~prepack: triple-beam@1.3.0
npm info lifecycle triple-beam@1.3.0~postpack: triple-beam@1.3.0
npm notice 
npm notice 📦  triple-beam@1.3.0
npm notice === Tarball Contents === 
npm notice 878B  package.json    
npm notice 136B  .eslintrc       
npm notice 25B   .gitattributes  
npm notice 220B  .travis.yml     
npm notice 374B  CHANGELOG.md    
npm notice 1.1kB index.js        
npm notice 1.1kB LICENSE         
npm notice 689B  README.md       
npm notice 2.5kB test.js         
npm notice 616B  config/cli.js   
npm notice 538B  config/index.js 
npm notice 516B  config/npm.js   
npm notice 556B  config/syslog.js
npm notice === Tarball Details === 
npm notice name:          triple-beam                             
npm notice version:       1.3.0                                   
npm notice filename:      triple-beam-1.3.0.tgz                   
npm notice package size:  3.4 kB                                  
npm notice unpacked size: 9.2 kB                                  
npm notice shasum:        a595214c7298db8339eeeee083e4d10bd8cb8dd9
npm notice integrity:     sha512-XrHUvV5HpdLmI[...]qfAbEe/QMp2Lw==
npm notice total files:   13                                      
npm notice 
triple-beam-1.3.0.tgz
npm timing npm Completed in 343ms
npm info ok 

Looking for similar behavior in lerna. Don’t want to publish anything or increment any versions, just want to generate *.tgz files based on the current configs and CLI args passed in.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:26
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ghdoergelohcommented, Aug 2, 2022

This would be great for CI if you want to build the packages, run some other tests and only if they succeed deploy the packages.

I currently have an aws pipeline that first runs the main job to install dependencies, build TS, test, lint and so on. After this job in another job (other docker image) sonarscanner will check for bugs using the coverage from the container before. The last job should only publish the packages but to copy the whole folder with all installed dependencies from the first job as an artifact or to install and build the package again, does not seem so performant. Just copying all the ready build packages and only deploying those would be nice.

We do the versioning “manualy” with lerna version and let the pipeline just publish on a git tag (lerna publish from-git). So I would need something like lerna pack from-git.

Is there a workaround for this? Packing all and select the changed would be okay, but there is no simple way to check, which packaged changed like from-git does, as far as I see, but I might be wrong.

2reactions
gstvribscommented, Jun 8, 2020

A simple workaround that works for me, is by simple run npm pack inside of each package, like:

// packageA/package.json

"pack": "npm pack"

// monorepo/package.json

"lerna:pack": "lerna run pack",
"lerna:pack:changed": "lerna run pack --since"
Read more comments on GitHub >

github_iconTop Results From Across the Web

@lerna/get-packed - npm
Read contents of package tarball created by npm pack. ... Start using @lerna/get-packed in your project by running `npm i @lerna/get-packed` ...
Read more >
@lerna/list | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Why Lerna creates a lot of .tgz files at root project
I believe this happens when npm publish fails and lerna doesn't cleanup the tarballs generated by npm pack . If you drill into...
Read more >
A guide through The Wild Wild West of setting up a mono repo ...
The lerna run command will run in every package of the mono repo. --stream flag will display the build output in the terminal...
Read more >
Question: Issue with installing dependencies for PWA kit
lerna info lifecycle pwa-kit-create-app@0.10.0~prepare: ... /AppData/Local/Temp/pwa-template-tmp5KkMaG/mobify-platform-sdks/packages/pwa.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found