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

docs: use vitepress #3921

Merged

Conversation

marcalexiei
Copy link
Contributor

@marcalexiei marcalexiei commented Feb 15, 2024

Description

Use vitepressto build doc.

Motivation and Context

See associated issue: #3905

Usage examples

n/a

TODOs

  • Convert all docs
    • Guides
    • Concepts
    • Reference
    • Improve homepage
  • Update documentation unit tests
  • Add copyright in the footer? not needed
  • Be sure to run prettier on docs files when necessary
  • Update CONTRIBUTING.md with new docs commands
  • Automatic install via CI
  • Replace module.exports in examples with ESM examples

Nav changes

Guides

  • "Release" and "Upgrade commitlint" have been moved inside "Support"

  • new "Getting started" page inside Guides (contains shared item for "Local setup" and "CI setup")

References

Rules page has been divided into two pages:

  • Rules: contains the list of all rules
  • Rules configuration: contains all the information about the rule (section on the top of the old rule page)

API

New section with a single page for each package (format, lint, load and read)

Support

a new collapsible section named "Support" which contains section.
In the future will include more content like troubleshooting information (#3894)

"Attributions"

new section with previous "Attributions" from docs/README.md content

Page preview (WIP)

Home

image

Guides: Local setup

Screenshot 2024-02-15 at 20 45 21

References: Rules

image

@JounQin
Copy link
Contributor

JounQin commented Feb 16, 2024

I would recommend to use https://rspress.dev/

@marcalexiei
Copy link
Contributor Author

Pending discussion on #3905 (comment)

@marcalexiei marcalexiei force-pushed the feature/docs-vitepress branch 2 times, most recently from b1994cd to badf56c Compare February 17, 2024 10:12
@marcalexiei
Copy link
Contributor Author

I finished the main implementation of the docs using vitepress.
I will keep updating this PR description with the relevant changes I made.

Tip

If anyone want to take a look you can checkout this branch and try it locally and let me know what you think!
To run the server simply use yarn docs-dev.

@escapedcat, @JounQin if you have time I would like to hear any feedback!


@escapedcat, I have a question about automatic installation:

When opening "Actions" pages I see that a "pages build and deployment" workflow exists:
https://github.com/conventional-changelog/commitlint/actions/workflows/pages/pages-build-deployment

However Inside .github/workflows I haven't find any workflow file for it.

Probably there is some kind of magic that I'm missing here 😅.
There is any way I can see that code that runs this workflow so I can update it to use vitepress?

Just for reference this is the official vitepress deploy doc:
https://vitepress.dev/guide/deploy#github-pages

@escapedcat
Copy link
Member

That's all "Github pages magic":

image

Currently everything in docs gets deployed.
We can adjust this if necessary.

@marcalexiei
Copy link
Contributor Author

Thanks for the info.
When the new doc is completed we have to set "Build and deployment → Source" to "GitHub Actions":

image

The new doc requires a build step before is ready for deploy.

Anyway there is more job to do before this 😀


One last question: do you want to add a copyright in the footer?
In the current site there is none, however, since adding it is trivial let me know if you want it.

@escapedcat
Copy link
Member

One last question: do you want to add a copyright in the footer?

No need, I think we're good without, right?

@marcalexiei marcalexiei force-pushed the feature/docs-vitepress branch 2 times, most recently from 972136f to c67473b Compare February 22, 2024 20:13
@marcalexiei marcalexiei marked this pull request as ready for review February 22, 2024 20:13
@marcalexiei
Copy link
Contributor Author

I completed the doc update. PR description is updated with all relevant changes.

I added also the docs-deploy workflow to automatically deploy the docs on every push on master branch.

Let me know if other changes are needed 😉.


After merge GitHub Pages repo settings should be updated as described in my previous comment.

I never deployed pages on a custom domain so I'm not sure if other things should be update in the workflow / repository settings 😅.

.github/CONTRIBUTING.md Outdated Show resolved Hide resolved
@commitlint/rules/src/index.test.ts Outdated Show resolved Hide resolved
docs/concepts/shareable-config.md Outdated Show resolved Hide resolved
docs/concepts/shareable-config.md Outdated Show resolved Hide resolved
docs/guides/getting-started.md Outdated Show resolved Hide resolved
docs/reference/configuration.md Show resolved Hide resolved
docs/reference/configuration.md Show resolved Hide resolved
docs/reference/configuration.md Show resolved Hide resolved
docs/reference/examples.md Outdated Show resolved Hide resolved
docs/reference/rules-configuration.md Outdated Show resolved Hide resolved
docs/guides/getting-started.md Outdated Show resolved Hide resolved
@marcalexiei marcalexiei force-pushed the feature/docs-vitepress branch 3 times, most recently from 7e6135f to 81fea2a Compare February 23, 2024 13:07
@marcalexiei
Copy link
Contributor Author

I have applied all requested changes. Let me know if other changes are needed.

docs/api/lint.md Outdated Show resolved Hide resolved
docs/api/lint.md Outdated Show resolved Hide resolved
@marcalexiei
Copy link
Contributor Author

Thanks for your review @JounQin!

@marcalexiei
Copy link
Contributor Author

@escapedcat, if you don't have changes that needs to be applied, new documentation is ready for merge.

@marcalexiei
Copy link
Contributor Author

I just noticed that were many link pointing to the documentation with a conventional-changelog.github.io/commitlint domain.

I update all of them pointing to new the docs pages paths and to use commitlint.js.org domain.
I also removed some doc from single packages README.md and added reference to the docs pages and the associated md file used to generate it.

@escapedcat
Copy link
Member

Thanks for pulling this off @marcalexiei .
We can adjust missing links later on if we missed some.
@JounQin thanks for your feedback and review!

Will try to merge and deploy this soon.

@escapedcat escapedcat merged commit 41504fc into conventional-changelog:master Feb 25, 2024
6 checks passed
@escapedcat
Copy link
Member

Merged. Exciting. Let's hope for the best 🤞

@escapedcat
Copy link
Member

Had to update the branch-name, we're still on master :P
Looks great:
https://commitlint.js.org/

Thanks everyone! You keep this alive!

@escapedcat
Copy link
Member

@JounQin would create a new major release tomorrow if you're good with that.
I would expect some incoming issues/feedback :P

@JounQin
Copy link
Contributor

JounQin commented Feb 25, 2024

I would be glad for fixing any issues. 😁

@marcalexiei marcalexiei deleted the feature/docs-vitepress branch February 25, 2024 11:34
escapedcat pushed a commit that referenced this pull request Feb 27, 2024
* docs: use vitepress

* docs: update src docs references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants