This website is built using Docusaurus 2, a modern static website generator.
yarn
and node
are installed by default on devservers, but not on Macs. To
work on this site on Macs, add fbsource/xplat/third-party/node/bin
and
fbsource/third-party/yarn
to your PATH
.
The very first time:
$ yarn global add node-gyp
And if on Eden:
$ eden redirect add $PWD/node_modules bind
$ eden redirect add $PWD/build bind
Also on your first time, and potentially after each large rebase:
$ yarn install
Again, on your first time:
$ yarn generate
You will need to re-run this each time you want to see changes to generated
content, primarily the API docs. You can alternatively yarn generate_local
to
update generated content using a built-from-source buck2.
$ yarn start-fb
This command starts a local development server, and if on Mac, opens up a local browser window.
On a devserver, the window does not open for you, but you can head to https://devvmXX.foo.com:9094 in your browser. This requires lighthouse or VPN.
To get your changes reflected on the local server:
- For non-generated markdown content in the
docs/
directory, reload the page. - For generated markdown content, re-run
yarn generate
as above and reload the page. - For other changes to the site configuration, Ctrl+C and restart
yarn start
. Then, hard-reload the page (Ctrl+Shift+R).
To see the external versions of the page, do:
$ yarn start
If on a devserver, this will require manually setting up an SSH tunnel by running the following from your mac:
ssh -L 3000:localhost:3000 $DEVSERVER
In all cases, you'll need to be either on lighthouse or VPN for this to work.
You can perform a production build via yarn build
or yarn build-fb
. This
generates a static site into build/
. This site can be served via any static
site viewer - docusaurus has one built in that you can run via yarn serve
. As
of Oct 2024 this only works on Macs, not on devservers.
Iterating on the prod build is slower than on the local yarn start
server.
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
If you are using GitHub pages for hosting, this command is a convenient way to
build the website and push to the gh-pages
branch.