fix(shared): drop .js extensions from relative imports for Metro

packages/shared/src/index.ts and all sub-modules used .js extensions on
relative imports (e.g. './admin/index.js') pointing at .ts source files.
TypeScript with moduleResolution: "Bundler" doesn't need them, and
Metro's eager exporter (used for preview / production builds) reads
them literally and fails — only the dev-server Metro fell back to .ts.

Workspace typecheck remains 8/8 green; Vite and TS Bundler resolution
already accept both styles, so desktop is unaffected.
This commit is contained in:
byGalax
2026-05-15 01:52:14 +02:00
parent b0967dd2c5
commit b61f929cf7
25 changed files with 108 additions and 108 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { DEFAULT_LOCALE, SUPPORTED_LOCALES, type SupportedLocale } from './types.js';
import { DEFAULT_LOCALE, SUPPORTED_LOCALES, type SupportedLocale } from './types';
export function isSupportedLocale(value: string | null | undefined): value is SupportedLocale {
return (
+7 -7
View File
@@ -1,12 +1,12 @@
import i18next, { type i18n as I18nInstance, type Resource } from 'i18next';
import i18next, { type i18n as I18nInstance, type Resource } from 'i18next';
import { initReactI18next } from 'react-i18next';
import { resources } from './resources.js';
import { DEFAULT_LOCALE, type SupportedLocale } from './types.js';
import { resources } from './resources';
import { DEFAULT_LOCALE, type SupportedLocale } from './types';
export * from './detect.js';
export * from './error-map.js';
export * from './types.js';
export * from './detect';
export * from './error-map';
export * from './types';
export interface InitI18nOptions {
initialLocale: SupportedLocale;
@@ -14,7 +14,7 @@ export interface InitI18nOptions {
onLanguageChanged?: (locale: SupportedLocale) => void;
}
// Idempotent init safe to call from multiple entry points.
// Idempotent init — safe to call from multiple entry points.
// Returns the configured i18next instance.
export function initI18n(options: InitI18nOptions): I18nInstance {
if (!i18next.isInitialized) {
+2 -2
View File
@@ -1,4 +1,4 @@
import deApp from './locales/de/app.json';
import deApp from './locales/de/app.json';
import deAuth from './locales/de/auth.json';
import deCommon from './locales/de/common.json';
import deErrors from './locales/de/errors.json';
@@ -6,7 +6,7 @@ import enApp from './locales/en/app.json';
import enAuth from './locales/en/auth.json';
import enCommon from './locales/en/common.json';
import enErrors from './locales/en/errors.json';
import type { Resources, SupportedLocale } from './types.js';
import type { Resources, SupportedLocale } from './types';
export const resources: Record<SupportedLocale, Resources> = {
en: { common: enCommon, auth: enAuth, errors: enErrors, app: enApp },