@formspec/build 0.1.0-alpha.20 → 0.1.0-alpha.22
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/internals.js
CHANGED
|
@@ -410,7 +410,7 @@ import {
|
|
|
410
410
|
sliceCommentSpan,
|
|
411
411
|
parseCommentBlock,
|
|
412
412
|
parseTagSyntax
|
|
413
|
-
} from "@formspec/analysis";
|
|
413
|
+
} from "@formspec/analysis/internal";
|
|
414
414
|
import {
|
|
415
415
|
TSDocParser,
|
|
416
416
|
TSDocConfiguration,
|
|
@@ -437,7 +437,7 @@ function createFormSpecTSDocConfig(extensionTagNames = []) {
|
|
|
437
437
|
})
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
for (const tagName of ["displayName", "
|
|
440
|
+
for (const tagName of ["displayName", "format", "placeholder"]) {
|
|
441
441
|
config.addTagDefinition(
|
|
442
442
|
new TSDocTagDefinition({
|
|
443
443
|
tagName: "@" + tagName,
|
|
@@ -797,10 +797,8 @@ function parseTSDocTags(node, file = "", options) {
|
|
|
797
797
|
const annotations = [];
|
|
798
798
|
const diagnostics = [];
|
|
799
799
|
let displayName;
|
|
800
|
-
let description;
|
|
801
800
|
let placeholder;
|
|
802
801
|
let displayNameProvenance;
|
|
803
|
-
let descriptionProvenance;
|
|
804
802
|
let placeholderProvenance;
|
|
805
803
|
const rawTextTags = [];
|
|
806
804
|
const sourceFile = node.getSourceFile();
|
|
@@ -845,7 +843,7 @@ function parseTSDocTags(node, file = "", options) {
|
|
|
845
843
|
for (const block of docComment.customBlocks) {
|
|
846
844
|
const tagName = normalizeConstraintTagName(block.blockTag.tagName.substring(1));
|
|
847
845
|
const parsedTag = nextParsedTag(tagName);
|
|
848
|
-
if (tagName === "displayName" || tagName === "
|
|
846
|
+
if (tagName === "displayName" || tagName === "format" || tagName === "placeholder") {
|
|
849
847
|
const text2 = getBestBlockPayloadText(parsedTag, commentText, range.pos, block);
|
|
850
848
|
if (text2 === "") continue;
|
|
851
849
|
const provenance2 = parsedTag !== null ? provenanceForParsedTag(parsedTag, sourceFile, file) : provenanceForComment(range, sourceFile, file, tagName);
|
|
@@ -864,10 +862,6 @@ function parseTSDocTags(node, file = "", options) {
|
|
|
864
862
|
provenance: provenance2
|
|
865
863
|
});
|
|
866
864
|
break;
|
|
867
|
-
case "description":
|
|
868
|
-
description = text2;
|
|
869
|
-
descriptionProvenance = provenance2;
|
|
870
|
-
break;
|
|
871
865
|
case "placeholder":
|
|
872
866
|
if (placeholder === void 0) {
|
|
873
867
|
placeholder = text2;
|
|
@@ -914,18 +908,26 @@ function parseTSDocTags(node, file = "", options) {
|
|
|
914
908
|
provenance: provenanceForComment(range, sourceFile, file, "deprecated")
|
|
915
909
|
});
|
|
916
910
|
}
|
|
917
|
-
|
|
918
|
-
const remarks = extractBlockText(docComment.remarksBlock).trim();
|
|
919
|
-
if (remarks !== "") {
|
|
920
|
-
description = remarks;
|
|
921
|
-
descriptionProvenance = provenanceForComment(range, sourceFile, file, "remarks");
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
if (description === void 0) {
|
|
911
|
+
{
|
|
925
912
|
const summary = extractPlainText(docComment.summarySection).trim();
|
|
926
913
|
if (summary !== "") {
|
|
927
|
-
|
|
928
|
-
|
|
914
|
+
annotations.push({
|
|
915
|
+
kind: "annotation",
|
|
916
|
+
annotationKind: "description",
|
|
917
|
+
value: summary,
|
|
918
|
+
provenance: provenanceForComment(range, sourceFile, file, "summary")
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
if (docComment.remarksBlock !== void 0) {
|
|
923
|
+
const remarksText = extractBlockText(docComment.remarksBlock).trim();
|
|
924
|
+
if (remarksText !== "") {
|
|
925
|
+
annotations.push({
|
|
926
|
+
kind: "annotation",
|
|
927
|
+
annotationKind: "remarks",
|
|
928
|
+
value: remarksText,
|
|
929
|
+
provenance: provenanceForComment(range, sourceFile, file, "remarks")
|
|
930
|
+
});
|
|
929
931
|
}
|
|
930
932
|
}
|
|
931
933
|
}
|
|
@@ -938,14 +940,6 @@ function parseTSDocTags(node, file = "", options) {
|
|
|
938
940
|
provenance: displayNameProvenance
|
|
939
941
|
});
|
|
940
942
|
}
|
|
941
|
-
if (description !== void 0 && descriptionProvenance !== void 0) {
|
|
942
|
-
annotations.push({
|
|
943
|
-
kind: "annotation",
|
|
944
|
-
annotationKind: "description",
|
|
945
|
-
value: description,
|
|
946
|
-
provenance: descriptionProvenance
|
|
947
|
-
});
|
|
948
|
-
}
|
|
949
943
|
if (placeholder !== void 0 && placeholderProvenance !== void 0) {
|
|
950
944
|
annotations.push({
|
|
951
945
|
kind: "annotation",
|
|
@@ -2731,6 +2725,9 @@ function applyAnnotations(schema, annotations, ctx) {
|
|
|
2731
2725
|
case "description":
|
|
2732
2726
|
schema.description = annotation.value;
|
|
2733
2727
|
break;
|
|
2728
|
+
case "remarks":
|
|
2729
|
+
schema[`${ctx.vendorPrefix}-remarks`] = annotation.value;
|
|
2730
|
+
break;
|
|
2734
2731
|
case "defaultValue":
|
|
2735
2732
|
schema.default = annotation.value;
|
|
2736
2733
|
break;
|
|
@@ -3034,7 +3031,7 @@ function generateUiSchemaFromIR(ir) {
|
|
|
3034
3031
|
// src/validate/constraint-validator.ts
|
|
3035
3032
|
import {
|
|
3036
3033
|
analyzeConstraintTargets
|
|
3037
|
-
} from "@formspec/analysis";
|
|
3034
|
+
} from "@formspec/analysis/internal";
|
|
3038
3035
|
function validateFieldNode(ctx, field) {
|
|
3039
3036
|
const analysis = analyzeConstraintTargets(
|
|
3040
3037
|
field.name,
|