GovTechSG/oobee

Sitemap Scan Broken

Closed this issue · 5 comments

This did work historically, but now it seems to skip the pages and go right to producing a null report.

 % node cli.js -u https://www.tech.gov.sg/sitemap.xml  -c 1 -p 500 -k "CivicActions gTracker2:accessibility@example.com"
(node:24191) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

 Purple A11y version: 0.9.59 
 Starting scan... 
 Fetching URLs. This might take some time... 
 Fetch URLs completed. Beginning scan 
┌────────────────────────┐
│ No pages were scanned. │
└────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Report of this run is at a11y-scan-results.zip                  │
│ Results directory is at results/20240528_171104_www.tech.gov.sg │
└─────────────────────────────────────────────────────────────────┘
% 

We are on it

Hi @mgifford,

Please try the latest 0.10.0 which resolves the issue.

Now it's even more broken. After upgrading the git repo, git pull, I it failed. Realized looking again at the directory that the cli.js is now expected to be in a /dist/ directory which doesn't exist.

This is what I got loading from a fresh clone of the repo:

% npm install
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm WARN deprecated dommatrix@1.0.3: dommatrix is no longer maintained. Please use @thednp/dommatrix.
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead

added 776 packages, and audited 777 packages in 7s

169 packages are looking for funding
  run `npm fund` for details

1 high severity vulnerability

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
(base) mgifford@Mikes-Mac-Studio purple-a11y-singapore % ls
DETAILS.md			__mocks__			package-lock.json
Dockerfile			__tests__			package.json
INSTALLATION.md			eslint.config.js		scripts
INTEGRATION.md			exclusions.txt			src
LICENSE				gitlab-pipeline-template.yml	tsconfig.json
README.md			jest.config.js
SECURITY.md			node_modules
% npm run cli -- -c 1 -u https://www.tech.gov.sg/sitemap.xml -k "CivicActions gTracker2:accessibility@example.com"

> @govtechsg/purple-hats@0.10.0 cli
> node dist/cli.js -c 1 -u https://www.tech.gov.sg/sitemap.xml -k CivicActions gTracker2:accessibility@example.com

node:internal/modules/cjs/loader:1146
  throw err;
  ^

Error: Cannot find module '/Users/mgifford/Documents/GitHub/purple-a11y-singapore/dist/cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v21.5.0

I would have expeced these to be created with node install:

% ls dist
ls: dist: No such file or directory
% ls cli.js
ls: cli.js: No such file or directory

You will need to run npm run build first. What the command does is run tsc (TypeScript compiler) and outputs to dist/.

You will see a number of types errors when running npm run build, which we are working on fixing progressively. But it should not impede you from running Purple A11y.

You may also refer to the README.md. Hope this helps!

I needed to run npm install print-message but have a copy running. Thanks.