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
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"arrowParens": "avoid"
}
2 changes: 1 addition & 1 deletion apps/api/.lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable filenames-simple/naming-convention */
import { createLintStagedConfig } from "@freecodecamp/eslint-config/lintstaged";
import { createLintStagedConfig } from '@freecodecamp/eslint-config/lintstaged';

export default createLintStagedConfig(import.meta.dirname);
32 changes: 16 additions & 16 deletions apps/api/configs/paths.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
import { join } from "path";
import * as dotenv from "dotenv";
import { join } from 'path';
import * as dotenv from 'dotenv';
dotenv.config();

export const SUPERBLOCK_META_DIR = join(
process.cwd(),
process.env.FCC_REPO_LOCATION!,
"curriculum",
"structure",
"superblocks",
'curriculum',
'structure',
'superblocks'
);

export const BLOCK_META_DIR = join(
process.cwd(),
process.env.FCC_REPO_LOCATION!,
"curriculum",
"structure",
"blocks",
'curriculum',
'structure',
'blocks'
);

export const CHALLENGE_DIR = join(
process.cwd(),
process.env.FCC_REPO_LOCATION!,
"curriculum",
"challenges",
"english",
"blocks",
'curriculum',
'challenges',
'english',
'blocks'
);

export const ENGLISH_LANG_DIR = join(
process.cwd(),
process.env.FCC_REPO_LOCATION!,
"client",
"i18n",
"locales",
"english",
'client',
'i18n',
'locales',
'english'
);
118 changes: 59 additions & 59 deletions apps/api/configs/super-block-list.ts
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
export const superBlockList = [
{
name: "Legacy Responsive Web Design",
path: "responsive-web-design",
name: 'Legacy Responsive Web Design',
path: 'responsive-web-design'
},
{
name: "Legacy JavaScript Algorithms and Data Structures",
path: "javascript-algorithms-and-data-structures",
name: 'Legacy JavaScript Algorithms and Data Structures',
path: 'javascript-algorithms-and-data-structures'
},
{
name: "Front End Development Libraries",
path: "front-end-development-libraries",
name: 'Front End Development Libraries',
path: 'front-end-development-libraries'
},
{
name: "Data Visualization",
path: "data-visualization",
name: 'Data Visualization',
path: 'data-visualization'
},
{
name: "Back End Development and APIs",
path: "back-end-development-and-apis",
name: 'Back End Development and APIs',
path: 'back-end-development-and-apis'
},
{
name: "Quality Assurance",
path: "quality-assurance",
name: 'Quality Assurance',
path: 'quality-assurance'
},
{
name: "Scientific Computing with Python",
path: "scientific-computing-with-python",
name: 'Scientific Computing with Python',
path: 'scientific-computing-with-python'
},
{
name: "Data Analysis with Python",
path: "data-analysis-with-python",
name: 'Data Analysis with Python',
path: 'data-analysis-with-python'
},
{
name: "Information Security",
path: "information-security",
name: 'Information Security',
path: 'information-security'
},
{
name: "Coding Interview Prep",
path: "coding-interview-prep",
name: 'Coding Interview Prep',
path: 'coding-interview-prep'
},
{
name: "Machine Learning with Python",
path: "machine-learning-with-python",
name: 'Machine Learning with Python',
path: 'machine-learning-with-python'
},
{
name: "Relational Databases",
path: "relational-databases",
name: 'Relational Databases',
path: 'relational-databases'
},
{
name: "Responsive Web Design",
path: "responsive-web-design-22",
name: 'Responsive Web Design',
path: 'responsive-web-design-22'
},
{
name: "JavaScript Algorithms and Data Structures",
path: "javascript-algorithms-and-data-structures-22",
name: 'JavaScript Algorithms and Data Structures',
path: 'javascript-algorithms-and-data-structures-22'
},
{
name: "The Odin Project",
path: "the-odin-project",
name: 'The Odin Project',
path: 'the-odin-project'
},
{
name: "College Algebra with Python",
path: "college-algebra-with-python",
name: 'College Algebra with Python',
path: 'college-algebra-with-python'
},
{
name: "Project Euler",
path: "project-euler",
name: 'Project Euler',
path: 'project-euler'
},
{
name: "(New) Foundational C# with Microsoft",
path: "foundational-c-sharp-with-microsoft",
name: '(New) Foundational C# with Microsoft',
path: 'foundational-c-sharp-with-microsoft'
},
{
name: "A2 English for Developers",
path: "a2-english-for-developers",
name: 'A2 English for Developers',
path: 'a2-english-for-developers'
},
{
name: "Rosetta Code",
path: "rosetta-code",
name: 'Rosetta Code',
path: 'rosetta-code'
},
{
name: "Python For Everybody",
path: "python-for-everybody",
name: 'Python For Everybody',
path: 'python-for-everybody'
},
{
name: "B1 English for Developers (Beta)",
path: "b1-english-for-developers",
name: 'B1 English for Developers (Beta)',
path: 'b1-english-for-developers'
},
{
name: "Certified Full Stack Developer",
path: "full-stack-developer",
name: 'Certified Full Stack Developer',
path: 'full-stack-developer'
},
{
name: "A1 Professional Spanish (Beta)",
path: "a1-professional-spanish",
name: 'A1 Professional Spanish (Beta)',
path: 'a1-professional-spanish'
},
{
name: "A2 Professional Spanish (Beta)",
path: "a2-professional-spanish",
name: 'A2 Professional Spanish (Beta)',
path: 'a2-professional-spanish'
},
{
name: "A2 Professional Chinese (Beta)",
path: "a2-professional-chinese",
name: 'A2 Professional Chinese (Beta)',
path: 'a2-professional-chinese'
},
{
name: "Basic HTML",
path: "basic-html",
name: 'Basic HTML',
path: 'basic-html'
},
{
name: "Semantic HTML",
path: "semantic-html",
name: 'Semantic HTML',
path: 'semantic-html'
},
{
name: "A1 Professional Chinese (Beta)",
path: "a1-professional-chinese",
},
name: 'A1 Professional Chinese (Beta)',
path: 'a1-professional-chinese'
}
];
2 changes: 1 addition & 1 deletion apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { configTypeChecked } from "@freecodecamp/eslint-config/base";
import { configTypeChecked } from '@freecodecamp/eslint-config/base';

export default configTypeChecked;
14 changes: 7 additions & 7 deletions apps/api/interfaces/tools.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
type ToolsFunction = (
directory: string,
directory: string
) => Promise<{ stdout: string; stderr: string }>;

type ToolsFunctionWithArg = (
directory: string,
start: number,
start: number
) => Promise<{ stdout: string; stderr: string }>;

export interface ToolsSwitch {
"create-next-step": ToolsFunction;
"create-empty-steps": ToolsFunctionWithArg;
"insert-step": ToolsFunctionWithArg;
"delete-step": ToolsFunctionWithArg;
"update-step-titles": ToolsFunction;
'create-next-step': ToolsFunction;
'create-empty-steps': ToolsFunctionWithArg;
'insert-step': ToolsFunctionWithArg;
'delete-step': ToolsFunctionWithArg;
'update-step-titles': ToolsFunction;
}
2 changes: 1 addition & 1 deletion apps/api/reset.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "@total-typescript/ts-reset";
import '@total-typescript/ts-reset';
6 changes: 3 additions & 3 deletions apps/api/routes/block-route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { getSteps } from "../utils/get-steps";
import { Request, Response } from 'express';
import { getSteps } from '../utils/get-steps';

export const blockRoute = async (
req: Request,
res: Response,
res: Response
): Promise<void> => {
const { superblock, block } = req.params;

Expand Down
4 changes: 2 additions & 2 deletions apps/api/routes/index-route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { superBlockList } from "../configs/super-block-list";
import { Request, Response } from 'express';
import { superBlockList } from '../configs/super-block-list';

export const indexRoute = (req: Request, res: Response): void => {
res.json(superBlockList);
Expand Down
6 changes: 3 additions & 3 deletions apps/api/routes/module-block-route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { getBlocks } from "../utils/get-full-stack-blocks";
import { Request, Response } from 'express';
import { getBlocks } from '../utils/get-full-stack-blocks';

export const moduleBlockRoute = async (
req: Request,
res: Response,
res: Response
): Promise<void> => {
const { superblock, chapter, module } = req.params;

Expand Down
6 changes: 3 additions & 3 deletions apps/api/routes/module-route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { getModules } from "../utils/get-full-stack-blocks";
import { Request, Response } from 'express';
import { getModules } from '../utils/get-full-stack-blocks';

export const moduleRoute = async (
req: Request,
res: Response,
res: Response
): Promise<void> => {
const { superblock, chapter } = req.params;

Expand Down
4 changes: 2 additions & 2 deletions apps/api/routes/module-step-route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { getStepContent } from "../utils/get-step-contents";
import { Request, Response } from 'express';
import { getStepContent } from '../utils/get-step-contents';

export const stepRoute = async (req: Request, res: Response): Promise<void> => {
const { superblock, block, step } = req.params;
Expand Down
8 changes: 4 additions & 4 deletions apps/api/routes/save-route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { saveStep } from "../utils/save-step";
import { Request, Response } from 'express';
import { saveStep } from '../utils/save-step';

export const saveRoute = async (req: Request, res: Response): Promise<void> => {
const { superblock, block, step } = req.params;
Expand All @@ -8,8 +8,8 @@ export const saveRoute = async (req: Request, res: Response): Promise<void> => {
const success = await saveStep(superblock, block, step, content);

const message = success
? "Your changes have been saved and are ready to commit!"
: "There was an error when saving your changes. Please try again.";
? 'Your changes have been saved and are ready to commit!'
: 'There was an error when saving your changes. Please try again.';

res.json({ message });
};
4 changes: 2 additions & 2 deletions apps/api/routes/step-route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request, Response } from "express";
import { getStepContent } from "../utils/get-step-contents";
import { Request, Response } from 'express';
import { getStepContent } from '../utils/get-step-contents';

export const stepRoute = async (req: Request, res: Response): Promise<void> => {
const { superblock, block, step } = req.params;
Expand Down
6 changes: 3 additions & 3 deletions apps/api/routes/super-block-route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";
import { getBlocks } from "../utils/get-blocks";
import { Request, Response } from 'express';
import { getBlocks } from '../utils/get-blocks';

export const superblockRoute = async (
req: Request,
res: Response,
res: Response
): Promise<void> => {
const sup = req.params.superblock;

Expand Down
Loading