gitignore icon indicating copy to clipboard operation
gitignore copied to clipboard

node.patch: Ignore /build/ directory from Docusaurus

Open rcdailey opened this issue 3 years ago • 1 comments

Pull Request

Thank you for contributing to @toptal/gitignore and https://www.gitignore.io.

New or update

Select the appropriate check box for this pull request. This helps when merging to ensure there are no conflicts with other templates or misunderstandings of how thee template list works.

New

  • [ ] Template - New .gitignore template
  • [ ] Composition - Template made from smaller templates
  • [ ] Inheritance - Template similar to an existing template
  • [X] Patch - Template extending functionality of existing template

Update

  • [ ] Template - Update existing .gitignore template

Details

When doing docusaurus build, the output gets placed in a build directory at the root of the repository. This directory should be ignored and not checked into version control.

rcdailey avatar Sep 19 '22 23:09 rcdailey

If you look in the core file from GitHub, they already have Docusaurus ignore patterns in there. I'm just locating it closest to that.

rcdailey avatar Sep 22 '22 12:09 rcdailey

Yep, I've noticed that they have Docusaurus ignore patterns, it would be great to create a new template in our repository specifically for Docusaurus - this way it would be safer to extend it. Basically we want to add a new template for Docusaurus users. So if a User would be using Docusaurus - he would get this template that you can add to his own .gitignore file. He can simply add it here after we'll implement it. Selection_034

deniskaber avatar Sep 30 '22 10:09 deniskaber

Ok I'll go ahead and start a template then. What do we do about the upstream patterns already included with Node? Do we just leave that there? Or is there a way to "subtract" changes from upstream ignore files in order to organize them all together?

rcdailey avatar Sep 30 '22 14:09 rcdailey

I went ahead and created the template as requested. Is there a way to indicate that Docusaurus also pulls in Node? I'm thinking this makes sense: If someone only builds a .gitignore using Docusaurus template, they probably also want most, if not all, of the Node ignore patterns as well since it's based on that technology.

rcdailey avatar Sep 30 '22 14:09 rcdailey

Hey @rcdailey! In order to pull Node content to Docusaurus, you would have to make it a "stack" over Node.

To achieve this, you should create an additional alias file that should point to Node.gitignore and it should be named Docusaurus.Node.stack.

deniskaber avatar Oct 10 '22 12:10 deniskaber

With respect, you previously instructed me to create a "template". And based on the very limited information provided in the README.md, this appeared to only require a *.gitignore file. No where until now was there a request to create a "stack". Nor do I see any documentation on how to do this.

The turnaround on this PR has been well over a week. I'm trying to make time in my schedule to respectfully provide the changes you need. I only ask that you try to provide more complete information regarding what you expect to be done in order to get this merged.

The instructions previously given feel incomplete to me. What contents should the Docusaurus.Node.stack file have? What about the Docusaurus.gitignore file I created; is it sufficient? Should it be deleted?

Are there better contributing docs somewhere that I've missed?

rcdailey avatar Oct 10 '22 13:10 rcdailey

Hello @rcdailey! Sorry for the long response.

I was referring to the main README file - https://github.com/toptal/gitignore/blob/master/README.md

Because you want to have Node content together with Docusaurus, we have to make it work as a stack.

Otherwise, your PR would be good to be merged. But in this case, a user would have to add both - Docusaurus and Node in the search field, like this: Screenshot 2022-10-12 at 15 35 06

Your suggestion makes a lot of sense, so let's do it in the most proper way.

  • Docusaurus.gitignore file should stay as you created it. It is correct.

  • You should also create a Docusaurus.Node.stack file which should be a link to the Node.gitignore file. Take a look on https://github.com/toptal/gitignore/blob/master/templates/MEAN.Node.stack as an example. You should be able to do this with: ln -s ./templates/Node.gitignore ./templates/Docusaurus.Node.stack

deniskaber avatar Oct 12 '22 12:10 deniskaber

Ok so a couple of things:

  1. I'm on Windows, not linux, so creating links with ln is not possible. I can of course try with mklink or something, but I'm not sure if Git will recognize that. Initially by "link" I thought you meant that Docusaurus.Node.stack would simply be a text file with the names of gitignore files, one per line.
  2. How do stack files get processed? For example, Docusaurus.Node.stack points to Node.gitignore; but how does the system know to also add Docusaurus.gitignore on top of that?
  3. A follow-on to to the previous point: I realize the README you linked exists; but it doesn't explain how stacks work. It's the only documentation I've been able to find, but it doesn't explain anything, especially knowledge contributors will need.

I appreciate your patience with me and being so instructive. I hate to pry detailed information out of you like this, since I know your time is just as valuable as mine. This is why I keep bringing up the documentation issue; that certainly deserves some improvement.

rcdailey avatar Oct 18 '22 21:10 rcdailey

Hey @rcdailey! I am merging this PR and then I will add needed stack files on top of it. Thanks for the contribution!

deniskaber avatar Oct 27 '22 16:10 deniskaber