Skip to content

Commit 2114c12

Browse files
committed
chore: cleanup code
1 parent efa1db7 commit 2114c12

4 files changed

Lines changed: 5 additions & 16 deletions

File tree

cmp/compiler/src/plugin/transform/process-file.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import * as t from "@babel/types";
55
import type { NodePath, TraverseOptions } from "@babel/traverse";
6-
import type { ComponentType, TranslationEntry } from "../../types";
6+
import type { TranslationEntry } from "../../types";
77
import { logger } from "../../utils/logger";
88
import {
99
comstructUnifiedImport,
@@ -29,7 +29,6 @@ import { processOverrideAttributes } from "./parse-override";
2929

3030
type ComponentEntry = {
3131
name: string;
32-
type: ComponentType;
3332
isAsync: boolean;
3433
};
3534

@@ -616,7 +615,6 @@ function processComponentFunction(
616615
// Push component to stack with async info and path reference
617616
const componentEntry: ComponentEntry = {
618617
name: componentName,
619-
type: "unknown",
620618
isAsync: path.node.async,
621619
};
622620
state.componentsStack.push(componentEntry);

cmp/compiler/src/translation-server/translation-server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ export class TranslationServer {
9292
this.logger.info(`🔧 Initializing translator...`);
9393

9494
const translator = createTranslator(this.config, this.logger);
95-
// TODO (AleksandrSl 14/12/2025): I think this should be taken from the translator directly
96-
const isPseudo = translator.constructor.name === "PseudoTranslator";
9795
const cache = createCache(this.config);
9896

9997
this.translationService = new TranslationService(
@@ -102,7 +100,6 @@ export class TranslationServer {
102100
{
103101
sourceLocale: this.config.sourceLocale,
104102
pluralization: this.config.pluralization,
105-
isPseudo,
106103
},
107104
this.logger,
108105
);

cmp/compiler/src/translators/translation-service.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ import {
1717
} from "./pluralization";
1818
import type { Logger } from "../utils/logger";
1919
import type { LocaleCode } from "lingo.dev/spec";
20+
import { PseudoTranslator } from "./pseudotranslator";
2021

2122
export interface TranslationServiceConfig {
2223
/**
2324
* Source locale (e.g., "en")
2425
*/
2526
sourceLocale: LocaleCode;
2627

27-
/**
28-
* Whether the translator is a pseudo translator
29-
* If true, translations will NOT be cached
30-
*/
31-
isPseudo?: boolean;
32-
3328
/**
3429
* Pluralization configuration
3530
* If provided, enables automatic pluralization of source messages
@@ -69,11 +64,12 @@ export class TranslationService {
6964
private config: TranslationServiceConfig,
7065
private logger: Logger,
7166
) {
72-
this.useCache = !this.config.isPseudo;
67+
const isPseudo = this.translator instanceof PseudoTranslator;
68+
this.useCache = !isPseudo;
7369

7470
// Initialize pluralization service if enabled
7571
// Do this once at construction to avoid repeated API key validation and model creation
76-
if (this.config.pluralization?.enabled !== false && !this.config.isPseudo) {
72+
if (this.config.pluralization?.enabled !== false && !isPseudo) {
7773
this.logger.info("Initializing pluralization service...");
7874
this.pluralizationService = new PluralizationService(
7975
{

cmp/compiler/src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,5 +306,3 @@ export interface MetadataSchema {
306306
lastUpdated: string;
307307
};
308308
}
309-
310-
export type ComponentType = "client" | "server" | "unknown";

0 commit comments

Comments
 (0)