feat: add curriculum feature flag (#44441)
This commit is contained in:
committed by
GitHub
parent
88524556e7
commit
dd2ff1683c
@ -31,7 +31,8 @@ const {
|
|||||||
PAYPAL_CLIENT_ID: paypalClientId,
|
PAYPAL_CLIENT_ID: paypalClientId,
|
||||||
PATREON_CLIENT_ID: patreonClientId,
|
PATREON_CLIENT_ID: patreonClientId,
|
||||||
DEPLOYMENT_ENV: deploymentEnv,
|
DEPLOYMENT_ENV: deploymentEnv,
|
||||||
SHOW_UPCOMING_CHANGES: showUpcomingChanges
|
SHOW_UPCOMING_CHANGES: showUpcomingChanges,
|
||||||
|
SHOW_NEW_CURRICULUM: showNewCurriculum
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
const locations = {
|
const locations = {
|
||||||
@ -70,5 +71,6 @@ module.exports = Object.assign(locations, {
|
|||||||
!patreonClientId || patreonClientId === 'id_from_patreon_dashboard'
|
!patreonClientId || patreonClientId === 'id_from_patreon_dashboard'
|
||||||
? null
|
? null
|
||||||
: patreonClientId,
|
: patreonClientId,
|
||||||
showUpcomingChanges: showUpcomingChanges === 'true'
|
showUpcomingChanges: showUpcomingChanges === 'true',
|
||||||
|
showNewCurriculum: showNewCurriculum === 'true'
|
||||||
});
|
});
|
||||||
|
@ -57,6 +57,7 @@ CURRICULUM_LOCALE=english
|
|||||||
|
|
||||||
# Show or hide WIP in progress challenges
|
# Show or hide WIP in progress challenges
|
||||||
SHOW_UPCOMING_CHANGES=false
|
SHOW_UPCOMING_CHANGES=false
|
||||||
|
SHOW_NEW_CURRICULUM=false
|
||||||
|
|
||||||
# Application paths
|
# Application paths
|
||||||
HOME_LOCATION=http://localhost:8000
|
HOME_LOCATION=http://localhost:8000
|
||||||
|
@ -49,7 +49,8 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
|
|||||||
'showLocaleDropdownMenu',
|
'showLocaleDropdownMenu',
|
||||||
'deploymentEnv',
|
'deploymentEnv',
|
||||||
'environment',
|
'environment',
|
||||||
'showUpcomingChanges'
|
'showUpcomingChanges',
|
||||||
|
'showNewCurriculum'
|
||||||
];
|
];
|
||||||
const searchKeys = ['algoliaAppId', 'algoliaAPIKey'];
|
const searchKeys = ['algoliaAppId', 'algoliaAPIKey'];
|
||||||
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
|
const donationKeys = ['stripePublicKey', 'paypalClientId', 'patreonClientId'];
|
||||||
@ -112,13 +113,18 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
|
|||||||
checkClientLocale();
|
checkClientLocale();
|
||||||
checkCurriculumLocale();
|
checkCurriculumLocale();
|
||||||
if (fs.existsSync(`${globalConfigPath}/env.json`)) {
|
if (fs.existsSync(`${globalConfigPath}/env.json`)) {
|
||||||
// eslint-disable-next-line
|
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
|
||||||
const { showUpcomingChanges } = require(`${globalConfigPath}/env.json`);
|
const {
|
||||||
if (env['showUpcomingChanges'] !== showUpcomingChanges) {
|
showNewCurriculum,
|
||||||
|
showUpcomingChanges
|
||||||
|
} = require(`${globalConfigPath}/env.json`);
|
||||||
|
/* eslint-enable @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment */
|
||||||
|
if (
|
||||||
|
env['showUpcomingChanges'] !== showUpcomingChanges ||
|
||||||
|
env['showNewCurriculum'] !== showNewCurriculum
|
||||||
|
) {
|
||||||
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
|
||||||
console.log(
|
console.log('Feature flags have been changed, cleaning client cache.');
|
||||||
'SHOW_UPCOMING_CHANGES value has changed, cleaning client cache.'
|
|
||||||
);
|
|
||||||
const child = spawn('npm', ['run', 'clean:client']);
|
const child = spawn('npm', ['run', 'clean:client']);
|
||||||
child.stdout.setEncoding('utf8');
|
child.stdout.setEncoding('utf8');
|
||||||
child.stdout.on('data', function (data) {
|
child.stdout.on('data', function (data) {
|
||||||
|
Reference in New Issue
Block a user