@wix/himalaya-cli 0.1213.0 → 0.1214.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,7 +47,20 @@ export interface L10nStringFinding {
|
|
|
47
47
|
* Bindings are skipped (they render worker state, which this cannot see — use
|
|
48
48
|
* `collectBoundServicePaths` + the worker's own state for that half).
|
|
49
49
|
*/
|
|
50
|
-
export declare function collectDescriptorStrings(descriptor: unknown
|
|
50
|
+
export declare function collectDescriptorStrings(descriptor: unknown, options?: {
|
|
51
|
+
/**
|
|
52
|
+
* Values the app has DECLARED as copy (its `strings/<locale>.json` table), for which
|
|
53
|
+
* the "has a letter" rule of `isUserVisibleCopy` is waived — and only that rule: the
|
|
54
|
+
* binding/id/url/hex/length filters still apply. Exists for letterless copy — a phone
|
|
55
|
+
* or number format such as "+1 555 0100" has no letter, so the heuristic calls it
|
|
56
|
+
* noise, and the extractor dropped `reserve.phonePlaceholder` (#3320). Only exact
|
|
57
|
+
* table values qualify, so an arbitrary "4.8" in sample data stays out.
|
|
58
|
+
*
|
|
59
|
+
* Passed by the extractor only. The `l10n` validate pass does not pass it yet, so it
|
|
60
|
+
* still treats letterless copy as non-copy (as it always has).
|
|
61
|
+
*/
|
|
62
|
+
copyValues?: ReadonlySet<string>;
|
|
63
|
+
}): L10nStringFinding[];
|
|
51
64
|
/**
|
|
52
65
|
* The `$service:` bindings sitting in a user-visible prop — i.e. the state paths whose
|
|
53
66
|
* value is PAINTED as copy.
|
package/dist/cli.mjs
CHANGED
|
@@ -6818,7 +6818,6 @@ function walk(node, registry, path2, out2) {
|
|
|
6818
6818
|
var SYSTEM_FONT_FAMILY, TONAL_ELEVATION_ALPHA, COLOR_TOKEN_PROPS, TYPOGRAPHY_TOKEN_PROPS;
|
|
6819
6819
|
var init_tokens = __esm({
|
|
6820
6820
|
"../../core/ts/src/tokens.ts"() {
|
|
6821
|
-
"use strict";
|
|
6822
6821
|
SYSTEM_FONT_FAMILY = "$system";
|
|
6823
6822
|
TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
|
|
6824
6823
|
COLOR_TOKEN_PROPS = {
|
|
@@ -6869,7 +6868,6 @@ function resolveTranslation(value, catalog, sourceCatalog) {
|
|
|
6869
6868
|
var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
|
|
6870
6869
|
var init_bindings = __esm({
|
|
6871
6870
|
"../../core/ts/src/bindings.ts"() {
|
|
6872
|
-
"use strict";
|
|
6873
6871
|
BINDING_SIGILS = ["service", "flag", "item", "t"];
|
|
6874
6872
|
BINDING_SIGIL_RE = new RegExp(
|
|
6875
6873
|
`^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
|
|
@@ -7988,14 +7986,19 @@ var init_token_suggest = __esm({
|
|
|
7988
7986
|
|
|
7989
7987
|
// ../../core/dev-server/src/l10n-strings.ts
|
|
7990
7988
|
function isUserVisibleCopy(s) {
|
|
7989
|
+
return isCopyShaped(s) && /[A-Za-z--ۿ]/.test(s);
|
|
7990
|
+
}
|
|
7991
|
+
function isCopyShaped(s) {
|
|
7991
7992
|
if (typeof s !== "string" || s.length === 0 || s.length > 200) return false;
|
|
7992
7993
|
if (s.startsWith("$") || s.startsWith("_")) return false;
|
|
7993
7994
|
if (/^https?:\/\//.test(s)) return false;
|
|
7994
7995
|
if (/^#[0-9A-Fa-f]+$/.test(s)) return false;
|
|
7995
7996
|
if (!s.includes(" ") && /^[a-z0-9_\-./]+$/.test(s)) return false;
|
|
7996
|
-
return
|
|
7997
|
+
return true;
|
|
7997
7998
|
}
|
|
7998
|
-
function collectDescriptorStrings(descriptor) {
|
|
7999
|
+
function collectDescriptorStrings(descriptor, options = {}) {
|
|
8000
|
+
const { copyValues } = options;
|
|
8001
|
+
const isCopy2 = (v) => isUserVisibleCopy(v) || copyValues !== void 0 && copyValues.has(v) && isCopyShaped(v);
|
|
7999
8002
|
const out2 = [];
|
|
8000
8003
|
const seen = /* @__PURE__ */ new Set();
|
|
8001
8004
|
const push = (f) => {
|
|
@@ -8018,7 +8021,7 @@ function collectDescriptorStrings(descriptor) {
|
|
|
8018
8021
|
const mapped = STRING_FIELDS_BY_TYPE[type] ?? [];
|
|
8019
8022
|
for (const [prop, v] of Object.entries(props)) {
|
|
8020
8023
|
if (typeof v !== "string" || BINDING_SIGIL.test(v)) continue;
|
|
8021
|
-
if (!
|
|
8024
|
+
if (!isCopy2(v)) continue;
|
|
8022
8025
|
const at2 = `${path2}.body.props.${prop}`;
|
|
8023
8026
|
if (mapped.includes(prop) || SECONDARY_FIELDS.has(prop)) {
|
|
8024
8027
|
push({ value: v, bucket: "reachable", type, prop, path: at2 });
|
|
@@ -8027,7 +8030,7 @@ function collectDescriptorStrings(descriptor) {
|
|
|
8027
8030
|
}
|
|
8028
8031
|
}
|
|
8029
8032
|
const templ = props.template;
|
|
8030
|
-
if (templ && typeof templ.template === "string" &&
|
|
8033
|
+
if (templ && typeof templ.template === "string" && isCopy2(templ.template)) {
|
|
8031
8034
|
push({
|
|
8032
8035
|
value: templ.template,
|
|
8033
8036
|
bucket: "reachable",
|
|
@@ -8039,7 +8042,7 @@ function collectDescriptorStrings(descriptor) {
|
|
|
8039
8042
|
}
|
|
8040
8043
|
for (const [k, v] of Object.entries(obj3)) {
|
|
8041
8044
|
if (k === "body") continue;
|
|
8042
|
-
if (typeof v === "string" && SECONDARY_FIELDS.has(k) && !BINDING_SIGIL.test(v) &&
|
|
8045
|
+
if (typeof v === "string" && SECONDARY_FIELDS.has(k) && !BINDING_SIGIL.test(v) && isCopy2(v)) {
|
|
8043
8046
|
push({ value: v, bucket: "reachable", type, prop: k, path: `${path2}.${k}` });
|
|
8044
8047
|
}
|
|
8045
8048
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1214.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"artifactId": "himalaya-cli"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"falconPackageHash": "
|
|
70
|
+
"falconPackageHash": "4665b1c60527def192c75337a09421d697bbdd3949d74c93be76a087"
|
|
71
71
|
}
|