publishConfig does not overrides after "lerna publish"
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36.1k
- Forks
- 2.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 50
Description
Current Behavior
publishConfig does not overrides package.json fields after "lerna publish".
original
{
"main": "./src/index.ts",
"publishConfig": {
"main": "./dist/index.js"
}
}
uploaded on npm
{
"main": "./src/index.ts",
"publishConfig": {
"main": "./dist/index.js"
}
}
Expected Behavior
package.json should be overwritten and publishConfig should be removed
{
"main": "./dist/index.js",
}
Steps to Reproduce
- add "main" field in publishConfig different with original "main" field.
- run "lerna publish"
- install uploaded package on npm, and check its package.json
Failure Logs / Configuration
lerna.json
<!-- Please paste your `lerna.json` here -->
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Environment
System:
OS: macOS 12.1
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 16.14.0 - /private/var/folders/zr/3tkznhqs6sn26wsynpczk2pxz0g_by/T/xfs-a49a6c75/node
Yarn: 3.2.1 - /private/var/folders/zr/3tkznhqs6sn26wsynpczk2pxz0g_by/T/xfs-a49a6c75/yarn
Utilities:
Git: 2.32.1 - /usr/bin/git
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the package.json example and trace the lerna publish entry point to see how publishConfig is handled; the issue also includes an empty lerna.json section and no debug log. Reproduce with the listed three steps, then verify that the published package.json uses the publishConfig main value and omits publishConfig.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100