repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/asyncFieldValidation.tsx | examples/V7/asyncFieldValidation.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
export default function App() {
const {
register,
handleSubmit,
formState: { errors },
} = useForm();
const onSubmit = (dat... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/normalizeField.tsx | examples/V7/normalizeField.tsx | import React from 'react';
import { useForm, Controller } from 'react-hook-form';
import NumberFormat from 'react-number-format';
import { TextField, ThemeProvider, createMuiTheme } from '@material-ui/core';
const theme = createMuiTheme({
palette: {
type: 'dark',
},
});
const defaultValues = {
priceInCents: ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/basicValidation.tsx | examples/V7/basicValidation.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
import './styles.css';
export default function Form() {
const { register, errors, handleSubmit } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
};
console.log(errors);
return ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/asyncSubmitValidation.tsx | examples/V7/asyncSubmitValidation.tsx | import { useForm } from 'react-hook-form';
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
export default function App() {
const {
register,
handleSubmit,
formState: { errors },
setError,
} = useForm();
const onSubmit = async (data) => {
await sleep(2000);
if (d... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/asyncSetFormValues.tsx | examples/V7/asyncSetFormValues.tsx | import React, { useEffect } from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
export default function App() {
const { register, handleSubmit, reset } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
};
useEffect(() => {
// you can use `asy... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/triggerFieldValidation.tsx | examples/V7/triggerFieldValidation.tsx | import React from 'react';
import { useForm } from 'react-hook-form';
export default function App() {
const {
register,
formState: { errors },
trigger,
handleSubmit,
} = useForm();
console.log('errors', errors);
return (
<form onSubmit={handleSubmit((data) => console.log(data))}>
<h... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/validationOnFieldBlur.tsx | examples/V7/validationOnFieldBlur.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
export default function App() {
const {
register,
formState: { errors },
handleSubmit,
} = useForm({
mode: 'onBlur',
});
const onSubmit = (data) => {
alert(JSON.stringify(data));
};
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/initalFormState.tsx | examples/V7/initalFormState.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import { useForm } from 'react-hook-form';
import './styles.css';
const defaultValues = {
firstName: 'bill',
lastName: 'luo',
email: 'bluebill1049@hotmail.com',
};
function App() {
const { register, handleSubmit } = useForm();
// or you can set t... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/typescript/Control.tsx | examples/V7/typescript/Control.tsx | import React from 'react';
import { useForm, useWatch, Control } from 'react-hook-form';
type FormValues = {
firstName: string;
lastName: string;
};
function IsolateReRender({ control }: { control: Control }) {
const firstName = useWatch<FormValues['firstName']>({
control,
name: 'firstName',
default... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/typescript/Resolver.tsx | examples/V7/typescript/Resolver.tsx | import React from 'react';
import { useForm, Resolver } from 'react-hook-form';
type FormValues = {
firstName: string;
lastName: string;
};
const resolver: Resolver<FormValues> = async (values) => {
return {
values: !values.firstName ? {} : values,
errors: !values.firstName
? {
firstName... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/typescript/SubmitHandler.tsx | examples/V7/typescript/SubmitHandler.tsx | import React from 'react';
import { useForm, SubmitHandler } from 'react-hook-form';
type FormValues = {
firstName: string;
lastName: string;
email: string;
};
export default function App() {
const { register, handleSubmit } = useForm<FormValues>();
const onSubmit: SubmitHandler<FormValues> = (data) =>
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/typescript/UseFormMethods.tsx | examples/V7/typescript/UseFormMethods.tsx | import React from 'react';
import {
useForm,
UseFormReturn,
UseFormRegisterReturn,
SubmitHandler,
} from 'react-hook-form';
import './styles.css';
const Input = (props: Partial<UseFormRegisterReturn> & { type?: string }) => (
<input {...props} />
);
type Option = {
label: React.ReactNode;
value: string... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/examples/V7/typescript/NestedValue.tsx | examples/V7/typescript/NestedValue.tsx | import React, { useEffect } from 'react';
import { useForm } from 'react-hook-form';
import {
TextField,
FormControl,
Select,
MenuItem,
FormHelperText,
} from '@material-ui/core';
import { Autocomplete } from '@material-ui/lab';
type Option = {
label: string;
value: string;
};
const options = [
{ labe... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/playwright.config.ts | playwright.config.ts | import path from 'path';
import { config as dotenvConfig } from 'dotenv';
import { defineConfig, devices } from '@playwright/test';
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
const envPath = path.resolve(__dirname, '.env');
dotenvConfig({ path: envPath });
/**
* See https:/... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/scripts/sync-i18n.ts | tools/scripts/sync-i18n.ts | import { exec } from 'child_process';
import { readFile, readdir, stat, writeFile } from 'fs/promises';
import { join, sep } from 'path';
import { promisify } from 'util';
const asyncExec = promisify(exec);
const loadDirectory = async (path: string): Promise<string[]> => {
const files: string[] = [];
const status... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/scripts/redirect-gen.ts | tools/scripts/redirect-gen.ts | import fs from 'fs';
import path from 'path';
/* This can be used to create NGINX maps for redirects. After running this
script with `npx tsx redirect-gen`, the map should appear in the current
directory.
*/
function createRedirectMap(): void {
const basePath = '../../../curriculum/challenges/english/18-proje... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/server.ts | tools/challenge-editor/api/server.ts | import * as dotenv from 'dotenv';
dotenv.config();
import cors from 'cors';
import express from 'express';
import { blockRoute } from './routes/block-route';
import { indexRoute } from './routes/index-route';
import { saveRoute } from './routes/save-route';
import { stepRoute } from './routes/step-route';
import { sup... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/reset.d.ts | tools/challenge-editor/api/reset.d.ts | import '@total-typescript/ts-reset';
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/interfaces/tools.ts | tools/challenge-editor/api/interfaces/tools.ts | type ToolsFunction = (
directory: string
) => Promise<{ stdout: string; stderr: string }>;
type ToolsFunctionWithArg = (
directory: string,
start: number
) => Promise<{ stdout: string; stderr: string }>;
export interface ToolsSwitch {
'create-next-step': ToolsFunction;
'create-empty-steps': ToolsFunctionWit... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/interfaces/superblock-meta.ts | tools/challenge-editor/api/interfaces/superblock-meta.ts | export interface SuperBlockModule {
dashedName: string;
blocks?: string[];
}
export interface SuperBlockChapter {
dashedName: string;
modules: SuperBlockModule[];
}
export interface SuperBlockMeta {
blocks?: string[];
chapters?: SuperBlockChapter[];
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/interfaces/partial-meta.ts | tools/challenge-editor/api/interfaces/partial-meta.ts | export interface PartialMeta {
name: string;
dashedName: string;
challengeOrder: { id: string; title: string }[];
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/interfaces/intro.ts | tools/challenge-editor/api/interfaces/intro.ts | interface SuperBlock {
title: string;
intro: string[];
blocks: string[];
modules?: string[];
chapters?: string[];
}
export interface Intro {
[key: string]: SuperBlock;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/interfaces/challenge-data.ts | tools/challenge-editor/api/interfaces/challenge-data.ts | export interface ChallengeData {
name: string;
id: string;
path: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/save-route.ts | tools/challenge-editor/api/routes/save-route.ts | 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;
const content = (req.body as { content: string }).content;
const success = await saveStep(s... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/module-route.ts | tools/challenge-editor/api/routes/module-route.ts | import { Request, Response } from 'express';
import { getModules } from '../utils/get-full-stack-blocks';
export const moduleRoute = async (
req: Request,
res: Response
): Promise<void> => {
const { superblock, chapter } = req.params;
const steps = await getModules(superblock, chapter);
res.json(steps);
};... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/module-step-route.ts | tools/challenge-editor/api/routes/module-step-route.ts | 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;
const stepContents = await getStepContent(superblock, block, step);
res.json(... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/index-route.ts | tools/challenge-editor/api/routes/index-route.ts | import { Request, Response } from 'express';
import { superBlockList } from '../configs/super-block-list';
export const indexRoute = (req: Request, res: Response): void => {
res.json(superBlockList);
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/step-route.ts | tools/challenge-editor/api/routes/step-route.ts | 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;
const stepContents = await getStepContent(superblock, block, step);
res.json(... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/tools-route.ts | tools/challenge-editor/api/routes/tools-route.ts | import { exec } from 'child_process';
import { join } from 'path';
import { promisify } from 'util';
import { Request, Response } from 'express';
import { ToolsSwitch } from '../interfaces/tools';
const asyncExec = promisify(exec);
const toolsSwitch: ToolsSwitch = {
'create-next-step': directory => {
return as... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/block-route.ts | tools/challenge-editor/api/routes/block-route.ts | import { Request, Response } from 'express';
import { getSteps } from '../utils/get-steps';
export const blockRoute = async (
req: Request,
res: Response
): Promise<void> => {
const { superblock, block } = req.params;
const steps = await getSteps(superblock, block);
res.json(steps);
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/module-block-route.ts | tools/challenge-editor/api/routes/module-block-route.ts | import { Request, Response } from 'express';
import { getBlocks } from '../utils/get-full-stack-blocks';
export const moduleBlockRoute = async (
req: Request,
res: Response
): Promise<void> => {
const { superblock, chapter, module } = req.params;
const steps = await getBlocks(superblock, chapter, module);
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/routes/super-block-route.ts | tools/challenge-editor/api/routes/super-block-route.ts | import { Request, Response } from 'express';
import { getBlocks } from '../utils/get-blocks';
export const superblockRoute = async (
req: Request,
res: Response
): Promise<void> => {
const sup = req.params.superblock;
const blocks = await getBlocks(sup);
res.json(blocks);
};
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/utils/get-steps.ts | tools/challenge-editor/api/utils/get-steps.ts | import { readFile } from 'fs/promises';
import { join } from 'path';
import matter from 'gray-matter';
import { PartialMeta } from '../interfaces/partial-meta';
import {
BLOCK_META_DIR,
CHALLENGE_DIR,
ENGLISH_LANG_DIR
} from '../configs/paths';
import { Intro } from '../interfaces/intro';
const getFileOrder = ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/utils/save-step.ts | tools/challenge-editor/api/utils/save-step.ts | import { writeFile } from 'fs/promises';
import { join } from 'path';
import { CHALLENGE_DIR } from '../configs/paths';
export const saveStep = async (
sup: string,
block: string,
step: string,
content: string
): Promise<boolean> => {
try {
const filePath = join(CHALLENGE_DIR, block, step);
await wr... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/utils/get-full-stack-blocks.ts | tools/challenge-editor/api/utils/get-full-stack-blocks.ts | import { readFile } from 'fs/promises';
import { join } from 'path';
import {
SUPERBLOCK_META_DIR,
BLOCK_META_DIR,
ENGLISH_LANG_DIR
} from '../configs/paths';
import { SuperBlockMeta } from '../interfaces/superblock-meta';
import { PartialMeta } from '../interfaces/partial-meta';
import { Intro } from '../interfa... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/utils/get-step-contents.ts | tools/challenge-editor/api/utils/get-step-contents.ts | import { readFile } from 'fs/promises';
import { join } from 'path';
import matter from 'gray-matter';
import { CHALLENGE_DIR } from '../configs/paths';
export const getStepContent = async (
sup: string,
block: string,
step: string
): Promise<{ name: string; dashedName: string; fileData: string }> => {
const f... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/utils/get-blocks.ts | tools/challenge-editor/api/utils/get-blocks.ts | import { readFile } from 'fs/promises';
import { join } from 'path';
import { chapterBasedSuperBlocks } from '../../../../shared/config/curriculum';
import {
SUPERBLOCK_META_DIR,
BLOCK_META_DIR,
ENGLISH_LANG_DIR
} from '../configs/paths';
import { SuperBlockMeta } from '../interfaces/superblock-meta';
import { ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/configs/paths.ts | tools/challenge-editor/api/configs/paths.ts | import { join } from 'path';
export const SUPERBLOCK_META_DIR = join(
process.cwd(),
'..',
'..',
'..',
'curriculum',
'structure',
'superblocks'
);
export const BLOCK_META_DIR = join(
process.cwd(),
'..',
'..',
'..',
'curriculum',
'structure',
'blocks'
);
export const CHALLENGE_DIR = join(... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/api/configs/super-block-list.ts | tools/challenge-editor/api/configs/super-block-list.ts | export const superBlockList = [
{
name: 'Legacy Responsive Web Design',
path: 'responsive-web-design'
},
{
name: 'Legacy JavaScript Algorithms and Data Structures',
path: 'javascript-algorithms-and-data-structures'
},
{
name: 'Front End Development Libraries',
path: 'front-end-developm... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/vite.config.ts | tools/challenge-editor/client/vite.config.ts | import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
base: '/',
plugins: [react()],
envPrefix: 'CHALLENGE_EDITOR_',
server: {
port: 3300
}
});
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/vite-app-env.d.ts | tools/challenge-editor/client/src/vite-app-env.d.ts | /// <reference types="vite/client" />
interface ImportMetaEnv {
readonly CHALLENGE_EDITOR_LEARN_CLIENT_LOCATION: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/index.tsx | tools/challenge-editor/client/src/index.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './app';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/app.tsx | tools/challenge-editor/client/src/app.tsx | import * as React from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Header from './components/header/header';
import Landing from './components/landing/landing';
import SuperBlock from './components/superblock/super-block';
import Block from './components/block/block';
impo... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/chapter-based-block/chapter-block.tsx | tools/challenge-editor/client/src/components/chapter-based-block/chapter-block.tsx | import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import {
ChallengeData,
ChallengeDataWithBlock
} from '../../../interfaces/challenge-data';
import { API_LOCATION } from '../../utils/handle-request';
import './chapter-block.css';
const stepBasedSuperblocks = [... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/tools/tools.tsx | tools/challenge-editor/client/src/components/tools/tools.tsx | import React, { Link, useParams } from 'react-router-dom';
import CreateEmptySteps from '../buttons/create-empty-steps';
import CreateNextStep from '../buttons/create-next-step';
import DeleteStep from '../buttons/delete-step';
import InsertStep from '../buttons/insert-step';
import UpdateStepTitles from '../buttons/up... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/superblock/super-block.tsx | tools/challenge-editor/client/src/components/superblock/super-block.tsx | import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import { Block, BlocksWithSuperBlock } from '../../../interfaces/block';
import { API_LOCATION } from '../../utils/handle-request';
const SuperBlock = () => {
const [error, setError] = useState<Error | null>(null)... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/save-challenge.tsx | tools/challenge-editor/client/src/components/buttons/save-challenge.tsx | import React from 'react';
import { ChallengeContentRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const SaveChallenge = ({
superblock,
block,
challenge,
content
}: ChallengeContentRequiredProps) => {
const click = handleReques... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/insert-step.tsx | tools/challenge-editor/client/src/components/buttons/insert-step.tsx | import React, { useState } from 'react';
import { BlockRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const InsertStep = ({ superblock, block }: BlockRequiredProps) => {
const [num, setNum] = useState(0);
const click = handleRequest... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/update-step-titles.tsx | tools/challenge-editor/client/src/components/buttons/update-step-titles.tsx | import React from 'react';
import { BlockRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const UpdateStepTitles = ({ superblock, block }: BlockRequiredProps) => {
const click = handleRequest(() =>
fetch(
`${API_LOCATION}/${sup... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/create-empty-steps.tsx | tools/challenge-editor/client/src/components/buttons/create-empty-steps.tsx | import React, { useState } from 'react';
import { BlockRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const CreateEmptySteps = ({ superblock, block }: BlockRequiredProps) => {
const [num, setNum] = useState(0);
const click = handleR... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/create-next-step.tsx | tools/challenge-editor/client/src/components/buttons/create-next-step.tsx | import React from 'react';
import { BlockRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const CreateNextStep = ({ superblock, block }: BlockRequiredProps) => {
const click = handleRequest(() =>
fetch(
`${API_LOCATION}/${super... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/buttons/delete-step.tsx | tools/challenge-editor/client/src/components/buttons/delete-step.tsx | import React, { useState } from 'react';
import { BlockRequiredProps } from '../../../interfaces/prop-types';
import { API_LOCATION, handleRequest } from '../../utils/handle-request';
const DeleteStep = ({ superblock, block }: BlockRequiredProps) => {
const [num, setNum] = useState(0);
const click = handleRequest... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/landing/landing.tsx | tools/challenge-editor/client/src/components/landing/landing.tsx | import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { SuperBlock } from '../../../interfaces/super-block';
import { API_LOCATION } from '../../utils/handle-request';
const Landing = () => {
const [error, setError] = useState<Error | null>(null);
const [loading, setLo... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/editor/editor.tsx | tools/challenge-editor/client/src/components/editor/editor.tsx | import React, { useEffect, useState } from 'react';
import CodeMirror from '@uiw/react-codemirror';
import * as codemirror from 'codemirror';
import 'codemirror/lib/codemirror.css';
import 'codemirror/theme/material.css';
import 'codemirror/mode/markdown/markdown';
// we need to import this mode to get the fenced codeb... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/block/block.tsx | tools/challenge-editor/client/src/components/block/block.tsx | import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import {
ChallengeData,
ChallengeDataWithBlock
} from '../../../interfaces/challenge-data';
import { API_LOCATION } from '../../utils/handle-request';
import './block.css';
const stepBasedSuperblocks = [
'scie... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/chapter/chapter.tsx | tools/challenge-editor/client/src/components/chapter/chapter.tsx | import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import { API_LOCATION } from '../../utils/handle-request';
import { Module, ChaptersWithLocation } from '../../../interfaces/chapter';
const ChapterLanding = () => {
const [error, setError] = useState<Error | null... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/module/module.tsx | tools/challenge-editor/client/src/components/module/module.tsx | import React, { useEffect, useState } from 'react';
import { Link, useParams } from 'react-router-dom';
import { API_LOCATION } from '../../utils/handle-request';
import { Block, BlocksWithModule } from '../../../interfaces/block';
const ModuleLanding = () => {
const [error, setError] = useState<Error | null>(null);... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/components/header/header.tsx | tools/challenge-editor/client/src/components/header/header.tsx | import React from 'react';
import './header.css';
const Header = () => {
return (
<div className='header'>
<p>
<a href='/'>freeCodeCamp Challenge Editor</a>
</p>
</div>
);
};
export default Header;
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/src/utils/handle-request.ts | tools/challenge-editor/client/src/utils/handle-request.ts | export const handleRequest = (makeRequest: () => Promise<Response>) => () => {
makeRequest()
.then(
res =>
res.json() as Promise<{
stdout?: string;
stderr?: string;
message?: string;
}>
)
.then(data => {
if (data.message) {
alert(data.messa... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/prop-types.ts | tools/challenge-editor/client/interfaces/prop-types.ts | export interface BlockRequiredProps {
superblock?: string;
block?: string;
}
export interface ChallengeContentRequiredProps extends BlockRequiredProps {
challenge?: string;
content: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/block.ts | tools/challenge-editor/client/interfaces/block.ts | export interface Block {
name: string;
path: string;
}
export interface BlocksWithSuperBlock {
blocks: Block[];
currentSuperBlock: string;
}
export interface BlocksWithModule {
blocks: Block[];
currentModule: string;
currentChapter: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/challenge-content.ts | tools/challenge-editor/client/interfaces/challenge-content.ts | export interface ChallengeContent {
name: string;
fileData: string;
dashedName: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/challenge-data.ts | tools/challenge-editor/client/interfaces/challenge-data.ts | export interface ChallengeData {
name: string;
id: string;
path: string;
}
export interface ChallengeDataWithBlock {
steps: ChallengeData[];
currentBlock: string;
currentSuperBlock: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/chapter.ts | tools/challenge-editor/client/interfaces/chapter.ts | export interface Module {
name: string;
path: string;
}
export interface ChaptersWithLocation {
modules: Module[];
currentSuperBlock: string;
currentChapter: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-editor/client/interfaces/super-block.ts | tools/challenge-editor/client/interfaces/super-block.ts | export interface SuperBlock {
name: string;
path: string;
}
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/sass-compile.ts | tools/client-plugins/browser-scripts/sass-compile.ts | // work around for SASS error in Edge
// https://github.com/medialize/sass.js/issues/96#issuecomment-424386171
interface WorkerWithSass extends Worker {
Sass: {
compile(data: unknown, callback: unknown): void;
};
}
const ctx: WorkerWithSass & typeof globalThis =
self as unknown as WorkerWithSass & typeof glo... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/python-worker.ts | tools/client-plugins/browser-scripts/python-worker.ts | // We have to specify pyodide.js because we need to import that file (not .mjs)
// and 'import' defaults to .mjs.
// This is to do with how webpack handles node fallbacks - it uses the node
// resolution algorithm to find the file, but that requires the full file name.
// We can't add the extension, because it's in a ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/index.d.ts | tools/client-plugins/browser-scripts/index.d.ts | import type { PyodideInterface } from 'pyodide';
export interface FrameDocument extends Document {
__initTestFrame: (e: InitTestFrameArg) => Promise<void>;
__runTest: (
testString: string
) => Promise<
{ pass: boolean } | { err: { message: string; stack?: string } }
>;
}
export interface PythonDocumen... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/test-runner.ts | tools/client-plugins/browser-scripts/test-runner.ts | export type { FCCTestRunner } from '@freecodecamp/curriculum-helpers/test-runner.js';
export { version } from '@freecodecamp/curriculum-helpers/package.json';
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/typescript-worker.ts | tools/client-plugins/browser-scripts/typescript-worker.ts | import { Compiler } from './modules/typescript-compiler';
// Most of the ts types are only a guideline. This is because we're not bundling
// TS in this worker. The specific TS version is going to be determined by the
// challenge (in general - it will be hardcoded in the MVP). So, the vfs types
// should be correct, ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/client-plugins/browser-scripts/modules/typescript-compiler.ts | tools/client-plugins/browser-scripts/modules/typescript-compiler.ts | import type { VirtualTypeScriptEnvironment } from '@typescript/vfs';
import type { CompilerHost, CompilerOptions } from 'typescript';
import reactTypes from './react-types.json';
type TS = typeof import('typescript');
type TSVFS = typeof import('@typescript/vfs');
export class Compiler {
ts: TS;
tsvfs: TSVFS;
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/commands.ts | tools/challenge-helper-scripts/commands.ts | import fs from 'fs';
import { getProjectPath } from './helpers/get-project-info.js';
import { getMetaData } from './helpers/project-metadata.js';
import {
createStepFile,
deleteStepFromMeta,
getChallenge,
insertStepIntoMeta,
updateStepTitles
} from './utils.js';
async function deleteStep(stepNum: number): Pr... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/reorder-tasks.ts | tools/challenge-helper-scripts/reorder-tasks.ts | import { updateTaskMeta, updateTaskMarkdownFiles } from './utils.js';
const reorderTasks = async () => {
await updateTaskMeta();
console.log("Finished updating tasks in 'meta.json'.");
updateTaskMarkdownFiles();
console.log('Finished updating task markdown files.');
};
void reorderTasks();
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/utils.ts | tools/challenge-helper-scripts/utils.ts | import fs from 'fs';
import path from 'path';
import { ObjectId } from 'bson';
import matter from 'gray-matter';
import { uniq } from 'lodash';
import { challengeTypes } from '../../shared-dist/config/challenge-types.js';
import { parseCurriculumStructure } from '../../curriculum/src/build-curriculum.js';
import { par... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/rename-block.ts | tools/challenge-helper-scripts/rename-block.ts | import fs from 'fs/promises';
import path, { join } from 'path';
import { prompt } from 'inquirer';
import { format } from 'prettier';
import { IntroJson, parseJson } from './helpers/parse-json';
import { withTrace } from './helpers/utils';
import { getAllBlocks, validateBlockName } from './utils';
import {
getBlock... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-next-step.ts | tools/challenge-helper-scripts/create-next-step.ts | import { getLastStep } from './helpers/get-last-step-file-number.js';
import { insertStep } from './commands.js';
void insertStep(getLastStep().stepNum + 1);
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-empty-steps.ts | tools/challenge-helper-scripts/create-empty-steps.ts | import { getArgValue } from './helpers/get-arg-value.js';
import { createEmptySteps } from './commands.js';
void createEmptySteps(getArgValue(process.argv));
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-next-task.ts | tools/challenge-helper-scripts/create-next-task.ts | import { ObjectId } from 'bson';
import { getTemplate } from './helpers/get-challenge-template.js';
import { newTaskPrompts } from './helpers/new-task-prompts.js';
import { getProjectPath } from './helpers/get-project-info.js';
import { getMetaData, updateMetaData } from './helpers/project-metadata.js';
import {
crea... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/update-challenge-order.ts | tools/challenge-helper-scripts/update-challenge-order.ts | import { prompt } from 'inquirer';
import { getMetaData, updateMetaData } from './helpers/project-metadata.js';
const updateChallengeOrder = async () => {
const oldChallengeOrder = getMetaData().challengeOrder;
console.log('Current challenge order is: ');
console.table(oldChallengeOrder.map(({ title }) => ({ ti... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-project.ts | tools/challenge-helper-scripts/create-project.ts | import fs from 'fs/promises';
import path from 'path';
import { prompt } from 'inquirer';
import { format } from 'prettier';
import { ObjectId } from 'bson';
import {
SuperBlocks,
chapterBasedSuperBlocks
} from '../../shared-dist/config/curriculum.js';
import { BlockLayouts, BlockLabel } from '../../shared-dist/co... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/delete-task.ts | tools/challenge-helper-scripts/delete-task.ts | import { unlink } from 'fs/promises';
import { prompt } from 'inquirer';
import { getProjectPath } from './helpers/get-project-info.js';
import { getFileName } from './helpers/get-file-name.js';
import {
deleteChallengeFromMeta,
updateTaskMarkdownFiles,
updateTaskMeta
} from './utils.js';
import { isTaskChallenge... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/utils.test.ts | tools/challenge-helper-scripts/utils.test.ts | import fs from 'fs';
import path, { join } from 'path';
import matter from 'gray-matter';
import { ObjectId } from 'bson';
import { vi, describe, it, expect, afterEach } from 'vitest';
vi.mock('fs', () => {
return {
default: {
writeFileSync: vi.fn(),
readdirSync: vi.fn()
}
};
});
vi.mock('gray... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-next-challenge.ts | tools/challenge-helper-scripts/create-next-challenge.ts | import { ObjectId } from 'bson';
import { getTemplate } from './helpers/get-challenge-template.js';
import { newChallengePrompts } from './helpers/new-challenge-prompts.js';
import { getProjectPath } from './helpers/get-project-info.js';
import { getMetaData, updateMetaData } from './helpers/project-metadata.js';
impor... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/rename-challenge-files.ts | tools/challenge-helper-scripts/rename-challenge-files.ts | import { exec } from 'child_process';
import { readFile, readdir } from 'fs/promises';
import { join } from 'path';
import { promisify } from 'util';
import gray from 'gray-matter';
import { prompt } from 'inquirer';
const asyncExec = promisify(exec);
void (async () => {
const superblocks = await readdir(
join... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/update-step-titles.ts | tools/challenge-helper-scripts/update-step-titles.ts | import { updateStepTitles } from './utils.js';
updateStepTitles();
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/insert-task.ts | tools/challenge-helper-scripts/insert-task.ts | import { ObjectId } from 'bson';
import { prompt } from 'inquirer';
import { getTemplate } from './helpers/get-challenge-template.js';
import { newTaskPrompts } from './helpers/new-task-prompts.js';
import { getProjectPath } from './helpers/get-project-info.js';
import {
createChallengeFile,
getChallenge,
insertC... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/insert-step.ts | tools/challenge-helper-scripts/insert-step.ts | import { getArgValue } from './helpers/get-arg-value.js';
import { insertStep } from './commands.js';
void insertStep(getArgValue(process.argv));
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/delete-step.ts | tools/challenge-helper-scripts/delete-step.ts | import { deleteStep } from './commands.js';
import { getArgValue } from './helpers/get-arg-value.js';
void deleteStep(getArgValue(process.argv));
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-this-challenge.ts | tools/challenge-helper-scripts/create-this-challenge.ts | /*
* This is a one-off script to create challenges with specific markdown. Fill in
* the content below where the comments suggest. When you are done, go to the
* English block folder where you want to create the challenge in the terminal,
* and run `pnpm create-this-challenge`. It will use the Object ID as the
* f... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-daily-challenges.ts | tools/challenge-helper-scripts/create-daily-challenges.ts | /*
Script to create daily coding challenge files in the dev-playground superblock.
Accepts a number arg for how many challenges to create.
*/
import { readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { ObjectId } from 'bson';
import { Meta } from './helpers/project-metadata.js';
import ... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-language-block.ts | tools/challenge-helper-scripts/create-language-block.ts | import fs from 'fs/promises';
import path from 'path';
import { prompt } from 'inquirer';
import { format } from 'prettier';
import { ObjectId } from 'bson';
import {
SuperBlocks,
languageSuperBlocks,
chapterBasedSuperBlocks
} from '../../shared-dist/config/curriculum.js';
import { BlockLayouts, BlockLabel } fr... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/reset.d.ts | tools/challenge-helper-scripts/reset.d.ts | import '@total-typescript/ts-reset';
| typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/create-quiz.ts | tools/challenge-helper-scripts/create-quiz.ts | import fs from 'fs/promises';
import path from 'path';
import { prompt } from 'inquirer';
import { format } from 'prettier';
import { ObjectId } from 'bson';
import { SuperBlocks } from '../../shared-dist/config/curriculum.js';
import {
createBlockFolder,
writeBlockStructure
} from '../../curriculum/src/file-handl... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/delete-challenge.ts | tools/challenge-helper-scripts/delete-challenge.ts | import { unlink } from 'fs/promises';
import { prompt } from 'inquirer';
import { getProjectPath } from './helpers/get-project-info.js';
import { getMetaData, updateMetaData } from './helpers/project-metadata.js';
import { getFileName } from './helpers/get-file-name.js';
const deleteChallenge = async () => {
const p... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/insert-challenge.ts | tools/challenge-helper-scripts/insert-challenge.ts | import { ObjectId } from 'bson';
import { prompt } from 'inquirer';
import { getTemplate } from './helpers/get-challenge-template.js';
import { newChallengePrompts } from './helpers/new-challenge-prompts.js';
import { getProjectPath } from './helpers/get-project-info.js';
import { getMetaData, updateMetaData } from './... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/helpers/get-lang-from-superblock.ts | tools/challenge-helper-scripts/helpers/get-lang-from-superblock.ts | import {
ChallengeLang,
SuperBlocks,
superBlockToSpeechLang
} from '../../../shared-dist/config/curriculum.js';
export const getLangFromSuperBlock = (
superBlock: SuperBlocks
): ChallengeLang => {
const lang = superBlockToSpeechLang[superBlock];
if (!lang) {
throw new Error(`Missing lang mapping for su... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/helpers/new-task-prompts.ts | tools/challenge-helper-scripts/helpers/new-task-prompts.ts | import { prompt } from 'inquirer';
import { challengeTypes } from '../../../shared-dist/config/challenge-types.js';
const taskChallenges = [
challengeTypes.multipleChoice,
challengeTypes.fillInTheBlank,
challengeTypes.generic
];
export const newTaskPrompts = async (): Promise<{
challengeType: string;
}> => {
... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/helpers/create-project.test.ts | tools/challenge-helper-scripts/helpers/create-project.test.ts | import { describe, it, expect, beforeEach, vi } from 'vitest';
import {
getSuperblockStructure,
writeSuperblockStructure
} from '../../../curriculum/src/file-handler.js';
import {
updateChapterModuleSuperblockStructure,
updateSimpleSuperblockStructure
} from './create-project.js';
vi.mock('../../../curriculum/... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/helpers/get-input-type.ts | tools/challenge-helper-scripts/helpers/get-input-type.ts | import { prompt } from 'inquirer';
import { ChallengeLang } from '../../../shared-dist/config/curriculum.js';
import { challengeTypes } from '../../../shared-dist/config/challenge-types.js';
export const getInputType = async (
challengeType: string,
challengeLang?: string
): Promise<string | undefined> => {
cons... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
freeCodeCamp/freeCodeCamp | https://github.com/freeCodeCamp/freeCodeCamp/blob/7d58ef2062b457d9370a7f730fc875f92ad28a80/tools/challenge-helper-scripts/helpers/project-metadata.ts | tools/challenge-helper-scripts/helpers/project-metadata.ts | import path from 'path';
import {
getBlockStructure,
writeBlockStructure
} from '../../../curriculum/src/file-handler.js';
import { getProjectPath } from './get-project-info.js';
export type Meta = {
name: string;
blockLayout: string;
blockLabel: string;
isUpcomingChange: boolean;
dashedName: string;
h... | typescript | BSD-3-Clause | 7d58ef2062b457d9370a7f730fc875f92ad28a80 | 2026-01-04T15:25:31.297347Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.