Skip to content

Commit b4deee6

Browse files
committed
Merge flow-builder into develop
# Conflicts: # .github/workflows/s3-deploy-development.yml # scripts/check-mdx-parse.mjs # scripts/lint-mdx.mjs # src/components/reusable/RetroactiveSettingChanges.mdx # src/content/docs/guides/analytics/how-adapty-analytics-works.mdx # src/content/docs/version-3.0/active-subscriptions.mdx # src/content/docs/version-3.0/active-trials.mdx # src/content/docs/version-3.0/analytics-cohorts.mdx # src/content/docs/version-3.0/arppu.mdx # src/content/docs/version-3.0/arpu.mdx # src/content/docs/version-3.0/arr.mdx # src/content/docs/version-3.0/billing-issue.mdx # src/content/docs/version-3.0/cancelled-subscriptions.mdx # src/content/docs/version-3.0/charts.mdx # src/content/docs/version-3.0/churned-expired-subscriptions.mdx # src/content/docs/version-3.0/controls-filters-grouping-compare-proceeds.mdx # src/content/docs/version-3.0/expired-churned-trials.mdx # src/content/docs/version-3.0/grace-period.mdx # src/content/docs/version-3.0/installs.mdx # src/content/docs/version-3.0/ltv.mdx # src/content/docs/version-3.0/mrr.mdx # src/content/docs/version-3.0/new-trials.mdx # src/content/docs/version-3.0/non-subscriptions.mdx # src/content/docs/version-3.0/overview.mdx # src/content/docs/version-3.0/reactivated-subscriptions.mdx # src/content/docs/version-3.0/refund-events.mdx # src/content/docs/version-3.0/revenue.mdx # src/content/docs/version-3.0/trials-renewal-cancelled.mdx
2 parents c8c9636 + 20b48f7 commit b4deee6

2,567 files changed

Lines changed: 102015 additions & 25525 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/localize/SKILL.md

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ The translation script creates `.mdx` files and `.hashes/` automatically. You on
220220

221221
## Step 6 — Translate content (phased, gated by native-speaker reviews)
222222

223-
> **Flow overview:** (1) research dictionary terminology → (2) native speaker reviews word-pair list → (3) translate tutorial 7 articles → (4) deploy to develop → (5) native speaker reviews rendered pages → (6) translate the rest.
223+
> **Flow overview:** (1) research dictionary terminology → (2) native speaker reviews word-pair list → (3) translate tutorial 7 articles → (4) deploy to develop → (5) native speaker reviews rendered pages → (6) translate the rest → (7) on "we are done", run MDX lint + parse checks locally and auto-fix.
224224
>
225-
> **Note on `CustomDocCardList`:** This component is already locale-aware — it reads titles from `_sidebar-labels.json` and descriptions from the translated article frontmatter automatically. No extra step is needed; it works correctly once sidebar labels (Step 6g `--sidebars`) and article translations are done.
225+
> **Note on `CustomDocCardList`:** This component is already locale-aware — it reads titles from `_sidebar-labels.json` and descriptions from the translated article frontmatter automatically. No extra step is needed; it works correctly once sidebar labels (Step 6f `--sidebars`) and article translations are done.
226226
227227
All `translate.mjs` commands require `ANTHROPIC_API_KEY` to be set.
228228

@@ -327,7 +327,17 @@ node scripts/translate.mjs --lang {LOCALE} --sidebar capacitor
327327
node scripts/translate.mjs --lang {LOCALE} --sidebar api
328328
```
329329

330-
#### 6g. Translate platform article docs, one platform at a time
330+
#### 6g. Translate reusable snippets
331+
332+
Reusable MDX snippets in `src/components/reusable/` are skipped by `--platform`, `--ids`, `--sidebar`, and `--sidebars` runs (to avoid re-translating them on every targeted run). They must be translated in their own pass:
333+
334+
```bash
335+
node scripts/translate.mjs --lang {LOCALE} --reusables
336+
```
337+
338+
Run this before the platform translations — platform articles import reusables, so the staging build will render mixed-language content until the snippets are translated.
339+
340+
#### 6h. Translate platform article docs, one platform at a time
331341

332342
```bash
333343
node scripts/translate.mjs --lang {LOCALE} --platform tutorial
@@ -338,14 +348,53 @@ node scripts/translate.mjs --lang {LOCALE} --platform flutter
338348
node scripts/translate.mjs --lang {LOCALE} --platform unity
339349
node scripts/translate.mjs --lang {LOCALE} --platform kmp
340350
node scripts/translate.mjs --lang {LOCALE} --platform capacitor
351+
node scripts/translate.mjs --lang {LOCALE} --platform api
341352
```
342353

343-
#### 6h. Translate API docs
354+
`--platform api` translates the MDX articles referenced from `src/data/sidebars/api.json` (e.g. developer CLI guides, server-side API intro/auth pages). This is separate from the OpenAPI YAML specs themselves — those are translated by `--api-specs` below.
355+
356+
#### 6i. Translate API OpenAPI specs
344357

345358
```bash
346359
node scripts/translate.mjs --lang {LOCALE} --api-specs
347360
```
348361

362+
This translates the YAML specs in `src/api-reference/specs/` (e.g. `adapty-api.yaml``adapty-api.{LOCALE}.yaml`) — the source for the rendered API reference pages. Distinct from `--platform api`, which translates the surrounding MDX articles.
363+
364+
#### 6j. Validate MDX parses cleanly before deploy (BLOCKING — triggers on "we are done")
365+
366+
**Trigger:** the user says "we're done", "that's it", "everything is translated", or otherwise signals end of translation work. Do not run this earlier — broken intermediate state is normal during translation.
367+
368+
Two CI checks must pass before merging to `main` (and they're enforced in `s3-deploy-production.yml` via `lint-mdx` and `check-mdx-parse` jobs). Run them locally and resolve issues before the user pushes:
369+
370+
**1. Run the lint check with auto-fix:**
371+
372+
```bash
373+
node scripts/lint-mdx.mjs --fix
374+
```
375+
376+
This auto-corrects the `blank-line` rule (missing blank line after the last `import` — Acorn's most common crash). Other rules (e.g. `missing-import` for `client:load` components like `CompoundCalculator`, `SimpleCalculator`) are reported but not auto-fixed; you must add the missing import line at the top of each flagged file.
377+
378+
**2. Run the parse check:**
379+
380+
```bash
381+
node scripts/check-mdx-parse.mjs
382+
```
383+
384+
This compiles every `.mdx` under `src/content/docs/`, `src/locales/`, and `src/components/reusable/` using the same MDX plugins Astro uses. It reports every parse error at once (Astro's locale build halts at the first, so this surfaces hidden failures stacked behind it).
385+
386+
**3. Auto-fix the remainder:**
387+
388+
For every remaining issue from either script, read the file at the reported line, identify the cause, and edit it directly. Common causes after translation:
389+
390+
- **JSX comments** (`{/* ... */}`) inside MDX — crash the content collection. Replace with `:::note` callouts.
391+
- **Inline callout syntax**`:::note text :::` on one line. Split into three lines: `:::note`, content, `:::`.
392+
- **Mismatched JSX tags** — usually a `</Tag>` introduced or dropped by the translator. Compare the locale file to the English source and restore the original tag balance.
393+
- **Smart-quote contamination** in attribute values (e.g. `title=" "`) — replace with straight ASCII quotes.
394+
- **Stray backslashes** in heading anchors — `\{#id\}` must keep its backslash escapes exactly.
395+
396+
After each edit pass, re-run both scripts. Loop until both exit clean. Only then tell the user the locale is ready to deploy.
397+
349398
---
350399

351400
## Step 7 — Algolia: update English crawler + create new locale crawler
@@ -461,8 +510,10 @@ strategy:
461510
| 6d | Deploy tutorial translations to develop via `sync-branch-to-develop` skill | `sync-branch-to-develop` |
462511
| 6e | **BLOCKING:** Wait for native speaker to review rendered tutorial pages on staging | — |
463512
| 6f | Output command to translate sidebar labels | `--sidebars` |
464-
| 6g | Output commands to translate platform article docs | `--platform` per sidebar |
465-
| 6h | Output command to translate API specs | `--api-specs` |
513+
| 6g | Output command to translate reusable snippets (skipped by targeted runs) | `--reusables` |
514+
| 6h | Output commands to translate platform article docs | `--platform` per sidebar |
515+
| 6i | Output command to translate API specs | `--api-specs` |
516+
| 6j | **BLOCKING on "we are done":** Run lint-mdx --fix + check-mdx-parse; auto-fix remaining issues | `scripts/lint-mdx.mjs`, `scripts/check-mdx-parse.mjs` |
466517
| 7a | Update English crawler exclusion | Algolia dashboard |
467518
| 7b | Create new locale crawler | Algolia dashboard |
468519
| 7c | Create new Algolia index | Algolia dashboard |

.github/workflows/s3-deploy-development.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ jobs:
6161

6262
- name: Build English only
6363
env:
64-
NODE_OPTIONS: --max-old-space-size=6144
64+
NODE_OPTIONS: --max-old-space-size=8192
6565
run: npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=none npx astro build
6666

6767
- name: Generate markdown exports
6868
env:
69-
NODE_OPTIONS: --max-old-space-size=6144
69+
NODE_OPTIONS: --max-old-space-size=8192
7070
run: npm run build:md:prod
7171

7272
- uses: actions/upload-artifact@v4
@@ -105,9 +105,18 @@ jobs:
105105

106106
- name: Build locale ${{ matrix.locale }}
107107
env:
108-
NODE_OPTIONS: --max-old-space-size=6144
108+
NODE_OPTIONS: --max-old-space-size=8192
109109
run: npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=${{ matrix.locale }} npx astro build
110110

111+
# Generate locale .md / llms.txt / llms-full.txt exports into
112+
# build/${{ matrix.locale }}/ so they land in the artifact alongside
113+
# the Astro HTML pages.
114+
- name: Generate locale markdown exports
115+
env:
116+
NODE_OPTIONS: --max-old-space-size=8192
117+
BUILD_LOCALES: ${{ matrix.locale }}
118+
run: npm run build:md:prod
119+
111120
- uses: actions/upload-artifact@v4
112121
with:
113122
name: build-${{ matrix.locale }}

.github/workflows/s3-deploy-production.yml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,42 @@ jobs:
5555
- run: npm install github-slugger
5656
- run: node scripts/check-links/index.mjs --diff --base=last-production-deploy --internal-only
5757

58+
# Fast-fail static checks for translator-introduced regressions
59+
# (missing blank line after imports, missing client:load imports).
60+
# Gates both content and translation-only deploy paths.
61+
lint-mdx:
62+
name: Lint MDX
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: actions/setup-node@v4
67+
with:
68+
node-version: 20
69+
- run: node scripts/lint-mdx.mjs
70+
71+
# MDX parse sweep: compiles every .mdx file with the same remark plugins
72+
# Astro uses, surfaces every parse error in one pass. Astro's locale
73+
# builds halt at the first error, so without this gate broken files
74+
# stay hidden behind whichever one CI happens to hit first.
75+
check-mdx-parse:
76+
name: Check MDX parse
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
- uses: actions/setup-node@v4
81+
with:
82+
node-version: 20
83+
cache: 'npm'
84+
- run: npm ci
85+
env:
86+
PUPPETEER_SKIP_DOWNLOAD: '1'
87+
- run: node scripts/check-mdx-parse.mjs
88+
5889
# ──────────────────────────────────────────────────────────────
5990
# Full deploy: English + all locales (on content pushes)
6091
# ──────────────────────────────────────────────────────────────
6192
build-en:
62-
needs: check-internal-links
93+
needs: [check-internal-links, lint-mdx, check-mdx-parse]
6394
runs-on: ubuntu-latest
6495
concurrency:
6596
group: build-en-${{ github.workflow }}-${{ github.ref }}
@@ -85,12 +116,12 @@ jobs:
85116

86117
- name: Build English only
87118
env:
88-
NODE_OPTIONS: --max-old-space-size=6144
119+
NODE_OPTIONS: --max-old-space-size=8192
89120
run: npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=none npx astro build
90121

91122
- name: Generate markdown exports
92123
env:
93-
NODE_OPTIONS: --max-old-space-size=6144
124+
NODE_OPTIONS: --max-old-space-size=8192
94125
run: npm run build:md:prod
95126

96127
- uses: actions/upload-artifact@v4
@@ -100,7 +131,7 @@ jobs:
100131
retention-days: 1
101132

102133
build-locale-full:
103-
needs: check-internal-links
134+
needs: [check-internal-links, lint-mdx, check-mdx-parse]
104135
runs-on: ubuntu-latest
105136
strategy:
106137
matrix:
@@ -129,9 +160,19 @@ jobs:
129160

130161
- name: Build locale ${{ matrix.locale }}
131162
env:
132-
NODE_OPTIONS: --max-old-space-size=6144
163+
NODE_OPTIONS: --max-old-space-size=8192
133164
run: npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=${{ matrix.locale }} npx astro build
134165

166+
# Generate locale .md / llms.txt / llms-full.txt exports into
167+
# build/${{ matrix.locale }}/ so they're included in the artifact.
168+
# Without this, the translation-only deploy (aws s3 sync --delete)
169+
# wipes them from S3 on every translator commit.
170+
- name: Generate locale markdown exports
171+
env:
172+
NODE_OPTIONS: --max-old-space-size=8192
173+
BUILD_LOCALES: ${{ matrix.locale }}
174+
run: npm run build:md:prod
175+
135176
- uses: actions/upload-artifact@v4
136177
with:
137178
name: build-${{ matrix.locale }}
@@ -198,7 +239,7 @@ jobs:
198239
# Translation-only deploy: build + upload only locale dirs
199240
# ──────────────────────────────────────────────────────────────
200241
build-locale-only:
201-
needs: classify
242+
needs: [classify, lint-mdx, check-mdx-parse]
202243
if: needs.classify.outputs.translation_only == 'true'
203244
runs-on: ubuntu-latest
204245
strategy:
@@ -228,9 +269,20 @@ jobs:
228269

229270
- name: Build locale ${{ matrix.locale }}
230271
env:
231-
NODE_OPTIONS: --max-old-space-size=6144
272+
NODE_OPTIONS: --max-old-space-size=8192
232273
run: npm run prebuild && ASTRO_TELEMETRY_DISABLED=1 BUILD_LOCALES=${{ matrix.locale }} npx astro build
233274

275+
# Generate locale .md / llms.txt / llms-full.txt exports into
276+
# build/${{ matrix.locale }}/ so they land in the artifact. Required
277+
# because the deploy uses `aws s3 sync --delete`, which would
278+
# otherwise remove these files from S3 on every translation-only
279+
# update.
280+
- name: Generate locale markdown exports
281+
env:
282+
NODE_OPTIONS: --max-old-space-size=8192
283+
BUILD_LOCALES: ${{ matrix.locale }}
284+
run: npm run build:md:prod
285+
234286
- uses: actions/upload-artifact@v4
235287
with:
236288
name: build-tr-only-${{ matrix.locale }}

0 commit comments

Comments
 (0)