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

Does not understand "files" starting with /; thinks files will be omitted #615

Closed
cspotcode opened this issue Jun 5, 2021 · 1 comment · Fixed by #682
Closed

Does not understand "files" starting with /; thinks files will be omitted #615

cspotcode opened this issue Jun 5, 2021 · 1 comment · Fixed by #682

Comments

@cspotcode
Copy link

Description

np erroneously warns that files will be omitted from the published package when package.json "files" entries start with /

Steps to reproduce

It reproduced when publishing https://github.com/cspotcode/tsimportlib

The package.json looks like this:

"files": [
  "/index.d.ts",
  "/index.js"
]

The logged warning:

? The following new files will not be part of your published package:
- index.d.ts
- index.js
Continue? Yes

The files were, indeed, published. https://unpkg.com/browse/[email protected]/

Expected behavior

np understands that files entries starting with a / indicate paths relative to the root of the package, and those files will be included.

Environment

np - 7.5.0
Node.js - 16.2.0
npm - 7.14.0
Git - 2.29.2
OS - Ubuntu 20.04.1 LTS (within WSL2 on Windows 10)

@rootwork
Copy link

I ran into this identical behavior; the items in my files were directories like /lib.

I thought I just wasn't understanding the files attribute somehow and was pulling my hair out until I chanced a publish and realized these items were in fact being included.

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.

3 participants