mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore: update Knip to v5 (#56244)
This commit is contained in:
@@ -80,11 +80,9 @@
|
||||
"@babel/cli": "7.17.10",
|
||||
"@babel/core": "7.18.0",
|
||||
"@babel/node": "7.17.10",
|
||||
"@babel/plugin-proposal-class-properties": "7.17.12",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.18.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.17.12",
|
||||
"@babel/preset-env": "7.18.0",
|
||||
"@babel/register": "7.17.7",
|
||||
"loopback-component-explorer": "6.4.0",
|
||||
"nodemon": "2.0.16"
|
||||
}
|
||||
|
||||
@@ -215,11 +215,6 @@ const completedExamChallenge = {
|
||||
completedDate: expect.any(Number)
|
||||
};
|
||||
|
||||
export const completedExamChallengeZeroCorrect = {
|
||||
...completedExamChallenge,
|
||||
examResults: mockResultsZeroCorrect
|
||||
};
|
||||
|
||||
export const completedExamChallengeOneCorrect = {
|
||||
...completedExamChallenge,
|
||||
examResults: mockResultsOneCorrect
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export const getCsrfToken = (setCookies: string[]): string | undefined => {
|
||||
return csrfToken;
|
||||
};
|
||||
|
||||
export const ORIGIN = 'https://www.freecodecamp.org';
|
||||
const ORIGIN = 'https://www.freecodecamp.org';
|
||||
|
||||
export const getCookies = (setCookies: string[]): string => {
|
||||
for (const cookie of setCookies) {
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ import {
|
||||
} from './utils/env';
|
||||
import { isObjectID } from './utils/validation';
|
||||
|
||||
export type FastifyInstanceWithTypeProvider = FastifyInstance<
|
||||
type FastifyInstanceWithTypeProvider = FastifyInstance<
|
||||
RawServerDefault,
|
||||
RawRequestDefaultExpression,
|
||||
RawReplyDefaultExpression,
|
||||
|
||||
@@ -48,7 +48,6 @@ assert.ok(isAllowedProvider(process.env.EMAIL_PROVIDER));
|
||||
assert.ok(process.env.AUTH0_CLIENT_ID);
|
||||
assert.ok(process.env.AUTH0_CLIENT_SECRET);
|
||||
assert.ok(process.env.AUTH0_DOMAIN);
|
||||
assert.ok(process.env.AUTH0_AUDIENCE);
|
||||
assert.ok(process.env.API_LOCATION);
|
||||
assert.ok(process.env.FCC_ENABLE_SWAGGER_UI);
|
||||
assert.ok(process.env.FCC_ENABLE_DEV_LOGIN_MODE);
|
||||
@@ -118,7 +117,6 @@ export const MONGOHQ_URL =
|
||||
export const FREECODECAMP_NODE_ENV = process.env.FREECODECAMP_NODE_ENV;
|
||||
export const AUTH0_CLIENT_ID = process.env.AUTH0_CLIENT_ID;
|
||||
export const AUTH0_DOMAIN = process.env.AUTH0_DOMAIN;
|
||||
export const AUTH0_AUDIENCE = process.env.AUTH0_AUDIENCE;
|
||||
export const AUTH0_CLIENT_SECRET = process.env.AUTH0_CLIENT_SECRET;
|
||||
export const PORT = process.env.PORT || '3000';
|
||||
export const HOST = process.env.HOST || 'localhost';
|
||||
|
||||
@@ -4,7 +4,7 @@ export interface Answer {
|
||||
}
|
||||
|
||||
// types for a generated exam
|
||||
export interface GeneratedQuestion {
|
||||
interface GeneratedQuestion {
|
||||
id: string;
|
||||
question: string;
|
||||
answers: Answer[];
|
||||
@@ -13,7 +13,7 @@ export interface GeneratedQuestion {
|
||||
export type GeneratedExam = GeneratedQuestion[];
|
||||
|
||||
// types for a user completed exam (from client)
|
||||
export interface UserQuestion {
|
||||
interface UserQuestion {
|
||||
id: string;
|
||||
question: string;
|
||||
answer: Answer;
|
||||
|
||||
@@ -24,7 +24,7 @@ function shuffleArray<T>(arr: T[]): T[] {
|
||||
* @param arr An array.
|
||||
* @returns The array without objects that have deprecated: true.
|
||||
*/
|
||||
export function filterDeprecated<T extends { deprecated: boolean | null }>(
|
||||
function filterDeprecated<T extends { deprecated: boolean | null }>(
|
||||
arr: T[]
|
||||
): T[] {
|
||||
return arr.filter(i => !i.deprecated);
|
||||
|
||||
+2
-25
@@ -41,7 +41,7 @@
|
||||
"@babel/plugin-transform-runtime": "^7.19.6",
|
||||
"@babel/preset-env": "7.23.7",
|
||||
"@babel/preset-react": "7.23.3",
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"@babel/standalone": "7.23.7",
|
||||
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
||||
"@fortawesome/free-brands-svg-icons": "6.4.2",
|
||||
@@ -49,7 +49,6 @@
|
||||
"@fortawesome/react-fontawesome": "0.2.0",
|
||||
"@freecodecamp/loop-protect": "3.0.0",
|
||||
"@freecodecamp/react-calendar-heatmap": "1.1.0",
|
||||
"@freecodecamp/strip-comments": "3.0.1",
|
||||
"@freecodecamp/ui": "1.2.0",
|
||||
"@growthbook/growthbook-react": "0.20.0",
|
||||
"@loadable/component": "5.16.3",
|
||||
@@ -60,33 +59,25 @@
|
||||
"@stripe/stripe-js": "1.54.2",
|
||||
"algoliasearch": "4.22.1",
|
||||
"assert": "2.0.0",
|
||||
"babel-loader": "8.3.0",
|
||||
"babel-plugin-preval": "5.1.0",
|
||||
"babel-plugin-prismjs": "2.1.0",
|
||||
"bezier-easing": "2.1.0",
|
||||
"browser-cookies": "1.2.0",
|
||||
"buffer": "6.0.3",
|
||||
"canvas-confetti": "^1.6.0",
|
||||
"chai": "4.4.1",
|
||||
"crypto-browserify": "3.12.0",
|
||||
"date-fns": "2.30.0",
|
||||
"enzyme": "3.11.0",
|
||||
"final-form": "4.20.10",
|
||||
"gatsby": "3.15.0",
|
||||
"gatsby-cli": "3.15.0",
|
||||
"gatsby-link": "3.15.0",
|
||||
"gatsby-plugin-advanced-sitemap": "2.1.0",
|
||||
"gatsby-plugin-create-client-paths": "3.15.0",
|
||||
"gatsby-plugin-manifest": "3.15.0",
|
||||
"gatsby-plugin-pnpm": "^1.2.10",
|
||||
"gatsby-plugin-postcss": "4.15.0",
|
||||
"gatsby-plugin-react-helmet": "4.15.0",
|
||||
"gatsby-plugin-remove-serviceworker": "1.0.0",
|
||||
"gatsby-remark-prismjs": "5.12.0",
|
||||
"gatsby-source-filesystem": "3.15.0",
|
||||
"gatsby-transformer-remark": "5.25.1",
|
||||
"i18next": "22.5.1",
|
||||
"jquery": "3.7.1",
|
||||
"lodash": "4.17.21",
|
||||
"lodash-es": "4.17.21",
|
||||
"micromark": "4.0.0",
|
||||
@@ -125,8 +116,6 @@
|
||||
"reselect": "4.1.8",
|
||||
"rxjs": "6.6.7",
|
||||
"sanitize-html": "2.11.0",
|
||||
"sass.js": "0.11.1",
|
||||
"sha-1": "1.0.0",
|
||||
"store": "2.0.12",
|
||||
"stream-browserify": "3.0.0",
|
||||
"tone": "14.7.77",
|
||||
@@ -139,15 +128,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@testing-library/jest-dom": "5.17.0",
|
||||
"@testing-library/react": "12.1.5",
|
||||
"@total-typescript/ts-reset": "^0.5.0",
|
||||
"@types/canvas-confetti": "^1.6.0",
|
||||
"@types/chai": "^4.3.4",
|
||||
"@types/enzyme": "^3.10.12",
|
||||
"@types/enzyme-adapter-react-16": "1.0.9",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/jquery": "^3.5.16",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/loadable__component": "5.13.8",
|
||||
"@types/lodash-es": "^4.17.6",
|
||||
@@ -169,18 +153,12 @@
|
||||
"@types/redux-actions": "2.6.5",
|
||||
"@types/sanitize-html": "^2.8.0",
|
||||
"@types/store": "^2.0.2",
|
||||
"@types/testing-library__jest-dom": "^5.14.5",
|
||||
"@types/validator": "^13.7.12",
|
||||
"autoprefixer": "10.4.17",
|
||||
"babel-plugin-macros": "3.1.0",
|
||||
"babel-plugin-transform-imports": "2.0.0",
|
||||
"chokidar": "3.6.0",
|
||||
"copy-webpack-plugin": "9.1.0",
|
||||
"core-js": "2.6.12",
|
||||
"dotenv": "16.4.5",
|
||||
"eslint-plugin-testing-library": "^3.9.0",
|
||||
"gatsby-plugin-webpack-bundle-analyser-v2": "1.1.32",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"jest-json-schema-extended": "1.0.1",
|
||||
"joi": "17.12.2",
|
||||
"js-yaml": "4.1.0",
|
||||
@@ -190,7 +168,6 @@
|
||||
"redux-saga-test-plan": "4.0.6",
|
||||
"serve": "13.0.4",
|
||||
"ts-node": "10.9.2",
|
||||
"webpack": "5.90.3",
|
||||
"webpack-cli": "4.10.0"
|
||||
"webpack": "5.90.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export const ThankYouMessage = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const OtherWaysToSupport = (): JSX.Element => {
|
||||
const OtherWaysToSupport = (): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
@@ -225,7 +225,7 @@ export const SupportBenefitsText = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const BenefitsList = (): JSX.Element => {
|
||||
const BenefitsList = (): JSX.Element => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<ul>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Button } from '@freecodecamp/ui';
|
||||
|
||||
import Link from './link';
|
||||
|
||||
export type ButtonSize = 'small' | 'medium' | 'large';
|
||||
type ButtonSize = 'small' | 'medium' | 'large';
|
||||
|
||||
interface Props extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
||||
children: React.ReactNode;
|
||||
|
||||
@@ -5,20 +5,6 @@ const { clientLocale } = envData;
|
||||
|
||||
const localeCode = getLangCode(clientLocale);
|
||||
|
||||
const formatYears = (array: string[], t: TFunction): string => {
|
||||
return array.reduce((string, item, index, array) => {
|
||||
if (string.length > 0) {
|
||||
if (index === array.length - 1) {
|
||||
return `${string} ${t('misc.and')} ${item}`;
|
||||
} else {
|
||||
return `${string}, ${item}`;
|
||||
}
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const parseDate = (joinDate: string, t: TFunction): string => {
|
||||
const convertedJoinDate = new Date(joinDate);
|
||||
const date = convertedJoinDate.toLocaleString([localeCode, 'en-US'], {
|
||||
@@ -28,4 +14,4 @@ const parseDate = (joinDate: string, t: TFunction): string => {
|
||||
return t('profile.joined', { date: date });
|
||||
};
|
||||
|
||||
export { formatYears, parseDate };
|
||||
export { parseDate };
|
||||
|
||||
@@ -6,7 +6,7 @@ export const hastag = '%23';
|
||||
export const nextLine = '%0A';
|
||||
export const action = 'intent/tweet';
|
||||
export const twitterDomain = 'twitter.com';
|
||||
export const freecodecampLearnDomainURL = 'www.freecodecamp.org/learn';
|
||||
const freecodecampLearnDomainURL = 'www.freecodecamp.org/learn';
|
||||
export const twitterDevelpoerDomainURL = 'https://developer.twitter.com';
|
||||
|
||||
export const useShare = ({ superBlock, block }: ShareProps): string => {
|
||||
|
||||
@@ -30,7 +30,7 @@ export type MarkdownRemark = {
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type MultipleChoiceAnswer = {
|
||||
type MultipleChoiceAnswer = {
|
||||
answer: string;
|
||||
feedback: string | null;
|
||||
};
|
||||
@@ -71,7 +71,7 @@ export interface VideoLocaleIds {
|
||||
}
|
||||
|
||||
// English types for animations
|
||||
export interface Dialogue {
|
||||
interface Dialogue {
|
||||
text: string;
|
||||
align: 'left' | 'right' | 'center';
|
||||
}
|
||||
@@ -82,7 +82,7 @@ export interface CharacterPosition {
|
||||
z?: number;
|
||||
}
|
||||
|
||||
export interface SceneCommand {
|
||||
interface SceneCommand {
|
||||
background?: string;
|
||||
character: string;
|
||||
position?: CharacterPosition;
|
||||
@@ -117,21 +117,21 @@ export type Characters =
|
||||
| 'Sophie'
|
||||
| 'Tom';
|
||||
|
||||
export interface SetupCharacter {
|
||||
interface SetupCharacter {
|
||||
character: Characters;
|
||||
position: CharacterPosition;
|
||||
opacity: number;
|
||||
isTalking?: boolean;
|
||||
}
|
||||
|
||||
export interface SetupAudio {
|
||||
interface SetupAudio {
|
||||
filename: string;
|
||||
startTime: number;
|
||||
startTimestamp?: number;
|
||||
finishTimestamp?: number;
|
||||
}
|
||||
|
||||
export interface SceneSetup {
|
||||
interface SceneSetup {
|
||||
background: string;
|
||||
characters: SetupCharacter[];
|
||||
audio: SetupAudio;
|
||||
@@ -456,7 +456,7 @@ export interface GeneratedExamQuestion {
|
||||
answers: GeneratedExamAnswer[];
|
||||
}
|
||||
|
||||
export interface GenerateExamResponse {
|
||||
interface GenerateExamResponse {
|
||||
error?: string;
|
||||
generatedExam?: GeneratedExamQuestion[];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ export const partiallyCompletedChallengesSelector = state =>
|
||||
userSelector(state).partiallyCompletedChallenges || [];
|
||||
export const currentChallengeIdSelector = state =>
|
||||
state[MainApp].currentChallengeId;
|
||||
export const completionCountSelector = state => state[MainApp].completionCount;
|
||||
export const isRandomCompletionThresholdSelector = state =>
|
||||
state[MainApp].isRandomCompletionThreshold;
|
||||
export const isDonatingSelector = state => userSelector(state).isDonating;
|
||||
|
||||
@@ -46,6 +46,6 @@ export const initializeMathJax = (mathJaxChallenge = true) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const mathJaxScriptLoader = () => {
|
||||
const mathJaxScriptLoader = () => {
|
||||
scriptLoader('mathjax', false, mathJaxSrc, configure, '');
|
||||
};
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
const challengePageCreators = require('./challenge-page-creator');
|
||||
|
||||
module.exports = {
|
||||
...challengePageCreators
|
||||
};
|
||||
module.exports = require('./challenge-page-creator');
|
||||
|
||||
+1
-11
@@ -41,18 +41,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.23.7",
|
||||
"@babel/preset-env": "7.23.7",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"@babel/register": "7.23.7",
|
||||
"@compodoc/live-server": "^1.2.3",
|
||||
"babel-plugin-dynamic-import-node": "2.3.3",
|
||||
"babel-plugin-lodash": "3.3.4",
|
||||
"babel-plugin-transform-runtime": "6.23.0",
|
||||
"babel-preset-env": "1.7.0",
|
||||
"babel-preset-react": "6.24.1",
|
||||
"babel-preset-stage-0": "6.24.1",
|
||||
"chai": "4.4.1",
|
||||
"css": "3.0.0",
|
||||
"glob": "8.1.0",
|
||||
"invariant": "2.2.4",
|
||||
"joi": "17.12.2",
|
||||
@@ -65,7 +56,6 @@
|
||||
"ora": "5.4.1",
|
||||
"puppeteer": "22.12.1",
|
||||
"readdirp": "3.6.0",
|
||||
"string-similarity": "4.0.4",
|
||||
"unist-util-visit": "2.0.3"
|
||||
"string-similarity": "4.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
+43
-15
@@ -1,27 +1,55 @@
|
||||
{
|
||||
"$schema": "https://unpkg.com/knip@1/schema.json",
|
||||
|
||||
"ignore": "**/*.d.ts",
|
||||
|
||||
// Only workspaces with a configuration below are analyzed by Knip
|
||||
"$schema": "https://unpkg.com/knip@5/schema.json",
|
||||
"ignoreBinaries": ["create:shared", "install-puppeteer", "pm2"],
|
||||
"ignoreWorkspaces": ["api-server"], // Ignored based on https://github.com/freeCodeCamp/freeCodeCamp/pull/52330#issuecomment-1807917235
|
||||
"workspaces": {
|
||||
".": {
|
||||
// No custom entry/project files in root workspace to not interfere with workspaces that are not set up yet
|
||||
"entry": []
|
||||
"playwright": [
|
||||
"playwright.config.ts",
|
||||
"playwright-mobile.config.ts" // How/where is this file used?
|
||||
],
|
||||
"ignore": ["tools/scripts/redirect-gen.ts"] // Referenced in tools/scripts/redirect-gen.ts
|
||||
},
|
||||
"api": {
|
||||
"ignoreDependencies": ["pino-pretty"] // Knip doesn't have a fastify plugin yet
|
||||
},
|
||||
"client": {
|
||||
"entry": ["static/**/*.js"],
|
||||
"webpack": "webpack-workers.js",
|
||||
"ignore": ["**/__mocks__"]
|
||||
"ignore": [
|
||||
"**/__mocks__/**",
|
||||
"tailwind.config.js",
|
||||
"src/assets/icons/*.tsx" // Ignored based on https://github.com/freeCodeCamp/freeCodeCamp/pull/56244#issuecomment-2367830791
|
||||
],
|
||||
"ignoreDependencies": [
|
||||
"core-js",
|
||||
// Node.js built-ins need to be ignored
|
||||
"process",
|
||||
"util",
|
||||
"assert",
|
||||
"@redux-saga/core" // Not referenced, something seems off related to peer dep and types
|
||||
]
|
||||
},
|
||||
"client/plugins/*": {
|
||||
"entry": "gatsby-node.js"
|
||||
"curriculum": {
|
||||
"ignoreDependencies": ["invariant"] // Used from another workspace: shared/utils/polyvinyl.js
|
||||
},
|
||||
"shared": {
|
||||
"ignore": ["{config,utils}/*.ts"] // Using the same dir for src + outDir files with tsc confuses Knip
|
||||
},
|
||||
"tools/challenge-helper-scripts": {
|
||||
"ignoreBinaries": ["mocha"] // Test setup in this workspace seems to be in need of a checkup
|
||||
},
|
||||
"tools/challenge-parser": {
|
||||
"entry": ["parser/tools/*.js"] // Files not referenced/documented?
|
||||
},
|
||||
"tools/client-plugins/browser-scripts": {
|
||||
"ignoreDependencies": ["sass.js", "xterm", "process", "util"] // Node.js built-ins need to be ignored
|
||||
},
|
||||
"tools/scripts/build": {
|
||||
"entry": ["*.ts"]
|
||||
},
|
||||
"tools/scripts/seed-exams": {
|
||||
"entry": ["add-nano-ids.js"] // Referenced in tools/scripts/seed-exams/README.md
|
||||
}
|
||||
},
|
||||
"ignoreDependencies": [
|
||||
// framerunner throws error if removed
|
||||
"@babel/runtime"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+9
-14
@@ -19,7 +19,7 @@
|
||||
"author": "freeCodeCamp <team@freecodecamp.org>",
|
||||
"main": "none",
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"preinstall": "npx -y only-allow pnpm",
|
||||
"audit-challenges": "pnpm run create:shared && ts-node tools/challenge-auditor/index.ts",
|
||||
"analyze-bundle": "webpack-bundle-analyzer",
|
||||
"prebuild": "npm-run-all create:shared",
|
||||
@@ -48,8 +48,8 @@
|
||||
"format:eslint": "eslint . --fix",
|
||||
"format:prettier": "prettier --write .",
|
||||
"i18n-sync": "ts-node ./tools/scripts/sync-i18n.ts",
|
||||
"knip": "npx -y knip@1 --include files",
|
||||
"knip:all": "npx -y knip@1",
|
||||
"knip": "npx -y knip@5 --include files",
|
||||
"knip:all": "npx -y knip@5 ",
|
||||
"prelint": "pnpm run -F=client predevelop",
|
||||
"lint": "NODE_OPTIONS=\"--max-old-space-size=7168\" npm-run-all create:shared -p lint:*",
|
||||
"lint:challenges": "cd ./curriculum && pnpm run lint",
|
||||
@@ -90,22 +90,17 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/eslint-parser": "7.23.3",
|
||||
"@babel/plugin-proposal-function-bind": "7.23.3",
|
||||
"@babel/preset-env": "7.23.7",
|
||||
"@babel/preset-react": "7.23.3",
|
||||
"@babel/preset-typescript": "7.23.3",
|
||||
"@playwright/test": "^1.47.1",
|
||||
"@testing-library/dom": "9.3.4",
|
||||
"@testing-library/jest-dom": "6.4.2",
|
||||
"@testing-library/user-event": "14.5.2",
|
||||
"@testing-library/jest-dom": "5.17.0",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/lodash": "4.14.202",
|
||||
"@types/node": "20.12.8",
|
||||
"@types/store": "2.0.5",
|
||||
"@types/testing-library__jest-dom": "^5.14.5",
|
||||
"@typescript-eslint/eslint-plugin": "7.1.1",
|
||||
"@typescript-eslint/parser": "7.1.1",
|
||||
"babel-jest": "29.7.0",
|
||||
"babel-plugin-transform-imports": "2.0.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-import-resolver-typescript": "^3.5.5",
|
||||
@@ -119,7 +114,9 @@
|
||||
"eslint-plugin-react-hooks": "4.6.0",
|
||||
"eslint-plugin-testing-library": "6.2.0",
|
||||
"husky": "9.0.11",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"js-yaml": "3.14.1",
|
||||
"lint-staged": "^13.1.0",
|
||||
"lodash": "4.17.21",
|
||||
@@ -127,12 +124,10 @@
|
||||
"npm-run-all2": "5.0.2",
|
||||
"prettier": "3.2.5",
|
||||
"prismjs": "1.29.0",
|
||||
"process": "0.11.10",
|
||||
"start-server-and-test": "2.0.3",
|
||||
"store": "2.0.12",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.4.5",
|
||||
"webpack-bundle-analyzer": "4.10.1",
|
||||
"yargs": "17.7.2"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@9.10.0+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
|
||||
}
|
||||
|
||||
Generated
+236
-1619
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,6 @@ SENTRY_ENVIRONMENT=staging
|
||||
AUTH0_CLIENT_ID=client_id_from_auth0_dashboard
|
||||
AUTH0_CLIENT_SECRET=client_secret_from_auth0_dashboard
|
||||
AUTH0_DOMAIN=example.auth0.com
|
||||
AUTH0_AUDIENCE=sample_audience
|
||||
|
||||
# Session, Cookie and JWT encryption strings
|
||||
SESSION_SECRET=a_thirty_two_plus_character_session_secret
|
||||
|
||||
@@ -87,16 +87,6 @@ function setExt(ext, poly) {
|
||||
return newPoly;
|
||||
}
|
||||
|
||||
// setImportedFiles(importedFiles: String[], poly: PolyVinyl) => PolyVinyl
|
||||
function setImportedFiles(importedFiles, poly) {
|
||||
checkPoly(poly);
|
||||
const newPoly = {
|
||||
...poly,
|
||||
importedFiles: [...importedFiles]
|
||||
};
|
||||
return newPoly;
|
||||
}
|
||||
|
||||
// This is currently only used to add back properties that are not stored in the
|
||||
// database.
|
||||
function regeneratePathAndHistory(poly) {
|
||||
@@ -162,7 +152,6 @@ module.exports = {
|
||||
isPoly,
|
||||
setContent,
|
||||
setExt,
|
||||
setImportedFiles,
|
||||
compileHeadTail,
|
||||
regeneratePathAndHistory,
|
||||
transformContents,
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
"react-dom": "16.14.0",
|
||||
"react-router-dom": "6.18.0",
|
||||
"typescript": "5.2.2",
|
||||
"vite": "4.5.2",
|
||||
"vite-tsconfig-paths": "4.2.1"
|
||||
"vite": "4.5.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "PORT=3300 vite",
|
||||
@@ -24,7 +23,6 @@
|
||||
"@types/react": "16.14.56",
|
||||
"@types/react-dom": "16.9.24",
|
||||
"@uiw/react-codemirror": "3.2.10",
|
||||
"eslint-plugin-react-hooks": "4.6.0",
|
||||
"shx": "0.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
@@ -5,7 +5,7 @@ const sanitizeTitle = (title: string) => {
|
||||
return title.includes(':') || title.includes("'") ? `"${title}"` : title;
|
||||
};
|
||||
|
||||
export interface ChallengeOptions {
|
||||
interface ChallengeOptions {
|
||||
challengeId: ObjectID;
|
||||
title: string;
|
||||
dashedName: string;
|
||||
@@ -37,7 +37,7 @@ challengeType: ${challengeType}
|
||||
dashedName: ${dashedName}
|
||||
---`;
|
||||
|
||||
export const getLegacyChallengeTemplate = (
|
||||
const getLegacyChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
@@ -70,7 +70,7 @@ Test 1
|
||||
\`\`\`
|
||||
`;
|
||||
|
||||
export const getQuizChallengeTemplate = (
|
||||
const getQuizChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
@@ -524,7 +524,7 @@ Placeholder answer
|
||||
|
||||
`;
|
||||
|
||||
export const getVideoChallengeTemplate = (
|
||||
const getVideoChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatterWithVideo(options)}
|
||||
|
||||
@@ -555,7 +555,7 @@ Answer 3
|
||||
1
|
||||
`;
|
||||
|
||||
export const getAssignmentChallengeTemplate = (
|
||||
const getAssignmentChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
@@ -590,7 +590,7 @@ Answer 3
|
||||
1
|
||||
`;
|
||||
|
||||
export const getMultipleChoiceChallengeTemplate = (
|
||||
const getMultipleChoiceChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
@@ -621,7 +621,7 @@ Answer 3
|
||||
1
|
||||
`;
|
||||
|
||||
export const getFillInTheBlankChallengeTemplate = (
|
||||
const getFillInTheBlankChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
@@ -648,7 +648,7 @@ It's \`in\`
|
||||
\`blank\`
|
||||
`;
|
||||
|
||||
export const getDialogueChallengeTemplate = (
|
||||
const getDialogueChallengeTemplate = (
|
||||
options: ChallengeOptions
|
||||
): string => `${buildFrontMatter(options)}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
const visitChildren = require('unist-util-visit-children');
|
||||
|
||||
function hasId(node, index, parent) {
|
||||
// image references should always be inside paragraphs.
|
||||
if (node.type !== 'paragraph') return;
|
||||
const idHolder = node.children[0];
|
||||
if (idHolder.type === 'imageReference') {
|
||||
if (node.children.length > 1) {
|
||||
console.log('oooops, too many links together!');
|
||||
// TODO: optional chaining
|
||||
} else if (
|
||||
parent.children[index + 1] &&
|
||||
parent.children[index + 1].type === 'code'
|
||||
) {
|
||||
console.log('found adjacent code block for id ' + idHolder.identifier);
|
||||
} else {
|
||||
console.log(
|
||||
'ooops! the id ' + idHolder.identifier + ' is not next to a code block'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function plugin() {
|
||||
// we don't want to recurse into the tree, hence visitChildren
|
||||
|
||||
const visit = visitChildren(hasId);
|
||||
return transformer;
|
||||
|
||||
function transformer(tree) {
|
||||
visit(tree);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = plugin;
|
||||
@@ -36,10 +36,8 @@
|
||||
"@types/jquery": "3.5.29",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"babel-loader": "8.3.0",
|
||||
"buffer": "6.0.3",
|
||||
"chai": "4.4.1",
|
||||
"copy-webpack-plugin": "9.1.0",
|
||||
"css-loader": "^6.8.1",
|
||||
"enzyme": "3.11.0",
|
||||
"enzyme-adapter-react-16": "1.15.8",
|
||||
"jquery": "3.7.1",
|
||||
@@ -47,14 +45,11 @@
|
||||
"process": "0.11.10",
|
||||
"pyodide": "^0.23.3",
|
||||
"sass.js": "0.11.1",
|
||||
"style-loader": "^3.3.3",
|
||||
"util": "0.12.5",
|
||||
"webpack": "5.90.3",
|
||||
"webpack-cli": "4.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"xterm": "^5.2.1",
|
||||
"xterm-addon-fit": "^0.8.0"
|
||||
"xterm": "^5.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
"joi": "17.12.2",
|
||||
"joi-objectid": "3.0.1",
|
||||
"js-yaml": "4.1.0",
|
||||
"lodash": "4.17.21",
|
||||
"mongodb": "5.9.2",
|
||||
"nanoid": "4.0.2"
|
||||
},
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
"devDependencies": {
|
||||
"debug": "4.3.4",
|
||||
"dotenv": "16.4.5",
|
||||
"lodash": "4.17.21",
|
||||
"mongodb": "5.9.2"
|
||||
}
|
||||
}
|
||||
|
||||
+12253
-12251
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user