Skip to content
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

Yarn equivalent for "npm pack [package-name]"? #7101

Open
bitjson opened this issue Mar 11, 2019 · 3 comments
Open

Yarn equivalent for "npm pack [package-name]"? #7101

bitjson opened this issue Mar 11, 2019 · 3 comments

Comments

@bitjson
Copy link

bitjson commented Mar 11, 2019

I think this is a feature request, but maybe I'm just missing some documentation.

What is the current behavior?

yarn pack doesn't accept an argument. So yarn pack matches npm pack, but there doesn't seem to be a way to replicate npm pack [package-identifier] with Yarn.

What is the expected behavior?

You can see the npm-pack documentation here.

For anything that’s installable (that is, a package folder, tarball, tarball url, name@tag, name@version, name, or scoped name), this command will fetch it to the cache, and then copy the tarball to the current working directory as -.tgz, and then write the filenames out to stdout.

If the same package is specified multiple times, then the file will be overwritten the second time.

If no arguments are supplied, then npm packs the current package folder.

The --dry-run argument will do everything that pack usually does without actually packing anything. Reports on what would have gone into the tarball.

Does Yarn have some CLI method of fetching the gzipped tarball? My workaround is:
npm pack [identifier from yarn.lock]

I don't think Yarn needs to provide the same API as NPM here (especially because "pack" is a strange place to put a fetching function), but it would be helpful to have the option to pull the raw tarball out of Yarn without installing. Something like yarn fetch [identifier].

I'm on yarn version v1.13.0.

@arcanis
Copy link
Member

arcanis commented Mar 15, 2019

We don't have one, but it would be very easy to implement a plugin on the v2

@raDiesle
Copy link

I need this. I wonder why noone else reported here

@furryboffin
Copy link

has this ever been added? I'm switching a project from npm to yarn now. The old version uses npm pack dist/ to build the project into the /dist folder. What would be the current equivalent of this for yarn?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants