lingo.dev 0.92.13 → 0.92.15
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 +158 -96
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +105 -43
- package/build/cli.mjs.map +1 -1
- package/package.json +3 -3
package/build/cli.mjs
CHANGED
|
@@ -1025,7 +1025,7 @@ import {
|
|
|
1025
1025
|
} from "@lingo.dev/_spec";
|
|
1026
1026
|
import { Command as Command6 } from "interactive-commander";
|
|
1027
1027
|
import Z3 from "zod";
|
|
1028
|
-
import
|
|
1028
|
+
import _26 from "lodash";
|
|
1029
1029
|
import Ora5 from "ora";
|
|
1030
1030
|
|
|
1031
1031
|
// src/cli/loaders/_utils.ts
|
|
@@ -1249,7 +1249,7 @@ function createTextFileLoader(pathPattern) {
|
|
|
1249
1249
|
const trimmedResult = result.trim();
|
|
1250
1250
|
return trimmedResult;
|
|
1251
1251
|
},
|
|
1252
|
-
async push(locale, data,
|
|
1252
|
+
async push(locale, data, _30, originalLocale) {
|
|
1253
1253
|
const draftPath = pathPattern.replaceAll("[locale]", locale);
|
|
1254
1254
|
const finalPath = path10.resolve(draftPath);
|
|
1255
1255
|
const dirPath = path10.dirname(finalPath);
|
|
@@ -1778,7 +1778,7 @@ function createPropertiesLoader() {
|
|
|
1778
1778
|
return result;
|
|
1779
1779
|
},
|
|
1780
1780
|
async push(locale, payload) {
|
|
1781
|
-
const result = Object.entries(payload).filter(([
|
|
1781
|
+
const result = Object.entries(payload).filter(([_30, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
|
|
1782
1782
|
return result;
|
|
1783
1783
|
}
|
|
1784
1784
|
});
|
|
@@ -2045,10 +2045,10 @@ function createUnlocalizableLoader(isCacheRestore = false, returnUnlocalizedKeys
|
|
|
2045
2045
|
}
|
|
2046
2046
|
}
|
|
2047
2047
|
return false;
|
|
2048
|
-
}).map(([key,
|
|
2049
|
-
const result = _10.omitBy(input2, (
|
|
2048
|
+
}).map(([key, _30]) => key);
|
|
2049
|
+
const result = _10.omitBy(input2, (_30, key) => passthroughKeys.includes(key));
|
|
2050
2050
|
if (returnUnlocalizedKeys) {
|
|
2051
|
-
result.unlocalizable = _10.omitBy(input2, (
|
|
2051
|
+
result.unlocalizable = _10.omitBy(input2, (_30, key) => !passthroughKeys.includes(key));
|
|
2052
2052
|
}
|
|
2053
2053
|
return result;
|
|
2054
2054
|
},
|
|
@@ -4005,8 +4005,24 @@ function createLingoLocalizer(params) {
|
|
|
4005
4005
|
|
|
4006
4006
|
// src/cli/processor/basic.ts
|
|
4007
4007
|
import { generateText } from "ai";
|
|
4008
|
+
import _24 from "lodash";
|
|
4008
4009
|
function createBasicTranslator(model, systemPrompt) {
|
|
4009
4010
|
return async (input2, onProgress) => {
|
|
4011
|
+
const chunks = extractPayloadChunks(input2.processableData);
|
|
4012
|
+
const subResults = [];
|
|
4013
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
4014
|
+
const chunk = chunks[i];
|
|
4015
|
+
const result2 = await doJob({
|
|
4016
|
+
...input2,
|
|
4017
|
+
processableData: chunk
|
|
4018
|
+
});
|
|
4019
|
+
subResults.push(result2);
|
|
4020
|
+
onProgress(i / chunks.length * 100, chunk, result2);
|
|
4021
|
+
}
|
|
4022
|
+
const result = _24.merge({}, ...subResults);
|
|
4023
|
+
return result;
|
|
4024
|
+
};
|
|
4025
|
+
async function doJob(input2) {
|
|
4010
4026
|
if (!Object.keys(input2.processableData).length) {
|
|
4011
4027
|
return input2.processableData;
|
|
4012
4028
|
}
|
|
@@ -4052,7 +4068,41 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
4052
4068
|
});
|
|
4053
4069
|
const result = JSON.parse(response.text);
|
|
4054
4070
|
return result?.data || {};
|
|
4055
|
-
}
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
function extractPayloadChunks(payload) {
|
|
4074
|
+
const idealBatchItemSize = 250;
|
|
4075
|
+
const batchSize = 25;
|
|
4076
|
+
const result = [];
|
|
4077
|
+
let currentChunk = {};
|
|
4078
|
+
let currentChunkItemCount = 0;
|
|
4079
|
+
const payloadEntries = Object.entries(payload);
|
|
4080
|
+
for (let i = 0; i < payloadEntries.length; i++) {
|
|
4081
|
+
const [key, value] = payloadEntries[i];
|
|
4082
|
+
currentChunk[key] = value;
|
|
4083
|
+
currentChunkItemCount++;
|
|
4084
|
+
const currentChunkSize = countWordsInRecord(currentChunk);
|
|
4085
|
+
if (currentChunkSize > idealBatchItemSize || currentChunkItemCount >= batchSize || i === payloadEntries.length - 1) {
|
|
4086
|
+
result.push(currentChunk);
|
|
4087
|
+
currentChunk = {};
|
|
4088
|
+
currentChunkItemCount = 0;
|
|
4089
|
+
}
|
|
4090
|
+
}
|
|
4091
|
+
return result;
|
|
4092
|
+
}
|
|
4093
|
+
function countWordsInRecord(payload) {
|
|
4094
|
+
if (Array.isArray(payload)) {
|
|
4095
|
+
return payload.reduce((acc, item) => acc + countWordsInRecord(item), 0);
|
|
4096
|
+
} else if (typeof payload === "object" && payload !== null) {
|
|
4097
|
+
return Object.values(payload).reduce(
|
|
4098
|
+
(acc, item) => acc + countWordsInRecord(item),
|
|
4099
|
+
0
|
|
4100
|
+
);
|
|
4101
|
+
} else if (typeof payload === "string") {
|
|
4102
|
+
return payload.trim().split(/\s+/).filter(Boolean).length;
|
|
4103
|
+
} else {
|
|
4104
|
+
return 0;
|
|
4105
|
+
}
|
|
4056
4106
|
}
|
|
4057
4107
|
|
|
4058
4108
|
// src/cli/processor/index.ts
|
|
@@ -4178,7 +4228,7 @@ async function trackEvent(distinctId, event, properties) {
|
|
|
4178
4228
|
}
|
|
4179
4229
|
|
|
4180
4230
|
// src/cli/utils/delta.ts
|
|
4181
|
-
import
|
|
4231
|
+
import _25 from "lodash";
|
|
4182
4232
|
import z from "zod";
|
|
4183
4233
|
|
|
4184
4234
|
// src/cli/utils/fs.ts
|
|
@@ -4227,9 +4277,9 @@ function createDeltaProcessor(fileKey) {
|
|
|
4227
4277
|
return checkIfFileExists(lockfilePath);
|
|
4228
4278
|
},
|
|
4229
4279
|
async calculateDelta(params) {
|
|
4230
|
-
let added =
|
|
4231
|
-
let removed =
|
|
4232
|
-
const updated =
|
|
4280
|
+
let added = _25.difference(Object.keys(params.sourceData), Object.keys(params.targetData));
|
|
4281
|
+
let removed = _25.difference(Object.keys(params.targetData), Object.keys(params.sourceData));
|
|
4282
|
+
const updated = _25.filter(Object.keys(params.sourceData), (key) => {
|
|
4233
4283
|
return md5(params.sourceData[key]) !== params.checksums[key] && params.checksums[key];
|
|
4234
4284
|
});
|
|
4235
4285
|
const renamed = [];
|
|
@@ -4278,7 +4328,7 @@ function createDeltaProcessor(fileKey) {
|
|
|
4278
4328
|
await this.saveLock(lockfileData);
|
|
4279
4329
|
},
|
|
4280
4330
|
async createChecksums(sourceData) {
|
|
4281
|
-
const checksums =
|
|
4331
|
+
const checksums = _25.mapValues(sourceData, (value) => md5(value));
|
|
4282
4332
|
return checksums;
|
|
4283
4333
|
}
|
|
4284
4334
|
};
|
|
@@ -4450,7 +4500,7 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4450
4500
|
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
4451
4501
|
const sourceChecksums = await deltaProcessor.createChecksums(sourceData);
|
|
4452
4502
|
const savedChecksums = await deltaProcessor.loadChecksums();
|
|
4453
|
-
const updatedSourceData =
|
|
4503
|
+
const updatedSourceData = _26.pickBy(
|
|
4454
4504
|
sourceData,
|
|
4455
4505
|
(value, key) => sourceChecksums[key] !== savedChecksums[key]
|
|
4456
4506
|
);
|
|
@@ -4464,15 +4514,15 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4464
4514
|
bucketPath.delimiter
|
|
4465
4515
|
);
|
|
4466
4516
|
const { unlocalizable: targetUnlocalizable, ...targetData } = await bucketLoader.pull(targetLocale);
|
|
4467
|
-
const missingKeys =
|
|
4517
|
+
const missingKeys = _26.difference(
|
|
4468
4518
|
Object.keys(sourceData),
|
|
4469
4519
|
Object.keys(targetData)
|
|
4470
4520
|
);
|
|
4471
|
-
const extraKeys =
|
|
4521
|
+
const extraKeys = _26.difference(
|
|
4472
4522
|
Object.keys(targetData),
|
|
4473
4523
|
Object.keys(sourceData)
|
|
4474
4524
|
);
|
|
4475
|
-
const unlocalizableDataDiff = !
|
|
4525
|
+
const unlocalizableDataDiff = !_26.isEqual(
|
|
4476
4526
|
sourceUnlocalizable,
|
|
4477
4527
|
targetUnlocalizable
|
|
4478
4528
|
);
|
|
@@ -4554,13 +4604,13 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4554
4604
|
targetData,
|
|
4555
4605
|
checksums: checksums2
|
|
4556
4606
|
});
|
|
4557
|
-
let processableData =
|
|
4607
|
+
let processableData = _26.chain(sourceData).entries().filter(
|
|
4558
4608
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!flags.force
|
|
4559
4609
|
).fromPairs().value();
|
|
4560
4610
|
if (flags.key) {
|
|
4561
|
-
processableData =
|
|
4611
|
+
processableData = _26.pickBy(
|
|
4562
4612
|
processableData,
|
|
4563
|
-
(
|
|
4613
|
+
(_30, key) => key === flags.key
|
|
4564
4614
|
);
|
|
4565
4615
|
}
|
|
4566
4616
|
if (flags.verbose) {
|
|
@@ -4593,13 +4643,13 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4593
4643
|
if (flags.verbose) {
|
|
4594
4644
|
bucketOra.info(JSON.stringify(processedTargetData, null, 2));
|
|
4595
4645
|
}
|
|
4596
|
-
let finalTargetData =
|
|
4646
|
+
let finalTargetData = _26.merge(
|
|
4597
4647
|
{},
|
|
4598
4648
|
sourceData,
|
|
4599
4649
|
targetData,
|
|
4600
4650
|
processedTargetData
|
|
4601
4651
|
);
|
|
4602
|
-
finalTargetData =
|
|
4652
|
+
finalTargetData = _26.chain(finalTargetData).entries().map(([key, value]) => {
|
|
4603
4653
|
const renaming = delta.renamed.find(
|
|
4604
4654
|
([oldKey, newKey]) => oldKey === key
|
|
4605
4655
|
);
|
|
@@ -4623,7 +4673,7 @@ var i18n_default = new Command6().command("i18n").description("Run Localization
|
|
|
4623
4673
|
`Applying changes to ${bucketPath} (${targetLocale})`
|
|
4624
4674
|
);
|
|
4625
4675
|
}
|
|
4626
|
-
const finalDiffSize =
|
|
4676
|
+
const finalDiffSize = _26.chain(finalTargetData).omitBy((value, key) => value === targetData[key]).size().value();
|
|
4627
4677
|
await bucketLoader.push(targetLocale, finalTargetData);
|
|
4628
4678
|
if (finalDiffSize > 0 || flags.force) {
|
|
4629
4679
|
bucketOra.succeed(
|
|
@@ -4794,7 +4844,7 @@ Reviewing changes for ${chalk2.blue(args.pathPattern)} (${chalk2.yellow(args.tar
|
|
|
4794
4844
|
return args.currentData;
|
|
4795
4845
|
}
|
|
4796
4846
|
const customData = { ...args.currentData };
|
|
4797
|
-
const changes =
|
|
4847
|
+
const changes = _26.reduce(
|
|
4798
4848
|
args.proposedData,
|
|
4799
4849
|
(result, value, key) => {
|
|
4800
4850
|
if (args.currentData[key] !== value) {
|
|
@@ -4867,7 +4917,7 @@ import path14 from "path";
|
|
|
4867
4917
|
import Z4 from "zod";
|
|
4868
4918
|
import YAML5 from "yaml";
|
|
4869
4919
|
import { MD5 as MD52 } from "object-hash";
|
|
4870
|
-
import
|
|
4920
|
+
import _27 from "lodash";
|
|
4871
4921
|
function createLockfileHelper() {
|
|
4872
4922
|
return {
|
|
4873
4923
|
isLockfileExists: () => {
|
|
@@ -4877,23 +4927,23 @@ function createLockfileHelper() {
|
|
|
4877
4927
|
registerSourceData: (pathPattern, sourceData) => {
|
|
4878
4928
|
const lockfile = _loadLockfile();
|
|
4879
4929
|
const sectionKey = MD52(pathPattern);
|
|
4880
|
-
const sectionChecksums =
|
|
4930
|
+
const sectionChecksums = _27.mapValues(sourceData, (value) => MD52(value));
|
|
4881
4931
|
lockfile.checksums[sectionKey] = sectionChecksums;
|
|
4882
4932
|
_saveLockfile(lockfile);
|
|
4883
4933
|
},
|
|
4884
4934
|
registerPartialSourceData: (pathPattern, partialSourceData) => {
|
|
4885
4935
|
const lockfile = _loadLockfile();
|
|
4886
4936
|
const sectionKey = MD52(pathPattern);
|
|
4887
|
-
const sectionChecksums =
|
|
4888
|
-
lockfile.checksums[sectionKey] =
|
|
4937
|
+
const sectionChecksums = _27.mapValues(partialSourceData, (value) => MD52(value));
|
|
4938
|
+
lockfile.checksums[sectionKey] = _27.merge({}, lockfile.checksums[sectionKey] ?? {}, sectionChecksums);
|
|
4889
4939
|
_saveLockfile(lockfile);
|
|
4890
4940
|
},
|
|
4891
4941
|
extractUpdatedData: (pathPattern, sourceData) => {
|
|
4892
4942
|
const lockfile = _loadLockfile();
|
|
4893
4943
|
const sectionKey = MD52(pathPattern);
|
|
4894
|
-
const currentChecksums =
|
|
4944
|
+
const currentChecksums = _27.mapValues(sourceData, (value) => MD52(value));
|
|
4895
4945
|
const savedChecksums = lockfile.checksums[sectionKey] || {};
|
|
4896
|
-
const updatedData =
|
|
4946
|
+
const updatedData = _27.pickBy(sourceData, (value, key) => savedChecksums[key] !== currentChecksums[key]);
|
|
4897
4947
|
return updatedData;
|
|
4898
4948
|
}
|
|
4899
4949
|
};
|
|
@@ -4963,7 +5013,7 @@ var flagsSchema = Z5.object({
|
|
|
4963
5013
|
// src/cli/cmd/cleanup.ts
|
|
4964
5014
|
import { resolveOverriddenLocale as resolveOverriddenLocale5 } from "@lingo.dev/_spec";
|
|
4965
5015
|
import { Command as Command8 } from "interactive-commander";
|
|
4966
|
-
import
|
|
5016
|
+
import _28 from "lodash";
|
|
4967
5017
|
import Ora7 from "ora";
|
|
4968
5018
|
var cleanup_default = new Command8().command("cleanup").description("Remove keys from target files that do not exist in the source file").helpOption("-h, --help", "Show help").option("--locale <locale>", "Specific locale to cleanup").option("--bucket <bucket>", "Specific bucket to cleanup").option("--dry-run", "Show what would be removed without making changes").option(
|
|
4969
5019
|
"--verbose",
|
|
@@ -4999,7 +5049,7 @@ var cleanup_default = new Command8().command("cleanup").description("Remove keys
|
|
|
4999
5049
|
try {
|
|
5000
5050
|
const targetData = await bucketLoader.pull(targetLocale);
|
|
5001
5051
|
const targetKeys = Object.keys(targetData);
|
|
5002
|
-
const keysToRemove =
|
|
5052
|
+
const keysToRemove = _28.difference(targetKeys, sourceKeys);
|
|
5003
5053
|
if (keysToRemove.length === 0) {
|
|
5004
5054
|
bucketOra.succeed(`[${targetLocale}] No keys to remove`);
|
|
5005
5055
|
continue;
|
|
@@ -5008,7 +5058,7 @@ var cleanup_default = new Command8().command("cleanup").description("Remove keys
|
|
|
5008
5058
|
bucketOra.info(`[${targetLocale}] Keys to remove: ${JSON.stringify(keysToRemove, null, 2)}`);
|
|
5009
5059
|
}
|
|
5010
5060
|
if (!options.dryRun) {
|
|
5011
|
-
const cleanedData =
|
|
5061
|
+
const cleanedData = _28.pick(targetData, sourceKeys);
|
|
5012
5062
|
await bucketLoader.push(targetLocale, cleanedData);
|
|
5013
5063
|
bucketOra.succeed(`[${targetLocale}] Removed ${keysToRemove.length} keys`);
|
|
5014
5064
|
} else {
|
|
@@ -5063,7 +5113,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
5063
5113
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5064
5114
|
import Z6 from "zod";
|
|
5065
5115
|
import { ReplexicaEngine } from "@lingo.dev/_sdk";
|
|
5066
|
-
var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (
|
|
5116
|
+
var mcp_default = new Command9().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_30, program) => {
|
|
5067
5117
|
const apiKey = program.args[0];
|
|
5068
5118
|
const settings = getSettings(apiKey);
|
|
5069
5119
|
if (!settings.auth.apiKey) {
|
|
@@ -6317,7 +6367,7 @@ async function renderHero() {
|
|
|
6317
6367
|
// package.json
|
|
6318
6368
|
var package_default = {
|
|
6319
6369
|
name: "lingo.dev",
|
|
6320
|
-
version: "0.92.
|
|
6370
|
+
version: "0.92.15",
|
|
6321
6371
|
description: "Lingo.dev CLI",
|
|
6322
6372
|
private: false,
|
|
6323
6373
|
publishConfig: {
|
|
@@ -6565,6 +6615,7 @@ import { createOpenAI as createOpenAI2 } from "@ai-sdk/openai";
|
|
|
6565
6615
|
import chalk7 from "chalk";
|
|
6566
6616
|
import dedent3 from "dedent";
|
|
6567
6617
|
import { generateText as generateText2 } from "ai";
|
|
6618
|
+
import { jsonrepair as jsonrepair3 } from "jsonrepair";
|
|
6568
6619
|
function createExplicitLocalizer(provider) {
|
|
6569
6620
|
switch (provider.id) {
|
|
6570
6621
|
default:
|
|
@@ -6674,7 +6725,12 @@ function createAiSdkLocalizer(params) {
|
|
|
6674
6725
|
]
|
|
6675
6726
|
});
|
|
6676
6727
|
const result = JSON.parse(response.text);
|
|
6677
|
-
|
|
6728
|
+
const index = result.data.indexOf("{");
|
|
6729
|
+
const lastIndex = result.data.lastIndexOf("}");
|
|
6730
|
+
const trimmed = result.data.slice(index, lastIndex + 1);
|
|
6731
|
+
const repaired = jsonrepair3(trimmed);
|
|
6732
|
+
const finalResult = JSON.parse(repaired);
|
|
6733
|
+
return finalResult.data;
|
|
6678
6734
|
}
|
|
6679
6735
|
};
|
|
6680
6736
|
}
|
|
@@ -6885,7 +6941,7 @@ async function plan(input2) {
|
|
|
6885
6941
|
import chalk10 from "chalk";
|
|
6886
6942
|
import { Listr as Listr3 } from "listr2";
|
|
6887
6943
|
import pLimit from "p-limit";
|
|
6888
|
-
import
|
|
6944
|
+
import _29 from "lodash";
|
|
6889
6945
|
var MAX_WORKER_COUNT = 10;
|
|
6890
6946
|
async function execute(input2) {
|
|
6891
6947
|
const effectiveConcurrency = Math.min(
|
|
@@ -6916,7 +6972,7 @@ async function execute(input2) {
|
|
|
6916
6972
|
const workerTasks = [];
|
|
6917
6973
|
for (let i = 0; i < workersCount; i++) {
|
|
6918
6974
|
const assignedTasks = ctx.tasks.filter(
|
|
6919
|
-
(
|
|
6975
|
+
(_30, idx) => idx % workersCount === i
|
|
6920
6976
|
);
|
|
6921
6977
|
workerTasks.push(
|
|
6922
6978
|
createWorkerTask({
|
|
@@ -7015,7 +7071,7 @@ function createWorkerTask(args) {
|
|
|
7015
7071
|
targetData,
|
|
7016
7072
|
checksums
|
|
7017
7073
|
});
|
|
7018
|
-
const processableData =
|
|
7074
|
+
const processableData = _29.chain(sourceData).entries().filter(
|
|
7019
7075
|
([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
|
|
7020
7076
|
).fromPairs().value();
|
|
7021
7077
|
if (!Object.keys(processableData).length) {
|
|
@@ -7036,13 +7092,13 @@ function createWorkerTask(args) {
|
|
|
7036
7092
|
});
|
|
7037
7093
|
}
|
|
7038
7094
|
);
|
|
7039
|
-
let finalTargetData =
|
|
7095
|
+
let finalTargetData = _29.merge(
|
|
7040
7096
|
{},
|
|
7041
7097
|
sourceData,
|
|
7042
7098
|
targetData,
|
|
7043
7099
|
processedTargetData
|
|
7044
7100
|
);
|
|
7045
|
-
finalTargetData =
|
|
7101
|
+
finalTargetData = _29.chain(finalTargetData).entries().map(([key, value]) => {
|
|
7046
7102
|
const renaming = delta.renamed.find(
|
|
7047
7103
|
([oldKey]) => oldKey === key
|
|
7048
7104
|
);
|
|
@@ -7162,11 +7218,17 @@ async function waitForUserPrompt(message) {
|
|
|
7162
7218
|
}
|
|
7163
7219
|
async function renderSummary(ctx) {
|
|
7164
7220
|
console.log(chalk11.hex(colors.green)("[Done]"));
|
|
7165
|
-
const skippedTasksCount = ctx.results.values().filter(
|
|
7221
|
+
const skippedTasksCount = Array.from(ctx.results.values()).filter(
|
|
7222
|
+
(r) => r.status === "skipped"
|
|
7223
|
+
).length;
|
|
7166
7224
|
console.log(`\u2022 ${chalk11.hex(colors.yellow)(skippedTasksCount)} from cache`);
|
|
7167
|
-
const succeededTasksCount = ctx.results.values().filter(
|
|
7225
|
+
const succeededTasksCount = Array.from(ctx.results.values()).filter(
|
|
7226
|
+
(r) => r.status === "success"
|
|
7227
|
+
).length;
|
|
7168
7228
|
console.log(`\u2022 ${chalk11.hex(colors.yellow)(succeededTasksCount)} processed`);
|
|
7169
|
-
const failedTasksCount = ctx.results.values().filter(
|
|
7229
|
+
const failedTasksCount = Array.from(ctx.results.values()).filter(
|
|
7230
|
+
(r) => r.status === "error"
|
|
7231
|
+
).length;
|
|
7170
7232
|
console.log(`\u2022 ${chalk11.hex(colors.yellow)(failedTasksCount)} failed`);
|
|
7171
7233
|
}
|
|
7172
7234
|
|