mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 10:22:16 +00:00
refactor: bundle shared so each consumer can require/import without hassle (#64167)
This commit is contained in:
committed by
GitHub
parent
ddfd598eb4
commit
f03ad05e84
@@ -155,7 +155,7 @@ jobs:
|
|||||||
- name: Install and Build
|
- name: Install and Build
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm compile:ts
|
pnpm turbo compile
|
||||||
pnpm run build:curriculum
|
pnpm run build:curriculum
|
||||||
|
|
||||||
- name: Start apps
|
- name: Start apps
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ jobs:
|
|||||||
- name: Install and Build
|
- name: Install and Build
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm compile:ts
|
pnpm turbo compile
|
||||||
pnpm run build:curriculum
|
pnpm run build:curriculum
|
||||||
|
|
||||||
- name: Start apps
|
- name: Start apps
|
||||||
|
|||||||
@@ -151,10 +151,6 @@ jspm_packages/
|
|||||||
### Netlify ###
|
### Netlify ###
|
||||||
.netlify
|
.netlify
|
||||||
|
|
||||||
### Generated config files ###
|
|
||||||
shared/tsconfig.tsbuildinfo
|
|
||||||
curriculum/tsconfig.tsbuildinfo
|
|
||||||
|
|
||||||
### Old Generated files ###
|
### Old Generated files ###
|
||||||
# These files are no longer generated by the client, but can
|
# These files are no longer generated by the client, but can
|
||||||
# exist on older branches. Continuing to ignore them ensures they
|
# exist on older branches. Continuing to ignore them ensures they
|
||||||
@@ -197,7 +193,6 @@ curriculum/curricula.json
|
|||||||
curriculum/dist
|
curriculum/dist
|
||||||
curriculum/build
|
curriculum/build
|
||||||
curriculum/src/test/blocks-generated
|
curriculum/src/test/blocks-generated
|
||||||
shared-dist
|
|
||||||
|
|
||||||
### Playwright ###
|
### Playwright ###
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ tasks:
|
|||||||
cp sample.env .env &&
|
cp sample.env .env &&
|
||||||
pnpm install &&
|
pnpm install &&
|
||||||
gp sync-done pnpm-install &&
|
gp sync-done pnpm-install &&
|
||||||
pnpm compile:ts &&
|
pnpm turbo compile &&
|
||||||
pnpm run build:curriculum &&
|
pnpm run build:curriculum &&
|
||||||
gp ports await 27017
|
gp ports await 27017
|
||||||
command: >
|
command: >
|
||||||
|
|||||||
+1
-2
@@ -9,15 +9,14 @@ client/public
|
|||||||
curriculum/challenges/_meta/*/*
|
curriculum/challenges/_meta/*/*
|
||||||
curriculum/challenges/**/*
|
curriculum/challenges/**/*
|
||||||
curriculum/i18n-curriculum
|
curriculum/i18n-curriculum
|
||||||
|
curriculum/generated
|
||||||
docs/**/*.md
|
docs/**/*.md
|
||||||
/playwright
|
/playwright
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
shared/config/*.js
|
shared/config/*.js
|
||||||
shared/config/curriculum.json
|
|
||||||
shared/utils/get-lines.js
|
shared/utils/get-lines.js
|
||||||
shared/utils/get-lines.test.js
|
shared/utils/get-lines.test.js
|
||||||
shared/utils/is-audited.js
|
shared/utils/is-audited.js
|
||||||
shared/utils/validate.js
|
shared/utils/validate.js
|
||||||
shared/utils/validate.test.js
|
shared/utils/validate.test.js
|
||||||
shared-dist
|
|
||||||
dist
|
dist
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"@fastify/swagger": "9.6.1",
|
"@fastify/swagger": "9.6.1",
|
||||||
"@fastify/swagger-ui": "5.2.4",
|
"@fastify/swagger-ui": "5.2.4",
|
||||||
"@fastify/type-provider-typebox": "6.1.0",
|
"@fastify/type-provider-typebox": "6.1.0",
|
||||||
|
"@freecodecamp/shared": "workspace:*",
|
||||||
"@growthbook/growthbook": "1.6.2",
|
"@growthbook/growthbook": "1.6.2",
|
||||||
"@prisma/client": "6.19.1",
|
"@prisma/client": "6.19.1",
|
||||||
"@sentry/node": "9.47.1",
|
"@sentry/node": "9.47.1",
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
"description": "The freeCodeCamp.org open-source codebase and curriculum",
|
"description": "The freeCodeCamp.org open-source codebase and curriculum",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@freecodecamp/eslint-config": "workspace:*",
|
"@freecodecamp/eslint-config": "workspace:*",
|
||||||
|
"@freecodecamp/shared": "workspace:*",
|
||||||
"@total-typescript/ts-reset": "0.6.1",
|
"@total-typescript/ts-reset": "0.6.1",
|
||||||
"@types/jsonwebtoken": "9.0.5",
|
"@types/jsonwebtoken": "9.0.5",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
certSlugTypeMap,
|
certSlugTypeMap,
|
||||||
certToIdMap,
|
certToIdMap,
|
||||||
Certification
|
Certification
|
||||||
} from '../../../../shared/config/certification-settings.js';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import { normalizeDate } from '../../utils/normalize.js';
|
import { normalizeDate } from '../../utils/normalize.js';
|
||||||
|
|
||||||
const fullStackCertificateIds = [
|
const fullStackCertificateIds = [
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { isProfane } from 'no-profanity';
|
import { isProfane } from 'no-profanity';
|
||||||
|
|
||||||
import { blocklistedUsernames } from '../../../../shared/config/constants.js';
|
import { blocklistedUsernames } from '@freecodecamp/shared/config/constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a username is restricted (i.e. It's profane or reserved).
|
* Checks if a username is restricted (i.e. It's profane or reserved).
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
vi
|
vi
|
||||||
} from 'vitest';
|
} from 'vitest';
|
||||||
|
|
||||||
import { Certification } from '../../../../shared/config/certification-settings.js';
|
import { Certification } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import {
|
import {
|
||||||
defaultUserEmail,
|
defaultUserEmail,
|
||||||
defaultUserId,
|
defaultUserId,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
legacyCertifications,
|
legacyCertifications,
|
||||||
legacyFullStackCertification,
|
legacyFullStackCertification,
|
||||||
upcomingCertifications
|
upcomingCertifications
|
||||||
} from '../../../../shared/config/certification-settings.js';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
|
|
||||||
import * as schemas from '../../schemas.js';
|
import * as schemas from '../../schemas.js';
|
||||||
import { normalizeChallenges, removeNulls } from '../../utils/normalize.js';
|
import { normalizeChallenges, removeNulls } from '../../utils/normalize.js';
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import { Static } from '@fastify/type-provider-typebox';
|
|||||||
import { DailyCodingChallengeLanguage } from '@prisma/client';
|
import { DailyCodingChallengeLanguage } from '@prisma/client';
|
||||||
import request from 'supertest';
|
import request from 'supertest';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../../shared/config/challenge-types.js';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
defaultUserId,
|
defaultUserId,
|
||||||
devLogin,
|
devLogin,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { uniqBy, matches } from 'lodash-es';
|
|||||||
|
|
||||||
import validator from 'validator';
|
import validator from 'validator';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../../shared/config/challenge-types.js';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import * as schemas from '../../schemas.js';
|
import * as schemas from '../../schemas.js';
|
||||||
import {
|
import {
|
||||||
jsCertProjectIds,
|
jsCertProjectIds,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebo
|
|||||||
import Stripe from 'stripe';
|
import Stripe from 'stripe';
|
||||||
|
|
||||||
import * as schemas from '../../schemas.js';
|
import * as schemas from '../../schemas.js';
|
||||||
import { donationSubscriptionConfig } from '../../../../shared/config/donation-settings.js';
|
import { donationSubscriptionConfig } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { STRIPE_SECRET_KEY, HOME_LOCATION } from '../../utils/env.js';
|
import { STRIPE_SECRET_KEY, HOME_LOCATION } from '../../utils/env.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { FastifyError, FastifyInstance } from 'fastify';
|
|||||||
import { differenceInMinutes } from 'date-fns';
|
import { differenceInMinutes } from 'date-fns';
|
||||||
import validator from 'validator';
|
import validator from 'validator';
|
||||||
|
|
||||||
import { isValidUsername } from '../../../../shared/utils/validate.js';
|
import { isValidUsername } from '@freecodecamp/shared/utils/validate';
|
||||||
import * as schemas from '../../schemas.js';
|
import * as schemas from '../../schemas.js';
|
||||||
import { createAuthToken, isExpired } from '../../utils/tokens.js';
|
import { createAuthToken, isExpired } from '../../utils/tokens.js';
|
||||||
import { API_LOCATION } from '../../utils/env.js';
|
import { API_LOCATION } from '../../utils/env.js';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
certToIdMap,
|
certToIdMap,
|
||||||
completionHours,
|
completionHours,
|
||||||
oldDataVizId
|
oldDataVizId
|
||||||
} from '../../../../shared/config/certification-settings.js';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import {
|
import {
|
||||||
getFallbackFullStackDate,
|
getFallbackFullStackDate,
|
||||||
isKnownCertSlug
|
isKnownCertSlug
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { STRIPE_SECRET_KEY } from '../../utils/env.js';
|
|||||||
import {
|
import {
|
||||||
donationSubscriptionConfig,
|
donationSubscriptionConfig,
|
||||||
allStripeProductIdsArray
|
allStripeProductIdsArray
|
||||||
} from '../../../../shared/config/donation-settings.js';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import * as schemas from '../../schemas.js';
|
import * as schemas from '../../schemas.js';
|
||||||
import { inLastFiveMinutes } from '../../utils/validate-donation.js';
|
import { inLastFiveMinutes } from '../../utils/validate-donation.js';
|
||||||
import { findOrCreateUser } from '../helpers/auth-helpers.js';
|
import { findOrCreateUser } from '../helpers/auth-helpers.js';
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
getPoints,
|
getPoints,
|
||||||
ProgressTimestamp
|
ProgressTimestamp
|
||||||
} from '../../utils/progress.js';
|
} from '../../utils/progress.js';
|
||||||
import { challengeTypes } from '../../../../shared/config/challenge-types.js';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
|
|
||||||
type ProfileUI = Partial<{
|
type ProfileUI = Partial<{
|
||||||
isLocked: boolean;
|
isLocked: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Type } from '@fastify/type-provider-typebox';
|
import { Type } from '@fastify/type-provider-typebox';
|
||||||
import { Certification } from '../../../../shared/config/certification-settings.js';
|
import { Certification } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import { genericError } from '../types.js';
|
import { genericError } from '../types.js';
|
||||||
|
|
||||||
export const certSlug = {
|
export const certSlug = {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { ExamResults, user, Prisma } from '@prisma/client';
|
import type { ExamResults, user, Prisma } from '@prisma/client';
|
||||||
import { FastifyInstance } from 'fastify';
|
import { FastifyInstance } from 'fastify';
|
||||||
import { omit, pick } from 'lodash-es';
|
import { omit, pick } from 'lodash-es';
|
||||||
import { challengeTypes } from '../../../shared/config/challenge-types.js';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { challenges, savableChallenges } from './get-challenges.js';
|
import { challenges, savableChallenges } from './get-challenges.js';
|
||||||
import { normalizeDate } from './normalize.js';
|
import { normalizeDate } from './normalize.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Exam, Question } from '@prisma/client';
|
import { Exam, Question } from '@prisma/client';
|
||||||
import { shuffleArray } from './../../../shared/utils/shuffle-array.js';
|
import { shuffleArray } from '@freecodecamp/shared/utils/shuffle-array';
|
||||||
import { UserExam, GeneratedExam } from './exam-types.js';
|
import { UserExam, GeneratedExam } from './exam-types.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { readFileSync } from 'fs';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { join, dirname } from 'path';
|
import { join, dirname } from 'path';
|
||||||
|
|
||||||
const CURRICULUM_PATH = '../../../shared-dist/config/curriculum.json';
|
const CURRICULUM_PATH = '../../../curriculum/generated/curriculum.json';
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
// Curriculum is read using fs, because it is too large for VSCode's LSP to handle type inference which causes annoying behavior.
|
// Curriculum is read using fs, because it is too large for VSCode's LSP to handle type inference which causes annoying behavior.
|
||||||
const curriculum = JSON.parse(
|
const curriculum = JSON.parse(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
|
|
||||||
import { availableLangs } from '../../../shared/config/i18n.js';
|
import { availableLangs } from '@freecodecamp/shared/config/i18n';
|
||||||
import { allowedOrigins } from './allowed-origins.js';
|
import { allowedOrigins } from './allowed-origins.js';
|
||||||
|
|
||||||
// process.env.HOME_LOCATION is being used as a fallback here. If the one
|
// process.env.HOME_LOCATION is being used as a fallback here. If the one
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import {
|
|||||||
legacyCertifications,
|
legacyCertifications,
|
||||||
upcomingCertifications,
|
upcomingCertifications,
|
||||||
currentCertifications
|
currentCertifications
|
||||||
} from '../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
|
|
||||||
import config from '../config/env.json';
|
import config from '../config/env.json';
|
||||||
|
|
||||||
const { showUpcomingChanges } = config;
|
const { showUpcomingChanges } = config;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const uniq = require('lodash/uniq');
|
|||||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
|
||||||
const { SuperBlocks } = require('../shared-dist/config/curriculum');
|
const { SuperBlocks } = require('@freecodecamp/shared/config/curriculum');
|
||||||
const env = require('./config/env.json');
|
const env = require('./config/env.json');
|
||||||
const {
|
const {
|
||||||
createChallengePages,
|
createChallengePages,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import i18n from 'i18next';
|
|||||||
import { initReactI18next } from 'react-i18next';
|
import { initReactI18next } from 'react-i18next';
|
||||||
|
|
||||||
const envData = require('../config/env.json');
|
const envData = require('../config/env.json');
|
||||||
const { i18nextCodes } = require('../../shared-dist/config/i18n');
|
const { i18nextCodes } = require('@freecodecamp/shared/config/i18n');
|
||||||
|
|
||||||
const { clientLocale } = envData;
|
const { clientLocale } = envData;
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ import {
|
|||||||
availableLangs,
|
availableLangs,
|
||||||
LangNames,
|
LangNames,
|
||||||
LangCodes
|
LangCodes
|
||||||
} from '../../shared-dist/config/i18n';
|
} from '@freecodecamp/shared/config/i18n';
|
||||||
import {
|
import {
|
||||||
catalogSuperBlocks,
|
catalogSuperBlocks,
|
||||||
SuperBlocks
|
SuperBlocks
|
||||||
} from '../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import intro from './locales/english/intro.json';
|
import intro from './locales/english/intro.json';
|
||||||
|
|
||||||
interface Intro {
|
interface Intro {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { readFile } from 'fs/promises';
|
import { readFile } from 'fs/promises';
|
||||||
import { availableLangs } from '../../shared-dist/config/i18n';
|
import { availableLangs } from '@freecodecamp/shared/config/i18n';
|
||||||
import introSchema from './locales/english/intro.json';
|
import introSchema from './locales/english/intro.json';
|
||||||
import linksSchema from './locales/english/links.json';
|
import linksSchema from './locales/english/links.json';
|
||||||
import metaTagsSchema from './locales/english/meta-tags.json';
|
import metaTagsSchema from './locales/english/meta-tags.json';
|
||||||
|
|||||||
+2
-1
@@ -24,7 +24,7 @@
|
|||||||
"build:scripts": "pnpm run -F=browser-scripts build",
|
"build:scripts": "pnpm run -F=browser-scripts build",
|
||||||
"build:external-curriculum": "tsx ./tools/external-curriculum/build",
|
"build:external-curriculum": "tsx ./tools/external-curriculum/build",
|
||||||
"clean": "gatsby clean",
|
"clean": "gatsby clean",
|
||||||
"common-setup": "pnpm -w run compile:ts && pnpm run create:env && pnpm run create:trending && pnpm run create:search-placeholder",
|
"common-setup": "pnpm -w turbo compile && pnpm run create:env && pnpm run create:trending && pnpm run create:search-placeholder",
|
||||||
"create:env": "DEBUG=fcc:* tsx ./tools/create-env.ts",
|
"create:env": "DEBUG=fcc:* tsx ./tools/create-env.ts",
|
||||||
"create:trending": "tsx ./tools/download-trending.ts",
|
"create:trending": "tsx ./tools/download-trending.ts",
|
||||||
"create:search-placeholder": "tsx ./tools/generate-search-placeholder",
|
"create:search-placeholder": "tsx ./tools/generate-search-placeholder",
|
||||||
@@ -139,6 +139,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||||
"@freecodecamp/eslint-config": "workspace:*",
|
"@freecodecamp/eslint-config": "workspace:*",
|
||||||
|
"@freecodecamp/shared": "workspace:*",
|
||||||
"@testing-library/jest-dom": "^6.8.0",
|
"@testing-library/jest-dom": "^6.8.0",
|
||||||
"@testing-library/react": "12.1.5",
|
"@testing-library/react": "12.1.5",
|
||||||
"@testing-library/react-hooks": "^8.0.1",
|
"@testing-library/react-hooks": "^8.0.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
DonationAmount,
|
DonationAmount,
|
||||||
DonationDuration
|
DonationDuration
|
||||||
} from '../../../shared-dist/config/donation-settings';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { ChallengeFiles } from '../redux/prop-types';
|
import { ChallengeFiles } from '../redux/prop-types';
|
||||||
import TagManager from '.';
|
import TagManager from '.';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
A1SpanishChapters,
|
A1SpanishChapters,
|
||||||
FsdChapters,
|
FsdChapters,
|
||||||
A1ChineseChapters
|
A1ChineseChapters
|
||||||
} from '../../../shared-dist/config/chapters';
|
} from '@freecodecamp/shared/config/chapters';
|
||||||
import DatabaseIcon from './icons/database';
|
import DatabaseIcon from './icons/database';
|
||||||
import JavaScriptIcon from './icons/javascript';
|
import JavaScriptIcon from './icons/javascript';
|
||||||
import ReactIcon from './icons/react';
|
import ReactIcon from './icons/react';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { SuperBlocks } from '../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import APIIcon from './icons/api';
|
import APIIcon from './icons/api';
|
||||||
import D3Icon from './icons/d3';
|
import D3Icon from './icons/d3';
|
||||||
import DatabaseIcon from './icons/database';
|
import DatabaseIcon from './icons/database';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { createSelector } from 'reselect';
|
|||||||
import { Container, Col, Row, Image, Button, Spacer } from '@freecodecamp/ui';
|
import { Container, Col, Row, Image, Button, Spacer } from '@freecodecamp/ui';
|
||||||
|
|
||||||
import envData from '../../config/env.json';
|
import envData from '../../config/env.json';
|
||||||
import { getLangCode } from '../../../shared-dist/config/i18n';
|
import { getLangCode } from '@freecodecamp/shared/config/i18n';
|
||||||
import FreeCodeCampLogo from '../assets/icons/freecodecamp-logo';
|
import FreeCodeCampLogo from '../assets/icons/freecodecamp-logo';
|
||||||
import MicrosoftLogo from '../assets/icons/microsoft-logo';
|
import MicrosoftLogo from '../assets/icons/microsoft-logo';
|
||||||
import { createFlashMessage } from '../components/Flash/redux';
|
import { createFlashMessage } from '../components/Flash/redux';
|
||||||
@@ -33,13 +33,13 @@ import {
|
|||||||
standardErrorMessage
|
standardErrorMessage
|
||||||
} from '../utils/error-messages';
|
} from '../utils/error-messages';
|
||||||
|
|
||||||
import { PaymentContext } from '../../../shared-dist/config/donation-settings';
|
import { PaymentContext } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import ribbon from '../assets/images/ribbon.svg';
|
import ribbon from '../assets/images/ribbon.svg';
|
||||||
import {
|
import {
|
||||||
Certification,
|
Certification,
|
||||||
CertSlug,
|
CertSlug,
|
||||||
linkedInCredentialIds
|
linkedInCredentialIds
|
||||||
} from '../../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import MultiTierDonationForm from '../components/Donation/multi-tier-donation-form';
|
import MultiTierDonationForm from '../components/Donation/multi-tier-donation-form';
|
||||||
import callGA from '../analytics/call-ga';
|
import callGA from '../analytics/call-ga';
|
||||||
import ShowProjectLinks from './show-project-links';
|
import ShowProjectLinks from './show-project-links';
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import ExamResultsModal from '../components/SolutionViewer/exam-results-modal';
|
|||||||
|
|
||||||
import { openModal } from '../templates/Challenges/redux/actions';
|
import { openModal } from '../templates/Challenges/redux/actions';
|
||||||
|
|
||||||
import { regenerateMissingProperties } from '../../../shared-dist/utils/polyvinyl';
|
import { regenerateMissingProperties } from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import '../components/layouts/project-links.css';
|
import '../components/layouts/project-links.css';
|
||||||
import { Certification } from '../../../shared-dist/config/certification-settings';
|
import { Certification } from '@freecodecamp/shared/config/certification-settings';
|
||||||
interface ShowProjectLinksProps {
|
interface ShowProjectLinksProps {
|
||||||
certSlug: Certification;
|
certSlug: Certification;
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
defaultDonation,
|
defaultDonation,
|
||||||
DonationAmount,
|
DonationAmount,
|
||||||
type DonationConfig
|
type DonationConfig
|
||||||
} from '../../../../shared-dist/config/donation-settings';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { defaultDonationFormState } from '../../redux';
|
import { defaultDonationFormState } from '../../redux';
|
||||||
import { updateDonationFormState, postCharge } from '../../redux/actions';
|
import { updateDonationFormState, postCharge } from '../../redux/actions';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { useFeature } from '@growthbook/growthbook-react';
|
import { useFeature } from '@growthbook/growthbook-react';
|
||||||
import { Col, Row, Modal, Spacer } from '@freecodecamp/ui';
|
import { Col, Row, Modal, Spacer } from '@freecodecamp/ui';
|
||||||
import { closeDonationModal } from '../../redux/actions';
|
import { closeDonationModal } from '../../redux/actions';
|
||||||
import { PaymentContext } from '../../../../shared-dist/config/donation-settings';
|
import { PaymentContext } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import donationAnimation from '../../assets/images/donation-bear-animation.svg';
|
import donationAnimation from '../../assets/images/donation-bear-animation.svg';
|
||||||
import donationAnimationB from '../../assets/images/new-bear-animation.svg';
|
import donationAnimationB from '../../assets/images/new-bear-animation.svg';
|
||||||
import supporterBearBlock from '../../assets/images/supporter-bear-block.svg';
|
import supporterBearBlock from '../../assets/images/supporter-bear-block.svg';
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
defaultTierAmount,
|
defaultTierAmount,
|
||||||
defaultTierAmountB,
|
defaultTierAmountB,
|
||||||
type DonationAmount
|
type DonationAmount
|
||||||
} from '../../../../shared-dist/config/donation-settings'; // You can further extract these into separate components and import them
|
} from '@freecodecamp/shared/config/donation-settings'; // You can further extract these into separate components and import them
|
||||||
import callGA from '../../analytics/call-ga';
|
import callGA from '../../analytics/call-ga';
|
||||||
import { LocalStorageThemes } from '../../redux/types';
|
import { LocalStorageThemes } from '../../redux/types';
|
||||||
import { formattedAmountLabel, convertToTimeContributed } from './utils';
|
import { formattedAmountLabel, convertToTimeContributed } from './utils';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
DonationAmount,
|
DonationAmount,
|
||||||
donationUrls,
|
donationUrls,
|
||||||
PaymentProvider
|
PaymentProvider
|
||||||
} from '../../../../shared-dist/config/donation-settings';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import envData from '../../../config/env.json';
|
import envData from '../../../config/env.json';
|
||||||
import PatreonLogo from '../../assets/images/components/patreon-logo';
|
import PatreonLogo from '../../assets/images/components/patreon-logo';
|
||||||
import { PostPayment } from './types';
|
import { PostPayment } from './types';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
PaymentProvider,
|
PaymentProvider,
|
||||||
type DonationDuration,
|
type DonationDuration,
|
||||||
type DonationAmount
|
type DonationAmount
|
||||||
} from '../../../../shared-dist/config/donation-settings';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import envData from '../../../config/env.json';
|
import envData from '../../../config/env.json';
|
||||||
import { userSelector, signInLoadingSelector } from '../../redux/selectors';
|
import { userSelector, signInLoadingSelector } from '../../redux/selectors';
|
||||||
import { LocalStorageThemes } from '../../redux/types';
|
import { LocalStorageThemes } from '../../redux/types';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import type {
|
|||||||
} from '@stripe/stripe-js';
|
} from '@stripe/stripe-js';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
import { PaymentProvider } from '../../../../shared-dist/config/donation-settings';
|
import { PaymentProvider } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { LocalStorageThemes } from '../../redux/types';
|
import { LocalStorageThemes } from '../../redux/types';
|
||||||
import { DonationApprovalData, PostPayment } from './types';
|
import { DonationApprovalData, PostPayment } from './types';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { PaymentIntentResult } from '@stripe/stripe-js';
|
import type { PaymentIntentResult } from '@stripe/stripe-js';
|
||||||
import { SuperBlocks } from '../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
|
|
||||||
export type PaymentContext = 'modal' | 'donate page' | 'certificate';
|
export type PaymentContext = 'modal' | 'donate page' | 'certificate';
|
||||||
export type PaymentProvider = 'patreon' | 'paypal' | 'stripe' | 'stripe card';
|
export type PaymentProvider = 'patreon' | 'paypal' | 'stripe' | 'stripe card';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { LocalStorageThemes } from '../../redux/types';
|
|||||||
import {
|
import {
|
||||||
PaymentProvider,
|
PaymentProvider,
|
||||||
DonationDuration
|
DonationDuration
|
||||||
} from '../../../../shared-dist/config/donation-settings';
|
} from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { createStripePaymentIntent } from '../../utils/ajax';
|
import { createStripePaymentIntent } from '../../utils/ajax';
|
||||||
import { DonationApprovalData, PostPayment } from './types';
|
import { DonationApprovalData, PostPayment } from './types';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
LangNames,
|
LangNames,
|
||||||
LangCodes,
|
LangCodes,
|
||||||
hiddenLangs
|
hiddenLangs
|
||||||
} from '../../../../../shared-dist/config/i18n';
|
} from '@freecodecamp/shared/config/i18n';
|
||||||
import { hardGoTo as navigate } from '../../../redux/actions';
|
import { hardGoTo as navigate } from '../../../redux/actions';
|
||||||
import createLanguageRedirect from '../../create-language-redirect';
|
import createLanguageRedirect from '../../create-language-redirect';
|
||||||
import LanguageGlobe from '../../../assets/icons/language-globe';
|
import LanguageGlobe from '../../../assets/icons/language-globe';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
getStageOrder,
|
getStageOrder,
|
||||||
superBlockStages,
|
superBlockStages,
|
||||||
archivedSuperBlocks
|
archivedSuperBlocks
|
||||||
} from '../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import { SuperBlockIcon } from '../../assets/superblock-icon';
|
import { SuperBlockIcon } from '../../assets/superblock-icon';
|
||||||
import LinkButton from '../../assets/icons/link-button';
|
import LinkButton from '../../assets/icons/link-button';
|
||||||
import { ButtonLink, Link } from '../helpers';
|
import { ButtonLink, Link } from '../helpers';
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
updateSuperBlockStructures,
|
updateSuperBlockStructures,
|
||||||
superBlockStructuresSelector
|
superBlockStructuresSelector
|
||||||
} from '../../templates/Introduction/redux';
|
} from '../../templates/Introduction/redux';
|
||||||
import { getIsDailyCodingChallenge } from '../../../../shared-dist/config/challenge-types';
|
import { getIsDailyCodingChallenge } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
isValidDateString,
|
isValidDateString,
|
||||||
formatDisplayDate
|
formatDisplayDate
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { I18nextProvider } from 'react-i18next';
|
|||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { describe, vi, test, expect } from 'vitest';
|
import { describe, vi, test, expect } from 'vitest';
|
||||||
|
|
||||||
import { i18nextCodes } from '../../../shared-dist/config/i18n';
|
import { i18nextCodes } from '@freecodecamp/shared/config/i18n';
|
||||||
import i18nTestConfig from '../../i18n/config-for-tests';
|
import i18nTestConfig from '../../i18n/config-for-tests';
|
||||||
import { createStore } from '../redux/create-store';
|
import { createStore } from '../redux/create-store';
|
||||||
import AppMountNotifier from './app-mount-notifier';
|
import AppMountNotifier from './app-mount-notifier';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import React from 'react';
|
|||||||
import { useFeature } from '@growthbook/growthbook-react';
|
import { useFeature } from '@growthbook/growthbook-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Button } from '@freecodecamp/ui';
|
import { Button } from '@freecodecamp/ui';
|
||||||
import { challengeTypes } from '../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
|
|
||||||
interface CodeAllyButtonProps {
|
interface CodeAllyButtonProps {
|
||||||
challengeType: number;
|
challengeType: number;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Callout } from '@freecodecamp/ui';
|
import { Callout } from '@freecodecamp/ui';
|
||||||
import { useFeatureValue } from '@growthbook/growthbook-react';
|
import { useFeatureValue } from '@growthbook/growthbook-react';
|
||||||
import { SuperBlocks } from '../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { Link } from '../helpers';
|
import { Link } from '../helpers';
|
||||||
|
|
||||||
type OnaNoteProps = {
|
type OnaNoteProps = {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { render, screen } from '@testing-library/react';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import { getLangCode } from '../../../../../shared-dist/config/i18n';
|
import { getLangCode } from '@freecodecamp/shared/config/i18n';
|
||||||
import HeatMap from './heat-map';
|
import HeatMap from './heat-map';
|
||||||
|
|
||||||
const { clientLocale } = envData;
|
const { clientLocale } = envData;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import 'react-calendar-heatmap/dist/styles.css';
|
|||||||
import './heatmap.css';
|
import './heatmap.css';
|
||||||
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import { getLangCode } from '../../../../../shared-dist/config/i18n';
|
import { getLangCode } from '@freecodecamp/shared/config/i18n';
|
||||||
import { User } from '../../../redux/prop-types';
|
import { User } from '../../../redux/prop-types';
|
||||||
import FullWidthRow from '../../helpers/full-width-row';
|
import FullWidthRow from '../../helpers/full-width-row';
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { connect } from 'react-redux';
|
|||||||
import { Table, Button, Modal, Spacer } from '@freecodecamp/ui';
|
import { Table, Button, Modal, Spacer } from '@freecodecamp/ui';
|
||||||
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import { getLangCode } from '../../../../../shared-dist/config/i18n';
|
import { getLangCode } from '@freecodecamp/shared/config/i18n';
|
||||||
import { getCertIds, getPathFromID } from '../../../../utils';
|
import { getCertIds, getPathFromID } from '../../../../utils';
|
||||||
import { regenerateMissingProperties } from '../../../../../shared-dist/utils/polyvinyl';
|
import { regenerateMissingProperties } from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import CertificationIcon from '../../../assets/icons/certification';
|
import CertificationIcon from '../../../assets/icons/certification';
|
||||||
import type {
|
import type {
|
||||||
ChallengeData,
|
ChallengeData,
|
||||||
@@ -21,7 +21,7 @@ import ExamResultsModal from '../../SolutionViewer/exam-results-modal';
|
|||||||
import { openModal } from '../../../templates/Challenges/redux/actions';
|
import { openModal } from '../../../templates/Challenges/redux/actions';
|
||||||
import { Link, FullWidthRow } from '../../helpers';
|
import { Link, FullWidthRow } from '../../helpers';
|
||||||
import { SolutionDisplayWidget } from '../../solution-display-widget';
|
import { SolutionDisplayWidget } from '../../solution-display-widget';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import TimelinePagination from './timeline-pagination';
|
import TimelinePagination from './timeline-pagination';
|
||||||
|
|
||||||
const SolutionViewer = Loadable(
|
const SolutionViewer = Loadable(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { bindActionCreators } from 'redux';
|
|||||||
import type { Dispatch } from 'redux';
|
import type { Dispatch } from 'redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
|
|
||||||
import { isValidUsername } from '../../../../../shared-dist/utils/validate';
|
import { isValidUsername } from '@freecodecamp/shared/utils/validate';
|
||||||
import { usernameValidationSelector } from '../../../redux/settings/selectors';
|
import { usernameValidationSelector } from '../../../redux/settings/selectors';
|
||||||
import {
|
import {
|
||||||
validateUsername,
|
validateUsername,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Certification } from '../../../../../../shared-dist/config/certification-settings';
|
import { Certification } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import { User } from '../../../../redux/prop-types';
|
import { User } from '../../../../redux/prop-types';
|
||||||
|
|
||||||
export const getCertifications = (user: User) => {
|
export const getCertifications = (user: User) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { getLangCode } from '../../../../../../shared-dist/config/i18n';
|
import { getLangCode } from '@freecodecamp/shared/config/i18n';
|
||||||
import envData from '../../../../../config/env.json';
|
import envData from '../../../../../config/env.json';
|
||||||
const { clientLocale } = envData;
|
const { clientLocale } = envData;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useStaticQuery, graphql } from 'gatsby';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Helmet from 'react-helmet';
|
import Helmet from 'react-helmet';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { SuperBlocks } from '../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
|
|
||||||
interface SEOProps {
|
interface SEOProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Element } from 'react-scroll';
|
|||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Table, Button, Spacer } from '@freecodecamp/ui';
|
import { Table, Button, Spacer } from '@freecodecamp/ui';
|
||||||
|
|
||||||
import { regenerateMissingProperties } from '../../../../shared-dist/utils/polyvinyl';
|
import { regenerateMissingProperties } from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import ProjectPreviewModal from '../../templates/Challenges/components/project-preview-modal';
|
import ProjectPreviewModal from '../../templates/Challenges/components/project-preview-modal';
|
||||||
import ExamResultsModal from '../SolutionViewer/exam-results-modal';
|
import ExamResultsModal from '../SolutionViewer/exam-results-modal';
|
||||||
import { openModal } from '../../templates/Challenges/redux/actions';
|
import { openModal } from '../../templates/Challenges/redux/actions';
|
||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
legacyCertifications,
|
legacyCertifications,
|
||||||
upcomingCertifications,
|
upcomingCertifications,
|
||||||
type CertificationFlags
|
type CertificationFlags
|
||||||
} from '../../../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import env from '../../../config/env.json';
|
import env from '../../../config/env.json';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
legacyCertifications,
|
legacyCertifications,
|
||||||
legacyFullStackCertification,
|
legacyFullStackCertification,
|
||||||
upcomingCertifications
|
upcomingCertifications
|
||||||
} from '../../../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import env from '../../../config/env.json';
|
import env from '../../../config/env.json';
|
||||||
|
|
||||||
type SettingsSidebarNavProps = {
|
type SettingsSidebarNavProps = {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { clientLocale } from '../config/env.json';
|
import { clientLocale } from '../config/env.json';
|
||||||
import { rtlLangs } from '../../shared-dist/config/i18n';
|
import { rtlLangs } from '@freecodecamp/shared/config/i18n';
|
||||||
|
|
||||||
interface HTMLProps {
|
interface HTMLProps {
|
||||||
body: string;
|
body: string;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Col, Spacer } from '@freecodecamp/ui';
|
import { Col, Spacer } from '@freecodecamp/ui';
|
||||||
import { ButtonLink } from '../components/helpers';
|
import { ButtonLink } from '../components/helpers';
|
||||||
import { catalog } from '../../../shared-dist/config/catalog';
|
import { catalog } from '@freecodecamp/shared/config/catalog';
|
||||||
import { showUpcomingChanges } from '../../config/env.json';
|
import { showUpcomingChanges } from '../../config/env.json';
|
||||||
import FourOhFour from '../components/FourOhFour';
|
import FourOhFour from '../components/FourOhFour';
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
userSelector,
|
userSelector,
|
||||||
donationFormStateSelector
|
donationFormStateSelector
|
||||||
} from '../redux/selectors';
|
} from '../redux/selectors';
|
||||||
import { PaymentContext } from '../../../shared-dist/config/donation-settings';
|
import { PaymentContext } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import { DonateFormState } from '../redux/types';
|
import { DonateFormState } from '../redux/types';
|
||||||
import callGA from '../analytics/call-ga';
|
import callGA from '../analytics/call-ga';
|
||||||
import type { User } from '../redux/prop-types';
|
import type { User } from '../redux/prop-types';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
} from '../utils/ajax';
|
} from '../utils/ajax';
|
||||||
import { stringifyDonationEvents } from '../utils/analytics-strings';
|
import { stringifyDonationEvents } from '../utils/analytics-strings';
|
||||||
import { stripe } from '../utils/stripe';
|
import { stripe } from '../utils/stripe';
|
||||||
import { PaymentProvider } from '../../../shared-dist/config/donation-settings';
|
import { PaymentProvider } from '@freecodecamp/shared/config/donation-settings';
|
||||||
import {
|
import {
|
||||||
getSessionChallengeData,
|
getSessionChallengeData,
|
||||||
saveCurrentCount
|
saveCurrentCount
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import store from 'store';
|
import store from 'store';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { isGoodXHRStatus } from '../templates/Challenges/utils';
|
import { isGoodXHRStatus } from '../templates/Challenges/utils';
|
||||||
import postUpdate$ from '../templates/Challenges/utils/post-update';
|
import postUpdate$ from '../templates/Challenges/utils/post-update';
|
||||||
import { actionTypes } from './action-types';
|
import { actionTypes } from './action-types';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
actionTypes as challengeTypes,
|
actionTypes as challengeTypes,
|
||||||
CURRENT_CHALLENGE_KEY
|
CURRENT_CHALLENGE_KEY
|
||||||
} from '../templates/Challenges/redux/action-types';
|
} from '../templates/Challenges/redux/action-types';
|
||||||
import { getIsDailyCodingChallenge } from '../../../shared-dist/config/challenge-types';
|
import { getIsDailyCodingChallenge } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { actionTypes, ns as MainApp } from './action-types';
|
import { actionTypes, ns as MainApp } from './action-types';
|
||||||
import { createAppMountSaga } from './app-mount-saga';
|
import { createAppMountSaga } from './app-mount-saga';
|
||||||
import { createDonationSaga } from './donation-saga';
|
import { createDonationSaga } from './donation-saga';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { HandlerProps } from 'react-reflex';
|
|||||||
import type {
|
import type {
|
||||||
ChallengeLang,
|
ChallengeLang,
|
||||||
SuperBlocks
|
SuperBlocks
|
||||||
} from '../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import type { CertificationFlags } from '../../../shared-dist/config/certification-settings';
|
import type { CertificationFlags } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import type { Chapter } from '../../../shared-dist/config/chapters';
|
import type { Chapter } from '@freecodecamp/shared/config/chapters';
|
||||||
import { BlockLayouts, BlockLabel } from '../../../shared-dist/config/blocks';
|
import { BlockLayouts, BlockLabel } from '@freecodecamp/shared/config/blocks';
|
||||||
import type { ChallengeFile, Ext } from '../../../shared-dist/utils/polyvinyl';
|
import type { ChallengeFile, Ext } from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import { type CertTitle } from '../../config/cert-and-project-map';
|
import { type CertTitle } from '../../config/cert-and-project-map';
|
||||||
import { UserThemes } from './types';
|
import { UserThemes } from './types';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { liveCerts } from '../../config/cert-and-project-map';
|
|||||||
import {
|
import {
|
||||||
certSlugTypeMap,
|
certSlugTypeMap,
|
||||||
certToTitleMap
|
certToTitleMap
|
||||||
} from '../../../shared-dist/config/certification-settings.js';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
|
|
||||||
import { randomBetween } from '../utils/random-between';
|
import { randomBetween } from '../utils/random-between';
|
||||||
import { getSessionChallengeData } from '../utils/session-storage';
|
import { getSessionChallengeData } from '../utils/session-storage';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import store from 'store';
|
import store from 'store';
|
||||||
import { navigate } from 'gatsby';
|
import { navigate } from 'gatsby';
|
||||||
|
|
||||||
import { Certification } from '../../../../shared-dist/config/certification-settings';
|
import { Certification } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import { createFlashMessage } from '../../components/Flash/redux';
|
import { createFlashMessage } from '../../components/Flash/redux';
|
||||||
import { liveCerts } from '../../../config/cert-and-project-map';
|
import { liveCerts } from '../../../config/cert-and-project-map';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import React from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
import { DailyCodingChallengeLanguages } from '../../../redux/prop-types';
|
import { DailyCodingChallengeLanguages } from '../../../redux/prop-types';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import EditorTabs from './editor-tabs';
|
import EditorTabs from './editor-tabs';
|
||||||
|
|
||||||
interface ClassicLayoutProps {
|
interface ClassicLayoutProps {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ReflexContainer, ReflexSplitter, ReflexElement } from 'react-reflex';
|
|||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
ChallengeFiles,
|
ChallengeFiles,
|
||||||
DailyCodingChallengeLanguages,
|
DailyCodingChallengeLanguages,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import type {
|
|||||||
} from '../../../redux/prop-types';
|
} from '../../../redux/prop-types';
|
||||||
import { editorToneOptions } from '../../../utils/tone/editor-config';
|
import { editorToneOptions } from '../../../utils/tone/editor-config';
|
||||||
import { editorNotes } from '../../../utils/tone/editor-notes';
|
import { editorNotes } from '../../../utils/tone/editor-notes';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
executeChallenge,
|
executeChallenge,
|
||||||
saveEditorContent,
|
saveEditorContent,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { editor } from 'monaco-editor';
|
|||||||
import type { FitAddon } from 'xterm-addon-fit';
|
import type { FitAddon } from 'xterm-addon-fit';
|
||||||
|
|
||||||
import { useFeature } from '@growthbook/growthbook-react';
|
import { useFeature } from '@growthbook/growthbook-react';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import LearnLayout from '../../../components/layouts/learn';
|
import LearnLayout from '../../../components/layouts/learn';
|
||||||
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
|
import { MAX_MOBILE_WIDTH } from '../../../../config/misc';
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { useFeature } from '@growthbook/growthbook-react';
|
|||||||
import LearnLayout from '../../../components/layouts/learn';
|
import LearnLayout from '../../../components/layouts/learn';
|
||||||
import ChallengeTitle from '../components/challenge-title';
|
import ChallengeTitle from '../components/challenge-title';
|
||||||
import PrismFormatted from '../components/prism-formatted';
|
import PrismFormatted from '../components/prism-formatted';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import CompletionModal from '../components/completion-modal';
|
import CompletionModal from '../components/completion-modal';
|
||||||
import HelpModal from '../components/help-modal';
|
import HelpModal from '../components/help-modal';
|
||||||
import Hotkeys from '../components/hotkeys';
|
import Hotkeys from '../components/hotkeys';
|
||||||
@@ -45,7 +45,7 @@ import ProjectToolPanel from '../projects/tool-panel';
|
|||||||
import { getChallengePaths } from '../utils/challenge-paths';
|
import { getChallengePaths } from '../utils/challenge-paths';
|
||||||
import SolutionForm from '../projects/solution-form';
|
import SolutionForm from '../projects/solution-form';
|
||||||
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { CodeAllyDown } from '../../../components/growth-book/codeally-down';
|
import { CodeAllyDown } from '../../../components/growth-book/codeally-down';
|
||||||
import { postUserToken } from '../../../utils/ajax';
|
import { postUserToken } from '../../../utils/ajax';
|
||||||
import RdbStep1Instructions from './rdb-step-1-instructions';
|
import RdbStep1Instructions from './rdb-step-1-instructions';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { faMicrophone } from '@fortawesome/free-solid-svg-icons';
|
|||||||
import { Button, Spacer } from '@freecodecamp/ui';
|
import { Button, Spacer } from '@freecodecamp/ui';
|
||||||
import { Question } from '../../../redux/prop-types';
|
import { Question } from '../../../redux/prop-types';
|
||||||
import { openModal } from '../redux/actions';
|
import { openModal } from '../redux/actions';
|
||||||
import { SuperBlocks } from '../../../../../shared/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import SpeakingModal from './speaking-modal';
|
import SpeakingModal from './speaking-modal';
|
||||||
import ChallengeHeading from './challenge-heading';
|
import ChallengeHeading from './challenge-heading';
|
||||||
import PrismFormatted from './prism-formatted';
|
import PrismFormatted from './prism-formatted';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { isSpeakingModalOpenSelector } from '../redux/selectors';
|
|||||||
import {
|
import {
|
||||||
SuperBlocks,
|
SuperBlocks,
|
||||||
superBlockToSpeechLang
|
superBlockToSpeechLang
|
||||||
} from '../../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import {
|
import {
|
||||||
compareTexts,
|
compareTexts,
|
||||||
type ComparisonResult,
|
type ComparisonResult,
|
||||||
|
|||||||
@@ -10,9 +10,11 @@ import { bindActionCreators } from 'redux';
|
|||||||
import type { Dispatch } from 'redux';
|
import type { Dispatch } from 'redux';
|
||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { Container, Col, Row, Button, Spacer } from '@freecodecamp/ui';
|
import { Container, Col, Row, Button, Spacer } from '@freecodecamp/ui';
|
||||||
import ShortcutsModal from '../components/shortcuts-modal';
|
|
||||||
|
import { ChallengeLang } from '@freecodecamp/shared/config/curriculum';
|
||||||
|
|
||||||
// Local Utilities
|
// Local Utilities
|
||||||
|
import ShortcutsModal from '../components/shortcuts-modal';
|
||||||
import LearnLayout from '../../../components/layouts/learn';
|
import LearnLayout from '../../../components/layouts/learn';
|
||||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||||
import Hotkeys from '../components/hotkeys';
|
import Hotkeys from '../components/hotkeys';
|
||||||
@@ -38,7 +40,6 @@ import { replaceAppleQuotes } from '../../../utils/replace-apple-quotes';
|
|||||||
import { parseHanziPinyinPairs } from './parse-blanks';
|
import { parseHanziPinyinPairs } from './parse-blanks';
|
||||||
|
|
||||||
import './show.css';
|
import './show.css';
|
||||||
import { ChallengeLang } from '../../../../../shared-dist/config/curriculum';
|
|
||||||
|
|
||||||
// Redux Setup
|
// Redux Setup
|
||||||
const mapStateToProps = createSelector(
|
const mapStateToProps = createSelector(
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
Spacer
|
Spacer
|
||||||
} from '@freecodecamp/ui';
|
} from '@freecodecamp/ui';
|
||||||
|
|
||||||
import { isMicrosoftTranscriptLink } from '../../../../../shared-dist/utils/validate';
|
import { isMicrosoftTranscriptLink } from '@freecodecamp/shared/utils/validate';
|
||||||
import {
|
import {
|
||||||
linkMsUsername,
|
linkMsUsername,
|
||||||
unlinkMsUsername,
|
unlinkMsUsername,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|||||||
import { withTranslation } from 'react-i18next';
|
import { withTranslation } from 'react-i18next';
|
||||||
import type { WithTranslation } from 'react-i18next';
|
import type { WithTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
StrictSolutionForm,
|
StrictSolutionForm,
|
||||||
ValidatedValues
|
ValidatedValues
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
} from '@freecodecamp/ui';
|
} from '@freecodecamp/ui';
|
||||||
|
|
||||||
// Local Utilities
|
// Local Utilities
|
||||||
import { shuffleArray } from '../../../../../shared-dist/utils/shuffle-array';
|
import { shuffleArray } from '@freecodecamp/shared/utils/shuffle-array';
|
||||||
import LearnLayout from '../../../components/layouts/learn';
|
import LearnLayout from '../../../components/layouts/learn';
|
||||||
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
import { ChallengeNode, ChallengeMeta, Test } from '../../../redux/prop-types';
|
||||||
import ChallengeDescription from '../components/challenge-description';
|
import ChallengeDescription from '../components/challenge-description';
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
transformHeadTailAndContents,
|
transformHeadTailAndContents,
|
||||||
compileHeadTail,
|
compileHeadTail,
|
||||||
createSource
|
createSource
|
||||||
} from '../../../../../shared-dist/utils/polyvinyl';
|
} from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import { WorkerExecutor } from '../utils/worker-executor';
|
import { WorkerExecutor } from '../utils/worker-executor';
|
||||||
import {
|
import {
|
||||||
compileTypeScriptCode,
|
compileTypeScriptCode,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { of } from 'rxjs';
|
|||||||
import { filter, ignoreElements, map, switchMap, tap } from 'rxjs/operators';
|
import { filter, ignoreElements, map, switchMap, tap } from 'rxjs/operators';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
|
|
||||||
import { isPoly, setContent } from '../../../../../shared-dist/utils/polyvinyl';
|
import { isPoly, setContent } from '@freecodecamp/shared/utils/polyvinyl';
|
||||||
import { createFlashMessage } from '../../../components/Flash/redux';
|
import { createFlashMessage } from '../../../components/Flash/redux';
|
||||||
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
||||||
import { savedChallengesSelector } from '../../../redux/selectors';
|
import { savedChallengesSelector } from '../../../redux/selectors';
|
||||||
@@ -11,7 +11,7 @@ import { actionTypes as appTypes } from '../../../redux/action-types';
|
|||||||
import {
|
import {
|
||||||
getIsDailyCodingChallenge,
|
getIsDailyCodingChallenge,
|
||||||
getDailyCodingChallengeLanguage
|
getDailyCodingChallengeLanguage
|
||||||
} from '../../../../../shared-dist/config/challenge-types';
|
} from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { actionTypes } from './action-types';
|
import { actionTypes } from './action-types';
|
||||||
import { noStoredCodeFound, updateFile } from './actions';
|
import { noStoredCodeFound, updateFile } from './actions';
|
||||||
import { challengeFilesSelector, challengeMetaSelector } from './selectors';
|
import { challengeFilesSelector, challengeMetaSelector } from './selectors';
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
getIsDailyCodingChallenge,
|
getIsDailyCodingChallenge,
|
||||||
getDailyCodingChallengeLanguage,
|
getDailyCodingChallengeLanguage,
|
||||||
submitTypes
|
submitTypes
|
||||||
} from '../../../../../shared-dist/config/challenge-types';
|
} from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { actionTypes as submitActionTypes } from '../../../redux/action-types';
|
import { actionTypes as submitActionTypes } from '../../../redux/action-types';
|
||||||
import {
|
import {
|
||||||
allowSectionDonationRequests,
|
allowSectionDonationRequests,
|
||||||
@@ -34,7 +34,7 @@ import { isSignedInSelector, userSelector } from '../../../redux/selectors';
|
|||||||
import { mapFilesToChallengeFiles } from '../../../utils/ajax';
|
import { mapFilesToChallengeFiles } from '../../../utils/ajax';
|
||||||
import { standardizeRequestBody } from '../../../utils/challenge-request-helpers';
|
import { standardizeRequestBody } from '../../../utils/challenge-request-helpers';
|
||||||
import postUpdate$ from '../utils/post-update';
|
import postUpdate$ from '../utils/post-update';
|
||||||
import { chapterBasedSuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { chapterBasedSuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { actionTypes } from './action-types';
|
import { actionTypes } from './action-types';
|
||||||
import {
|
import {
|
||||||
closeModal,
|
closeModal,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { mapTo, tap } from 'rxjs/operators';
|
|||||||
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import { transformEditorLink } from '../utils';
|
import { transformEditorLink } from '../utils';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { actionTypes } from './action-types';
|
import { actionTypes } from './action-types';
|
||||||
import { closeModal } from './actions';
|
import { closeModal } from './actions';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
takeLatest
|
takeLatest
|
||||||
} from 'redux-saga/effects';
|
} from 'redux-saga/effects';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { createFlashMessage } from '../../../components/Flash/redux';
|
import { createFlashMessage } from '../../../components/Flash/redux';
|
||||||
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
import { FlashMessages } from '../../../components/Flash/redux/flash-messages';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
import { handleActions } from 'redux-actions';
|
import { handleActions } from 'redux-actions';
|
||||||
|
|
||||||
import { getLines } from '../../../../../shared-dist/utils/get-lines';
|
import { getLines } from '@freecodecamp/shared/utils/get-lines';
|
||||||
import { getTargetEditor } from '../utils/get-target-editor';
|
import { getTargetEditor } from '../utils/get-target-editor';
|
||||||
import { actionTypes, ns } from './action-types';
|
import { actionTypes, ns } from './action-types';
|
||||||
import codeStorageEpic from './code-storage-epic';
|
import codeStorageEpic from './code-storage-epic';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
completedChallengesSelector,
|
completedChallengesSelector,
|
||||||
allChallengesInfoSelector,
|
allChallengesInfoSelector,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
|
|
||||||
import type { ChallengeFile } from '../../../redux/prop-types';
|
import type { ChallengeFile } from '../../../redux/prop-types';
|
||||||
import { concatHtml } from '../rechallenge/builders';
|
import { concatHtml } from '../rechallenge/builders';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { isEmpty } from 'lodash';
|
|||||||
import { Button } from '@freecodecamp/ui';
|
import { Button } from '@freecodecamp/ui';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
|
|
||||||
import type { BlockLabel as BlockLabelType } from '../../../../../shared-dist/config/blocks';
|
import type { BlockLabel as BlockLabelType } from '@freecodecamp/shared/config/blocks';
|
||||||
import { ProgressBar } from '../../../components/Progress/progress-bar';
|
import { ProgressBar } from '../../../components/Progress/progress-bar';
|
||||||
import DropDown from '../../../assets/icons/dropdown';
|
import DropDown from '../../../assets/icons/dropdown';
|
||||||
import CheckMark from './check-mark';
|
import CheckMark from './check-mark';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { BlockLabel as BlockLabelType } from '../../../../../shared-dist/config/blocks';
|
import { BlockLabel as BlockLabelType } from '@freecodecamp/shared/config/blocks';
|
||||||
|
|
||||||
interface BlockLabelProps {
|
interface BlockLabelProps {
|
||||||
blockLabel: BlockLabelType;
|
blockLabel: BlockLabelType;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { describe, it, expect, afterEach, vi, Mock } from 'vitest';
|
import { describe, it, expect, afterEach, vi, Mock } from 'vitest';
|
||||||
import type { TFunction } from 'i18next';
|
import type { TFunction } from 'i18next';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import {
|
import {
|
||||||
ChallengeFiles,
|
ChallengeFiles,
|
||||||
PrerequisiteChallenge,
|
PrerequisiteChallenge,
|
||||||
@@ -12,14 +12,11 @@ import {
|
|||||||
FileKeyChallenge,
|
FileKeyChallenge,
|
||||||
BilibiliIds
|
BilibiliIds
|
||||||
} from '../../../redux/prop-types';
|
} from '../../../redux/prop-types';
|
||||||
import { isAuditedSuperBlock } from '../../../../../shared-dist/utils/is-audited';
|
import { isAuditedSuperBlock } from '@freecodecamp/shared/utils/is-audited';
|
||||||
import {
|
import { BlockLayouts, BlockLabel } from '@freecodecamp/shared/config/blocks';
|
||||||
BlockLayouts,
|
|
||||||
BlockLabel
|
|
||||||
} from '../../../../../shared-dist/config/blocks';
|
|
||||||
import { Block } from './block';
|
import { Block } from './block';
|
||||||
|
|
||||||
vi.mock('../../../../../shared-dist/utils/is-audited', () => ({
|
vi.mock('@freecodecamp/shared/utils/is-audited', () => ({
|
||||||
isAuditedSuperBlock: vi.fn().mockReturnValueOnce(true)
|
isAuditedSuperBlock: vi.fn().mockReturnValueOnce(true)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import { bindActionCreators, Dispatch } from 'redux';
|
|||||||
import { createSelector } from 'reselect';
|
import { createSelector } from 'reselect';
|
||||||
import { Spacer } from '@freecodecamp/ui';
|
import { Spacer } from '@freecodecamp/ui';
|
||||||
|
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import {
|
import {
|
||||||
chapterBasedSuperBlocks,
|
chapterBasedSuperBlocks,
|
||||||
SuperBlocks
|
SuperBlocks
|
||||||
} from '../../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import { isAuditedSuperBlock } from '../../../../../shared-dist/utils/is-audited';
|
import { isAuditedSuperBlock } from '@freecodecamp/shared/utils/is-audited';
|
||||||
import Caret from '../../../assets/icons/caret';
|
import Caret from '../../../assets/icons/caret';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
import { completedChallengesSelector } from '../../../redux/selectors';
|
import { completedChallengesSelector } from '../../../redux/selectors';
|
||||||
@@ -23,7 +23,7 @@ import { isProjectBased } from '../../../utils/curriculum-layout';
|
|||||||
import {
|
import {
|
||||||
BlockLayouts,
|
BlockLayouts,
|
||||||
BlockLabel as BlockLabelType
|
BlockLabel as BlockLabelType
|
||||||
} from '../../../../../shared-dist/config/blocks';
|
} from '@freecodecamp/shared/config/blocks';
|
||||||
import CheckMark from './check-mark';
|
import CheckMark from './check-mark';
|
||||||
import {
|
import {
|
||||||
GridMapChallenges,
|
GridMapChallenges,
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import { Button } from '@freecodecamp/ui';
|
|||||||
import {
|
import {
|
||||||
type Certification,
|
type Certification,
|
||||||
superBlockToCertMap
|
superBlockToCertMap
|
||||||
} from '../../../../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
isSignedInSelector,
|
isSignedInSelector,
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next';
|
|||||||
|
|
||||||
import GreenNotCompleted from '../../../assets/icons/green-not-completed';
|
import GreenNotCompleted from '../../../assets/icons/green-not-completed';
|
||||||
import GreenPass from '../../../assets/icons/green-pass';
|
import GreenPass from '../../../assets/icons/green-pass';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { challengeTypes } from '../../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
import { ButtonLink } from '../../../components/helpers/button-link';
|
import { ButtonLink } from '../../../components/helpers/button-link';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Spacer } from '@freecodecamp/ui';
|
import { Spacer } from '@freecodecamp/ui';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { isAuditedSuperBlock } from '../../../../../shared-dist/utils/is-audited';
|
import { isAuditedSuperBlock } from '@freecodecamp/shared/utils/is-audited';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Callout } from '@freecodecamp/ui';
|
import { Callout } from '@freecodecamp/ui';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { isRelationalDbCert, isExamCert } from '../../../utils/is-a-cert';
|
import { isRelationalDbCert, isExamCert } from '../../../utils/is-a-cert';
|
||||||
import { CodeAllyDown } from '../../../components/growth-book/codeally-down';
|
import { CodeAllyDown } from '../../../components/growth-book/codeally-down';
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render, screen, within } from '@testing-library/react';
|
import { render, screen, within } from '@testing-library/react';
|
||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import { SuperBlockAccordion } from './super-block-accordion';
|
import { SuperBlockAccordion } from './super-block-accordion';
|
||||||
import {
|
import { BlockLabel, BlockLayouts } from '@freecodecamp/shared/config/blocks';
|
||||||
BlockLabel,
|
|
||||||
BlockLayouts
|
|
||||||
} from '../../../../../shared-dist/config/blocks';
|
|
||||||
|
|
||||||
const mockStructure = {
|
const mockStructure = {
|
||||||
superBlock: SuperBlocks.RespWebDesign,
|
superBlock: SuperBlocks.RespWebDesign,
|
||||||
|
|||||||
@@ -3,18 +3,15 @@ import { useTranslation } from 'react-i18next';
|
|||||||
// TODO: Add this component to freecodecamp/ui and remove this dependency
|
// TODO: Add this component to freecodecamp/ui and remove this dependency
|
||||||
import { Disclosure } from '@headlessui/react';
|
import { Disclosure } from '@headlessui/react';
|
||||||
|
|
||||||
import { SuperBlocks } from '../../../../../shared-dist/config/curriculum';
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
import DropDown from '../../../assets/icons/dropdown';
|
import DropDown from '../../../assets/icons/dropdown';
|
||||||
import type { ChapterBasedSuperBlockStructure } from '../../../redux/prop-types';
|
import type { ChapterBasedSuperBlockStructure } from '../../../redux/prop-types';
|
||||||
import { ChapterIcon } from '../../../assets/chapter-icon';
|
import { ChapterIcon } from '../../../assets/chapter-icon';
|
||||||
import { type Chapter } from '../../../../../shared-dist/config/chapters';
|
import { type Chapter } from '@freecodecamp/shared/config/chapters';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
import {
|
import { BlockLayouts, BlockLabel } from '@freecodecamp/shared/config/blocks';
|
||||||
BlockLayouts,
|
import { FsdChapters } from '@freecodecamp/shared/config/chapters';
|
||||||
BlockLabel
|
import { type Module } from '@freecodecamp/shared/config/modules';
|
||||||
} from '../../../../../shared-dist/config/blocks';
|
|
||||||
import { FsdChapters } from '../../../../../shared-dist/config/chapters';
|
|
||||||
import { type Module } from '../../../../../shared-dist/config/modules';
|
|
||||||
import envData from '../../../../config/env.json';
|
import envData from '../../../../config/env.json';
|
||||||
import Block from './block';
|
import Block from './block';
|
||||||
import CheckMark from './check-mark';
|
import CheckMark from './check-mark';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Callout, Spacer, Container, Row, Col } from '@freecodecamp/ui';
|
|||||||
import {
|
import {
|
||||||
archivedSuperBlocks,
|
archivedSuperBlocks,
|
||||||
SuperBlocks
|
SuperBlocks
|
||||||
} from '../../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import { SuperBlockIcon } from '../../../assets/superblock-icon';
|
import { SuperBlockIcon } from '../../../assets/superblock-icon';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
import CapIcon from '../../../assets/icons/cap';
|
import CapIcon from '../../../assets/icons/cap';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
certificationCollectionSuperBlocks,
|
certificationCollectionSuperBlocks,
|
||||||
chapterBasedSuperBlocks,
|
chapterBasedSuperBlocks,
|
||||||
SuperBlocks
|
SuperBlocks
|
||||||
} from '../../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import type { CertTitle } from '../../../../config/cert-and-project-map';
|
import type { CertTitle } from '../../../../config/cert-and-project-map';
|
||||||
import type {
|
import type {
|
||||||
ChapterBasedSuperBlockStructure,
|
ChapterBasedSuperBlockStructure,
|
||||||
@@ -15,14 +15,14 @@ import type {
|
|||||||
import type {
|
import type {
|
||||||
BlockLabel,
|
BlockLabel,
|
||||||
BlockLayouts
|
BlockLayouts
|
||||||
} from '../../../../../shared-dist/config/blocks';
|
} from '@freecodecamp/shared/config/blocks';
|
||||||
import { SuperBlockIcon } from '../../../assets/superblock-icon';
|
import { SuperBlockIcon } from '../../../assets/superblock-icon';
|
||||||
import { Link } from '../../../components/helpers';
|
import { Link } from '../../../components/helpers';
|
||||||
import {
|
import {
|
||||||
certSlugTypeMap,
|
certSlugTypeMap,
|
||||||
certificationRequirements,
|
certificationRequirements,
|
||||||
superBlockToCertMap
|
superBlockToCertMap
|
||||||
} from '../../../../../shared-dist/config/certification-settings';
|
} from '@freecodecamp/shared/config/certification-settings';
|
||||||
import CheckMark from './check-mark';
|
import CheckMark from './check-mark';
|
||||||
|
|
||||||
import Block from './block';
|
import Block from './block';
|
||||||
|
|||||||
@@ -144,11 +144,8 @@ vi.mock('../../components/helpers', () => ({
|
|||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import {
|
import { BlockLabel, BlockLayouts } from '@freecodecamp/shared/config/blocks';
|
||||||
BlockLabel,
|
import { SuperBlocks } from '@freecodecamp/shared/config/curriculum';
|
||||||
BlockLayouts
|
|
||||||
} from '../../../../shared-dist/config/blocks';
|
|
||||||
import { SuperBlocks } from '../../../../shared-dist/config/curriculum';
|
|
||||||
import SuperBlockIntroductionPage from './super-block-intro';
|
import SuperBlockIntroductionPage from './super-block-intro';
|
||||||
|
|
||||||
type ChallengeNode = {
|
type ChallengeNode = {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { useFeatureValue } from '@growthbook/growthbook-react';
|
|||||||
import {
|
import {
|
||||||
SuperBlocks,
|
SuperBlocks,
|
||||||
certificationCollectionSuperBlocks
|
certificationCollectionSuperBlocks
|
||||||
} from '../../../../shared-dist/config/curriculum';
|
} from '@freecodecamp/shared/config/curriculum';
|
||||||
import DonateModal from '../../components/Donation/donation-modal';
|
import DonateModal from '../../components/Donation/donation-modal';
|
||||||
import Login from '../../components/Header/components/login';
|
import Login from '../../components/Header/components/login';
|
||||||
import Map from '../../components/Map';
|
import Map from '../../components/Map';
|
||||||
@@ -34,11 +34,8 @@ import type {
|
|||||||
ChapterBasedSuperBlockStructure
|
ChapterBasedSuperBlockStructure
|
||||||
} from '../../redux/prop-types';
|
} from '../../redux/prop-types';
|
||||||
import { CertTitle, liveCerts } from '../../../config/cert-and-project-map';
|
import { CertTitle, liveCerts } from '../../../config/cert-and-project-map';
|
||||||
import { superBlockToCertMap } from '../../../../shared-dist/config/certification-settings';
|
import { superBlockToCertMap } from '@freecodecamp/shared/config/certification-settings';
|
||||||
import {
|
import { BlockLayouts, BlockLabel } from '@freecodecamp/shared/config/blocks';
|
||||||
BlockLayouts,
|
|
||||||
BlockLabel
|
|
||||||
} from '../../../../shared-dist/config/blocks';
|
|
||||||
import LegacyLinks from './components/legacy-links';
|
import LegacyLinks from './components/legacy-links';
|
||||||
import HelpTranslate from './components/help-translate';
|
import HelpTranslate from './components/help-translate';
|
||||||
import SuperBlockIntro from './components/super-block-intro';
|
import SuperBlockIntro from './components/super-block-intro';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { challengeFiles } from '../../../utils/__fixtures__/challenges';
|
import { challengeFiles } from '../../../utils/__fixtures__/challenges';
|
||||||
import { challengeTypes } from '../../../../shared-dist/config/challenge-types';
|
import { challengeTypes } from '@freecodecamp/shared/config/challenge-types';
|
||||||
|
|
||||||
const baseChallenge = {
|
const baseChallenge = {
|
||||||
id: '1',
|
id: '1',
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import type {
|
|||||||
SurveyResults,
|
SurveyResults,
|
||||||
User
|
User
|
||||||
} from '../redux/prop-types';
|
} from '../redux/prop-types';
|
||||||
import { DonationDuration } from '../../../shared-dist/config/donation-settings';
|
import { DonationDuration } from '@freecodecamp/shared/config/donation-settings';
|
||||||
|
|
||||||
const { apiLocation } = envData;
|
const { apiLocation } = envData;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user