lingo.dev 0.83.0 → 0.85.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 +531 -29
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +531 -29
- package/build/cli.mjs.map +1 -1
- package/package.json +4 -3
package/build/cli.cjs
CHANGED
|
@@ -1635,9 +1635,9 @@ var _remarkgfm = require('remark-gfm'); var _remarkgfm2 = _interopRequireDefault
|
|
|
1635
1635
|
var _remarkstringify = require('remark-stringify'); var _remarkstringify2 = _interopRequireDefault(_remarkstringify);
|
|
1636
1636
|
var _remarkmdxfrontmatter = require('remark-mdx-frontmatter'); var _remarkmdxfrontmatter2 = _interopRequireDefault(_remarkmdxfrontmatter);
|
|
1637
1637
|
var _vfile = require('vfile');
|
|
1638
|
+
var parser = _unified.unified.call(void 0, ).use(_remarkparse2.default).use(_remarkmdx2.default).use(_remarkfrontmatter2.default, ["yaml"]).use(_remarkmdxfrontmatter2.default).use(_remarkgfm2.default);
|
|
1639
|
+
var serializer = _unified.unified.call(void 0, ).use(_remarkstringify2.default).use(_remarkmdx2.default).use(_remarkfrontmatter2.default, ["yaml"]).use(_remarkmdxfrontmatter2.default).use(_remarkgfm2.default);
|
|
1638
1640
|
function createMdxFormatLoader() {
|
|
1639
|
-
const parser = _unified.unified.call(void 0, ).use(_remarkparse2.default).use(_remarkmdx2.default).use(_remarkfrontmatter2.default, ["yaml"]).use(_remarkmdxfrontmatter2.default).use(_remarkgfm2.default);
|
|
1640
|
-
const serializer = _unified.unified.call(void 0, ).use(_remarkstringify2.default).use(_remarkmdx2.default).use(_remarkfrontmatter2.default, ["yaml"]).use(_remarkmdxfrontmatter2.default).use(_remarkgfm2.default);
|
|
1641
1641
|
return createLoader({
|
|
1642
1642
|
async pull(locale, input2) {
|
|
1643
1643
|
const file = new (0, _vfile.VFile)(input2);
|
|
@@ -1646,8 +1646,21 @@ function createMdxFormatLoader() {
|
|
|
1646
1646
|
},
|
|
1647
1647
|
async push(locale, data) {
|
|
1648
1648
|
const ast = data;
|
|
1649
|
-
const
|
|
1650
|
-
return
|
|
1649
|
+
const content = String(serializer.stringify(ast));
|
|
1650
|
+
return content;
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
function createDoubleSerializationLoader() {
|
|
1655
|
+
return createLoader({
|
|
1656
|
+
async pull(locale, input2) {
|
|
1657
|
+
return input2;
|
|
1658
|
+
},
|
|
1659
|
+
async push(locale, data) {
|
|
1660
|
+
const file = new (0, _vfile.VFile)(data);
|
|
1661
|
+
const ast = parser.parse(file);
|
|
1662
|
+
const finalContent = String(serializer.stringify(ast));
|
|
1663
|
+
return finalContent;
|
|
1651
1664
|
}
|
|
1652
1665
|
});
|
|
1653
1666
|
}
|
|
@@ -2092,10 +2105,10 @@ function createXmlLoader() {
|
|
|
2092
2105
|
// src/cli/loaders/srt.ts
|
|
2093
2106
|
var _srtparser2 = require('srt-parser-2'); var _srtparser22 = _interopRequireDefault(_srtparser2);
|
|
2094
2107
|
function createSrtLoader() {
|
|
2095
|
-
const
|
|
2108
|
+
const parser2 = new (0, _srtparser22.default)();
|
|
2096
2109
|
return createLoader({
|
|
2097
2110
|
async pull(locale, input2) {
|
|
2098
|
-
const parsed =
|
|
2111
|
+
const parsed = parser2.fromSrt(input2) || [];
|
|
2099
2112
|
const result = {};
|
|
2100
2113
|
parsed.forEach((entry) => {
|
|
2101
2114
|
const key = `${entry.id}#${entry.startTime}-${entry.endTime}`;
|
|
@@ -2116,7 +2129,7 @@ function createSrtLoader() {
|
|
|
2116
2129
|
text
|
|
2117
2130
|
};
|
|
2118
2131
|
});
|
|
2119
|
-
const srtContent =
|
|
2132
|
+
const srtContent = parser2.toSrt(output).trim().replace(/\r?\n/g, "\n");
|
|
2120
2133
|
return srtContent;
|
|
2121
2134
|
}
|
|
2122
2135
|
});
|
|
@@ -3075,7 +3088,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3075
3088
|
createAndroidLoader(),
|
|
3076
3089
|
createFlatLoader(),
|
|
3077
3090
|
createSyncLoader(),
|
|
3078
|
-
createUnlocalizableLoader(
|
|
3091
|
+
createUnlocalizableLoader(
|
|
3092
|
+
options.isCacheRestore,
|
|
3093
|
+
options.returnUnlocalizedKeys
|
|
3094
|
+
)
|
|
3079
3095
|
);
|
|
3080
3096
|
case "csv":
|
|
3081
3097
|
return composeLoaders(
|
|
@@ -3083,7 +3099,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3083
3099
|
createCsvLoader(),
|
|
3084
3100
|
createFlatLoader(),
|
|
3085
3101
|
createSyncLoader(),
|
|
3086
|
-
createUnlocalizableLoader(
|
|
3102
|
+
createUnlocalizableLoader(
|
|
3103
|
+
options.isCacheRestore,
|
|
3104
|
+
options.returnUnlocalizedKeys
|
|
3105
|
+
)
|
|
3087
3106
|
);
|
|
3088
3107
|
case "html":
|
|
3089
3108
|
return composeLoaders(
|
|
@@ -3091,7 +3110,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3091
3110
|
createPrettierLoader({ parser: "html", bucketPathPattern }),
|
|
3092
3111
|
createHtmlLoader(),
|
|
3093
3112
|
createSyncLoader(),
|
|
3094
|
-
createUnlocalizableLoader(
|
|
3113
|
+
createUnlocalizableLoader(
|
|
3114
|
+
options.isCacheRestore,
|
|
3115
|
+
options.returnUnlocalizedKeys
|
|
3116
|
+
)
|
|
3095
3117
|
);
|
|
3096
3118
|
case "json":
|
|
3097
3119
|
return composeLoaders(
|
|
@@ -3102,7 +3124,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3102
3124
|
createFlatLoader(),
|
|
3103
3125
|
createLockedKeysLoader(lockedKeys || [], options.isCacheRestore),
|
|
3104
3126
|
createSyncLoader(),
|
|
3105
|
-
createUnlocalizableLoader(
|
|
3127
|
+
createUnlocalizableLoader(
|
|
3128
|
+
options.isCacheRestore,
|
|
3129
|
+
options.returnUnlocalizedKeys
|
|
3130
|
+
)
|
|
3106
3131
|
);
|
|
3107
3132
|
case "markdown":
|
|
3108
3133
|
return composeLoaders(
|
|
@@ -3110,7 +3135,24 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3110
3135
|
createPrettierLoader({ parser: "markdown", bucketPathPattern }),
|
|
3111
3136
|
createMarkdownLoader(),
|
|
3112
3137
|
createSyncLoader(),
|
|
3113
|
-
createUnlocalizableLoader(
|
|
3138
|
+
createUnlocalizableLoader(
|
|
3139
|
+
options.isCacheRestore,
|
|
3140
|
+
options.returnUnlocalizedKeys
|
|
3141
|
+
)
|
|
3142
|
+
);
|
|
3143
|
+
case "mdx":
|
|
3144
|
+
return composeLoaders(
|
|
3145
|
+
createTextFileLoader(bucketPathPattern),
|
|
3146
|
+
createDoubleSerializationLoader(),
|
|
3147
|
+
createPrettierLoader({ parser: "mdx", bucketPathPattern }),
|
|
3148
|
+
createMdxFormatLoader(),
|
|
3149
|
+
createFlatLoader(),
|
|
3150
|
+
createMdxStructureLoader(),
|
|
3151
|
+
createSyncLoader(),
|
|
3152
|
+
createUnlocalizableLoader(
|
|
3153
|
+
options.isCacheRestore,
|
|
3154
|
+
options.returnUnlocalizedKeys
|
|
3155
|
+
)
|
|
3114
3156
|
);
|
|
3115
3157
|
case "mdx":
|
|
3116
3158
|
return composeLoaders(
|
|
@@ -3129,21 +3171,30 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3129
3171
|
createFlatLoader(),
|
|
3130
3172
|
createSyncLoader(),
|
|
3131
3173
|
createVariableLoader({ type: "python" }),
|
|
3132
|
-
createUnlocalizableLoader(
|
|
3174
|
+
createUnlocalizableLoader(
|
|
3175
|
+
options.isCacheRestore,
|
|
3176
|
+
options.returnUnlocalizedKeys
|
|
3177
|
+
)
|
|
3133
3178
|
);
|
|
3134
3179
|
case "properties":
|
|
3135
3180
|
return composeLoaders(
|
|
3136
3181
|
createTextFileLoader(bucketPathPattern),
|
|
3137
3182
|
createPropertiesLoader(),
|
|
3138
3183
|
createSyncLoader(),
|
|
3139
|
-
createUnlocalizableLoader(
|
|
3184
|
+
createUnlocalizableLoader(
|
|
3185
|
+
options.isCacheRestore,
|
|
3186
|
+
options.returnUnlocalizedKeys
|
|
3187
|
+
)
|
|
3140
3188
|
);
|
|
3141
3189
|
case "xcode-strings":
|
|
3142
3190
|
return composeLoaders(
|
|
3143
3191
|
createTextFileLoader(bucketPathPattern),
|
|
3144
3192
|
createXcodeStringsLoader(),
|
|
3145
3193
|
createSyncLoader(),
|
|
3146
|
-
createUnlocalizableLoader(
|
|
3194
|
+
createUnlocalizableLoader(
|
|
3195
|
+
options.isCacheRestore,
|
|
3196
|
+
options.returnUnlocalizedKeys
|
|
3197
|
+
)
|
|
3147
3198
|
);
|
|
3148
3199
|
case "xcode-stringsdict":
|
|
3149
3200
|
return composeLoaders(
|
|
@@ -3151,7 +3202,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3151
3202
|
createXcodeStringsdictLoader(),
|
|
3152
3203
|
createFlatLoader(),
|
|
3153
3204
|
createSyncLoader(),
|
|
3154
|
-
createUnlocalizableLoader(
|
|
3205
|
+
createUnlocalizableLoader(
|
|
3206
|
+
options.isCacheRestore,
|
|
3207
|
+
options.returnUnlocalizedKeys
|
|
3208
|
+
)
|
|
3155
3209
|
);
|
|
3156
3210
|
case "xcode-xcstrings":
|
|
3157
3211
|
return composeLoaders(
|
|
@@ -3162,7 +3216,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3162
3216
|
createFlatLoader(),
|
|
3163
3217
|
createSyncLoader(),
|
|
3164
3218
|
createVariableLoader({ type: "ieee" }),
|
|
3165
|
-
createUnlocalizableLoader(
|
|
3219
|
+
createUnlocalizableLoader(
|
|
3220
|
+
options.isCacheRestore,
|
|
3221
|
+
options.returnUnlocalizedKeys
|
|
3222
|
+
)
|
|
3166
3223
|
);
|
|
3167
3224
|
case "yaml":
|
|
3168
3225
|
return composeLoaders(
|
|
@@ -3172,7 +3229,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3172
3229
|
createFlatLoader(),
|
|
3173
3230
|
createLockedKeysLoader(lockedKeys || [], options.isCacheRestore),
|
|
3174
3231
|
createSyncLoader(),
|
|
3175
|
-
createUnlocalizableLoader(
|
|
3232
|
+
createUnlocalizableLoader(
|
|
3233
|
+
options.isCacheRestore,
|
|
3234
|
+
options.returnUnlocalizedKeys
|
|
3235
|
+
)
|
|
3176
3236
|
);
|
|
3177
3237
|
case "yaml-root-key":
|
|
3178
3238
|
return composeLoaders(
|
|
@@ -3182,7 +3242,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3182
3242
|
createRootKeyLoader(true),
|
|
3183
3243
|
createFlatLoader(),
|
|
3184
3244
|
createSyncLoader(),
|
|
3185
|
-
createUnlocalizableLoader(
|
|
3245
|
+
createUnlocalizableLoader(
|
|
3246
|
+
options.isCacheRestore,
|
|
3247
|
+
options.returnUnlocalizedKeys
|
|
3248
|
+
)
|
|
3186
3249
|
);
|
|
3187
3250
|
case "flutter":
|
|
3188
3251
|
return composeLoaders(
|
|
@@ -3192,7 +3255,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3192
3255
|
createFlutterLoader(),
|
|
3193
3256
|
createFlatLoader(),
|
|
3194
3257
|
createSyncLoader(),
|
|
3195
|
-
createUnlocalizableLoader(
|
|
3258
|
+
createUnlocalizableLoader(
|
|
3259
|
+
options.isCacheRestore,
|
|
3260
|
+
options.returnUnlocalizedKeys
|
|
3261
|
+
)
|
|
3196
3262
|
);
|
|
3197
3263
|
case "xliff":
|
|
3198
3264
|
return composeLoaders(
|
|
@@ -3200,7 +3266,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3200
3266
|
createXliffLoader(),
|
|
3201
3267
|
createFlatLoader(),
|
|
3202
3268
|
createSyncLoader(),
|
|
3203
|
-
createUnlocalizableLoader(
|
|
3269
|
+
createUnlocalizableLoader(
|
|
3270
|
+
options.isCacheRestore,
|
|
3271
|
+
options.returnUnlocalizedKeys
|
|
3272
|
+
)
|
|
3204
3273
|
);
|
|
3205
3274
|
case "xml":
|
|
3206
3275
|
return composeLoaders(
|
|
@@ -3208,28 +3277,40 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3208
3277
|
createXmlLoader(),
|
|
3209
3278
|
createFlatLoader(),
|
|
3210
3279
|
createSyncLoader(),
|
|
3211
|
-
createUnlocalizableLoader(
|
|
3280
|
+
createUnlocalizableLoader(
|
|
3281
|
+
options.isCacheRestore,
|
|
3282
|
+
options.returnUnlocalizedKeys
|
|
3283
|
+
)
|
|
3212
3284
|
);
|
|
3213
3285
|
case "srt":
|
|
3214
3286
|
return composeLoaders(
|
|
3215
3287
|
createTextFileLoader(bucketPathPattern),
|
|
3216
3288
|
createSrtLoader(),
|
|
3217
3289
|
createSyncLoader(),
|
|
3218
|
-
createUnlocalizableLoader(
|
|
3290
|
+
createUnlocalizableLoader(
|
|
3291
|
+
options.isCacheRestore,
|
|
3292
|
+
options.returnUnlocalizedKeys
|
|
3293
|
+
)
|
|
3219
3294
|
);
|
|
3220
3295
|
case "dato":
|
|
3221
3296
|
return composeLoaders(
|
|
3222
3297
|
createDatoLoader(bucketPathPattern),
|
|
3223
3298
|
createSyncLoader(),
|
|
3224
3299
|
createFlatLoader(),
|
|
3225
|
-
createUnlocalizableLoader(
|
|
3300
|
+
createUnlocalizableLoader(
|
|
3301
|
+
options.isCacheRestore,
|
|
3302
|
+
options.returnUnlocalizedKeys
|
|
3303
|
+
)
|
|
3226
3304
|
);
|
|
3227
3305
|
case "vtt":
|
|
3228
3306
|
return composeLoaders(
|
|
3229
3307
|
createTextFileLoader(bucketPathPattern),
|
|
3230
3308
|
createVttLoader(),
|
|
3231
3309
|
createSyncLoader(),
|
|
3232
|
-
createUnlocalizableLoader(
|
|
3310
|
+
createUnlocalizableLoader(
|
|
3311
|
+
options.isCacheRestore,
|
|
3312
|
+
options.returnUnlocalizedKeys
|
|
3313
|
+
)
|
|
3233
3314
|
);
|
|
3234
3315
|
case "php":
|
|
3235
3316
|
return composeLoaders(
|
|
@@ -3237,7 +3318,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3237
3318
|
createPhpLoader(),
|
|
3238
3319
|
createSyncLoader(),
|
|
3239
3320
|
createFlatLoader(),
|
|
3240
|
-
createUnlocalizableLoader(
|
|
3321
|
+
createUnlocalizableLoader(
|
|
3322
|
+
options.isCacheRestore,
|
|
3323
|
+
options.returnUnlocalizedKeys
|
|
3324
|
+
)
|
|
3241
3325
|
);
|
|
3242
3326
|
case "vue-json":
|
|
3243
3327
|
return composeLoaders(
|
|
@@ -3245,7 +3329,10 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys)
|
|
|
3245
3329
|
createVueJsonLoader(),
|
|
3246
3330
|
createSyncLoader(),
|
|
3247
3331
|
createFlatLoader(),
|
|
3248
|
-
createUnlocalizableLoader(
|
|
3332
|
+
createUnlocalizableLoader(
|
|
3333
|
+
options.isCacheRestore,
|
|
3334
|
+
options.returnUnlocalizedKeys
|
|
3335
|
+
)
|
|
3249
3336
|
);
|
|
3250
3337
|
}
|
|
3251
3338
|
}
|
|
@@ -5024,10 +5111,424 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5024
5111
|
main();
|
|
5025
5112
|
});
|
|
5026
5113
|
|
|
5114
|
+
// src/cli/cmd/status.ts
|
|
5115
|
+
|
|
5116
|
+
|
|
5117
|
+
|
|
5118
|
+
|
|
5119
|
+
|
|
5120
|
+
var _clitable3 = require('cli-table3'); var _clitable32 = _interopRequireDefault(_clitable3);
|
|
5121
|
+
var status_default = new (0, _interactivecommander.Command)().command("status").description("Show the status of the localization process").helpOption("-h, --help", "Show help").option("--locale <locale>", "Locale to process", (val, prev) => prev ? [...prev, val] : [val]).option("--bucket <bucket>", "Bucket to process", (val, prev) => prev ? [...prev, val] : [val]).option(
|
|
5122
|
+
"--file [files...]",
|
|
5123
|
+
"File to process. Process only a specific path, may contain asterisk * to match multiple files."
|
|
5124
|
+
).option("--force", "Ignore lockfile and process all keys, useful for estimating full re-translation").option("--verbose", "Show detailed output including key-level word counts").option("--api-key <api-key>", "Explicitly set the API key to use, override the default API key from settings").action(async function(options) {
|
|
5125
|
+
const ora = _ora2.default.call(void 0, );
|
|
5126
|
+
const flags = parseFlags2(options);
|
|
5127
|
+
let authId = null;
|
|
5128
|
+
try {
|
|
5129
|
+
ora.start("Loading configuration...");
|
|
5130
|
+
const i18nConfig = getConfig();
|
|
5131
|
+
const settings = getSettings(flags.apiKey);
|
|
5132
|
+
ora.succeed("Configuration loaded");
|
|
5133
|
+
try {
|
|
5134
|
+
ora.start("Checking authentication status...");
|
|
5135
|
+
const auth = await tryAuthenticate(settings);
|
|
5136
|
+
if (auth) {
|
|
5137
|
+
authId = auth.id;
|
|
5138
|
+
ora.succeed(`Authenticated as ${auth.email}`);
|
|
5139
|
+
} else {
|
|
5140
|
+
ora.info(
|
|
5141
|
+
"Not authenticated. Continuing without authentication. (Run `lingo.dev auth --login` to authenticate)"
|
|
5142
|
+
);
|
|
5143
|
+
}
|
|
5144
|
+
} catch (error) {
|
|
5145
|
+
ora.info("Authentication failed. Continuing without authentication.");
|
|
5146
|
+
}
|
|
5147
|
+
ora.start("Validating localization configuration...");
|
|
5148
|
+
validateParams2(i18nConfig, flags);
|
|
5149
|
+
ora.succeed("Localization configuration is valid");
|
|
5150
|
+
trackEvent(authId || "status", "cmd.status.start", {
|
|
5151
|
+
i18nConfig,
|
|
5152
|
+
flags
|
|
5153
|
+
});
|
|
5154
|
+
let buckets = getBuckets(i18nConfig);
|
|
5155
|
+
if (_optionalChain([flags, 'access', _179 => _179.bucket, 'optionalAccess', _180 => _180.length])) {
|
|
5156
|
+
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
5157
|
+
}
|
|
5158
|
+
ora.succeed("Buckets retrieved");
|
|
5159
|
+
if (_optionalChain([flags, 'access', _181 => _181.file, 'optionalAccess', _182 => _182.length])) {
|
|
5160
|
+
buckets = buckets.map((bucket) => {
|
|
5161
|
+
const paths = bucket.paths.filter((path18) => flags.file.find((file) => _optionalChain([path18, 'access', _183 => _183.pathPattern, 'optionalAccess', _184 => _184.match, 'call', _185 => _185(file)])));
|
|
5162
|
+
return { ...bucket, paths };
|
|
5163
|
+
}).filter((bucket) => bucket.paths.length > 0);
|
|
5164
|
+
if (buckets.length === 0) {
|
|
5165
|
+
ora.fail("No buckets found. All buckets were filtered out by --file option.");
|
|
5166
|
+
process.exit(1);
|
|
5167
|
+
} else {
|
|
5168
|
+
ora.info(`\x1B[36mProcessing only filtered buckets:\x1B[0m`);
|
|
5169
|
+
buckets.map((bucket) => {
|
|
5170
|
+
ora.info(` ${bucket.type}:`);
|
|
5171
|
+
bucket.paths.forEach((path18) => {
|
|
5172
|
+
ora.info(` - ${path18.pathPattern}`);
|
|
5173
|
+
});
|
|
5174
|
+
});
|
|
5175
|
+
}
|
|
5176
|
+
}
|
|
5177
|
+
const targetLocales = _optionalChain([flags, 'access', _186 => _186.locale, 'optionalAccess', _187 => _187.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
5178
|
+
let totalSourceKeyCount = 0;
|
|
5179
|
+
let uniqueKeysToTranslate = 0;
|
|
5180
|
+
let totalExistingTranslations = 0;
|
|
5181
|
+
const totalWordCount = /* @__PURE__ */ new Map();
|
|
5182
|
+
const languageStats = {};
|
|
5183
|
+
for (const locale of targetLocales) {
|
|
5184
|
+
languageStats[locale] = {
|
|
5185
|
+
complete: 0,
|
|
5186
|
+
missing: 0,
|
|
5187
|
+
updated: 0,
|
|
5188
|
+
words: 0
|
|
5189
|
+
};
|
|
5190
|
+
totalWordCount.set(locale, 0);
|
|
5191
|
+
}
|
|
5192
|
+
const fileStats = {};
|
|
5193
|
+
for (const bucket of buckets) {
|
|
5194
|
+
try {
|
|
5195
|
+
console.log();
|
|
5196
|
+
ora.info(`Analyzing bucket: ${bucket.type}`);
|
|
5197
|
+
for (const bucketPath of bucket.paths) {
|
|
5198
|
+
const bucketOra = _ora2.default.call(void 0, { indent: 2 }).info(`Analyzing path: ${bucketPath.pathPattern}`);
|
|
5199
|
+
const sourceLocale = __spec.resolveOverriddenLocale.call(void 0, i18nConfig.locale.source, bucketPath.delimiter);
|
|
5200
|
+
const bucketLoader = createBucketLoader(
|
|
5201
|
+
bucket.type,
|
|
5202
|
+
bucketPath.pathPattern,
|
|
5203
|
+
{
|
|
5204
|
+
isCacheRestore: false,
|
|
5205
|
+
defaultLocale: sourceLocale,
|
|
5206
|
+
injectLocale: bucket.injectLocale
|
|
5207
|
+
},
|
|
5208
|
+
bucket.lockedKeys
|
|
5209
|
+
);
|
|
5210
|
+
bucketLoader.setDefaultLocale(sourceLocale);
|
|
5211
|
+
await bucketLoader.init();
|
|
5212
|
+
const filePath = bucketPath.pathPattern;
|
|
5213
|
+
if (!fileStats[filePath]) {
|
|
5214
|
+
fileStats[filePath] = {
|
|
5215
|
+
path: filePath,
|
|
5216
|
+
sourceKeys: 0,
|
|
5217
|
+
wordCount: 0,
|
|
5218
|
+
languageStats: {}
|
|
5219
|
+
};
|
|
5220
|
+
for (const locale of targetLocales) {
|
|
5221
|
+
fileStats[filePath].languageStats[locale] = {
|
|
5222
|
+
complete: 0,
|
|
5223
|
+
missing: 0,
|
|
5224
|
+
updated: 0,
|
|
5225
|
+
words: 0
|
|
5226
|
+
};
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
const sourceData = await bucketLoader.pull(sourceLocale);
|
|
5230
|
+
const sourceKeys = Object.keys(sourceData);
|
|
5231
|
+
fileStats[filePath].sourceKeys = sourceKeys.length;
|
|
5232
|
+
totalSourceKeyCount += sourceKeys.length;
|
|
5233
|
+
let sourceWordCount = 0;
|
|
5234
|
+
for (const key of sourceKeys) {
|
|
5235
|
+
const value = sourceData[key];
|
|
5236
|
+
if (typeof value === "string") {
|
|
5237
|
+
const words = value.trim().split(/\s+/).length;
|
|
5238
|
+
sourceWordCount += words;
|
|
5239
|
+
}
|
|
5240
|
+
}
|
|
5241
|
+
fileStats[filePath].wordCount = sourceWordCount;
|
|
5242
|
+
for (const _targetLocale of targetLocales) {
|
|
5243
|
+
const targetLocale = __spec.resolveOverriddenLocale.call(void 0, _targetLocale, bucketPath.delimiter);
|
|
5244
|
+
bucketOra.start(`[${sourceLocale} -> ${targetLocale}] Analyzing translation status...`);
|
|
5245
|
+
let targetData = {};
|
|
5246
|
+
let fileExists = true;
|
|
5247
|
+
try {
|
|
5248
|
+
targetData = await bucketLoader.pull(targetLocale);
|
|
5249
|
+
} catch (error) {
|
|
5250
|
+
fileExists = false;
|
|
5251
|
+
bucketOra.info(
|
|
5252
|
+
`[${sourceLocale} -> ${targetLocale}] Target file not found, assuming all keys need translation.`
|
|
5253
|
+
);
|
|
5254
|
+
}
|
|
5255
|
+
if (!fileExists) {
|
|
5256
|
+
fileStats[filePath].languageStats[targetLocale].missing = sourceKeys.length;
|
|
5257
|
+
fileStats[filePath].languageStats[targetLocale].words = sourceWordCount;
|
|
5258
|
+
languageStats[targetLocale].missing += sourceKeys.length;
|
|
5259
|
+
languageStats[targetLocale].words += sourceWordCount;
|
|
5260
|
+
totalWordCount.set(targetLocale, (totalWordCount.get(targetLocale) || 0) + sourceWordCount);
|
|
5261
|
+
bucketOra.succeed(
|
|
5262
|
+
`[${sourceLocale} -> ${targetLocale}] ${_chalk2.default.red(`0% complete`)} (0/${sourceKeys.length} keys) - file not found`
|
|
5263
|
+
);
|
|
5264
|
+
continue;
|
|
5265
|
+
}
|
|
5266
|
+
const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
|
|
5267
|
+
const checksums = await deltaProcessor.loadChecksums();
|
|
5268
|
+
const delta = await deltaProcessor.calculateDelta({
|
|
5269
|
+
sourceData,
|
|
5270
|
+
targetData,
|
|
5271
|
+
checksums
|
|
5272
|
+
});
|
|
5273
|
+
const missingKeys = delta.added;
|
|
5274
|
+
const updatedKeys = delta.updated;
|
|
5275
|
+
const completeKeys = sourceKeys.filter((key) => !missingKeys.includes(key) && !updatedKeys.includes(key));
|
|
5276
|
+
let wordsToTranslate = 0;
|
|
5277
|
+
const keysToProcess = flags.force ? sourceKeys : [...missingKeys, ...updatedKeys];
|
|
5278
|
+
for (const key of keysToProcess) {
|
|
5279
|
+
const value = sourceData[String(key)];
|
|
5280
|
+
if (typeof value === "string") {
|
|
5281
|
+
const words = value.trim().split(/\s+/).length;
|
|
5282
|
+
wordsToTranslate += words;
|
|
5283
|
+
}
|
|
5284
|
+
}
|
|
5285
|
+
fileStats[filePath].languageStats[targetLocale].missing = missingKeys.length;
|
|
5286
|
+
fileStats[filePath].languageStats[targetLocale].updated = updatedKeys.length;
|
|
5287
|
+
fileStats[filePath].languageStats[targetLocale].complete = completeKeys.length;
|
|
5288
|
+
fileStats[filePath].languageStats[targetLocale].words = wordsToTranslate;
|
|
5289
|
+
languageStats[targetLocale].missing += missingKeys.length;
|
|
5290
|
+
languageStats[targetLocale].updated += updatedKeys.length;
|
|
5291
|
+
languageStats[targetLocale].complete += completeKeys.length;
|
|
5292
|
+
languageStats[targetLocale].words += wordsToTranslate;
|
|
5293
|
+
totalWordCount.set(targetLocale, (totalWordCount.get(targetLocale) || 0) + wordsToTranslate);
|
|
5294
|
+
const totalKeysInFile = sourceKeys.length;
|
|
5295
|
+
const completionPercent = (completeKeys.length / totalKeysInFile * 100).toFixed(1);
|
|
5296
|
+
if (missingKeys.length === 0 && updatedKeys.length === 0) {
|
|
5297
|
+
bucketOra.succeed(
|
|
5298
|
+
`[${sourceLocale} -> ${targetLocale}] ${_chalk2.default.green(`100% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`
|
|
5299
|
+
);
|
|
5300
|
+
} else {
|
|
5301
|
+
const message = `[${sourceLocale} -> ${targetLocale}] ${parseFloat(completionPercent) > 50 ? _chalk2.default.yellow(`${completionPercent}% complete`) : _chalk2.default.red(`${completionPercent}% complete`)} (${completeKeys.length}/${totalKeysInFile} keys)`;
|
|
5302
|
+
bucketOra.succeed(message);
|
|
5303
|
+
if (flags.verbose) {
|
|
5304
|
+
if (missingKeys.length > 0) {
|
|
5305
|
+
console.log(` ${_chalk2.default.red(`Missing:`)} ${missingKeys.length} keys, ~${wordsToTranslate} words`);
|
|
5306
|
+
console.log(
|
|
5307
|
+
` ${_chalk2.default.dim(`Example missing: ${missingKeys.slice(0, 2).join(", ")}${missingKeys.length > 2 ? "..." : ""}`)}`
|
|
5308
|
+
);
|
|
5309
|
+
}
|
|
5310
|
+
if (updatedKeys.length > 0) {
|
|
5311
|
+
console.log(` ${_chalk2.default.yellow(`Updated:`)} ${updatedKeys.length} keys that changed in source`);
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5314
|
+
}
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
} catch (error) {
|
|
5318
|
+
ora.fail(`Failed to analyze bucket ${bucket.type}: ${error.message}`);
|
|
5319
|
+
}
|
|
5320
|
+
}
|
|
5321
|
+
const totalKeysNeedingTranslation = Object.values(languageStats).reduce((sum, stats) => {
|
|
5322
|
+
return sum + stats.missing + stats.updated;
|
|
5323
|
+
}, 0);
|
|
5324
|
+
const totalCompletedKeys = totalSourceKeyCount - totalKeysNeedingTranslation / targetLocales.length;
|
|
5325
|
+
console.log();
|
|
5326
|
+
ora.succeed(_chalk2.default.green(`Localization status completed.`));
|
|
5327
|
+
console.log(_chalk2.default.bold.cyan(`
|
|
5328
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557`));
|
|
5329
|
+
console.log(_chalk2.default.bold.cyan(`\u2551 LOCALIZATION STATUS REPORT \u2551`));
|
|
5330
|
+
console.log(_chalk2.default.bold.cyan(`\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D`));
|
|
5331
|
+
console.log(_chalk2.default.bold(`
|
|
5332
|
+
\u{1F4DD} SOURCE CONTENT:`));
|
|
5333
|
+
console.log(`\u2022 Source language: ${_chalk2.default.green(i18nConfig.locale.source)}`);
|
|
5334
|
+
console.log(`\u2022 Source keys: ${_chalk2.default.yellow(totalSourceKeyCount.toString())} keys across all files`);
|
|
5335
|
+
console.log(_chalk2.default.bold(`
|
|
5336
|
+
\u{1F310} LANGUAGE BY LANGUAGE BREAKDOWN:`));
|
|
5337
|
+
const table = new (0, _clitable32.default)({
|
|
5338
|
+
head: ["Language", "Status", "Complete", "Missing", "Updated", "Words"],
|
|
5339
|
+
style: {
|
|
5340
|
+
head: ["white"],
|
|
5341
|
+
// White color for headers
|
|
5342
|
+
border: []
|
|
5343
|
+
// No color for borders
|
|
5344
|
+
},
|
|
5345
|
+
colWidths: [12, 20, 18, 12, 12, 15]
|
|
5346
|
+
// Explicit column widths, making Status column wider
|
|
5347
|
+
});
|
|
5348
|
+
let totalWordsToTranslate = 0;
|
|
5349
|
+
for (const locale of targetLocales) {
|
|
5350
|
+
const stats = languageStats[locale];
|
|
5351
|
+
const percentComplete = (stats.complete / totalSourceKeyCount * 100).toFixed(1);
|
|
5352
|
+
let statusText;
|
|
5353
|
+
let statusColor;
|
|
5354
|
+
if (stats.missing === totalSourceKeyCount) {
|
|
5355
|
+
statusText = "\u{1F534} Not started";
|
|
5356
|
+
statusColor = _chalk2.default.red;
|
|
5357
|
+
} else if (stats.missing === 0 && stats.updated === 0) {
|
|
5358
|
+
statusText = "\u2705 Complete";
|
|
5359
|
+
statusColor = _chalk2.default.green;
|
|
5360
|
+
} else if (parseFloat(percentComplete) > 80) {
|
|
5361
|
+
statusText = "\u{1F7E1} Almost done";
|
|
5362
|
+
statusColor = _chalk2.default.yellow;
|
|
5363
|
+
} else if (parseFloat(percentComplete) > 0) {
|
|
5364
|
+
statusText = "\u{1F7E0} In progress";
|
|
5365
|
+
statusColor = _chalk2.default.yellow;
|
|
5366
|
+
} else {
|
|
5367
|
+
statusText = "\u{1F534} Not started";
|
|
5368
|
+
statusColor = _chalk2.default.red;
|
|
5369
|
+
}
|
|
5370
|
+
const words = totalWordCount.get(locale) || 0;
|
|
5371
|
+
totalWordsToTranslate += words;
|
|
5372
|
+
table.push([
|
|
5373
|
+
locale,
|
|
5374
|
+
statusColor(statusText),
|
|
5375
|
+
`${stats.complete}/${totalSourceKeyCount} (${percentComplete}%)`,
|
|
5376
|
+
stats.missing > 0 ? _chalk2.default.red(stats.missing.toString()) : "0",
|
|
5377
|
+
stats.updated > 0 ? _chalk2.default.yellow(stats.updated.toString()) : "0",
|
|
5378
|
+
words > 0 ? `~${words.toLocaleString()}` : "0"
|
|
5379
|
+
]);
|
|
5380
|
+
}
|
|
5381
|
+
console.log(table.toString());
|
|
5382
|
+
console.log(_chalk2.default.bold(`
|
|
5383
|
+
\u{1F4CA} USAGE ESTIMATE:`));
|
|
5384
|
+
console.log(
|
|
5385
|
+
`\u2022 TOTAL: ~${_chalk2.default.yellow.bold(totalWordsToTranslate.toLocaleString())} words to translate across all languages`
|
|
5386
|
+
);
|
|
5387
|
+
if (targetLocales.length > 1) {
|
|
5388
|
+
console.log(`\u2022 Per-language breakdown:`);
|
|
5389
|
+
for (const locale of targetLocales) {
|
|
5390
|
+
const words = totalWordCount.get(locale) || 0;
|
|
5391
|
+
const percent = (words / totalWordsToTranslate * 100).toFixed(1);
|
|
5392
|
+
console.log(` - ${locale}: ~${words.toLocaleString()} words (${percent}% of total)`);
|
|
5393
|
+
}
|
|
5394
|
+
}
|
|
5395
|
+
if (flags.confirm && Object.keys(fileStats).length > 0) {
|
|
5396
|
+
console.log(_chalk2.default.bold(`
|
|
5397
|
+
\u{1F4D1} BREAKDOWN BY FILE:`));
|
|
5398
|
+
Object.entries(fileStats).sort((a, b) => b[1].wordCount - a[1].wordCount).forEach(([path18, stats]) => {
|
|
5399
|
+
if (stats.sourceKeys === 0) return;
|
|
5400
|
+
console.log(_chalk2.default.bold(`
|
|
5401
|
+
\u2022 ${path18}:`));
|
|
5402
|
+
console.log(` ${stats.sourceKeys} source keys, ~${stats.wordCount.toLocaleString()} source words`);
|
|
5403
|
+
const fileTable = new (0, _clitable32.default)({
|
|
5404
|
+
head: ["Language", "Status", "Details"],
|
|
5405
|
+
style: {
|
|
5406
|
+
head: ["white"],
|
|
5407
|
+
border: []
|
|
5408
|
+
},
|
|
5409
|
+
colWidths: [12, 20, 50]
|
|
5410
|
+
// Explicit column widths for file detail table
|
|
5411
|
+
});
|
|
5412
|
+
for (const locale of targetLocales) {
|
|
5413
|
+
const langStats = stats.languageStats[locale];
|
|
5414
|
+
const complete = langStats.complete;
|
|
5415
|
+
const total = stats.sourceKeys;
|
|
5416
|
+
const completion = (complete / total * 100).toFixed(1);
|
|
5417
|
+
let status = "\u2705 Complete";
|
|
5418
|
+
let statusColor = _chalk2.default.green;
|
|
5419
|
+
if (langStats.missing === total) {
|
|
5420
|
+
status = "\u274C Not started";
|
|
5421
|
+
statusColor = _chalk2.default.red;
|
|
5422
|
+
} else if (langStats.missing > 0 || langStats.updated > 0) {
|
|
5423
|
+
status = `\u26A0\uFE0F ${completion}% complete`;
|
|
5424
|
+
statusColor = _chalk2.default.yellow;
|
|
5425
|
+
}
|
|
5426
|
+
let details = "";
|
|
5427
|
+
if (langStats.missing > 0 || langStats.updated > 0) {
|
|
5428
|
+
const parts = [];
|
|
5429
|
+
if (langStats.missing > 0) parts.push(`${langStats.missing} missing`);
|
|
5430
|
+
if (langStats.updated > 0) parts.push(`${langStats.updated} changed`);
|
|
5431
|
+
details = `${parts.join(", ")}, ~${langStats.words} words`;
|
|
5432
|
+
} else {
|
|
5433
|
+
details = "All keys translated";
|
|
5434
|
+
}
|
|
5435
|
+
fileTable.push([locale, statusColor(status), details]);
|
|
5436
|
+
}
|
|
5437
|
+
console.log(fileTable.toString());
|
|
5438
|
+
});
|
|
5439
|
+
}
|
|
5440
|
+
const completeLanguages = targetLocales.filter(
|
|
5441
|
+
(locale) => languageStats[locale].missing === 0 && languageStats[locale].updated === 0
|
|
5442
|
+
);
|
|
5443
|
+
const missingLanguages = targetLocales.filter((locale) => languageStats[locale].complete === 0);
|
|
5444
|
+
console.log(_chalk2.default.bold.green(`
|
|
5445
|
+
\u{1F4A1} OPTIMIZATION TIPS:`));
|
|
5446
|
+
if (missingLanguages.length > 0) {
|
|
5447
|
+
console.log(
|
|
5448
|
+
`\u2022 ${_chalk2.default.yellow(missingLanguages.join(", "))} ${missingLanguages.length === 1 ? "has" : "have"} no translations yet`
|
|
5449
|
+
);
|
|
5450
|
+
}
|
|
5451
|
+
if (completeLanguages.length > 0) {
|
|
5452
|
+
console.log(
|
|
5453
|
+
`\u2022 ${_chalk2.default.green(completeLanguages.join(", "))} ${completeLanguages.length === 1 ? "is" : "are"} completely translated`
|
|
5454
|
+
);
|
|
5455
|
+
}
|
|
5456
|
+
if (targetLocales.length > 1) {
|
|
5457
|
+
console.log(`\u2022 Translating one language at a time reduces complexity`);
|
|
5458
|
+
console.log(`\u2022 Try 'lingo.dev@latest i18n --locale ${targetLocales[0]}' to process just one language`);
|
|
5459
|
+
}
|
|
5460
|
+
trackEvent(authId || "status", "cmd.status.success", {
|
|
5461
|
+
i18nConfig,
|
|
5462
|
+
flags,
|
|
5463
|
+
totalSourceKeyCount,
|
|
5464
|
+
languageStats,
|
|
5465
|
+
totalWordsToTranslate,
|
|
5466
|
+
authenticated: !!authId
|
|
5467
|
+
});
|
|
5468
|
+
} catch (error) {
|
|
5469
|
+
ora.fail(error.message);
|
|
5470
|
+
trackEvent(authId || "status", "cmd.status.error", {
|
|
5471
|
+
flags,
|
|
5472
|
+
error: error.message,
|
|
5473
|
+
authenticated: !!authId
|
|
5474
|
+
});
|
|
5475
|
+
process.exit(1);
|
|
5476
|
+
}
|
|
5477
|
+
});
|
|
5478
|
+
function parseFlags2(options) {
|
|
5479
|
+
return _zod2.default.object({
|
|
5480
|
+
locale: _zod2.default.array(__spec.localeCodeSchema).optional(),
|
|
5481
|
+
bucket: _zod2.default.array(__spec.bucketTypeSchema).optional(),
|
|
5482
|
+
force: _zod2.default.boolean().optional(),
|
|
5483
|
+
confirm: _zod2.default.boolean().optional(),
|
|
5484
|
+
verbose: _zod2.default.boolean().optional(),
|
|
5485
|
+
file: _zod2.default.array(_zod2.default.string()).optional(),
|
|
5486
|
+
apiKey: _zod2.default.string().optional()
|
|
5487
|
+
}).parse(options);
|
|
5488
|
+
}
|
|
5489
|
+
async function tryAuthenticate(settings) {
|
|
5490
|
+
if (!settings.auth.apiKey) {
|
|
5491
|
+
return null;
|
|
5492
|
+
}
|
|
5493
|
+
try {
|
|
5494
|
+
const authenticator = createAuthenticator({
|
|
5495
|
+
apiKey: settings.auth.apiKey,
|
|
5496
|
+
apiUrl: settings.auth.apiUrl
|
|
5497
|
+
});
|
|
5498
|
+
const user = await authenticator.whoami();
|
|
5499
|
+
return user;
|
|
5500
|
+
} catch (error) {
|
|
5501
|
+
return null;
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
function validateParams2(i18nConfig, flags) {
|
|
5505
|
+
if (!i18nConfig) {
|
|
5506
|
+
throw new CLIError({
|
|
5507
|
+
message: "i18n.json not found. Please run `lingo.dev init` to initialize the project.",
|
|
5508
|
+
docUrl: "i18nNotFound"
|
|
5509
|
+
});
|
|
5510
|
+
} else if (!i18nConfig.buckets || !Object.keys(i18nConfig.buckets).length) {
|
|
5511
|
+
throw new CLIError({
|
|
5512
|
+
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
5513
|
+
docUrl: "bucketNotFound"
|
|
5514
|
+
});
|
|
5515
|
+
} else if (_optionalChain([flags, 'access', _188 => _188.locale, 'optionalAccess', _189 => _189.some, 'call', _190 => _190((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
5516
|
+
throw new CLIError({
|
|
5517
|
+
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
5518
|
+
docUrl: "localeTargetNotFound"
|
|
5519
|
+
});
|
|
5520
|
+
} else if (_optionalChain([flags, 'access', _191 => _191.bucket, 'optionalAccess', _192 => _192.some, 'call', _193 => _193((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
5521
|
+
throw new CLIError({
|
|
5522
|
+
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
5523
|
+
docUrl: "bucketNotFound"
|
|
5524
|
+
});
|
|
5525
|
+
}
|
|
5526
|
+
}
|
|
5527
|
+
|
|
5027
5528
|
// package.json
|
|
5028
5529
|
var package_default = {
|
|
5029
5530
|
name: "lingo.dev",
|
|
5030
|
-
version: "0.
|
|
5531
|
+
version: "0.85.0",
|
|
5031
5532
|
description: "Lingo.dev CLI",
|
|
5032
5533
|
private: false,
|
|
5033
5534
|
publishConfig: {
|
|
@@ -5097,6 +5598,7 @@ var package_default = {
|
|
|
5097
5598
|
ai: "^4.3.2",
|
|
5098
5599
|
bitbucket: "^2.12.0",
|
|
5099
5600
|
chalk: "^5.4.1",
|
|
5601
|
+
"cli-table3": "^0.6.5",
|
|
5100
5602
|
cors: "^2.8.5",
|
|
5101
5603
|
"csv-parse": "^5.6.0",
|
|
5102
5604
|
"csv-stringify": "^6.5.2",
|
|
@@ -5202,7 +5704,7 @@ ${_gradientstring.vice.call(void 0,
|
|
|
5202
5704
|
|
|
5203
5705
|
Star the the repo :) https://github.com/LingoDotDev/lingo.dev
|
|
5204
5706
|
`
|
|
5205
|
-
).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).exitOverride((err) => {
|
|
5707
|
+
).version(`v${package_default.version}`, "-v, --version", "Show version").addCommand(init_default).interactive("-y, --no-interactive", "Disable interactive mode").addCommand(i18n_default).addCommand(auth_default).addCommand(show_default).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).exitOverride((err) => {
|
|
5206
5708
|
if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
|
|
5207
5709
|
process.exit(0);
|
|
5208
5710
|
}
|