Skip to content

refactor: deep cleanup and critical bug fixes#60

Merged
shtse8 merged 1 commit intomainfrom
refactor/deep-cleanup
Dec 13, 2025
Merged

refactor: deep cleanup and critical bug fixes#60
shtse8 merged 1 commit intomainfrom
refactor/deep-cleanup

Conversation

@shtse8
Copy link
Contributor

@shtse8 shtse8 commented Dec 13, 2025

Summary

  • Deep cleanup removing all legacy/deprecated code
  • Fixed 5 critical bugs discovered during comprehensive code review
  • Removed ~4,850 lines of dead code

Bug Fixes

  • Armenian locale corruption - Fixed ՀdelaysՀdelays (correct Armenian script)
  • Option parsing false positive - t("Hello {context}", {context: "world"}) now works correctly
  • Edge runtime crash - Added safe process.env checks for Cloudflare Workers/Deno Deploy
  • React infinite re-render - Fixed useAdminState hook when using inline selectors
  • OpenRouter JSON.parse crash - Added try-catch for malformed API responses

Breaking Changes

  • Removed @sylphx/rosetta/server (use @sylphx/rosetta-next/server)
  • Removed @sylphx/rosetta/adapters (legacy)
  • Removed @sylphx/rosetta-next/loader and @sylphx/rosetta-next/sync exports
  • Removed deprecated functions: getDefaultLocale, getLocaleChain, getTranslationsAsync

Test plan

  • All 287 tests pass
  • Build succeeds for all packages
  • Edge runtime compatibility verified (no Node.js-only APIs)

## Breaking Changes
- Removed deprecated exports from @sylphx/rosetta:
  - `./server` entry point (use @sylphx/rosetta-next/server)
  - `./adapters` entry point (legacy)
- Removed deprecated exports from @sylphx/rosetta-next:
  - `./loader` entry point
  - `./sync` entry point
  - Deprecated functions: getDefaultLocale, getLocaleChain, getTranslationsAsync

## Bug Fixes
- fix(rosetta-next): Armenian locale data corruption (Հdelays → Հdelays)
- fix(rosetta-next): option parsing false positive when params contain 'context' key
- fix(rosetta-next): Edge runtime crash with process.env (3 locations)
- fix(rosetta-admin): useAdminState infinite re-render with inline selectors
- fix(rosetta-translator-openrouter): unprotected JSON.parse crash on malformed response

## Improvements
- refactor(rosetta): document MAX_TEXT_LENGTH difference (10KB validation vs 50KB ICU)
- refactor(rosetta): fix CLI build output path to dist/cli
- refactor(rosetta-next): extract shared locale constants to avoid duplication
- refactor(rosetta-drizzle): document non-atomic deleteSource operation

## Removed (Legacy/Unused)
- packages/rosetta/src/server/ (moved to rosetta-next)
- packages/rosetta/src/adapters/ (legacy)
- packages/rosetta-next/src/loader.ts
- packages/rosetta-next/src/sync.ts
- packages/rosetta-next/src/server-provider.tsx
- Associated test files for removed modules
@vercel
Copy link

vercel bot commented Dec 13, 2025

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

Project Deployment Review Updated (UTC)
rosetta Building Building Preview, Comment Dec 13, 2025 6:02am

@shtse8 shtse8 merged commit e8ef654 into main Dec 13, 2025
3 of 5 checks passed
@shtse8 shtse8 deleted the refactor/deep-cleanup branch December 13, 2025 06:02
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