dialekt 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +8 -10
  2. package/TESTING.md +29 -29
  3. package/dist/cli/main.d.mts +1 -1
  4. package/dist/cli/main.mjs +549 -362
  5. package/dist/formatters-De4Q-X1d.mjs +516 -435
  6. package/dist/index.d.mts +162 -25
  7. package/dist/index.mjs +119 -34
  8. package/package.json +3 -3
  9. package/pnpm-workspace.yaml +3 -3
  10. package/src/adapter/types.test.ts +57 -57
  11. package/src/adapter/types.ts +7 -4
  12. package/src/benchmark/metrics.test.ts +141 -69
  13. package/src/benchmark/metrics.ts +6 -6
  14. package/src/benchmark/report.test.ts +38 -38
  15. package/src/benchmark/report.ts +6 -6
  16. package/src/benchmark/runner.test.ts +70 -72
  17. package/src/benchmark/runner.ts +4 -4
  18. package/src/cli/commands/add.test.ts +90 -109
  19. package/src/cli/commands/add.ts +40 -28
  20. package/src/cli/commands/benchmark.test.ts +77 -64
  21. package/src/cli/commands/benchmark.ts +64 -41
  22. package/src/cli/commands/languages.test.ts +45 -42
  23. package/src/cli/commands/languages.ts +16 -12
  24. package/src/cli/commands/missing.test.ts +143 -92
  25. package/src/cli/commands/missing.ts +24 -17
  26. package/src/cli/commands/translate.test.ts +79 -79
  27. package/src/cli/commands/translate.ts +41 -31
  28. package/src/cli/commands/unused.test.ts +62 -51
  29. package/src/cli/commands/unused.ts +18 -14
  30. package/src/cli/commands/validate.test.ts +130 -72
  31. package/src/cli/commands/validate.ts +25 -20
  32. package/src/cli/config-resolution.test.ts +169 -49
  33. package/src/cli/config-resolution.ts +5 -7
  34. package/src/cli/format.test.ts +50 -50
  35. package/src/cli/format.ts +57 -60
  36. package/src/cli/formatters.test.ts +128 -106
  37. package/src/cli/formatters.ts +72 -95
  38. package/src/cli/main.ts +13 -13
  39. package/src/config/define-config.test.ts +44 -29
  40. package/src/config/define-config.ts +1 -1
  41. package/src/config/load-config.test.ts +21 -18
  42. package/src/config/load-config.ts +5 -5
  43. package/src/config/types.test.ts +50 -44
  44. package/src/config/types.ts +2 -2
  45. package/src/index.ts +22 -26
  46. package/src/keys/flatten.test.ts +52 -52
  47. package/src/keys/flatten.ts +7 -9
  48. package/src/sdk/file-io.test.ts +47 -59
  49. package/src/sdk/file-io.ts +2 -2
  50. package/src/sdk/node-layer.test.ts +18 -18
  51. package/src/sdk/node-layer.ts +2 -2
  52. package/src/sdk/php-array-reader.test.ts +49 -40
  53. package/src/sdk/php-array-reader.ts +5 -5
  54. package/src/translation/chunking.test.ts +52 -44
  55. package/src/translation/chunking.ts +1 -1
  56. package/src/translation/missing-keys.test.ts +86 -93
  57. package/src/translation/missing-keys.ts +4 -6
  58. package/src/translation/model-registry.test.ts +41 -32
  59. package/src/translation/model-registry.ts +9 -9
  60. package/src/translation/one-shot-strategy.test.ts +105 -86
  61. package/src/translation/one-shot-strategy.ts +10 -12
  62. package/src/translation/orchestrator.test.ts +90 -101
  63. package/src/translation/orchestrator.ts +26 -26
  64. package/src/translation/prompt.test.ts +76 -76
  65. package/src/translation/prompt.ts +2 -2
  66. package/src/translation/tool-loop-strategy.test.ts +134 -107
  67. package/src/translation/tool-loop-strategy.ts +14 -18
  68. package/src/translation/types.test.ts +22 -22
  69. package/src/translation/types.ts +3 -3
  70. package/tsdown.config.ts +3 -3
  71. package/vitest.config.ts +3 -3
@@ -1,17 +1,17 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { Effect, Option } from 'effect';
3
- import { runTranslate, translateCommand } from './translate.js';
4
- import type { DialektConfig } from '../../config/types.js';
5
- import type { TranslationAdapter, ResourceRef } from '../../adapter/types.js';
6
- import type { TranslationStrategy } from '../../translation/types.js';
7
-
8
- describe('runTranslate', () => {
1
+ import { describe, expect, it } from "vitest";
2
+ import { Effect, Option } from "effect";
3
+ import { runTranslate, translateCommand } from "./translate.js";
4
+ import type { DialektConfig } from "../../config/types.js";
5
+ import type { TranslationAdapter, ResourceRef } from "../../adapter/types.js";
6
+ import type { TranslationStrategy } from "../../translation/types.js";
7
+
8
+ describe("runTranslate", () => {
9
9
  const baseConfig: DialektConfig = {
10
- sourceLocale: 'en',
11
- targetLocales: ['de', 'fr'],
12
- strategy: 'one-shot',
13
- model: { provider: 'openai', modelId: 'gpt-4o' },
14
- fastModel: { provider: 'openai', modelId: 'gpt-4o-mini' },
10
+ sourceLocale: "en",
11
+ targetLocales: ["de", "fr"],
12
+ strategy: "one-shot",
13
+ model: { provider: "openai", modelId: "gpt-4o" },
14
+ fastModel: { provider: "openai", modelId: "gpt-4o-mini" },
15
15
  chunking: { maxTokens: 3000, charsPerToken: 3.0, concurrency: 3 },
16
16
  retry: { maxAttempts: 3, baseDelayMs: 1000 },
17
17
  adapters: [],
@@ -21,22 +21,22 @@ describe('runTranslate', () => {
21
21
  return {
22
22
  name: opts.name,
23
23
  capabilities: { canCreateResource: true, unusedKeyDetection: false },
24
- listLocales: () => Effect.succeed(opts.locales ?? ['en', 'de']),
24
+ listLocales: () => Effect.succeed(opts.locales ?? ["en", "de"]),
25
25
  listResources: () => Effect.succeed([]),
26
26
  readResource: () => Effect.succeed({}),
27
27
  writeResource: () => Effect.void,
28
28
  };
29
29
  }
30
30
 
31
- it('loads config and runs translation with default model', async () => {
31
+ it("loads config and runs translation with default model", async () => {
32
32
  const logs: string[] = [];
33
33
  let translationCalls = 0;
34
- const adapter = makeAdapter({ name: 'test' });
35
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
34
+ const adapter = makeAdapter({ name: "test" });
35
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
36
36
 
37
37
  const program = runTranslate(
38
38
  {
39
- config: './config.ts',
39
+ config: "./config.ts",
40
40
  adapter: Option.none(),
41
41
  strategy: Option.none(),
42
42
  baseLanguage: Option.none(),
@@ -52,7 +52,7 @@ describe('runTranslate', () => {
52
52
  Effect.sync(() => {
53
53
  translationCalls++;
54
54
  expect(opts.adapters).toHaveLength(1);
55
- expect(opts.sourceLocale).toBe('en');
55
+ expect(opts.sourceLocale).toBe("en");
56
56
  }),
57
57
  (msg) => Effect.sync(() => logs.push(msg)),
58
58
  );
@@ -62,17 +62,17 @@ describe('runTranslate', () => {
62
62
  expect(logs).toHaveLength(1);
63
63
  const parsed = JSON.parse(logs[0]!);
64
64
  expect(parsed.success).toBe(true);
65
- expect(parsed.message).toBe('Translation complete.');
65
+ expect(parsed.message).toBe("Translation complete.");
66
66
  });
67
67
 
68
- it('uses fastModel when --fast is passed', async () => {
68
+ it("uses fastModel when --fast is passed", async () => {
69
69
  let usedModel: string | undefined;
70
- const adapter = makeAdapter({ name: 'test' });
71
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
70
+ const adapter = makeAdapter({ name: "test" });
71
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
72
72
 
73
73
  const program = runTranslate(
74
74
  {
75
- config: './config.ts',
75
+ config: "./config.ts",
76
76
  adapter: Option.none(),
77
77
  strategy: Option.none(),
78
78
  baseLanguage: Option.none(),
@@ -93,21 +93,21 @@ describe('runTranslate', () => {
93
93
  );
94
94
 
95
95
  await Effect.runPromise(program);
96
- expect(usedModel).toBe('gpt-4o-mini');
96
+ expect(usedModel).toBe("gpt-4o-mini");
97
97
  });
98
98
 
99
- it('uses default strategy from config', async () => {
99
+ it("uses default strategy from config", async () => {
100
100
  let strategy: TranslationStrategy | undefined;
101
- const adapter = makeAdapter({ name: 'test' });
101
+ const adapter = makeAdapter({ name: "test" });
102
102
  const config: DialektConfig = {
103
103
  ...baseConfig,
104
- strategy: 'tool-loop-agent',
105
- adapters: [adapter] as unknown as DialektConfig['adapters'],
104
+ strategy: "tool-loop-agent",
105
+ adapters: [adapter] as unknown as DialektConfig["adapters"],
106
106
  };
107
107
 
108
108
  const program = runTranslate(
109
109
  {
110
- config: './config.ts',
110
+ config: "./config.ts",
111
111
  adapter: Option.none(),
112
112
  strategy: Option.none(),
113
113
  baseLanguage: Option.none(),
@@ -128,19 +128,19 @@ describe('runTranslate', () => {
128
128
 
129
129
  await Effect.runPromise(program);
130
130
  expect(strategy).toBeDefined();
131
- expect(strategy!.name).toBe('tool-loop-agent');
131
+ expect(strategy!.name).toBe("tool-loop-agent");
132
132
  });
133
133
 
134
- it('overrides strategy with --strategy flag', async () => {
134
+ it("overrides strategy with --strategy flag", async () => {
135
135
  let strategyName: string | undefined;
136
- const adapter = makeAdapter({ name: 'test' });
137
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
136
+ const adapter = makeAdapter({ name: "test" });
137
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
138
138
 
139
139
  const program = runTranslate(
140
140
  {
141
- config: './config.ts',
141
+ config: "./config.ts",
142
142
  adapter: Option.none(),
143
- strategy: Option.some('tool-loop-agent'),
143
+ strategy: Option.some("tool-loop-agent"),
144
144
  baseLanguage: Option.none(),
145
145
  language: Option.none(),
146
146
  name: Option.none(),
@@ -158,19 +158,19 @@ describe('runTranslate', () => {
158
158
  );
159
159
 
160
160
  await Effect.runPromise(program);
161
- expect(strategyName).toBe('tool-loop-agent');
161
+ expect(strategyName).toBe("tool-loop-agent");
162
162
  });
163
163
 
164
- it('filters adapters by --adapter flag', async () => {
164
+ it("filters adapters by --adapter flag", async () => {
165
165
  let usedAdapterName: string | undefined;
166
- const a1 = makeAdapter({ name: 'a1' });
167
- const a2 = makeAdapter({ name: 'a2' });
168
- const config = { ...baseConfig, adapters: [a1, a2] as unknown as DialektConfig['adapters'] };
166
+ const a1 = makeAdapter({ name: "a1" });
167
+ const a2 = makeAdapter({ name: "a2" });
168
+ const config = { ...baseConfig, adapters: [a1, a2] as unknown as DialektConfig["adapters"] };
169
169
 
170
170
  const program = runTranslate(
171
171
  {
172
- config: './config.ts',
173
- adapter: Option.some('a2'),
172
+ config: "./config.ts",
173
+ adapter: Option.some("a2"),
174
174
  strategy: Option.none(),
175
175
  baseLanguage: Option.none(),
176
176
  language: Option.none(),
@@ -189,13 +189,13 @@ describe('runTranslate', () => {
189
189
  );
190
190
 
191
191
  await Effect.runPromise(program);
192
- expect(usedAdapterName).toBe('a2');
192
+ expect(usedAdapterName).toBe("a2");
193
193
  });
194
194
 
195
- it('fails when configLoader fails', async () => {
195
+ it("fails when configLoader fails", async () => {
196
196
  const program = runTranslate(
197
197
  {
198
- config: './missing.ts',
198
+ config: "./missing.ts",
199
199
  adapter: Option.none(),
200
200
  strategy: Option.none(),
201
201
  baseLanguage: Option.none(),
@@ -205,21 +205,21 @@ describe('runTranslate', () => {
205
205
  skipLanguages: false,
206
206
  fast: false,
207
207
  },
208
- () => Effect.fail(new Error('Config not found')),
208
+ () => Effect.fail(new Error("Config not found")),
209
209
  () => Effect.succeed({}),
210
210
  () => Effect.void,
211
211
  );
212
212
 
213
- await expect(Effect.runPromise(program)).rejects.toThrow('Config not found');
213
+ await expect(Effect.runPromise(program)).rejects.toThrow("Config not found");
214
214
  });
215
215
 
216
- it('fails when modelResolver fails', async () => {
217
- const adapter = makeAdapter({ name: 'test' });
218
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
216
+ it("fails when modelResolver fails", async () => {
217
+ const adapter = makeAdapter({ name: "test" });
218
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
219
219
 
220
220
  const program = runTranslate(
221
221
  {
222
- config: './config.ts',
222
+ config: "./config.ts",
223
223
  adapter: Option.none(),
224
224
  strategy: Option.none(),
225
225
  baseLanguage: Option.none(),
@@ -230,20 +230,20 @@ describe('runTranslate', () => {
230
230
  fast: false,
231
231
  },
232
232
  () => Effect.succeed(config),
233
- () => Effect.fail(new Error('No API key')),
233
+ () => Effect.fail(new Error("No API key")),
234
234
  () => Effect.void,
235
235
  );
236
236
 
237
- await expect(Effect.runPromise(program)).rejects.toThrow('No API key');
237
+ await expect(Effect.runPromise(program)).rejects.toThrow("No API key");
238
238
  });
239
239
 
240
- it('fails when translationRunner fails', async () => {
241
- const adapter = makeAdapter({ name: 'test' });
242
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
240
+ it("fails when translationRunner fails", async () => {
241
+ const adapter = makeAdapter({ name: "test" });
242
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
243
243
 
244
244
  const program = runTranslate(
245
245
  {
246
- config: './config.ts',
246
+ config: "./config.ts",
247
247
  adapter: Option.none(),
248
248
  strategy: Option.none(),
249
249
  baseLanguage: Option.none(),
@@ -255,21 +255,21 @@ describe('runTranslate', () => {
255
255
  },
256
256
  () => Effect.succeed(config),
257
257
  () => Effect.succeed({}),
258
- () => Effect.fail(new Error('Translation failed')),
258
+ () => Effect.fail(new Error("Translation failed")),
259
259
  () => Effect.void,
260
260
  );
261
261
 
262
- await expect(Effect.runPromise(program)).rejects.toThrow('Translation failed');
262
+ await expect(Effect.runPromise(program)).rejects.toThrow("Translation failed");
263
263
  });
264
264
 
265
- it('uses one-shot strategy by default', async () => {
265
+ it("uses one-shot strategy by default", async () => {
266
266
  let strategyName: string | undefined;
267
- const adapter = makeAdapter({ name: 'test' });
268
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
267
+ const adapter = makeAdapter({ name: "test" });
268
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
269
269
 
270
270
  const program = runTranslate(
271
271
  {
272
- config: './config.ts',
272
+ config: "./config.ts",
273
273
  adapter: Option.none(),
274
274
  strategy: Option.none(),
275
275
  baseLanguage: Option.none(),
@@ -289,21 +289,21 @@ describe('runTranslate', () => {
289
289
  );
290
290
 
291
291
  await Effect.runPromise(program);
292
- expect(strategyName).toBe('one-shot');
292
+ expect(strategyName).toBe("one-shot");
293
293
  });
294
294
 
295
- it('filters target locales by --language flag', async () => {
295
+ it("filters target locales by --language flag", async () => {
296
296
  let targetLocales: readonly string[] = [];
297
- const adapter = makeAdapter({ name: 'test' });
298
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
297
+ const adapter = makeAdapter({ name: "test" });
298
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
299
299
 
300
300
  const program = runTranslate(
301
301
  {
302
- config: './config.ts',
302
+ config: "./config.ts",
303
303
  adapter: Option.none(),
304
304
  strategy: Option.none(),
305
305
  baseLanguage: Option.none(),
306
- language: Option.some('de'),
306
+ language: Option.some("de"),
307
307
  name: Option.none(),
308
308
  skipNames: false,
309
309
  skipLanguages: false,
@@ -319,17 +319,17 @@ describe('runTranslate', () => {
319
319
  );
320
320
 
321
321
  await Effect.runPromise(program);
322
- expect(targetLocales).toEqual(['de']);
322
+ expect(targetLocales).toEqual(["de"]);
323
323
  });
324
324
 
325
- it('outputs pretty when --format pretty is passed', async () => {
325
+ it("outputs pretty when --format pretty is passed", async () => {
326
326
  const logs: string[] = [];
327
- const adapter = makeAdapter({ name: 'test' });
328
- const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig['adapters'] };
327
+ const adapter = makeAdapter({ name: "test" });
328
+ const config = { ...baseConfig, adapters: [adapter] as unknown as DialektConfig["adapters"] };
329
329
 
330
330
  const program = runTranslate(
331
331
  {
332
- config: './config.ts',
332
+ config: "./config.ts",
333
333
  adapter: Option.none(),
334
334
  strategy: Option.none(),
335
335
  baseLanguage: Option.none(),
@@ -338,7 +338,7 @@ describe('runTranslate', () => {
338
338
  skipNames: false,
339
339
  skipLanguages: false,
340
340
  fast: false,
341
- format: Option.some('pretty'),
341
+ format: Option.some("pretty"),
342
342
  },
343
343
  () => Effect.succeed(config),
344
344
  () => Effect.succeed({}),
@@ -348,16 +348,16 @@ describe('runTranslate', () => {
348
348
 
349
349
  await Effect.runPromise(program);
350
350
  expect(logs).toHaveLength(1);
351
- expect(logs[0]).toContain('Translation complete');
351
+ expect(logs[0]).toContain("Translation complete");
352
352
  });
353
353
 
354
- it('handles empty adapters list', async () => {
354
+ it("handles empty adapters list", async () => {
355
355
  const logs: string[] = [];
356
356
  const config = { ...baseConfig, adapters: [] };
357
357
 
358
358
  const program = runTranslate(
359
359
  {
360
- config: './config.ts',
360
+ config: "./config.ts",
361
361
  adapter: Option.none(),
362
362
  strategy: Option.none(),
363
363
  baseLanguage: Option.none(),
@@ -1,15 +1,15 @@
1
- import { Command, Options } from '@effect/cli';
2
- import { Effect, Console, Option } from 'effect';
3
- import { loadConfig } from '../../config/load-config.js';
4
- import { resolveEffectiveConfig } from '../config-resolution.js';
5
- import { resolveModel } from '../../translation/model-registry.js';
6
- import { createOneShotStrategy } from '../../translation/one-shot-strategy.js';
7
- import { createToolLoopStrategy } from '../../translation/tool-loop-strategy.js';
8
- import { runTranslation } from '../../translation/orchestrator.js';
9
- import { detectFormat, type OutputFormat } from '../format.js';
10
- import { formatTranslate, formatError } from '../formatters.js';
11
- import type { DialektConfig } from '../../config/types.js';
12
- import type { TranslationStrategy } from '../../translation/types.js';
1
+ import { Command, Options } from "@effect/cli";
2
+ import { Effect, Console, Option } from "effect";
3
+ import { loadConfig } from "../../config/load-config.js";
4
+ import { resolveEffectiveConfig } from "../config-resolution.js";
5
+ import { resolveModel } from "../../translation/model-registry.js";
6
+ import { createOneShotStrategy } from "../../translation/one-shot-strategy.js";
7
+ import { createToolLoopStrategy } from "../../translation/tool-loop-strategy.js";
8
+ import { runTranslation } from "../../translation/orchestrator.js";
9
+ import { detectFormat, type OutputFormat } from "../format.js";
10
+ import { formatTranslate, formatError } from "../formatters.js";
11
+ import type { DialektConfig } from "../../config/types.js";
12
+ import type { TranslationStrategy } from "../../translation/types.js";
13
13
 
14
14
  export interface TranslateFlags {
15
15
  readonly config: string;
@@ -27,7 +27,10 @@ export interface TranslateFlags {
27
27
  export function runTranslate(
28
28
  flags: TranslateFlags,
29
29
  configLoader: (path: string) => Effect.Effect<DialektConfig, unknown> = loadConfig,
30
- modelResolver: (config: { provider: string; modelId: string }) => Effect.Effect<unknown, unknown> = resolveModel,
30
+ modelResolver: (config: {
31
+ provider: string;
32
+ modelId: string;
33
+ }) => Effect.Effect<unknown, unknown> = resolveModel,
31
34
  translationRunner: (opts: {
32
35
  adapters: readonly unknown[];
33
36
  strategy: TranslationStrategy;
@@ -45,19 +48,22 @@ export function runTranslate(
45
48
  language: Option.isSome(flags.language) ? [flags.language.value] : undefined,
46
49
  adapter: Option.getOrUndefined(flags.adapter),
47
50
  strategy:
48
- Option.getOrUndefined(flags.strategy) === 'one-shot' ||
49
- Option.getOrUndefined(flags.strategy) === 'tool-loop-agent'
50
- ? (Option.getOrUndefined(flags.strategy) as 'one-shot' | 'tool-loop-agent')
51
+ Option.getOrUndefined(flags.strategy) === "one-shot" ||
52
+ Option.getOrUndefined(flags.strategy) === "tool-loop-agent"
53
+ ? (Option.getOrUndefined(flags.strategy) as "one-shot" | "tool-loop-agent")
51
54
  : undefined,
52
55
  },
53
56
  loaded,
54
57
  );
55
58
 
56
59
  const modelConfig = flags.fast ? effective.fastModel : effective.model;
57
- const model = yield* modelResolver(modelConfig) as Effect.Effect<import('ai').LanguageModel, unknown>;
60
+ const model = yield* modelResolver(modelConfig) as Effect.Effect<
61
+ import("ai").LanguageModel,
62
+ unknown
63
+ >;
58
64
 
59
65
  const translationStrategy =
60
- effective.strategy === 'tool-loop-agent'
66
+ effective.strategy === "tool-loop-agent"
61
67
  ? createToolLoopStrategy({ model, retry: effective.retry })
62
68
  : createOneShotStrategy({ model, retry: effective.retry });
63
69
 
@@ -79,7 +85,7 @@ export function runTranslate(
79
85
  formatTranslate(
80
86
  {
81
87
  success: true,
82
- message: 'Translation complete.',
88
+ message: "Translation complete.",
83
89
  stats: {
84
90
  adaptersProcessed: effective.adapters.length,
85
91
  localesTranslated: (effective.targetLocales ?? []).length,
@@ -92,15 +98,19 @@ export function runTranslate(
92
98
  });
93
99
  }
94
100
 
95
- export const translateCommand = Command.make('translate', {
96
- config: Options.text('config').pipe(Options.withDefault('./dialekt.config.ts')),
97
- adapter: Options.optional(Options.text('adapter')),
98
- strategy: Options.optional(Options.text('strategy')),
99
- baseLanguage: Options.optional(Options.text('base-language')),
100
- language: Options.optional(Options.text('language')),
101
- name: Options.optional(Options.text('name')),
102
- skipNames: Options.boolean('skip-names'),
103
- skipLanguages: Options.boolean('skip-languages'),
104
- fast: Options.boolean('fast'),
105
- format: Options.optional(Options.text('format')),
106
- }, (flags) => runTranslate(flags));
101
+ export const translateCommand = Command.make(
102
+ "translate",
103
+ {
104
+ config: Options.text("config").pipe(Options.withDefault("./dialekt.config.ts")),
105
+ adapter: Options.optional(Options.text("adapter")),
106
+ strategy: Options.optional(Options.text("strategy")),
107
+ baseLanguage: Options.optional(Options.text("base-language")),
108
+ language: Options.optional(Options.text("language")),
109
+ name: Options.optional(Options.text("name")),
110
+ skipNames: Options.boolean("skip-names"),
111
+ skipLanguages: Options.boolean("skip-languages"),
112
+ fast: Options.boolean("fast"),
113
+ format: Options.optional(Options.text("format")),
114
+ },
115
+ (flags) => runTranslate(flags),
116
+ );