feat: update readme, clean up logging
Node.js CI / Lint and Test (push) Failing after 1m0s

This commit is contained in:
2025-10-07 11:44:56 -07:00
parent 9896bff829
commit ef2d1f570e
2 changed files with 11 additions and 16 deletions
+8 -15
View File
@@ -1,20 +1,13 @@
# New Repository Template # freeCodeCamp Review Generator
This template contains all of our basic files for a new GitHub repository. There is also a handy workflow that will create an issue on a new repository made from this template, with a checklist for the steps we usually take in setting up a new repository. This tool allows you to compile all of freeCodeCamp's review lessons into a single PDF.
If you're starting a Node.JS project with TypeScript, we have a [specific template](https://github.com/naomi-lgbt/nodejs-typescript-template) for that purpose. ## Usage
## Readme 1. Clone the repo, `pnpm install`.
2. Go to the freeCodeCamp repo, copy all of the review blocks into the `content` directory here. Nested directories are fine, we walk the file tree recursively. Only markdown files will be parsed.
Delete all of the above text (including this line), and uncomment the below text to use our standard readme template. 3. Run `pnpm start` to start reading the files, compiling them into a single doc, and turning that doc into a PDF.
4. Profit.
<!-- # Project Name
Project Description
## Live Version
This page is currently deployed. [View the live website.]
## Feedback and Bugs ## Feedback and Bugs
@@ -36,4 +29,4 @@ Copyright held by Naomi Carrigan.
## Contact ## Contact
We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`. --> We may be contacted through our [Chat Server](http://chat.nhcarrigan.com) or via email at `contact@nhcarrigan.com`.
+3 -1
View File
@@ -36,7 +36,9 @@ const rollupFiles = async(
outputFile: string, outputFile: string,
): Promise<void> => { ): Promise<void> => {
try { try {
console.log("Process started...");
await writeFile(outputFile, `${starterText}\n`); await writeFile(outputFile, `${starterText}\n`);
console.log("Reading content directory...");
const files = await readDirectoryRecursively(inputDirectory); const files = await readDirectoryRecursively(inputDirectory);
for (const file of files) { for (const file of files) {
if (file === ".gitkeep") { if (file === ".gitkeep") {
@@ -49,7 +51,6 @@ const rollupFiles = async(
trim(); trim();
// Title is in front matter // Title is in front matter
const title = /^title: (?<title>.*)/m.exec(content)?.groups?.title; const title = /^title: (?<title>.*)/m.exec(content)?.groups?.title;
console.log(title);
const strippedFccHeadings = strippedFrontmatter. const strippedFccHeadings = strippedFrontmatter.
replace(/^#+ --.*--/, ""). replace(/^#+ --.*--/, "").
trim(); trim();
@@ -66,6 +67,7 @@ const rollupFiles = async(
}; };
const createPdf = async(inputPath: string): Promise<void> => { const createPdf = async(inputPath: string): Promise<void> => {
console.log("Creating PDF...");
const pdf = await mdToPdf({ path: inputPath }, options); const pdf = await mdToPdf({ path: inputPath }, options);
console.log("PDF created!"); console.log("PDF created!");
await writeFile("./fcc-review-pages.pdf", pdf.content); await writeFile("./fcc-review-pages.pdf", pdf.content);