Skip to content

Commit 172c0b2

Browse files
authored
Update website to use Docusaurus (#4536)
* Adding a clean copy of Docusaurus Updating sidebar Modifying files into Docusaurus format Slight header logo CSS change Ignore translated files and build directory Proper file locations for Docusaurus Move blog files to Docusaurus preferred location, modified crowdin to output /docs to /translated_pages, updated siteConfig.js Eslinting Docusaurus files Ignoring website/blog pages Linter fixes * Updating Circle config to remove website test * Updating Circle config to auto-deploy website * Add @deltice's config changes before website build, skip yarn build step * Switch crowdin branch to master * Updating siteconfig to @deltice's file * Test crowdin branch * Switching Crowdin to master * Uses yarn to install, run, and deploy * Feedback fixes Switch to use process.env.VAR for algolia key Switching crowdin upload/download to use yarn Circle CI fix Adding a delay to crowdin Fixing prettier errors Updating crowdin command in circle ci config Path fix * Upgrading docusaurus to 1.0.0a40, adds an RSS/Atom feed * Update Docusaurus version * Updated footer to reflect current footer. Updated footer logo. * Fixes Edit this doc link, removes node_modules from .gitignore * Move .gitignore rules to top level * Updating license file in siteConfig to MIT, added new Docusaurus beta to package.json * Lint fix * Editing siteConfig.js to account for /docs not living in /docs/en
1 parent 5049651 commit 172c0b2

187 files changed

Lines changed: 760 additions & 6727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ aliases:
2727
git config --global user.email "jest-bot@users.noreply.github.com"
2828
git config --global user.name "Website Deployment Script"
2929
echo "machine github.com login jest-bot password $GITHUB_TOKEN" > ~/.netrc
30-
# crowdin install start
30+
# install Docusaurus and generate file of English strings
31+
cd website && yarn && yarn run write-translations
32+
# crowdin install
3133
sudo apt-get update
3234
sudo apt-get install default-jre
3335
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
3436
sudo dpkg -i crowdin.deb
35-
# crowdin install end
36-
crowdin --config crowdin.yaml upload sources --auto-update -b master
37-
crowdin --config crowdin.yaml download -b master
38-
cd website && GIT_USER=jest-bot npm run gh-pages
37+
sleep 5
38+
# translations upload/download
39+
yarn run crowdin-upload
40+
yarn run crowdin-download
41+
# build and publish website
42+
GIT_USER=jest-bot yarn run publish-gh-pages
3943
4044
version: 2
4145
jobs:
@@ -95,9 +99,6 @@ jobs:
9599
cd website
96100
yarn --no-progress
97101
- save-cache: *save-cache
98-
- run: |
99-
cd website
100-
yarn run test
101102
- deploy: *deploy
102103

103104
# Workflows enables us to run multiple jobs in parallel

.eslintignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ flow-typed/**
55
packages/*/build/**
66
packages/*/build-es5/**
77
types/**
8+
website/blog
89
website/build
910
website/node_modules
10-
website/core/metadata*.js
1111
website/i18n/*.js
12-
website/src/jest/docs
13-
website/src/jest/blog
12+
website/translated_docs
1413
!.eslintrc.js

.gitignore

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,52 +14,25 @@
1414
/packages/*/build-es5/
1515
/packages/*/coverage/
1616
/packages/*/node_modules/
17+
1718
/website/build
1819
/website/core/metadata*.js
1920
/website/node_modules
2021
/website/src/jest/blog
2122
/website/src/jest/docs
2223
/website/yarn.lock
2324

25+
/website/lib/core/metadata.js
26+
/website/lib/core/MetadataBlog.js
27+
/website/translated_docs
28+
/website/yarn.lock
29+
/website/node_modules
30+
2431
/website/i18n/*
2532
!/website/i18n/en.json
2633

27-
/website/src/jest/af
28-
/website/src/jest/ar
29-
/website/src/jest/ca
30-
/website/src/jest/cs
31-
/website/src/jest/da
32-
/website/src/jest/de
33-
/website/src/jest/el
34-
/website/src/jest/es-ES
35-
/website/src/jest/fa-IR
36-
/website/src/jest/fi
37-
/website/src/jest/fr
38-
/website/src/jest/he
39-
/website/src/jest/hu
40-
/website/src/jest/id-ID
41-
/website/src/jest/it
42-
/website/src/jest/ja
43-
/website/src/jest/ko
44-
/website/src/jest/mr-IN
45-
/website/src/jest/nl
46-
/website/src/jest/no-NO
47-
/website/src/jest/pl
48-
/website/src/jest/pt-BR
49-
/website/src/jest/pt-PT
50-
/website/src/jest/ro
51-
/website/src/jest/ru
52-
/website/src/jest/sk-SK
53-
/website/src/jest/sr
54-
/website/src/jest/sv-SE
55-
/website/src/jest/tr
56-
/website/src/jest/uk
57-
/website/src/jest/vi
58-
/website/src/jest/zh-Hans
59-
/website/src/jest/zh-Hant
60-
61-
/docs/*
62-
!/docs/en
34+
/website/translated_docs/*
35+
/website/build
6336

6437
coverage
6538
lerna-debug.log

crowdin.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
project_identifier_env: CROWDIN_PROJECT_ID
2-
api_key_env: CROWDIN_API_KEY
1+
project_identifier_env: CROWDIN_JEST_PROJECT_ID
2+
api_key_env: CROWDIN_JEST_API_KEY
33
base_path: "./"
44
preserve_hierarchy: true
55

66
files:
77
-
8-
source: '/docs/en/*.md'
9-
translation: '/docs/%locale%/%original_file_name%'
8+
source: '/docs/*.md'
9+
translation: '/website/translated_docs/%locale%/%original_file_name%'
1010
languages_mapping: &anchor
1111
locale:
1212
'af': 'af'

docs/en/CLI.md renamed to docs/CLI.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
id: cli
33
title: Jest CLI Options
4-
layout: docs
5-
category: API Reference
6-
permalink: docs/en/cli.html
7-
previous: configuration
8-
next: tutorial-react
94
---
105

116
The `jest` command line runner has a number of useful options. You can run `jest --help` to view all available options. Many of the options shown below can also be used together to run tests exactly the way you want. Every one of Jest's [Configuration](/jest/docs/configuration.html) options can also be specified through the CLI.
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
id: configuration
33
title: Configuring Jest
4-
layout: docs
5-
category: API Reference
6-
permalink: docs/en/configuration.html
7-
previous: jest-object
8-
next: cli
94
---
105

116
Jest's configuration can be defined in the `package.json` file of your project, or through a `jest.config.js` file or
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
id: expect
33
title: Expect
4-
layout: docs
5-
category: API Reference
6-
permalink: docs/en/expect.html
7-
previous: api
8-
next: mock-function-api
94
---
105

116
When you're writing tests, you often need to check that values meet certain conditions. `expect` gives you access to a number of "matchers" that let you validate different things.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
id: getting-started
33
title: Getting Started
4-
layout: docs
5-
category: Introduction
6-
permalink: docs/en/getting-started.html
7-
next: using-matchers
84
---
95

106
Install Jest using `npm`:
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
id: api
33
title: Globals
4-
layout: docs
5-
category: API Reference
6-
permalink: docs/en/api.html
7-
next: expect
84
---
95

106
In your test files, Jest puts each of these methods and objects into the global environment. You don't have to require or import anything to use them.
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
---
22
id: jest-object
33
title: The Jest Object
4-
layout: docs
5-
category: API Reference
6-
permalink: docs/en/jest-object.html
7-
previous: mock-function-api
8-
next: configuration
94
---
105

116
The `jest` object is automatically in scope within every test file. The methods in the `jest` object help create mocks and let you control Jest's overall behavior.

0 commit comments

Comments
 (0)