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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Node.gitignore to include VitePress #4543

Merged
merged 4 commits into from
Jan 6, 2025
Merged

Conversation

NdagiStanley
Copy link
Contributor

Include VitePress

Reasons for making this change:

I noticed that VuePress is included in the current gitignore. VuePress has been succeeded by VitePress. This change includes files to be ignored in a VitePress project.

Include VitePress
@wirecat
Copy link
Collaborator

wirecat commented Dec 6, 2024

@NdagiStanley could you provide some links to documentation supporting the change?
I just want to keep a good record that supports the change.
Thank you! 🙇

@caipeter888
Copy link

caipeter888 commented Dec 14, 2024

@wirecat The modification reference can be found in the official VitePress documentation here: https://vitepress.dev/guide/getting-started#file-structure

It mentions:

TIP

By default, VitePress stores its dev server cache in .vitepress/cache, and the production build output in .vitepress/dist. If using Git, you should add them to your .gitignore file. These locations can also be configured.

@caipeter888
Copy link

@NdagiStanley Please note that the VitePress temp and cache directory is .vitepress/cache, not .temp or .cache. It differs from the VuePress v2.x directories.

@NdagiStanley
Copy link
Contributor Author

@NdagiStanley Please note that the VitePress temp and cache directory is .vitepress/cache, not .temp or .cache. It differs from the VuePress v2.x directories.

You are right @caipeter888. I've updated the PR.

@caipeter888
Copy link

However, the .vitepress folder might not always appear in the root directory of the repository; it could be in a subdirectory like docs/.vitepress. I’m not sure if using .vitepress/cache and .vitepress/dist in the .gitignore file would correctly ignore the files in such cases. We might need to adjust the paths to handle different directory structures.

@NdagiStanley
Copy link
Contributor Author

NdagiStanley commented Dec 22, 2024

Good point @caipeter888
According to the .gitignore docs on pattern format, I should include **/.

That said, judging by how vuepress was handled, I believe the reasoning is to handle the default case and leave it to the developer who restructures the folders, to update the pattern.

I'll make the edit anyway.

Node.gitignore Outdated
# vuepress v2.x temp and cache directory
.temp
.cache

# vitepress temp and cache directory
**/.vitepress/temp
Copy link

@caipeter888 caipeter888 Dec 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line is unnecessary since the VitePress documentation does not mention using a temp folder. If I’ve missed something, please point it out. Otherwise, it seems safe to omit this line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.
In the Tip section of the docs here, it points to only cache and dist folders.

@Alongazhar

This comment was marked as off-topic.

@Alongazhar

This comment was marked as off-topic.

@wirecat
Copy link
Collaborator

wirecat commented Jan 6, 2025

Thank you to everyone for the contributions on this one!

@wirecat wirecat merged commit 4f5f531 into github:main Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants