Skip to content

feat: add i18n category (i18next, next-intl)#149

Merged
Marve10s merged 1 commit intomainfrom
feat/add-i18n-v3
Apr 11, 2026
Merged

feat: add i18n category (i18next, next-intl)#149
Marve10s merged 1 commit intomainfrom
feat/add-i18n-v3

Conversation

@Marve10s
Copy link
Copy Markdown
Owner

Summary

  • Adds Internationalization (i18n) as a new TypeScript ecosystem category with two options:
    • i18next: Full-featured i18n framework, works with all frontends (React, Svelte, Solid, Vue, etc.)
    • next-intl: Lightweight i18n for Next.js with App Router support (Next.js only)
  • Follows Scenario B (new category) from the adding-new-tool-options guidelines -- full ~30 file checklist

Files changed (33 files, ~142 lines added)

Schema/types (4 files)

  • packages/types/src/schemas.ts -- I18nSchema + all 3 config schemas + VALUES export
  • packages/types/src/types.ts -- I18n type alias
  • packages/types/src/option-metadata.ts -- OptionCategory, CATEGORY_VALUE_IDS, EXACT_LABEL_OVERRIDES, OPTION_CATEGORY_METADATA
  • packages/types/src/compatibility.ts -- CompatibilityCategory, CompatibilityInput, TYPESCRIPT_CATEGORY_ORDER, getDisabledReason (next-intl requires Next.js)

CLI wiring (8 files)

  • apps/cli/src/index.ts -- 4 spots: import, router schema, config construction, prompt
  • apps/cli/src/prompts/i18n.ts -- NEW interactive prompt (shows next-intl only when Next.js selected)
  • apps/cli/src/prompts/config-prompts.ts -- Import, PromptGroupResults type, navigable group, return mapping
  • apps/cli/src/mcp.ts -- 6 spots: import, SCHEMA_MAP, ECOSYSTEM_CATEGORIES, buildProjectConfig, buildCompatibilityInput, tool params
  • apps/cli/src/utils/bts-config.ts -- write + read paths
  • apps/cli/src/constants.ts -- DEFAULT_CONFIG_BASE
  • apps/cli/src/helpers/core/command-handlers.ts -- error fallback config
  • apps/cli/src/utils/generate-reproducible-command.ts -- --i18n flag
  • apps/cli/src/utils/config-processing.ts -- processFlags branch

Web builder (8 files)

  • apps/web/src/lib/constant.ts -- TECH_OPTIONS + ECOSYSTEM_CATEGORIES
  • apps/web/src/lib/preview-config.ts -- stackToConfig mapping
  • apps/web/src/lib/stack-defaults.ts -- StackState type + DEFAULT_STACK
  • apps/web/src/lib/stack-url-keys.ts -- URL key i18n: "i18n"
  • apps/web/src/lib/stack-url-state.ts -- 3 spots: load, serialize, searchToStack
  • apps/web/src/lib/stack-utils.ts -- TYPESCRIPT_CATEGORY_ORDER + generateStackCommand
  • apps/web/src/lib/tech-icons.ts -- i18next + next-intl icons
  • apps/web/src/lib/tech-resource-links.ts -- docs + GitHub URLs
  • apps/web/public/icon/next-intl.svg -- NEW SVG icon

Template generator (6 files)

  • packages/template-generator/src/utils/add-deps.ts -- dependency versions (i18next, react-i18next, next-intl, etc.)
  • packages/template-generator/src/processors/i18n-deps.ts -- NEW dependency processor
  • packages/template-generator/src/processors/index.ts -- wire processor
  • packages/template-generator/src/template-handlers/i18n.ts -- NEW template handler
  • packages/template-generator/src/template-handlers/index.ts -- export handler
  • packages/template-generator/src/generator.ts -- wire handler call

Templates (7 files)

  • templates/i18n/i18next/web/base/src/i18n/config.ts.hbs -- i18next config with language detector
  • templates/i18n/i18next/web/base/public/locales/en/common.json -- English translations
  • templates/i18n/i18next/web/base/public/locales/fr/common.json -- French translations
  • templates/i18n/i18next/web/react/src/i18n/provider.tsx.hbs -- React I18nextProvider wrapper
  • templates/i18n/next-intl/web/base/src/i18n/config.ts.hbs -- locale config
  • templates/i18n/next-intl/web/base/src/i18n/request.ts.hbs -- next-intl server request config
  • templates/i18n/next-intl/web/base/messages/{en,fr}.json -- translation files

Tests (4 files)

  • apps/cli/test/test-utils.ts -- I18n type import + coreStackDefaults
  • apps/cli/test/generate-reproducible-command.test.ts -- i18n field in makeConfig defaults
  • testing/lib/generate-combos/options.ts -- I18N_VALUES import + sampleScalar + base config
  • testing/lib/presets.ts -- i18n default in makeBaseConfig

Compatibility

  • next-intl is disabled (greyed out) when frontend is not Next.js
  • i18next works with all frontends

Verification

  • bun run --filter=@better-fullstack/types build -- passes
  • bun run --filter=@better-fullstack/template-generator generate-templates -- passes (1046 templates)
  • bun run --filter=@better-fullstack/template-generator build -- passes
  • bun run --filter=create-better-fullstack build -- passes (publint clean)
  • bun test apps/cli/test/cli-builder-sync.test.ts -- 358 pass, 0 fail
  • bun test apps/cli/test/generate-reproducible-command.test.ts -- 5 pass, 0 fail
  • bun run --cwd apps/cli check-types -- passes
  • bun run --cwd apps/web typecheck -- passes
  • bun run --cwd apps/web validate:tech-links -- passes (no missing icons/links)

Scaffold tests (3 combos)

All scaffolded with bun install && bun run check-types:

  • i18next + Next.js + Hono -- type-checks clean
  • i18next + TanStack Router + Hono -- type-checks clean
  • next-intl + Next.js + Hono -- type-checks clean

Add internationalization as a new TypeScript ecosystem category with two
options: i18next (works with all frontends) and next-intl (Next.js only).

Schema/types: I18nSchema, I18n type, option-metadata, compatibility rules
CLI: prompt, index.ts wiring (4 spots), mcp.ts (6 spots), bts-config,
     command-handlers, generate-reproducible-command, config-processing
Web: constant.ts, preview-config, stack-defaults, stack-url-keys,
     stack-url-state (3 spots), stack-utils, tech-icons, tech-resource-links
Generator: i18n-deps processor, i18n template handler, templates for both
           i18next (config + locales + React provider) and next-intl
           (request config + messages)
Tests: test-utils defaults, generate-reproducible-command.test.ts,
       smoke test options.ts and presets.ts

Compatibility: next-intl disabled when frontend is not Next.js
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
better-fullstack-web Ignored Ignored Apr 10, 2026 8:09pm

@github-actions github-actions bot added size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 10, 2026
@Marve10s Marve10s merged commit 0ce1bcd into main Apr 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant