Skip to content

Jm/improved sync mdx#9

Open
JonathanMatthey wants to merge 31 commits intomainfrom
jm/improved-sync-mdx
Open

Jm/improved sync mdx#9
JonathanMatthey wants to merge 31 commits intomainfrom
jm/improved-sync-mdx

Conversation

@JonathanMatthey
Copy link
Collaborator

  • improves sync scripts
  • adds tests
  • major refactor for lifecycles
  • also improve summit styling

@JonathanMatthey
Copy link
Collaborator Author

JonathanMatthey commented Feb 6, 2026

sync import locale seems broken, possibly because contentId of locale wont match the new generated english version of the newly imported entry.

possibly add the contentId in the english FrontMatter

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements significant improvements to the sync infrastructure and adds i18n support across the codebase. It transitions from SSR to SSG for foundation and summit pages, refactors CMS lifecycles into reusable utilities, modularizes sync scripts, adds test coverage, and improves summit page styling.

Changes:

  • Converts foundation and summit pages from server-side rendering (prerender=false) to static site generation with getStaticPaths
  • Refactors CMS lifecycle hooks into reusable factory functions (mdxLifecycle.ts, navigationLifecycle.ts) with shared MDX utilities
  • Modularizes sync-mdx script into testable components with added test coverage
  • Adds comprehensive i18n plugin options to all CMS components and content types
  • Updates styling for summit header (extracted CSS classes) and footer components

Reviewed changes

Copilot reviewed 69 out of 71 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/pages/[...page].astro Changed to SSG with getStaticPaths, filters out 'home' slug
src/pages/summit/[...page].astro Changed to SSG with getStaticPaths, added background styling
src/pages/developers/blog/preview.astro Fixed import paths (added '../' prefix)
src/content/summit/*.mdx Added new summit pages (faq, code-of-conduct) and Spanish localizations
src/content/foundation-pages/*.mdx Removed 'page.mdx', added financial-services, education, ambassadors, updated about-us
src/content/es/foundation-pages/sobre-nosotros.mdx Added Spanish localized about-us page (content needs translation)
src/components/pages/SummitHeader.astro Refactored inline styles to CSS class variables
src/components/pages/SummitFooter.astro Updated styling with improved colors and spacing
cms/src/utils/*.ts New lifecycle utilities (mdxLifecycle, navigationLifecycle, mdx, gitSync)
cms/src/api/*/lifecycles.ts Updated to use new factory functions
cms/src/components/**/*.json Added i18n localized: true to all fields
cms/scripts/sync-mdx/*.cjs Modularized sync script into separate concerns (scan, sync, strapi, markdown, mdx)
cms/scripts/sync-mdx/tests/*.js Added comprehensive test coverage for sync functionality
cms/scripts/sync-navigation.cjs New script to sync navigation JSON to Strapi
package.json Disabled ESLint warnings (--max-warnings=9999), removed export scripts
eslint.config.js Disabled multiple TypeScript linting rules
astro.config.mjs Made link validation conditional on CI or env variable
.github/workflows/*.yml Updated to use Bun, added missing test steps
cms/README.md, cms/QUICKSTART.md Updated documentation to reference Bun instead of npm

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 13 to 17
export async function gitCommitAndPush(
filepath: string,
filepath: string | string[],
message: string
): Promise<void> {
if (process.env.STRAPI_DISABLE_GIT_SYNC === 'true') {
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git workflow should pull before committing to avoid race conditions. The current workflow of add → commit → pull --rebase → push can lose commits if conflicts occur during rebase. Consider changing to: pull → add → commit → push to ensure changes are integrated before committing.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +16
// Ensure cms/.env takes precedence
delete process.env.STRAPI_API_TOKEN;
delete process.env.STRAPI_PREVIEW_TOKEN;

const envPath = path.join(projectRoot, 'cms', '.env');
if (fs.existsSync(envPath)) {
require('dotenv').config({ path: envPath });
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting environment variables from process.env before loading the .env file can cause issues in certain deployment environments where these variables are set via the platform. Consider using dotenv's override option instead of manually deleting variables, or check if variables exist before deleting them.

Suggested change
// Ensure cms/.env takes precedence
delete process.env.STRAPI_API_TOKEN;
delete process.env.STRAPI_PREVIEW_TOKEN;
const envPath = path.join(projectRoot, 'cms', '.env');
if (fs.existsSync(envPath)) {
require('dotenv').config({ path: envPath });
// Ensure cms/.env takes precedence by overriding existing values
const envPath = path.join(projectRoot, 'cms', '.env');
if (fs.existsSync(envPath)) {
require('dotenv').config({ path: envPath, override: true });

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +41
The Interledger Foundation (ILF) is a mission-driven nonprofit ensuring that no one is left behind in the digital economy. We support inclusive innovation and financial infrastructure that connects people, communities, and entire economies globally.

## Our role?

We collaborate with entrepreneurs, organizations, and governments to [advocate](/policy-and-advocacy) for equitable access to financial systems and steward the interoperable technologies that power the Internet of Opportunity (IoO). To advance this work we fund [financial services](/financial-services) projects, [education](/education) initiatives, and [ambassador](/ambassadors) programs.

## The Problem We’re Solving

The global financial system is broken, fragmented, and slow.

Billions are excluded from full participation due to:

- High transaction costs and slow settlements
- Disconnected local and global payment systems
- Inaccessible remittance infrastructure
- Limited digital financial tools for creators, freelancers, and the unbanked

The Interledger Foundation is changing that.

## Our Vision: The Internet of Opportunity

Imagine a world where everyone can send a payment as easily as an email.

With the Internet of Opportunity, powered by Interledger, we make that vision real:

**Open Access**
Anyone can participate in the digital economy, regardless of location or income.

**Seamless Interoperability**
Payments move instantly across platforms, currencies, and borders.

**Programmable Transactions**
New business models become possible, from real-time creator tips to pay-as-you-go utilities.
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Spanish localized page (sobre-nosotros.mdx) has a Spanish slug and heroTitle but the content body is in English. This should be translated to Spanish to provide a proper localized experience for Spanish-speaking users.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to 5
push:
pull_request:
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow now runs on every push to any branch, not just pull requests to main. This can cause unnecessary CI runs for personal development branches and increase CI costs. Consider keeping the trigger limited to pull requests targeting main and pushes to main/production branches.

Suggested change
push:
pull_request:
push:
branches:
- main
- production
pull_request:
branches:
- main

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +35
run: bun run test
- name: Test build website
run: bun run build
- name: Install Playwright browsers
run: bunx playwright install --with-deps
- name: E2E tests
run: bun run test:e2e
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow references bun run test and bun run test:e2e scripts, but these are not defined in package.json. The CI build will fail when it tries to run these commands.

Suggested change
run: bun run test
- name: Test build website
run: bun run build
- name: Install Playwright browsers
run: bunx playwright install --with-deps
- name: E2E tests
run: bun run test:e2e
run: bun test
- name: Test build website
run: bun run build
- name: Install Playwright browsers
run: bunx playwright install --with-deps
- name: E2E tests
run: bunx playwright test

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +40
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/prefer-namespace-keyword': 'off',
'astro/no-set-text-directive': 'off',
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ESLint configuration has disabled many useful TypeScript and JavaScript linting rules. Disabling rules like @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/ban-ts-comment, and others significantly reduces code quality enforcement. Consider re-enabling these rules and fixing the underlying issues instead of suppressing all warnings.

Copilot uses AI. Check for mistakes.
"import:nav": "npx tsx scripts/import-navigation.ts --all"
"check": "astro check",
"format": "prettier --write '**/*.{js,mjs,ts,tsx,json,md,mdx,astro}'",
"lint": "eslint --max-warnings=9999 ."
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lint script has been changed to allow up to 9999 warnings (--max-warnings=9999), which effectively disables warning limits. This defeats the purpose of linting. Consider setting this to a reasonable number (e.g., 0) and addressing the warnings properly.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant