SimonAlling / userscripter

Create userscripts in a breeze!
https://www.npmjs.com/package/userscripter
MIT License
100 stars 10 forks source link

.gitignore not created by `userscripter init` #24

Closed SimonAlling closed 3 years ago

SimonAlling commented 4 years ago
$ userscripter init
$ ls -a .gitignore
ls: cannot access '.gitignore': No such file or directory
$ ls -a
.   metadata.ts  package.json  tsconfig.json          webpack.config.ts
..  .npmignore   src           tsconfig.webpack.json
SimonAlling commented 4 years ago

Seems like .gitignore is included in the tarball created by npm pack, but not in the actual directory created by npm install -g (e.g. ~/.npm/node_modules/lib/node_modules/userscripter/bootstrap).

SimonAlling commented 3 years ago

Turns out .gitignore is in a sense included in said directory, but it's automatically renamed to .npmignore.

SimonAlling commented 3 years ago

https://github.com/npm/npm/issues/3763 :upside_down_face:

SimonAlling commented 3 years ago

Interestingly, the behavior is different depending on how Userscripter is installed:

(Legend: template directory ends up with ❌ = .npmignore; ✅ = .gitignore.)

So it appears that it works as intended if no tarball is involved.

Possibly relevant: https://github.com/npm/npm/commit/2c6acb96c71c16106965d5cd829b67195dd673c7