From 38548c8a535f055b1965f2153f31db9790d906c7 Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 30 Mar 2026 15:48:20 -0700 Subject: [PATCH 1/3] Added the glossary page --- .github/scripts/wai-build.mjs | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/scripts/wai-build.mjs b/.github/scripts/wai-build.mjs index 5c8b18f953..2040f65213 100644 --- a/.github/scripts/wai-build.mjs +++ b/.github/scripts/wai-build.mjs @@ -2,24 +2,36 @@ import 'zx/globals'; import { config, cloneWcagActRules, commitAndPush } from './commons.mjs' +const ACT_TOOLS_PATH = process.env.ACT_TOOLS_PATH || './node_modules/act-tools'; + await cloneWcagActRules(config); await generateProposedRulePages(config); await generateexamples(config); +await generateGlossaryPage({ ...config, wcagActRulesDir: config.tmpDir }); const commitMessage = (await $`git log -1 --pretty=%B`).stdout; await commitAndPush(config, commitMessage); +async function generateGlossaryPage({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) { + await $`node ${ACT_TOOLS_PATH}/dist/cli/generate-glossary.js \ + --rulesDir "${rulesDir}" \ + --glossaryDir "${glossaryDir}" \ + --testAssetsDir "${testAssetsDir}" \ + --outDir "${tmpDir}" + `; +} + async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) { - await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \ - --rulesDir "${rulesDir}" \ - --glossaryDir "${glossaryDir}" \ - --testAssetsDir "${testAssetsDir}" \ - --outDir "${tmpDir}" \ - --proposed + await $`node ${ACT_TOOLS_PATH}/dist/cli/rule-transform.js \ + --rulesDir "${rulesDir}" \ + --glossaryDir "${glossaryDir}" \ + --testAssetsDir "${testAssetsDir}" \ + --outDir "${tmpDir}" \ + --proposed `; } async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) { - await $`node ./node_modules/act-tools/dist/cli/build-examples.js \ + await $`node ${ACT_TOOLS_PATH}/dist/cli/build-examples.js \ --rulesDir "${rulesDir}" \ --testAssetsDir "${testAssetsDir}" \ --outDir "${tmpDir}" \ From ab43436ddcd07830b9395a3944f108f2dfad5117 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 31 Mar 2026 09:47:02 -0700 Subject: [PATCH 2/3] Separated the build and deploy steps to avoid accidental commits to the w3c repo --- .github/scripts/push-wai.js | 6 ++++++ .github/scripts/wai-build.mjs | 4 +--- .github/workflows/wai-deploy.yml | 4 +++- package.json | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .github/scripts/push-wai.js diff --git a/.github/scripts/push-wai.js b/.github/scripts/push-wai.js new file mode 100644 index 0000000000..15803cbdb5 --- /dev/null +++ b/.github/scripts/push-wai.js @@ -0,0 +1,6 @@ +#!/usr/bin/env zx +import 'zx/globals' +import { config, commitAndPush } from './commons.mjs' + +const commitMessage = (await $`git log -1 --pretty=%B`).stdout +await commitAndPush(config, commitMessage) diff --git a/.github/scripts/wai-build.mjs b/.github/scripts/wai-build.mjs index 2040f65213..c2c20ee57d 100644 --- a/.github/scripts/wai-build.mjs +++ b/.github/scripts/wai-build.mjs @@ -1,6 +1,6 @@ #!/usr/bin/env zx import 'zx/globals'; -import { config, cloneWcagActRules, commitAndPush } from './commons.mjs' +import { config, cloneWcagActRules } from './commons.mjs' const ACT_TOOLS_PATH = process.env.ACT_TOOLS_PATH || './node_modules/act-tools'; @@ -8,8 +8,6 @@ await cloneWcagActRules(config); await generateProposedRulePages(config); await generateexamples(config); await generateGlossaryPage({ ...config, wcagActRulesDir: config.tmpDir }); -const commitMessage = (await $`git log -1 --pretty=%B`).stdout; -await commitAndPush(config, commitMessage); async function generateGlossaryPage({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) { await $`node ${ACT_TOOLS_PATH}/dist/cli/generate-glossary.js \ diff --git a/.github/workflows/wai-deploy.yml b/.github/workflows/wai-deploy.yml index 214457d272..b5b12c4b40 100644 --- a/.github/workflows/wai-deploy.yml +++ b/.github/workflows/wai-deploy.yml @@ -31,5 +31,7 @@ jobs: git config --global url."https://${{ secrets.WAI_GIT_NAME }}:${{ secrets.WAI_GIT_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com" git config --global user.name "${{ secrets.WAI_GIT_NAME }}" git config --global user.email "${{ secrets.WAI_GIT_EMAIL }}" - - name: Build and deploy WAI update + - name: Build WAI update run: npm run build:wai + - name: Push WAI update + run: npm run push:wai diff --git a/package.json b/package.json index 5e37f27855..c9e7755a9d 100644 --- a/package.json +++ b/package.json @@ -178,6 +178,7 @@ "format": "prettier --write *.{json,md,js,html,css,yml} './{__tests__,_rules,.github,pages,test-assets,test-utils,utils}/**/*.{json,md,js,html,css,yml}'", "test": "jest --coverage", "build:wai": "zx .github/scripts/wai-build.mjs", + "push:wai": "zx .github/scripts/wai-push.mjs", "pr:preview": "zx .github/scripts/pr-preview.mjs" }, "homepage": "https://github.com/act-rules/act-rules.github.io", From ccba2d4822cad05bde343816058e721c2306a2af Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 31 Mar 2026 17:13:15 -0700 Subject: [PATCH 3/3] Fixed an issue with the Glossary nav link --- .github/scripts/wai-build.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/wai-build.mjs b/.github/scripts/wai-build.mjs index c2c20ee57d..6b7b82dfaa 100644 --- a/.github/scripts/wai-build.mjs +++ b/.github/scripts/wai-build.mjs @@ -7,7 +7,7 @@ const ACT_TOOLS_PATH = process.env.ACT_TOOLS_PATH || './node_modules/act-tools'; await cloneWcagActRules(config); await generateProposedRulePages(config); await generateexamples(config); -await generateGlossaryPage({ ...config, wcagActRulesDir: config.tmpDir }); +await generateGlossaryPage(config); async function generateGlossaryPage({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) { await $`node ${ACT_TOOLS_PATH}/dist/cli/generate-glossary.js \