mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: clean client on setup (#66108)
This commit is contained in:
committed by
GitHub
parent
f507f600b1
commit
ab830caaa6
+1
-1
@@ -28,7 +28,7 @@
|
||||
"create:search-placeholder": "tsx ./tools/generate-search-placeholder",
|
||||
"develop": "NODE_OPTIONS=\"--max-old-space-size=7168 --no-deprecation\" gatsby develop --inspect=9230",
|
||||
"lint": "eslint --max-warnings 0",
|
||||
"setup": "pnpm create:env && pnpm create:trending && pnpm create:search-placeholder && pnpm create:external-curriculum && pnpm copy:scripts",
|
||||
"setup": "pnpm clean && pnpm create:env && pnpm create:trending && pnpm create:search-placeholder && pnpm create:external-curriculum && pnpm copy:scripts",
|
||||
"serve": "gatsby serve -p 8000",
|
||||
"serve-ci": "serve -l 8000 -c serve.json public",
|
||||
"prestand-alone": "pnpm run prebuild",
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { spawn } from 'child_process';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import { availableLangs, Languages } from '@freecodecamp/shared/config/i18n';
|
||||
import env from './read-env';
|
||||
|
||||
@@ -123,24 +120,6 @@ if (FREECODECAMP_NODE_ENV !== 'development') {
|
||||
SHOW_UPCOMING_CHANGES should never be 'true' in production
|
||||
|
||||
`);
|
||||
} else {
|
||||
if (fs.existsSync(`${configPath}/env.json`)) {
|
||||
const envJson = JSON.parse(
|
||||
fs.readFileSync(`${configPath}/env.json`, 'utf-8')
|
||||
);
|
||||
|
||||
if (!isEqual(env, envJson)) {
|
||||
console.log('Feature flags have been changed, cleaning client cache.');
|
||||
const child = spawn('pnpm', ['run', '-w', 'clean:client']);
|
||||
child.stdout.setEncoding('utf8');
|
||||
child.stdout.on('data', function (data) {
|
||||
console.log(data);
|
||||
});
|
||||
child.on('error', err => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(`${configPath}/env.json`, JSON.stringify(env));
|
||||
|
||||
@@ -602,8 +602,4 @@ void getAllBlocks()
|
||||
);
|
||||
}
|
||||
)
|
||||
.then(() =>
|
||||
console.log(
|
||||
'All set. Now use pnpm run clean:client in the root and it should be good to go.'
|
||||
)
|
||||
);
|
||||
.then(() => console.log('All set. Restart the client to see the changes.'));
|
||||
|
||||
@@ -396,8 +396,4 @@ void getAllBlocks()
|
||||
})
|
||||
)
|
||||
)
|
||||
.then(() =>
|
||||
console.log(
|
||||
'All set. Now use pnpm run clean:client in the root and it should be good to go.'
|
||||
)
|
||||
);
|
||||
.then(() => console.log('All set. Restart the client to see the changes.'));
|
||||
|
||||
@@ -183,8 +183,4 @@ void getAllBlocks()
|
||||
}: CreateQuizArgs) =>
|
||||
await createQuiz(superBlock, block, helpCategory, questionCount, title)
|
||||
)
|
||||
.then(() =>
|
||||
console.log(
|
||||
'All set. Now use pnpm run clean:client in the root and it should be good to go.'
|
||||
)
|
||||
);
|
||||
.then(() => console.log('All set. Restart the client to see the changes.'));
|
||||
|
||||
@@ -108,8 +108,4 @@ void getAllBlocks()
|
||||
async ({ newBlock, newName, oldBlock }: RenameBlockArgs) =>
|
||||
await renameBlock({ newBlock, newName, oldBlock })
|
||||
)
|
||||
.then(() =>
|
||||
console.log(
|
||||
'All set. Now use pnpm run clean:client in the root and it should be good to go'
|
||||
)
|
||||
);
|
||||
.then(() => console.log('All set. Restart the client to see the changes.'));
|
||||
|
||||
Reference in New Issue
Block a user