1 Commits

Author SHA1 Message Date
minori 85263ac866 deps: update md-to-pdf to 5.2.5
Node.js CI / CI (pull_request) Failing after 40s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m42s
2026-02-04 08:42:13 -08:00
5 changed files with 98 additions and 121 deletions
+25
View File
@@ -0,0 +1,25 @@
# Package Manager Configuration
# Force pnpm usage - breaks npm/yarn intentionally
node-linker=pnpm
# Security: Disable all lifecycle scripts
ignore-scripts=true
enable-pre-post-scripts=false
# Security: Require packages to be 10+ days old before installation
minimum-release-age=14400
# Security: Verify package integrity hashes
verify-store-integrity=true
# Security: Enforce strict trust policies
trust-policy=strict
# Security: Strict peer dependency resolution
strict-peer-dependencies=true
# Performance: Use symlinks for node_modules
symlink=true
# Lockfile: Ensure lockfile is not modified during install
frozen-lockfile=false
+1 -2
View File
@@ -20,11 +20,10 @@
"@nhcarrigan/typescript-config": "4.0.0",
"@types/node": "24.7.0",
"eslint": "9.37.0",
"puppeteer": "24.40.0",
"tsx": "4.20.6",
"typescript": "5.9.3"
},
"dependencies": {
"md-to-pdf": "5.2.4"
"md-to-pdf": "5.2.5"
}
}
+43 -54
View File
@@ -9,8 +9,8 @@ importers:
.:
dependencies:
md-to-pdf:
specifier: 5.2.4
version: 5.2.4(typescript@5.9.3)
specifier: 5.2.5
version: 5.2.5(typescript@5.9.3)
devDependencies:
'@nhcarrigan/eslint-config':
specifier: 5.2.0
@@ -24,9 +24,6 @@ importers:
eslint:
specifier: 9.37.0
version: 9.37.0
puppeteer:
specifier: 24.40.0
version: 24.40.0(typescript@5.9.3)
tsx:
specifier: 4.20.6
version: 4.20.6
@@ -316,8 +313,8 @@ packages:
resolution: {integrity: sha512-fdDH1LSGfZdTH2sxdpVMw31BanV28K/Gry0cVFxaNP77neJSkd82mM8ErPNYs9e+0O7SdHBLTDzDgwUuy18RnQ==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
'@puppeteer/browsers@2.13.0':
resolution: {integrity: sha512-46BZJYJjc/WwmKjsvDFykHtXrtomsCIrwYQPOP7VfMJoZY2bsDF9oROBABR3paDjDcmkUye1Pb1BqdcdiipaWA==}
'@puppeteer/browsers@2.10.10':
resolution: {integrity: sha512-3ZG500+ZeLql8rE0hjfhkycJjDj0pI/btEh3L9IkWUYcOrgP0xCNRq3HbtbqOPbvDhFaAWD88pDFtlLv8ns8gA==}
engines: {node: '>=18'}
hasBin: true
@@ -825,7 +822,6 @@ packages:
basic-ftp@5.0.5:
resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==}
engines: {node: '>=10.0.0'}
deprecated: Security vulnerability fixed in 5.2.1, please upgrade
binary-extensions@2.3.0:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
@@ -904,8 +900,8 @@ packages:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
chromium-bidi@14.0.0:
resolution: {integrity: sha512-9gYlLtS6tStdRWzrtXaTMnqcM4dudNegMXJxkR0I/CXObHalYeYcAMPrL19eroNZHtJ8DQmu1E+ZNOYu/IXMXw==}
chromium-bidi@9.1.0:
resolution: {integrity: sha512-rlUzQ4WzIAWdIbY/viPShhZU2n21CxDUgazXVbw4Hu1MwaeUSEksSeM6DqPgpRjCLXRk702AVRxJxoOz0dw4OA==}
peerDependencies:
devtools-protocol: '*'
@@ -1028,8 +1024,8 @@ packages:
resolution: {integrity: sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==}
engines: {node: '>= 14'}
devtools-protocol@0.0.1581282:
resolution: {integrity: sha512-nv7iKtNZQshSW2hKzYNr46nM/Cfh5SEvE2oV0/SEGgc9XupIY5ggf84Cz8eJIkBce7S3bmTAauFD6aysMpnqsQ==}
devtools-protocol@0.0.1508733:
resolution: {integrity: sha512-QJ1R5gtck6nDcdM+nlsaJXcelPEI7ZxSMw1ujHpO1c4+9l+Nue5qlebi9xO1Z2MGr92bFOQTW7/rrheh5hHxDg==}
dir-glob@3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
@@ -1777,8 +1773,8 @@ packages:
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
md-to-pdf@5.2.4:
resolution: {integrity: sha512-s6080i4ZSBfvn7qplSVjdqP9eWi9rIWj+t5pucEKnpAHan89VLQuQPhVx06vWIM+6JX2HrJ1wNRFMiwLlS01vg==}
md-to-pdf@5.2.5:
resolution: {integrity: sha512-TG8TgDM0PmEwCldR6j/1QP9gBElLL3DSn5ID8P3bEXEl3Y2zHOUSyszHzabWnDNxklRjKbi40ybli8YQJ5Ym5w==}
engines: {node: '>=12.0'}
hasBin: true
@@ -2028,12 +2024,12 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
puppeteer-core@24.40.0:
resolution: {integrity: sha512-MWL3XbUCfVgGR0gRsidzT6oKJT2QydPLhMITU6HoVWiiv4gkb6gJi3pcdAa8q4HwjBTbqISOWVP4aJiiyUJvag==}
puppeteer-core@24.23.0:
resolution: {integrity: sha512-yl25C59gb14sOdIiSnJ08XiPP+O2RjuyZmEG+RjYmCXO7au0jcLf7fRiyii96dXGUBW7Zwei/mVKfxMx/POeFw==}
engines: {node: '>=18'}
puppeteer@24.40.0:
resolution: {integrity: sha512-IxQbDq93XHVVLWHrAkFP7F7iHvb9o0mgfsSIMlhHb+JM+JjM1V4v4MNSQfcRWJopx9dsNOr9adYv0U5fm9BJBQ==}
puppeteer@24.23.0:
resolution: {integrity: sha512-BVR1Lg8sJGKXY79JARdIssFWK2F6e1j+RyuJP66w4CUmpaXjENicmA3nNpUXA8lcTdDjAndtP+oNdni3T/qQqA==}
engines: {node: '>=18'}
hasBin: true
@@ -2155,11 +2151,6 @@ packages:
engines: {node: '>=10'}
hasBin: true
semver@7.7.4:
resolution: {integrity: sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==}
engines: {node: '>=10'}
hasBin: true
serve-handler@6.1.6:
resolution: {integrity: sha512-x5RL9Y2p5+Sh3D38Fh9i/iQ5ZK+e4xuXRd/pGbM4D13tgo/MGwbttUk8emytcr1YYzBYs+apnUngBDFYfpjPuQ==}
@@ -2446,8 +2437,8 @@ packages:
resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
engines: {node: '>= 0.4'}
typed-query-selector@2.12.1:
resolution: {integrity: sha512-uzR+FzI8qrUEIu96oaeBJmd9E7CFEiQ3goA5qCVgc4s5llSubcfGHq9yUstZx/k4s9dXHVKsE35YWoFyvEqEHA==}
typed-query-selector@2.12.0:
resolution: {integrity: sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg==}
typescript@5.9.3:
resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==}
@@ -2546,8 +2537,8 @@ packages:
jsdom:
optional: true
webdriver-bidi-protocol@0.4.1:
resolution: {integrity: sha512-ARrjNjtWRRs2w4Tk7nqrf2gBI0QXWuOmMCx2hU+1jUt6d00MjMxURrhxhGbrsoiZKJrhTSTzbIrc554iKI10qw==}
webdriver-bidi-protocol@0.3.6:
resolution: {integrity: sha512-mlGndEOA9yK9YAbvtxaPTqdi/kaCWYYfwrZvGzcmkr/3lWM+tQj53BxtpVd6qbC6+E5OnHXgCcAhre6AkXzxjA==}
which-boxed-primitive@1.1.1:
resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==}
@@ -2590,8 +2581,8 @@ packages:
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@8.20.0:
resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==}
ws@8.18.3:
resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@@ -2850,13 +2841,13 @@ snapshots:
'@pkgr/core@0.1.2': {}
'@puppeteer/browsers@2.13.0':
'@puppeteer/browsers@2.10.10':
dependencies:
debug: 4.4.3
extract-zip: 2.0.1
progress: 2.0.3
proxy-agent: 6.5.0
semver: 7.7.4
semver: 7.7.2
tar-fs: 3.1.1
yargs: 17.7.2
transitivePeerDependencies:
@@ -3469,9 +3460,9 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
chromium-bidi@14.0.0(devtools-protocol@0.0.1581282):
chromium-bidi@9.1.0(devtools-protocol@0.0.1508733):
dependencies:
devtools-protocol: 0.0.1581282
devtools-protocol: 0.0.1508733
mitt: 3.0.1
zod: 3.25.76
@@ -3587,7 +3578,7 @@ snapshots:
escodegen: 2.1.0
esprima: 4.0.1
devtools-protocol@0.0.1581282: {}
devtools-protocol@0.0.1508733: {}
dir-glob@3.0.1:
dependencies:
@@ -4511,7 +4502,7 @@ snapshots:
math-intrinsics@1.1.0: {}
md-to-pdf@5.2.4(typescript@5.9.3):
md-to-pdf@5.2.5(typescript@5.9.3):
dependencies:
arg: 5.0.2
chalk: 4.1.2
@@ -4523,7 +4514,7 @@ snapshots:
iconv-lite: 0.6.3
listr: 0.14.3
marked: 4.3.0
puppeteer: 24.40.0(typescript@5.9.3)
puppeteer: 24.23.0(typescript@5.9.3)
semver: 7.7.2
serve-handler: 6.1.6
transitivePeerDependencies:
@@ -4779,15 +4770,15 @@ snapshots:
punycode@2.3.1: {}
puppeteer-core@24.40.0:
puppeteer-core@24.23.0:
dependencies:
'@puppeteer/browsers': 2.13.0
chromium-bidi: 14.0.0(devtools-protocol@0.0.1581282)
'@puppeteer/browsers': 2.10.10
chromium-bidi: 9.1.0(devtools-protocol@0.0.1508733)
debug: 4.4.3
devtools-protocol: 0.0.1581282
typed-query-selector: 2.12.1
webdriver-bidi-protocol: 0.4.1
ws: 8.20.0
devtools-protocol: 0.0.1508733
typed-query-selector: 2.12.0
webdriver-bidi-protocol: 0.3.6
ws: 8.18.3
transitivePeerDependencies:
- bare-buffer
- bufferutil
@@ -4795,14 +4786,14 @@ snapshots:
- supports-color
- utf-8-validate
puppeteer@24.40.0(typescript@5.9.3):
puppeteer@24.23.0(typescript@5.9.3):
dependencies:
'@puppeteer/browsers': 2.13.0
chromium-bidi: 14.0.0(devtools-protocol@0.0.1581282)
'@puppeteer/browsers': 2.10.10
chromium-bidi: 9.1.0(devtools-protocol@0.0.1508733)
cosmiconfig: 9.0.0(typescript@5.9.3)
devtools-protocol: 0.0.1581282
puppeteer-core: 24.40.0
typed-query-selector: 2.12.1
devtools-protocol: 0.0.1508733
puppeteer-core: 24.23.0
typed-query-selector: 2.12.0
transitivePeerDependencies:
- bare-buffer
- bufferutil
@@ -4957,8 +4948,6 @@ snapshots:
semver@7.7.2: {}
semver@7.7.4: {}
serve-handler@6.1.6:
dependencies:
bytes: 3.0.0
@@ -5312,7 +5301,7 @@ snapshots:
possible-typed-array-names: 1.1.0
reflect.getprototypeof: 1.0.10
typed-query-selector@2.12.1: {}
typed-query-selector@2.12.0: {}
typescript@5.9.3: {}
@@ -5415,7 +5404,7 @@ snapshots:
- tsx
- yaml
webdriver-bidi-protocol@0.4.1: {}
webdriver-bidi-protocol@0.3.6: {}
which-boxed-primitive@1.1.1:
dependencies:
@@ -5482,7 +5471,7 @@ snapshots:
wrappy@1.0.2: {}
ws@8.20.0: {}
ws@8.18.3: {}
y18n@5.0.8: {}
-21
View File
@@ -1,21 +0,0 @@
# Security
# Do not execute any scripts of installed packages (project scripts still run)
ignoreDepScripts: true
# Do not automatically run pre/post scripts (e.g. preinstall, postbuild)
enablePrePostScripts: false
# Only allow packages published at least 10 days ago (reduces risk of compromised packages)
minimumReleaseAge: 14400
# Fail if a package's trust level has decreased compared to previous releases
trustPolicy: no-downgrade
# Ignore trust policy for packages published more than 1 year ago (predates provenance signing)
trustPolicyIgnoreAfter: 525960
# Fail if there are missing or invalid peer dependencies
strictPeerDependencies: true
# Prevent transitive dependencies from using exotic sources (git repos, direct tarball URLs)
blockExoticSubdeps: true
# Lockfile
# Allow the lockfile to be updated during install (set to true in CI for stricter reproducibility)
preferFrozenLockfile: false
+28 -43
View File
@@ -4,7 +4,13 @@
* @author Naomi Carrigan
*/
import { readFile, writeFile, readdir, unlink } from "node:fs/promises";
import {
readFile,
appendFile,
writeFile,
readdir,
unlink,
} from "node:fs/promises";
import { join } from "node:path";
import { mdToPdf } from "md-to-pdf";
import order from "../data/order.json" assert { type: "json" };
@@ -40,59 +46,38 @@ const sortFiles = (a: string, b: string): number => {
return aIndex - bIndex;
};
interface FileEntry {
body: string;
title: string;
}
const slugify = (text: string): string => {
return text.
toLowerCase().
replaceAll(/[^\w\s-]/gu, "").
replaceAll(/\s+/gu, "-");
};
const processFile = async(file: string): Promise<FileEntry> => {
const content = await readFile(file, "utf8");
const titleMatch = /^title: (?<title>.*)/mu.exec(content);
const title = titleMatch?.groups?.title ?? "Unknown";
const body = content.
replace(/^---\n[\S\s]*?\n---\n/u, "").
trim().
replace(/^#+ --.*--/u, "").
trim().
replaceAll(/^:::.*$/gmu, "").
trim();
return { body, title };
};
const rollupFiles = async(
inputDirectory: string,
outputFile: string,
): Promise<void> => {
try {
console.log("Process started...");
await writeFile(outputFile, `${starterText}\n`);
console.log("Reading content directory...");
const unsortedFiles = await readDirectoryRecursively(inputDirectory);
console.log(unsortedFiles);
const files = unsortedFiles.toSorted(sortFiles);
console.log("Files found, processing...");
const mdFiles = files.filter((file) => {
return file.endsWith(".md");
});
const entries = await Promise.all(
mdFiles.map(async(file) => {
return await processFile(file);
}),
for (const file of files) {
if (file === ".gitkeep") {
continue;
}
if (file.endsWith(".md")) {
const content = await readFile(file, "utf8");
const strippedFrontmatter = content.
replace(/^---\n[\S\s]*?\n---\n/, "").
trim();
// Title is in front matter
const title = /^title: (?<title>.*)/m.exec(content)?.groups?.title;
const strippedFccHeadings = strippedFrontmatter.
replace(/^#+ --.*--/, "").
trim();
await appendFile(
outputFile,
`---\n\n# ${title ?? "Unknown"}\n${strippedFccHeadings}\n\n`,
);
const tocLines = entries.map(({ title }) => {
return `- [${title}](#${slugify(title)})`;
});
const toc = `## Table of Contents\n\n${tocLines.join("\n")}\n\n---`;
const sections = entries.map(({ body, title }) => {
return `---\n\n# ${title}\n\n${body}\n\n`;
});
await writeFile(outputFile, `${starterText}\n${toc}\n\n${sections.join("")}`);
}
}
console.log(`Successfully rolled up files into ${outputFile}`);
} catch (error) {
console.error("Error rolling up files:", error);