Skip to content

Add --allow-dirty flag#792

Closed
idleberg wants to merge 1 commit into
sindresorhus:mainfrom
idleberg:main
Closed

Add --allow-dirty flag#792
idleberg wants to merge 1 commit into
sindresorhus:mainfrom
idleberg:main

Conversation

@idleberg
Copy link
Copy Markdown

I have the feeling this will create some controversy, but hear me out. I'm fully aware that ignoring a dirty git state can introduce some unwanted behaviour; files that are not tracked could still end up in a published package, which likely nobody ever wants to happen. However, the situation is very different when working in a monorepo that contains multiple packages. A dirty state in package B would prevent package A being published. This flag helps working around that.

Let me know what you think or feel free to close this.

@sindresorhus
Copy link
Copy Markdown
Owner

Thanks for the PR. I understand the monorepo use case, but I am going to pass on this.

np intentionally requires a clean working tree because publishing should start from a known safe state, and a dirty tree can leak unexpected files or hide changes made during install and versioning. Monorepos are explicitly outside np's supported scope, so I do not want to add an escape hatch that weakens one of its main safeguards for that case.

For this workflow, the supported path is to release from a clean repo state before running np.

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.

2 participants