chore(client): refactor & organise config (#40875)
This commit is contained in:
committed by
GitHub
parent
c1f9cd93f5
commit
fffc0e51ec
@@ -4,7 +4,7 @@ const React = require('react');
|
||||
|
||||
const gatsby = jest.requireActual('gatsby');
|
||||
|
||||
const { clientLocale } = require('../../config/env');
|
||||
const { clientLocale } = require('../../../config/env.json');
|
||||
|
||||
module.exports = {
|
||||
...gatsby,
|
||||
|
@@ -5,7 +5,7 @@ import { createSelector } from 'reselect';
|
||||
import { Grid, Button } from '@freecodecamp/react-bootstrap';
|
||||
import Helmet from 'react-helmet';
|
||||
|
||||
import { apiLocation } from '../../config/env.json';
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
import {
|
||||
signInLoadingSelector,
|
||||
userSelector,
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/* global jest, expect */
|
||||
import React from 'react';
|
||||
import ShallowRenderer from 'react-test-renderer/shallow';
|
||||
import { apiLocation } from '../../config/env.json';
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
|
||||
import { ShowSettings } from './ShowSettings';
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import { Grid, Panel, Button } from '@freecodecamp/react-bootstrap';
|
||||
import Helmet from 'react-helmet';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import env from '../../config/env.json';
|
||||
import env from '../../../config/env.json';
|
||||
import FullWidthRow from '../components/helpers/FullWidthRow';
|
||||
import { Spacer } from '../components/helpers';
|
||||
|
||||
|
@@ -24,10 +24,9 @@ import {
|
||||
donationUrls,
|
||||
modalDefaultDonation
|
||||
} from '../../../../config/donation-settings';
|
||||
import { stripePublicKey } from '../../../../config/env.json';
|
||||
import { stripePublicKey, deploymentEnv } from '../../../../config/env.json';
|
||||
import { stripeScriptLoader } from '../../utils/scriptLoaders';
|
||||
import DonateFormChildViewForHOC from './DonateFormChildViewForHOC';
|
||||
import { deploymentEnv } from '../../../config/env.json';
|
||||
import Spacer from '../helpers/Spacer';
|
||||
import PaypalButton from './PaypalButton';
|
||||
import DonateCompletion from './DonateCompletion';
|
||||
|
@@ -7,7 +7,7 @@ import { createSelector } from 'reselect';
|
||||
import PayPalButtonScriptLoader from './PayPalButtonScriptLoader';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
|
||||
import { paypalClientId, deploymentEnv } from '../../../config/env.json';
|
||||
import { paypalClientId, deploymentEnv } from '../../../../config/env.json';
|
||||
import {
|
||||
paypalConfigurator,
|
||||
paypalConfigTypes
|
||||
|
@@ -6,7 +6,7 @@ import { Button } from '@freecodecamp/react-bootstrap';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { isSignedInSelector } from '../../../redux';
|
||||
import { apiLocation, homeLocation } from '../../../../config/env.json';
|
||||
import { apiLocation, homeLocation } from '../../../../../config/env.json';
|
||||
|
||||
import './login.css';
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Link, Spacer } from '../../helpers';
|
||||
import { forumLocation } from '../../../../config/env.json';
|
||||
import { forumLocation } from '../../../../../config/env.json';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
import '../intro.css';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { forumLocation } from '../../config/env.json';
|
||||
import { forumLocation } from '../../../config/env.json';
|
||||
|
||||
const createExternalRedirect = (page, { clientLocale }) => {
|
||||
const isNotEnglish = clientLocale !== 'english';
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
import { apiLocation } from '../../../../config/env.json';
|
||||
|
||||
const currentChallengeApi = '/challenges/current-challenge';
|
||||
|
||||
|
@@ -11,7 +11,7 @@ import HeatMap from './components/HeatMap';
|
||||
import Certifications from './components/Certifications';
|
||||
import Portfolio from './components/Portfolio';
|
||||
import Timeline from './components/TimeLine';
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
import { apiLocation } from '../../../../config/env.json';
|
||||
|
||||
const propTypes = {
|
||||
isSessionUser: PropTypes.bool,
|
||||
|
@@ -16,7 +16,7 @@ import Link from '../../helpers/Link';
|
||||
import './camper.css';
|
||||
|
||||
import { langCodes } from '../../../../i18n/allLangs';
|
||||
import { clientLocale } from '../../../../config/env';
|
||||
import { clientLocale } from '../../../../../config/env.json';
|
||||
|
||||
const localeCode = langCodes[clientLocale];
|
||||
|
||||
|
@@ -16,7 +16,7 @@ import '@freecodecamp/react-calendar-heatmap/dist/styles.css';
|
||||
import './heatmap.css';
|
||||
|
||||
import { langCodes } from '../../../../i18n/allLangs';
|
||||
import { clientLocale } from '../../../../config/env';
|
||||
import { clientLocale } from '../../../../../config/env.json';
|
||||
|
||||
const localeCode = langCodes[clientLocale];
|
||||
|
||||
|
@@ -25,7 +25,7 @@ import { maybeUrlRE } from '../../../utils';
|
||||
import CertificationIcon from '../../../assets/icons/CertificationIcon';
|
||||
|
||||
import { langCodes } from '../../../../i18n/allLangs';
|
||||
import { clientLocale } from '../../../../config/env';
|
||||
import { clientLocale } from '../../../../../config/env.json';
|
||||
|
||||
const localeCode = langCodes[clientLocale];
|
||||
|
||||
|
@@ -15,7 +15,7 @@ import {
|
||||
toggleSearchDropdown,
|
||||
updateSearchQuery
|
||||
} from './redux';
|
||||
import { algoliaAppId, algoliaAPIKey } from '../../../config/env.json';
|
||||
import { algoliaAppId, algoliaAPIKey } from '../../../../config/env.json';
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
||||
import { first } from 'lodash';
|
||||
import EditorTabs from './EditorTabs';
|
||||
import ActionRow from './ActionRow';
|
||||
import { showUpcomingChanges } from '../../../../config/env.json';
|
||||
import { showUpcomingChanges } from '../../../../../config/env.json';
|
||||
|
||||
const propTypes = {
|
||||
challengeFiles: PropTypes.object,
|
||||
|
@@ -8,7 +8,7 @@ import { createStructuredSelector } from 'reselect';
|
||||
import { currentTabSelector, moveToTab } from '../redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import EditorTabs from './EditorTabs';
|
||||
import { showUpcomingChanges } from '../../../../config/env.json';
|
||||
import { showUpcomingChanges } from '../../../../../config/env.json';
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentTab: currentTabSelector
|
||||
|
@@ -7,7 +7,7 @@ import { Trans, withTranslation } from 'react-i18next';
|
||||
|
||||
import { createQuestion, closeModal, isHelpModalOpenSelector } from '../redux';
|
||||
import { executeGA } from '../../../redux';
|
||||
import { forumLocation } from '../../../../config/env.json';
|
||||
import { forumLocation } from '../../../../../config/env.json';
|
||||
|
||||
import './help-modal.css';
|
||||
|
||||
|
@@ -17,7 +17,7 @@ import createWorker from '../utils/worker-executor';
|
||||
|
||||
// the config files are created during the build, but not before linting
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { filename as sassCompile } from '../../../../config/sass-compile';
|
||||
import { filename as sassCompile } from '../../../../../config/client/sass-compile';
|
||||
|
||||
const protectTimeout = 100;
|
||||
const testProtectTimeout = 1500;
|
||||
|
@@ -10,9 +10,9 @@ import {
|
||||
|
||||
// the config files are created during the build, but not before linting
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { filename as runner } from '../../../../config/frame-runner';
|
||||
import { filename as runner } from '../../../../../config/client/frame-runner';
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
import { filename as testEvaluator } from '../../../../config/test-evaluator';
|
||||
import { filename as testEvaluator } from '../../../../../config/client/test-evaluator';
|
||||
|
||||
const frameRunner = [
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { apiLocation } from '../../config/env.json';
|
||||
import { apiLocation } from '../../../config/env.json';
|
||||
import axios from 'axios';
|
||||
import Tokens from 'csrf';
|
||||
import cookies from 'browser-cookies';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
const config = require('../../config/env');
|
||||
const config = require('../../../config/env.json');
|
||||
|
||||
const words = require(`../../i18n/locales/${config.clientLocale}/motivation.json`);
|
||||
|
||||
|
Reference in New Issue
Block a user