chore(curriculum): remove BUILD_WITH_SUBMODULE env variable (#55654)

This commit is contained in:
Tom
2024-07-26 10:12:11 -05:00
committed by GitHub
parent 82ec052a3f
commit 99023bfcdc
11 changed files with 33 additions and 39 deletions

View File

@@ -48,8 +48,6 @@ jobs:
- name: Set Environment variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install node_modules
run: pnpm install

View File

@@ -48,8 +48,6 @@ jobs:
- name: Set freeCodeCamp Environment Variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install and Build
run: |
@@ -132,8 +130,6 @@ jobs:
- name: Set freeCodeCamp Environment Variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install and Build
run: |

View File

@@ -32,6 +32,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Checkout client-config
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

View File

@@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Checkout client-config
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -79,6 +81,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Create Image
run: |
@@ -96,6 +100,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Create Image
run: |

View File

@@ -32,8 +32,6 @@ jobs:
- name: Set freeCodeCamp Environment Variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install Dependencies
run: pnpm install

View File

@@ -34,8 +34,6 @@ jobs:
- name: Set freeCodeCamp Environment Variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install Dependencies
run: pnpm install

View File

@@ -56,7 +56,6 @@ jobs:
run: |
cp sample.env .env
cat .env
# TODO: Remove this ^ after migration is complete
- name: Install node_modules
run: pnpm install
@@ -104,8 +103,6 @@ jobs:
- name: Set freeCodeCamp Environment Variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
# TODO: Remove this ^ after migration is complete
- name: Install and Build
run: |
@@ -142,9 +139,7 @@ jobs:
- name: Set Environment variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
cat .env
# TODO: Remove this ^ after migration is complete
- name: Start MongoDB
uses: supercharge/mongodb-github-action@b0a1493307c4e9b82ed61f3858d606c5ff190c64 # v1.10.0
@@ -196,9 +191,7 @@ jobs:
cp sample.env .env
echo 'SHOW_UPCOMING_CHANGES=true' >> .env
echo 'SHOW_NEW_CURRICULUM=true' >> .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
cat .env
# TODO: Remove this ^ after migration is complete
- name: Start MongoDB
uses: supercharge/mongodb-github-action@b0a1493307c4e9b82ed61f3858d606c5ff190c64 # v1.10.0
@@ -249,9 +242,7 @@ jobs:
- name: Set Environment variables
run: |
cp sample.env .env
echo 'BUILD_WITH_SUBMODULE=true' >> .env
cat .env
# TODO: Remove this ^ after migration is complete
- name: Start MongoDB
uses: supercharge/mongodb-github-action@b0a1493307c4e9b82ed61f3858d606c5ff190c64 # v1.10.0

View File

@@ -27,6 +27,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Create Image
run: |
@@ -61,6 +63,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Create Image
run: |
@@ -78,6 +82,8 @@ jobs:
steps:
- name: Checkout Source Files
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: 'recursive'
- name: Create Image
run: |

View File

@@ -8,7 +8,7 @@ const {
generateChallengeCreator,
ENGLISH_CHALLENGES_DIR,
META_DIR,
CHALLENGES_DIR,
I18N_CHALLENGES_DIR,
getChallengesDirForLang
} = require('../../curriculum/get-challenges');
@@ -30,7 +30,11 @@ exports.replaceChallengeNode = () => {
'english',
filePath
);
const i18nPath = path.resolve(CHALLENGES_DIR, curriculumLocale, filePath);
const i18nPath = path.resolve(
I18N_CHALLENGES_DIR,
curriculumLocale,
filePath
);
// TODO: reimplement hot-reloading of certifications
const createChallenge = generateChallengeCreator(
curriculumLocale,

View File

@@ -25,31 +25,29 @@ const ENGLISH_CHALLENGES_DIR = path.resolve(__dirname, 'challenges');
const ENGLISH_DICTIONARIES_DIR = path.resolve(__dirname, 'dictionaries');
const META_DIR = path.resolve(ENGLISH_CHALLENGES_DIR, '_meta');
const CURRICULUM_DIR = path.resolve(
// This is to allow English to build without having to download the i18n files.
// It fails when trying to resolve the i18n-curriculum path if they don't exist.
const I18N_CURRICULUM_DIR = path.resolve(
__dirname,
process.env.BUILD_WITH_SUBMODULE === 'true'
? 'i18n-curriculum/curriculum'
: '.'
process.env.CURRICULUM_LOCALE === 'english'
? '.'
: 'i18n-curriculum/curriculum'
);
const CHALLENGES_DIR = path.resolve(CURRICULUM_DIR, 'challenges');
const DICTIONARIES_DIR = path.resolve(CURRICULUM_DIR, 'dictionaries');
const I18N_CHALLENGES_DIR = path.resolve(I18N_CURRICULUM_DIR, 'challenges');
const I18N_DICTIONARIES_DIR = path.resolve(I18N_CURRICULUM_DIR, 'dictionaries');
exports.ENGLISH_CHALLENGES_DIR = ENGLISH_CHALLENGES_DIR;
exports.META_DIR = META_DIR;
exports.CHALLENGES_DIR = CHALLENGES_DIR;
exports.I18N_CHALLENGES_DIR = I18N_CHALLENGES_DIR;
const COMMENT_TRANSLATIONS = createCommentMap(
DICTIONARIES_DIR,
I18N_DICTIONARIES_DIR,
ENGLISH_DICTIONARIES_DIR
);
function createCommentMap(dictionariesDir, englishDictionariesDir) {
// get all the languages for which there are dictionaries. Note: the english
// entries are created separately, so we remove it from languages.
const languages = fs
.readdirSync(dictionariesDir)
.filter(lang => lang !== 'english'); // TODO: Remove the filter after migrating to i18n-curriculum
const languages = fs.readdirSync(dictionariesDir);
// get all their dictionaries
const dictionaries = languages.reduce(
@@ -130,7 +128,7 @@ function getChallengesDirForLang(lang) {
if (lang === 'english') {
return path.resolve(ENGLISH_CHALLENGES_DIR, `${lang}`);
} else {
return path.resolve(CHALLENGES_DIR, `${lang}`);
return path.resolve(I18N_CHALLENGES_DIR, `${lang}`);
}
}
@@ -258,7 +256,7 @@ async function buildChallenges({ path: filePath }, curriculum, lang) {
'english',
filePath
);
const i18nPath = path.resolve(__dirname, CHALLENGES_DIR, lang, filePath);
const i18nPath = path.resolve(__dirname, I18N_CHALLENGES_DIR, lang, filePath);
const createChallenge = generateChallengeCreator(lang, englishPath, i18nPath);
await assertHasEnglishSource(filePath, lang, englishPath);

View File

@@ -51,9 +51,6 @@ FREECODECAMP_NODE_ENV=development
CLIENT_LOCALE=english
CURRICULUM_LOCALE=english
# Build using submodule - remove this once the workflow has been entirely moved to use the submodule
BUILD_WITH_SUBMODULE=false
# Show or hide WIP in progress challenges
SHOW_UPCOMING_CHANGES=false
SHOW_NEW_CURRICULUM=false