feat: add i18n category (i18next, next-intl)#149
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Files changed (33 files, ~142 lines added)
Schema/types (4 files)
packages/types/src/schemas.ts-- I18nSchema + all 3 config schemas + VALUES exportpackages/types/src/types.ts-- I18n type aliaspackages/types/src/option-metadata.ts-- OptionCategory, CATEGORY_VALUE_IDS, EXACT_LABEL_OVERRIDES, OPTION_CATEGORY_METADATApackages/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, promptapps/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 mappingapps/cli/src/mcp.ts-- 6 spots: import, SCHEMA_MAP, ECOSYSTEM_CATEGORIES, buildProjectConfig, buildCompatibilityInput, tool paramsapps/cli/src/utils/bts-config.ts-- write + read pathsapps/cli/src/constants.ts-- DEFAULT_CONFIG_BASEapps/cli/src/helpers/core/command-handlers.ts-- error fallback configapps/cli/src/utils/generate-reproducible-command.ts----i18nflagapps/cli/src/utils/config-processing.ts-- processFlags branchWeb builder (8 files)
apps/web/src/lib/constant.ts-- TECH_OPTIONS + ECOSYSTEM_CATEGORIESapps/web/src/lib/preview-config.ts-- stackToConfig mappingapps/web/src/lib/stack-defaults.ts-- StackState type + DEFAULT_STACKapps/web/src/lib/stack-url-keys.ts-- URL keyi18n: "i18n"apps/web/src/lib/stack-url-state.ts-- 3 spots: load, serialize, searchToStackapps/web/src/lib/stack-utils.ts-- TYPESCRIPT_CATEGORY_ORDER + generateStackCommandapps/web/src/lib/tech-icons.ts-- i18next + next-intl iconsapps/web/src/lib/tech-resource-links.ts-- docs + GitHub URLsapps/web/public/icon/next-intl.svg-- NEW SVG iconTemplate 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 processorpackages/template-generator/src/processors/index.ts-- wire processorpackages/template-generator/src/template-handlers/i18n.ts-- NEW template handlerpackages/template-generator/src/template-handlers/index.ts-- export handlerpackages/template-generator/src/generator.ts-- wire handler callTemplates (7 files)
templates/i18n/i18next/web/base/src/i18n/config.ts.hbs-- i18next config with language detectortemplates/i18n/i18next/web/base/public/locales/en/common.json-- English translationstemplates/i18n/i18next/web/base/public/locales/fr/common.json-- French translationstemplates/i18n/i18next/web/react/src/i18n/provider.tsx.hbs-- React I18nextProvider wrappertemplates/i18n/next-intl/web/base/src/i18n/config.ts.hbs-- locale configtemplates/i18n/next-intl/web/base/src/i18n/request.ts.hbs-- next-intl server request configtemplates/i18n/next-intl/web/base/messages/{en,fr}.json-- translation filesTests (4 files)
apps/cli/test/test-utils.ts-- I18n type import + coreStackDefaultsapps/cli/test/generate-reproducible-command.test.ts-- i18n field in makeConfig defaultstesting/lib/generate-combos/options.ts-- I18N_VALUES import + sampleScalar + base configtesting/lib/presets.ts-- i18n default in makeBaseConfigCompatibility
next-intlis disabled (greyed out) when frontend is not Next.jsi18nextworks with all frontendsVerification
bun run --filter=@better-fullstack/types build-- passesbun run --filter=@better-fullstack/template-generator generate-templates-- passes (1046 templates)bun run --filter=@better-fullstack/template-generator build-- passesbun run --filter=create-better-fullstack build-- passes (publint clean)bun test apps/cli/test/cli-builder-sync.test.ts-- 358 pass, 0 failbun test apps/cli/test/generate-reproducible-command.test.ts-- 5 pass, 0 failbun run --cwd apps/cli check-types-- passesbun run --cwd apps/web typecheck-- passesbun 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: