diff --git a/client/package.json b/client/package.json index 70667dc73e3..757610e16ba 100644 --- a/client/package.json +++ b/client/package.json @@ -70,6 +70,7 @@ "final-form": "4.20.7", "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", @@ -100,6 +101,7 @@ "react-helmet": "6.1.0", "react-hotkeys": "2.0.0", "react-i18next": "11.18.6", + "react-instantsearch-core": "6.38.2", "react-instantsearch-dom": "6.38.1", "react-lazy-load": "3.1.14", "react-monaco-editor": "0.40.0", @@ -133,6 +135,7 @@ "@babel/types": "7.20.7", "@codesee/babel-plugin-instrument": "0.470.0", "@codesee/tracker": "0.470.0", + "@faker-js/faker": "7.6.0", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "12.1.5", "autoprefixer": "10.4.13", diff --git a/client/src/components/Donation/paypal-button.tsx b/client/src/components/Donation/paypal-button.tsx index e6b3167e82f..3e54d4fd119 100644 --- a/client/src/components/Donation/paypal-button.tsx +++ b/client/src/components/Donation/paypal-button.tsx @@ -59,10 +59,7 @@ const { deploymentEnv: 'staging' | 'live'; }; -export class PaypalButton extends Component< - PaypalButtonProps, - PaypalButtonState -> { +class PaypalButton extends Component { static displayName = 'PaypalButton'; state: PaypalButtonState = { amount: defaultDonation.donationAmount, diff --git a/client/src/components/Header/components/nav-links.tsx b/client/src/components/Header/components/nav-links.tsx index dc9bd246338..3de9d1c1063 100644 --- a/client/src/components/Header/components/nav-links.tsx +++ b/client/src/components/Header/components/nav-links.tsx @@ -65,7 +65,7 @@ const mapDispatchToProps = { openSignoutModal }; -export class NavLinks extends Component { +class NavLinks extends Component { static displayName: string; langButtonRef: React.RefObject; firstLangOptionRef: React.RefObject; diff --git a/client/src/redux/action-types.js b/client/src/redux/action-types.js index 1b487225651..7aa77c37257 100644 --- a/client/src/redux/action-types.js +++ b/client/src/redux/action-types.js @@ -23,7 +23,6 @@ export const actionTypes = createTypes( 'showCodeAlly', 'submitComplete', 'updateComplete', - 'updateCurrentChallengeId', 'updateFailed', 'updateDonationFormState', 'updateUserToken', diff --git a/client/src/redux/actions.js b/client/src/redux/actions.js index 47a3d923eed..43c1d3923b9 100644 --- a/client/src/redux/actions.js +++ b/client/src/redux/actions.js @@ -90,9 +90,5 @@ export const hideCodeAlly = createAction(actionTypes.hideCodeAlly); export const showCodeAlly = createAction(actionTypes.showCodeAlly); export const tryToShowCodeAlly = createAction(actionTypes.tryToShowCodeAlly); -export const updateCurrentChallengeId = createAction( - actionTypes.updateCurrentChallengeId -); - export const closeSignoutModal = createAction(actionTypes.closeSignoutModal); export const openSignoutModal = createAction(actionTypes.openSignoutModal); diff --git a/client/src/redux/index.js b/client/src/redux/index.js index b520e2c03c9..9dbaf84a81e 100644 --- a/client/src/redux/index.js +++ b/client/src/redux/index.js @@ -23,7 +23,7 @@ import { createShowCertSaga } from './show-cert-saga'; import updateCompleteEpic from './update-complete-epic'; import { createUserTokenSaga } from './user-token-saga'; -export const defaultFetchState = { +const defaultFetchState = { pending: true, complete: false, errored: false, @@ -41,7 +41,7 @@ export const defaultDonationFormState = { } }; -export const initialState = { +const initialState = { appUsername: '', recentlyClaimedBlock: null, canRequestProgressDonation: true, diff --git a/client/src/redux/prop-types.ts b/client/src/redux/prop-types.ts index aed72b85469..a44282bba2b 100644 --- a/client/src/redux/prop-types.ts +++ b/client/src/redux/prop-types.ts @@ -1,78 +1,8 @@ -import PropTypes from 'prop-types'; import { HandlerProps } from 'react-reflex'; import { SuperBlocks } from '../../../config/certification-settings'; import { Themes } from '../components/settings/theme'; import { certMap } from '../resources/cert-and-project-map'; -export const UserPropType = PropTypes.shape({ - about: PropTypes.string, - completedChallenges: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - solution: PropTypes.string, - githubLink: PropTypes.string, - challengeType: PropTypes.number, - completedDate: PropTypes.number, - challengeFiles: PropTypes.array - }) - ), - email: PropTypes.string, - githubProfile: PropTypes.string, - is2018DataVisCert: PropTypes.bool, - isApisMicroservicesCert: PropTypes.bool, - isBackEndCert: PropTypes.bool, - isDataVisCert: PropTypes.bool, - isEmailVerified: PropTypes.bool, - isFrontEndCert: PropTypes.bool, - isFrontEndLibsCert: PropTypes.bool, - isFullStackCert: PropTypes.bool, - isHonest: PropTypes.bool, - isInfosecQaCert: PropTypes.bool, - isQaCertV7: PropTypes.bool, - isInfosecCertV7: PropTypes.bool, - isJsAlgoDataStructCert: PropTypes.bool, - isRelationalDatabaseCertV8: PropTypes.bool, - isRespWebDesignCert: PropTypes.bool, - isSciCompPyCertV7: PropTypes.bool, - isDataAnalysisPyCertV7: PropTypes.bool, - isMachineLearningPyCertV7: PropTypes.bool, - linkedin: PropTypes.string, - location: PropTypes.string, - name: PropTypes.string, - picture: PropTypes.string, - points: PropTypes.number, - portfolio: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string.isRequired, - title: PropTypes.string, - url: PropTypes.string, - image: PropTypes.string, - description: PropTypes.string - }) - ), - savedChallenges: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - challengeFiles: PropTypes.array - }) - ), - sendQuincyEmail: PropTypes.bool, - sound: PropTypes.bool, - theme: PropTypes.string, - keyboardShortcuts: PropTypes.bool, - twitter: PropTypes.string, - username: PropTypes.string, - website: PropTypes.string -}); - -export const CurrentCertsPropType = PropTypes.arrayOf( - PropTypes.shape({ - show: PropTypes.bool, - title: PropTypes.string, - certSlug: PropTypes.string - }) -); - export type Steps = { isHonest?: boolean; currentCerts?: Array; diff --git a/client/src/redux/save-challenge-saga.js b/client/src/redux/save-challenge-saga.js index be0ad140992..4c109abe4e7 100644 --- a/client/src/redux/save-challenge-saga.js +++ b/client/src/redux/save-challenge-saga.js @@ -17,7 +17,7 @@ import { import { saveChallengeComplete } from './actions'; import { savedChallengesSelector } from './selectors'; -export function* saveChallengeSaga() { +function* saveChallengeSaga() { const { id, challengeType } = yield select(challengeMetaSelector); const { challengeFiles } = yield select(challengeDataSelector); const savedChallenges = yield select(savedChallengesSelector); diff --git a/client/src/redux/selectors.js b/client/src/redux/selectors.js index e9a561d6067..291d162d5fe 100644 --- a/client/src/redux/selectors.js +++ b/client/src/redux/selectors.js @@ -217,5 +217,3 @@ export const userSelector = state => { return state[MainApp].user[username] || {}; }; - -export const sessionMetaSelector = state => state[MainApp].sessionMeta; diff --git a/client/src/redux/types.ts b/client/src/redux/types.ts index 0c56a1c4bd0..0288b1363b5 100644 --- a/client/src/redux/types.ts +++ b/client/src/redux/types.ts @@ -49,17 +49,3 @@ interface DefaultDonationFormState { success: boolean; error: null | string; } - -export const defaultFetchState = { - pending: true, - complete: false, - errored: false, - error: null -}; - -export const defaultDonationFormState = { - redirecting: false, - processing: false, - success: false, - error: '' -}; diff --git a/client/src/templates/Challenges/components/completion-modal.tsx b/client/src/templates/Challenges/components/completion-modal.tsx index 64a13b47403..cf404e24f0f 100644 --- a/client/src/templates/Challenges/components/completion-modal.tsx +++ b/client/src/templates/Challenges/components/completion-modal.tsx @@ -131,7 +131,7 @@ interface CompletionModalInnerState { completedChallengesInBlock: number; } -export class CompletionModalInner extends Component< +class CompletionModalInner extends Component< CompletionModalsProps, CompletionModalInnerState > { diff --git a/client/src/templates/Challenges/components/help-modal.tsx b/client/src/templates/Challenges/components/help-modal.tsx index 66ed57101aa..169325ceb4f 100644 --- a/client/src/templates/Challenges/components/help-modal.tsx +++ b/client/src/templates/Challenges/components/help-modal.tsx @@ -44,7 +44,7 @@ const generateSearchLink = (title: string, block: string) => { return search; }; -export function HelpModal({ +function HelpModal({ closeHelpModal, createQuestion, executeGA, diff --git a/client/src/templates/Challenges/components/shortcuts-modal.tsx b/client/src/templates/Challenges/components/shortcuts-modal.tsx index 629a59adff0..6d882f02644 100644 --- a/client/src/templates/Challenges/components/shortcuts-modal.tsx +++ b/client/src/templates/Challenges/components/shortcuts-modal.tsx @@ -37,7 +37,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => dispatch ); -export function ShortcutsModal({ +function ShortcutsModal({ closeShortcutsModal, toggleKeyboardShortcuts, isOpen, diff --git a/client/src/templates/Challenges/components/video-modal.tsx b/client/src/templates/Challenges/components/video-modal.tsx index 1b42eeff8c8..d79417223c4 100644 --- a/client/src/templates/Challenges/components/video-modal.tsx +++ b/client/src/templates/Challenges/components/video-modal.tsx @@ -28,7 +28,7 @@ const mapDispatchToProps = (dispatch: Dispatch) => dispatch ); -export function VideoModal({ +function VideoModal({ closeVideoModal, executeGA, isOpen, diff --git a/client/src/templates/Challenges/projects/tool-panel.tsx b/client/src/templates/Challenges/projects/tool-panel.tsx index 7cb402a04e5..46a1e3cb820 100644 --- a/client/src/templates/Challenges/projects/tool-panel.tsx +++ b/client/src/templates/Challenges/projects/tool-panel.tsx @@ -24,7 +24,7 @@ interface ToolPanelProps { t: TFunction; } -export function ToolPanel({ +function ToolPanel({ guideUrl, openHelpModal, t diff --git a/client/src/templates/Challenges/rechallenge/transformers.js b/client/src/templates/Challenges/rechallenge/transformers.js index 4abd8943a2e..ddc5ba1f7c1 100644 --- a/client/src/templates/Challenges/rechallenge/transformers.js +++ b/client/src/templates/Challenges/rechallenge/transformers.js @@ -99,9 +99,8 @@ const testJS = matchesProperty('ext', 'js'); const testJSX = matchesProperty('ext', 'jsx'); const testHTML = matchesProperty('ext', 'html'); const testHTML$JS$JSX = overSome(testHTML, testJS, testJSX); -export const testJS$JSX = overSome(testJS, testJSX); -export const replaceNBSP = cond([ +const replaceNBSP = cond([ [ testHTML$JS$JSX, partial(transformContents, contents => contents.replace(NBSPReg, ' ')) diff --git a/client/src/templates/Challenges/redux/action-types.js b/client/src/templates/Challenges/redux/action-types.js index caa4b98f5a0..9e2137bab75 100644 --- a/client/src/templates/Challenges/redux/action-types.js +++ b/client/src/templates/Challenges/redux/action-types.js @@ -14,7 +14,6 @@ export const actionTypes = createTypes( 'updateConsole', 'updateChallengeMeta', 'updateFile', - 'updateJSEnabled', 'updateSolutionFormValues', 'updateSuccessMessage', 'updateTests', diff --git a/client/src/templates/Challenges/redux/actions.js b/client/src/templates/Challenges/redux/actions.js index 5a488306546..8c8577dd8a6 100644 --- a/client/src/templates/Challenges/redux/actions.js +++ b/client/src/templates/Challenges/redux/actions.js @@ -31,7 +31,6 @@ export const updateChallengeMeta = createAction( export const updateFile = createAction(actionTypes.updateFile); export const updateConsole = createAction(actionTypes.updateConsole); export const updateLogs = createAction(actionTypes.updateLogs); -export const updateJSEnabled = createAction(actionTypes.updateJSEnabled); export const updateSolutionFormValues = createAction( actionTypes.updateSolutionFormValues ); diff --git a/client/src/templates/Challenges/redux/current-challenge-saga.js b/client/src/templates/Challenges/redux/current-challenge-saga.js index eb78a2f09f4..9e07be593b7 100644 --- a/client/src/templates/Challenges/redux/current-challenge-saga.js +++ b/client/src/templates/Challenges/redux/current-challenge-saga.js @@ -5,7 +5,7 @@ import { randomCompliment } from '../../../utils/get-words'; import { CURRENT_CHALLENGE_KEY } from './action-types'; import { updateSuccessMessage } from './actions'; -export function* currentChallengeSaga({ payload: id }) { +function* currentChallengeSaga({ payload: id }) { yield store.set(CURRENT_CHALLENGE_KEY, id); // // Temporarily removed to reduce calls to database // // will need to re-import things at the top @@ -26,7 +26,7 @@ export function* currentChallengeSaga({ payload: id }) { // } } -export function* updateSuccessMessageSaga() { +function* updateSuccessMessageSaga() { yield put(updateSuccessMessage(randomCompliment())); } diff --git a/client/src/templates/Challenges/redux/execute-challenge-saga.js b/client/src/templates/Challenges/redux/execute-challenge-saga.js index 4f009dd991d..f7449133fdb 100644 --- a/client/src/templates/Challenges/redux/execute-challenge-saga.js +++ b/client/src/templates/Challenges/redux/execute-challenge-saga.js @@ -57,7 +57,7 @@ import { const previewTimeout = 2500; // when 'run tests' is clicked, do this first -export function* executeCancellableChallengeSaga(payload) { +function* executeCancellableChallengeSaga(payload) { const { challengeType, id } = yield select(challengeMetaSelector); const { challengeFiles } = yield select(challengeDataSelector); @@ -84,7 +84,7 @@ export function* executeCancellableChallengeSaga(payload) { yield cancel(task); } -export function* executeChallengeSaga({ payload }) { +function* executeChallengeSaga({ payload }) { const isBuildEnabled = yield select(isBuildEnabledSelector); if (!isBuildEnabled) { return; diff --git a/client/src/templates/Challenges/redux/selectors.js b/client/src/templates/Challenges/redux/selectors.js index a5f9296223b..12d30ff54b4 100644 --- a/client/src/templates/Challenges/redux/selectors.js +++ b/client/src/templates/Challenges/redux/selectors.js @@ -2,7 +2,6 @@ import { challengeTypes } from '../../../../utils/challenge-types'; import { completedChallengesSelector } from '../../../redux/selectors'; import { ns } from './action-types'; -export const currentTabSelector = state => state[ns].currentTab; export const challengeFilesSelector = state => state[ns].challengeFiles; export const challengeMetaSelector = state => state[ns].challengeMeta; export const challengeTestsSelector = state => state[ns].challengeTests; diff --git a/client/src/templates/Challenges/utils/build.ts b/client/src/templates/Challenges/utils/build.ts index b902c8b635d..81d04296ab2 100644 --- a/client/src/templates/Challenges/utils/build.ts +++ b/client/src/templates/Challenges/utils/build.ts @@ -250,7 +250,7 @@ export function buildJSChallenge( } } -export function buildBackendChallenge({ url }: BuildChallengeData) { +function buildBackendChallenge({ url }: BuildChallengeData) { return { challengeType: challengeTypes.backend, build: concatHtml({ required: frameRunner }), diff --git a/client/src/templates/Introduction/components/block.tsx b/client/src/templates/Introduction/components/block.tsx index 30e4501ceb1..ec6edcd0861 100644 --- a/client/src/templates/Introduction/components/block.tsx +++ b/client/src/templates/Introduction/components/block.tsx @@ -57,8 +57,7 @@ interface BlockProps { t: TFunction; toggleBlock: typeof toggleBlock; } - -export class Block extends Component { +class Block extends Component { static displayName: string; constructor(props: BlockProps) { super(props); diff --git a/client/src/templates/Introduction/components/cert-challenge.tsx b/client/src/templates/Introduction/components/cert-challenge.tsx index f193e852d3e..cce3d4a7c17 100644 --- a/client/src/templates/Introduction/components/cert-challenge.tsx +++ b/client/src/templates/Introduction/components/cert-challenge.tsx @@ -140,8 +140,6 @@ const CertChallenge = ({ CertChallenge.displayName = 'CertChallenge'; -export { CertChallenge }; - export default connect( mapStateToProps, mapDispatchToProps diff --git a/client/src/utils/A-B-tester.test.ts b/client/src/utils/A-B-tester.test.ts index df932ff6abd..5c1d1d30c01 100644 --- a/client/src/utils/A-B-tester.test.ts +++ b/client/src/utils/A-B-tester.test.ts @@ -1,4 +1,4 @@ -import faker from 'faker'; +import { faker } from '@faker-js/faker'; import { emailToABVariant } from './A-B-tester'; describe('client/src is-email-variation-a', () => { diff --git a/client/src/utils/path-parsers.ts b/client/src/utils/path-parsers.ts index 587606f409c..11f23e452db 100644 --- a/client/src/utils/path-parsers.ts +++ b/client/src/utils/path-parsers.ts @@ -31,6 +31,3 @@ export const isLocationSuperBlock = ( ): boolean => { return /^\/learn\/[\w-]+\/$/.test(location?.pathname ?? ''); }; - -const pathParsers = { isLanding, isChallenge }; -export default pathParsers; diff --git a/client/utils/challenge-types.js b/client/utils/challenge-types.js index 5cbc1d59f66..5655b53143c 100644 --- a/client/utils/challenge-types.js +++ b/client/utils/challenge-types.js @@ -60,12 +60,6 @@ exports.isCodeAllyPractice = challengeType => { return challengeType === codeAllyPractice; }; -// turn challengeType to file ext -exports.pathsMap = { - [html]: 'html', - [js]: 'js', - [jsProject]: 'js' -}; // determine the component view for each challenge exports.viewTypes = { [html]: 'classic', diff --git a/config/knip/knip.json b/config/knip/knip.json index cdb79eb4b6c..bb0962d2751 100644 --- a/config/knip/knip.json +++ b/config/knip/knip.json @@ -6,7 +6,8 @@ "src/html.tsx", "src/pages/*.tsx", "src/templates/Challenges/**/{s,S}how.tsx", - "src/templates/Introduction/**/{intro,super-block-intro}.tsx" + "src/templates/Introduction/**/{intro,super-block-intro}.tsx", + "**/*.test.{js,ts,tsx}" ], "projectFiles": [ "**/*.{js,ts,tsx}", @@ -17,8 +18,6 @@ "!src/client/frame-runner.ts", "!src/client/workers/**", "!webpack-workers.js", - "!**/*.test.{js,ts,tsx}", - "!**/i18n/config-for-tests.ts", "!**/__mocks__/**", "!**/__fixtures/**", "!**/node_modules/**", diff --git a/package-lock.json b/package-lock.json index 1c15f30d1a7..bc0764ff28e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,6 @@ "@types/enzyme-adapter-react-16": "1.0.6", "@types/eslint": "7.29.0", "@types/estree": "0.0.52", - "@types/faker": "5.5.9", "@types/inquirer": "8.2.5", "@types/jest": "27.5.2", "@types/jquery": "3.5.16", @@ -87,7 +86,6 @@ "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-testing-library": "4.12.4", "execa": "5.1.1", - "faker": "5.5.3", "husky": "8.0.3", "jest": "27.5.1", "js-yaml": "3.14.1", @@ -462,6 +460,7 @@ "final-form": "4.20.7", "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", @@ -492,6 +491,7 @@ "react-helmet": "6.1.0", "react-hotkeys": "2.0.0", "react-i18next": "11.18.6", + "react-instantsearch-core": "6.38.2", "react-instantsearch-dom": "6.38.1", "react-lazy-load": "3.1.14", "react-monaco-editor": "0.40.0", @@ -525,6 +525,7 @@ "@babel/types": "7.20.7", "@codesee/babel-plugin-instrument": "0.470.0", "@codesee/tracker": "0.470.0", + "@faker-js/faker": "7.6.0", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "12.1.5", "autoprefixer": "10.4.13", @@ -585,6 +586,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "client/node_modules/react-instantsearch-core": { + "version": "6.38.2", + "resolved": "https://registry.npmjs.org/react-instantsearch-core/-/react-instantsearch-core-6.38.2.tgz", + "integrity": "sha512-eX1FJQ7648mZgY+B79EghggjCHLLxiv/otQ7kgkXiHpU2XNfqEhweufqgwSEJH5gUgGUo4JsgHHWLoX56YvrDQ==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "algoliasearch-helper": "^3.11.1", + "prop-types": "^15.6.2", + "react-fast-compare": "^3.0.0" + }, + "peerDependencies": { + "algoliasearch": ">= 3.1 < 5", + "react": ">= 16.3.0 < 19" + } + }, "client/node_modules/react-monaco-editor": { "version": "0.40.0", "license": "MIT", @@ -3181,6 +3197,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@faker-js/faker": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", + "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", + "dev": true, + "engines": { + "node": ">=14.0.0", + "npm": ">=6.0.0" + } + }, "node_modules/@fortawesome/fontawesome-common-types": { "version": "6.2.1", "hasInstallScript": true, @@ -13874,11 +13900,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/faker": { - "version": "5.5.9", - "dev": true, - "license": "MIT" - }, "node_modules/@types/get-port": { "version": "3.2.0", "license": "MIT" @@ -25067,11 +25088,6 @@ "node": "> 0.1.90" } }, - "node_modules/faker": { - "version": "5.5.3", - "dev": true, - "license": "MIT" - }, "node_modules/fast-copy": { "version": "2.1.1", "license": "MIT" @@ -56029,6 +56045,12 @@ } } }, + "@faker-js/faker": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", + "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", + "dev": true + }, "@fortawesome/fontawesome-common-types": { "version": "6.2.1" }, @@ -56423,6 +56445,7 @@ "@babel/types": "7.20.7", "@codesee/babel-plugin-instrument": "0.470.0", "@codesee/tracker": "0.470.0", + "@faker-js/faker": "7.6.0", "@fortawesome/fontawesome-svg-core": "6.2.1", "@fortawesome/free-brands-svg-icons": "6.2.1", "@fortawesome/free-solid-svg-icons": "6.2.1", @@ -56461,6 +56484,7 @@ "final-form": "4.20.7", "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", @@ -56494,6 +56518,7 @@ "react-helmet": "6.1.0", "react-hotkeys": "2.0.0", "react-i18next": "11.18.6", + "react-instantsearch-core": "6.38.2", "react-instantsearch-dom": "6.38.1", "react-lazy-load": "3.1.14", "react-monaco-editor": "0.40.0", @@ -56552,6 +56577,17 @@ "strict-uri-encode": "^2.0.0" } }, + "react-instantsearch-core": { + "version": "6.38.2", + "resolved": "https://registry.npmjs.org/react-instantsearch-core/-/react-instantsearch-core-6.38.2.tgz", + "integrity": "sha512-eX1FJQ7648mZgY+B79EghggjCHLLxiv/otQ7kgkXiHpU2XNfqEhweufqgwSEJH5gUgGUo4JsgHHWLoX56YvrDQ==", + "requires": { + "@babel/runtime": "^7.1.2", + "algoliasearch-helper": "^3.11.1", + "prop-types": "^15.6.2", + "react-fast-compare": "^3.0.0" + } + }, "react-monaco-editor": { "version": "0.40.0", "requires": { @@ -64270,10 +64306,6 @@ "@types/range-parser": "*" } }, - "@types/faker": { - "version": "5.5.9", - "dev": true - }, "@types/get-port": { "version": "3.2.0" }, @@ -72021,10 +72053,6 @@ "eyes": { "version": "0.1.8" }, - "faker": { - "version": "5.5.3", - "dev": true - }, "fast-copy": { "version": "2.1.1" }, diff --git a/package.json b/package.json index 78cb285946a..fe431d45f03 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,6 @@ "@types/enzyme-adapter-react-16": "1.0.6", "@types/eslint": "7.29.0", "@types/estree": "0.0.52", - "@types/faker": "5.5.9", "@types/inquirer": "8.2.5", "@types/jest": "27.5.2", "@types/jquery": "3.5.16", @@ -174,7 +173,6 @@ "eslint-plugin-react-hooks": "4.6.0", "eslint-plugin-testing-library": "4.12.4", "execa": "5.1.1", - "faker": "5.5.3", "husky": "8.0.3", "jest": "27.5.1", "js-yaml": "3.14.1", diff --git a/tools/scripts/build/download-trending.ts b/tools/scripts/build/download-trending.ts index 7621c41f9e1..bafe4423376 100644 --- a/tools/scripts/build/download-trending.ts +++ b/tools/scripts/build/download-trending.ts @@ -1,9 +1,9 @@ import { writeFileSync } from 'fs'; import fetch from 'node-fetch'; import yaml from 'js-yaml'; -import { trendingSchemaValidator } from '../../../client/i18n/schema/trendingSchema'; - import envData from '../../../config/env.json'; +import { trendingSchemaValidator } from './schema/trending-schema'; + const { clientLocale } = envData; const createCdnUrl = (lang: string) => diff --git a/client/i18n/schema/trendingSchema.js b/tools/scripts/build/schema/trending-schema.ts similarity index 97% rename from client/i18n/schema/trendingSchema.js rename to tools/scripts/build/schema/trending-schema.ts index e9d06c170f3..935fd918e6f 100644 --- a/client/i18n/schema/trendingSchema.js +++ b/tools/scripts/build/schema/trending-schema.ts @@ -63,6 +63,8 @@ const schema = Joi.object().keys({ article29link: Joi.string().uri({ scheme: 'https' }).required() }); -export const trendingSchemaValidator = trendingObj => { +export const trendingSchemaValidator = ( + trendingObj: Record +) => { return schema.validate(trendingObj); };