-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Update website to use Docusaurus #4536
Update website to use Docusaurus #4536
Conversation
I know what the error is. I'll resolve and send an update to this this PR. The issue is the 'yarn build' script tries building the website, but looks for localized files and fails if they are missing. |
Codecov Report
@@ Coverage Diff @@
## master #4536 +/- ##
=======================================
Coverage 57.13% 57.13%
=======================================
Files 194 194
Lines 6565 6565
Branches 3 3
=======================================
Hits 3751 3751
Misses 2814 2814 Continue to review full report at Codecov.
|
.circleci/config.yml
Outdated
@@ -27,15 +27,18 @@ aliases: | |||
git config --global user.email "jest-bot@users.noreply.github.com" | |||
git config --global user.name "Website Deployment Script" | |||
echo "machine github.com login jest-bot password $GITHUB_TOKEN" > ~/.netrc | |||
# crowdin install start | |||
# install Docusaurus and generate file of English strings | |||
cd website && npm install && npm run write-translations && cd .. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we install the deps w yarn instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heck yeah! I'll swap that out now.
@thymikee Hi Mike, are you able to review and accept? |
I'll see what I can do! |
website/package.json
Outdated
"crowdin-upload": "crowdin-cli --config ../crowdin.yaml upload sources --auto-update -b master", | ||
"crowdin-download": "crowdin-cli --config ../crowdin.yaml download -b master" | ||
"crowdin-download": "crowdin-cli --config ../crowdin.yaml download -b master", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see crowdin-download
nor crowdin-upload
used anywhere – is this expected and somehow used implicitly?
Also, README.md
would use an update (e.g. port is outdated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard for me to test it, because I'm not sure how to fully set this up locally – I don't have access to config keys, which makes all requests to /en
et al. crash :<
website/pages/en/help.js
Outdated
|
||
const translate = require('../../server/translate.js').translate; | ||
|
||
// const siteConfig = require(process.cwd() + "/siteConfig.js"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
@@ -1,94 +0,0 @@ | |||
/* eslint-disable sort-keys */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we providing RRS feed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docusaurus doesn't have an RSS feature. I've made it a TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New PR includes updated Docusaurus with RSS/Atom feeds.
const Container = CompLibrary.Container; | ||
const GridBlock = CompLibrary.GridBlock; | ||
|
||
const translate = require('../../server/translate.js').translate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file generated somehow? It's deleted in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a file from Docusaurus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'd expect something like:
const {translate} = require('docusaurus/server');
but not sure how this thing works currently.
website/siteConfig.js
Outdated
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License headers need to be adjusted to MIT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't adjust any additional licenses at this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thymikee Great news Michał! Docusaurus is now licensed under MIT!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still bsd here though
website/siteConfig.js
Outdated
ogImage: 'img/opengraph.png', | ||
recruitingLink: 'https://crowdin.com/project/jest', | ||
algolia: { | ||
apiKey: '833906d7486e4059359fa58823c4ef56', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we expose Algolia API key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. This would be the same issue as you not having crowdin keys to test. I'll move the keys to Circle CI.
website/static/css/custom.css
Outdated
} | ||
|
||
@media only screen and (min-width: 1500px) { | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused media queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed them.
Impressive amount of deletions here 👍 |
@thymikee Please do another review. Hoping this update meets the expected standards! Preview -- https://build-mitsvvnzqs.now.sh/jest# |
@ericnakagawa I'm out for the weekend, but if I make some time, definitely have a look. Can I somehow build it locally? |
@orta Thanks for the catch. Latest push has matching footer info + logos. Here's a fresh build from my machine: https://build-qbmkjpokcg.now.sh (currently uploading on airplane WiFi) |
website/.gitignore
Outdated
@@ -0,0 +1,11 @@ | |||
node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a nested gitignore?
Loving it 😀 Only issue I found (other than the footer, which is fixed in latest commit) is that all the "Edit this doc" links 404 on github (they are missing the language). That might be fixed on the latest upload, it currently gives me 403. One other thing (not sure if issue or not) is that all the links in the sidebar includes the hash |
website/.gitignore
Outdated
@@ -1,4 +1,3 @@ | |||
node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the whole file, why not just stick the ignores you need in the root .gitignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimenB Ahh, I see. In event we ever break out the website into its own repo. For time being, I'll migrate the paths to the top level .gitignore
.
@SimenB I removed the line from .gitignore and updated the edit doc path to include As for the sidebar links going to |
Due to my current internet connection I am unable to troubleshoot the breaking CI test. |
The CI failure is just prettier it seems like. So a |
Only thing I could spot was the comment about the license, nothing else I noticed (either in the code or clicking through https://build-qbmkjpokcg.now.sh/jest) |
@SimenB Updated last file, also updated package.json to use latest docusaurus with MIT license throughout. |
website/siteConfig.js
Outdated
image: '/jest/img/logos/facebook.png', | ||
infoLink: 'https://code.facebook.com', | ||
pinned: true, | ||
caption: "Facebook", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your autoformat kicked in, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
Rebased and waiting for tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good 👍
Seeing as this PR moves all files out of |
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
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
Rebased again after docs updated. |
@SimenB Ah, I knew I had a reason for configuring it this way. I've rolled back the change. Rebased, and ran through lint fixer. We should be good to go! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
I have done a complete conversion of Jest's website to use Docusaurus.
Docusaurus provides all of the same features: crowdin integration, static page building, deployment to github, and algolia search.