chore: removal of Docusaurus v1 code from master (it is now available on docusaurus-v1 branch) (#4902)

This commit is contained in:
Sébastien Lorber 2021-06-10 10:54:07 +02:00 committed by GitHub
parent df8a900f9c
commit b835aecaec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
463 changed files with 6 additions and 36940 deletions

View file

@ -176,8 +176,6 @@ yarn build:packages
yarn lerna publish 2.0.0-alpha.68 --exact
```
~~**Note**: The v1 packages will also be modified because it's part of the monorepo. It is not ideal but we will live with it for now.~~
This command does a few things:
- Modifies the versions of all the `package.json` in the repository to be `2.0.0-alpha.41` and creates a commit
@ -234,98 +232,3 @@ NOTE: most likely this last item will be relevant for each new release, so do no
https://github.com/facebook/docusaurus/releases/tag/%VER%
```
---
## Docusaurus 1
### IMPORTANT: v1 packages are now private:
**TLDR**: you need to mark them as public, publish, and mark them back as private
v1 packages have been marked as `private: true` on purpose. This is because lerna will publish ALL (v1+v2) packages with the lerna-publish command.
Unfortunately it seems there is no way to tell it to ignore v1 packages while publishing v2.
During a long time, we published all these packages using the `@next` dist tag: `yarn lerna publish 2.0.0-alpha.41 --dist-tag next --exact`. It caused problems because v2 packages will then all need @next during npm/yarn installs, confusing some users (https://github.com/facebook/docusaurus/issues/3755).
We made the v1 packages private so that lerna publish won't publish them, so that we can publish v2 packages under latest dist tag, without creating v1 upgrades that people will be notified abut.
### Updated v1 release process
Process reworked by @slorber at `1.14.6`, it may not be perfect yet:
Suppose we are at `v1.14.5`, and want to release `v1.14.6`:
- Assign appropriate `tag: xyz` labels to merged PRs
- Be on master (up-to-date): `git co master && git pull`
- Create a new branch: `git co -b slorber/release-1.14.6`
- Get the changelog from last release: `git fetch --tags && GITHUB_AUTH=<myToken> yarn changelog --from=v1.14.5`
- Update [CHANGELOG-1.x.md](https://github.com/facebook/docusaurus/blob/master/CHANGELOG-1.x.md), but remove the v2-related items manually.
- Run `yarn install`
- Version the docs: `yarn workspace docusaurus-1-website docusaurus-version 1.14.6`
- Test the v1 website locally: `yarn start:v1` + `yarn build:v1`
- Make the two v1 packages private: false
- Publish: `yarn workspace docusaurus-init publish --no-git-tag-version --new-version 1.14.6`
- Publish: `yarn workspace docusaurus publish --no-git-tag-version --new-version 1.14.6`
- Make the v1 package private: true
The release is now published. It's worth to test it by initializing a new v1 site:
```sh
mkdir my-v1-website
cd my-v1-website
npx docusaurus-init
cd website
yarn start
```
Finish the release:
- Commit: `git commit -am "chore(v1): release v1.14.6"`
- Push: `git push origin slorber/release-1.14.6`
- Run `git tag v1.14.6` (important: the tag is prefixed by **`v`**)
- Run `git push origin v1.14.6`
- Ensure you can run `yarn install` (it may fail and need to use v2 versions on the v1 packages...)
- Open a PR, and merge it
- Create the [new Github release](https://github.com/facebook/docusaurus/releases/new), paste the changelog
- The End
### Historical v1 release process
1. Bump version number in [`package.json`](https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-1.x/package.json).
1. Update the [CHANGELOG-1.x.md](https://github.com/facebook/docusaurus/blob/master/CHANGELOG-1.x.md), including at the reference links at the bottom.
1. Do this always, but particularly important if there were any `package.json` changes in this release:
1. If there is no `node_modules` directory in you local Docusaurus version, run `yarn install` and `npm install`.
1. Run `yarn upgrade` to update `yarn.lock` and `npm update` to update `package-lock.json`.
1. From the `website-1.x` directory, run `npm run docusaurus-version x.x.x`, where x.x.x is the same version number you updated to in `package.json`.
1. Test your PR locally on a project that was created via [these instructions](https://github.com/facebook/docusaurus/blob/master/admin/local-third-party-project-testing.md).
1. Submit your PR
1. When your PR is merged, rebase to get the PR commit locally
1. Run `npm publish`
1. Tag the commit with the new version prefixed with a `v` (e.g. `v1.19.0`) and push the tag to `master`
1. Go to https://github.com/facebook/docusaurus/releases/new
1. Under the "Tag version" field, look for the newly-created tag
1. Paste the CHANGELOG changes in the textarea below
1. Hit the green "Publish release" button
1. Profit! 💰
### 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`.
```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`.