oh-my-customcode 0.65.1 → 0.65.2
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/dist/cli/index.js +102 -84
- package/dist/index.js +3 -3
- package/package.json +3 -3
- package/templates/manifest.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -9325,7 +9325,7 @@ var init_package = __esm(() => {
|
|
|
9325
9325
|
workspaces: [
|
|
9326
9326
|
"packages/*"
|
|
9327
9327
|
],
|
|
9328
|
-
version: "0.65.
|
|
9328
|
+
version: "0.65.2",
|
|
9329
9329
|
description: "Batteries-included agent harness for Claude Code",
|
|
9330
9330
|
type: "module",
|
|
9331
9331
|
bin: {
|
|
@@ -9369,7 +9369,7 @@ var init_package = __esm(() => {
|
|
|
9369
9369
|
"@clack/prompts": "^1.1.0",
|
|
9370
9370
|
"@inquirer/prompts": "^8.3.2",
|
|
9371
9371
|
commander: "^14.0.2",
|
|
9372
|
-
i18next: "^
|
|
9372
|
+
i18next: "^26.0.2",
|
|
9373
9373
|
yaml: "^2.8.2"
|
|
9374
9374
|
},
|
|
9375
9375
|
devDependencies: {
|
|
@@ -9380,7 +9380,7 @@ var init_package = __esm(() => {
|
|
|
9380
9380
|
"@types/nodemailer": "^7.0.9",
|
|
9381
9381
|
"js-yaml": "^4.1.0",
|
|
9382
9382
|
nodemailer: "^8.0.1",
|
|
9383
|
-
typescript: "^
|
|
9383
|
+
typescript: "^6.0.2",
|
|
9384
9384
|
vitepress: "^1.6.4"
|
|
9385
9385
|
},
|
|
9386
9386
|
keywords: [
|
|
@@ -22266,7 +22266,7 @@ import { homedir } from "node:os";
|
|
|
22266
22266
|
import { dirname, join } from "node:path";
|
|
22267
22267
|
import { createInterface } from "node:readline/promises";
|
|
22268
22268
|
|
|
22269
|
-
// node_modules/.bun/i18next@
|
|
22269
|
+
// node_modules/.bun/i18next@26.0.2+8e24a2f921b8d7be/node_modules/i18next/dist/esm/i18next.js
|
|
22270
22270
|
var isString = (obj) => typeof obj === "string";
|
|
22271
22271
|
var defer = () => {
|
|
22272
22272
|
let res;
|
|
@@ -22282,7 +22282,7 @@ var defer = () => {
|
|
|
22282
22282
|
var makeString = (object) => {
|
|
22283
22283
|
if (object == null)
|
|
22284
22284
|
return "";
|
|
22285
|
-
return
|
|
22285
|
+
return String(object);
|
|
22286
22286
|
};
|
|
22287
22287
|
var copy = (a, s, t) => {
|
|
22288
22288
|
a.forEach((m) => {
|
|
@@ -22291,7 +22291,7 @@ var copy = (a, s, t) => {
|
|
|
22291
22291
|
});
|
|
22292
22292
|
};
|
|
22293
22293
|
var lastOfPathSeparatorRegExp = /###/g;
|
|
22294
|
-
var cleanKey = (key) => key && key.
|
|
22294
|
+
var cleanKey = (key) => key && key.includes("###") ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
|
|
22295
22295
|
var canNotTraverseDeeper = (object) => !object || isString(object);
|
|
22296
22296
|
var getLastOfPath = (object, path, Empty) => {
|
|
22297
22297
|
const stack = !isString(path) ? path : path.split(".");
|
|
@@ -22422,7 +22422,7 @@ var looksLikeObjectPathRegExpCache = new RegExpCache(20);
|
|
|
22422
22422
|
var looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
|
|
22423
22423
|
nsSeparator = nsSeparator || "";
|
|
22424
22424
|
keySeparator = keySeparator || "";
|
|
22425
|
-
const possibleChars = chars.filter((c) => nsSeparator.
|
|
22425
|
+
const possibleChars = chars.filter((c) => !nsSeparator.includes(c) && !keySeparator.includes(c));
|
|
22426
22426
|
if (possibleChars.length === 0)
|
|
22427
22427
|
return true;
|
|
22428
22428
|
const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c) => c === "?" ? "\\?" : c).join("|")})`);
|
|
@@ -22458,7 +22458,7 @@ var deepFind = (obj, path, keySeparator = ".") => {
|
|
|
22458
22458
|
nextPath += tokens[j];
|
|
22459
22459
|
next = current[nextPath];
|
|
22460
22460
|
if (next !== undefined) {
|
|
22461
|
-
if (["string", "number", "boolean"].
|
|
22461
|
+
if (["string", "number", "boolean"].includes(typeof next) && j < tokens.length - 1) {
|
|
22462
22462
|
continue;
|
|
22463
22463
|
}
|
|
22464
22464
|
i += j - i + 1;
|
|
@@ -22469,7 +22469,7 @@ var deepFind = (obj, path, keySeparator = ".") => {
|
|
|
22469
22469
|
}
|
|
22470
22470
|
return current;
|
|
22471
22471
|
};
|
|
22472
|
-
var getCleanedCode = (code) => code?.replace(
|
|
22472
|
+
var getCleanedCode = (code) => code?.replace(/_/g, "-");
|
|
22473
22473
|
var consoleLogger = {
|
|
22474
22474
|
type: "logger",
|
|
22475
22475
|
log(args) {
|
|
@@ -22553,6 +22553,14 @@ class EventEmitter {
|
|
|
22553
22553
|
}
|
|
22554
22554
|
this.observers[event].delete(listener);
|
|
22555
22555
|
}
|
|
22556
|
+
once(event, listener) {
|
|
22557
|
+
const wrapper = (...args) => {
|
|
22558
|
+
listener(...args);
|
|
22559
|
+
this.off(event, wrapper);
|
|
22560
|
+
};
|
|
22561
|
+
this.on(event, wrapper);
|
|
22562
|
+
return this;
|
|
22563
|
+
}
|
|
22556
22564
|
emit(event, ...args) {
|
|
22557
22565
|
if (this.observers[event]) {
|
|
22558
22566
|
const cloned = Array.from(this.observers[event].entries());
|
|
@@ -22566,7 +22574,7 @@ class EventEmitter {
|
|
|
22566
22574
|
const cloned = Array.from(this.observers["*"].entries());
|
|
22567
22575
|
cloned.forEach(([observer, numTimesAdded]) => {
|
|
22568
22576
|
for (let i = 0;i < numTimesAdded; i++) {
|
|
22569
|
-
observer
|
|
22577
|
+
observer(event, ...args);
|
|
22570
22578
|
}
|
|
22571
22579
|
});
|
|
22572
22580
|
}
|
|
@@ -22589,7 +22597,7 @@ class ResourceStore extends EventEmitter {
|
|
|
22589
22597
|
}
|
|
22590
22598
|
}
|
|
22591
22599
|
addNamespaces(ns) {
|
|
22592
|
-
if (this.options.ns.
|
|
22600
|
+
if (!this.options.ns.includes(ns)) {
|
|
22593
22601
|
this.options.ns.push(ns);
|
|
22594
22602
|
}
|
|
22595
22603
|
}
|
|
@@ -22603,7 +22611,7 @@ class ResourceStore extends EventEmitter {
|
|
|
22603
22611
|
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
22604
22612
|
const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
22605
22613
|
let path;
|
|
22606
|
-
if (lng.
|
|
22614
|
+
if (lng.includes(".")) {
|
|
22607
22615
|
path = lng.split(".");
|
|
22608
22616
|
} else {
|
|
22609
22617
|
path = [lng, ns];
|
|
@@ -22618,7 +22626,7 @@ class ResourceStore extends EventEmitter {
|
|
|
22618
22626
|
}
|
|
22619
22627
|
}
|
|
22620
22628
|
const result = getPath(this.data, path);
|
|
22621
|
-
if (!result && !ns && !key && lng.
|
|
22629
|
+
if (!result && !ns && !key && lng.includes(".")) {
|
|
22622
22630
|
lng = path[0];
|
|
22623
22631
|
ns = path[1];
|
|
22624
22632
|
key = path.slice(2).join(".");
|
|
@@ -22634,7 +22642,7 @@ class ResourceStore extends EventEmitter {
|
|
|
22634
22642
|
let path = [lng, ns];
|
|
22635
22643
|
if (key)
|
|
22636
22644
|
path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
22637
|
-
if (lng.
|
|
22645
|
+
if (lng.includes(".")) {
|
|
22638
22646
|
path = lng.split(".");
|
|
22639
22647
|
value = ns;
|
|
22640
22648
|
ns = path[1];
|
|
@@ -22661,7 +22669,7 @@ class ResourceStore extends EventEmitter {
|
|
|
22661
22669
|
skipCopy: false
|
|
22662
22670
|
}) {
|
|
22663
22671
|
let path = [lng, ns];
|
|
22664
|
-
if (lng.
|
|
22672
|
+
if (lng.includes(".")) {
|
|
22665
22673
|
path = lng.split(".");
|
|
22666
22674
|
deep = resources;
|
|
22667
22675
|
resources = ns;
|
|
@@ -22741,9 +22749,17 @@ function keysFromSelector(selector, opts) {
|
|
|
22741
22749
|
const {
|
|
22742
22750
|
[PATH_KEY]: path
|
|
22743
22751
|
} = selector(createProxy());
|
|
22744
|
-
|
|
22752
|
+
const keySeparator = opts?.keySeparator ?? ".";
|
|
22753
|
+
const nsSeparator = opts?.nsSeparator ?? ":";
|
|
22754
|
+
if (path.length > 1 && nsSeparator) {
|
|
22755
|
+
const ns = opts?.ns;
|
|
22756
|
+
const nsArray = Array.isArray(ns) ? ns : null;
|
|
22757
|
+
if (nsArray && nsArray.length > 1 && nsArray.slice(1).includes(path[0])) {
|
|
22758
|
+
return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`;
|
|
22759
|
+
}
|
|
22760
|
+
}
|
|
22761
|
+
return path.join(keySeparator);
|
|
22745
22762
|
}
|
|
22746
|
-
var checkedLoadedFor = {};
|
|
22747
22763
|
var shouldHandleAsObject = (res) => !isString(res) && typeof res !== "boolean" && typeof res !== "number";
|
|
22748
22764
|
|
|
22749
22765
|
class Translator extends EventEmitter {
|
|
@@ -22755,6 +22771,7 @@ class Translator extends EventEmitter {
|
|
|
22755
22771
|
this.options.keySeparator = ".";
|
|
22756
22772
|
}
|
|
22757
22773
|
this.logger = baseLogger.create("translator");
|
|
22774
|
+
this.checkedLoadedFor = {};
|
|
22758
22775
|
}
|
|
22759
22776
|
changeLanguage(lng) {
|
|
22760
22777
|
if (lng)
|
|
@@ -22783,7 +22800,7 @@ class Translator extends EventEmitter {
|
|
|
22783
22800
|
nsSeparator = ":";
|
|
22784
22801
|
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
22785
22802
|
let namespaces = opt.ns || this.options.defaultNS || [];
|
|
22786
|
-
const wouldCheckForNsInKey = nsSeparator && key.
|
|
22803
|
+
const wouldCheckForNsInKey = nsSeparator && key.includes(nsSeparator);
|
|
22787
22804
|
const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
|
22788
22805
|
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
|
22789
22806
|
const m = key.match(this.interpolator.nestingRegexp);
|
|
@@ -22794,7 +22811,7 @@ class Translator extends EventEmitter {
|
|
|
22794
22811
|
};
|
|
22795
22812
|
}
|
|
22796
22813
|
const parts = key.split(nsSeparator);
|
|
22797
|
-
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.
|
|
22814
|
+
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.includes(parts[0]))
|
|
22798
22815
|
namespaces = parts.shift();
|
|
22799
22816
|
key = parts.join(keySeparator);
|
|
22800
22817
|
}
|
|
@@ -22825,6 +22842,10 @@ class Translator extends EventEmitter {
|
|
|
22825
22842
|
});
|
|
22826
22843
|
if (!Array.isArray(keys))
|
|
22827
22844
|
keys = [String(keys)];
|
|
22845
|
+
keys = keys.map((k) => typeof k === "function" ? keysFromSelector(k, {
|
|
22846
|
+
...this.options,
|
|
22847
|
+
...opt
|
|
22848
|
+
}) : String(k));
|
|
22828
22849
|
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
|
|
22829
22850
|
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
|
|
22830
22851
|
const {
|
|
@@ -22884,7 +22905,7 @@ class Translator extends EventEmitter {
|
|
|
22884
22905
|
}
|
|
22885
22906
|
const handleAsObject = shouldHandleAsObject(resForObjHndl);
|
|
22886
22907
|
const resType = Object.prototype.toString.apply(resForObjHndl);
|
|
22887
|
-
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.
|
|
22908
|
+
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && !noObject.includes(resType) && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
|
|
22888
22909
|
if (!opt.returnObjects && !this.options.returnObjects) {
|
|
22889
22910
|
if (!this.options.returnedObjectHandler) {
|
|
22890
22911
|
this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -22983,7 +23004,7 @@ class Translator extends EventEmitter {
|
|
|
22983
23004
|
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
|
22984
23005
|
lngs.forEach((language) => {
|
|
22985
23006
|
const suffixes = this.pluralResolver.getSuffixes(language, opt);
|
|
22986
|
-
if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.
|
|
23007
|
+
if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && !suffixes.includes(`${this.options.pluralSeparator}zero`)) {
|
|
22987
23008
|
suffixes.push(`${this.options.pluralSeparator}zero`);
|
|
22988
23009
|
}
|
|
22989
23010
|
suffixes.forEach((suffix) => {
|
|
@@ -23082,6 +23103,11 @@ class Translator extends EventEmitter {
|
|
|
23082
23103
|
let usedNS;
|
|
23083
23104
|
if (isString(keys))
|
|
23084
23105
|
keys = [keys];
|
|
23106
|
+
if (Array.isArray(keys))
|
|
23107
|
+
keys = keys.map((k) => typeof k === "function" ? keysFromSelector(k, {
|
|
23108
|
+
...this.options,
|
|
23109
|
+
...opt
|
|
23110
|
+
}) : k);
|
|
23085
23111
|
keys.forEach((k) => {
|
|
23086
23112
|
if (this.isValidLookup(found))
|
|
23087
23113
|
return;
|
|
@@ -23099,8 +23125,8 @@ class Translator extends EventEmitter {
|
|
|
23099
23125
|
if (this.isValidLookup(found))
|
|
23100
23126
|
return;
|
|
23101
23127
|
usedNS = ns;
|
|
23102
|
-
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
23103
|
-
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
23128
|
+
if (!this.checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
23129
|
+
this.checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
23104
23130
|
this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
23105
23131
|
}
|
|
23106
23132
|
codes.forEach((code) => {
|
|
@@ -23117,7 +23143,7 @@ class Translator extends EventEmitter {
|
|
|
23117
23143
|
const zeroSuffix = `${this.options.pluralSeparator}zero`;
|
|
23118
23144
|
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
23119
23145
|
if (needsPluralHandling) {
|
|
23120
|
-
if (opt.ordinal && pluralSuffix.
|
|
23146
|
+
if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {
|
|
23121
23147
|
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
23122
23148
|
}
|
|
23123
23149
|
finalKeys.push(key + pluralSuffix);
|
|
@@ -23129,7 +23155,7 @@ class Translator extends EventEmitter {
|
|
|
23129
23155
|
const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
|
|
23130
23156
|
finalKeys.push(contextKey);
|
|
23131
23157
|
if (needsPluralHandling) {
|
|
23132
|
-
if (opt.ordinal && pluralSuffix.
|
|
23158
|
+
if (opt.ordinal && pluralSuffix.startsWith(ordinalPrefix)) {
|
|
23133
23159
|
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
|
|
23134
23160
|
}
|
|
23135
23161
|
finalKeys.push(contextKey + pluralSuffix);
|
|
@@ -23191,7 +23217,7 @@ class Translator extends EventEmitter {
|
|
|
23191
23217
|
static hasDefaultValue(options) {
|
|
23192
23218
|
const prefix = "defaultValue";
|
|
23193
23219
|
for (const option in options) {
|
|
23194
|
-
if (Object.prototype.hasOwnProperty.call(options, option) &&
|
|
23220
|
+
if (Object.prototype.hasOwnProperty.call(options, option) && option.startsWith(prefix) && options[option] !== undefined) {
|
|
23195
23221
|
return true;
|
|
23196
23222
|
}
|
|
23197
23223
|
}
|
|
@@ -23207,7 +23233,7 @@ class LanguageUtil {
|
|
|
23207
23233
|
}
|
|
23208
23234
|
getScriptPartFromCode(code) {
|
|
23209
23235
|
code = getCleanedCode(code);
|
|
23210
|
-
if (!code || code.
|
|
23236
|
+
if (!code || !code.includes("-"))
|
|
23211
23237
|
return null;
|
|
23212
23238
|
const p = code.split("-");
|
|
23213
23239
|
if (p.length === 2)
|
|
@@ -23219,13 +23245,13 @@ class LanguageUtil {
|
|
|
23219
23245
|
}
|
|
23220
23246
|
getLanguagePartFromCode(code) {
|
|
23221
23247
|
code = getCleanedCode(code);
|
|
23222
|
-
if (!code || code.
|
|
23248
|
+
if (!code || !code.includes("-"))
|
|
23223
23249
|
return code;
|
|
23224
23250
|
const p = code.split("-");
|
|
23225
23251
|
return this.formatLanguageCode(p[0]);
|
|
23226
23252
|
}
|
|
23227
23253
|
formatLanguageCode(code) {
|
|
23228
|
-
if (isString(code) && code.
|
|
23254
|
+
if (isString(code) && code.includes("-")) {
|
|
23229
23255
|
let formattedCode;
|
|
23230
23256
|
try {
|
|
23231
23257
|
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
@@ -23246,7 +23272,7 @@ class LanguageUtil {
|
|
|
23246
23272
|
if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) {
|
|
23247
23273
|
code = this.getLanguagePartFromCode(code);
|
|
23248
23274
|
}
|
|
23249
|
-
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.
|
|
23275
|
+
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.includes(code);
|
|
23250
23276
|
}
|
|
23251
23277
|
getBestMatchFromCodes(codes) {
|
|
23252
23278
|
if (!codes)
|
|
@@ -23271,13 +23297,14 @@ class LanguageUtil {
|
|
|
23271
23297
|
return found = lngOnly;
|
|
23272
23298
|
found = this.options.supportedLngs.find((supportedLng) => {
|
|
23273
23299
|
if (supportedLng === lngOnly)
|
|
23274
|
-
return
|
|
23275
|
-
if (supportedLng.
|
|
23276
|
-
return;
|
|
23277
|
-
if (supportedLng.
|
|
23278
|
-
return
|
|
23279
|
-
if (supportedLng.
|
|
23280
|
-
return
|
|
23300
|
+
return true;
|
|
23301
|
+
if (!supportedLng.includes("-") && !lngOnly.includes("-"))
|
|
23302
|
+
return false;
|
|
23303
|
+
if (supportedLng.includes("-") && !lngOnly.includes("-") && supportedLng.slice(0, supportedLng.indexOf("-")) === lngOnly)
|
|
23304
|
+
return true;
|
|
23305
|
+
if (supportedLng.startsWith(lngOnly) && lngOnly.length > 1)
|
|
23306
|
+
return true;
|
|
23307
|
+
return false;
|
|
23281
23308
|
});
|
|
23282
23309
|
});
|
|
23283
23310
|
}
|
|
@@ -23319,7 +23346,7 @@ class LanguageUtil {
|
|
|
23319
23346
|
this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
|
|
23320
23347
|
}
|
|
23321
23348
|
};
|
|
23322
|
-
if (isString(code) && (code.
|
|
23349
|
+
if (isString(code) && (code.includes("-") || code.includes("_"))) {
|
|
23323
23350
|
if (this.options.load !== "languageOnly")
|
|
23324
23351
|
addCode(this.formatLanguageCode(code));
|
|
23325
23352
|
if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly")
|
|
@@ -23330,7 +23357,7 @@ class LanguageUtil {
|
|
|
23330
23357
|
addCode(this.formatLanguageCode(code));
|
|
23331
23358
|
}
|
|
23332
23359
|
fallbackCodes.forEach((fc) => {
|
|
23333
|
-
if (codes.
|
|
23360
|
+
if (!codes.includes(fc))
|
|
23334
23361
|
addCode(this.formatLanguageCode(fc));
|
|
23335
23362
|
});
|
|
23336
23363
|
return codes;
|
|
@@ -23377,7 +23404,7 @@ class PluralResolver {
|
|
|
23377
23404
|
type
|
|
23378
23405
|
});
|
|
23379
23406
|
} catch (err) {
|
|
23380
|
-
if (
|
|
23407
|
+
if (typeof Intl === "undefined") {
|
|
23381
23408
|
this.logger.error("No Intl support, please use an Intl polyfill!");
|
|
23382
23409
|
return dummyRule;
|
|
23383
23410
|
}
|
|
@@ -23494,7 +23521,7 @@ class Interpolator {
|
|
|
23494
23521
|
let replaces;
|
|
23495
23522
|
const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
|
23496
23523
|
const handleFormat = (key) => {
|
|
23497
|
-
if (key.
|
|
23524
|
+
if (!key.includes(this.formatSeparator)) {
|
|
23498
23525
|
const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
23499
23526
|
return this.alwaysFormat ? this.format(path, undefined, lng, {
|
|
23500
23527
|
...options,
|
|
@@ -23564,15 +23591,15 @@ class Interpolator {
|
|
|
23564
23591
|
let clonedOptions;
|
|
23565
23592
|
const handleHasOptions = (key, inheritedOptions) => {
|
|
23566
23593
|
const sep = this.nestingOptionsSeparator;
|
|
23567
|
-
if (key.
|
|
23594
|
+
if (!key.includes(sep))
|
|
23568
23595
|
return key;
|
|
23569
|
-
const c = key.split(new RegExp(`${sep}[ ]*{`));
|
|
23596
|
+
const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));
|
|
23570
23597
|
let optionsString = `{${c[1]}`;
|
|
23571
23598
|
key = c[0];
|
|
23572
23599
|
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
23573
23600
|
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
23574
23601
|
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
23575
|
-
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes
|
|
23602
|
+
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) {
|
|
23576
23603
|
optionsString = optionsString.replace(/'/g, '"');
|
|
23577
23604
|
}
|
|
23578
23605
|
try {
|
|
@@ -23586,7 +23613,7 @@ class Interpolator {
|
|
|
23586
23613
|
this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
|
|
23587
23614
|
return `${key}${sep}${optionsString}`;
|
|
23588
23615
|
}
|
|
23589
|
-
if (clonedOptions.defaultValue && clonedOptions.defaultValue.
|
|
23616
|
+
if (clonedOptions.defaultValue && clonedOptions.defaultValue.includes(this.prefix))
|
|
23590
23617
|
delete clonedOptions.defaultValue;
|
|
23591
23618
|
return key;
|
|
23592
23619
|
};
|
|
@@ -23627,14 +23654,14 @@ class Interpolator {
|
|
|
23627
23654
|
var parseFormatStr = (formatStr) => {
|
|
23628
23655
|
let formatName = formatStr.toLowerCase().trim();
|
|
23629
23656
|
const formatOptions = {};
|
|
23630
|
-
if (formatStr.
|
|
23657
|
+
if (formatStr.includes("(")) {
|
|
23631
23658
|
const p = formatStr.split("(");
|
|
23632
23659
|
formatName = p[0].toLowerCase().trim();
|
|
23633
|
-
const optStr = p[1].
|
|
23634
|
-
if (formatName === "currency" && optStr.
|
|
23660
|
+
const optStr = p[1].slice(0, -1);
|
|
23661
|
+
if (formatName === "currency" && !optStr.includes(":")) {
|
|
23635
23662
|
if (!formatOptions.currency)
|
|
23636
23663
|
formatOptions.currency = optStr.trim();
|
|
23637
|
-
} else if (formatName === "relativetime" && optStr.
|
|
23664
|
+
} else if (formatName === "relativetime" && !optStr.includes(":")) {
|
|
23638
23665
|
if (!formatOptions.range)
|
|
23639
23666
|
formatOptions.range = optStr.trim();
|
|
23640
23667
|
} else {
|
|
@@ -23734,9 +23761,13 @@ class Formatter {
|
|
|
23734
23761
|
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
23735
23762
|
}
|
|
23736
23763
|
format(value, format, lng, options = {}) {
|
|
23764
|
+
if (!format)
|
|
23765
|
+
return value;
|
|
23766
|
+
if (value == null)
|
|
23767
|
+
return value;
|
|
23737
23768
|
const formats = format.split(this.formatSeparator);
|
|
23738
|
-
if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].
|
|
23739
|
-
const lastIndex = formats.findIndex((f) => f.
|
|
23769
|
+
if (formats.length > 1 && formats[0].indexOf("(") > 1 && !formats[0].includes(")") && formats.find((f) => f.includes(")"))) {
|
|
23770
|
+
const lastIndex = formats.findIndex((f) => f.includes(")"));
|
|
23740
23771
|
formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
|
|
23741
23772
|
}
|
|
23742
23773
|
const result = formats.reduce((mem, f) => {
|
|
@@ -23903,7 +23934,7 @@ class Connector extends EventEmitter {
|
|
|
23903
23934
|
}
|
|
23904
23935
|
if (err && data && tried < this.maxRetries) {
|
|
23905
23936
|
setTimeout(() => {
|
|
23906
|
-
this.read
|
|
23937
|
+
this.read(lng, ns, fcName, tried + 1, wait * 2, callback);
|
|
23907
23938
|
}, wait);
|
|
23908
23939
|
return;
|
|
23909
23940
|
}
|
|
@@ -24013,7 +24044,6 @@ var get = () => ({
|
|
|
24013
24044
|
nonExplicitSupportedLngs: false,
|
|
24014
24045
|
load: "all",
|
|
24015
24046
|
preload: false,
|
|
24016
|
-
simplifyPluralSuffix: true,
|
|
24017
24047
|
keySeparator: ".",
|
|
24018
24048
|
nsSeparator: ":",
|
|
24019
24049
|
pluralSeparator: "_",
|
|
@@ -24053,7 +24083,6 @@ var get = () => ({
|
|
|
24053
24083
|
},
|
|
24054
24084
|
interpolation: {
|
|
24055
24085
|
escapeValue: true,
|
|
24056
|
-
format: (value) => value,
|
|
24057
24086
|
prefix: "{{",
|
|
24058
24087
|
suffix: "}}",
|
|
24059
24088
|
formatSeparator: ",",
|
|
@@ -24073,11 +24102,9 @@ var transformOptions = (options) => {
|
|
|
24073
24102
|
options.fallbackLng = [options.fallbackLng];
|
|
24074
24103
|
if (isString(options.fallbackNS))
|
|
24075
24104
|
options.fallbackNS = [options.fallbackNS];
|
|
24076
|
-
if (options.supportedLngs
|
|
24105
|
+
if (options.supportedLngs && !options.supportedLngs.includes("cimode")) {
|
|
24077
24106
|
options.supportedLngs = options.supportedLngs.concat(["cimode"]);
|
|
24078
24107
|
}
|
|
24079
|
-
if (typeof options.initImmediate === "boolean")
|
|
24080
|
-
options.initAsync = options.initImmediate;
|
|
24081
24108
|
return options;
|
|
24082
24109
|
};
|
|
24083
24110
|
var noop = () => {};
|
|
@@ -24119,7 +24146,7 @@ class I18n extends EventEmitter {
|
|
|
24119
24146
|
if (options.defaultNS == null && options.ns) {
|
|
24120
24147
|
if (isString(options.ns)) {
|
|
24121
24148
|
options.defaultNS = options.ns;
|
|
24122
|
-
} else if (options.ns.
|
|
24149
|
+
} else if (!options.ns.includes("translation")) {
|
|
24123
24150
|
options.defaultNS = options.ns[0];
|
|
24124
24151
|
}
|
|
24125
24152
|
}
|
|
@@ -24142,10 +24169,6 @@ class I18n extends EventEmitter {
|
|
|
24142
24169
|
if (typeof this.options.overloadTranslationOptionHandler !== "function") {
|
|
24143
24170
|
this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
|
|
24144
24171
|
}
|
|
24145
|
-
if (this.options.debug === true) {
|
|
24146
|
-
if (typeof console !== "undefined")
|
|
24147
|
-
console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");
|
|
24148
|
-
}
|
|
24149
24172
|
const createClassOnDemand = (ClassOrObject) => {
|
|
24150
24173
|
if (!ClassOrObject)
|
|
24151
24174
|
return null;
|
|
@@ -24172,14 +24195,9 @@ class I18n extends EventEmitter {
|
|
|
24172
24195
|
s.resourceStore = this.store;
|
|
24173
24196
|
s.languageUtils = lu;
|
|
24174
24197
|
s.pluralResolver = new PluralResolver(lu, {
|
|
24175
|
-
prepend: this.options.pluralSeparator
|
|
24176
|
-
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
24198
|
+
prepend: this.options.pluralSeparator
|
|
24177
24199
|
});
|
|
24178
|
-
|
|
24179
|
-
if (usingLegacyFormatFunction) {
|
|
24180
|
-
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
|
|
24181
|
-
}
|
|
24182
|
-
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
24200
|
+
if (formatter) {
|
|
24183
24201
|
s.formatter = createClassOnDemand(formatter);
|
|
24184
24202
|
if (s.formatter.init)
|
|
24185
24203
|
s.formatter.init(s, this.options);
|
|
@@ -24276,7 +24294,7 @@ class I18n extends EventEmitter {
|
|
|
24276
24294
|
lngs.forEach((l) => {
|
|
24277
24295
|
if (l === "cimode")
|
|
24278
24296
|
return;
|
|
24279
|
-
if (toLoad.
|
|
24297
|
+
if (!toLoad.includes(l))
|
|
24280
24298
|
toLoad.push(l);
|
|
24281
24299
|
});
|
|
24282
24300
|
};
|
|
@@ -24349,18 +24367,18 @@ class I18n extends EventEmitter {
|
|
|
24349
24367
|
setResolvedLanguage(l) {
|
|
24350
24368
|
if (!l || !this.languages)
|
|
24351
24369
|
return;
|
|
24352
|
-
if (["cimode", "dev"].
|
|
24370
|
+
if (["cimode", "dev"].includes(l))
|
|
24353
24371
|
return;
|
|
24354
24372
|
for (let li = 0;li < this.languages.length; li++) {
|
|
24355
24373
|
const lngInLngs = this.languages[li];
|
|
24356
|
-
if (["cimode", "dev"].
|
|
24374
|
+
if (["cimode", "dev"].includes(lngInLngs))
|
|
24357
24375
|
continue;
|
|
24358
24376
|
if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
|
|
24359
24377
|
this.resolvedLanguage = lngInLngs;
|
|
24360
24378
|
break;
|
|
24361
24379
|
}
|
|
24362
24380
|
}
|
|
24363
|
-
if (!this.resolvedLanguage && this.languages.
|
|
24381
|
+
if (!this.resolvedLanguage && !this.languages.includes(l) && this.store.hasLanguageSomeTranslations(l)) {
|
|
24364
24382
|
this.resolvedLanguage = l;
|
|
24365
24383
|
this.languages.unshift(l);
|
|
24366
24384
|
}
|
|
@@ -24436,23 +24454,23 @@ class I18n extends EventEmitter {
|
|
|
24436
24454
|
o.ns = o.ns || fixedT.ns;
|
|
24437
24455
|
if (o.keyPrefix !== "")
|
|
24438
24456
|
o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
24457
|
+
const selectorOpts = {
|
|
24458
|
+
...this.options,
|
|
24459
|
+
...o
|
|
24460
|
+
};
|
|
24461
|
+
if (typeof o.keyPrefix === "function")
|
|
24462
|
+
o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts);
|
|
24439
24463
|
const keySeparator = this.options.keySeparator || ".";
|
|
24440
24464
|
let resultKey;
|
|
24441
24465
|
if (o.keyPrefix && Array.isArray(key)) {
|
|
24442
24466
|
resultKey = key.map((k) => {
|
|
24443
24467
|
if (typeof k === "function")
|
|
24444
|
-
k = keysFromSelector(k,
|
|
24445
|
-
...this.options,
|
|
24446
|
-
...opts
|
|
24447
|
-
});
|
|
24468
|
+
k = keysFromSelector(k, selectorOpts);
|
|
24448
24469
|
return `${o.keyPrefix}${keySeparator}${k}`;
|
|
24449
24470
|
});
|
|
24450
24471
|
} else {
|
|
24451
24472
|
if (typeof key === "function")
|
|
24452
|
-
key = keysFromSelector(key,
|
|
24453
|
-
...this.options,
|
|
24454
|
-
...opts
|
|
24455
|
-
});
|
|
24473
|
+
key = keysFromSelector(key, selectorOpts);
|
|
24456
24474
|
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
|
|
24457
24475
|
}
|
|
24458
24476
|
return this.t(resultKey, o);
|
|
@@ -24516,7 +24534,7 @@ class I18n extends EventEmitter {
|
|
|
24516
24534
|
if (isString(ns))
|
|
24517
24535
|
ns = [ns];
|
|
24518
24536
|
ns.forEach((n) => {
|
|
24519
|
-
if (this.options.ns.
|
|
24537
|
+
if (!this.options.ns.includes(n))
|
|
24520
24538
|
this.options.ns.push(n);
|
|
24521
24539
|
});
|
|
24522
24540
|
this.loadResources((err) => {
|
|
@@ -24531,7 +24549,7 @@ class I18n extends EventEmitter {
|
|
|
24531
24549
|
if (isString(lngs))
|
|
24532
24550
|
lngs = [lngs];
|
|
24533
24551
|
const preloaded = this.options.preload || [];
|
|
24534
|
-
const newLngs = lngs.filter((lng) => preloaded.
|
|
24552
|
+
const newLngs = lngs.filter((lng) => !preloaded.includes(lng) && this.services.languageUtils.isSupportedCode(lng));
|
|
24535
24553
|
if (!newLngs.length) {
|
|
24536
24554
|
if (callback)
|
|
24537
24555
|
callback();
|
|
@@ -24562,7 +24580,7 @@ class I18n extends EventEmitter {
|
|
|
24562
24580
|
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
24563
24581
|
if (lng.toLowerCase().indexOf("-latn") > 1)
|
|
24564
24582
|
return "ltr";
|
|
24565
|
-
return rtlLngs.
|
|
24583
|
+
return rtlLngs.includes(languageUtils.getLanguagePartFromCode(lng)) || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
24566
24584
|
}
|
|
24567
24585
|
static createInstance(options = {}, callback) {
|
|
24568
24586
|
const instance = new I18n(options, callback);
|
package/dist/index.js
CHANGED
|
@@ -1674,7 +1674,7 @@ var package_default = {
|
|
|
1674
1674
|
workspaces: [
|
|
1675
1675
|
"packages/*"
|
|
1676
1676
|
],
|
|
1677
|
-
version: "0.65.
|
|
1677
|
+
version: "0.65.2",
|
|
1678
1678
|
description: "Batteries-included agent harness for Claude Code",
|
|
1679
1679
|
type: "module",
|
|
1680
1680
|
bin: {
|
|
@@ -1718,7 +1718,7 @@ var package_default = {
|
|
|
1718
1718
|
"@clack/prompts": "^1.1.0",
|
|
1719
1719
|
"@inquirer/prompts": "^8.3.2",
|
|
1720
1720
|
commander: "^14.0.2",
|
|
1721
|
-
i18next: "^
|
|
1721
|
+
i18next: "^26.0.2",
|
|
1722
1722
|
yaml: "^2.8.2"
|
|
1723
1723
|
},
|
|
1724
1724
|
devDependencies: {
|
|
@@ -1729,7 +1729,7 @@ var package_default = {
|
|
|
1729
1729
|
"@types/nodemailer": "^7.0.9",
|
|
1730
1730
|
"js-yaml": "^4.1.0",
|
|
1731
1731
|
nodemailer: "^8.0.1",
|
|
1732
|
-
typescript: "^
|
|
1732
|
+
typescript: "^6.0.2",
|
|
1733
1733
|
vitepress: "^1.6.4"
|
|
1734
1734
|
},
|
|
1735
1735
|
keywords: [
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"workspaces": [
|
|
4
4
|
"packages/*"
|
|
5
5
|
],
|
|
6
|
-
"version": "0.65.
|
|
6
|
+
"version": "0.65.2",
|
|
7
7
|
"description": "Batteries-included agent harness for Claude Code",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"bin": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@clack/prompts": "^1.1.0",
|
|
48
48
|
"@inquirer/prompts": "^8.3.2",
|
|
49
49
|
"commander": "^14.0.2",
|
|
50
|
-
"i18next": "^
|
|
50
|
+
"i18next": "^26.0.2",
|
|
51
51
|
"yaml": "^2.8.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@types/nodemailer": "^7.0.9",
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
60
|
"nodemailer": "^8.0.1",
|
|
61
|
-
"typescript": "^
|
|
61
|
+
"typescript": "^6.0.2",
|
|
62
62
|
"vitepress": "^1.6.4"
|
|
63
63
|
},
|
|
64
64
|
"keywords": [
|
package/templates/manifest.json
CHANGED