-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathpr-preview.mjs
More file actions
28 lines (25 loc) · 906 Bytes
/
pr-preview.mjs
File metadata and controls
28 lines (25 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env zx
import 'zx/globals';
import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
await cloneWcagActRules(config);
await generateProposedRulePages(config);
await generateexamples(config);
// const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
// await commitAndPush(config, commitMessage);
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
`;
}
async function generateexamples({ tmpDir, rulesDir, testAssetsDir }) {
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
--rulesDir "${rulesDir}" \
--testAssetsDir "${testAssetsDir}" \
--outDir "${tmpDir}" \
--proposed
`;
}