Skip to content

Commit 5c01066

Browse files
committed
feat(cli): add workflow id param
1 parent ed99eac commit 5c01066

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

packages/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"license": "ISC",
2525
"dependencies": {
2626
"@inquirer/prompts": "^4.3.0",
27+
"@paralleldrive/cuid2": "^2.2.2",
2728
"commander": "^12.0.0",
2829
"dotenv": "^16.4.5",
2930
"open": "^10.1.0",

packages/cli/src/i18n.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Ora from 'ora';
33
import { getEnv } from './services/env.js';
44
import path from 'path';
55
import fs from 'fs/promises';
6+
import { createId } from '@paralleldrive/cuid2';
67

78
const buildDataDir = path.resolve(process.cwd(), 'node_modules', '@replexica/translations');
89
const buildDataFilePath = path.resolve(buildDataDir, '.replexica.json');
@@ -40,7 +41,7 @@ export default new Command()
4041

4142
spinner.succeed('Replexica build data loaded!');
4243

43-
44+
const workflowId = createId();
4445
for (let i = 0; i < localeTargets.length; i++) {
4546
const targetLocale = localeTargets[i];
4647
const resultData: any = {};
@@ -52,6 +53,7 @@ export default new Command()
5253

5354
const partialLocaleData = { [localeFileId]: localeFileData };
5455
const result = await processI18n(
56+
{ workflowId },
5557
{ source: localeSource, target: targetLocale },
5658
buildData.meta,
5759
partialLocaleData,
@@ -69,6 +71,7 @@ export default new Command()
6971
});
7072

7173
async function processI18n(
74+
params: { workflowId: string },
7275
locale: { source: string, target: string },
7376
meta: any,
7477
data: any,
@@ -82,6 +85,7 @@ async function processI18n(
8285
Authorization: `Bearer ${env.REPLEXICA_API_KEY}`,
8386
},
8487
body: JSON.stringify({
88+
params,
8589
locale,
8690
meta,
8791
data,

pnpm-lock.yaml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)