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

chore: prepare v2.0.0-rc.1 release #7778

Merged
merged 6 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Docusaurus 2 Changelog

## 2.0.0-rc.1 (2022-07-14)

#### :bug: Bug Fix

- `docusaurus`
- [#7776](https://github.com/facebook/docusaurus/pull/7776) fix(core): swizzle --eject js should not copy theme .d.ts files ([@slorber](https://github.com/slorber))
- [#7750](https://github.com/facebook/docusaurus/pull/7750) fix(deploy): revert "feat(deploy): copy local git config to tmp repo (#7702)" ([@ghostsquad](https://github.com/ghostsquad))
- `docusaurus-plugin-sitemap`
- [#7774](https://github.com/facebook/docusaurus/pull/7774) fix(sitemap): complete gracefully when all pages have noIndex meta ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-classic`
- [#7771](https://github.com/facebook/docusaurus/pull/7771) chore: bump Infima to 0.2.0-alpha.42, fix a:hover link bug ([@slorber](https://github.com/slorber))
- [#7755](https://github.com/facebook/docusaurus/pull/7755) fix(theme-classic): validate options properly ([@Josh-Cena](https://github.com/Josh-Cena))
- [#7752](https://github.com/facebook/docusaurus/pull/7752) fix(theme-classic): fix Layout theme height CSS ([@LichLord91](https://github.com/LichLord91))
- `docusaurus-migrate`
- [#7766](https://github.com/facebook/docusaurus/pull/7766) fix(migrate): import siteConfig with file extension ([@Josh-Cena](https://github.com/Josh-Cena))
- `docusaurus-theme-search-algolia`
- [#7761](https://github.com/facebook/docusaurus/pull/7761) fix(algolia-search): test for canUseIntersectionObserver ([@RoiArthurB](https://github.com/RoiArthurB))

#### :nail_care: Polish

- `docusaurus-theme-translations`
- [#7762](https://github.com/facebook/docusaurus/pull/7762) chore(theme-translations): complete ko translations ([@anaclumos](https://github.com/anaclumos))

#### :memo: Documentation

- `docusaurus-plugin-content-docs`
- [#7706](https://github.com/facebook/docusaurus/pull/7706) docs: release process, versioning, breaking changes, public API surface ([@slorber](https://github.com/slorber))

#### :wrench: Maintenance

- `docusaurus-theme-classic`
- [#7777](https://github.com/facebook/docusaurus/pull/7777) refactor(theme): fix duplicate page metadata usage ([@slorber](https://github.com/slorber))
- [#7771](https://github.com/facebook/docusaurus/pull/7771) chore: bump Infima to 0.2.0-alpha.42, fix a:hover link bug ([@slorber](https://github.com/slorber))

#### Committers: 11

- Arthur Brugière ([@RoiArthurB](https://github.com/RoiArthurB))
- Bruce Song ([@recallwei](https://github.com/recallwei))
- Evan ([@DigiPie](https://github.com/DigiPie))
- Jeffrey Aven ([@jeffreyaven](https://github.com/jeffreyaven))
- Joshua Chen ([@Josh-Cena](https://github.com/Josh-Cena))
- Sunghyun Cho ([@anaclumos](https://github.com/anaclumos))
- Sébastien Lorber ([@slorber](https://github.com/slorber))
- The Nguyen ([@treoden](https://github.com/treoden))
- Wes McNamee ([@ghostsquad](https://github.com/ghostsquad))
- [@LichLord91](https://github.com/LichLord91)
- 凱恩 Kane ([@Gary50613](https://github.com/Gary50613))

## 2.0.0-beta.22 (2022-07-08)

#### :boom: Breaking Change
Expand Down
45 changes: 15 additions & 30 deletions admin/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Get access from the Docusaurus npm admins (@yangshun/@JoelMarcey).

You need publish access to **the main Docusaurus repository** (not a fork).

## npm
## NPM
slorber marked this conversation as resolved.
Show resolved Hide resolved

Publishing will only work if you are logged into npm with an account with publishing rights to the package.

Expand Down Expand Up @@ -57,7 +57,7 @@ yarn install
```sh
# This will build all the packages and publish them in a local Verdaccio npm registry
# and then initialize a new website in the `test-website` directory using those locally published packages
yarn test:build:website
yarn test:build:v2

# Now you can test the site in dev/prod mode
cd test-website
Expand All @@ -70,26 +70,15 @@ This local test step is optional because it will be run by the CI on your releas

### 3. Update the v2 changelog

The changelog uses GitHub labels to classify each pull request. Use the GitHub interface to assign each newly merged pull request to a GitHub label starting with `pr:`, otherwise the PR won't appear in the changelog.
The changelog uses GitHub labels to classify each pull request. Use the GitHub interface to assign each newly merged pull request to a GitHub label starting with `tag:`, otherwise the PR won't appear in the changelog.

Not all labels will appear in the changelog—some are designed not to. However, you should **always** label each PR, so that before release, we can do a quick scan and confirm no PR is accidentally left out. Here's a search query (pity that GH doesn't have wildcard queries yet):
[Check tags of all recently merged Pull-Requests](https://github.com/facebook/docusaurus/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+)

```
is:pr is:merged sort:updated-desc -label:"pr: breaking change","pr: new feature","pr: bug fix","pr: performance","pr: polish","pr: documentation","pr: maintenance","pr: internal","pr: dependencies","pr: showcase"
```

[Check tags of all recently merged Pull-Requests](https://github.com/facebook/docusaurus/pulls?q=is%3Apr+is%3Amerged+sort%3Aupdated-desc+-label%3A%22pr%3A+breaking+change%22%2C%22pr%3A+new+feature%22%2C%22pr%3A+bug+fix%22%2C%22pr%3A+performance%22%2C%22pr%3A+polish%22%2C%22pr%3A+documentation%22%2C%22pr%3A+maintenance%22%2C%22pr%3A+internal%22%2C%22pr%3A+dependencies%22%2C%22pr%3A+showcase%22)

Some general principles about the labeling process:

- "Will an average user be interested in this entry?" Items like "improve test coverage", "upgrade dependencies" can probably be left out (we have `pr: internal` and `pr: dependencies` for this). However, "pin GitHub actions to an SHA", "add visual testing infrastructure", etc., albeit internal, could be interesting to the user, and can be included in the "maintenance" section.
- "Will this change have tangible impact on the user?" A common case is when a PR implements a feature X, then there are immediately follow-up PRs that fix bugs or polish feature X. These follow-up PRs don't necessarily have to be in the changelog, and even if they alter the API, they are not breaking changes, because to an average user bumping their version, they will only see the new feature X as a whole. Make the entries atomic.

The `pr:` label prefix is for PRs only. Other labels are not used by the changelog tool, and it's not necessary to assign such labels to issues, only PRs.
The `tag:` label prefix is for PRs only. Other labels are not used by the changelog tool, and it's not necessary to assign such labels to issues, only PRs.

Generate a GitHub auth token by going to https://github.com/settings/tokens (the only permission needed is `public_repo`). Save the token somewhere for future reference.

Fetch the tags from GitHub (lerna-changelog looks for commits since last tag by default):
Fetch the tags from Github (lerna-changelog looks for commits since last tag by default):

```sh
git fetch --tags
Expand All @@ -114,22 +103,18 @@ yarn changelog --from v2.0.0-beta.0
### 4. Cut a new version of the docs

```sh
yarn workspace website docusaurus docs:version 2.0.0-beta.0
yarn workspace docusaurus-2-website docusaurus docs:version 2.0.0-beta.0
```

Test running the website with the new version locally.

To keep versions number small, delete the oldest version and add a link to it in `archivedVersions.json`.

Check [Netlify site deployments](https://app.netlify.com/sites/docusaurus-2/deploys) to pick a recent immutable deployment URL.

### 5. Create a Pull Request

You should still be on your local branch `<your_username>/<version_to_release>`

Make a commit/push, create a pull request with the changes.

Example PR: [#3114](https://github.com/facebook/docusaurus/pull/5098), using title such as `chore: prepare v2.0.0-beta.0 release`
Example PR: [#3114](https://github.com/facebook/docusaurus/pull/5098), using title such as `chore(v2): prepare v2.0.0-beta.0 release`

**Don't merge it yet**, but wait for the CI checks to complete.

Expand Down Expand Up @@ -164,22 +149,24 @@ npm access ls-packages
"@docusaurus/theme-live-codeblock": "read-write",
"@docusaurus/plugin-google-analytics": "read-write",
"@docusaurus/plugin-google-gtag": "read-write",
"@docusaurus/init": "read-write",
"@docusaurus/plugin-content-docs-legacy": "read-write",
"@docusaurus/plugin-ideal-image": "read-write",
"@docusaurus/types": "read-write",
"create-docusaurus": "read-write",
"docusaurus": "read-write",
"docusaurus-init": "read-write",
"stylelint-copyright": "read-write"
}
</pre>
</details>

It can happen that some accesses are not granted, as an admin might add you to the @docusaurus npm organization, but you don't have access to the packages that are not in that organization.
It can happen that some accesses are not granted, as an admin might add you to the @docusaurus NPM organization, but you don't have access to the packages that are not in that organization.

Please **double-check your permissions on these packages**, otherwise you'll publish a half-release and will have to release a new version.
Please **double-check your permissions on these 3 packages**, otherwise you'll publish a half-release and will have to release a new version.

```
"create-docusaurus": "read-write",
"docusaurus": "read-write",
"docusaurus-init": "read-write",
"stylelint-copyright": "read-write"
```

Expand All @@ -198,8 +185,6 @@ This command does a few things:

You should receive many emails notifying you that a new version of the packages has been published.

If above command fail (network issue or whatever), you can try to recover with `yarn lerna publish from-package`: it will try to publish the packages that are missing on npm.

Now that the release is done, **merge the pull request**.

### 7. Create a release on GitHub
Expand All @@ -218,7 +203,7 @@ Create a separate branch/PR and run `yarn examples:generate`

### 9. Notify people about new release (optional but desirable)

After new release, it is cool to notify our users about this in the Discord chat (`#announcements` channel) and write summaries on Twitter using the following templates.
After new release, it is cool to notify our users about this in the Discord chat (`docusaurus-users` channel) and write summaries on Twitter using the following templates.

For Discord:

Expand Down
10 changes: 5 additions & 5 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ const ArchivedVersionsDropdownItems = Object.entries(VersionsArchived).splice(
5,
);

// This probably only makes sense for the beta phase, temporary
function getNextBetaVersionName() {
const expectedPrefix = '2.0.0-beta.';
// This probably only makes sense for the alpha/beta/rc phase, temporary
function getNextVersionName() {
const expectedPrefix = '2.0.0-rc.';

const lastReleasedVersion = versions[0];
if (!lastReleasedVersion || !lastReleasedVersion.includes(expectedPrefix)) {
throw new Error(
'this code is only meant to be used during the 2.0 beta phase.',
'this code is only meant to be used during the 2.0 alpha/beta/rc phase.',
);
}
const version = parseInt(lastReleasedVersion.replace(expectedPrefix, ''), 10);
Expand Down Expand Up @@ -310,7 +310,7 @@ const config = {
})(),
versions: {
current: {
label: `${getNextBetaVersionName()} 🚧`,
label: `${getNextVersionName()} 🚧`,
},
},
},
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ When writing links in Markdown, you could either mean a _file path_, or a _URL p
- If the path has an `.md(x)` extension, Docusaurus would try to resolve that Markdown file to a URL, and replace the file path with a URL path.
- If the path has any other extension, Docusaurus would treat it as [an asset](../guides/markdown-features/markdown-features-assets.mdx) and bundle it.

The following directory structure may help you visualize this file -> URL mapping. Assume that there's no slug customization in any page.
The following directory structure may help you visualize this file URL mapping. Assume that there's no slug customization in any page.

<details>

Expand Down
Loading