From f1ee387307057bc0f65df2865b7fbb56dc1d174d Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Sun, 31 Aug 2025 23:03:20 +0100 Subject: [PATCH 1/2] docs(contributing): add instructions to generate github token --- .github/CONTRIBUTING.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 621c05136696..c5d802f5dc0f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -13,10 +13,15 @@ Start by ensuring that you have Node.js installed and forking the repository: - Fork the **webpack.js.org** repo from [the main repository][2]. - `git clone && cd webpack.js.org` +Some operations in the build process require a GitHub token. To create and export one: + +- Go to [GitHub Personal Access Tokens](https://github.com/settings/personal-access-tokens) and generate a new token with the repo and workflow scopes. +- Export it in your terminal before running build or fetch commands: + Once you are in the project directory, run the following commands: - `yarn` to pull all dependencies. -- `yarn build` to create a production version of the site. +- `export GITHUB_TOKEN= yarn build` to create a production version of the site. - `yarn start` to develop on a local webpack-dev-server: [localhost:3000][3]. > NOTE: run `yarn fetch-repos` and then `yarn fetch` before running `yarn start` command for the first time From 2f5740a854ee7135c3faad7818ea1055b8b72ce4 Mon Sep 17 00:00:00 2001 From: Bruno Rodrigues Date: Sun, 12 Oct 2025 20:56:09 +0100 Subject: [PATCH 2/2] chore: add command fetch-all and update contributing docs --- .github/CONTRIBUTING.md | 14 +++++++++----- package.json | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c5d802f5dc0f..d4ab933ab3d6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -13,17 +13,21 @@ Start by ensuring that you have Node.js installed and forking the repository: - Fork the **webpack.js.org** repo from [the main repository][2]. - `git clone && cd webpack.js.org` -Some operations in the build process require a GitHub token. To create and export one: - -- Go to [GitHub Personal Access Tokens](https://github.com/settings/personal-access-tokens) and generate a new token with the repo and workflow scopes. -- Export it in your terminal before running build or fetch commands: +> To run the project, you must run scripts that download the website content from GitHub. +> To avoid hitting rate limits, you'll need to use your GitHub token. +> The build scripts (`fetch-repo` and `fetch:*` commands) use this token to retrieve repository data, +> including documentation, examples, and contributors. +> If you do not have one, you can create it on the [GitHub Personal Access Tokens page](https://github.com/settings/personal-access-tokens). Once you are in the project directory, run the following commands: - `yarn` to pull all dependencies. -- `export GITHUB_TOKEN= yarn build` to create a production version of the site. +- `GITHUB_TOKEN= yarn fetch-all` - Fetches all updated website content from GitHub. +- `yarn build` to create a production version of the site. - `yarn start` to develop on a local webpack-dev-server: [localhost:3000][3]. +**Note:** The `fetch` and `fetch-repos` commands must be run before building the site as they populate necessary data for the build process. + > NOTE: run `yarn fetch-repos` and then `yarn fetch` before running `yarn start` command for the first time - `yarn fetch` to retrieve external documentation/data. diff --git a/package.json b/package.json index 0638f85a813c..3de148cd413c 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "fetch": "run-p fetch:*", "fetch:readmes": "node src/utilities/fetch-package-readmes.mjs", "fetch:supporters": "node src/utilities/fetch-supporters.mjs", + "fetch-all": "run-s fetch-repos fetch", "prebuild": "npm run clean", "build": "run-s fetch-repos fetch content && webpack --config webpack.prod.mjs --config-node-env production && run-s printable content && webpack --config webpack.ssg.mjs --config-node-env production --env ssg", "postbuild": "npm run sitemap",