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

Private root package prevents non-private subdirectory from being published #474

Closed
lukeggchapman opened this issue Dec 2, 2019 · 3 comments · Fixed by #483
Closed

Private root package prevents non-private subdirectory from being published #474

lukeggchapman opened this issue Dec 2, 2019 · 3 comments · Fixed by #483

Comments

@lukeggchapman
Copy link
Contributor

Description

We have a use case where we want to bundle up the types of a private package into a subdirectory with a cloned package.json and publish that to npm.

The problem is that even though the cloned nested package.json is not set to private, because the root package.json is private the publish task is skipped.

Steps to reproduce

  1. Create a package with the following file structure:
.
|-- dist
|    |-- package.json // private: false
|    `-- types.d.ts
|-- src
`-- package.json // private: true
  1. Run np --contents=dist from root dir.
  2. Observe np does everything but publish the package.

Expected behavior

The package in the subdirectory will be published.

Environment

np - 5.2.1
Node.js - 12.7.0
npm - 6.10.0
Git - 2.20.1
OS - OSX 10.14.6

@chinesedfan
Copy link
Collaborator

@lukeggchapman According to your root package.json, it is really not allowed to be published. You can try npm publish dist directly in the root folder. np should keep the same behavior with npm.

If npm works, feel free to remind me to reopen this issue.

@lukeggchapman
Copy link
Contributor Author

lukeggchapman commented Dec 3, 2019

@chinesedfan npm publish dist works from the root.
Right now I'm having to follow the np command with npm publish dist so it's not a huge issue. I'd just prefer that np handles it.

Happy to help add this too, just wanted to get a feel for what your thoughts are here before I start trying to solve it.

@chinesedfan
Copy link
Collaborator

@lukeggchapman Sure. PR welcome to make np checks the same package.json with npm.

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