diff --git a/.github/workflows/curriculum-i18n-submodule.yml b/.github/workflows/curriculum-i18n-submodule.yml index 29f6c034f17..c2af27c0513 100644 --- a/.github/workflows/curriculum-i18n-submodule.yml +++ b/.github/workflows/curriculum-i18n-submodule.yml @@ -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 diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml index 3691381f78e..352b8ea953f 100644 --- a/.github/workflows/e2e-playwright.yml +++ b/.github/workflows/e2e-playwright.yml @@ -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: | diff --git a/.github/workflows/e2e-third-party.yml b/.github/workflows/e2e-third-party.yml index e7cdf151adc..4b36c447f96 100644 --- a/.github/workflows/e2e-third-party.yml +++ b/.github/workflows/e2e-third-party.yml @@ -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 diff --git a/.github/workflows/e2e-with-new-api.yml b/.github/workflows/e2e-with-new-api.yml index f0cbab9e7ee..73bc026ea52 100644 --- a/.github/workflows/e2e-with-new-api.yml +++ b/.github/workflows/e2e-with-new-api.yml @@ -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: | diff --git a/.github/workflows/i18n-validate-builds.yml b/.github/workflows/i18n-validate-builds.yml index cf78c0fa357..38e5c77d38f 100644 --- a/.github/workflows/i18n-validate-builds.yml +++ b/.github/workflows/i18n-validate-builds.yml @@ -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 diff --git a/.github/workflows/i18n-validate-prs.yml b/.github/workflows/i18n-validate-prs.yml index 3fea98fadfc..e44fc7a638b 100644 --- a/.github/workflows/i18n-validate-prs.yml +++ b/.github/workflows/i18n-validate-prs.yml @@ -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 diff --git a/.github/workflows/node.js-tests.yml b/.github/workflows/node.js-tests.yml index 419a2685196..50be76e7dff 100644 --- a/.github/workflows/node.js-tests.yml +++ b/.github/workflows/node.js-tests.yml @@ -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 diff --git a/.github/workflows/temporary-container-checks.yml b/.github/workflows/temporary-container-checks.yml index 8501bdb3af1..01cbdde8275 100644 --- a/.github/workflows/temporary-container-checks.yml +++ b/.github/workflows/temporary-container-checks.yml @@ -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: | diff --git a/client/utils/build-challenges.js b/client/utils/build-challenges.js index 6df479c2047..8cbd6904f5a 100644 --- a/client/utils/build-challenges.js +++ b/client/utils/build-challenges.js @@ -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, diff --git a/curriculum/get-challenges.js b/curriculum/get-challenges.js index 9a67aafceac..22fc608a84a 100644 --- a/curriculum/get-challenges.js +++ b/curriculum/get-challenges.js @@ -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); diff --git a/sample.env b/sample.env index 6e0da371eb5..32e2e5b301d 100644 --- a/sample.env +++ b/sample.env @@ -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