@yahoo/uds-create-cli 5.88.0 → 5.88.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/package.json +11 -11
- package/subprocess/transform-runner.mjs +51 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.88.
|
|
3
|
+
"version": "5.88.1",
|
|
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.88.
|
|
36
|
-
"@yahoo/uds-create-loader": "5.88.
|
|
37
|
-
"@yahoo/uds-create-types": "5.88.
|
|
38
|
-
"@yahoo/uds-create-utils": "5.88.
|
|
35
|
+
"@yahoo/uds-create-config": "5.88.1",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.88.1",
|
|
37
|
+
"@yahoo/uds-create-types": "5.88.1",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.88.1",
|
|
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.88.
|
|
58
|
-
"@yahoo/uds-create-cli-darwin-x64": "5.88.
|
|
59
|
-
"@yahoo/uds-create-cli-linux-arm64": "5.88.
|
|
60
|
-
"@yahoo/uds-create-cli-linux-x64": "5.88.
|
|
61
|
-
"@yahoo/uds-create-cli-linux-arm64-musl": "5.88.
|
|
62
|
-
"@yahoo/uds-create-cli-linux-x64-musl": "5.88.
|
|
57
|
+
"@yahoo/uds-create-cli-darwin-arm64": "5.88.1",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.88.1",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.88.1",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.88.1",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.88.1",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.88.1"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -106150,7 +106150,7 @@ var transformLoader = function(source) {
|
|
|
106150
106150
|
return source;
|
|
106151
106151
|
}
|
|
106152
106152
|
const projection = getLoaderProjection(config2);
|
|
106153
|
-
let hasComponentReference = source.includes(linkedAlias);
|
|
106153
|
+
let hasComponentReference = source.includes(linkedAlias) || source.includes("/uds/components/");
|
|
106154
106154
|
for (const name of projection.componentNames) {
|
|
106155
106155
|
if (source.includes(name)) {
|
|
106156
106156
|
hasComponentReference = true;
|
|
@@ -106175,60 +106175,64 @@ var transformLoader = function(source) {
|
|
|
106175
106175
|
return source;
|
|
106176
106176
|
}
|
|
106177
106177
|
const edits = [];
|
|
106178
|
+
const rewriteSource = ({
|
|
106179
|
+
sourceNode,
|
|
106180
|
+
names
|
|
106181
|
+
}) => {
|
|
106182
|
+
const { start, end, value: moduleSource } = sourceNode;
|
|
106183
|
+
if (typeof start !== "number" || typeof end !== "number") return;
|
|
106184
|
+
const quote = source[start] ?? "'";
|
|
106185
|
+
const splice = (target2) => {
|
|
106186
|
+
edits.push({ start, end, value: `${quote}${target2}${quote}` });
|
|
106187
|
+
};
|
|
106188
|
+
if (moduleSource.startsWith(linkedAlias)) {
|
|
106189
|
+
splice(
|
|
106190
|
+
`${outputAlias}/components/_linked/${moduleSource.slice(linkedAlias.length)}`
|
|
106191
|
+
);
|
|
106192
|
+
return;
|
|
106193
|
+
}
|
|
106194
|
+
if (moduleSource.startsWith(".") || moduleSource.startsWith("/")) return;
|
|
106195
|
+
const segmentMatch = moduleSource.match(/\/uds\/components\/([^/]+)$/);
|
|
106196
|
+
if (!segmentMatch) return;
|
|
106197
|
+
const segment = segmentMatch[1];
|
|
106198
|
+
const pascal = segment.split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
106199
|
+
const namesComponent = names.some(
|
|
106200
|
+
(name) => projection.componentNames.has(name)
|
|
106201
|
+
);
|
|
106202
|
+
if (!namesComponent && !projection.componentNames.has(pascal)) return;
|
|
106203
|
+
splice(`${outputAlias}/components/${segment}`);
|
|
106204
|
+
};
|
|
106178
106205
|
traverse(ast, {
|
|
106179
|
-
// -----------------------------------------------------------------------
|
|
106180
|
-
// Import rewrite: alias-prefixed local imports of registered UDS
|
|
106181
|
-
// components → `#uds/components/<seg>` (the per-source-file
|
|
106182
|
-
// codegen-emitted module).
|
|
106183
|
-
// -----------------------------------------------------------------------
|
|
106184
106206
|
// biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
|
|
106185
106207
|
ImportDeclaration(nodePath) {
|
|
106186
|
-
const
|
|
106187
|
-
if (!importSource) return;
|
|
106188
|
-
if (importSource.startsWith(linkedAlias)) {
|
|
106189
|
-
const sourceNode = nodePath.node.source;
|
|
106190
|
-
if (typeof sourceNode.start !== "number" || typeof sourceNode.end !== "number") {
|
|
106191
|
-
return;
|
|
106192
|
-
}
|
|
106193
|
-
const quote = source[sourceNode.start] ?? "'";
|
|
106194
|
-
edits.push({
|
|
106195
|
-
start: sourceNode.start,
|
|
106196
|
-
end: sourceNode.end,
|
|
106197
|
-
value: `${quote}${outputAlias}/components/_linked/${importSource.slice(linkedAlias.length)}${quote}`
|
|
106198
|
-
});
|
|
106199
|
-
return;
|
|
106200
|
-
}
|
|
106201
|
-
const isAliasedLocalImport = !importSource.startsWith(".") && !importSource.startsWith("/");
|
|
106202
|
-
if (!isAliasedLocalImport) return;
|
|
106203
|
-
let shouldRewriteSource = false;
|
|
106208
|
+
const names = [];
|
|
106204
106209
|
for (const specifier of nodePath.node.specifiers) {
|
|
106205
|
-
if (specifier.type
|
|
106206
|
-
|
|
106207
|
-
if (!importedName) continue;
|
|
106208
|
-
if (projection.componentNames.has(importedName)) {
|
|
106209
|
-
shouldRewriteSource = true;
|
|
106210
|
-
}
|
|
106211
|
-
}
|
|
106212
|
-
const segmentMatch = importSource.match(/\/uds\/components\/([^/]+)$/);
|
|
106213
|
-
if (!shouldRewriteSource && segmentMatch) {
|
|
106214
|
-
const tail = segmentMatch[1];
|
|
106215
|
-
const pascal = tail.split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
106216
|
-
if (projection.componentNames.has(pascal)) {
|
|
106217
|
-
shouldRewriteSource = true;
|
|
106210
|
+
if (specifier.type === "ImportSpecifier" && specifier.imported?.type === "Identifier") {
|
|
106211
|
+
names.push(specifier.imported.name);
|
|
106218
106212
|
}
|
|
106219
106213
|
}
|
|
106220
|
-
|
|
106221
|
-
|
|
106222
|
-
|
|
106223
|
-
|
|
106214
|
+
rewriteSource({ sourceNode: nodePath.node.source, names });
|
|
106215
|
+
},
|
|
106216
|
+
// `export { Box } from '…'` runs the same module an import of `Box`
|
|
106217
|
+
// would. `export type { … } from '…'` is erased before it runs, and
|
|
106218
|
+
// stays pointed at the source its types come from.
|
|
106219
|
+
// biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
|
|
106220
|
+
ExportNamedDeclaration(nodePath) {
|
|
106221
|
+
const { node: node2 } = nodePath;
|
|
106222
|
+
if (!node2.source || node2.exportKind === "type") return;
|
|
106223
|
+
const names = [];
|
|
106224
|
+
for (const specifier of node2.specifiers) {
|
|
106225
|
+
if (specifier.type === "ExportSpecifier" && specifier.exportKind !== "type" && specifier.local?.type === "Identifier") {
|
|
106226
|
+
names.push(specifier.local.name);
|
|
106224
106227
|
}
|
|
106225
|
-
const quote = source[sourceNode.start] ?? "'";
|
|
106226
|
-
edits.push({
|
|
106227
|
-
start: sourceNode.start,
|
|
106228
|
-
end: sourceNode.end,
|
|
106229
|
-
value: `${quote}${outputAlias}/components/${segmentMatch[1]}${quote}`
|
|
106230
|
-
});
|
|
106231
106228
|
}
|
|
106229
|
+
rewriteSource({ sourceNode: node2.source, names });
|
|
106230
|
+
},
|
|
106231
|
+
// biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
|
|
106232
|
+
ExportAllDeclaration(nodePath) {
|
|
106233
|
+
const { node: node2 } = nodePath;
|
|
106234
|
+
if (node2.exportKind === "type") return;
|
|
106235
|
+
rewriteSource({ sourceNode: node2.source, names: [] });
|
|
106232
106236
|
}
|
|
106233
106237
|
});
|
|
106234
106238
|
if (edits.length === 0) return source;
|