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

[DOCS] Question on .npmignore / files behavior for git dependencies in latest version #7335

Open
2 tasks done
cs-balazs opened this issue Apr 3, 2024 · 2 comments
Open
2 tasks done
Labels
Documentation documentation related issue Needs Triage needs review for next steps

Comments

@cs-balazs
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Enhancement, not another kind of Docs Enhancement.

  • This is a CLI Docs Enhancement.

Description of Problem

Considering a sample typescript project like this minimal example: https://github.com/cs-balazs/dummy-lib
When this repo is used as a git dependency in an npm project, after npm install, the build folder is not included in node_modules/dummy-lib. With version 10.2.4, it does appear in the folder, but with 10.5.0 it doesn't

With either of these changes, it works with 10.5.0:

  • Adding a files: ["./build/**/*"] in package.json
  • Removing src from .npmignore

I wanted to understand the reason behind this, but couldn't find the relevant change in the changelog, nor found a reason in the docs. The documentation of the files field states, that:

Certain files are always included, regardless of settings:

  • package.json
  • README
  • LICENSE / LICENCE
  • The file in the "main" field
  • The file(s) in the "bin" field

Which to me means, that in this case at least build/src/index.js should be there

I don't know if this is indeed a problem with the docs, or just my misunderstanding, I'm submitting this issue to find that out, and a reason on why this git dependency behavior changed

Potential Solution

No response

Docs URL

No response

@cs-balazs cs-balazs added Documentation documentation related issue Needs Triage needs review for next steps labels Apr 3, 2024
@adamraine
Copy link

I noticed this changed as well (nodejs/node#52382). I assume it's intentional because the new behavior seems more inline with the syntax rules of .gitignore.

That being said, I think this change could break certain packages without warning.

@cs-balazs
Copy link
Author

I noticed this changed as well (nodejs/node#52382). I assume it's intentional because the new behavior seems more inline with the syntax rules of .gitignore.

Yeah, I guess this is indeed the reason. It seems like this might be the related dependency change (not sure): npm/ignore-walk#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation documentation related issue Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

2 participants