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

[RRFC] Include gitHead when publishing from subdirectories #412

Open
iarna opened this issue Jul 13, 2021 · 3 comments
Open

[RRFC] Include gitHead when publishing from subdirectories #412

iarna opened this issue Jul 13, 2021 · 3 comments

Comments

@iarna
Copy link
Contributor

iarna commented Jul 13, 2021

Motivation ("The Why")

When publishing from workspaces, it is still desirable to have gitHead still set, for all the reasons it was desirable without them. (Specifically, that published packages can be correlated with a specific commit in the source repo.) This is described in terms of subdirectories and not workspaces because supporting this without requiring a workspace definition would allow monorepos that npm does not manage to still be published with gitHead. This is most commonly the case when pnpm is used as it calls npm publish from its own workspace folders under the hood.

Example

$ git init
$ mkdir packages
$ npm init -y
$ git add package.json
$ git commit -minitial
$ npm publish

How

Current Behaviour

Currently gitHead is read only if there is a .git folder in the same directory as the package.json

Desired Behaviour

npm should scan up the directory tree looking for a .git folder the same way git itself does.

References

  • n/a
@targos
Copy link

targos commented Jul 13, 2021

This would be helpful for Node's citgm tool 👍

@darcyclarke darcyclarke added the Agenda will be discussed at the Open RFC call label Jul 21, 2021
@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Jul 28, 2021
@wraithgar
Copy link
Member

This went out w/ npm v7.21.1

I will wait for confirmation this is working as requested before closing

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

No branches or pull requests

5 participants