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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans for checking the files array or npmrc #7

Open
thetutlage opened this issue Sep 22, 2018 · 6 comments
Open

Any plans for checking the files array or npmrc #7

thetutlage opened this issue Sep 22, 2018 · 6 comments

Comments

@thetutlage
Copy link

thetutlage commented Sep 22, 2018

I am regular user of pkg-ok and loves it 馃槃

I try to be explicit about the files I publish to the npm using the files array or the .npmrc file. I have been bitten quite a few times, where as per pkg-ok the paths are correct, however, I forgot to add them to the files array.

I am checking to see if you have any plans to check the published files and then validate paths. Not only it makes sure that the path exists, it also makes sure that paths are also published to npm.

I am happy to work on this feature (only if you want to add it).

Thanks

@typicode
Copy link
Collaborator

Thanks @thetutlage :) glad you like it.

Not sure to know how files field relate to .npmrc? Could you point me to some docs?
Also a basic package.json and .npmrc examples would be helpful.

@Andarist
Copy link

Andarist commented Oct 6, 2018

Maybe the @thetutlage has meant the .npmignore rather than .npmrc, I'm not sure if latter can control what gets published to the registry.

@abraham
Copy link
Owner

abraham commented Mar 11, 2022

Maybe there is an npm JS API or npm publish --dry-run could be used to get the list of files that will be published and match against that.

@Andarist
Copy link

For reference - this is what got implemented in Preconstruct to validate this sort of a thing:
https://github.com/preconstruct/preconstruct/blob/50744cf58f9473c16e765e92c441a118a5b5b985/packages/cli/src/validate-included-files.ts#L8

@abraham
Copy link
Owner

abraham commented Mar 11, 2022

Nice. npm-packlist looks particularly useful.

@tommy-mitchell
Copy link

npm pack --dry-run --json shows which files will be packaged: sindresorhus/np#682

This could then be verified against the files list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants