refactor: remove SHOW_NEW_CURRICULUM (#57977)

This commit is contained in:
Oliver Eyton-Williams
2025-01-07 11:17:05 +01:00
committed by GitHub
parent 09a5415d03
commit 232f6d50aa
15 changed files with 10 additions and 66 deletions
+3 -9
View File
@@ -49,8 +49,7 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
'curriculumLocale',
'deploymentEnv',
'environment',
'showUpcomingChanges',
'showNewCurriculum'
'showUpcomingChanges'
];
const searchKeys = ['algoliaAppId', 'algoliaAPIKey'];
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
@@ -114,14 +113,9 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
checkCurriculumLocale();
if (fs.existsSync(`${configPath}/env.json`)) {
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
const { showNewCurriculum, showUpcomingChanges } = require(
`${configPath}/env.json`
);
const { showUpcomingChanges } = require(`${configPath}/env.json`);
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
if (
env['showUpcomingChanges'] !== showUpcomingChanges ||
env['showNewCurriculum'] !== showNewCurriculum
) {
if (env['showUpcomingChanges'] !== showUpcomingChanges) {
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
console.log('Feature flags have been changed, cleaning client cache.');
const child = spawn('pnpm', ['run', '-w', 'clean:client']);
-2
View File
@@ -32,7 +32,6 @@ const {
PATREON_CLIENT_ID: patreonClientId,
DEPLOYMENT_ENV: deploymentEnv,
SHOW_UPCOMING_CHANGES: showUpcomingChanges,
SHOW_NEW_CURRICULUM: showNewCurriculum,
GROWTHBOOK_URI: growthbookUri
} = process.env;
@@ -72,7 +71,6 @@ export default Object.assign(locations, {
? null
: patreonClientId,
showUpcomingChanges: showUpcomingChanges === 'true',
showNewCurriculum: showNewCurriculum === 'true',
growthbookUri:
!growthbookUri || growthbookUri === 'api_URI_from_Growthbook_dashboard'
? null