@yahoo/uds-create-cli 5.88.0 → 5.89.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-cli",
3
- "version": "5.88.0",
3
+ "version": "5.89.0",
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.0",
36
- "@yahoo/uds-create-loader": "5.88.0",
37
- "@yahoo/uds-create-types": "5.88.0",
38
- "@yahoo/uds-create-utils": "5.88.0",
35
+ "@yahoo/uds-create-config": "5.89.0",
36
+ "@yahoo/uds-create-loader": "5.89.0",
37
+ "@yahoo/uds-create-types": "5.89.0",
38
+ "@yahoo/uds-create-utils": "5.89.0",
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.0",
58
- "@yahoo/uds-create-cli-darwin-x64": "5.88.0",
59
- "@yahoo/uds-create-cli-linux-arm64": "5.88.0",
60
- "@yahoo/uds-create-cli-linux-x64": "5.88.0",
61
- "@yahoo/uds-create-cli-linux-arm64-musl": "5.88.0",
62
- "@yahoo/uds-create-cli-linux-x64-musl": "5.88.0"
57
+ "@yahoo/uds-create-cli-darwin-arm64": "5.89.0",
58
+ "@yahoo/uds-create-cli-darwin-x64": "5.89.0",
59
+ "@yahoo/uds-create-cli-linux-arm64": "5.89.0",
60
+ "@yahoo/uds-create-cli-linux-x64": "5.89.0",
61
+ "@yahoo/uds-create-cli-linux-arm64-musl": "5.89.0",
62
+ "@yahoo/uds-create-cli-linux-x64-musl": "5.89.0"
63
63
  }
64
64
  }
@@ -69864,16 +69864,30 @@ function storedDefaultConditions(body) {
69864
69864
  return isPlainObject2(stored) ? stored : {};
69865
69865
  }
69866
69866
  function defaultsFor({ body, given }) {
69867
- const defaults = body?.defaultProps ?? {};
69868
- const conditions = Object.values(storedDefaultConditions(body));
69869
- if (conditions.length === 0) return defaults;
69867
+ const defaults = unconditionalDefaults(body);
69868
+ if (Object.keys(storedDefaultConditions(body)).length === 0) return defaults;
69870
69869
  const out = { ...defaults };
69871
- for (const { when, props } of conditions) if (Object.entries(when).every(([prop, value]) => {
69872
- const current = given[prop] !== void 0 ? given[prop] : defaults[prop];
69873
- return String(refLeaf(current)) === String(refLeaf(value));
69874
- })) Object.assign(out, props);
69870
+ for (const { condition } of holdingDefaultConditions({
69871
+ body,
69872
+ given
69873
+ })) Object.assign(out, condition.props);
69875
69874
  return out;
69876
69875
  }
69876
+ function holdingDefaultConditions({ body, given }) {
69877
+ const defaults = unconditionalDefaults(body);
69878
+ return Object.entries(storedDefaultConditions(body)).flatMap(([key2, condition]) => {
69879
+ return Object.entries(condition.when).every(([prop, value]) => {
69880
+ const current = given[prop] !== void 0 ? given[prop] : defaults[prop];
69881
+ return String(refLeaf(current)) === String(refLeaf(value));
69882
+ }) ? [{
69883
+ key: key2,
69884
+ condition
69885
+ }] : [];
69886
+ });
69887
+ }
69888
+ function unconditionalDefaults(body) {
69889
+ return body?.defaultProps ?? {};
69890
+ }
69877
69891
 
69878
69892
  // ../config/dist/framework/config-operation-kind.js
69879
69893
  var CONFIG_OPERATION_KIND = "config";
@@ -106053,6 +106067,21 @@ var defineComponent = Object.assign(defineComponentImpl, {
106053
106067
  props: definePropsFirst
106054
106068
  });
106055
106069
 
106070
+ // ../config/dist/entities/system/resolve-properties.js
106071
+ var componentModels = createSliceMemo({
106072
+ kinds: [
106073
+ "component",
106074
+ "style-property",
106075
+ "token",
106076
+ "composite",
106077
+ "modifier",
106078
+ "icon",
106079
+ "motion",
106080
+ "source"
106081
+ ],
106082
+ compute: (_config) => /* @__PURE__ */ new Map()
106083
+ });
106084
+
106056
106085
  // ../config/dist/framework/derived-mutations.js
106057
106086
  var PROBE_COLLECTION = defineSubEntity({
106058
106087
  name: "member",
@@ -106150,7 +106179,7 @@ var transformLoader = function(source) {
106150
106179
  return source;
106151
106180
  }
106152
106181
  const projection = getLoaderProjection(config2);
106153
- let hasComponentReference = source.includes(linkedAlias);
106182
+ let hasComponentReference = source.includes(linkedAlias) || source.includes("/uds/components/");
106154
106183
  for (const name of projection.componentNames) {
106155
106184
  if (source.includes(name)) {
106156
106185
  hasComponentReference = true;
@@ -106175,60 +106204,64 @@ var transformLoader = function(source) {
106175
106204
  return source;
106176
106205
  }
106177
106206
  const edits = [];
106207
+ const rewriteSource = ({
106208
+ sourceNode,
106209
+ names
106210
+ }) => {
106211
+ const { start, end, value: moduleSource } = sourceNode;
106212
+ if (typeof start !== "number" || typeof end !== "number") return;
106213
+ const quote = source[start] ?? "'";
106214
+ const splice = (target2) => {
106215
+ edits.push({ start, end, value: `${quote}${target2}${quote}` });
106216
+ };
106217
+ if (moduleSource.startsWith(linkedAlias)) {
106218
+ splice(
106219
+ `${outputAlias}/components/_linked/${moduleSource.slice(linkedAlias.length)}`
106220
+ );
106221
+ return;
106222
+ }
106223
+ if (moduleSource.startsWith(".") || moduleSource.startsWith("/")) return;
106224
+ const segmentMatch = moduleSource.match(/\/uds\/components\/([^/]+)$/);
106225
+ if (!segmentMatch) return;
106226
+ const segment = segmentMatch[1];
106227
+ const pascal = segment.split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
106228
+ const namesComponent = names.some(
106229
+ (name) => projection.componentNames.has(name)
106230
+ );
106231
+ if (!namesComponent && !projection.componentNames.has(pascal)) return;
106232
+ splice(`${outputAlias}/components/${segment}`);
106233
+ };
106178
106234
  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
106235
  // biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
106185
106236
  ImportDeclaration(nodePath) {
106186
- const importSource = nodePath.node.source?.value;
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;
106237
+ const names = [];
106204
106238
  for (const specifier of nodePath.node.specifiers) {
106205
- if (specifier.type !== "ImportSpecifier") continue;
106206
- const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : void 0;
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;
106239
+ if (specifier.type === "ImportSpecifier" && specifier.imported?.type === "Identifier") {
106240
+ names.push(specifier.imported.name);
106218
106241
  }
106219
106242
  }
106220
- if (shouldRewriteSource && segmentMatch) {
106221
- const sourceNode = nodePath.node.source;
106222
- if (typeof sourceNode.start !== "number" || typeof sourceNode.end !== "number") {
106223
- return;
106243
+ rewriteSource({ sourceNode: nodePath.node.source, names });
106244
+ },
106245
+ // `export { Box } from '…'` runs the same module an import of `Box`
106246
+ // would. `export type { … } from '…'` is erased before it runs, and
106247
+ // stays pointed at the source its types come from.
106248
+ // biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
106249
+ ExportNamedDeclaration(nodePath) {
106250
+ const { node: node2 } = nodePath;
106251
+ if (!node2.source || node2.exportKind === "type") return;
106252
+ const names = [];
106253
+ for (const specifier of node2.specifiers) {
106254
+ if (specifier.type === "ExportSpecifier" && specifier.exportKind !== "type" && specifier.local?.type === "Identifier") {
106255
+ names.push(specifier.local.name);
106224
106256
  }
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
106257
  }
106258
+ rewriteSource({ sourceNode: node2.source, names });
106259
+ },
106260
+ // biome-ignore lint/suspicious/noExplicitAny: untyped babel traverse visitor
106261
+ ExportAllDeclaration(nodePath) {
106262
+ const { node: node2 } = nodePath;
106263
+ if (node2.exportKind === "type") return;
106264
+ rewriteSource({ sourceNode: node2.source, names: [] });
106232
106265
  }
106233
106266
  });
106234
106267
  if (edits.length === 0) return source;