@formspec/build 0.1.0-alpha.54 → 0.1.0-alpha.55

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/browser.js CHANGED
@@ -1055,10 +1055,11 @@ function generatePrimitiveType(type) {
1055
1055
  function generateEnumType(type, ctx) {
1056
1056
  if (ctx.enumSerialization === "oneOf") {
1057
1057
  return {
1058
- oneOf: type.members.map((m) => ({
1059
- const: m.value,
1060
- title: m.displayName ?? String(m.value)
1061
- }))
1058
+ oneOf: type.members.map((m) => {
1059
+ const stringValue = String(m.value);
1060
+ const title = m.displayName !== void 0 && m.displayName !== stringValue ? m.displayName : void 0;
1061
+ return title !== void 0 ? { const: m.value, title } : { const: m.value };
1062
+ })
1062
1063
  };
1063
1064
  }
1064
1065
  const schema = { enum: type.members.map((m) => m.value) };
@@ -1851,7 +1852,8 @@ import {
1851
1852
  } from "@formspec/core/internals";
1852
1853
  import {
1853
1854
  getTagDefinition,
1854
- normalizeFormSpecTagName
1855
+ normalizeFormSpecTagName,
1856
+ getSyntheticLogger
1855
1857
  } from "@formspec/analysis/internal";
1856
1858
  var BUILTIN_METADATA_TAGS = /* @__PURE__ */ new Set(["apiName", "displayName"]);
1857
1859
  function buildConstraintTagSources(extensions) {
@@ -1865,6 +1867,11 @@ function buildConstraintTagSources(extensions) {
1865
1867
  }));
1866
1868
  }
1867
1869
  function createExtensionRegistry(extensions) {
1870
+ const registryLog = getSyntheticLogger();
1871
+ registryLog.debug("createExtensionRegistry: constructing", {
1872
+ extensionCount: extensions.length,
1873
+ extensionIds: extensions.map((e) => e.extensionId)
1874
+ });
1868
1875
  const reservedTagSources = buildConstraintTagSources(extensions);
1869
1876
  let symbolMap = /* @__PURE__ */ new Map();
1870
1877
  const typeMap = /* @__PURE__ */ new Map();
@@ -1996,6 +2003,14 @@ function createExtensionRegistry(extensions) {
1996
2003
  }
1997
2004
  }
1998
2005
  }
2006
+ registryLog.debug("createExtensionRegistry: complete", {
2007
+ typeCount: typeMap.size,
2008
+ constraintCount: constraintMap.size,
2009
+ constraintTagCount: constraintTagMap.size,
2010
+ broadeningCount: builtinBroadeningMap.size,
2011
+ annotationCount: annotationMap.size,
2012
+ metadataSlotCount: metadataSlotMap.size
2013
+ });
1999
2014
  return {
2000
2015
  extensions,
2001
2016
  findType: (typeId) => typeMap.get(typeId),