lingo.dev 0.117.16 → 0.117.18
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 +156 -55
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +146 -45
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.cjs
CHANGED
|
@@ -10802,27 +10802,128 @@ function withExponentialBackoff(fn, maxAttempts = 3, baseDelay = 1e3) {
|
|
|
10802
10802
|
// src/cli/utils/observability.ts
|
|
10803
10803
|
var _nodemachineid = require('node-machine-id'); var _nodemachineid2 = _interopRequireDefault(_nodemachineid);
|
|
10804
10804
|
var _https = require('https'); var _https2 = _interopRequireDefault(_https);
|
|
10805
|
+
|
|
10806
|
+
// src/cli/utils/repository-id.ts
|
|
10807
|
+
var _child_process = require('child_process'); var cp = _interopRequireWildcard(_child_process);
|
|
10808
|
+
var cachedGitRepoId = void 0;
|
|
10809
|
+
function getRepositoryId() {
|
|
10810
|
+
const ciRepoId = getCIRepositoryId();
|
|
10811
|
+
if (ciRepoId) return ciRepoId;
|
|
10812
|
+
const gitRepoId = getGitRepositoryId();
|
|
10813
|
+
if (gitRepoId) return gitRepoId;
|
|
10814
|
+
return null;
|
|
10815
|
+
}
|
|
10816
|
+
function getCIRepositoryId() {
|
|
10817
|
+
if (process.env.GITHUB_REPOSITORY) {
|
|
10818
|
+
return `github:${process.env.GITHUB_REPOSITORY}`;
|
|
10819
|
+
}
|
|
10820
|
+
if (process.env.CI_PROJECT_PATH) {
|
|
10821
|
+
return `gitlab:${process.env.CI_PROJECT_PATH}`;
|
|
10822
|
+
}
|
|
10823
|
+
if (process.env.BITBUCKET_REPO_FULL_NAME) {
|
|
10824
|
+
return `bitbucket:${process.env.BITBUCKET_REPO_FULL_NAME}`;
|
|
10825
|
+
}
|
|
10826
|
+
return null;
|
|
10827
|
+
}
|
|
10828
|
+
function getGitRepositoryId() {
|
|
10829
|
+
if (cachedGitRepoId !== void 0) {
|
|
10830
|
+
return cachedGitRepoId;
|
|
10831
|
+
}
|
|
10832
|
+
try {
|
|
10833
|
+
const remoteUrl = _child_process.execSync.call(void 0, "git config --get remote.origin.url", {
|
|
10834
|
+
encoding: "utf8",
|
|
10835
|
+
stdio: ["pipe", "pipe", "ignore"]
|
|
10836
|
+
}).trim();
|
|
10837
|
+
if (!remoteUrl) {
|
|
10838
|
+
cachedGitRepoId = null;
|
|
10839
|
+
return null;
|
|
10840
|
+
}
|
|
10841
|
+
cachedGitRepoId = parseGitUrl(remoteUrl);
|
|
10842
|
+
return cachedGitRepoId;
|
|
10843
|
+
} catch (e3) {
|
|
10844
|
+
cachedGitRepoId = null;
|
|
10845
|
+
return null;
|
|
10846
|
+
}
|
|
10847
|
+
}
|
|
10848
|
+
function parseGitUrl(url) {
|
|
10849
|
+
const cleanUrl = url.replace(/\.git$/, "");
|
|
10850
|
+
let platform = null;
|
|
10851
|
+
if (cleanUrl.includes("github.com")) {
|
|
10852
|
+
platform = "github";
|
|
10853
|
+
} else if (cleanUrl.includes("gitlab.com")) {
|
|
10854
|
+
platform = "gitlab";
|
|
10855
|
+
} else if (cleanUrl.includes("bitbucket.org")) {
|
|
10856
|
+
platform = "bitbucket";
|
|
10857
|
+
}
|
|
10858
|
+
const sshMatch = cleanUrl.match(/[@:]([^:/@]+\/[^:/@]+)$/);
|
|
10859
|
+
const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
|
|
10860
|
+
const repoPath = _optionalChain([sshMatch, 'optionalAccess', _340 => _340[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _341 => _341[1]]);
|
|
10861
|
+
if (!repoPath) return null;
|
|
10862
|
+
if (platform) {
|
|
10863
|
+
return `${platform}:${repoPath}`;
|
|
10864
|
+
}
|
|
10865
|
+
return `git:${repoPath}`;
|
|
10866
|
+
}
|
|
10867
|
+
|
|
10868
|
+
// src/cli/utils/observability.ts
|
|
10805
10869
|
var { machineIdSync } = _nodemachineid2.default;
|
|
10806
10870
|
var POSTHOG_API_KEY = "phc_eR0iSoQufBxNY36k0f0T15UvHJdTfHlh8rJcxsfhfXk";
|
|
10807
10871
|
var POSTHOG_HOST = "eu.i.posthog.com";
|
|
10808
10872
|
var POSTHOG_PATH = "/i/v0/e/";
|
|
10809
10873
|
var REQUEST_TIMEOUT_MS = 1e3;
|
|
10874
|
+
var TRACKING_VERSION = "2.0";
|
|
10875
|
+
function determineDistinctId(providedId) {
|
|
10876
|
+
if (providedId) {
|
|
10877
|
+
const projectId = getRepositoryId();
|
|
10878
|
+
return {
|
|
10879
|
+
distinct_id: providedId,
|
|
10880
|
+
distinct_id_source: "email",
|
|
10881
|
+
project_id: projectId
|
|
10882
|
+
};
|
|
10883
|
+
}
|
|
10884
|
+
const repoId = getRepositoryId();
|
|
10885
|
+
if (repoId) {
|
|
10886
|
+
return {
|
|
10887
|
+
distinct_id: repoId,
|
|
10888
|
+
distinct_id_source: "git_repo",
|
|
10889
|
+
project_id: repoId
|
|
10890
|
+
};
|
|
10891
|
+
}
|
|
10892
|
+
const deviceId = `device-${machineIdSync()}`;
|
|
10893
|
+
if (process.env.DEBUG === "true") {
|
|
10894
|
+
console.warn(
|
|
10895
|
+
"[Tracking] Using device ID fallback. Consider using git repository for consistent tracking."
|
|
10896
|
+
);
|
|
10897
|
+
}
|
|
10898
|
+
return {
|
|
10899
|
+
distinct_id: deviceId,
|
|
10900
|
+
distinct_id_source: "device",
|
|
10901
|
+
project_id: null
|
|
10902
|
+
};
|
|
10903
|
+
}
|
|
10810
10904
|
function trackEvent(distinctId, event, properties) {
|
|
10811
10905
|
if (process.env.DO_NOT_TRACK === "1") {
|
|
10812
10906
|
return;
|
|
10813
10907
|
}
|
|
10814
10908
|
setImmediate(() => {
|
|
10815
10909
|
try {
|
|
10816
|
-
const
|
|
10910
|
+
const identityInfo = determineDistinctId(distinctId);
|
|
10911
|
+
if (process.env.DEBUG === "true") {
|
|
10912
|
+
console.log(
|
|
10913
|
+
`[Tracking] Event: ${event}, ID: ${identityInfo.distinct_id}, Source: ${identityInfo.distinct_id_source}`
|
|
10914
|
+
);
|
|
10915
|
+
}
|
|
10817
10916
|
const eventData = {
|
|
10818
10917
|
api_key: POSTHOG_API_KEY,
|
|
10819
10918
|
event,
|
|
10820
|
-
distinct_id:
|
|
10919
|
+
distinct_id: identityInfo.distinct_id,
|
|
10821
10920
|
properties: {
|
|
10822
10921
|
...properties,
|
|
10823
10922
|
$lib: "lingo.dev-cli",
|
|
10824
10923
|
$lib_version: process.env.npm_package_version || "unknown",
|
|
10825
|
-
|
|
10924
|
+
tracking_version: TRACKING_VERSION,
|
|
10925
|
+
distinct_id_source: identityInfo.distinct_id_source,
|
|
10926
|
+
project_id: identityInfo.project_id,
|
|
10826
10927
|
node_version: process.version,
|
|
10827
10928
|
is_ci: !!process.env.CI,
|
|
10828
10929
|
debug_enabled: process.env.DEBUG === "true"
|
|
@@ -11032,7 +11133,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11032
11133
|
try {
|
|
11033
11134
|
flags = parseFlags(options);
|
|
11034
11135
|
} catch (parseError) {
|
|
11035
|
-
await trackEvent(
|
|
11136
|
+
await trackEvent(null, "cmd.i18n.error", {
|
|
11036
11137
|
errorType: "validation_error",
|
|
11037
11138
|
errorName: parseError.name || "ValidationError",
|
|
11038
11139
|
errorMessage: parseError.message || "Invalid command line options",
|
|
@@ -11064,7 +11165,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11064
11165
|
validateParams(i18nConfig, flags);
|
|
11065
11166
|
ora.succeed("Localization configuration is valid");
|
|
11066
11167
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
11067
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
11168
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _342 => _342.provider]);
|
|
11068
11169
|
if (isByokMode) {
|
|
11069
11170
|
authId = null;
|
|
11070
11171
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -11078,16 +11179,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11078
11179
|
flags
|
|
11079
11180
|
});
|
|
11080
11181
|
let buckets = getBuckets(i18nConfig);
|
|
11081
|
-
if (_optionalChain([flags, 'access',
|
|
11182
|
+
if (_optionalChain([flags, 'access', _343 => _343.bucket, 'optionalAccess', _344 => _344.length])) {
|
|
11082
11183
|
buckets = buckets.filter(
|
|
11083
11184
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
11084
11185
|
);
|
|
11085
11186
|
}
|
|
11086
11187
|
ora.succeed("Buckets retrieved");
|
|
11087
|
-
if (_optionalChain([flags, 'access',
|
|
11188
|
+
if (_optionalChain([flags, 'access', _345 => _345.file, 'optionalAccess', _346 => _346.length])) {
|
|
11088
11189
|
buckets = buckets.map((bucket) => {
|
|
11089
11190
|
const paths = bucket.paths.filter(
|
|
11090
|
-
(path19) => flags.file.find((file) => _optionalChain([path19, 'access',
|
|
11191
|
+
(path19) => flags.file.find((file) => _optionalChain([path19, 'access', _347 => _347.pathPattern, 'optionalAccess', _348 => _348.includes, 'call', _349 => _349(file)]))
|
|
11091
11192
|
);
|
|
11092
11193
|
return { ...bucket, paths };
|
|
11093
11194
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -11108,7 +11209,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11108
11209
|
});
|
|
11109
11210
|
}
|
|
11110
11211
|
}
|
|
11111
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
11212
|
+
const targetLocales = _optionalChain([flags, 'access', _350 => _350.locale, 'optionalAccess', _351 => _351.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
11112
11213
|
ora.start("Setting up localization cache...");
|
|
11113
11214
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
11114
11215
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -11393,7 +11494,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11393
11494
|
}
|
|
11394
11495
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
11395
11496
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
11396
|
-
if (!_optionalChain([flags, 'access',
|
|
11497
|
+
if (!_optionalChain([flags, 'access', _352 => _352.locale, 'optionalAccess', _353 => _353.length])) {
|
|
11397
11498
|
await deltaProcessor.saveChecksums(checksums);
|
|
11398
11499
|
}
|
|
11399
11500
|
}
|
|
@@ -11432,7 +11533,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11432
11533
|
});
|
|
11433
11534
|
} else {
|
|
11434
11535
|
ora.warn("Localization completed with errors.");
|
|
11435
|
-
await trackEvent(authId
|
|
11536
|
+
await trackEvent(authId, "cmd.i18n.error", {
|
|
11436
11537
|
flags,
|
|
11437
11538
|
...aggregateErrorAnalytics(
|
|
11438
11539
|
errorDetails,
|
|
@@ -11458,7 +11559,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
11458
11559
|
bucket: error.bucket
|
|
11459
11560
|
};
|
|
11460
11561
|
}
|
|
11461
|
-
await trackEvent(authId
|
|
11562
|
+
await trackEvent(authId, "cmd.i18n.error", {
|
|
11462
11563
|
flags,
|
|
11463
11564
|
errorType,
|
|
11464
11565
|
errorName: error.name || "Error",
|
|
@@ -11517,12 +11618,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
11517
11618
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
11518
11619
|
docUrl: "bucketNotFound"
|
|
11519
11620
|
});
|
|
11520
|
-
} else if (_optionalChain([flags, 'access',
|
|
11621
|
+
} else if (_optionalChain([flags, 'access', _354 => _354.locale, 'optionalAccess', _355 => _355.some, 'call', _356 => _356((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
11521
11622
|
throw new ValidationError({
|
|
11522
11623
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
11523
11624
|
docUrl: "localeTargetNotFound"
|
|
11524
11625
|
});
|
|
11525
|
-
} else if (_optionalChain([flags, 'access',
|
|
11626
|
+
} else if (_optionalChain([flags, 'access', _357 => _357.bucket, 'optionalAccess', _358 => _358.some, 'call', _359 => _359(
|
|
11526
11627
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
11527
11628
|
)])) {
|
|
11528
11629
|
throw new ValidationError({
|
|
@@ -11978,7 +12079,7 @@ var mcp_default = new (0, _interactivecommander.Command)().command("mcp").descri
|
|
|
11978
12079
|
|
|
11979
12080
|
|
|
11980
12081
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
11981
|
-
|
|
12082
|
+
|
|
11982
12083
|
|
|
11983
12084
|
// src/cli/cmd/ci/flows/in-branch.ts
|
|
11984
12085
|
|
|
@@ -12056,7 +12157,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
12056
12157
|
const response = await engine.whoami();
|
|
12057
12158
|
return {
|
|
12058
12159
|
authenticated: !!response,
|
|
12059
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
12160
|
+
username: _optionalChain([response, 'optionalAccess', _360 => _360.email])
|
|
12060
12161
|
};
|
|
12061
12162
|
} catch (error) {
|
|
12062
12163
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -12172,7 +12273,7 @@ function createExplicitLocalizer(provider) {
|
|
|
12172
12273
|
}
|
|
12173
12274
|
function createAiSdkLocalizer(params) {
|
|
12174
12275
|
const skipAuth = params.skipAuth === true;
|
|
12175
|
-
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
12276
|
+
const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _361 => _361.apiKeyName]), () => ( ""))];
|
|
12176
12277
|
if (!skipAuth && !apiKey || !params.apiKeyName) {
|
|
12177
12278
|
throw new Error(
|
|
12178
12279
|
_dedent2.default`
|
|
@@ -12306,8 +12407,8 @@ async function setup(input2) {
|
|
|
12306
12407
|
throw new Error(
|
|
12307
12408
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
12308
12409
|
);
|
|
12309
|
-
} else if (_optionalChain([ctx, 'access',
|
|
12310
|
-
(bucket) => !_optionalChain([ctx, 'access',
|
|
12410
|
+
} else if (_optionalChain([ctx, 'access', _362 => _362.flags, 'access', _363 => _363.bucket, 'optionalAccess', _364 => _364.some, 'call', _365 => _365(
|
|
12411
|
+
(bucket) => !_optionalChain([ctx, 'access', _366 => _366.config, 'optionalAccess', _367 => _367.buckets, 'access', _368 => _368[bucket]])
|
|
12311
12412
|
)])) {
|
|
12312
12413
|
throw new Error(
|
|
12313
12414
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -12320,7 +12421,7 @@ async function setup(input2) {
|
|
|
12320
12421
|
title: "Selecting localization provider",
|
|
12321
12422
|
task: async (ctx, task) => {
|
|
12322
12423
|
ctx.localizer = createLocalizer(
|
|
12323
|
-
_optionalChain([ctx, 'access',
|
|
12424
|
+
_optionalChain([ctx, 'access', _369 => _369.config, 'optionalAccess', _370 => _370.provider]),
|
|
12324
12425
|
ctx.flags.apiKey
|
|
12325
12426
|
);
|
|
12326
12427
|
if (!ctx.localizer) {
|
|
@@ -12333,7 +12434,7 @@ async function setup(input2) {
|
|
|
12333
12434
|
},
|
|
12334
12435
|
{
|
|
12335
12436
|
title: "Checking authentication",
|
|
12336
|
-
enabled: (ctx) => _optionalChain([ctx, 'access',
|
|
12437
|
+
enabled: (ctx) => _optionalChain([ctx, 'access', _371 => _371.localizer, 'optionalAccess', _372 => _372.id]) === "Lingo.dev",
|
|
12337
12438
|
task: async (ctx, task) => {
|
|
12338
12439
|
const authStatus = await ctx.localizer.checkAuth();
|
|
12339
12440
|
if (!authStatus.authenticated) {
|
|
@@ -12346,7 +12447,7 @@ async function setup(input2) {
|
|
|
12346
12447
|
},
|
|
12347
12448
|
{
|
|
12348
12449
|
title: "Validating configuration",
|
|
12349
|
-
enabled: (ctx) => _optionalChain([ctx, 'access',
|
|
12450
|
+
enabled: (ctx) => _optionalChain([ctx, 'access', _373 => _373.localizer, 'optionalAccess', _374 => _374.id]) !== "Lingo.dev",
|
|
12350
12451
|
task: async (ctx, task) => {
|
|
12351
12452
|
const validationStatus = await ctx.localizer.validateSettings();
|
|
12352
12453
|
if (!validationStatus.valid) {
|
|
@@ -12677,7 +12778,7 @@ function createWorkerTask(args) {
|
|
|
12677
12778
|
const processableData = _lodash2.default.chain(sourceData).entries().filter(
|
|
12678
12779
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
12679
12780
|
).filter(
|
|
12680
|
-
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access',
|
|
12781
|
+
([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _375 => _375.onlyKeys, 'optionalAccess', _376 => _376.some, 'call', _377 => _377(
|
|
12681
12782
|
(pattern) => minimatch(key, pattern)
|
|
12682
12783
|
)])
|
|
12683
12784
|
).fromPairs().value();
|
|
@@ -12745,7 +12846,7 @@ function createWorkerTask(args) {
|
|
|
12745
12846
|
finalRenamedTargetData
|
|
12746
12847
|
);
|
|
12747
12848
|
const checksums = await deltaProcessor.createChecksums(sourceData);
|
|
12748
|
-
if (!_optionalChain([args, 'access',
|
|
12849
|
+
if (!_optionalChain([args, 'access', _378 => _378.ctx, 'access', _379 => _379.flags, 'access', _380 => _380.targetLocale, 'optionalAccess', _381 => _381.length])) {
|
|
12749
12850
|
await deltaProcessor.saveChecksums(checksums);
|
|
12750
12851
|
}
|
|
12751
12852
|
});
|
|
@@ -12950,10 +13051,10 @@ var flagsSchema2 = _zod.z.object({
|
|
|
12950
13051
|
async function frozen(input2) {
|
|
12951
13052
|
console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
|
|
12952
13053
|
let buckets = getBuckets(input2.config);
|
|
12953
|
-
if (_optionalChain([input2, 'access',
|
|
13054
|
+
if (_optionalChain([input2, 'access', _382 => _382.flags, 'access', _383 => _383.bucket, 'optionalAccess', _384 => _384.length])) {
|
|
12954
13055
|
buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
|
|
12955
13056
|
}
|
|
12956
|
-
if (_optionalChain([input2, 'access',
|
|
13057
|
+
if (_optionalChain([input2, 'access', _385 => _385.flags, 'access', _386 => _386.file, 'optionalAccess', _387 => _387.length])) {
|
|
12957
13058
|
buckets = buckets.map((bucket) => {
|
|
12958
13059
|
const paths = bucket.paths.filter(
|
|
12959
13060
|
(p) => input2.flags.file.some(
|
|
@@ -13090,14 +13191,14 @@ async function frozen(input2) {
|
|
|
13090
13191
|
|
|
13091
13192
|
// src/cli/cmd/run/_utils.ts
|
|
13092
13193
|
async function determineAuthId(ctx) {
|
|
13093
|
-
const isByokMode = !!_optionalChain([ctx, 'access',
|
|
13194
|
+
const isByokMode = !!_optionalChain([ctx, 'access', _388 => _388.config, 'optionalAccess', _389 => _389.provider]);
|
|
13094
13195
|
if (isByokMode) {
|
|
13095
13196
|
return null;
|
|
13096
13197
|
} else {
|
|
13097
13198
|
try {
|
|
13098
|
-
const authStatus = await _optionalChain([ctx, 'access',
|
|
13099
|
-
return _optionalChain([authStatus, 'optionalAccess',
|
|
13100
|
-
} catch (
|
|
13199
|
+
const authStatus = await _optionalChain([ctx, 'access', _390 => _390.localizer, 'optionalAccess', _391 => _391.checkAuth, 'call', _392 => _392()]);
|
|
13200
|
+
return _optionalChain([authStatus, 'optionalAccess', _393 => _393.username]) || null;
|
|
13201
|
+
} catch (e4) {
|
|
13101
13202
|
return null;
|
|
13102
13203
|
}
|
|
13103
13204
|
}
|
|
@@ -13214,7 +13315,7 @@ var run_default = new (0, _interactivecommander.Command)().command("run").descri
|
|
|
13214
13315
|
flags: ctx.flags
|
|
13215
13316
|
});
|
|
13216
13317
|
} catch (error) {
|
|
13217
|
-
await trackEvent(authId
|
|
13318
|
+
await trackEvent(authId, "cmd.run.error", {});
|
|
13218
13319
|
if (args.sound) {
|
|
13219
13320
|
await playSound("failure");
|
|
13220
13321
|
}
|
|
@@ -13294,7 +13395,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13294
13395
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
13295
13396
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
13296
13397
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
13297
|
-
_optionalChain([this, 'access',
|
|
13398
|
+
_optionalChain([this, 'access', _394 => _394.platformKit, 'optionalAccess', _395 => _395.gitConfig, 'call', _396 => _396()]);
|
|
13298
13399
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
13299
13400
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
13300
13401
|
if (!processOwnCommits) {
|
|
@@ -13326,7 +13427,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
13326
13427
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
13327
13428
|
var PullRequestFlow = class extends InBranchFlow {
|
|
13328
13429
|
async preRun() {
|
|
13329
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
13430
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _397 => _397()]);
|
|
13330
13431
|
if (!canContinue) {
|
|
13331
13432
|
return false;
|
|
13332
13433
|
}
|
|
@@ -13593,10 +13694,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
13593
13694
|
repo_slug: this.platformConfig.repositoryName,
|
|
13594
13695
|
state: "OPEN"
|
|
13595
13696
|
}).then(({ data: { values } }) => {
|
|
13596
|
-
return _optionalChain([values, 'optionalAccess',
|
|
13597
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
13697
|
+
return _optionalChain([values, 'optionalAccess', _398 => _398.find, 'call', _399 => _399(
|
|
13698
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _400 => _400.branch, 'optionalAccess', _401 => _401.name]) === branch && _optionalChain([destination, 'optionalAccess', _402 => _402.branch, 'optionalAccess', _403 => _403.name]) === this.platformConfig.baseBranchName
|
|
13598
13699
|
)]);
|
|
13599
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
13700
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _404 => _404.id]));
|
|
13600
13701
|
}
|
|
13601
13702
|
async closePullRequest({ pullRequestNumber }) {
|
|
13602
13703
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -13692,7 +13793,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
13692
13793
|
repo: this.platformConfig.repositoryName,
|
|
13693
13794
|
base: this.platformConfig.baseBranchName,
|
|
13694
13795
|
state: "open"
|
|
13695
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
13796
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _405 => _405.number]));
|
|
13696
13797
|
}
|
|
13697
13798
|
async closePullRequest({ pullRequestNumber }) {
|
|
13698
13799
|
await this.octokit.rest.pulls.update({
|
|
@@ -13807,7 +13908,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
13807
13908
|
branch
|
|
13808
13909
|
);
|
|
13809
13910
|
return true;
|
|
13810
|
-
} catch (
|
|
13911
|
+
} catch (e5) {
|
|
13811
13912
|
return false;
|
|
13812
13913
|
}
|
|
13813
13914
|
}
|
|
@@ -13819,7 +13920,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
13819
13920
|
sourceBranch: branch,
|
|
13820
13921
|
state: "opened"
|
|
13821
13922
|
});
|
|
13822
|
-
return _optionalChain([mergeRequests, 'access',
|
|
13923
|
+
return _optionalChain([mergeRequests, 'access', _406 => _406[0], 'optionalAccess', _407 => _407.iid]);
|
|
13823
13924
|
}
|
|
13824
13925
|
async closePullRequest({
|
|
13825
13926
|
pullRequestNumber
|
|
@@ -13931,7 +14032,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
13931
14032
|
}
|
|
13932
14033
|
const env = {
|
|
13933
14034
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
13934
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
14035
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _408 => _408.pullRequest, 'optionalAccess', _409 => _409.toString, 'call', _410 => _410()]) || "false",
|
|
13935
14036
|
...options.commitMessage && {
|
|
13936
14037
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
13937
14038
|
},
|
|
@@ -13957,7 +14058,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
13957
14058
|
const { isPullRequestMode } = platformKit.config;
|
|
13958
14059
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
13959
14060
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
13960
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
14061
|
+
const canRun = await _optionalChain([flow, 'access', _411 => _411.preRun, 'optionalCall', _412 => _412()]);
|
|
13961
14062
|
if (canRun === false) {
|
|
13962
14063
|
return;
|
|
13963
14064
|
}
|
|
@@ -13967,7 +14068,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
13967
14068
|
if (!hasChanges) {
|
|
13968
14069
|
return;
|
|
13969
14070
|
}
|
|
13970
|
-
await _optionalChain([flow, 'access',
|
|
14071
|
+
await _optionalChain([flow, 'access', _413 => _413.postRun, 'optionalCall', _414 => _414()]);
|
|
13971
14072
|
});
|
|
13972
14073
|
function parseBooleanArg(val) {
|
|
13973
14074
|
if (val === true) return true;
|
|
@@ -14004,8 +14105,8 @@ function exitGracefully(elapsedMs = 0) {
|
|
|
14004
14105
|
}
|
|
14005
14106
|
}
|
|
14006
14107
|
function checkForPendingOperations() {
|
|
14007
|
-
const activeHandles = _optionalChain([process, 'access',
|
|
14008
|
-
const activeRequests = _optionalChain([process, 'access',
|
|
14108
|
+
const activeHandles = _optionalChain([process, 'access', _415 => _415._getActiveHandles, 'optionalCall', _416 => _416()]) || [];
|
|
14109
|
+
const activeRequests = _optionalChain([process, 'access', _417 => _417._getActiveRequests, 'optionalCall', _418 => _418()]) || [];
|
|
14009
14110
|
const nonStandardHandles = activeHandles.filter((handle) => {
|
|
14010
14111
|
if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
|
|
14011
14112
|
return false;
|
|
@@ -14069,22 +14170,22 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14069
14170
|
ora.start("Validating localization configuration...");
|
|
14070
14171
|
validateParams2(i18nConfig, flags);
|
|
14071
14172
|
ora.succeed("Localization configuration is valid");
|
|
14072
|
-
trackEvent(authId
|
|
14173
|
+
trackEvent(authId, "cmd.status.start", {
|
|
14073
14174
|
i18nConfig,
|
|
14074
14175
|
flags
|
|
14075
14176
|
});
|
|
14076
14177
|
let buckets = getBuckets(i18nConfig);
|
|
14077
|
-
if (_optionalChain([flags, 'access',
|
|
14178
|
+
if (_optionalChain([flags, 'access', _419 => _419.bucket, 'optionalAccess', _420 => _420.length])) {
|
|
14078
14179
|
buckets = buckets.filter(
|
|
14079
14180
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
14080
14181
|
);
|
|
14081
14182
|
}
|
|
14082
14183
|
ora.succeed("Buckets retrieved");
|
|
14083
|
-
if (_optionalChain([flags, 'access',
|
|
14184
|
+
if (_optionalChain([flags, 'access', _421 => _421.file, 'optionalAccess', _422 => _422.length])) {
|
|
14084
14185
|
buckets = buckets.map((bucket) => {
|
|
14085
14186
|
const paths = bucket.paths.filter(
|
|
14086
14187
|
(path19) => flags.file.find(
|
|
14087
|
-
(file) => _optionalChain([path19, 'access',
|
|
14188
|
+
(file) => _optionalChain([path19, 'access', _423 => _423.pathPattern, 'optionalAccess', _424 => _424.includes, 'call', _425 => _425(file)]) || _optionalChain([path19, 'access', _426 => _426.pathPattern, 'optionalAccess', _427 => _427.match, 'call', _428 => _428(file)]) || minimatch(path19.pathPattern, file)
|
|
14088
14189
|
)
|
|
14089
14190
|
);
|
|
14090
14191
|
return { ...bucket, paths };
|
|
@@ -14104,7 +14205,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14104
14205
|
});
|
|
14105
14206
|
}
|
|
14106
14207
|
}
|
|
14107
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
14208
|
+
const targetLocales = _optionalChain([flags, 'access', _429 => _429.locale, 'optionalAccess', _430 => _430.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
14108
14209
|
let totalSourceKeyCount = 0;
|
|
14109
14210
|
let uniqueKeysToTranslate = 0;
|
|
14110
14211
|
let totalExistingTranslations = 0;
|
|
@@ -14456,7 +14557,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14456
14557
|
`\u2022 Try 'lingo.dev@latest i18n --locale ${targetLocales[0]}' to process just one language`
|
|
14457
14558
|
);
|
|
14458
14559
|
}
|
|
14459
|
-
trackEvent(authId
|
|
14560
|
+
trackEvent(authId, "cmd.status.success", {
|
|
14460
14561
|
i18nConfig,
|
|
14461
14562
|
flags,
|
|
14462
14563
|
totalSourceKeyCount,
|
|
@@ -14467,7 +14568,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
14467
14568
|
exitGracefully();
|
|
14468
14569
|
} catch (error) {
|
|
14469
14570
|
ora.fail(error.message);
|
|
14470
|
-
trackEvent(authId
|
|
14571
|
+
trackEvent(authId, "cmd.status.error", {
|
|
14471
14572
|
flags,
|
|
14472
14573
|
error: error.message,
|
|
14473
14574
|
authenticated: !!authId
|
|
@@ -14512,12 +14613,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
14512
14613
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
14513
14614
|
docUrl: "bucketNotFound"
|
|
14514
14615
|
});
|
|
14515
|
-
} else if (_optionalChain([flags, 'access',
|
|
14616
|
+
} else if (_optionalChain([flags, 'access', _431 => _431.locale, 'optionalAccess', _432 => _432.some, 'call', _433 => _433((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
14516
14617
|
throw new CLIError({
|
|
14517
14618
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
14518
14619
|
docUrl: "localeTargetNotFound"
|
|
14519
14620
|
});
|
|
14520
|
-
} else if (_optionalChain([flags, 'access',
|
|
14621
|
+
} else if (_optionalChain([flags, 'access', _434 => _434.bucket, 'optionalAccess', _435 => _435.some, 'call', _436 => _436(
|
|
14521
14622
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
14522
14623
|
)])) {
|
|
14523
14624
|
throw new CLIError({
|
|
@@ -14609,7 +14710,7 @@ async function renderHero2() {
|
|
|
14609
14710
|
// package.json
|
|
14610
14711
|
var package_default = {
|
|
14611
14712
|
name: "lingo.dev",
|
|
14612
|
-
version: "0.117.
|
|
14713
|
+
version: "0.117.18",
|
|
14613
14714
|
description: "Lingo.dev CLI",
|
|
14614
14715
|
private: false,
|
|
14615
14716
|
repository: {
|
|
@@ -14911,7 +15012,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
|
|
|
14911
15012
|
if (options.file && options.file.length) {
|
|
14912
15013
|
buckets = buckets.map((bucket) => {
|
|
14913
15014
|
const paths = bucket.paths.filter(
|
|
14914
|
-
(bucketPath) => _optionalChain([options, 'access',
|
|
15015
|
+
(bucketPath) => _optionalChain([options, 'access', _437 => _437.file, 'optionalAccess', _438 => _438.some, 'call', _439 => _439((f) => bucketPath.pathPattern.includes(f))])
|
|
14915
15016
|
);
|
|
14916
15017
|
return { ...bucket, paths };
|
|
14917
15018
|
}).filter((bucket) => bucket.paths.length > 0);
|