lingo.dev 0.92.16 → 0.92.17
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/README.md +1 -1
- package/build/cli.cjs +274 -99
- package/build/cli.cjs.map +1 -1
- package/build/cli.mjs +481 -306
- package/build/cli.mjs.map +1 -1
- package/package.json +1 -1
package/build/cli.cjs
CHANGED
|
@@ -26,36 +26,65 @@ function getSettings(explicitApiKey) {
|
|
|
26
26
|
_envVarsInfo();
|
|
27
27
|
return {
|
|
28
28
|
auth: {
|
|
29
|
-
apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access',
|
|
30
|
-
apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access',
|
|
31
|
-
webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access',
|
|
29
|
+
apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _34 => _34.auth, 'optionalAccess', _35 => _35.apiKey]) || defaults.auth.apiKey,
|
|
30
|
+
apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _36 => _36.auth, 'optionalAccess', _37 => _37.apiUrl]) || defaults.auth.apiUrl,
|
|
31
|
+
webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _38 => _38.auth, 'optionalAccess', _39 => _39.webUrl]) || defaults.auth.webUrl
|
|
32
|
+
},
|
|
33
|
+
llm: {
|
|
34
|
+
openaiApiKey: env.OPENAI_API_KEY || _optionalChain([systemFile, 'access', _40 => _40.llm, 'optionalAccess', _41 => _41.openaiApiKey]),
|
|
35
|
+
anthropicApiKey: env.ANTHROPIC_API_KEY || _optionalChain([systemFile, 'access', _42 => _42.llm, 'optionalAccess', _43 => _43.anthropicApiKey]),
|
|
36
|
+
groqApiKey: env.GROQ_API_KEY || _optionalChain([systemFile, 'access', _44 => _44.llm, 'optionalAccess', _45 => _45.groqApiKey])
|
|
32
37
|
}
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
40
|
function saveSettings(settings) {
|
|
36
41
|
_saveSystemFile(settings);
|
|
37
42
|
}
|
|
43
|
+
function loadSystemSettings() {
|
|
44
|
+
return _loadSystemFile();
|
|
45
|
+
}
|
|
46
|
+
var flattenZodObject = (schema, prefix = "") => {
|
|
47
|
+
return Object.entries(schema.shape).flatMap(([key, value]) => {
|
|
48
|
+
const newPrefix = prefix ? `${prefix}.${key}` : key;
|
|
49
|
+
if (value instanceof _zod2.default.ZodObject) {
|
|
50
|
+
return flattenZodObject(value, newPrefix);
|
|
51
|
+
}
|
|
52
|
+
return [newPrefix];
|
|
53
|
+
});
|
|
54
|
+
};
|
|
38
55
|
var SettingsSchema = _zod2.default.object({
|
|
39
56
|
auth: _zod2.default.object({
|
|
40
57
|
apiKey: _zod2.default.string(),
|
|
41
58
|
apiUrl: _zod2.default.string(),
|
|
42
59
|
webUrl: _zod2.default.string()
|
|
60
|
+
}),
|
|
61
|
+
llm: _zod2.default.object({
|
|
62
|
+
openaiApiKey: _zod2.default.string().optional(),
|
|
63
|
+
anthropicApiKey: _zod2.default.string().optional(),
|
|
64
|
+
groqApiKey: _zod2.default.string().optional()
|
|
43
65
|
})
|
|
44
66
|
});
|
|
67
|
+
var SETTINGS_KEYS = flattenZodObject(
|
|
68
|
+
SettingsSchema
|
|
69
|
+
);
|
|
45
70
|
function _loadDefaults() {
|
|
46
71
|
return {
|
|
47
72
|
auth: {
|
|
48
73
|
apiKey: "",
|
|
49
74
|
apiUrl: "https://engine.lingo.dev",
|
|
50
75
|
webUrl: "https://lingo.dev"
|
|
51
|
-
}
|
|
76
|
+
},
|
|
77
|
+
llm: {}
|
|
52
78
|
};
|
|
53
79
|
}
|
|
54
80
|
function _loadEnv() {
|
|
55
81
|
return _zod2.default.object({
|
|
56
82
|
LINGODOTDEV_API_KEY: _zod2.default.string().optional(),
|
|
57
83
|
LINGODOTDEV_API_URL: _zod2.default.string().optional(),
|
|
58
|
-
LINGODOTDEV_WEB_URL: _zod2.default.string().optional()
|
|
84
|
+
LINGODOTDEV_WEB_URL: _zod2.default.string().optional(),
|
|
85
|
+
OPENAI_API_KEY: _zod2.default.string().optional(),
|
|
86
|
+
ANTHROPIC_API_KEY: _zod2.default.string().optional(),
|
|
87
|
+
GROQ_API_KEY: _zod2.default.string().optional()
|
|
59
88
|
}).passthrough().parse(process.env);
|
|
60
89
|
}
|
|
61
90
|
function _loadSystemFile() {
|
|
@@ -67,6 +96,11 @@ function _loadSystemFile() {
|
|
|
67
96
|
apiKey: _zod2.default.string().optional(),
|
|
68
97
|
apiUrl: _zod2.default.string().optional(),
|
|
69
98
|
webUrl: _zod2.default.string().optional()
|
|
99
|
+
}).optional(),
|
|
100
|
+
llm: _zod2.default.object({
|
|
101
|
+
openaiApiKey: _zod2.default.string().optional(),
|
|
102
|
+
anthropicApiKey: _zod2.default.string().optional(),
|
|
103
|
+
groqApiKey: _zod2.default.string().optional()
|
|
70
104
|
}).optional()
|
|
71
105
|
}).passthrough().parse(data);
|
|
72
106
|
}
|
|
@@ -99,17 +133,41 @@ Please use LINGODOTDEV_API_KEY instead.
|
|
|
99
133
|
function _envVarsInfo() {
|
|
100
134
|
const env = _loadEnv();
|
|
101
135
|
const systemFile = _loadSystemFile();
|
|
102
|
-
if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access',
|
|
136
|
+
if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access', _46 => _46.auth, 'optionalAccess', _47 => _47.apiKey])) {
|
|
137
|
+
console.info(
|
|
138
|
+
"\x1B[36m%s\x1B[0m",
|
|
139
|
+
`\u2139\uFE0F Using LINGODOTDEV_API_KEY env var instead of credentials from user config`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
if (env.OPENAI_API_KEY && _optionalChain([systemFile, 'access', _48 => _48.llm, 'optionalAccess', _49 => _49.openaiApiKey])) {
|
|
103
143
|
console.info(
|
|
104
144
|
"\x1B[36m%s\x1B[0m",
|
|
105
|
-
`\u2139\uFE0F Using
|
|
145
|
+
`\u2139\uFE0F Using OPENAI_API_KEY env var instead of key from user config.`
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
if (env.ANTHROPIC_API_KEY && _optionalChain([systemFile, 'access', _50 => _50.llm, 'optionalAccess', _51 => _51.anthropicApiKey])) {
|
|
149
|
+
console.info(
|
|
150
|
+
"\x1B[36m%s\x1B[0m",
|
|
151
|
+
`\u2139\uFE0F Using ANTHROPIC_API_KEY env var instead of key from user config`
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
if (env.GROQ_API_KEY && _optionalChain([systemFile, 'access', _52 => _52.llm, 'optionalAccess', _53 => _53.groqApiKey])) {
|
|
155
|
+
console.info(
|
|
156
|
+
"\x1B[36m%s\x1B[0m",
|
|
157
|
+
`\u2139\uFE0F Using GROQ_API_KEY env var instead of key from user config`
|
|
106
158
|
);
|
|
107
159
|
}
|
|
108
160
|
if (env.LINGODOTDEV_API_URL) {
|
|
109
|
-
console.info(
|
|
161
|
+
console.info(
|
|
162
|
+
"\x1B[36m%s\x1B[0m",
|
|
163
|
+
`\u2139\uFE0F Using LINGODOTDEV_API_URL: ${env.LINGODOTDEV_API_URL}`
|
|
164
|
+
);
|
|
110
165
|
}
|
|
111
166
|
if (env.LINGODOTDEV_WEB_URL) {
|
|
112
|
-
console.info(
|
|
167
|
+
console.info(
|
|
168
|
+
"\x1B[36m%s\x1B[0m",
|
|
169
|
+
`\u2139\uFE0F Using LINGODOTDEV_WEB_URL: ${env.LINGODOTDEV_WEB_URL}`
|
|
170
|
+
);
|
|
113
171
|
}
|
|
114
172
|
}
|
|
115
173
|
|
|
@@ -154,7 +212,7 @@ function createAuthenticator(params) {
|
|
|
154
212
|
});
|
|
155
213
|
if (res.ok) {
|
|
156
214
|
const payload = await res.json();
|
|
157
|
-
if (!_optionalChain([payload, 'optionalAccess',
|
|
215
|
+
if (!_optionalChain([payload, 'optionalAccess', _54 => _54.email])) {
|
|
158
216
|
return null;
|
|
159
217
|
}
|
|
160
218
|
return {
|
|
@@ -774,7 +832,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
|
|
|
774
832
|
});
|
|
775
833
|
const auth2 = await newAuthenticator.whoami();
|
|
776
834
|
if (auth2) {
|
|
777
|
-
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess',
|
|
835
|
+
_ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _55 => _55.email])}`);
|
|
778
836
|
} else {
|
|
779
837
|
_ora2.default.call(void 0, ).fail("Authentication failed.");
|
|
780
838
|
}
|
|
@@ -859,7 +917,7 @@ function getBuckets(i18nConfig) {
|
|
|
859
917
|
const includeItems = bucketEntry.include.map(
|
|
860
918
|
(item) => resolveBucketItem(item)
|
|
861
919
|
);
|
|
862
|
-
const excludeItems = _optionalChain([bucketEntry, 'access',
|
|
920
|
+
const excludeItems = _optionalChain([bucketEntry, 'access', _56 => _56.exclude, 'optionalAccess', _57 => _57.map, 'call', _58 => _58(
|
|
863
921
|
(item) => resolveBucketItem(item)
|
|
864
922
|
)]);
|
|
865
923
|
const config = {
|
|
@@ -897,7 +955,7 @@ function extractPathPatterns(sourceLocale, include, exclude) {
|
|
|
897
955
|
delimiter: pattern.delimiter
|
|
898
956
|
}))
|
|
899
957
|
);
|
|
900
|
-
const excludedPatterns = _optionalChain([exclude, 'optionalAccess',
|
|
958
|
+
const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _59 => _59.flatMap, 'call', _60 => _60(
|
|
901
959
|
(pattern) => expandPlaceholderedGlob(
|
|
902
960
|
pattern.path,
|
|
903
961
|
__spec.resolveOverriddenLocale.call(void 0, sourceLocale, pattern.delimiter)
|
|
@@ -1017,6 +1075,123 @@ var files_default = new (0, _interactivecommander.Command)().command("files").de
|
|
|
1017
1075
|
// src/cli/cmd/show/index.ts
|
|
1018
1076
|
var show_default = new (0, _interactivecommander.Command)().command("show").description("Prints out the current configuration").helpOption("-h, --help", "Show help").addCommand(config_default).addCommand(locale_default).addCommand(files_default);
|
|
1019
1077
|
|
|
1078
|
+
// src/cli/cmd/config/index.ts
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
// src/cli/cmd/config/set.ts
|
|
1082
|
+
|
|
1083
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
1084
|
+
var _dedent = require('dedent'); var _dedent2 = _interopRequireDefault(_dedent);
|
|
1085
|
+
|
|
1086
|
+
var set_default = new (0, _interactivecommander.Command)().name("set").description("Set a configuration key to a value").addHelpText("afterAll", `
|
|
1087
|
+
Available keys:
|
|
1088
|
+
${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key to set").argument("<value>", "New value").helpOption("-h, --help", "Show help").action(async (key, value) => {
|
|
1089
|
+
if (!SETTINGS_KEYS.includes(key)) {
|
|
1090
|
+
console.error(
|
|
1091
|
+
_dedent2.default`
|
|
1092
|
+
${_chalk2.default.red("\u2716")} Unknown configuration key: ${_chalk2.default.bold(key)}
|
|
1093
|
+
Run ${_chalk2.default.dim("lingo.dev config set --help")} to see available keys.
|
|
1094
|
+
`
|
|
1095
|
+
);
|
|
1096
|
+
process.exitCode = 1;
|
|
1097
|
+
return;
|
|
1098
|
+
}
|
|
1099
|
+
const current = loadSystemSettings();
|
|
1100
|
+
const updated = _lodash2.default.cloneDeep(current);
|
|
1101
|
+
_lodash2.default.set(updated, key, value);
|
|
1102
|
+
try {
|
|
1103
|
+
saveSettings(updated);
|
|
1104
|
+
console.log(`${_chalk2.default.green("\u2714")} Set ${_chalk2.default.bold(key)}`);
|
|
1105
|
+
} catch (err) {
|
|
1106
|
+
console.error(
|
|
1107
|
+
_chalk2.default.red(
|
|
1108
|
+
`\u2716 Failed to save configuration: ${_chalk2.default.dim(
|
|
1109
|
+
err instanceof Error ? err.message : String(err)
|
|
1110
|
+
)}`
|
|
1111
|
+
)
|
|
1112
|
+
);
|
|
1113
|
+
process.exitCode = 1;
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
|
|
1117
|
+
// src/cli/cmd/config/unset.ts
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
var unset_default = new (0, _interactivecommander.Command)().name("unset").description("Remove a configuration key").addHelpText("afterAll", `
|
|
1123
|
+
Available keys:
|
|
1124
|
+
${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key to remove").helpOption("-h, --help", "Show help").action(async (key) => {
|
|
1125
|
+
if (!SETTINGS_KEYS.includes(key)) {
|
|
1126
|
+
console.error(
|
|
1127
|
+
_dedent2.default`
|
|
1128
|
+
${_chalk2.default.red("\u2716")} Unknown configuration key: ${_chalk2.default.bold(key)}
|
|
1129
|
+
Run ${_chalk2.default.dim("lingo.dev config unset --help")} to see available keys.
|
|
1130
|
+
`
|
|
1131
|
+
);
|
|
1132
|
+
process.exitCode = 1;
|
|
1133
|
+
return;
|
|
1134
|
+
}
|
|
1135
|
+
const settings = loadSystemSettings();
|
|
1136
|
+
const currentValue = _lodash2.default.get(settings, key);
|
|
1137
|
+
if (!_lodash2.default.trim(String(currentValue || ""))) {
|
|
1138
|
+
console.log(`${_chalk2.default.cyan("\u2139")} ${_chalk2.default.bold(key)} is not set.`);
|
|
1139
|
+
return;
|
|
1140
|
+
} else {
|
|
1141
|
+
const updated = _lodash2.default.cloneDeep(settings);
|
|
1142
|
+
_lodash2.default.unset(updated, key);
|
|
1143
|
+
try {
|
|
1144
|
+
saveSettings(updated);
|
|
1145
|
+
console.log(
|
|
1146
|
+
`${_chalk2.default.green("\u2714")} Removed configuration key ${_chalk2.default.bold(key)}`
|
|
1147
|
+
);
|
|
1148
|
+
} catch (err) {
|
|
1149
|
+
console.error(
|
|
1150
|
+
_chalk2.default.red(
|
|
1151
|
+
`\u2716 Failed to save configuration: ${_chalk2.default.dim(
|
|
1152
|
+
err instanceof Error ? err.message : String(err)
|
|
1153
|
+
)}`
|
|
1154
|
+
)
|
|
1155
|
+
);
|
|
1156
|
+
process.exitCode = 1;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
// src/cli/cmd/config/get.ts
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
var get_default = new (0, _interactivecommander.Command)().name("get").description("Get the value of a configuration key").addHelpText("afterAll", `
|
|
1167
|
+
Available keys:
|
|
1168
|
+
${SETTINGS_KEYS.join("\n ")}`).argument("<key>", "Configuration key").helpOption("-h, --help", "Show help").action(async (key) => {
|
|
1169
|
+
if (!SETTINGS_KEYS.includes(key)) {
|
|
1170
|
+
console.error(
|
|
1171
|
+
_dedent2.default`
|
|
1172
|
+
${_chalk2.default.red("\u2716")} Unknown configuration key: ${_chalk2.default.bold(key)}
|
|
1173
|
+
Run ${_chalk2.default.dim("lingo.dev config get --help")} to see available keys.
|
|
1174
|
+
`
|
|
1175
|
+
);
|
|
1176
|
+
process.exitCode = 1;
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
const settings = loadSystemSettings();
|
|
1180
|
+
const value = _lodash2.default.get(settings, key);
|
|
1181
|
+
if (!value) {
|
|
1182
|
+
console.log(`${_chalk2.default.cyan("\u2139")} ${_chalk2.default.bold(key)} is not set.`);
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
if (typeof value === "object") {
|
|
1186
|
+
console.log(JSON.stringify(value, null, 2));
|
|
1187
|
+
} else {
|
|
1188
|
+
console.log(value);
|
|
1189
|
+
}
|
|
1190
|
+
});
|
|
1191
|
+
|
|
1192
|
+
// src/cli/cmd/config/index.ts
|
|
1193
|
+
var config_default2 = new (0, _interactivecommander.Command)().command("config").description("Manage Lingo.dev CLI configuration").helpOption("-h, --help", "Show help").addCommand(set_default).addCommand(unset_default).addCommand(get_default);
|
|
1194
|
+
|
|
1020
1195
|
// src/cli/cmd/i18n.ts
|
|
1021
1196
|
|
|
1022
1197
|
|
|
@@ -1033,12 +1208,12 @@ function composeLoaders(...loaders) {
|
|
|
1033
1208
|
return {
|
|
1034
1209
|
init: async () => {
|
|
1035
1210
|
for (const loader of loaders) {
|
|
1036
|
-
await _optionalChain([loader, 'access',
|
|
1211
|
+
await _optionalChain([loader, 'access', _61 => _61.init, 'optionalCall', _62 => _62()]);
|
|
1037
1212
|
}
|
|
1038
1213
|
},
|
|
1039
1214
|
setDefaultLocale(locale) {
|
|
1040
1215
|
for (const loader of loaders) {
|
|
1041
|
-
_optionalChain([loader, 'access',
|
|
1216
|
+
_optionalChain([loader, 'access', _63 => _63.setDefaultLocale, 'optionalCall', _64 => _64(locale)]);
|
|
1042
1217
|
}
|
|
1043
1218
|
return this;
|
|
1044
1219
|
},
|
|
@@ -1071,7 +1246,7 @@ function createLoader(lDefinition) {
|
|
|
1071
1246
|
if (state.initCtx) {
|
|
1072
1247
|
return state.initCtx;
|
|
1073
1248
|
}
|
|
1074
|
-
state.initCtx = await _optionalChain([lDefinition, 'access',
|
|
1249
|
+
state.initCtx = await _optionalChain([lDefinition, 'access', _65 => _65.init, 'optionalCall', _66 => _66()]);
|
|
1075
1250
|
return state.initCtx;
|
|
1076
1251
|
},
|
|
1077
1252
|
setDefaultLocale(locale) {
|
|
@@ -1176,7 +1351,7 @@ function createNormalizeLoader() {
|
|
|
1176
1351
|
return normalized;
|
|
1177
1352
|
},
|
|
1178
1353
|
push: async (locale, data, originalInput) => {
|
|
1179
|
-
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess',
|
|
1354
|
+
const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _67 => _67.keysMap]), () => ( {}));
|
|
1180
1355
|
const input2 = mapDenormalizedKeys(data, keysMap);
|
|
1181
1356
|
const denormalized = _flat.unflatten.call(void 0, input2, {
|
|
1182
1357
|
delimiter: "/",
|
|
@@ -1250,7 +1425,7 @@ function createTextFileLoader(pathPattern) {
|
|
|
1250
1425
|
const trimmedResult = result.trim();
|
|
1251
1426
|
return trimmedResult;
|
|
1252
1427
|
},
|
|
1253
|
-
async push(locale, data,
|
|
1428
|
+
async push(locale, data, _33, originalLocale) {
|
|
1254
1429
|
const draftPath = pathPattern.replaceAll("[locale]", locale);
|
|
1255
1430
|
const finalPath = path12.default.resolve(draftPath);
|
|
1256
1431
|
const dirPath = path12.default.dirname(finalPath);
|
|
@@ -1279,8 +1454,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
|
|
|
1279
1454
|
if (!templateData) {
|
|
1280
1455
|
templateData = await readFileForLocale(pathPattern, originalLocale);
|
|
1281
1456
|
}
|
|
1282
|
-
if (_optionalChain([templateData, 'optionalAccess',
|
|
1283
|
-
const ending = _optionalChain([templateData, 'optionalAccess',
|
|
1457
|
+
if (_optionalChain([templateData, 'optionalAccess', _68 => _68.match, 'call', _69 => _69(/[\r\n]$/)])) {
|
|
1458
|
+
const ending = _optionalChain([templateData, 'optionalAccess', _70 => _70.includes, 'call', _71 => _71("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _72 => _72.includes, 'call', _73 => _73("\r")]) ? "\r" : "\n";
|
|
1284
1459
|
return ending;
|
|
1285
1460
|
}
|
|
1286
1461
|
return "";
|
|
@@ -1622,7 +1797,7 @@ function createHtmlLoader() {
|
|
|
1622
1797
|
break;
|
|
1623
1798
|
}
|
|
1624
1799
|
const siblings = Array.from(parent.childNodes).filter(
|
|
1625
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1800
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _74 => _74.textContent, 'optionalAccess', _75 => _75.trim, 'call', _76 => _76()])
|
|
1626
1801
|
);
|
|
1627
1802
|
const index = siblings.indexOf(current);
|
|
1628
1803
|
if (index !== -1) {
|
|
@@ -1657,11 +1832,11 @@ function createHtmlLoader() {
|
|
|
1657
1832
|
result[getPath(element, attr)] = value;
|
|
1658
1833
|
}
|
|
1659
1834
|
});
|
|
1660
|
-
Array.from(element.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1835
|
+
Array.from(element.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _77 => _77.textContent, 'optionalAccess', _78 => _78.trim, 'call', _79 => _79()])).forEach(processNode);
|
|
1661
1836
|
}
|
|
1662
1837
|
};
|
|
1663
|
-
Array.from(document.head.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1664
|
-
Array.from(document.body.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1838
|
+
Array.from(document.head.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _80 => _80.textContent, 'optionalAccess', _81 => _81.trim, 'call', _82 => _82()])).forEach(processNode);
|
|
1839
|
+
Array.from(document.body.childNodes).filter((n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _83 => _83.textContent, 'optionalAccess', _84 => _84.trim, 'call', _85 => _85()])).forEach(processNode);
|
|
1665
1840
|
return result;
|
|
1666
1841
|
},
|
|
1667
1842
|
async push(locale, data, originalInput) {
|
|
@@ -1683,7 +1858,7 @@ function createHtmlLoader() {
|
|
|
1683
1858
|
for (let i = 0; i < indices.length; i++) {
|
|
1684
1859
|
const index = parseInt(indices[i]);
|
|
1685
1860
|
const siblings = Array.from(parent.childNodes).filter(
|
|
1686
|
-
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access',
|
|
1861
|
+
(n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _86 => _86.textContent, 'optionalAccess', _87 => _87.trim, 'call', _88 => _88()])
|
|
1687
1862
|
);
|
|
1688
1863
|
if (index >= siblings.length) {
|
|
1689
1864
|
if (i === indices.length - 1) {
|
|
@@ -1734,7 +1909,7 @@ function createMarkdownLoader() {
|
|
|
1734
1909
|
yaml: yamlEngine
|
|
1735
1910
|
}
|
|
1736
1911
|
});
|
|
1737
|
-
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess',
|
|
1912
|
+
const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]), () => ( ""))).filter(Boolean);
|
|
1738
1913
|
return {
|
|
1739
1914
|
...Object.fromEntries(
|
|
1740
1915
|
sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
|
|
@@ -1746,7 +1921,7 @@ function createMarkdownLoader() {
|
|
|
1746
1921
|
const frontmatter = Object.fromEntries(
|
|
1747
1922
|
Object.entries(data).filter(([key]) => key.startsWith(FM_ATTR_PREFIX)).map(([key, value]) => [key.replace(FM_ATTR_PREFIX, ""), value])
|
|
1748
1923
|
);
|
|
1749
|
-
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
1924
|
+
let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _91 => _91.trim, 'call', _92 => _92()]), () => ( ""))).filter(Boolean).join("\n\n");
|
|
1750
1925
|
if (Object.keys(frontmatter).length > 0) {
|
|
1751
1926
|
content = `
|
|
1752
1927
|
${content}`;
|
|
@@ -1779,7 +1954,7 @@ function createPropertiesLoader() {
|
|
|
1779
1954
|
return result;
|
|
1780
1955
|
},
|
|
1781
1956
|
async push(locale, payload) {
|
|
1782
|
-
const result = Object.entries(payload).filter(([
|
|
1957
|
+
const result = Object.entries(payload).filter(([_33, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
|
|
1783
1958
|
return result;
|
|
1784
1959
|
}
|
|
1785
1960
|
});
|
|
@@ -1790,7 +1965,7 @@ function isSkippableLine(line) {
|
|
|
1790
1965
|
function parsePropertyLine(line) {
|
|
1791
1966
|
const [key, ...valueParts] = line.split("=");
|
|
1792
1967
|
return {
|
|
1793
|
-
key: _optionalChain([key, 'optionalAccess',
|
|
1968
|
+
key: _optionalChain([key, 'optionalAccess', _93 => _93.trim, 'call', _94 => _94()]) || "",
|
|
1794
1969
|
value: valueParts.join("=").trim()
|
|
1795
1970
|
};
|
|
1796
1971
|
}
|
|
@@ -1876,7 +2051,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1876
2051
|
if (rootTranslationEntity.shouldTranslate === false) {
|
|
1877
2052
|
continue;
|
|
1878
2053
|
}
|
|
1879
|
-
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess',
|
|
2054
|
+
const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _95 => _95.localizations, 'optionalAccess', _96 => _96[locale]]);
|
|
1880
2055
|
if (langTranslationEntity) {
|
|
1881
2056
|
if ("stringUnit" in langTranslationEntity) {
|
|
1882
2057
|
resultData[translationKey] = langTranslationEntity.stringUnit.value;
|
|
@@ -1885,7 +2060,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1885
2060
|
resultData[translationKey] = {};
|
|
1886
2061
|
const pluralForms = langTranslationEntity.variations.plural;
|
|
1887
2062
|
for (const form in pluralForms) {
|
|
1888
|
-
if (_optionalChain([pluralForms, 'access',
|
|
2063
|
+
if (_optionalChain([pluralForms, 'access', _97 => _97[form], 'optionalAccess', _98 => _98.stringUnit, 'optionalAccess', _99 => _99.value])) {
|
|
1889
2064
|
resultData[translationKey][form] = pluralForms[form].stringUnit.value;
|
|
1890
2065
|
}
|
|
1891
2066
|
}
|
|
@@ -1908,7 +2083,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
|
|
|
1908
2083
|
const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
|
|
1909
2084
|
if (typeof value === "string") {
|
|
1910
2085
|
langDataToMerge.strings[key] = {
|
|
1911
|
-
extractionState: _optionalChain([originalInput, 'optionalAccess',
|
|
2086
|
+
extractionState: _optionalChain([originalInput, 'optionalAccess', _100 => _100.strings, 'optionalAccess', _101 => _101[key], 'optionalAccess', _102 => _102.extractionState]),
|
|
1912
2087
|
localizations: {
|
|
1913
2088
|
[locale]: {
|
|
1914
2089
|
stringUnit: {
|
|
@@ -2046,10 +2221,10 @@ function createUnlocalizableLoader(isCacheRestore = false, returnUnlocalizedKeys
|
|
|
2046
2221
|
}
|
|
2047
2222
|
}
|
|
2048
2223
|
return false;
|
|
2049
|
-
}).map(([key,
|
|
2050
|
-
const result = _lodash2.default.omitBy(input2, (
|
|
2224
|
+
}).map(([key, _33]) => key);
|
|
2225
|
+
const result = _lodash2.default.omitBy(input2, (_33, key) => passthroughKeys.includes(key));
|
|
2051
2226
|
if (returnUnlocalizedKeys) {
|
|
2052
|
-
result.unlocalizable = _lodash2.default.omitBy(input2, (
|
|
2227
|
+
result.unlocalizable = _lodash2.default.omitBy(input2, (_33, key) => !passthroughKeys.includes(key));
|
|
2053
2228
|
}
|
|
2054
2229
|
return result;
|
|
2055
2230
|
},
|
|
@@ -2088,7 +2263,7 @@ function createPoDataLoader(params) {
|
|
|
2088
2263
|
Object.entries(entries).forEach(([msgid, entry]) => {
|
|
2089
2264
|
if (msgid && entry.msgid) {
|
|
2090
2265
|
const context = entry.msgctxt || "";
|
|
2091
|
-
const fullEntry = _optionalChain([parsedPo, 'access',
|
|
2266
|
+
const fullEntry = _optionalChain([parsedPo, 'access', _103 => _103.translations, 'access', _104 => _104[context], 'optionalAccess', _105 => _105[msgid]]);
|
|
2092
2267
|
if (fullEntry) {
|
|
2093
2268
|
result[msgid] = fullEntry;
|
|
2094
2269
|
}
|
|
@@ -2098,8 +2273,8 @@ function createPoDataLoader(params) {
|
|
|
2098
2273
|
return result;
|
|
2099
2274
|
},
|
|
2100
2275
|
async push(locale, data, originalInput, originalLocale, pullInput) {
|
|
2101
|
-
const currentSections = _optionalChain([pullInput, 'optionalAccess',
|
|
2102
|
-
const originalSections = _optionalChain([originalInput, 'optionalAccess',
|
|
2276
|
+
const currentSections = _optionalChain([pullInput, 'optionalAccess', _106 => _106.split, 'call', _107 => _107("\n\n"), 'access', _108 => _108.filter, 'call', _109 => _109(Boolean)]) || [];
|
|
2277
|
+
const originalSections = _optionalChain([originalInput, 'optionalAccess', _110 => _110.split, 'call', _111 => _111("\n\n"), 'access', _112 => _112.filter, 'call', _113 => _113(Boolean)]) || [];
|
|
2103
2278
|
const result = originalSections.map((section) => {
|
|
2104
2279
|
const sectionPo = _gettextparser2.default.po.parse(section);
|
|
2105
2280
|
const contextKey = _lodash2.default.keys(sectionPo.translations)[0];
|
|
@@ -2164,8 +2339,8 @@ function createPoContentLoader() {
|
|
|
2164
2339
|
{
|
|
2165
2340
|
...entry,
|
|
2166
2341
|
msgstr: [
|
|
2167
|
-
_optionalChain([data, 'access',
|
|
2168
|
-
_optionalChain([data, 'access',
|
|
2342
|
+
_optionalChain([data, 'access', _114 => _114[entry.msgid], 'optionalAccess', _115 => _115.singular]),
|
|
2343
|
+
_optionalChain([data, 'access', _116 => _116[entry.msgid], 'optionalAccess', _117 => _117.plural]) || null
|
|
2169
2344
|
].filter(Boolean)
|
|
2170
2345
|
}
|
|
2171
2346
|
]).fromPairs().value();
|
|
@@ -2412,7 +2587,7 @@ function createDatoClient(params) {
|
|
|
2412
2587
|
only_valid: "true",
|
|
2413
2588
|
ids: !records.length ? void 0 : records.join(",")
|
|
2414
2589
|
}
|
|
2415
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2590
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _118 => _118.response, 'optionalAccess', _119 => _119.body, 'optionalAccess', _120 => _120.data, 'optionalAccess', _121 => _121[0]]) || error));
|
|
2416
2591
|
},
|
|
2417
2592
|
findRecordsForModel: async (modelId, records) => {
|
|
2418
2593
|
try {
|
|
@@ -2422,9 +2597,9 @@ function createDatoClient(params) {
|
|
|
2422
2597
|
filter: {
|
|
2423
2598
|
type: modelId,
|
|
2424
2599
|
only_valid: "true",
|
|
2425
|
-
ids: !_optionalChain([records, 'optionalAccess',
|
|
2600
|
+
ids: !_optionalChain([records, 'optionalAccess', _122 => _122.length]) ? void 0 : records.join(",")
|
|
2426
2601
|
}
|
|
2427
|
-
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2602
|
+
}).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _123 => _123.response, 'optionalAccess', _124 => _124.body, 'optionalAccess', _125 => _125.data, 'optionalAccess', _126 => _126[0]]) || error));
|
|
2428
2603
|
return result;
|
|
2429
2604
|
} catch (_error) {
|
|
2430
2605
|
throw new Error(
|
|
@@ -2438,9 +2613,9 @@ function createDatoClient(params) {
|
|
|
2438
2613
|
},
|
|
2439
2614
|
updateRecord: async (id, payload) => {
|
|
2440
2615
|
try {
|
|
2441
|
-
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2616
|
+
await dato.items.update(id, payload).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _127 => _127.response, 'optionalAccess', _128 => _128.body, 'optionalAccess', _129 => _129.data, 'optionalAccess', _130 => _130[0]]) || error));
|
|
2442
2617
|
} catch (_error) {
|
|
2443
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2618
|
+
if (_optionalChain([_error, 'optionalAccess', _131 => _131.attributes, 'optionalAccess', _132 => _132.details, 'optionalAccess', _133 => _133.message])) {
|
|
2444
2619
|
throw new Error(
|
|
2445
2620
|
[
|
|
2446
2621
|
`${_error.attributes.details.message}`,
|
|
@@ -2461,9 +2636,9 @@ function createDatoClient(params) {
|
|
|
2461
2636
|
},
|
|
2462
2637
|
enableFieldLocalization: async (args) => {
|
|
2463
2638
|
try {
|
|
2464
|
-
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess',
|
|
2639
|
+
await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch((error) => Promise.reject(_optionalChain([error, 'optionalAccess', _134 => _134.response, 'optionalAccess', _135 => _135.body, 'optionalAccess', _136 => _136.data, 'optionalAccess', _137 => _137[0]]) || error));
|
|
2465
2640
|
} catch (_error) {
|
|
2466
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2641
|
+
if (_optionalChain([_error, 'optionalAccess', _138 => _138.attributes, 'optionalAccess', _139 => _139.code]) === "NOT_FOUND") {
|
|
2467
2642
|
throw new Error(
|
|
2468
2643
|
[
|
|
2469
2644
|
`Field "${args.fieldId}" not found in model "${args.modelId}".`,
|
|
@@ -2471,7 +2646,7 @@ function createDatoClient(params) {
|
|
|
2471
2646
|
].join("\n\n")
|
|
2472
2647
|
);
|
|
2473
2648
|
}
|
|
2474
|
-
if (_optionalChain([_error, 'optionalAccess',
|
|
2649
|
+
if (_optionalChain([_error, 'optionalAccess', _140 => _140.attributes, 'optionalAccess', _141 => _141.details, 'optionalAccess', _142 => _142.message])) {
|
|
2475
2650
|
throw new Error(
|
|
2476
2651
|
[`${_error.attributes.details.message}`, `Error: ${JSON.stringify(_error, null, 2)}`].join("\n\n")
|
|
2477
2652
|
);
|
|
@@ -2537,7 +2712,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2537
2712
|
}
|
|
2538
2713
|
}
|
|
2539
2714
|
const records = await dato.findRecordsForModel(modelId);
|
|
2540
|
-
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access',
|
|
2715
|
+
const recordChoices = createRecordChoices(records, _optionalChain([config, 'access', _143 => _143.models, 'access', _144 => _144[modelId], 'optionalAccess', _145 => _145.records]) || [], project);
|
|
2541
2716
|
const selectedRecords = await promptRecordSelection(modelName, recordChoices);
|
|
2542
2717
|
result.models[modelId].records = records.filter((record) => selectedRecords.includes(record.id));
|
|
2543
2718
|
updatedConfig.models[modelId].records = selectedRecords;
|
|
@@ -2549,14 +2724,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
|
|
|
2549
2724
|
},
|
|
2550
2725
|
async pull(locale, input2, initCtx) {
|
|
2551
2726
|
const result = {};
|
|
2552
|
-
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess',
|
|
2553
|
-
let records = _optionalChain([initCtx, 'optionalAccess',
|
|
2727
|
+
for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _146 => _146.models]) || {})) {
|
|
2728
|
+
let records = _optionalChain([initCtx, 'optionalAccess', _147 => _147.models, 'access', _148 => _148[modelId], 'access', _149 => _149.records]) || [];
|
|
2554
2729
|
const recordIds = records.map((record) => record.id);
|
|
2555
2730
|
records = await dato.findRecords(recordIds);
|
|
2556
2731
|
console.log(`Fetched ${records.length} records for model ${modelId}`);
|
|
2557
2732
|
if (records.length > 0) {
|
|
2558
2733
|
result[modelId] = {
|
|
2559
|
-
fields: _optionalChain([initCtx, 'optionalAccess',
|
|
2734
|
+
fields: _optionalChain([initCtx, 'optionalAccess', _150 => _150.models, 'optionalAccess', _151 => _151[modelId], 'optionalAccess', _152 => _152.fields]) || [],
|
|
2560
2735
|
records
|
|
2561
2736
|
};
|
|
2562
2737
|
}
|
|
@@ -2615,7 +2790,7 @@ function createRecordChoices(records, selectedIds = [], project) {
|
|
|
2615
2790
|
return records.map((record) => ({
|
|
2616
2791
|
name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
|
|
2617
2792
|
value: record.id,
|
|
2618
|
-
checked: _optionalChain([selectedIds, 'optionalAccess',
|
|
2793
|
+
checked: _optionalChain([selectedIds, 'optionalAccess', _153 => _153.includes, 'call', _154 => _154(record.id)])
|
|
2619
2794
|
}));
|
|
2620
2795
|
}
|
|
2621
2796
|
async function promptRecordSelection(modelName, choices) {
|
|
@@ -2882,7 +3057,7 @@ var _nodewebvtt = require('node-webvtt'); var _nodewebvtt2 = _interopRequireDefa
|
|
|
2882
3057
|
function createVttLoader() {
|
|
2883
3058
|
return createLoader({
|
|
2884
3059
|
async pull(locale, input2) {
|
|
2885
|
-
const vtt = _optionalChain([_nodewebvtt2.default, 'access',
|
|
3060
|
+
const vtt = _optionalChain([_nodewebvtt2.default, 'access', _155 => _155.parse, 'call', _156 => _156(input2), 'optionalAccess', _157 => _157.cues]);
|
|
2886
3061
|
if (Object.keys(vtt).length === 0) {
|
|
2887
3062
|
return {};
|
|
2888
3063
|
} else {
|
|
@@ -2936,7 +3111,7 @@ function variableExtractLoader(params) {
|
|
|
2936
3111
|
for (let i = 0; i < matches.length; i++) {
|
|
2937
3112
|
const match = matches[i];
|
|
2938
3113
|
const currentValue = result[key].value;
|
|
2939
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
3114
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _158 => _158.replace, 'call', _159 => _159(match, `{variable:${i}}`)]);
|
|
2940
3115
|
result[key].value = newValue;
|
|
2941
3116
|
result[key].variables[i] = match;
|
|
2942
3117
|
}
|
|
@@ -2950,7 +3125,7 @@ function variableExtractLoader(params) {
|
|
|
2950
3125
|
for (let i = 0; i < valueObj.variables.length; i++) {
|
|
2951
3126
|
const variable = valueObj.variables[i];
|
|
2952
3127
|
const currentValue = result[key];
|
|
2953
|
-
const newValue = _optionalChain([currentValue, 'optionalAccess',
|
|
3128
|
+
const newValue = _optionalChain([currentValue, 'optionalAccess', _160 => _160.replace, 'call', _161 => _161(`{variable:${i}}`, variable)]);
|
|
2954
3129
|
result[key] = newValue;
|
|
2955
3130
|
}
|
|
2956
3131
|
}
|
|
@@ -3133,7 +3308,7 @@ function createVueJsonLoader() {
|
|
|
3133
3308
|
return createLoader({
|
|
3134
3309
|
pull: async (locale, input2, ctx) => {
|
|
3135
3310
|
const parsed = parseVueFile(input2);
|
|
3136
|
-
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess',
|
|
3311
|
+
return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _162 => _162.i18n, 'optionalAccess', _163 => _163[locale]]), () => ( {}));
|
|
3137
3312
|
},
|
|
3138
3313
|
push: async (locale, data, originalInput) => {
|
|
3139
3314
|
const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
|
|
@@ -3314,7 +3489,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
|
|
|
3314
3489
|
objectExpression.properties.forEach((prop) => {
|
|
3315
3490
|
if (!t.isObjectProperty(prop)) return;
|
|
3316
3491
|
const key = getPropertyKey(prop);
|
|
3317
|
-
const incomingVal = _optionalChain([data, 'optionalAccess',
|
|
3492
|
+
const incomingVal = _optionalChain([data, 'optionalAccess', _164 => _164[key]]);
|
|
3318
3493
|
if (incomingVal === void 0) {
|
|
3319
3494
|
return;
|
|
3320
3495
|
}
|
|
@@ -3350,7 +3525,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
|
|
|
3350
3525
|
let modified = false;
|
|
3351
3526
|
arrayExpression.elements.forEach((element, index) => {
|
|
3352
3527
|
if (!element) return;
|
|
3353
|
-
const incomingVal = _optionalChain([incoming, 'optionalAccess',
|
|
3528
|
+
const incomingVal = _optionalChain([incoming, 'optionalAccess', _165 => _165[index]]);
|
|
3354
3529
|
if (incomingVal === void 0) return;
|
|
3355
3530
|
if (t.isStringLiteral(element) && typeof incomingVal === "string") {
|
|
3356
3531
|
if (element.value !== incomingVal) {
|
|
@@ -3626,7 +3801,7 @@ function createMdxSectionsSplit2Loader() {
|
|
|
3626
3801
|
const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
|
|
3627
3802
|
const result = {
|
|
3628
3803
|
frontmatter: data.frontmatter,
|
|
3629
|
-
codePlaceholders: _optionalChain([pullInput, 'optionalAccess',
|
|
3804
|
+
codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _166 => _166.codePlaceholders]) || {},
|
|
3630
3805
|
content
|
|
3631
3806
|
};
|
|
3632
3807
|
return result;
|
|
@@ -3969,14 +4144,14 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
|
|
|
3969
4144
|
}
|
|
3970
4145
|
|
|
3971
4146
|
// src/cli/cmd/i18n.ts
|
|
3972
|
-
|
|
4147
|
+
|
|
3973
4148
|
var _diff = require('diff');
|
|
3974
4149
|
|
|
3975
4150
|
var _externaleditor = require('external-editor'); var _externaleditor2 = _interopRequireDefault(_externaleditor);
|
|
3976
4151
|
|
|
3977
4152
|
// src/cli/processor/index.ts
|
|
3978
4153
|
|
|
3979
|
-
|
|
4154
|
+
|
|
3980
4155
|
|
|
3981
4156
|
// src/cli/processor/lingo.ts
|
|
3982
4157
|
var __sdk = require('@lingo.dev/_sdk');
|
|
@@ -4069,7 +4244,7 @@ function createBasicTranslator(model, systemPrompt) {
|
|
|
4069
4244
|
]
|
|
4070
4245
|
});
|
|
4071
4246
|
const result = JSON.parse(response.text);
|
|
4072
|
-
return _optionalChain([result, 'optionalAccess',
|
|
4247
|
+
return _optionalChain([result, 'optionalAccess', _167 => _167.data]) || {};
|
|
4073
4248
|
}
|
|
4074
4249
|
}
|
|
4075
4250
|
function extractPayloadChunks(payload) {
|
|
@@ -4151,7 +4326,7 @@ function getPureModelProvider(provider) {
|
|
|
4151
4326
|
|
|
4152
4327
|
${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
|
|
4153
4328
|
`;
|
|
4154
|
-
switch (_optionalChain([provider, 'optionalAccess',
|
|
4329
|
+
switch (_optionalChain([provider, 'optionalAccess', _168 => _168.id])) {
|
|
4155
4330
|
case "openai":
|
|
4156
4331
|
if (!process.env.OPENAI_API_KEY) {
|
|
4157
4332
|
throw new Error(
|
|
@@ -4172,7 +4347,7 @@ function getPureModelProvider(provider) {
|
|
|
4172
4347
|
apiKey: process.env.ANTHROPIC_API_KEY
|
|
4173
4348
|
})(provider.model);
|
|
4174
4349
|
default:
|
|
4175
|
-
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess',
|
|
4350
|
+
throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _169 => _169.id])));
|
|
4176
4351
|
}
|
|
4177
4352
|
}
|
|
4178
4353
|
|
|
@@ -4396,7 +4571,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
4396
4571
|
validateParams(i18nConfig, flags);
|
|
4397
4572
|
ora.succeed("Localization configuration is valid");
|
|
4398
4573
|
ora.start("Connecting to Lingo.dev Localization Engine...");
|
|
4399
|
-
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess',
|
|
4574
|
+
const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _170 => _170.provider]);
|
|
4400
4575
|
if (isByokMode) {
|
|
4401
4576
|
authId = null;
|
|
4402
4577
|
ora.succeed("Using external provider (BYOK mode)");
|
|
@@ -4410,16 +4585,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
4410
4585
|
flags
|
|
4411
4586
|
});
|
|
4412
4587
|
let buckets = getBuckets(i18nConfig);
|
|
4413
|
-
if (_optionalChain([flags, 'access',
|
|
4588
|
+
if (_optionalChain([flags, 'access', _171 => _171.bucket, 'optionalAccess', _172 => _172.length])) {
|
|
4414
4589
|
buckets = buckets.filter(
|
|
4415
4590
|
(bucket) => flags.bucket.includes(bucket.type)
|
|
4416
4591
|
);
|
|
4417
4592
|
}
|
|
4418
4593
|
ora.succeed("Buckets retrieved");
|
|
4419
|
-
if (_optionalChain([flags, 'access',
|
|
4594
|
+
if (_optionalChain([flags, 'access', _173 => _173.file, 'optionalAccess', _174 => _174.length])) {
|
|
4420
4595
|
buckets = buckets.map((bucket) => {
|
|
4421
4596
|
const paths = bucket.paths.filter(
|
|
4422
|
-
(path16) => flags.file.find((file) => _optionalChain([path16, 'access',
|
|
4597
|
+
(path16) => flags.file.find((file) => _optionalChain([path16, 'access', _175 => _175.pathPattern, 'optionalAccess', _176 => _176.includes, 'call', _177 => _177(file)]))
|
|
4423
4598
|
);
|
|
4424
4599
|
return { ...bucket, paths };
|
|
4425
4600
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
@@ -4438,7 +4613,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
4438
4613
|
});
|
|
4439
4614
|
}
|
|
4440
4615
|
}
|
|
4441
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
4616
|
+
const targetLocales = _optionalChain([flags, 'access', _178 => _178.locale, 'optionalAccess', _179 => _179.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
4442
4617
|
ora.start("Setting up localization cache...");
|
|
4443
4618
|
const checkLockfileProcessor = createDeltaProcessor("");
|
|
4444
4619
|
const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
|
|
@@ -4612,7 +4787,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
|
|
|
4612
4787
|
if (flags.key) {
|
|
4613
4788
|
processableData = _lodash2.default.pickBy(
|
|
4614
4789
|
processableData,
|
|
4615
|
-
(
|
|
4790
|
+
(_33, key) => key === flags.key
|
|
4616
4791
|
);
|
|
4617
4792
|
}
|
|
4618
4793
|
if (flags.verbose) {
|
|
@@ -4782,12 +4957,12 @@ function validateParams(i18nConfig, flags) {
|
|
|
4782
4957
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
4783
4958
|
docUrl: "bucketNotFound"
|
|
4784
4959
|
});
|
|
4785
|
-
} else if (_optionalChain([flags, 'access',
|
|
4960
|
+
} else if (_optionalChain([flags, 'access', _180 => _180.locale, 'optionalAccess', _181 => _181.some, 'call', _182 => _182((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
4786
4961
|
throw new CLIError({
|
|
4787
4962
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
4788
4963
|
docUrl: "localeTargetNotFound"
|
|
4789
4964
|
});
|
|
4790
|
-
} else if (_optionalChain([flags, 'access',
|
|
4965
|
+
} else if (_optionalChain([flags, 'access', _183 => _183.bucket, 'optionalAccess', _184 => _184.some, 'call', _185 => _185(
|
|
4791
4966
|
(bucket) => !i18nConfig.buckets[bucket]
|
|
4792
4967
|
)])) {
|
|
4793
4968
|
throw new CLIError({
|
|
@@ -5115,7 +5290,7 @@ var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
|
5115
5290
|
var _mcpjs = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
5116
5291
|
|
|
5117
5292
|
|
|
5118
|
-
var mcp_default = new (0, _interactivecommander.Command)().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (
|
|
5293
|
+
var mcp_default = new (0, _interactivecommander.Command)().command("mcp").description("Use Lingo.dev model context provider with your AI agent").helpOption("-h, --help", "Show help").action(async (_33, program) => {
|
|
5119
5294
|
const apiKey = program.args[0];
|
|
5120
5295
|
const settings = getSettings(apiKey);
|
|
5121
5296
|
if (!settings.auth.apiKey) {
|
|
@@ -5252,7 +5427,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
5252
5427
|
_child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
|
|
5253
5428
|
_child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
|
|
5254
5429
|
_child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
|
|
5255
|
-
_optionalChain([this, 'access',
|
|
5430
|
+
_optionalChain([this, 'access', _186 => _186.platformKit, 'optionalAccess', _187 => _187.gitConfig, 'call', _188 => _188()]);
|
|
5256
5431
|
_child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
|
|
5257
5432
|
_child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
|
|
5258
5433
|
if (!processOwnCommits) {
|
|
@@ -5284,7 +5459,7 @@ var InBranchFlow = class extends IntegrationFlow {
|
|
|
5284
5459
|
// src/cli/cmd/ci/flows/pull-request.ts
|
|
5285
5460
|
var PullRequestFlow = class extends InBranchFlow {
|
|
5286
5461
|
async preRun() {
|
|
5287
|
-
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall',
|
|
5462
|
+
const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _189 => _189()]);
|
|
5288
5463
|
if (!canContinue) {
|
|
5289
5464
|
return false;
|
|
5290
5465
|
}
|
|
@@ -5536,10 +5711,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
|
|
|
5536
5711
|
repo_slug: this.platformConfig.repositoryName,
|
|
5537
5712
|
state: "OPEN"
|
|
5538
5713
|
}).then(({ data: { values } }) => {
|
|
5539
|
-
return _optionalChain([values, 'optionalAccess',
|
|
5540
|
-
({ source, destination }) => _optionalChain([source, 'optionalAccess',
|
|
5714
|
+
return _optionalChain([values, 'optionalAccess', _190 => _190.find, 'call', _191 => _191(
|
|
5715
|
+
({ source, destination }) => _optionalChain([source, 'optionalAccess', _192 => _192.branch, 'optionalAccess', _193 => _193.name]) === branch && _optionalChain([destination, 'optionalAccess', _194 => _194.branch, 'optionalAccess', _195 => _195.name]) === this.platformConfig.baseBranchName
|
|
5541
5716
|
)]);
|
|
5542
|
-
}).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
5717
|
+
}).then((pr) => _optionalChain([pr, 'optionalAccess', _196 => _196.id]));
|
|
5543
5718
|
}
|
|
5544
5719
|
async closePullRequest({ pullRequestNumber }) {
|
|
5545
5720
|
await this.bb.repositories.declinePullRequest({
|
|
@@ -5635,7 +5810,7 @@ var GitHubPlatformKit = class extends PlatformKit {
|
|
|
5635
5810
|
repo: this.platformConfig.repositoryName,
|
|
5636
5811
|
base: this.platformConfig.baseBranchName,
|
|
5637
5812
|
state: "open"
|
|
5638
|
-
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess',
|
|
5813
|
+
}).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _197 => _197.number]));
|
|
5639
5814
|
}
|
|
5640
5815
|
async closePullRequest({ pullRequestNumber }) {
|
|
5641
5816
|
await this.octokit.rest.pulls.update({
|
|
@@ -5762,7 +5937,7 @@ var GitlabPlatformKit = class extends PlatformKit {
|
|
|
5762
5937
|
sourceBranch: branch,
|
|
5763
5938
|
state: "opened"
|
|
5764
5939
|
});
|
|
5765
|
-
return _optionalChain([mergeRequests, 'access',
|
|
5940
|
+
return _optionalChain([mergeRequests, 'access', _198 => _198[0], 'optionalAccess', _199 => _199.iid]);
|
|
5766
5941
|
}
|
|
5767
5942
|
async closePullRequest({
|
|
5768
5943
|
pullRequestNumber
|
|
@@ -5846,7 +6021,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5846
6021
|
}
|
|
5847
6022
|
const env = {
|
|
5848
6023
|
LINGODOTDEV_API_KEY: settings.auth.apiKey,
|
|
5849
|
-
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access',
|
|
6024
|
+
LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _200 => _200.pullRequest, 'optionalAccess', _201 => _201.toString, 'call', _202 => _202()]) || "false",
|
|
5850
6025
|
...options.commitMessage && {
|
|
5851
6026
|
LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
|
|
5852
6027
|
},
|
|
@@ -5866,7 +6041,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5866
6041
|
const { isPullRequestMode } = platformKit.config;
|
|
5867
6042
|
ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
|
|
5868
6043
|
const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
|
|
5869
|
-
const canRun = await _optionalChain([flow, 'access',
|
|
6044
|
+
const canRun = await _optionalChain([flow, 'access', _203 => _203.preRun, 'optionalCall', _204 => _204()]);
|
|
5870
6045
|
if (canRun === false) {
|
|
5871
6046
|
return;
|
|
5872
6047
|
}
|
|
@@ -5874,7 +6049,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
|
|
|
5874
6049
|
if (!hasChanges) {
|
|
5875
6050
|
return;
|
|
5876
6051
|
}
|
|
5877
|
-
await _optionalChain([flow, 'access',
|
|
6052
|
+
await _optionalChain([flow, 'access', _205 => _205.postRun, 'optionalCall', _206 => _206()]);
|
|
5878
6053
|
});
|
|
5879
6054
|
|
|
5880
6055
|
// src/cli/cmd/status.ts
|
|
@@ -5918,13 +6093,13 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5918
6093
|
flags
|
|
5919
6094
|
});
|
|
5920
6095
|
let buckets = getBuckets(i18nConfig);
|
|
5921
|
-
if (_optionalChain([flags, 'access',
|
|
6096
|
+
if (_optionalChain([flags, 'access', _207 => _207.bucket, 'optionalAccess', _208 => _208.length])) {
|
|
5922
6097
|
buckets = buckets.filter((bucket) => flags.bucket.includes(bucket.type));
|
|
5923
6098
|
}
|
|
5924
6099
|
ora.succeed("Buckets retrieved");
|
|
5925
|
-
if (_optionalChain([flags, 'access',
|
|
6100
|
+
if (_optionalChain([flags, 'access', _209 => _209.file, 'optionalAccess', _210 => _210.length])) {
|
|
5926
6101
|
buckets = buckets.map((bucket) => {
|
|
5927
|
-
const paths = bucket.paths.filter((path16) => flags.file.find((file) => _optionalChain([path16, 'access',
|
|
6102
|
+
const paths = bucket.paths.filter((path16) => flags.file.find((file) => _optionalChain([path16, 'access', _211 => _211.pathPattern, 'optionalAccess', _212 => _212.match, 'call', _213 => _213(file)])));
|
|
5928
6103
|
return { ...bucket, paths };
|
|
5929
6104
|
}).filter((bucket) => bucket.paths.length > 0);
|
|
5930
6105
|
if (buckets.length === 0) {
|
|
@@ -5940,7 +6115,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
|
|
|
5940
6115
|
});
|
|
5941
6116
|
}
|
|
5942
6117
|
}
|
|
5943
|
-
const targetLocales = _optionalChain([flags, 'access',
|
|
6118
|
+
const targetLocales = _optionalChain([flags, 'access', _214 => _214.locale, 'optionalAccess', _215 => _215.length]) ? flags.locale : i18nConfig.locale.targets;
|
|
5944
6119
|
let totalSourceKeyCount = 0;
|
|
5945
6120
|
let uniqueKeysToTranslate = 0;
|
|
5946
6121
|
let totalExistingTranslations = 0;
|
|
@@ -6281,12 +6456,12 @@ function validateParams2(i18nConfig, flags) {
|
|
|
6281
6456
|
message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
|
|
6282
6457
|
docUrl: "bucketNotFound"
|
|
6283
6458
|
});
|
|
6284
|
-
} else if (_optionalChain([flags, 'access',
|
|
6459
|
+
} else if (_optionalChain([flags, 'access', _216 => _216.locale, 'optionalAccess', _217 => _217.some, 'call', _218 => _218((locale) => !i18nConfig.locale.targets.includes(locale))])) {
|
|
6285
6460
|
throw new CLIError({
|
|
6286
6461
|
message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
|
|
6287
6462
|
docUrl: "localeTargetNotFound"
|
|
6288
6463
|
});
|
|
6289
|
-
} else if (_optionalChain([flags, 'access',
|
|
6464
|
+
} else if (_optionalChain([flags, 'access', _219 => _219.bucket, 'optionalAccess', _220 => _220.some, 'call', _221 => _221((bucket) => !i18nConfig.buckets[bucket])])) {
|
|
6290
6465
|
throw new CLIError({
|
|
6291
6466
|
message: `One or more specified buckets do not exist in i18n.json. Please add them to the list and try again.`,
|
|
6292
6467
|
docUrl: "bucketNotFound"
|
|
@@ -6369,7 +6544,7 @@ async function renderHero() {
|
|
|
6369
6544
|
// package.json
|
|
6370
6545
|
var package_default = {
|
|
6371
6546
|
name: "lingo.dev",
|
|
6372
|
-
version: "0.92.
|
|
6547
|
+
version: "0.92.17",
|
|
6373
6548
|
description: "Lingo.dev CLI",
|
|
6374
6549
|
private: false,
|
|
6375
6550
|
publishConfig: {
|
|
@@ -6584,7 +6759,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
|
|
|
6584
6759
|
const response = await engine.whoami();
|
|
6585
6760
|
return {
|
|
6586
6761
|
authenticated: !!response,
|
|
6587
|
-
username: _optionalChain([response, 'optionalAccess',
|
|
6762
|
+
username: _optionalChain([response, 'optionalAccess', _222 => _222.email])
|
|
6588
6763
|
};
|
|
6589
6764
|
} catch (e3) {
|
|
6590
6765
|
return { authenticated: false };
|
|
@@ -6769,14 +6944,14 @@ async function setup(input2) {
|
|
|
6769
6944
|
throw new Error(
|
|
6770
6945
|
"No buckets found in i18n.json. Please add at least one bucket containing i18n content."
|
|
6771
6946
|
);
|
|
6772
|
-
} else if (_optionalChain([ctx, 'access',
|
|
6773
|
-
(locale) => !_optionalChain([ctx, 'access',
|
|
6947
|
+
} else if (_optionalChain([ctx, 'access', _223 => _223.flags, 'access', _224 => _224.locale, 'optionalAccess', _225 => _225.some, 'call', _226 => _226(
|
|
6948
|
+
(locale) => !_optionalChain([ctx, 'access', _227 => _227.config, 'optionalAccess', _228 => _228.locale, 'access', _229 => _229.targets, 'access', _230 => _230.includes, 'call', _231 => _231(locale)])
|
|
6774
6949
|
)])) {
|
|
6775
6950
|
throw new Error(
|
|
6776
6951
|
`One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list first and try again.`
|
|
6777
6952
|
);
|
|
6778
|
-
} else if (_optionalChain([ctx, 'access',
|
|
6779
|
-
(bucket) => !_optionalChain([ctx, 'access',
|
|
6953
|
+
} else if (_optionalChain([ctx, 'access', _232 => _232.flags, 'access', _233 => _233.bucket, 'optionalAccess', _234 => _234.some, 'call', _235 => _235(
|
|
6954
|
+
(bucket) => !_optionalChain([ctx, 'access', _236 => _236.config, 'optionalAccess', _237 => _237.buckets, 'access', _238 => _238[bucket]])
|
|
6780
6955
|
)])) {
|
|
6781
6956
|
throw new Error(
|
|
6782
6957
|
`One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
|
|
@@ -6788,7 +6963,7 @@ async function setup(input2) {
|
|
|
6788
6963
|
{
|
|
6789
6964
|
title: "Selecting localization provider",
|
|
6790
6965
|
task: async (ctx, task) => {
|
|
6791
|
-
ctx.localizer = createLocalizer(_optionalChain([ctx, 'access',
|
|
6966
|
+
ctx.localizer = createLocalizer(_optionalChain([ctx, 'access', _239 => _239.config, 'optionalAccess', _240 => _240.provider]));
|
|
6792
6967
|
if (!ctx.localizer) {
|
|
6793
6968
|
throw new Error(
|
|
6794
6969
|
"Could not create localization provider. Please check your i18n.json configuration."
|
|
@@ -6974,7 +7149,7 @@ async function execute(input2) {
|
|
|
6974
7149
|
const workerTasks = [];
|
|
6975
7150
|
for (let i = 0; i < workersCount; i++) {
|
|
6976
7151
|
const assignedTasks = ctx.tasks.filter(
|
|
6977
|
-
(
|
|
7152
|
+
(_33, idx) => idx % workersCount === i
|
|
6978
7153
|
);
|
|
6979
7154
|
workerTasks.push(
|
|
6980
7155
|
createWorkerTask({
|
|
@@ -7309,7 +7484,7 @@ ${_gradientstring.vice.call(void 0,
|
|
|
7309
7484
|
|
|
7310
7485
|
Star the the repo :) https://github.com/LingoDotDev/lingo.dev
|
|
7311
7486
|
`
|
|
7312
|
-
).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).addCommand(may_the_fourth_default, { hidden: true }).addCommand(run_default, { hidden: true }).exitOverride((err) => {
|
|
7487
|
+
).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(config_default2).addCommand(lockfile_default).addCommand(cleanup_default).addCommand(mcp_default).addCommand(ci_default).addCommand(status_default).addCommand(may_the_fourth_default, { hidden: true }).addCommand(run_default, { hidden: true }).exitOverride((err) => {
|
|
7313
7488
|
if (err.code === "commander.helpDisplayed" || err.code === "commander.version" || err.code === "commander.help") {
|
|
7314
7489
|
process.exit(0);
|
|
7315
7490
|
}
|