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

refactor: rename Git master branch to main #5345

Merged
merged 12 commits into from Aug 17, 2021
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Expand Up @@ -39,7 +39,7 @@ This way we know you've done these steps first.

(A clear and concise description of what the bug is.)

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?

(Write your answer here.)

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Expand Up @@ -15,7 +15,7 @@ labels: 'feature, needs triage'

(A clear and concise description of what the feature is.)

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?

(Write your answer here.)

Expand Down
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -3,7 +3,7 @@ Thank you for sending the PR! We appreciate you spending the time to work on the

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md
You can learn more about contributing to Docusaurus here: https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md

Happy contributing!

Expand All @@ -13,7 +13,7 @@ Happy contributing!

(Write your motivation here.)

### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#pull-requests)?
### Have you read the [Contributing Guidelines on pull requests](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#pull-requests)?

(Write your answer here.)

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/canary-release.yml
Expand Up @@ -3,7 +3,7 @@ name: Canary Release
on:
push:
branches:
- master
- main
paths:
- 'packages/**'

Expand All @@ -26,7 +26,7 @@ jobs:
git config --global user.name "Docusaurus Canary"
git config --global user.email "canary@docusaurus.io"
git fetch
git checkout master
git checkout main
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
cat .npmrc
echo "npm whoami"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Expand Up @@ -3,7 +3,7 @@ name: Lint
on:
pull_request:
branches:
- master
- main

jobs:
lint:
Expand All @@ -15,8 +15,8 @@ jobs:
- name: Installation
uses: bahmutov/npm-install@v1
with:
install-command: yarn install
# install-command: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!)
install-command: yarn install
# install-command: yarn install --immutable # Fails if yarn.lock is modified (unfortunately only works for Yarn 2, and --frozen-lockfile is not the same!)
slorber marked this conversation as resolved.
Show resolved Hide resolved
- name: Check immutable yarn.lock
run: git diff --exit-code
- name: Lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/v2-build-blog-only.yml
Expand Up @@ -3,7 +3,7 @@ name: V2 Build Blog-only
on:
pull_request:
branches:
- master
- main
paths:
- 'website-1.x/blog/**'
- 'packages/docusaurus/**'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/v2-build-size-report.yml
@@ -1,4 +1,3 @@

name: V2 Build Size Report

on:
Expand All @@ -9,7 +8,7 @@ on:
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests
pull_request:
branches:
- master
- main
paths-ignore:
- 'website-1.x/**'
- 'packages/docusaurus-1.x/**'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/v2-build-time-perf.yml
Expand Up @@ -3,7 +3,7 @@ name: V2 Build Time Perf
on:
pull_request:
branches:
- master
- main
paths-ignore:
- 'website/docs/**'
- 'website-1.x/**'
Expand Down Expand Up @@ -31,5 +31,4 @@ jobs:
- name: Build (warm cache)
run: yarn workspace docusaurus-2-website build --locale en
timeout-minutes: 2

# TODO post a Github comment with build with perf warnings?
4 changes: 2 additions & 2 deletions .github/workflows/v2-lighthouse-report.yml
Expand Up @@ -3,7 +3,7 @@ name: V2 Lighthouse Report
on:
pull_request_target:
branches:
- master
- main
paths-ignore:
- 'website-1.x/**'
- 'packages/docusaurus-1.x/**'
Expand All @@ -25,7 +25,7 @@ jobs:
uses: treosh/lighthouse-ci-action@v3
with:
urls: |
https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/
https://deploy-preview-$PR_NUMBER--docusaurus-2.netlify.app/
configPath: ./.github/workflows/v2-lighthousesrc.json
uploadArtifacts: true
temporaryPublicStorage: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/v2-tests-e2e.yml
Expand Up @@ -3,10 +3,10 @@ name: V2 Tests E2E
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
paths-ignore:
- 'website-1.x/**'
- 'packages/docusaurus-1.x/**'
Expand All @@ -29,7 +29,7 @@ jobs:
uses: bahmutov/npm-install@v1
with:
install-command: yarn
- name: Generate test-website project against master release
- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:v2 -s
mv test-website ../test-website
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
install-command: yarn

- name: Generate test-website project against master release
- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:v2 -s
mv test-website ../test-website
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/v2-tests-windows.yml
Expand Up @@ -3,7 +3,7 @@ name: V2 Windows Tests
on:
pull_request:
branches:
- master
- main
paths-ignore:
- 'website-1.x/**'
- 'packages/docusaurus-1.x/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/v2-tests.yml
Expand Up @@ -3,7 +3,7 @@ name: V2 Tests
on:
pull_request:
branches:
- master
- main
paths-ignore:
- 'website-1.x/**'
- 'packages/docusaurus-1.x/**'
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -57,15 +57,15 @@ When a change made on GitHub is approved, it will be checked by our continuous i

### Branch Organization

Docusaurus has one primary branches `master` and we use feature branches with deploy previews to deliver new features with pull requests.
Docusaurus has one primary branch `main` and we use feature branches with deploy previews to deliver new features with pull requests.

## Bugs

We use [GitHub Issues](https://github.com/facebook/docusaurus/issues) for our public bugs. If you would like to report a problem, take a look around and see if someone already opened an issue about it. If you are certain this is a new, unreported bug, you can submit a [bug report](#reporting-new-issues).

If you have questions about using Docusaurus, contact the Docusaurus Twitter account at [@docusaurus](https://twitter.com/docusaurus), and we will do our best to answer your questions.

You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature%20request). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/master/.github/ISSUE_TEMPLATE/feature.md)
You can also file issues as [feature requests or enhancements](https://github.com/facebook/docusaurus/labels/feature%20request). If you see anything you'd like to be implemented, create an issue with [feature template](https://raw.githubusercontent.com/facebook/docusaurus/main/.github/ISSUE_TEMPLATE/feature.md)

## Reporting New Issues

Expand Down Expand Up @@ -125,14 +125,14 @@ Small pull requests are much easier to review and more likely to get merged. Mak

Please make sure the following is done when submitting a pull request:

1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `master`.
1. Fork [the repository](https://github.com/facebook/docusaurus) and create your branch from `main`.
1. Add the copyright notice to the top of any code new files you've added.
1. Describe your [**test plan**](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/master/admin/testing-changes-on-Docusaurus-itself.md)!
1. Describe your [**test plan**](#test-plan) in your pull request description. Make sure to [test your changes](https://github.com/facebook/docusaurus/blob/main/admin/testing-changes-on-Docusaurus-itself.md)!
1. Make sure your code lints (`yarn prettier && yarn lint`).
1. Make sure your Jest tests pass (`yarn test`).
1. If you haven't already, [sign the CLA](https://code.facebook.com/cla).

All pull requests should be opened against the `master` branch.
All pull requests should be opened against the `main` branch.

#### Test Plan

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -67,7 +67,7 @@ Facebook has adopted a Code of Conduct that we expect project participants to ad

### Contributing guide

Read our [contributing guide](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.
Read our [contributing guide](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Docusaurus.

### Beginner-friendly bugs

Expand Down
2 changes: 1 addition & 1 deletion admin/local-third-party-project-testing.md
@@ -1,4 +1,4 @@
Sometimes you want to test the latest version of Docusaurus on a third-party project via `npm` or `yarn` without having to publish it to npm itself. For example, you may want to use the latest code in `master`.
Sometimes you want to test the latest version of Docusaurus on a third-party project via `npm` or `yarn` without having to publish it to npm itself. For example, you may want to use the latest code in `main`.

> If you want to use Docusaurus to test Docusaurus, see the [testing changes on Docusaurus itself doc](./testing-changes-on-Docusaurus-itself.md)

Expand Down
2 changes: 1 addition & 1 deletion admin/new.docusaurus.io/functionUtils/playgroundUtils.ts
Expand Up @@ -13,7 +13,7 @@ const PlaygroundConfigs = {
codesandbox: 'https://codesandbox.io/s/docusaurus',

// stackblitz: 'https://stackblitz.com/fork/docusaurus', // not updated
// stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/master/examples/classic', // slow to load
// stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/main/examples/classic', // slow to load
stackblitz: 'https://stackblitz.com/github/facebook/docusaurus/tree/starter', // dedicated branch: faster load
};

Expand Down
6 changes: 3 additions & 3 deletions admin/publish.md
Expand Up @@ -30,13 +30,13 @@ If you're publishing new v2 versions, 2FA might get in the way as the pin might

### 1. Git setup

From the **master branch** (up to date, main repo, not a fork), create a new branch for the release.
From the **main branch** (up to date, main repo, not a fork), create a new branch for the release.

The branch name does not matter much, but you can use the `<your_username>/<version_to_release>` pattern.

```sh
# up to date master
git co master
# up to date main
git co main
git pull

# create a new release branch
Expand Down
6 changes: 3 additions & 3 deletions examples/README.md
Expand Up @@ -8,9 +8,9 @@ npx @docusaurus/init@latest init examples/<templateName> <templateName>`

You can run them in CodeSandbox:

- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/classic)
- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/bootstrap)
- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/master/examples/facebook)
- [classic](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/classic)
- [bootstrap](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/bootstrap)
- [facebook](https://codesandbox.io/s/github/facebook/docusaurus/tree/main/examples/facebook)

**Tip**: use the [new.docusaurus.io](https://new.docusaurus.io) shortcut.

Expand Down
5 changes: 2 additions & 3 deletions examples/bootstrap/docusaurus.config.js
Expand Up @@ -74,14 +74,13 @@ module.exports = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
},
],
Expand Down
5 changes: 2 additions & 3 deletions examples/classic/docusaurus.config.js
Expand Up @@ -91,14 +91,13 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
5 changes: 2 additions & 3 deletions examples/facebook/docusaurus.config.js
Expand Up @@ -126,14 +126,13 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
4 changes: 2 additions & 2 deletions generateExamples.js
Expand Up @@ -125,9 +125,9 @@ function updateStarters() {

function run() {
const branch = execSync('git rev-parse --abbrev-ref HEAD').toString();
if (branch === 'master') {
if (branch === 'main') {
throw new Error(
"Please don't generate Docusaurus examples from the master branch!\nWe are going to commit during this process!",
"Please don't generate Docusaurus examples from the main branch!\nWe are going to commit during this process!",
);
}
try {
Expand Down
Expand Up @@ -74,14 +74,13 @@ module.exports = {
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
},
],
Expand Down
Expand Up @@ -91,14 +91,13 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
Expand Up @@ -126,14 +126,13 @@ module.exports = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down
Expand Up @@ -24,7 +24,7 @@ const siteConfig = {
cname: 'docusaurus.io',
noIndex: false,
users,
editUrl: 'https://github.com/facebook/docusaurus/edit/master/docs/',
editUrl: 'https://github.com/facebook/docusaurus/edit/main/docs/',
headerLinks: [
{doc: 'installation', label: 'Docs'},
{doc: 'tutorial-setup', label: 'Tutorial'},
Expand Down