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
'lerna publish' doesn't respect publishConfig #404
Comments
Yarn, pnpm has its own packing logic, (via yarn pack, pnpm pack). |
As you found out, the code is the same as Lerna, I'm not really sure what to do this with this. You seem to have more knowledge, can you create a PR that would address your problem? Hopefully not too much code specific to each package manager, the less specific code, the more generic code, the better. |
I think best solution is getting tarballs by packageManager's own command. import {tempfile} from '@lerna-lite/core';
async function createTarball(npmClient: 'pnpm' | 'yarn' | 'npm', pkg: Package) {
const dir = tempfile();
switch (npmClient) {
case 'yarn':
await execa('yarn', ['pack', '--out', `${dir}/%s-%v.tgz`]);
default:
await execa(npmClient, ['pack', '--pack-destination', dir]);
}
return `${dir}/${getTarballName(pkg)}`;
} |
Lerna has always created all the package tarball by itself, they must have good reason to do it this way. They have However, I would rather try to avoid having package manager specific code, it's a lot less portable than generic code that works for all type of package managers. That's probably the reason they use the NoteAs a reminder, my main goal with this fork was to update all of Lerna's dependencies and fix all security related issues (I now use Renovate to update them once a week) and add some new features when possible. My main goal was achieved, however, I'm still learning the lib itself, there's still a lot of things that I don't quite understand and need help from the community (you for example) to understand how certain things work the way they do, so that we can improve when possible. |
@ghiscoding I agree. I reported an issue in original leran repo, so it will be better to wait for their action(or not). |
Describe the bug
'lerna publish' doesn't respect publishConfig in package.json.
When published to npm via lerna publish,
"main" in package.json should be same with publishConfig.main
(yarn pack does do that, at least)
but it doesn't change when using lerna publish
Expectation
"main" in package.json should be same with publishConfig.main
Reproduction
Lerna config and logs
lerna.json
<!-- Please paste your `lerna.json` here -->
lerna-debug.log
Environment Info
Used Package Manager
yarn >= 2.x
Validations
The text was updated successfully, but these errors were encountered: