express-autodocs icon indicating copy to clipboard operation
express-autodocs copied to clipboard

Update .gitignore

Open KulkarniSuraj opened this issue 3 years ago • 15 comments

Adds more entries to .gitignore https://github.com/github/gitignore/blob/master/Node.gitignore

since node_modules was created before adding .gitignore it is still being tracked so node modules was deleted and then added to .gitignore

  • [x] bug fixes

  • [x] Enhancements

you can delete node_modules manually from your master branch

KulkarniSuraj avatar Oct 06 '20 15:10 KulkarniSuraj

I think it is mandatory to update, the node_modules in case of a GitHub action, I read this somewhere, can you please confirm it @KulkarniSuraj

prafulla-codes avatar Oct 06 '20 15:10 prafulla-codes

I have read that npm ci does fresh installation everytime the action is run and it is faster than npm install

KulkarniSuraj avatar Oct 06 '20 15:10 KulkarniSuraj

right now the git is tracking entire node modules and its subdirectories for a single commit and it also increases the size of project

KulkarniSuraj avatar Oct 06 '20 15:10 KulkarniSuraj

Gitignore already had node_modules right? So what's the point of adding the files individually to gitignore? Does adding files individually compared to the entire folder help in any way?

rahil1304 avatar Oct 06 '20 16:10 rahil1304

I have read that npm ci does fresh installation everytime the action is run and it is faster than npm install

npm ci is present in .github/workflows/node.js.yml it removes node_modules if already present refer to https://docs.npmjs.com/cli/ci.html

KulkarniSuraj avatar Oct 06 '20 16:10 KulkarniSuraj

Gitignore already had node_modules right? So what's the point of adding the files individually to gitignore? Does adding files individually compared to the entire folder help in any way?

node_modules were still being tracked

KulkarniSuraj avatar Oct 06 '20 16:10 KulkarniSuraj

Gitignore already had node_modules right? So what's the point of adding the files individually to gitignore? Does adding files individually compared to the entire folder help in any way?

node_modules were still being tracked

How was it being tracked? The .gitignore file had "node_modules" in it. So that means any changes to the node_modules folder was not being tracked by git.

rahil1304 avatar Oct 06 '20 16:10 rahil1304

Gitignore already had node_modules right? So what's the point of adding the files individually to gitignore? Does adding files individually compared to the entire folder help in any way?

node_modules were still being tracked

How was it being tracked? The .gitignore file had "node_modules" in it. So that means any changes to the node_modules folder was not being tracked by git.

I had same doubt. but node_modules was present even before .gitignore and I noticed that git was tracking the changes in node modules, I don't know why

KulkarniSuraj avatar Oct 06 '20 16:10 KulkarniSuraj

Gitignore already had node_modules right? So what's the point of adding the files individually to gitignore? Does adding files individually compared to the entire folder help in any way?

node_modules were still being tracked

How was it being tracked? The .gitignore file had "node_modules" in it. So that means any changes to the node_modules folder was not being tracked by git.

please refer to this commit https://github.com/Pika1998/express-autodocs/commit/ede0d78d6b2171e1d4adc0a0f251efce6005cca7

KulkarniSuraj avatar Oct 06 '20 16:10 KulkarniSuraj

Ok @KulkarniSuraj, you mean actions can run using npm ci, that way there is no need to track node_modules?

It would be great then, because it will reduce the size of the project considerably

prafulla-codes avatar Oct 06 '20 18:10 prafulla-codes

@Pika1998 As you mentioned earlier node_modules might be required for javascript actions many people are facing same problems with node_modules. until Github solves this problem we can use @vercel/ncc or some other utility like this which will compile all the code into single file which can be used by user. This approach is also mentioned on javascript action page Although this issue needs some more research I would like to know your thoughts on this

KulkarniSuraj avatar Oct 07 '20 15:10 KulkarniSuraj

Ok as of now let's stick with the node_modules, I will try to do some research on the approach you are talking about and get back to you 😃

prafulla-codes avatar Oct 07 '20 16:10 prafulla-codes

Ok as of now let's stick with the node_modules, I will try to do some research on the approach you are talking about and get back to you 😃

Yeah! sure we can work on this later

KulkarniSuraj avatar Oct 07 '20 16:10 KulkarniSuraj

I was also thinking of adding test/output to .gitignore because files in this folder are generated every time we run npm run dev I was going to add those commits to this pull request should I create separate pull request for that?

KulkarniSuraj avatar Oct 07 '20 16:10 KulkarniSuraj

@KulkarniSuraj that's a nice idea, please make it as a separate PR

prafulla-codes avatar Oct 08 '20 02:10 prafulla-codes