mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 02:08:36 +02:00
1.9 KiB
1.9 KiB
Docusaurus is published as an npm package that can be installed via npm
or yarn
. Here is how you publish the package to npm:
Log in to npm
Publishing will only work if you are logged into npm with an account with admin rights to the package.
If you are not currently logged into npm locally:
npm adduser
- Enter username, password and associated email address
Publish
- Bump version number in
package.json
. - Update the changelog, including at the reference links at the bottom.
- Do this always, but particularly important if there were any
package.json
changes in this release:- If there is no
node_modules
directory in you local Docusaurus version, runyarn install
andnpm install
. - Run
yarn upgrade
to updateyarn.lock
andnpm update
to updatepackage-lock.json
.
- If there is no
- From the
website-1.x
directory, runnpm run docusaurus-version x.x.x
, where x.x.x is the same version number you updated to inpackage.json
. - Test your PR locally on a project that was created via these instructions.
- Submit your PR
- When your PR is merged, rebase to get the PR commit locally.
- Run
npm publish
What version should you use?
The version number should generally increase by some factor than the current one. You can check current version by looking in package.json
.
{
"name": "docusaurus",
"version": "1.0.0-alpha.41",
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git"
}
...
}
For the above example, you may want to bump the version to 1.0.0-alpha.42
or 1.0.0-beta.1
or 1.0.1
.
You can also see the full list of all published versions with npm show docusaurus versions --json
.