Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/page-404.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import assert from "node:assert/strict";
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
import { dirname, join, relative } from "node:path";
import { fileURLToPath } from "node:url";
import { SKIP_DIRS } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

function attrs(tag) {
const out = {};
Expand Down
1 change: 0 additions & 1 deletion scripts/page-csp.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { htmlFiles } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

// Script types the browser never executes; CSP script-src does not apply.
const DATA_SCRIPT_TYPES = new Set(["application/ld+json", "application/json", "importmap"]);
Expand Down
1 change: 0 additions & 1 deletion scripts/page-images.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { htmlFiles, isRedirectPage, lineOf } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);
const ASSET_DIR = join(ROOT, "assets");
const IMAGE_EXT_RE = /\.(?:png|jpe?g|gif|webp|svg|ico)$/i;
// Declared width/height may be rounded from a non-integer intrinsic ratio
Expand Down
1 change: 0 additions & 1 deletion scripts/page-markup.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { htmlFiles, isRedirectPage, lineOf } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

// Attributes whose value is one or more whitespace-separated id references.
const IDREF_ATTRS = ["aria-controls", "aria-labelledby", "aria-describedby", "aria-owns", "aria-activedescendant", "for"];
Expand Down
3 changes: 1 addition & 2 deletions scripts/page-meta.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import assert from "node:assert/strict";
import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
import { dirname, join, relative, resolve, sep } from "node:path";
import { fileURLToPath } from "node:url";
import { isRedirectPage } from "./html-pages.mjs";
import { isRedirectPage, SKIP_DIRS } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SITE_ORIGIN = "https://hivecommons.dev";
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

function htmlFiles(dir = ROOT) {
const out = [];
Expand Down
3 changes: 1 addition & 2 deletions scripts/page-scripts.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import { readFileSync, readdirSync, statSync, existsSync } from "node:fs";
import { dirname, join, relative } from "node:path";
import { fileURLToPath } from "node:url";
import vm from "node:vm";
import { htmlFiles, isRedirectPage } from "./html-pages.mjs";
import { htmlFiles, isRedirectPage, SKIP_DIRS } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SITE_ORIGIN = "https://hivecommons.dev";
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

const SCRIPT_RE = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;

Expand Down
1 change: 0 additions & 1 deletion scripts/page-structure.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { htmlFiles, isRedirectPage, lineOf } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

// https://html.spec.whatwg.org/#void-elements
const VOID = new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
Expand Down
2 changes: 1 addition & 1 deletion scripts/redirect-targets.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import { spawnSync } from "node:child_process";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { SKIP_DIRS } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const GENERATOR = join(ROOT, "make-redirects.sh");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

// The HTML Standard's named character references that browsers resolve even
// without a trailing ";" (the Latin-1 set plus AMP/COPY/GT/LT/QUOT/REG).
Expand Down
1 change: 0 additions & 1 deletion scripts/style-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { htmlFiles, isRedirectPage, lineOf } from "./html-pages.mjs";

const HERE = dirname(fileURLToPath(import.meta.url));
const ROOT = join(HERE, "..");
const SKIP_DIRS = new Set([".git", ".github", "node_modules", "scripts", ".linkcheck-work"]);

// Replace every non-newline character so line numbers survive.
function blank(s) {
Expand Down
Loading