@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.
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts +7 -8
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts.map +1 -1
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +5 -4
- package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +1 -1
- package/dist/__tests__/fixtures/example-interface-types.d.ts +7 -2
- package/dist/__tests__/fixtures/example-interface-types.d.ts.map +1 -1
- package/dist/__tests__/fixtures/sample-forms.d.ts +1 -1
- package/dist/__tests__/parity/utils.d.ts +3 -2
- package/dist/__tests__/parity/utils.d.ts.map +1 -1
- package/dist/analyzer/class-analyzer.d.ts +1 -1
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts +8 -7
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
- package/dist/browser.cjs +6 -3
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +4 -1
- package/dist/browser.js.map +1 -1
- package/dist/build.d.ts +150 -2
- package/dist/cli.cjs +44 -47
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +25 -28
- package/dist/cli.js.map +1 -1
- package/dist/extensions/registry.d.ts +4 -0
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/generators/class-schema.d.ts +12 -0
- package/dist/generators/class-schema.d.ts.map +1 -1
- package/dist/generators/mixed-authoring.d.ts +6 -0
- package/dist/generators/mixed-authoring.d.ts.map +1 -1
- package/dist/index.cjs +42 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -28
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +42 -45
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.js +25 -28
- package/dist/internals.js.map +1 -1
- package/dist/json-schema/generator.d.ts +4 -0
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/ir-generator.d.ts +6 -0
- package/dist/json-schema/ir-generator.d.ts.map +1 -1
- package/dist/json-schema/schema.d.ts +7 -0
- package/dist/json-schema/schema.d.ts.map +1 -1
- package/dist/json-schema/types.d.ts +18 -2
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/ui-schema/generator.d.ts +2 -0
- package/dist/ui-schema/generator.d.ts.map +1 -1
- package/dist/ui-schema/schema.d.ts +77 -0
- package/dist/ui-schema/schema.d.ts.map +1 -1
- package/dist/ui-schema/types.d.ts +2 -0
- package/dist/ui-schema/types.d.ts.map +1 -1
- package/dist/validate/constraint-validator.d.ts +1 -1
- package/dist/validate/constraint-validator.d.ts.map +1 -1
- 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", "
|
|
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 === "
|
|
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
|
-
|
|
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
|
-
|
|
1817
|
-
|
|
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,
|