@formspec/build 0.1.0-alpha.20 → 0.1.0-alpha.21

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.
Files changed (55) hide show
  1. package/dist/__tests__/fixtures/class-schema-regressions.d.ts +7 -8
  2. package/dist/__tests__/fixtures/class-schema-regressions.d.ts.map +1 -1
  3. package/dist/__tests__/fixtures/example-a-builtins.d.ts +5 -4
  4. package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +1 -1
  5. package/dist/__tests__/fixtures/example-interface-types.d.ts +7 -2
  6. package/dist/__tests__/fixtures/example-interface-types.d.ts.map +1 -1
  7. package/dist/__tests__/fixtures/sample-forms.d.ts +1 -1
  8. package/dist/__tests__/parity/utils.d.ts +3 -2
  9. package/dist/__tests__/parity/utils.d.ts.map +1 -1
  10. package/dist/analyzer/class-analyzer.d.ts +1 -1
  11. package/dist/analyzer/class-analyzer.d.ts.map +1 -1
  12. package/dist/analyzer/tsdoc-parser.d.ts +8 -7
  13. package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
  14. package/dist/browser.cjs +6 -3
  15. package/dist/browser.cjs.map +1 -1
  16. package/dist/browser.js +4 -1
  17. package/dist/browser.js.map +1 -1
  18. package/dist/build.d.ts +150 -2
  19. package/dist/cli.cjs +44 -47
  20. package/dist/cli.cjs.map +1 -1
  21. package/dist/cli.js +25 -28
  22. package/dist/cli.js.map +1 -1
  23. package/dist/extensions/registry.d.ts +4 -0
  24. package/dist/extensions/registry.d.ts.map +1 -1
  25. package/dist/generators/class-schema.d.ts +12 -0
  26. package/dist/generators/class-schema.d.ts.map +1 -1
  27. package/dist/generators/mixed-authoring.d.ts +6 -0
  28. package/dist/generators/mixed-authoring.d.ts.map +1 -1
  29. package/dist/index.cjs +42 -45
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.ts +12 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +25 -28
  34. package/dist/index.js.map +1 -1
  35. package/dist/internals.cjs +42 -45
  36. package/dist/internals.cjs.map +1 -1
  37. package/dist/internals.js +25 -28
  38. package/dist/internals.js.map +1 -1
  39. package/dist/json-schema/generator.d.ts +4 -0
  40. package/dist/json-schema/generator.d.ts.map +1 -1
  41. package/dist/json-schema/ir-generator.d.ts +6 -0
  42. package/dist/json-schema/ir-generator.d.ts.map +1 -1
  43. package/dist/json-schema/schema.d.ts +7 -0
  44. package/dist/json-schema/schema.d.ts.map +1 -1
  45. package/dist/json-schema/types.d.ts +18 -2
  46. package/dist/json-schema/types.d.ts.map +1 -1
  47. package/dist/ui-schema/generator.d.ts +2 -0
  48. package/dist/ui-schema/generator.d.ts.map +1 -1
  49. package/dist/ui-schema/schema.d.ts +77 -0
  50. package/dist/ui-schema/schema.d.ts.map +1 -1
  51. package/dist/ui-schema/types.d.ts +2 -0
  52. package/dist/ui-schema/types.d.ts.map +1 -1
  53. package/dist/validate/constraint-validator.d.ts +1 -1
  54. package/dist/validate/constraint-validator.d.ts.map +1 -1
  55. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -772,6 +772,9 @@ function applyAnnotations(schema, annotations, ctx) {
772
772
  case "description":
773
773
  schema.description = annotation.value;
774
774
  break;
775
+ case "remarks":
776
+ schema[`${ctx.vendorPrefix}-remarks`] = annotation.value;
777
+ break;
775
778
  case "defaultValue":
776
779
  schema.default = annotation.value;
777
780
  break;
@@ -1303,7 +1306,7 @@ import {
1303
1306
  sliceCommentSpan,
1304
1307
  parseCommentBlock,
1305
1308
  parseTagSyntax
1306
- } from "@formspec/analysis";
1309
+ } from "@formspec/analysis/internal";
1307
1310
  import {
1308
1311
  TSDocParser,
1309
1312
  TSDocConfiguration,
@@ -1329,7 +1332,7 @@ function createFormSpecTSDocConfig(extensionTagNames = []) {
1329
1332
  })
1330
1333
  );
1331
1334
  }
1332
- for (const tagName of ["displayName", "description", "format", "placeholder"]) {
1335
+ for (const tagName of ["displayName", "format", "placeholder"]) {
1333
1336
  config.addTagDefinition(
1334
1337
  new TSDocTagDefinition({
1335
1338
  tagName: "@" + tagName,
@@ -1686,10 +1689,8 @@ function parseTSDocTags(node, file = "", options) {
1686
1689
  const annotations = [];
1687
1690
  const diagnostics = [];
1688
1691
  let displayName;
1689
- let description;
1690
1692
  let placeholder;
1691
1693
  let displayNameProvenance;
1692
- let descriptionProvenance;
1693
1694
  let placeholderProvenance;
1694
1695
  const rawTextTags = [];
1695
1696
  const sourceFile = node.getSourceFile();
@@ -1734,7 +1735,7 @@ function parseTSDocTags(node, file = "", options) {
1734
1735
  for (const block of docComment.customBlocks) {
1735
1736
  const tagName = normalizeConstraintTagName(block.blockTag.tagName.substring(1));
1736
1737
  const parsedTag = nextParsedTag(tagName);
1737
- if (tagName === "displayName" || tagName === "description" || tagName === "format" || tagName === "placeholder") {
1738
+ if (tagName === "displayName" || tagName === "format" || tagName === "placeholder") {
1738
1739
  const text2 = getBestBlockPayloadText(parsedTag, commentText, range.pos, block);
1739
1740
  if (text2 === "") continue;
1740
1741
  const provenance2 = parsedTag !== null ? provenanceForParsedTag(parsedTag, sourceFile, file) : provenanceForComment(range, sourceFile, file, tagName);
@@ -1753,10 +1754,6 @@ function parseTSDocTags(node, file = "", options) {
1753
1754
  provenance: provenance2
1754
1755
  });
1755
1756
  break;
1756
- case "description":
1757
- description = text2;
1758
- descriptionProvenance = provenance2;
1759
- break;
1760
1757
  case "placeholder":
1761
1758
  if (placeholder === void 0) {
1762
1759
  placeholder = text2;
@@ -1803,18 +1800,26 @@ function parseTSDocTags(node, file = "", options) {
1803
1800
  provenance: provenanceForComment(range, sourceFile, file, "deprecated")
1804
1801
  });
1805
1802
  }
1806
- if (description === void 0 && docComment.remarksBlock !== void 0) {
1807
- const remarks = extractBlockText(docComment.remarksBlock).trim();
1808
- if (remarks !== "") {
1809
- description = remarks;
1810
- descriptionProvenance = provenanceForComment(range, sourceFile, file, "remarks");
1811
- }
1812
- }
1813
- if (description === void 0) {
1803
+ {
1814
1804
  const summary = extractPlainText(docComment.summarySection).trim();
1815
1805
  if (summary !== "") {
1816
- description = summary;
1817
- descriptionProvenance = provenanceForComment(range, sourceFile, file, "summary");
1806
+ annotations.push({
1807
+ kind: "annotation",
1808
+ annotationKind: "description",
1809
+ value: summary,
1810
+ provenance: provenanceForComment(range, sourceFile, file, "summary")
1811
+ });
1812
+ }
1813
+ }
1814
+ if (docComment.remarksBlock !== void 0) {
1815
+ const remarksText = extractBlockText(docComment.remarksBlock).trim();
1816
+ if (remarksText !== "") {
1817
+ annotations.push({
1818
+ kind: "annotation",
1819
+ annotationKind: "remarks",
1820
+ value: remarksText,
1821
+ provenance: provenanceForComment(range, sourceFile, file, "remarks")
1822
+ });
1818
1823
  }
1819
1824
  }
1820
1825
  }
@@ -1827,14 +1832,6 @@ function parseTSDocTags(node, file = "", options) {
1827
1832
  provenance: displayNameProvenance
1828
1833
  });
1829
1834
  }
1830
- if (description !== void 0 && descriptionProvenance !== void 0) {
1831
- annotations.push({
1832
- kind: "annotation",
1833
- annotationKind: "description",
1834
- value: description,
1835
- provenance: descriptionProvenance
1836
- });
1837
- }
1838
1835
  if (placeholder !== void 0 && placeholderProvenance !== void 0) {
1839
1836
  annotations.push({
1840
1837
  kind: "annotation",
@@ -3324,7 +3321,7 @@ var init_program = __esm({
3324
3321
  // src/validate/constraint-validator.ts
3325
3322
  import {
3326
3323
  analyzeConstraintTargets
3327
- } from "@formspec/analysis";
3324
+ } from "@formspec/analysis/internal";
3328
3325
  function validateFieldNode(ctx, field) {
3329
3326
  const analysis = analyzeConstraintTargets(
3330
3327
  field.name,