lingo.dev 0.129.0 → 0.130.0
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.
- package/build/cli.cjs +56 -8
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +55 -7
- package/build/cli.mjs.map +1 -1
- package/package.json +2 -2
package/build/cli.cjs
CHANGED
|
@@ -12657,19 +12657,39 @@ function createAiSdkLocalizer(params) {
|
|
|
12657
12657
|
message: "Hola, mundo!"
|
|
12658
12658
|
}
|
|
12659
12659
|
}
|
|
12660
|
+
],
|
|
12661
|
+
[
|
|
12662
|
+
{
|
|
12663
|
+
sourceLocale: "en",
|
|
12664
|
+
targetLocale: "es",
|
|
12665
|
+
data: {
|
|
12666
|
+
spring: "Spring"
|
|
12667
|
+
},
|
|
12668
|
+
hints: {
|
|
12669
|
+
spring: ["A source of water"]
|
|
12670
|
+
}
|
|
12671
|
+
},
|
|
12672
|
+
{
|
|
12673
|
+
sourceLocale: "en",
|
|
12674
|
+
targetLocale: "es",
|
|
12675
|
+
data: {
|
|
12676
|
+
spring: "Manantial"
|
|
12677
|
+
}
|
|
12678
|
+
}
|
|
12660
12679
|
]
|
|
12661
12680
|
];
|
|
12681
|
+
const hasHints = input2.hints && Object.keys(input2.hints).length > 0;
|
|
12662
12682
|
const payload = {
|
|
12663
12683
|
sourceLocale: input2.sourceLocale,
|
|
12664
12684
|
targetLocale: input2.targetLocale,
|
|
12665
|
-
data: input2.processableData
|
|
12685
|
+
data: input2.processableData,
|
|
12686
|
+
...hasHints && { hints: input2.hints }
|
|
12666
12687
|
};
|
|
12667
12688
|
const response = await _ai.generateText.call(void 0, {
|
|
12668
12689
|
model,
|
|
12669
12690
|
...params.settings,
|
|
12670
12691
|
messages: [
|
|
12671
12692
|
{ role: "system", content: systemPrompt },
|
|
12672
|
-
{ role: "user", content: "OK" },
|
|
12673
12693
|
...shots.flatMap(
|
|
12674
12694
|
([userShot, assistantShot]) => [
|
|
12675
12695
|
{ role: "user", content: JSON.stringify(userShot) },
|
|
@@ -13808,8 +13828,9 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13808
13828
|
this.ora.start("Committing changes");
|
|
13809
13829
|
_child_process.execSync.call(void 0, `git add .`, { stdio: "inherit" });
|
|
13810
13830
|
_child_process.execSync.call(void 0, `git status --porcelain`, { stdio: "inherit" });
|
|
13831
|
+
const signFlag = this.platformKit.config.gpgSign ? "-S " : "";
|
|
13811
13832
|
_child_process.execSync.call(void 0,
|
|
13812
|
-
`git commit -m ${escapeShellArg(
|
|
13833
|
+
`git commit ${signFlag}-m ${escapeShellArg(
|
|
13813
13834
|
this.platformKit.config.commitMessage
|
|
13814
13835
|
)} --no-verify`,
|
|
13815
13836
|
{
|
|
@@ -13860,6 +13881,21 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13860
13881
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
13861
13882
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
13862
13883
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
13884
|
+
if (this.platformKit.config.gpgSign) {
|
|
13885
|
+
try {
|
|
13886
|
+
const signingKey = _child_process.execSync.call(void 0, `git config user.signingkey`, {
|
|
13887
|
+
encoding: "utf8"
|
|
13888
|
+
}).trim();
|
|
13889
|
+
if (!signingKey) {
|
|
13890
|
+
throw new Error("No signing key configured");
|
|
13891
|
+
}
|
|
13892
|
+
} catch (e5) {
|
|
13893
|
+
throw new Error(
|
|
13894
|
+
"GPG signing is enabled but no signing key is configured. Import a GPG key (e.g., using crazy-max/ghaction-import-gpg) before running this action, or set gpg-sign to false."
|
|
13895
|
+
);
|
|
13896
|
+
}
|
|
13897
|
+
_child_process.execSync.call(void 0, `git config commit.gpgsign true`);
|
|
13898
|
+
}
|
|
13863
13899
|
_optionalChain([this, 'access', _413 => _413.platformKit, 'optionalAccess', _414 => _414.gitConfig, 'call', _415 => _415()]);
|
|
13864
13900
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
13865
13901
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
@@ -14056,8 +14092,9 @@ var PullRequestFlow = class extends InBranchFlow {
|
|
|
14056
14092
|
const hasChanges = this.checkCommitableChanges();
|
|
14057
14093
|
if (hasChanges) {
|
|
14058
14094
|
_child_process.execSync.call(void 0, "git add .", { stdio: "inherit" });
|
|
14095
|
+
const signFlag = this.platformKit.config.gpgSign ? "-S " : "";
|
|
14059
14096
|
_child_process.execSync.call(void 0,
|
|
14060
|
-
`git commit -m "chore: sync with ${this.platformKit.platformConfig.baseBranchName}" --no-verify`,
|
|
14097
|
+
`git commit ${signFlag}-m "chore: sync with ${this.platformKit.platformConfig.baseBranchName}" --no-verify`,
|
|
14061
14098
|
{
|
|
14062
14099
|
stdio: "inherit"
|
|
14063
14100
|
}
|
|
@@ -14119,6 +14156,10 @@ var PlatformKit = class {
|
|
|
14119
14156
|
LINGODOTDEV_PROCESS_OWN_COMMITS: _zod2.default.preprocess(
|
|
14120
14157
|
(val) => val === "true" || val === true,
|
|
14121
14158
|
_zod2.default.boolean()
|
|
14159
|
+
).optional(),
|
|
14160
|
+
LINGODOTDEV_GPG_SIGN: _zod2.default.preprocess(
|
|
14161
|
+
(val) => val === "true" || val === true,
|
|
14162
|
+
_zod2.default.boolean()
|
|
14122
14163
|
).optional()
|
|
14123
14164
|
}).parse(process.env);
|
|
14124
14165
|
return {
|
|
@@ -14129,7 +14170,8 @@ var PlatformKit = class {
|
|
|
14129
14170
|
commitAuthorName: env.LINGODOTDEV_COMMIT_AUTHOR_NAME || "Lingo.dev",
|
|
14130
14171
|
commitAuthorEmail: env.LINGODOTDEV_COMMIT_AUTHOR_EMAIL || "support@lingo.dev",
|
|
14131
14172
|
workingDir: env.LINGODOTDEV_WORKING_DIRECTORY || ".",
|
|
14132
|
-
processOwnCommits: env.LINGODOTDEV_PROCESS_OWN_COMMITS || false
|
|
14173
|
+
processOwnCommits: env.LINGODOTDEV_PROCESS_OWN_COMMITS || false,
|
|
14174
|
+
gpgSign: env.LINGODOTDEV_GPG_SIGN || false
|
|
14133
14175
|
};
|
|
14134
14176
|
}
|
|
14135
14177
|
};
|
|
@@ -14373,7 +14415,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
14373
14415
|
branch
|
|
14374
14416
|
);
|
|
14375
14417
|
return true;
|
|
14376
|
-
} catch (
|
|
14418
|
+
} catch (e6) {
|
|
14377
14419
|
return false;
|
|
14378
14420
|
}
|
|
14379
14421
|
}
|
|
@@ -14479,9 +14521,12 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
14479
14521
|
"--process-own-commits [boolean]",
|
|
14480
14522
|
"Allow processing commits made by this CI user (bypasses infinite loop prevention)",
|
|
14481
14523
|
parseBooleanArg
|
|
14524
|
+
).option(
|
|
14525
|
+
"--gpg-sign [boolean]",
|
|
14526
|
+
"Sign commits with GPG. Requires GPG to be configured in the environment",
|
|
14527
|
+
parseBooleanArg
|
|
14482
14528
|
).action(async (options) => {
|
|
14483
14529
|
const settings = getSettings(options.apiKey);
|
|
14484
|
-
console.log(options);
|
|
14485
14530
|
if (!settings.auth.apiKey) {
|
|
14486
14531
|
console.error("No API key provided");
|
|
14487
14532
|
return;
|
|
@@ -14515,6 +14560,9 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
14515
14560
|
},
|
|
14516
14561
|
...options.processOwnCommits && {
|
|
14517
14562
|
LINGODOTDEV_PROCESS_OWN_COMMITS: options.processOwnCommits.toString()
|
|
14563
|
+
},
|
|
14564
|
+
...options.gpgSign && {
|
|
14565
|
+
LINGODOTDEV_GPG_SIGN: options.gpgSign.toString()
|
|
14518
14566
|
}
|
|
14519
14567
|
};
|
|
14520
14568
|
process.env = { ...process.env, ...env };
|
|
@@ -15178,7 +15226,7 @@ async function renderHero2() {
|
|
|
15178
15226
|
// package.json
|
|
15179
15227
|
var package_default = {
|
|
15180
15228
|
name: "lingo.dev",
|
|
15181
|
-
version: "0.
|
|
15229
|
+
version: "0.130.0",
|
|
15182
15230
|
description: "Lingo.dev CLI",
|
|
15183
15231
|
private: false,
|
|
15184
15232
|
repository: {
|