@formspec/build 0.1.0-alpha.21 → 0.1.0-alpha.23
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 +82 -126
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +72 -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 +79 -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 +72 -101
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +77 -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 +69 -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 {
|
|
@@ -1320,7 +1240,8 @@ import {
|
|
|
1320
1240
|
BUILTIN_CONSTRAINT_DEFINITIONS,
|
|
1321
1241
|
normalizeConstraintTagName,
|
|
1322
1242
|
isBuiltinConstraintName
|
|
1323
|
-
} from "@formspec/core";
|
|
1243
|
+
} from "@formspec/core/internals";
|
|
1244
|
+
import "@formspec/core/internals";
|
|
1324
1245
|
function createFormSpecTSDocConfig(extensionTagNames = []) {
|
|
1325
1246
|
const config = new TSDocConfiguration();
|
|
1326
1247
|
for (const tagName of Object.keys(BUILTIN_CONSTRAINT_DEFINITIONS)) {
|
|
@@ -1365,10 +1286,71 @@ function sharedTagValueOptions(options) {
|
|
|
1365
1286
|
...options?.fieldType !== void 0 ? { fieldType: options.fieldType } : {}
|
|
1366
1287
|
};
|
|
1367
1288
|
}
|
|
1289
|
+
function collectImportedNames(sourceFile) {
|
|
1290
|
+
const importedNames = /* @__PURE__ */ new Set();
|
|
1291
|
+
for (const statement of sourceFile.statements) {
|
|
1292
|
+
if (ts.isImportDeclaration(statement) && statement.importClause !== void 0) {
|
|
1293
|
+
const clause = statement.importClause;
|
|
1294
|
+
if (clause.name !== void 0) {
|
|
1295
|
+
importedNames.add(clause.name.text);
|
|
1296
|
+
}
|
|
1297
|
+
if (clause.namedBindings !== void 0) {
|
|
1298
|
+
if (ts.isNamedImports(clause.namedBindings)) {
|
|
1299
|
+
for (const specifier of clause.namedBindings.elements) {
|
|
1300
|
+
importedNames.add(specifier.name.text);
|
|
1301
|
+
}
|
|
1302
|
+
} else if (ts.isNamespaceImport(clause.namedBindings)) {
|
|
1303
|
+
importedNames.add(clause.namedBindings.name.text);
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
if (ts.isImportEqualsDeclaration(statement)) {
|
|
1309
|
+
importedNames.add(statement.name.text);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
return importedNames;
|
|
1313
|
+
}
|
|
1314
|
+
function isNonReferenceIdentifier(node) {
|
|
1315
|
+
const parent = node.parent;
|
|
1316
|
+
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) {
|
|
1317
|
+
return true;
|
|
1318
|
+
}
|
|
1319
|
+
if ((ts.isPropertyAssignment(parent) || ts.isPropertyAccessExpression(parent)) && parent.name === node) {
|
|
1320
|
+
return true;
|
|
1321
|
+
}
|
|
1322
|
+
if (ts.isQualifiedName(parent) && parent.right === node) {
|
|
1323
|
+
return true;
|
|
1324
|
+
}
|
|
1325
|
+
return false;
|
|
1326
|
+
}
|
|
1327
|
+
function statementReferencesImportedName(statement, importedNames) {
|
|
1328
|
+
let referencesImportedName = false;
|
|
1329
|
+
const visit = (node) => {
|
|
1330
|
+
if (referencesImportedName) {
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
if (ts.isIdentifier(node) && importedNames.has(node.text) && !isNonReferenceIdentifier(node)) {
|
|
1334
|
+
referencesImportedName = true;
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
ts.forEachChild(node, visit);
|
|
1338
|
+
};
|
|
1339
|
+
visit(statement);
|
|
1340
|
+
return referencesImportedName;
|
|
1341
|
+
}
|
|
1368
1342
|
function buildSupportingDeclarations(sourceFile) {
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1343
|
+
const importedNames = collectImportedNames(sourceFile);
|
|
1344
|
+
return sourceFile.statements.filter((statement) => {
|
|
1345
|
+
if (ts.isImportDeclaration(statement)) return false;
|
|
1346
|
+
if (ts.isImportEqualsDeclaration(statement)) return false;
|
|
1347
|
+
if (ts.isExportDeclaration(statement) && statement.moduleSpecifier !== void 0)
|
|
1348
|
+
return false;
|
|
1349
|
+
if (importedNames.size > 0 && statementReferencesImportedName(statement, importedNames)) {
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
return true;
|
|
1353
|
+
}).map((statement) => statement.getText(sourceFile));
|
|
1372
1354
|
}
|
|
1373
1355
|
function renderSyntheticArgumentExpression(valueKind, argumentText) {
|
|
1374
1356
|
const trimmed = argumentText.trim();
|
|
@@ -3672,30 +3654,11 @@ var index_exports = {};
|
|
|
3672
3654
|
__export(index_exports, {
|
|
3673
3655
|
buildFormSchemas: () => buildFormSchemas,
|
|
3674
3656
|
buildMixedAuthoringSchemas: () => buildMixedAuthoringSchemas,
|
|
3675
|
-
categorizationSchema: () => categorizationSchema,
|
|
3676
|
-
categorySchema: () => categorySchema,
|
|
3677
|
-
controlSchema: () => controlSchema,
|
|
3678
3657
|
createExtensionRegistry: () => createExtensionRegistry,
|
|
3679
3658
|
generateJsonSchema: () => generateJsonSchema,
|
|
3680
|
-
generateJsonSchemaFromIR: () => generateJsonSchemaFromIR,
|
|
3681
3659
|
generateSchemas: () => generateSchemas,
|
|
3682
3660
|
generateSchemasFromClass: () => generateSchemasFromClass,
|
|
3683
3661
|
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
3662
|
writeSchemas: () => writeSchemas
|
|
3700
3663
|
});
|
|
3701
3664
|
import * as fs from "fs";
|
|
@@ -3707,11 +3670,8 @@ function buildFormSchemas(form, options) {
|
|
|
3707
3670
|
};
|
|
3708
3671
|
}
|
|
3709
3672
|
function writeSchemas(form, options) {
|
|
3710
|
-
const { outDir, name = "schema", indent = 2,
|
|
3711
|
-
const buildOptions =
|
|
3712
|
-
extensionRegistry,
|
|
3713
|
-
vendorPrefix
|
|
3714
|
-
};
|
|
3673
|
+
const { outDir, name = "schema", indent = 2, vendorPrefix } = options;
|
|
3674
|
+
const buildOptions = vendorPrefix === void 0 ? void 0 : { vendorPrefix };
|
|
3715
3675
|
const { jsonSchema, uiSchema: uiSchema2 } = buildFormSchemas(form, buildOptions);
|
|
3716
3676
|
if (!fs.existsSync(outDir)) {
|
|
3717
3677
|
fs.mkdirSync(outDir, { recursive: true });
|
|
@@ -3728,12 +3688,8 @@ var init_index = __esm({
|
|
|
3728
3688
|
init_generator();
|
|
3729
3689
|
init_generator2();
|
|
3730
3690
|
init_ir_generator();
|
|
3731
|
-
init_types();
|
|
3732
3691
|
init_extensions();
|
|
3733
|
-
init_schema();
|
|
3734
|
-
init_schema2();
|
|
3735
3692
|
init_generator();
|
|
3736
|
-
init_ir_generator();
|
|
3737
3693
|
init_generator2();
|
|
3738
3694
|
init_class_schema();
|
|
3739
3695
|
init_mixed_authoring();
|