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

Remove entries from "publishConfig" when publishing. #4311

Closed
1 task
hyrious opened this issue Feb 9, 2022 · 0 comments · Fixed by #4334
Closed
1 task

Remove entries from "publishConfig" when publishing. #4311

hyrious opened this issue Feb 9, 2022 · 0 comments · Fixed by #4334
Milestone

Comments

@hyrious
Copy link

hyrious commented Feb 9, 2022

Describe the user story

Fields in package.json will be edited as publishConfig specified, I hope it can also delete those field when they are "used" since they are no longer meaningful.

Describe the solution you'd like

for (const key of PUBLISH_CONFIG_WHITELIST) {
  if (key in publishConfig) {
    pkg[key] = publishConfig[key]
    delete publishConfig[key]
  }
}
if (Object.keys(publishConfig[key]).length === 0) {
  delete pkg.publishConfig
}

Describe the drawbacks of your solution

What if someone need a field to exist at two places (both in top level and in publishConfig)? I haven't seen the meaning of this behavior.

Describe alternatives you've considered

Make it possible to apply a custom hook function to the package.json when publishing.

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

Successfully merging a pull request may close this issue.

2 participants