@yahoo/uds-create-cli 5.89.0 → 5.89.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/package.json +11 -11
- package/subprocess/transform-runner.mjs +163 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.89.
|
|
3
|
+
"version": "5.89.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
33
33
|
"@orpc/client": "^1.13.9",
|
|
34
34
|
"@orpc/contract": "^1.13.9",
|
|
35
|
-
"@yahoo/uds-create-config": "5.89.
|
|
36
|
-
"@yahoo/uds-create-loader": "5.89.
|
|
37
|
-
"@yahoo/uds-create-types": "5.89.
|
|
38
|
-
"@yahoo/uds-create-utils": "5.89.
|
|
35
|
+
"@yahoo/uds-create-config": "5.89.2",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.89.2",
|
|
37
|
+
"@yahoo/uds-create-types": "5.89.2",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.89.2",
|
|
39
39
|
"esbuild": "^0.27.4",
|
|
40
40
|
"ts-morph": "^27.0.2",
|
|
41
41
|
"get-tsconfig": "^4.10.0",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"udsSchemaVersion": 20261109144822,
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@yahoo/uds-create-cli-darwin-arm64": "5.89.
|
|
58
|
-
"@yahoo/uds-create-cli-darwin-x64": "5.89.
|
|
59
|
-
"@yahoo/uds-create-cli-linux-arm64": "5.89.
|
|
60
|
-
"@yahoo/uds-create-cli-linux-x64": "5.89.
|
|
61
|
-
"@yahoo/uds-create-cli-linux-arm64-musl": "5.89.
|
|
62
|
-
"@yahoo/uds-create-cli-linux-x64-musl": "5.89.
|
|
57
|
+
"@yahoo/uds-create-cli-darwin-arm64": "5.89.2",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.89.2",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.89.2",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.89.2",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.89.2",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.89.2"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -70522,6 +70522,61 @@ function isShadow(value) {
|
|
|
70522
70522
|
const layers = value.shadow;
|
|
70523
70523
|
return Array.isArray(layers) && layers.length > 0 && layers.every((layer) => isRef2(layer) || isParts(layer));
|
|
70524
70524
|
}
|
|
70525
|
+
var SHADOW_LENGTH = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:[a-z]+|%)?$/i;
|
|
70526
|
+
function parseCssShadow(value) {
|
|
70527
|
+
return splitTopLevel({
|
|
70528
|
+
value,
|
|
70529
|
+
separator: ","
|
|
70530
|
+
}).map((layer) => {
|
|
70531
|
+
const lengths = [];
|
|
70532
|
+
let color;
|
|
70533
|
+
let inset = false;
|
|
70534
|
+
for (const part of splitTopLevel({
|
|
70535
|
+
value: layer,
|
|
70536
|
+
separator: " "
|
|
70537
|
+
})) {
|
|
70538
|
+
if (part === "inset" && !inset) {
|
|
70539
|
+
inset = true;
|
|
70540
|
+
continue;
|
|
70541
|
+
}
|
|
70542
|
+
if (SHADOW_LENGTH.test(part)) {
|
|
70543
|
+
lengths.push(part);
|
|
70544
|
+
continue;
|
|
70545
|
+
}
|
|
70546
|
+
if (color !== void 0) throw new Error(`Unexpected shadow part "${part}"`);
|
|
70547
|
+
color = part;
|
|
70548
|
+
}
|
|
70549
|
+
if (color === void 0 || lengths.length < 2 || lengths.length > 4) throw new Error("Shadow needs a color and two to four lengths");
|
|
70550
|
+
const [offsetX, offsetY, blur, spread] = lengths;
|
|
70551
|
+
return {
|
|
70552
|
+
...inset ? { inset } : {},
|
|
70553
|
+
offsetX,
|
|
70554
|
+
offsetY,
|
|
70555
|
+
...blur === void 0 ? {} : { blur },
|
|
70556
|
+
...spread === void 0 ? {} : { spread },
|
|
70557
|
+
color
|
|
70558
|
+
};
|
|
70559
|
+
});
|
|
70560
|
+
}
|
|
70561
|
+
function splitTopLevel({ value, separator }) {
|
|
70562
|
+
const parts = [];
|
|
70563
|
+
let depth = 0;
|
|
70564
|
+
let start = 0;
|
|
70565
|
+
for (let at = 0; at < value.length; at++) {
|
|
70566
|
+
const char = value[at] ?? "";
|
|
70567
|
+
if (char === "(") depth++;
|
|
70568
|
+
if (char === ")") depth--;
|
|
70569
|
+
if (depth < 0) throw new Error("Unbalanced shadow function");
|
|
70570
|
+
const splits = separator === " " ? /\s/.test(char) : char === separator;
|
|
70571
|
+
if (depth === 0 && splits) {
|
|
70572
|
+
parts.push(value.slice(start, at).trim());
|
|
70573
|
+
start = at + 1;
|
|
70574
|
+
}
|
|
70575
|
+
}
|
|
70576
|
+
if (depth !== 0) throw new Error("Unbalanced shadow function");
|
|
70577
|
+
parts.push(value.slice(start).trim());
|
|
70578
|
+
return parts.filter(Boolean);
|
|
70579
|
+
}
|
|
70525
70580
|
function shadowAuthoring(value) {
|
|
70526
70581
|
return {
|
|
70527
70582
|
helper: "shadow",
|
|
@@ -84560,13 +84615,18 @@ function prepareLinkedTokenBody({ path: path2, body, source, config: config2, de
|
|
|
84560
84615
|
remBase,
|
|
84561
84616
|
preserveLength: path2.split("/")[0] === "fontLineHeight"
|
|
84562
84617
|
}) : value;
|
|
84563
|
-
|
|
84618
|
+
if (typeof literal3 !== "string" && typeof literal3 !== "number" && typeof literal3 !== "boolean" && !isNativeFlexValue(literal3) && !isRelativeLineHeightValue(literal3)) return literal3;
|
|
84619
|
+
const converted = convertLinkedTokenValue({
|
|
84564
84620
|
path: path2,
|
|
84565
84621
|
value: literal3,
|
|
84566
84622
|
sourcePlatform: source.name,
|
|
84567
84623
|
destinationPlatform,
|
|
84568
84624
|
remBase
|
|
84569
|
-
})
|
|
84625
|
+
});
|
|
84626
|
+
return destinationPlatform === "react-native-system" && typeof converted === "string" ? nativeShadowValue({
|
|
84627
|
+
value: converted,
|
|
84628
|
+
remBase
|
|
84629
|
+
}) ?? converted : converted;
|
|
84570
84630
|
};
|
|
84571
84631
|
const overrides = body.overrides;
|
|
84572
84632
|
return {
|
|
@@ -84578,6 +84638,42 @@ function prepareLinkedTokenBody({ path: path2, body, source, config: config2, de
|
|
|
84578
84638
|
} : raw])) } : {}
|
|
84579
84639
|
};
|
|
84580
84640
|
}
|
|
84641
|
+
function nativeShadowValue({ value, remBase }) {
|
|
84642
|
+
let layers;
|
|
84643
|
+
try {
|
|
84644
|
+
layers = parseCssShadow(value);
|
|
84645
|
+
} catch {
|
|
84646
|
+
return;
|
|
84647
|
+
}
|
|
84648
|
+
const points = (length) => {
|
|
84649
|
+
if (NUMBER3.test(length)) return Number(length) === 0 ? length : void 0;
|
|
84650
|
+
const match = LENGTH.exec(length);
|
|
84651
|
+
if (!match) return void 0;
|
|
84652
|
+
if (match[2] === "px") return length;
|
|
84653
|
+
if (remBase === void 0) return void 0;
|
|
84654
|
+
return `${Number(match[1]) * remBase}px`;
|
|
84655
|
+
};
|
|
84656
|
+
const converted = [];
|
|
84657
|
+
for (const { color, offsetX, offsetY, blur, spread, inset } of layers) {
|
|
84658
|
+
if (typeof color !== "string" || color.includes("var(")) return void 0;
|
|
84659
|
+
const [x, y, b, s] = [
|
|
84660
|
+
offsetX,
|
|
84661
|
+
offsetY,
|
|
84662
|
+
blur,
|
|
84663
|
+
spread
|
|
84664
|
+
].map((length) => length === void 0 ? void 0 : points(length));
|
|
84665
|
+
if (x === void 0 || y === void 0 || blur !== void 0 && b === void 0 || spread !== void 0 && s === void 0) return;
|
|
84666
|
+
converted.push({
|
|
84667
|
+
...inset ? { inset } : {},
|
|
84668
|
+
offsetX: x,
|
|
84669
|
+
offsetY: y,
|
|
84670
|
+
...b === void 0 ? {} : { blur: b },
|
|
84671
|
+
...s === void 0 ? {} : { spread: s },
|
|
84672
|
+
color: oklchAsHex(color) ?? color
|
|
84673
|
+
});
|
|
84674
|
+
}
|
|
84675
|
+
return { shadow: converted };
|
|
84676
|
+
}
|
|
84581
84677
|
function nativeLiteral({ config: config2, value, remBase, preserveLength = false }) {
|
|
84582
84678
|
const marked = typeof value === "string" && hasRefMarker(value);
|
|
84583
84679
|
const calc = isCalc(value);
|
|
@@ -91549,11 +91645,20 @@ function inlineWholeEntity({ body, kind, config: config2, slug: slug2, options }
|
|
|
91549
91645
|
source: owner
|
|
91550
91646
|
});
|
|
91551
91647
|
const { [primary]: _ourRef, ...ourFields } = body;
|
|
91552
|
-
const
|
|
91553
|
-
|
|
91554
|
-
|
|
91648
|
+
const carried = inlineSourcedRefs(theirFields, owner, void 0, options);
|
|
91649
|
+
const ours = inlineSourcedRefs(ourFields, config2, slug2, options);
|
|
91650
|
+
const borrowed = {
|
|
91651
|
+
...carried,
|
|
91652
|
+
...ours,
|
|
91555
91653
|
[primary]: inlineSourcedRefs(theirValue, owner, void 0, options)
|
|
91556
91654
|
};
|
|
91655
|
+
const merged = config2.entityOf(kind)?.prepareLinkedBody?.({
|
|
91656
|
+
path: pathOf2(pointer),
|
|
91657
|
+
body: borrowed,
|
|
91658
|
+
source: owner,
|
|
91659
|
+
config: config2,
|
|
91660
|
+
extend: ours
|
|
91661
|
+
}) ?? borrowed;
|
|
91557
91662
|
assertCarriedRefsResolve(merged, config2, pointer.__ref);
|
|
91558
91663
|
return merged;
|
|
91559
91664
|
}
|
|
@@ -96583,14 +96688,57 @@ var Config = class Config2 {
|
|
|
96583
96688
|
const reaching = this.sourceFor(other);
|
|
96584
96689
|
const copy = reaching?.resolve(kind, path2);
|
|
96585
96690
|
if (!reaching || !copy) return false;
|
|
96691
|
+
const bare2 = [.../* @__PURE__ */ new Set([...reaching.sourceSlugs(), ...collectRefs(copy.body).flatMap((marker) => sourceOf2(marker) ?? [])])].reduce((body2, slug2) => rewriteRefSource(body2, slug2, void 0), copy.body);
|
|
96692
|
+
const ours = rewriteRefSource(body, other, void 0);
|
|
96693
|
+
return this.readsAs({
|
|
96694
|
+
kind,
|
|
96695
|
+
body: bare2,
|
|
96696
|
+
as: ours
|
|
96697
|
+
});
|
|
96698
|
+
}
|
|
96699
|
+
/**
|
|
96700
|
+
* Whether `body` is what `slug`'s entity at `kind:path` becomes when it is inlined here
|
|
96701
|
+
* ({@link withInlinedSources}), which follows their aliases and spells the result in this config's
|
|
96702
|
+
* terms. A pin that survives the inlining still offers the path, and this is the same entity.
|
|
96703
|
+
*/
|
|
96704
|
+
inlinedFrom({ body, slug: slug2, kind, path: path2 }) {
|
|
96705
|
+
let borrowed;
|
|
96706
|
+
try {
|
|
96707
|
+
borrowed = this.extensionBody(kind, {
|
|
96708
|
+
__ref: ref(kind, path2, slug2).__ref,
|
|
96709
|
+
extend: {}
|
|
96710
|
+
});
|
|
96711
|
+
} catch {
|
|
96712
|
+
return false;
|
|
96713
|
+
}
|
|
96714
|
+
if (!borrowed) return false;
|
|
96715
|
+
let inlined;
|
|
96716
|
+
try {
|
|
96717
|
+
inlined = inlineWholeEntity({
|
|
96718
|
+
body: borrowed,
|
|
96719
|
+
kind,
|
|
96720
|
+
config: this,
|
|
96721
|
+
options: { keepIdentityRefs: true }
|
|
96722
|
+
});
|
|
96723
|
+
} catch {
|
|
96724
|
+
return false;
|
|
96725
|
+
}
|
|
96726
|
+
return this.readsAs({
|
|
96727
|
+
kind,
|
|
96728
|
+
body: inlined,
|
|
96729
|
+
as: body
|
|
96730
|
+
});
|
|
96731
|
+
}
|
|
96732
|
+
/** Whether two bodies of `kind` are the same entity, leaving out the fields that say where a body
|
|
96733
|
+
* came from: the kind's computed fields (`borrowedFrom`, `sources`) and a copy's `copiedFrom`. A
|
|
96734
|
+
* resolved body carries them where a stored one doesn't. */
|
|
96735
|
+
readsAs({ kind, body, as }) {
|
|
96586
96736
|
const provenance = Object.fromEntries([...this.entityOf(kind)?.computedKeys ?? [], "copiedFrom"].map((key2) => [key2, void 0]));
|
|
96587
|
-
const entityOf = (
|
|
96588
|
-
...
|
|
96737
|
+
const entityOf = (fields) => JSON.stringify({
|
|
96738
|
+
...fields,
|
|
96589
96739
|
...provenance
|
|
96590
96740
|
});
|
|
96591
|
-
|
|
96592
|
-
const ours = rewriteRefSource(body, other, void 0);
|
|
96593
|
-
return entityOf(bare2) === entityOf(ours);
|
|
96741
|
+
return entityOf(body) === entityOf(as);
|
|
96594
96742
|
}
|
|
96595
96743
|
/** How `slug`'s source joins this config ({@link EntityKind.sourceType}): `linked` unless its pin
|
|
96596
96744
|
* says otherwise. */
|
|
@@ -96807,6 +96955,11 @@ var Config = class Config2 {
|
|
|
96807
96955
|
other: slug2,
|
|
96808
96956
|
kind,
|
|
96809
96957
|
path: path2
|
|
96958
|
+
}) && !this.inlinedFrom({
|
|
96959
|
+
body: current.body,
|
|
96960
|
+
slug: slug2,
|
|
96961
|
+
kind,
|
|
96962
|
+
path: path2
|
|
96810
96963
|
})) ownedAgainst.set(target2, [...ownedAgainst.get(target2) ?? [], slug2]);
|
|
96811
96964
|
continue;
|
|
96812
96965
|
}
|