@formspec/build 0.1.0-alpha.22 → 0.1.0-alpha.24
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/README.md +9 -4
- package/dist/analyzer/class-analyzer.d.ts +1 -1
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
- package/dist/browser.cjs +5 -4
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +4 -3
- package/dist/browser.js.map +1 -1
- package/dist/build-alpha.d.ts +836 -0
- package/dist/build-beta.d.ts +836 -0
- package/dist/build-internal.d.ts +836 -0
- package/dist/build.d.ts +157 -538
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts +2 -1
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts.map +1 -1
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts +1 -1
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -1
- package/dist/cli.cjs +85 -126
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +76 -116
- package/dist/cli.js.map +1 -1
- package/dist/generators/class-schema.d.ts +20 -3
- package/dist/generators/class-schema.d.ts.map +1 -1
- package/dist/generators/mixed-authoring.d.ts +3 -2
- package/dist/generators/mixed-authoring.d.ts.map +1 -1
- package/dist/index.cjs +82 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -101
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +80 -15
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.d.ts +2 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +73 -7
- package/dist/internals.js.map +1 -1
- package/dist/json-schema/generator.d.ts +8 -4
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/ir-generator.d.ts +4 -4
- package/dist/json-schema/ir-generator.d.ts.map +1 -1
- package/dist/json-schema/schema.d.ts +2 -2
- package/dist/json-schema/types.d.ts +6 -6
- package/dist/ui-schema/ir-generator.d.ts +1 -1
- package/dist/ui-schema/ir-generator.d.ts.map +1 -1
- package/dist/ui-schema/schema.d.ts +28 -28
- package/dist/ui-schema/types.d.ts +152 -3
- 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 +8 -8
- package/dist/__tests__/alias-chain-propagation.test.d.ts +0 -9
- package/dist/__tests__/alias-chain-propagation.test.d.ts.map +0 -1
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts +0 -2
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts.map +0 -1
- package/dist/__tests__/class-schema.test.d.ts +0 -2
- package/dist/__tests__/class-schema.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/constraint-validator.test.d.ts +0 -2
- package/dist/__tests__/constraint-validator.test.d.ts.map +0 -1
- package/dist/__tests__/date-extension.integration.test.d.ts +0 -2
- package/dist/__tests__/date-extension.integration.test.d.ts.map +0 -1
- package/dist/__tests__/edge-cases.test.d.ts +0 -7
- package/dist/__tests__/edge-cases.test.d.ts.map +0 -1
- package/dist/__tests__/extension-api.test.d.ts +0 -2
- package/dist/__tests__/extension-api.test.d.ts.map +0 -1
- package/dist/__tests__/extension-runtime.integration.test.d.ts +0 -2
- package/dist/__tests__/extension-runtime.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fixtures/alias-chains.d.ts +0 -37
- package/dist/__tests__/fixtures/alias-chains.d.ts.map +0 -1
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts +0 -86
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts.map +0 -1
- package/dist/__tests__/fixtures/edge-cases.d.ts +0 -132
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +0 -31
- package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-date-extension.d.ts +0 -12
- package/dist/__tests__/fixtures/example-date-extension.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-interface-types.d.ts +0 -107
- package/dist/__tests__/fixtures/example-interface-types.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts +0 -20
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts.map +0 -1
- package/dist/__tests__/fixtures/extension-forms.d.ts +0 -7
- package/dist/__tests__/fixtures/extension-forms.d.ts.map +0 -1
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +0 -31
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +0 -1
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts +0 -15
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts.map +0 -1
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts +0 -14
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts.map +0 -1
- package/dist/__tests__/fixtures/sample-forms.d.ts +0 -65
- package/dist/__tests__/fixtures/sample-forms.d.ts.map +0 -1
- package/dist/__tests__/generate-schemas.test.d.ts +0 -2
- package/dist/__tests__/generate-schemas.test.d.ts.map +0 -1
- package/dist/__tests__/generator.test.d.ts +0 -2
- package/dist/__tests__/generator.test.d.ts.map +0 -1
- package/dist/__tests__/guards.test.d.ts +0 -2
- package/dist/__tests__/guards.test.d.ts.map +0 -1
- package/dist/__tests__/integration.test.d.ts +0 -8
- package/dist/__tests__/integration.test.d.ts.map +0 -1
- package/dist/__tests__/ir-analyzer.test.d.ts +0 -11
- package/dist/__tests__/ir-analyzer.test.d.ts.map +0 -1
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts +0 -12
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts.map +0 -1
- package/dist/__tests__/ir-json-schema-generator.test.d.ts +0 -11
- package/dist/__tests__/ir-json-schema-generator.test.d.ts.map +0 -1
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts +0 -2
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts.map +0 -1
- package/dist/__tests__/mixed-authoring.test.d.ts +0 -2
- package/dist/__tests__/mixed-authoring.test.d.ts.map +0 -1
- package/dist/__tests__/numeric-extension.integration.test.d.ts +0 -2
- package/dist/__tests__/numeric-extension.integration.test.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts +0 -6
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts +0 -17
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts +0 -13
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts +0 -28
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts +0 -6
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts +0 -12
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/parity.test.d.ts +0 -18
- package/dist/__tests__/parity/parity.test.d.ts.map +0 -1
- package/dist/__tests__/parity/utils.d.ts +0 -152
- package/dist/__tests__/parity/utils.d.ts.map +0 -1
- package/dist/__tests__/path-target-parser.test.d.ts +0 -9
- package/dist/__tests__/path-target-parser.test.d.ts.map +0 -1
- package/dist/__tests__/write-schemas.test.d.ts +0 -2
- package/dist/__tests__/write-schemas.test.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ var __export = (target, all) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// src/canonicalize/chain-dsl-canonicalizer.ts
|
|
13
|
-
import { IR_VERSION } from "@formspec/core";
|
|
13
|
+
import { IR_VERSION } from "@formspec/core/internals";
|
|
14
14
|
function isGroup(el) {
|
|
15
15
|
return el._type === "group";
|
|
16
16
|
}
|
|
@@ -328,7 +328,7 @@ var init_chain_dsl_canonicalizer = __esm({
|
|
|
328
328
|
});
|
|
329
329
|
|
|
330
330
|
// src/canonicalize/tsdoc-canonicalizer.ts
|
|
331
|
-
import { IR_VERSION as IR_VERSION2 } from "@formspec/core";
|
|
331
|
+
import { IR_VERSION as IR_VERSION2 } from "@formspec/core/internals";
|
|
332
332
|
function canonicalizeTSDoc(analysis, source) {
|
|
333
333
|
const file = source?.file ?? "";
|
|
334
334
|
const provenance = {
|
|
@@ -860,7 +860,8 @@ var init_ir_generator = __esm({
|
|
|
860
860
|
// src/json-schema/generator.ts
|
|
861
861
|
function generateJsonSchema(form, options) {
|
|
862
862
|
const ir = canonicalizeChainDSL(form);
|
|
863
|
-
|
|
863
|
+
const internalOptions = options?.vendorPrefix === void 0 ? void 0 : { vendorPrefix: options.vendorPrefix };
|
|
864
|
+
return generateJsonSchemaFromIR(ir, internalOptions);
|
|
864
865
|
}
|
|
865
866
|
var init_generator = __esm({
|
|
866
867
|
"src/json-schema/generator.ts"() {
|
|
@@ -1118,19 +1119,6 @@ var init_generator2 = __esm({
|
|
|
1118
1119
|
}
|
|
1119
1120
|
});
|
|
1120
1121
|
|
|
1121
|
-
// src/json-schema/types.ts
|
|
1122
|
-
function setSchemaExtension(schema, key, value) {
|
|
1123
|
-
schema[key] = value;
|
|
1124
|
-
}
|
|
1125
|
-
function getSchemaExtension(schema, key) {
|
|
1126
|
-
return schema[key];
|
|
1127
|
-
}
|
|
1128
|
-
var init_types = __esm({
|
|
1129
|
-
"src/json-schema/types.ts"() {
|
|
1130
|
-
"use strict";
|
|
1131
|
-
}
|
|
1132
|
-
});
|
|
1133
|
-
|
|
1134
1122
|
// src/extensions/registry.ts
|
|
1135
1123
|
function createExtensionRegistry(extensions) {
|
|
1136
1124
|
const typeMap = /* @__PURE__ */ new Map();
|
|
@@ -1224,74 +1212,6 @@ var init_extensions = __esm({
|
|
|
1224
1212
|
}
|
|
1225
1213
|
});
|
|
1226
1214
|
|
|
1227
|
-
// src/json-schema/schema.ts
|
|
1228
|
-
import { z as z3 } from "zod";
|
|
1229
|
-
var jsonSchemaTypeSchema, jsonSchema7Schema;
|
|
1230
|
-
var init_schema2 = __esm({
|
|
1231
|
-
"src/json-schema/schema.ts"() {
|
|
1232
|
-
"use strict";
|
|
1233
|
-
jsonSchemaTypeSchema = z3.enum([
|
|
1234
|
-
"string",
|
|
1235
|
-
"number",
|
|
1236
|
-
"integer",
|
|
1237
|
-
"boolean",
|
|
1238
|
-
"object",
|
|
1239
|
-
"array",
|
|
1240
|
-
"null"
|
|
1241
|
-
]);
|
|
1242
|
-
jsonSchema7Schema = z3.lazy(
|
|
1243
|
-
() => z3.object({
|
|
1244
|
-
$schema: z3.string().optional(),
|
|
1245
|
-
$id: z3.string().optional(),
|
|
1246
|
-
$ref: z3.string().optional(),
|
|
1247
|
-
// Metadata
|
|
1248
|
-
title: z3.string().optional(),
|
|
1249
|
-
description: z3.string().optional(),
|
|
1250
|
-
deprecated: z3.boolean().optional(),
|
|
1251
|
-
// Type
|
|
1252
|
-
type: z3.union([jsonSchemaTypeSchema, z3.array(jsonSchemaTypeSchema)]).optional(),
|
|
1253
|
-
// String validation
|
|
1254
|
-
minLength: z3.number().optional(),
|
|
1255
|
-
maxLength: z3.number().optional(),
|
|
1256
|
-
pattern: z3.string().optional(),
|
|
1257
|
-
// Number validation
|
|
1258
|
-
minimum: z3.number().optional(),
|
|
1259
|
-
maximum: z3.number().optional(),
|
|
1260
|
-
exclusiveMinimum: z3.number().optional(),
|
|
1261
|
-
exclusiveMaximum: z3.number().optional(),
|
|
1262
|
-
// Enum
|
|
1263
|
-
enum: z3.array(z3.union([z3.string(), z3.number(), z3.boolean(), z3.null()])).readonly().optional(),
|
|
1264
|
-
const: z3.union([z3.string(), z3.number(), z3.boolean(), z3.null()]).optional(),
|
|
1265
|
-
// Object
|
|
1266
|
-
properties: z3.record(z3.string(), jsonSchema7Schema).optional(),
|
|
1267
|
-
required: z3.array(z3.string()).optional(),
|
|
1268
|
-
additionalProperties: z3.union([z3.boolean(), jsonSchema7Schema]).optional(),
|
|
1269
|
-
// Array
|
|
1270
|
-
items: z3.union([jsonSchema7Schema, z3.array(jsonSchema7Schema)]).optional(),
|
|
1271
|
-
minItems: z3.number().optional(),
|
|
1272
|
-
maxItems: z3.number().optional(),
|
|
1273
|
-
// Composition
|
|
1274
|
-
allOf: z3.array(jsonSchema7Schema).optional(),
|
|
1275
|
-
anyOf: z3.array(jsonSchema7Schema).optional(),
|
|
1276
|
-
oneOf: z3.array(jsonSchema7Schema).optional(),
|
|
1277
|
-
not: jsonSchema7Schema.optional(),
|
|
1278
|
-
// Conditional
|
|
1279
|
-
if: jsonSchema7Schema.optional(),
|
|
1280
|
-
then: jsonSchema7Schema.optional(),
|
|
1281
|
-
else: jsonSchema7Schema.optional(),
|
|
1282
|
-
// Format
|
|
1283
|
-
format: z3.string().optional(),
|
|
1284
|
-
// Default
|
|
1285
|
-
default: z3.unknown().optional(),
|
|
1286
|
-
// FormSpec extensions
|
|
1287
|
-
"x-formspec-source": z3.string().optional(),
|
|
1288
|
-
"x-formspec-params": z3.array(z3.string()).readonly().optional(),
|
|
1289
|
-
"x-formspec-schemaSource": z3.string().optional()
|
|
1290
|
-
}).passthrough()
|
|
1291
|
-
);
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
|
|
1295
1215
|
// src/analyzer/tsdoc-parser.ts
|
|
1296
1216
|
import * as ts from "typescript";
|
|
1297
1217
|
import {
|
|
@@ -1312,6 +1232,7 @@ import {
|
|
|
1312
1232
|
TSDocConfiguration,
|
|
1313
1233
|
TSDocTagDefinition,
|
|
1314
1234
|
TSDocTagSyntaxKind,
|
|
1235
|
+
DocExcerpt,
|
|
1315
1236
|
DocPlainText,
|
|
1316
1237
|
DocSoftBreak,
|
|
1317
1238
|
TextRange
|
|
@@ -1320,7 +1241,8 @@ import {
|
|
|
1320
1241
|
BUILTIN_CONSTRAINT_DEFINITIONS,
|
|
1321
1242
|
normalizeConstraintTagName,
|
|
1322
1243
|
isBuiltinConstraintName
|
|
1323
|
-
} from "@formspec/core";
|
|
1244
|
+
} from "@formspec/core/internals";
|
|
1245
|
+
import "@formspec/core/internals";
|
|
1324
1246
|
function createFormSpecTSDocConfig(extensionTagNames = []) {
|
|
1325
1247
|
const config = new TSDocConfiguration();
|
|
1326
1248
|
for (const tagName of Object.keys(BUILTIN_CONSTRAINT_DEFINITIONS)) {
|
|
@@ -1365,10 +1287,71 @@ function sharedTagValueOptions(options) {
|
|
|
1365
1287
|
...options?.fieldType !== void 0 ? { fieldType: options.fieldType } : {}
|
|
1366
1288
|
};
|
|
1367
1289
|
}
|
|
1290
|
+
function collectImportedNames(sourceFile) {
|
|
1291
|
+
const importedNames = /* @__PURE__ */ new Set();
|
|
1292
|
+
for (const statement of sourceFile.statements) {
|
|
1293
|
+
if (ts.isImportDeclaration(statement) && statement.importClause !== void 0) {
|
|
1294
|
+
const clause = statement.importClause;
|
|
1295
|
+
if (clause.name !== void 0) {
|
|
1296
|
+
importedNames.add(clause.name.text);
|
|
1297
|
+
}
|
|
1298
|
+
if (clause.namedBindings !== void 0) {
|
|
1299
|
+
if (ts.isNamedImports(clause.namedBindings)) {
|
|
1300
|
+
for (const specifier of clause.namedBindings.elements) {
|
|
1301
|
+
importedNames.add(specifier.name.text);
|
|
1302
|
+
}
|
|
1303
|
+
} else if (ts.isNamespaceImport(clause.namedBindings)) {
|
|
1304
|
+
importedNames.add(clause.namedBindings.name.text);
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
if (ts.isImportEqualsDeclaration(statement)) {
|
|
1310
|
+
importedNames.add(statement.name.text);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
return importedNames;
|
|
1314
|
+
}
|
|
1315
|
+
function isNonReferenceIdentifier(node) {
|
|
1316
|
+
const parent = node.parent;
|
|
1317
|
+
if ((ts.isBindingElement(parent) || ts.isClassDeclaration(parent) || ts.isEnumDeclaration(parent) || ts.isEnumMember(parent) || ts.isFunctionDeclaration(parent) || ts.isFunctionExpression(parent) || ts.isImportClause(parent) || ts.isImportEqualsDeclaration(parent) || ts.isImportSpecifier(parent) || ts.isInterfaceDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isMethodSignature(parent) || ts.isModuleDeclaration(parent) || ts.isNamespaceExport(parent) || ts.isNamespaceImport(parent) || ts.isParameter(parent) || ts.isPropertyDeclaration(parent) || ts.isPropertySignature(parent) || ts.isSetAccessorDeclaration(parent) || ts.isGetAccessorDeclaration(parent) || ts.isTypeAliasDeclaration(parent) || ts.isTypeParameterDeclaration(parent) || ts.isVariableDeclaration(parent)) && parent.name === node) {
|
|
1318
|
+
return true;
|
|
1319
|
+
}
|
|
1320
|
+
if ((ts.isPropertyAssignment(parent) || ts.isPropertyAccessExpression(parent)) && parent.name === node) {
|
|
1321
|
+
return true;
|
|
1322
|
+
}
|
|
1323
|
+
if (ts.isQualifiedName(parent) && parent.right === node) {
|
|
1324
|
+
return true;
|
|
1325
|
+
}
|
|
1326
|
+
return false;
|
|
1327
|
+
}
|
|
1328
|
+
function statementReferencesImportedName(statement, importedNames) {
|
|
1329
|
+
let referencesImportedName = false;
|
|
1330
|
+
const visit = (node) => {
|
|
1331
|
+
if (referencesImportedName) {
|
|
1332
|
+
return;
|
|
1333
|
+
}
|
|
1334
|
+
if (ts.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
|
|
1335
|
+
referencesImportedName = true;
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
ts.forEachChild(node, visit);
|
|
1339
|
+
};
|
|
1340
|
+
visit(statement);
|
|
1341
|
+
return referencesImportedName;
|
|
1342
|
+
}
|
|
1368
1343
|
function buildSupportingDeclarations(sourceFile) {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1344
|
+
const importedNames = collectImportedNames(sourceFile);
|
|
1345
|
+
return sourceFile.statements.filter((statement) => {
|
|
1346
|
+
if (ts.isImportDeclaration(statement)) return false;
|
|
1347
|
+
if (ts.isImportEqualsDeclaration(statement)) return false;
|
|
1348
|
+
if (ts.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0)
|
|
1349
|
+
return false;
|
|
1350
|
+
if (importedNames.size > 0 && statementReferencesImportedName(statement, importedNames)) {
|
|
1351
|
+
return false;
|
|
1352
|
+
}
|
|
1353
|
+
return true;
|
|
1354
|
+
}).map((statement) => statement.getText(sourceFile));
|
|
1372
1355
|
}
|
|
1373
1356
|
function renderSyntheticArgumentExpression(valueKind, argumentText) {
|
|
1374
1357
|
const trimmed = argumentText.trim();
|
|
@@ -1953,6 +1936,9 @@ function extractBlockText(block) {
|
|
|
1953
1936
|
}
|
|
1954
1937
|
function extractPlainText(node) {
|
|
1955
1938
|
let result = "";
|
|
1939
|
+
if (node instanceof DocExcerpt) {
|
|
1940
|
+
return node.content.toString();
|
|
1941
|
+
}
|
|
1956
1942
|
if (node instanceof DocPlainText) {
|
|
1957
1943
|
return node.text;
|
|
1958
1944
|
}
|
|
@@ -3672,30 +3658,11 @@ var index_exports = {};
|
|
|
3672
3658
|
__export(index_exports, {
|
|
3673
3659
|
buildFormSchemas: () => buildFormSchemas,
|
|
3674
3660
|
buildMixedAuthoringSchemas: () => buildMixedAuthoringSchemas,
|
|
3675
|
-
categorizationSchema: () => categorizationSchema,
|
|
3676
|
-
categorySchema: () => categorySchema,
|
|
3677
|
-
controlSchema: () => controlSchema,
|
|
3678
3661
|
createExtensionRegistry: () => createExtensionRegistry,
|
|
3679
3662
|
generateJsonSchema: () => generateJsonSchema,
|
|
3680
|
-
generateJsonSchemaFromIR: () => generateJsonSchemaFromIR,
|
|
3681
3663
|
generateSchemas: () => generateSchemas,
|
|
3682
3664
|
generateSchemasFromClass: () => generateSchemasFromClass,
|
|
3683
3665
|
generateUiSchema: () => generateUiSchema,
|
|
3684
|
-
getSchemaExtension: () => getSchemaExtension,
|
|
3685
|
-
groupLayoutSchema: () => groupLayoutSchema,
|
|
3686
|
-
horizontalLayoutSchema: () => horizontalLayoutSchema,
|
|
3687
|
-
jsonSchema7Schema: () => jsonSchema7Schema,
|
|
3688
|
-
jsonSchemaTypeSchema: () => jsonSchemaTypeSchema,
|
|
3689
|
-
labelElementSchema: () => labelElementSchema,
|
|
3690
|
-
ruleConditionSchema: () => ruleConditionSchema,
|
|
3691
|
-
ruleEffectSchema: () => ruleEffectSchema,
|
|
3692
|
-
ruleSchema: () => ruleSchema,
|
|
3693
|
-
schemaBasedConditionSchema: () => schemaBasedConditionSchema,
|
|
3694
|
-
setSchemaExtension: () => setSchemaExtension,
|
|
3695
|
-
uiSchemaElementSchema: () => uiSchemaElementSchema,
|
|
3696
|
-
uiSchemaElementTypeSchema: () => uiSchemaElementTypeSchema,
|
|
3697
|
-
uiSchemaSchema: () => uiSchema,
|
|
3698
|
-
verticalLayoutSchema: () => verticalLayoutSchema,
|
|
3699
3666
|
writeSchemas: () => writeSchemas
|
|
3700
3667
|
});
|
|
3701
3668
|
import * as fs from "fs";
|
|
@@ -3707,11 +3674,8 @@ function buildFormSchemas(form, options) {
|
|
|
3707
3674
|
};
|
|
3708
3675
|
}
|
|
3709
3676
|
function writeSchemas(form, options) {
|
|
3710
|
-
const { outDir, name = "schema", indent = 2,
|
|
3711
|
-
const buildOptions =
|
|
3712
|
-
extensionRegistry,
|
|
3713
|
-
vendorPrefix
|
|
3714
|
-
};
|
|
3677
|
+
const { outDir, name = "schema", indent = 2, vendorPrefix } = options;
|
|
3678
|
+
const buildOptions = vendorPrefix === void 0 ? void 0 : { vendorPrefix };
|
|
3715
3679
|
const { jsonSchema, uiSchema: uiSchema2 } = buildFormSchemas(form, buildOptions);
|
|
3716
3680
|
if (!fs.existsSync(outDir)) {
|
|
3717
3681
|
fs.mkdirSync(outDir, { recursive: true });
|
|
@@ -3728,12 +3692,8 @@ var init_index = __esm({
|
|
|
3728
3692
|
init_generator();
|
|
3729
3693
|
init_generator2();
|
|
3730
3694
|
init_ir_generator();
|
|
3731
|
-
init_types();
|
|
3732
3695
|
init_extensions();
|
|
3733
|
-
init_schema();
|
|
3734
|
-
init_schema2();
|
|
3735
3696
|
init_generator();
|
|
3736
|
-
init_ir_generator();
|
|
3737
3697
|
init_generator2();
|
|
3738
3698
|
init_class_schema();
|
|
3739
3699
|
init_mixed_authoring();
|