np icon indicating copy to clipboard operation
np copied to clipboard

"Show files added since..." feature should ignore the `.github` directory

Open sindresorhus opened this issue 4 years ago • 13 comments

I keep getting:

? The following new files are not already part of your published package:
- .github/workflows/main.yml
Continue? (y/N)

Which is not useful.


// @bunysae

sindresorhus avatar Dec 23 '20 10:12 sindresorhus

It also showed a false-positive just now:

~/dev/oss/is-retry-allowed master
❯ np
? The following new files are not already part of your published package:
- index.test-d.ts
Continue? (y/N) y

iindex.test-d.ts is not in files in package.json.

sindresorhus avatar Dec 25 '20 12:12 sindresorhus

Another bug, I got this when publishing p-timeout just now (this commit https://github.com/sindresorhus/p-timeout/commit/e26f08d43fe0a8f58c169b60feaac863041e4e3e):

~/dev/oss/p-timeout master
❯ np
? The following new files are not already part of your published package:
-
Continue? (y/N)

sindresorhus avatar Dec 26 '20 10:12 sindresorhus

The last issue is caused by: https://github.com/sindresorhus/np/commit/3466903c8940d5bcbf12e17ac27e65f66e990d3b

sindresorhus avatar Dec 26 '20 13:12 sindresorhus

There is maybe a misunderstanding. The prompt shows the files, which are added to the git repository, but which are NOT added to the npm package. I assume you thought the prompt shows the files which are added to the git repository and which will be published in the npm package.

bunysae avatar Dec 26 '20 16:12 bunysae

The message is very misleading then.

The following new files are not already part of your published package:

This makes it sound like it's just a warning that a new file is added to the package, not that it's not going to be included in the package.

sindresorhus avatar Dec 26 '20 17:12 sindresorhus

Shouldn't we do both? For a new file, indicate that it will be included in the package, and if it will not, indicate that too. That way there's no way you accidentally include a file you don't want, and also no way to forget to include a file. That was the original intent of the feature.

sindresorhus avatar Dec 26 '20 17:12 sindresorhus

Can we close this it it is implemented? @sindresorhus @bunysae

dopecodez avatar Dec 31 '20 11:12 dopecodez

I don't think all the issues mentioned here are resolved.

sindresorhus avatar Dec 31 '20 22:12 sindresorhus

I'm also getting this for the .storybook directory, should it be ignored too?

nerdyman avatar Jan 02 '21 20:01 nerdyman

Maybe there should be a setting to add an array of directories to ignore.

Drarig29 avatar Jan 02 '21 20:01 Drarig29

I don't think it's worth having a setting for this. We can hard-code a list of common things. You should only be prompted about this once anyway.

sindresorhus avatar Jan 03 '21 10:01 sindresorhus

Just encountered this and I'm quite confused what it means and for me it's unclear what decision I'm actually making here.

➜ np prerelease --tag latest
? The following new files are not already part of your published package:
- src/core/collection.ts
Continue? (y/N) 

In my case, src is never ever part of the published package, as I am transpiling the TypeScript code to JavaScript code for the published package. Why does the prompt actually recommend N as answer here? What does this mean? :D

thasmo avatar Mar 26 '21 08:03 thasmo

@thasmo Can you try out https://github.com/sindresorhus/np/pull/595? It should be clearer there.

sindresorhus avatar Mar 26 '21 09:03 sindresorhus