Skip to content

feat: added init-private option #8246

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

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

owlstronaut
Copy link
Contributor

Closes npm/statusboard#509

This pull request introduces a new --init-private flag to the npm init command, allowing users to set the private field in the package.json file by default.

@owlstronaut owlstronaut force-pushed the owlstronaut/init-private branch from 647f13b to eb99fca Compare April 21, 2025 22:10
@owlstronaut owlstronaut marked this pull request as ready for review April 22, 2025 14:46
@owlstronaut owlstronaut requested a review from a team as a code owner April 22, 2025 14:46
owlstronaut added a commit to npm/init-package-json that referenced this pull request Apr 23, 2025
npm/cli#8246

This pull request introduces support for an `init-private` configuration
option, allowing users to specify whether a package should be private by
default. It includes changes to the initialization logic and
corresponding test cases to ensure the feature works as expected.
@owlstronaut owlstronaut marked this pull request as draft April 24, 2025 15:04
@owlstronaut owlstronaut force-pushed the owlstronaut/init-private branch from 9a26950 to e531f17 Compare April 24, 2025 18:16
@owlstronaut owlstronaut marked this pull request as ready for review April 24, 2025 18:23
@owlstronaut owlstronaut force-pushed the owlstronaut/init-private branch from e531f17 to d06004b Compare April 24, 2025 18:52
@owlstronaut owlstronaut requested a review from wraithgar April 29, 2025 17:02
@owlstronaut
Copy link
Contributor Author

this is waiting on npm/init-package-json#327

wraithgar pushed a commit to npm/init-package-json that referenced this pull request May 5, 2025
@wraithgar wraithgar force-pushed the owlstronaut/init-private branch from 160413e to fae36f2 Compare May 5, 2025 15:57
@wraithgar
Copy link
Member

Landed npm/init-package-json#327 and amended the deps update to use the newest version. CI is still failing :/

@wraithgar
Copy link
Member

This is gonna take more work than what's in here, the code path that's failing is when no args are present, it goes directly to init-package-json without our isDefault code checks.

init-package-json itself is gonna have to have more logic in it for this, since it gets passed the config object itself, not flatOptions (sigh).

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

Successfully merging this pull request may close these issues.

feat(init): add new config to npm init for setting private value (ie. --init-private)
3 participants