@formspec/build 0.1.0-alpha.41 → 0.1.0-alpha.43

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/index.cjs CHANGED
@@ -1594,6 +1594,66 @@ function generateCustomType(type, ctx) {
1594
1594
  }
1595
1595
  return registration.toJsonSchema(type.payload, ctx.vendorPrefix);
1596
1596
  }
1597
+ var JSON_SCHEMA_STRUCTURAL_KEYWORDS = /* @__PURE__ */ new Set([
1598
+ "$schema",
1599
+ "$ref",
1600
+ "$defs",
1601
+ "$id",
1602
+ "$anchor",
1603
+ "$dynamicRef",
1604
+ "$dynamicAnchor",
1605
+ "$vocabulary",
1606
+ "$comment",
1607
+ "type",
1608
+ "enum",
1609
+ "const",
1610
+ "properties",
1611
+ "patternProperties",
1612
+ "additionalProperties",
1613
+ "required",
1614
+ "items",
1615
+ "prefixItems",
1616
+ "additionalItems",
1617
+ "contains",
1618
+ "allOf",
1619
+ "oneOf",
1620
+ "anyOf",
1621
+ "not",
1622
+ "if",
1623
+ "then",
1624
+ "else",
1625
+ "minimum",
1626
+ "maximum",
1627
+ "exclusiveMinimum",
1628
+ "exclusiveMaximum",
1629
+ "multipleOf",
1630
+ "minLength",
1631
+ "maxLength",
1632
+ "pattern",
1633
+ "minItems",
1634
+ "maxItems",
1635
+ "uniqueItems",
1636
+ "minProperties",
1637
+ "maxProperties",
1638
+ "minContains",
1639
+ "maxContains",
1640
+ "format",
1641
+ "title",
1642
+ "description",
1643
+ "default",
1644
+ "deprecated",
1645
+ "readOnly",
1646
+ "writeOnly",
1647
+ "examples",
1648
+ "dependentRequired",
1649
+ "dependentSchemas",
1650
+ "propertyNames",
1651
+ "unevaluatedItems",
1652
+ "unevaluatedProperties",
1653
+ "contentEncoding",
1654
+ "contentMediaType",
1655
+ "contentSchema"
1656
+ ]);
1597
1657
  function applyCustomConstraint(schema, constraint, ctx) {
1598
1658
  const registration = ctx.extensionRegistry?.findConstraint(constraint.constraintId);
1599
1659
  if (registration === void 0) {
@@ -1601,12 +1661,25 @@ function applyCustomConstraint(schema, constraint, ctx) {
1601
1661
  `Cannot generate JSON Schema for custom constraint "${constraint.constraintId}" without a matching extension registration`
1602
1662
  );
1603
1663
  }
1604
- assignVendorPrefixedExtensionKeywords(
1605
- schema,
1606
- registration.toJsonSchema(constraint.payload, ctx.vendorPrefix),
1607
- ctx.vendorPrefix,
1608
- `custom constraint "${constraint.constraintId}"`
1609
- );
1664
+ const extensionSchema = registration.toJsonSchema(constraint.payload, ctx.vendorPrefix);
1665
+ if (registration.emitsVocabularyKeywords) {
1666
+ const target = schema;
1667
+ for (const [key, value] of Object.entries(extensionSchema)) {
1668
+ if (JSON_SCHEMA_STRUCTURAL_KEYWORDS.has(key)) {
1669
+ throw new Error(
1670
+ `Custom constraint "${constraint.constraintId}" with emitsVocabularyKeywords must not overwrite standard JSON Schema keyword "${key}"`
1671
+ );
1672
+ }
1673
+ target[key] = value;
1674
+ }
1675
+ } else {
1676
+ assignVendorPrefixedExtensionKeywords(
1677
+ schema,
1678
+ extensionSchema,
1679
+ ctx.vendorPrefix,
1680
+ `custom constraint "${constraint.constraintId}"`
1681
+ );
1682
+ }
1610
1683
  }
1611
1684
  function applyCustomAnnotation(schema, annotation, ctx) {
1612
1685
  const registration = ctx.extensionRegistry?.findAnnotation(annotation.annotationId);
@@ -2136,48 +2209,8 @@ var ts2 = __toESM(require("typescript"), 1);
2136
2209
  // src/analyzer/tsdoc-parser.ts
2137
2210
  var ts = __toESM(require("typescript"), 1);
2138
2211
  var import_internal2 = require("@formspec/analysis/internal");
2139
- var import_tsdoc = require("@microsoft/tsdoc");
2140
2212
  var import_internals4 = require("@formspec/core/internals");
2141
2213
  var import_internals5 = require("@formspec/core/internals");
2142
- var TAGS_REQUIRING_RAW_TEXT = /* @__PURE__ */ new Set(["pattern", "enumOptions", "defaultValue"]);
2143
- function createFormSpecTSDocConfig(extensionTagNames = []) {
2144
- const config = new import_tsdoc.TSDocConfiguration();
2145
- for (const tagName of Object.keys(import_internals4.BUILTIN_CONSTRAINT_DEFINITIONS)) {
2146
- config.addTagDefinition(
2147
- new import_tsdoc.TSDocTagDefinition({
2148
- tagName: "@" + tagName,
2149
- syntaxKind: import_tsdoc.TSDocTagSyntaxKind.BlockTag,
2150
- allowMultiple: true
2151
- })
2152
- );
2153
- }
2154
- for (const tagName of ["apiName", "displayName", "format", "placeholder"]) {
2155
- config.addTagDefinition(
2156
- new import_tsdoc.TSDocTagDefinition({
2157
- tagName: "@" + tagName,
2158
- syntaxKind: import_tsdoc.TSDocTagSyntaxKind.BlockTag,
2159
- allowMultiple: true
2160
- })
2161
- );
2162
- }
2163
- for (const tagName of extensionTagNames) {
2164
- config.addTagDefinition(
2165
- new import_tsdoc.TSDocTagDefinition({
2166
- tagName: "@" + tagName,
2167
- syntaxKind: import_tsdoc.TSDocTagSyntaxKind.BlockTag,
2168
- allowMultiple: true
2169
- })
2170
- );
2171
- }
2172
- return config;
2173
- }
2174
- function sharedCommentSyntaxOptions(options, offset) {
2175
- const extensions = options?.extensionRegistry?.extensions;
2176
- return {
2177
- ...offset !== void 0 ? { offset } : {},
2178
- ...extensions !== void 0 ? { extensions } : {}
2179
- };
2180
- }
2181
2214
  function sharedTagValueOptions(options) {
2182
2215
  return {
2183
2216
  ...options?.extensionRegistry !== void 0 ? { registry: options.extensionRegistry } : {},
@@ -2277,6 +2310,30 @@ function pushUniqueCompilerDiagnostics(target, additions) {
2277
2310
  target.push(diagnostic);
2278
2311
  }
2279
2312
  }
2313
+ function processConstraintTag(tagName, text, parsedTag, provenance, node, sourceFile, supportingDeclarations, options, constraints, diagnostics) {
2314
+ const compilerDiagnostics = buildCompilerBackedConstraintDiagnostics(
2315
+ node,
2316
+ sourceFile,
2317
+ tagName,
2318
+ parsedTag,
2319
+ provenance,
2320
+ supportingDeclarations,
2321
+ options
2322
+ );
2323
+ if (compilerDiagnostics.length > 0) {
2324
+ pushUniqueCompilerDiagnostics(diagnostics, compilerDiagnostics);
2325
+ return;
2326
+ }
2327
+ const constraintNode = (0, import_internal2.parseConstraintTagValue)(
2328
+ tagName,
2329
+ text,
2330
+ provenance,
2331
+ sharedTagValueOptions(options)
2332
+ );
2333
+ if (constraintNode) {
2334
+ constraints.push(constraintNode);
2335
+ }
2336
+ }
2280
2337
  function renderSyntheticArgumentExpression(valueKind, argumentText) {
2281
2338
  const trimmed = argumentText.trim();
2282
2339
  if (trimmed === "") {
@@ -2562,10 +2619,9 @@ function buildCompilerBackedConstraintDiagnostics(node, sourceFile, tagName, par
2562
2619
  )
2563
2620
  ];
2564
2621
  }
2565
- var parserCache = /* @__PURE__ */ new Map();
2566
2622
  var parseResultCache = /* @__PURE__ */ new Map();
2567
- function getParser(options) {
2568
- const extensionTagNames = [
2623
+ function getExtensionTagNames(options) {
2624
+ return [
2569
2625
  ...options?.extensionRegistry?.extensions.flatMap(
2570
2626
  (extension) => (extension.constraintTags ?? []).map((tag) => (0, import_internal2.normalizeFormSpecTagName)(tag.tagName))
2571
2627
  ) ?? [],
@@ -2573,14 +2629,6 @@ function getParser(options) {
2573
2629
  (extension) => (extension.metadataSlots ?? []).map((slot) => (0, import_internal2.normalizeFormSpecTagName)(slot.tagName))
2574
2630
  ) ?? []
2575
2631
  ].sort();
2576
- const cacheKey = extensionTagNames.join("|");
2577
- const existing = parserCache.get(cacheKey);
2578
- if (existing) {
2579
- return existing;
2580
- }
2581
- const parser = new import_tsdoc.TSDocParser(createFormSpecTSDocConfig(extensionTagNames));
2582
- parserCache.set(cacheKey, parser);
2583
- return parser;
2584
2632
  }
2585
2633
  function getExtensionRegistryCacheKey(registry) {
2586
2634
  if (registry === void 0) {
@@ -2631,13 +2679,13 @@ function parseTSDocTags(node, file = "", options) {
2631
2679
  let placeholder;
2632
2680
  let displayNameProvenance;
2633
2681
  let placeholderProvenance;
2634
- const rawTextTags = [];
2635
2682
  const sourceFile = node.getSourceFile();
2636
2683
  const sourceText = sourceFile.getFullText();
2637
2684
  const extensionTypeNames = getExtensionTypeNames(options?.extensionRegistry);
2638
2685
  const supportingDeclarations = buildSupportingDeclarations(sourceFile, extensionTypeNames);
2639
2686
  const commentRanges = ts.getLeadingCommentRanges(sourceText, node.getFullStart());
2640
2687
  const rawTextFallbacks = collectRawTextFallbacks(node, file);
2688
+ const extensionTagNames = getExtensionTagNames(options);
2641
2689
  if (commentRanges) {
2642
2690
  for (const range of commentRanges) {
2643
2691
  if (range.kind !== ts.SyntaxKind.MultiLineCommentTrivia) {
@@ -2647,38 +2695,18 @@ function parseTSDocTags(node, file = "", options) {
2647
2695
  if (!commentText.startsWith("/**")) {
2648
2696
  continue;
2649
2697
  }
2650
- const parser = getParser(options);
2651
- const parserContext = parser.parseRange(
2652
- import_tsdoc.TextRange.fromStringRange(sourceText, range.pos, range.end)
2653
- );
2654
- const docComment = parserContext.docComment;
2655
- const parsedComment = (0, import_internal2.parseCommentBlock)(
2656
- commentText,
2657
- sharedCommentSyntaxOptions(options, range.pos)
2658
- );
2659
- let parsedTagCursor = 0;
2660
- const nextParsedTag = (normalizedTagName) => {
2661
- while (parsedTagCursor < parsedComment.tags.length) {
2662
- const candidate = parsedComment.tags[parsedTagCursor];
2663
- parsedTagCursor += 1;
2664
- if (candidate?.normalizedTagName === normalizedTagName) {
2665
- return candidate;
2666
- }
2667
- }
2668
- return null;
2669
- };
2670
- for (const parsedTag of parsedComment.tags) {
2671
- if (TAGS_REQUIRING_RAW_TEXT.has(parsedTag.normalizedTagName)) {
2672
- rawTextTags.push({ tag: parsedTag, commentText, commentOffset: range.pos });
2673
- }
2674
- }
2675
- for (const block of docComment.customBlocks) {
2676
- const tagName = (0, import_internals4.normalizeConstraintTagName)(block.blockTag.tagName.substring(1));
2677
- const parsedTag = nextParsedTag(tagName);
2698
+ const extensions = options?.extensionRegistry?.extensions;
2699
+ const unified = (0, import_internal2.parseUnifiedComment)(commentText, {
2700
+ offset: range.pos,
2701
+ extensionTagNames,
2702
+ ...extensions !== void 0 ? { extensions } : {}
2703
+ });
2704
+ for (const tag of unified.tags) {
2705
+ const tagName = tag.normalizedTagName;
2678
2706
  if (tagName === "displayName" || tagName === "format" || tagName === "placeholder") {
2679
- const text2 = getBestBlockPayloadText(parsedTag, commentText, range.pos, block);
2707
+ const text2 = tag.resolvedPayloadText;
2680
2708
  if (text2 === "") continue;
2681
- const provenance2 = parsedTag !== null ? provenanceForParsedTag(parsedTag, sourceFile, file) : provenanceForComment(range, sourceFile, file, tagName);
2709
+ const provenance2 = provenanceForParsedTag(tag, sourceFile, file);
2682
2710
  switch (tagName) {
2683
2711
  case "displayName":
2684
2712
  if (!isMemberTargetDisplayName(text2) && displayName === void 0) {
@@ -2703,64 +2731,69 @@ function parseTSDocTags(node, file = "", options) {
2703
2731
  }
2704
2732
  continue;
2705
2733
  }
2706
- if (TAGS_REQUIRING_RAW_TEXT.has(tagName)) continue;
2707
- const text = getBestBlockPayloadText(parsedTag, commentText, range.pos, block);
2708
- const expectedType = (0, import_internals4.isBuiltinConstraintName)(tagName) ? import_internals4.BUILTIN_CONSTRAINT_DEFINITIONS[tagName] : void 0;
2709
- if (text === "" && expectedType !== "boolean") continue;
2710
- const provenance = parsedTag !== null ? provenanceForParsedTag(parsedTag, sourceFile, file) : provenanceForComment(range, sourceFile, file, tagName);
2711
- const compilerDiagnostics = buildCompilerBackedConstraintDiagnostics(
2712
- node,
2713
- sourceFile,
2714
- tagName,
2715
- parsedTag,
2716
- provenance,
2717
- supportingDeclarations,
2718
- options
2719
- );
2720
- if (compilerDiagnostics.length > 0) {
2721
- pushUniqueCompilerDiagnostics(diagnostics, compilerDiagnostics);
2734
+ if (import_internal2.TAGS_REQUIRING_RAW_TEXT.has(tagName)) {
2735
+ const fallback = rawTextFallbacks.get(tagName)?.shift();
2736
+ const text2 = (0, import_internal2.choosePreferredPayloadText)(tag.resolvedPayloadText, fallback?.text ?? "");
2737
+ if (text2 === "") continue;
2738
+ const provenance2 = provenanceForParsedTag(tag, sourceFile, file);
2739
+ if (tagName === "defaultValue") {
2740
+ annotations.push((0, import_internal2.parseDefaultValueTagValue)(text2, provenance2));
2741
+ continue;
2742
+ }
2743
+ processConstraintTag(
2744
+ tagName,
2745
+ text2,
2746
+ tag,
2747
+ provenance2,
2748
+ node,
2749
+ sourceFile,
2750
+ supportingDeclarations,
2751
+ options,
2752
+ constraints,
2753
+ diagnostics
2754
+ );
2722
2755
  continue;
2723
2756
  }
2724
- const constraintNode = (0, import_internal2.parseConstraintTagValue)(
2757
+ const text = tag.resolvedPayloadText;
2758
+ const expectedType = (0, import_internals4.isBuiltinConstraintName)(tagName) ? import_internals4.BUILTIN_CONSTRAINT_DEFINITIONS[tagName] : void 0;
2759
+ if (text === "" && expectedType !== "boolean") continue;
2760
+ const provenance = provenanceForParsedTag(tag, sourceFile, file);
2761
+ processConstraintTag(
2725
2762
  tagName,
2726
2763
  text,
2764
+ tag,
2727
2765
  provenance,
2728
- sharedTagValueOptions(options)
2766
+ node,
2767
+ sourceFile,
2768
+ supportingDeclarations,
2769
+ options,
2770
+ constraints,
2771
+ diagnostics
2729
2772
  );
2730
- if (constraintNode) {
2731
- constraints.push(constraintNode);
2732
- }
2733
2773
  }
2734
- if (docComment.deprecatedBlock !== void 0) {
2735
- const message = extractBlockText(docComment.deprecatedBlock).trim();
2774
+ if (unified.isDeprecated) {
2736
2775
  annotations.push({
2737
2776
  kind: "annotation",
2738
2777
  annotationKind: "deprecated",
2739
- ...message !== "" && { message },
2778
+ ...unified.deprecationMessage !== "" && { message: unified.deprecationMessage },
2740
2779
  provenance: provenanceForComment(range, sourceFile, file, "deprecated")
2741
2780
  });
2742
2781
  }
2743
- {
2744
- const summary = extractPlainText(docComment.summarySection).trim();
2745
- if (summary !== "") {
2746
- annotations.push({
2747
- kind: "annotation",
2748
- annotationKind: "description",
2749
- value: summary,
2750
- provenance: provenanceForComment(range, sourceFile, file, "summary")
2751
- });
2752
- }
2782
+ if (unified.summaryText !== "") {
2783
+ annotations.push({
2784
+ kind: "annotation",
2785
+ annotationKind: "description",
2786
+ value: unified.summaryText,
2787
+ provenance: provenanceForComment(range, sourceFile, file, "summary")
2788
+ });
2753
2789
  }
2754
- if (docComment.remarksBlock !== void 0) {
2755
- const remarksText = extractBlockText(docComment.remarksBlock).trim();
2756
- if (remarksText !== "") {
2757
- annotations.push({
2758
- kind: "annotation",
2759
- annotationKind: "remarks",
2760
- value: remarksText,
2761
- provenance: provenanceForComment(range, sourceFile, file, "remarks")
2762
- });
2763
- }
2790
+ if (unified.remarksText !== "") {
2791
+ annotations.push({
2792
+ kind: "annotation",
2793
+ annotationKind: "remarks",
2794
+ value: unified.remarksText,
2795
+ provenance: provenanceForComment(range, sourceFile, file, "remarks")
2796
+ });
2764
2797
  }
2765
2798
  }
2766
2799
  }
@@ -2780,77 +2813,27 @@ function parseTSDocTags(node, file = "", options) {
2780
2813
  provenance: placeholderProvenance
2781
2814
  });
2782
2815
  }
2783
- if (rawTextTags.length > 0) {
2784
- for (const rawTextTag of rawTextTags) {
2785
- const fallbackQueue = rawTextFallbacks.get(rawTextTag.tag.normalizedTagName);
2786
- const fallback = fallbackQueue?.shift();
2787
- const text = choosePreferredPayloadText(
2788
- getSharedPayloadText(rawTextTag.tag, rawTextTag.commentText, rawTextTag.commentOffset),
2789
- fallback?.text ?? ""
2790
- );
2791
- if (text === "") continue;
2792
- const provenance = provenanceForParsedTag(rawTextTag.tag, sourceFile, file);
2793
- if (rawTextTag.tag.normalizedTagName === "defaultValue") {
2794
- const defaultValueNode = (0, import_internal2.parseDefaultValueTagValue)(text, provenance);
2795
- annotations.push(defaultValueNode);
2796
- continue;
2797
- }
2798
- const compilerDiagnostics = buildCompilerBackedConstraintDiagnostics(
2799
- node,
2800
- sourceFile,
2801
- rawTextTag.tag.normalizedTagName,
2802
- rawTextTag.tag,
2803
- provenance,
2804
- supportingDeclarations,
2805
- options
2806
- );
2807
- if (compilerDiagnostics.length > 0) {
2808
- pushUniqueCompilerDiagnostics(diagnostics, compilerDiagnostics);
2809
- continue;
2810
- }
2811
- const constraintNode = (0, import_internal2.parseConstraintTagValue)(
2812
- rawTextTag.tag.normalizedTagName,
2813
- text,
2814
- provenance,
2815
- sharedTagValueOptions(options)
2816
- );
2817
- if (constraintNode) {
2818
- constraints.push(constraintNode);
2819
- }
2820
- }
2821
- }
2822
2816
  for (const [tagName, fallbacks] of rawTextFallbacks) {
2823
2817
  for (const fallback of fallbacks) {
2824
2818
  const text = fallback.text.trim();
2825
2819
  if (text === "") continue;
2826
2820
  const provenance = fallback.provenance;
2827
2821
  if (tagName === "defaultValue") {
2828
- const defaultValueNode = (0, import_internal2.parseDefaultValueTagValue)(text, provenance);
2829
- annotations.push(defaultValueNode);
2822
+ annotations.push((0, import_internal2.parseDefaultValueTagValue)(text, provenance));
2830
2823
  continue;
2831
2824
  }
2832
- const compilerDiagnostics = buildCompilerBackedConstraintDiagnostics(
2833
- node,
2834
- sourceFile,
2825
+ processConstraintTag(
2835
2826
  tagName,
2827
+ text,
2836
2828
  null,
2837
2829
  provenance,
2830
+ node,
2831
+ sourceFile,
2838
2832
  supportingDeclarations,
2839
- options
2840
- );
2841
- if (compilerDiagnostics.length > 0) {
2842
- pushUniqueCompilerDiagnostics(diagnostics, compilerDiagnostics);
2843
- continue;
2844
- }
2845
- const constraintNode = (0, import_internal2.parseConstraintTagValue)(
2846
- tagName,
2847
- text,
2848
- provenance,
2849
- sharedTagValueOptions(options)
2833
+ options,
2834
+ constraints,
2835
+ diagnostics
2850
2836
  );
2851
- if (constraintNode) {
2852
- constraints.push(constraintNode);
2853
- }
2854
2837
  }
2855
2838
  }
2856
2839
  const result = { constraints, annotations, diagnostics };
@@ -2868,8 +2851,8 @@ function extractDisplayNameMetadata(node) {
2868
2851
  if (range.kind !== ts.SyntaxKind.MultiLineCommentTrivia) continue;
2869
2852
  const commentText = sourceText.substring(range.pos, range.end);
2870
2853
  if (!commentText.startsWith("/**")) continue;
2871
- const parsed = (0, import_internal2.parseCommentBlock)(commentText);
2872
- for (const tag of parsed.tags) {
2854
+ const unified = (0, import_internal2.parseUnifiedComment)(commentText);
2855
+ for (const tag of unified.tags) {
2873
2856
  if (tag.normalizedTagName !== "displayName") {
2874
2857
  continue;
2875
2858
  }
@@ -2888,56 +2871,11 @@ function extractDisplayNameMetadata(node) {
2888
2871
  memberDisplayNames
2889
2872
  };
2890
2873
  }
2891
- function extractBlockText(block) {
2892
- return extractPlainText(block.content);
2893
- }
2894
- function extractPlainText(node) {
2895
- let result = "";
2896
- if (node instanceof import_tsdoc.DocExcerpt) {
2897
- return node.content.toString();
2898
- }
2899
- if (node instanceof import_tsdoc.DocPlainText) {
2900
- return node.text;
2901
- }
2902
- if (node instanceof import_tsdoc.DocSoftBreak) {
2903
- return " ";
2904
- }
2905
- if (typeof node.getChildNodes === "function") {
2906
- for (const child of node.getChildNodes()) {
2907
- result += extractPlainText(child);
2908
- }
2909
- }
2910
- return result;
2911
- }
2912
- function choosePreferredPayloadText(primary, fallback) {
2913
- const preferred = primary.trim();
2914
- const alternate = fallback.trim();
2915
- if (preferred === "") return alternate;
2916
- if (alternate === "") return preferred;
2917
- if (alternate.includes("\n")) return alternate;
2918
- if (alternate.length > preferred.length && alternate.startsWith(preferred)) {
2919
- return alternate;
2920
- }
2921
- return preferred;
2922
- }
2923
- function getSharedPayloadText(tag, commentText, commentOffset) {
2924
- if (tag.payloadSpan === null) {
2925
- return "";
2926
- }
2927
- return (0, import_internal2.sliceCommentSpan)(commentText, tag.payloadSpan, {
2928
- offset: commentOffset
2929
- }).trim();
2930
- }
2931
- function getBestBlockPayloadText(tag, commentText, commentOffset, block) {
2932
- const sharedText = tag === null ? "" : getSharedPayloadText(tag, commentText, commentOffset);
2933
- const blockText = extractBlockText(block).replace(/\s+/g, " ").trim();
2934
- return choosePreferredPayloadText(sharedText, blockText);
2935
- }
2936
2874
  function collectRawTextFallbacks(node, file) {
2937
2875
  const fallbacks = /* @__PURE__ */ new Map();
2938
2876
  for (const tag of ts.getJSDocTags(node)) {
2939
2877
  const tagName = (0, import_internals4.normalizeConstraintTagName)(tag.tagName.text);
2940
- if (!TAGS_REQUIRING_RAW_TEXT.has(tagName)) continue;
2878
+ if (!import_internal2.TAGS_REQUIRING_RAW_TEXT.has(tagName)) continue;
2941
2879
  const commentText = getTagCommentText(tag)?.trim() ?? "";
2942
2880
  if (commentText === "") continue;
2943
2881
  const entries = fallbacks.get(tagName) ?? [];
@@ -4582,7 +4520,7 @@ function typeNodeContainsReference(type, targetName) {
4582
4520
  }
4583
4521
  }
4584
4522
  function shouldEmitResolvedObjectProperty(property, declaration) {
4585
- if (property.name.startsWith("__@")) {
4523
+ if (property.name.startsWith("__")) {
4586
4524
  return false;
4587
4525
  }
4588
4526
  if (declaration !== void 0 && "name" in declaration && declaration.name !== void 0) {
@@ -5573,7 +5511,9 @@ function generateSchemasFromClass(options) {
5573
5511
  classDecl,
5574
5512
  ctx.checker,
5575
5513
  options.filePath,
5514
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5576
5515
  options.extensionRegistry,
5516
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5577
5517
  options.metadata,
5578
5518
  options.discriminator
5579
5519
  );
@@ -5581,9 +5521,13 @@ function generateSchemasFromClass(options) {
5581
5521
  analysis,
5582
5522
  { file: options.filePath },
5583
5523
  {
5524
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5584
5525
  extensionRegistry: options.extensionRegistry,
5526
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5585
5527
  metadata: options.metadata,
5528
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5586
5529
  enumSerialization: options.enumSerialization,
5530
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5587
5531
  vendorPrefix: options.vendorPrefix
5588
5532
  }
5589
5533
  );
@@ -5630,7 +5574,12 @@ function generateSchemasDetailedInternal(options) {
5630
5574
  diagnostics: [createProgramContextFailureDiagnostic(options.filePath, error)]
5631
5575
  };
5632
5576
  }
5633
- return generateSchemasFromDetailedProgramContext(ctx, options.filePath, options.typeName, options);
5577
+ return generateSchemasFromDetailedProgramContext(
5578
+ ctx,
5579
+ options.filePath,
5580
+ options.typeName,
5581
+ options
5582
+ );
5634
5583
  }
5635
5584
  function generateSchemasFromProgramDetailed(options) {
5636
5585
  return generateSchemasFromProgram({
@@ -5648,7 +5597,12 @@ function generateSchemasFromProgramDetailedInternal(options) {
5648
5597
  diagnostics: [createProgramContextFailureDiagnostic(options.filePath, error)]
5649
5598
  };
5650
5599
  }
5651
- return generateSchemasFromDetailedProgramContext(ctx, options.filePath, options.typeName, options);
5600
+ return generateSchemasFromDetailedProgramContext(
5601
+ ctx,
5602
+ options.filePath,
5603
+ options.typeName,
5604
+ options
5605
+ );
5652
5606
  }
5653
5607
  function generateSchemasBatch(options) {
5654
5608
  const contextCache = /* @__PURE__ */ new Map();
@@ -5692,13 +5646,27 @@ function generateSchemasBatchFromProgram(options) {
5692
5646
  );
5693
5647
  });
5694
5648
  }
5649
+ function resolveOptions(options) {
5650
+ const configRegistry = options.config?.extensions !== void 0 ? createExtensionRegistry(options.config.extensions) : void 0;
5651
+ return {
5652
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5653
+ extensionRegistry: options.extensionRegistry ?? configRegistry,
5654
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5655
+ vendorPrefix: options.vendorPrefix ?? options.config?.vendorPrefix,
5656
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5657
+ enumSerialization: options.enumSerialization ?? options.config?.enumSerialization,
5658
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5659
+ metadata: options.metadata ?? options.config?.metadata
5660
+ };
5661
+ }
5695
5662
  function generateSchemasFromDetailedProgramContext(ctx, filePath, typeName, options) {
5663
+ const resolved = resolveOptions(options);
5696
5664
  const analysisResult = analyzeNamedTypeToIRFromProgramContextDetailed(
5697
5665
  ctx,
5698
5666
  filePath,
5699
5667
  typeName,
5700
- options.extensionRegistry,
5701
- options.metadata,
5668
+ resolved.extensionRegistry,
5669
+ resolved.metadata,
5702
5670
  options.discriminator
5703
5671
  );
5704
5672
  if (!analysisResult.ok) {
@@ -5711,10 +5679,10 @@ function generateSchemasFromDetailedProgramContext(ctx, filePath, typeName, opti
5711
5679
  analysisResult.analysis,
5712
5680
  { file: filePath },
5713
5681
  {
5714
- extensionRegistry: options.extensionRegistry,
5715
- metadata: options.metadata,
5716
- enumSerialization: options.enumSerialization,
5717
- vendorPrefix: options.vendorPrefix
5682
+ extensionRegistry: resolved.extensionRegistry,
5683
+ metadata: resolved.metadata,
5684
+ enumSerialization: resolved.enumSerialization,
5685
+ vendorPrefix: resolved.vendorPrefix
5718
5686
  }
5719
5687
  );
5720
5688
  }
@@ -5851,6 +5819,7 @@ function omitApiName(metadata) {
5851
5819
  }
5852
5820
  function enforceRequiredMetadata(metadata, declarationKind, logicalName, options) {
5853
5821
  const declarationPolicy = getDeclarationMetadataPolicy(
5822
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5854
5823
  normalizeMetadataPolicy(options.metadata),
5855
5824
  declarationKind
5856
5825
  );
@@ -5925,6 +5894,7 @@ function toStandaloneJsonSchema(root, typeRegistry, options) {
5925
5894
  provenance: syntheticField.provenance
5926
5895
  },
5927
5896
  {
5897
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5928
5898
  policy: normalizeMetadataPolicy(options?.metadata),
5929
5899
  surface: "tsdoc",
5930
5900
  rootLogicalName: root.name
@@ -5933,8 +5903,11 @@ function toStandaloneJsonSchema(root, typeRegistry, options) {
5933
5903
  const schema = generateJsonSchemaFromIR(
5934
5904
  ir,
5935
5905
  {
5906
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5936
5907
  extensionRegistry: options?.extensionRegistry,
5908
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5937
5909
  enumSerialization: options?.enumSerialization,
5910
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5938
5911
  vendorPrefix: options?.vendorPrefix
5939
5912
  }
5940
5913
  );
@@ -5960,9 +5933,13 @@ function generateSchemasFromAnalysis(analysis, filePath, options) {
5960
5933
  analysis,
5961
5934
  { file: filePath },
5962
5935
  {
5936
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5963
5937
  extensionRegistry: options?.extensionRegistry,
5938
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5964
5939
  enumSerialization: options?.enumSerialization,
5940
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5965
5941
  metadata: options?.metadata,
5942
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5966
5943
  vendorPrefix: options?.vendorPrefix
5967
5944
  }
5968
5945
  ),
@@ -5987,7 +5964,9 @@ function generateSchemasFromResolvedType(options, skipNamedDeclaration = false,
5987
5964
  typeRegistry,
5988
5965
  /* @__PURE__ */ new Set(),
5989
5966
  options.sourceNode,
5967
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5990
5968
  createAnalyzerMetadataPolicy(options.metadata, options.discriminator),
5969
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
5991
5970
  options.extensionRegistry,
5992
5971
  diagnostics
5993
5972
  );
@@ -6036,7 +6015,9 @@ function generateSchemasFromDeclaration(options) {
6036
6015
  options.declaration,
6037
6016
  options.context.checker,
6038
6017
  filePath,
6018
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6039
6019
  options.extensionRegistry,
6020
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6040
6021
  options.metadata,
6041
6022
  options.discriminator
6042
6023
  ),
@@ -6050,7 +6031,9 @@ function generateSchemasFromDeclaration(options) {
6050
6031
  options.declaration,
6051
6032
  options.context.checker,
6052
6033
  filePath,
6034
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6053
6035
  options.extensionRegistry,
6036
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6054
6037
  options.metadata,
6055
6038
  options.discriminator
6056
6039
  ),
@@ -6063,7 +6046,9 @@ function generateSchemasFromDeclaration(options) {
6063
6046
  options.declaration,
6064
6047
  options.context.checker,
6065
6048
  filePath,
6049
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6066
6050
  options.extensionRegistry,
6051
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6067
6052
  options.metadata,
6068
6053
  options.discriminator
6069
6054
  );
@@ -6074,7 +6059,9 @@ function generateSchemasFromDeclaration(options) {
6074
6059
  options.declaration,
6075
6060
  options.context.checker,
6076
6061
  filePath,
6062
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6077
6063
  options.extensionRegistry,
6064
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6078
6065
  options.metadata
6079
6066
  );
6080
6067
  if (aliasRootInfo.diagnostics.length > 0) {
@@ -6129,7 +6116,9 @@ function resolveDeclarationMetadata(options) {
6129
6116
  const analysis = (0, import_internal5.analyzeMetadataForNodeWithChecker)({
6130
6117
  checker: options.context.checker,
6131
6118
  node: options.declaration,
6119
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6132
6120
  metadata: options.metadata,
6121
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6133
6122
  extensions: options.extensionRegistry?.extensions,
6134
6123
  buildContext: options.context
6135
6124
  });
@@ -6166,7 +6155,9 @@ function buildMixedAuthoringSchemas(options) {
6166
6155
  const analysis = analyzeNamedTypeToIR(
6167
6156
  filePath,
6168
6157
  typeName,
6158
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6169
6159
  schemaOptions.extensionRegistry,
6160
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6170
6161
  schemaOptions.metadata,
6171
6162
  schemaOptions.discriminator
6172
6163
  );
@@ -6174,6 +6165,7 @@ function buildMixedAuthoringSchemas(options) {
6174
6165
  const ir = canonicalizeTSDoc(
6175
6166
  composedAnalysis,
6176
6167
  { file: filePath },
6168
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- migration bridge reads deprecated fields
6177
6169
  schemaOptions.metadata !== void 0 ? { metadata: schemaOptions.metadata } : void 0
6178
6170
  );
6179
6171
  return {