Open
Conversation
- Add new `i18n-wrapper-swc` command for high-performance parsing (3-10× faster)
- Keep existing `i18n-wrapper` using Babel (stable, default)
- Add `parser` option to ScriptConfig ('babel' | 'swc')
- Add parseCode() and generateCode() methods for parser abstraction
- Update README and CLI documentation with performance comparison
- Add @babel/parser dependency back for Babel support
- Version 1.7.0: Transition period with both parsers available
Both commands produce identical output - only parsing speed differs.
Usage:
npx i18n-wrapper # Babel (default, stable)
npx i18n-wrapper-swc # SWC (high-performance)
Performance comparison:
I18N_PERF_MONITOR=true npx i18n-wrapper
I18N_PERF_MONITOR=true npx i18n-wrapper-swc
- 외부 상수 분석 기능 제거 (불안전하고 복잡함) - props 체크 로직 제거 - JSXExpressionContainer MemberExpression 처리 제거 - 성능 측정을 핵심 병목만 측정하도록 간소화 - 성능 리포트 출력 함수 분리
- scripts/t-wrapper.ts를 scripts/t-wrapper/index.ts로 이동 - 내부 import 경로 수정 (상대 경로 조정) - 동일한 기능 유지하며 모듈 구조 개선
- ScriptConfig에서 constantPatterns 필드 제거 - I18nexusConfig에서 constantPatterns 필드 제거 - CLI 옵션 --constant-patterns/-c 제거 - 관련 문서 및 help 메시지 정리
- scripts/default-config.ts 생성하여 모든 기본 설정 값 중앙 관리 - COMMON_DEFAULTS, GOOGLE_SHEETS_DEFAULTS 등 공통 설정 분리 - ScriptConfig 타입과 SCRIPT_CONFIG_DEFAULTS를 default-config.ts로 이동 - config-loader, extractor, clean-legacy에서 공통 설정 사용하도록 변경 - t-wrapper/index.ts에서 중앙화된 설정 사용
- performance-monitor.ts, performance-reporter.ts, default-config.ts를 scripts/common/으로 이동 - t-wrapper 관련 파일은 t-wrapper 폴더에 유지 - 모든 import 경로 업데이트 (../common/ 경로로 변경) - 파일 구조 정리로 모듈화 개선
- completion-reporter.ts로 분리 - t-wrapper 전용이므로 같은 폴더에 위치
- translation-wrapper.ts로 클래스 분리 - t-wrapper 전용이므로 같은 폴더에 위치 - index.ts는 re-export만 담당
- PerformanceReporter에 printCompletionReport 메서드 추가 - 제목을 파라미터로 받아 재사용 가능하도록 개선 - completion-reporter.ts 파일 제거
- hasIgnoreComment, shouldSkipPath, isReactComponent, isServerComponent 분리 - 순수 함수로 구성하여 테스트 용이성 향상 - t-wrapper 전용이므로 같은 폴더에 위치
- createUseTranslationHook, addImportIfNeeded 분리 - import-manager.ts로 분리하여 테스트 용이성 향상
- parseFile, generateCode를 common/ast/parser-utils.ts로 분리 - extractor에서도 사용 가능하도록 공통화 - babel/swc 파서 선택 지원
- transformFunctionBody를 ast-transformers.ts로 분리 - StringLiteral, TemplateLiteral, JSXText 변환 로직 분리 - 테스트 용이성 향상
- Jest 설정 추가 - default-config 기본 설정 값 테스트 작성 - 7개 테스트 모두 통과
- parseWithBabel, parseFile 테스트 - generateWithBabel, generateCode 테스트 - 9개 테스트 모두 통과
- deprecated globals 설정을 transform으로 변경 - Jest, ts-jest, @types/jest 설치 확인 - 경고 메시지 제거
- types 필드 중복 제거 - jest 타입 포함하여 테스트 파일 타입 인식 가능하도록 수정
- processFiles 내부의 개별 파일 에러는 조용히 처리 - runTranslationWrapper의 불필요한 try-catch 제거 - 최상위(CLI)에서만 에러 출력하여 중복 방지
- ScriptConfig, TranslationWrapper re-export 제거 - 모든 파일에서 직접 import하도록 변경 - runTranslationWrapper 제거 및 TranslationWrapper 직접 사용
- Wtf8Atom/Atom을 문자열로 변환하여 한국어 감지 - TemplateLiteral i18next interpolation 형식 변환 - JSXText t() 함수 호출 생성 - rayon-usage.md 문서 제거
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.
No description provided.