lingo.dev 0.72.0 → 0.73.1

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 CHANGED
@@ -1298,17 +1298,23 @@ async function loadPrettierConfig() {
1298
1298
  var _isurl = require('is-url'); var _isurl2 = _interopRequireDefault(_isurl);
1299
1299
  var _datefns = require('date-fns');
1300
1300
  function createUnlocalizableLoader() {
1301
+ const rules = {
1302
+ isEmpty: (v) => _lodash2.default.isEmpty(v),
1303
+ isNumber: (v) => !_lodash2.default.isNaN(_lodash2.default.toNumber(v)),
1304
+ isBoolean: (v) => _lodash2.default.isBoolean(v),
1305
+ isIsoDate: (v) => _lodash2.default.isString(v) && _isIsoDate(v),
1306
+ isSystemId: (v) => _lodash2.default.isString(v) && _isSystemId(v),
1307
+ isUrl: (v) => _lodash2.default.isString(v) && _isurl2.default.call(void 0, v)
1308
+ };
1301
1309
  return createLoader({
1302
1310
  async pull(locale, input) {
1303
1311
  const passthroughKeys = Object.entries(input).filter(([key, value]) => {
1304
- return [
1305
- (v) => _lodash2.default.isEmpty(v),
1306
- (v) => _lodash2.default.isString(v) && _isIsoDate(v),
1307
- (v) => !_lodash2.default.isNaN(_lodash2.default.toNumber(v)),
1308
- (v) => _lodash2.default.isBoolean(v),
1309
- (v) => _lodash2.default.isString(v) && _isSystemId(v),
1310
- (v) => _lodash2.default.isString(v) && _isurl2.default.call(void 0, v)
1311
- ].some((fn) => fn(value));
1312
+ for (const [ruleName, rule] of Object.entries(rules)) {
1313
+ if (rule(value)) {
1314
+ return true;
1315
+ }
1316
+ }
1317
+ return false;
1312
1318
  }).map(([key, _19]) => key);
1313
1319
  const result = _lodash2.default.omitBy(input, (_19, key) => passthroughKeys.includes(key));
1314
1320
  return result;
@@ -2257,7 +2263,14 @@ ${currentIndent}]`;
2257
2263
 
2258
2264
  ${currentIndent}}`;
2259
2265
  }
2260
- const items = keys.map((key) => {
2266
+ const sortedKeys = keys.sort((a, b) => {
2267
+ const aIsWhitespace = /^\s*$/.test(a);
2268
+ const bIsWhitespace = /^\s*$/.test(b);
2269
+ if (aIsWhitespace && !bIsWhitespace) return -1;
2270
+ if (!aIsWhitespace && bIsWhitespace) return 1;
2271
+ return a.localeCompare(b, void 0, { numeric: false });
2272
+ });
2273
+ const items = sortedKeys.map((key) => {
2261
2274
  const value = data[key];
2262
2275
  return `${nextIndent}${JSON.stringify(key)} : ${format(value, level + 1)}`;
2263
2276
  });
@@ -2265,7 +2278,8 @@ ${currentIndent}}`;
2265
2278
  ${items.join(",\n")}
2266
2279
  ${currentIndent}}`;
2267
2280
  }
2268
- return format(jsonData);
2281
+ const result = format(jsonData);
2282
+ return result;
2269
2283
  }
2270
2284
  function detectIndentation(jsonStr) {
2271
2285
  const match = jsonStr.match(/\n(\s+)/);
@@ -2281,7 +2295,6 @@ function createPlutilJsonTextLoader() {
2281
2295
  async push(locale, data, originalInput) {
2282
2296
  const jsonData = JSON.parse(data);
2283
2297
  const result = formatPlutilStyle(jsonData, originalInput || "");
2284
- console.log(result[result.length - 1]);
2285
2298
  return result;
2286
2299
  }
2287
2300
  });
@@ -3167,7 +3180,7 @@ function displaySummary(results) {
3167
3180
  // package.json
3168
3181
  var package_default = {
3169
3182
  name: "lingo.dev",
3170
- version: "0.72.0",
3183
+ version: "0.73.1",
3171
3184
  description: "Lingo.dev CLI",
3172
3185
  private: false,
3173
3186
  type: "module",
@@ -3227,7 +3240,7 @@ var package_default = {
3227
3240
  "gradient-string": "^3.0.0",
3228
3241
  "gray-matter": "^4.0.3",
3229
3242
  ini: "^5.0.0",
3230
- inquirer: "^12.3.0",
3243
+ inquirer: "^12.3.2",
3231
3244
  "interactive-commander": "^0.5.194",
3232
3245
  "is-url": "^1.2.4",
3233
3246
  jsdom: "^25.0.1",
@@ -3236,7 +3249,7 @@ var package_default = {
3236
3249
  lodash: "^4.17.21",
3237
3250
  "markdown-it": "^14.1.0",
3238
3251
  "markdown-it-front-matter": "^0.2.4",
3239
- marked: "^15.0.4",
3252
+ marked: "^15.0.6",
3240
3253
  "node-webvtt": "^1.9.4",
3241
3254
  "object-hash": "^3.0.0",
3242
3255
  open: "^10.1.0",
@@ -3253,14 +3266,14 @@ var package_default = {
3253
3266
  xml2js: "^0.6.2",
3254
3267
  xmldom: "^0.6.0",
3255
3268
  xpath: "^0.0.34",
3256
- yaml: "^2.6.1",
3269
+ yaml: "^2.7.0",
3257
3270
  zod: "^3.24.1"
3258
3271
  },
3259
3272
  devDependencies: {
3260
3273
  "@lingo.dev/sdk": "workspace:*",
3261
3274
  "@lingo.dev/spec": "workspace:*",
3262
3275
  "@types/cors": "^2.8.17",
3263
- "@types/diff": "^6.0.0",
3276
+ "@types/diff": "^7.0.0",
3264
3277
  "@types/express": "^5.0.0",
3265
3278
  "@types/figlet": "^1.7.0",
3266
3279
  "@types/gettext-parser": "^4.0.4",