@varavel/vdl-plugin-sdk 0.0.0 → 0.1.1
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/LICENSE +0 -0
- package/README.md +168 -0
- package/bin/vdl-plugin.js +66 -0
- package/dist/{ir.cjs → index.cjs} +234 -2
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +373 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +373 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{ir.js → index.js} +219 -3
- package/dist/index.js.map +1 -0
- package/package.json +18 -5
- package/schemas/common/position.vdl +14 -0
- package/schemas/ir.vdl +319 -0
- package/schemas/plugin.vdl +19 -0
- package/schemas/plugin_input.vdl +30 -0
- package/schemas/plugin_output.vdl +72 -0
- package/src/define-plugin.ts +33 -0
- package/src/index.ts +7 -0
- package/src/runtime.ts +10 -0
- package/src/types/index.ts +10 -0
- package/src/{ir.ts → types/types.ts} +341 -282
- package/src/utils/annotations.test.ts +86 -0
- package/src/utils/annotations.ts +26 -0
- package/src/utils/literals.test.ts +115 -0
- package/src/utils/literals.ts +60 -0
- package/src/utils/options.test.ts +88 -0
- package/src/utils/options.ts +115 -0
- package/tsconfig.base.json +18 -0
- package/dist/ir.cjs.map +0 -1
- package/dist/ir.d.cts +0 -213
- package/dist/ir.d.cts.map +0 -1
- package/dist/ir.d.ts +0 -213
- package/dist/ir.d.ts.map +0 -1
- package/dist/ir.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/define-plugin.ts","../src/types/types.ts","../src/utils/annotations.ts","../src/utils/literals.ts","../src/utils/options.ts"],"sourcesContent":["import type { PluginInput, PluginOutput } from \"./types\";\n\n/**\n * Defines a VDL plugin handler function.\n *\n * @param input - The input data for the plugin containing the IR and other relevant information.\n * @returns The output data from the plugin containing the generated files and any errors.\n */\nexport type VdlPluginHandler = (input: PluginInput) => PluginOutput;\n\n/**\n * Defines a VDL plugin by wrapping the provided handler function. This is a helper function\n * that can be used to create plugins in a more concise way.\n *\n * Example usage:\n * ```typescript\n * import { definePlugin } from \"@varavel/vdl-plugin-sdk\";\n *\n * export const generate = definePlugin((input) => {\n * // Plugin logic goes here\n * return {\n * files: [],\n * errors: []\n * };\n * });\n * ```\n *\n * @param handler - The plugin handler function that contains the logic for processing the input and generating the output.\n * @returns The same handler function, which can be exported as the plugin's main entry point.\n */\nexport function definePlugin(handler: VdlPluginHandler): VdlPluginHandler {\n return handler;\n}\n","// Code generated by VDL v0.4.0-alpha.5. DO NOT EDIT.\n// If you edit this file, it will be overwritten the next time it is generated.\n//\n// For more information about VDL, visit https://vdl.varavel.com\n\n/* eslint-disable */\n/* tslint:disable */\n// biome-ignore-all lint: Generated by VDL\n\n// -----------------------------------------------------------------------------\n// Enumerations\n// -----------------------------------------------------------------------------\n\n/**\n * Underlying storage kind used by an enum\n */\nexport type EnumValueType = \"string\" | \"int\";\n\nexport const EnumValueTypeList: EnumValueType[] = [\n \"string\",\n \"int\",\n];\n\nexport function isEnumValueType(value: unknown): value is EnumValueType {\n return EnumValueTypeList.includes(value as EnumValueType);\n}\n\n/**\n * Kind discriminator for LiteralValue.\n * \n * LiteralValue is used for fully resolved literal data in:\n * \n * - constant values\n * - annotation arguments\n */\nexport type LiteralKind = \"string\" | \"int\" | \"float\" | \"bool\" | \"object\" | \"array\";\n\nexport const LiteralKindList: LiteralKind[] = [\n \"string\",\n \"int\",\n \"float\",\n \"bool\",\n \"object\",\n \"array\",\n];\n\nexport function isLiteralKind(value: unknown): value is LiteralKind {\n return LiteralKindList.includes(value as LiteralKind);\n}\n\n/**\n * Primitive scalar type names\n */\nexport type PrimitiveType = \"string\" | \"int\" | \"float\" | \"bool\" | \"datetime\";\n\nexport const PrimitiveTypeList: PrimitiveType[] = [\n \"string\",\n \"int\",\n \"float\",\n \"bool\",\n \"datetime\",\n];\n\nexport function isPrimitiveType(value: unknown): value is PrimitiveType {\n return PrimitiveTypeList.includes(value as PrimitiveType);\n}\n\n/**\n * Kind discriminator for TypeRef\n */\nexport type TypeKind = \"primitive\" | \"type\" | \"enum\" | \"array\" | \"map\" | \"object\";\n\nexport const TypeKindList: TypeKind[] = [\n \"primitive\",\n \"type\",\n \"enum\",\n \"array\",\n \"map\",\n \"object\",\n];\n\nexport function isTypeKind(value: unknown): value is TypeKind {\n return TypeKindList.includes(value as TypeKind);\n}\n\n// -----------------------------------------------------------------------------\n// Domain Types\n// -----------------------------------------------------------------------------\n\n/**\n * Annotation Annotation metadata preserved in IR.\n * \n * `name` is the annotation identifier without the `@` prefix.\n * `argument`, when present, is fully resolved as a LiteralValue.\n */\nexport type Annotation = {\n position: Position\n name: string\n argument?: LiteralValue\n}\n\nexport function hydrateAnnotation(input: Annotation): Annotation {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedArgument = input.argument ? hydrateLiteralValue(input.argument) : input.argument\n return {\n position: hydratedPosition,\n name: hydratedName,\n argument: hydratedArgument,\n }\n}\n\nexport function validateAnnotation(input: unknown, path = \"Annotation\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.argument !== undefined && obj.argument !== null) {\n {\n const err = validateLiteralValue(obj.argument, `${path}.argument`);\n if (err !== null) return err;\n }\n }\n return null;\n}\n\n/**\n * ConstantDef Fully resolved constant definition.\n * \n * `typeRef` is explicit or inferred by analysis.\n * `value` contains the fully resolved literal payload.\n */\nexport type ConstantDef = {\n position: Position\n name: string\n doc?: string\n annotations: Annotation[]\n typeRef: TypeRef\n value: LiteralValue\n}\n\nexport function hydrateConstantDef(input: ConstantDef): ConstantDef {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedDoc = input.doc ? input.doc : input.doc\n const hydratedAnnotations = input.annotations.map(el => hydrateAnnotation(el))\n const hydratedTypeRef = hydrateTypeRef(input.typeRef)\n const hydratedValue = hydrateLiteralValue(input.value)\n return {\n position: hydratedPosition,\n name: hydratedName,\n doc: hydratedDoc,\n annotations: hydratedAnnotations,\n typeRef: hydratedTypeRef,\n value: hydratedValue,\n }\n}\n\nexport function validateConstantDef(input: unknown, path = \"ConstantDef\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.annotations === undefined || obj.annotations === null) {\n return `${path}.annotations: required field is missing`;\n }\n {\n if (!Array.isArray(obj.annotations)) {\n return `${path}.annotations: expected array, got ${typeof obj.annotations}`;\n }\n for (let i = 0; i < obj.annotations.length; i++) {\n {\n const err = validateAnnotation(obj.annotations[i], `${path}.annotations[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.typeRef === undefined || obj.typeRef === null) {\n return `${path}.typeRef: required field is missing`;\n }\n {\n const err = validateTypeRef(obj.typeRef, `${path}.typeRef`);\n if (err !== null) return err;\n }\n if (obj.value === undefined || obj.value === null) {\n return `${path}.value: required field is missing`;\n }\n {\n const err = validateLiteralValue(obj.value, `${path}.value`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * EnumDef Flattened enum definition.\n * \n * All enum spreads are already expanded into `members`.\n */\nexport type EnumDef = {\n position: Position\n name: string\n doc?: string\n annotations: Annotation[]\n enumType: EnumValueType\n members: EnumMember[]\n}\n\nexport function hydrateEnumDef(input: EnumDef): EnumDef {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedDoc = input.doc ? input.doc : input.doc\n const hydratedAnnotations = input.annotations.map(el => hydrateAnnotation(el))\n const hydratedEnumType = input.enumType\n const hydratedMembers = input.members.map(el => hydrateEnumMember(el))\n return {\n position: hydratedPosition,\n name: hydratedName,\n doc: hydratedDoc,\n annotations: hydratedAnnotations,\n enumType: hydratedEnumType,\n members: hydratedMembers,\n }\n}\n\nexport function validateEnumDef(input: unknown, path = \"EnumDef\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.annotations === undefined || obj.annotations === null) {\n return `${path}.annotations: required field is missing`;\n }\n {\n if (!Array.isArray(obj.annotations)) {\n return `${path}.annotations: expected array, got ${typeof obj.annotations}`;\n }\n for (let i = 0; i < obj.annotations.length; i++) {\n {\n const err = validateAnnotation(obj.annotations[i], `${path}.annotations[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.enumType === undefined || obj.enumType === null) {\n return `${path}.enumType: required field is missing`;\n }\n {\n if (!isEnumValueType(obj.enumType)) {\n return `${path}.enumType: invalid enum value '${obj.enumType}' for EnumValueType`;\n }\n }\n if (obj.members === undefined || obj.members === null) {\n return `${path}.members: required field is missing`;\n }\n {\n if (!Array.isArray(obj.members)) {\n return `${path}.members: expected array, got ${typeof obj.members}`;\n }\n for (let i = 0; i < obj.members.length; i++) {\n {\n const err = validateEnumMember(obj.members[i], `${path}.members[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n return null;\n}\n\n/**\n * EnumMember Enum member definition\n */\nexport type EnumMember = {\n position: Position\n name: string\n value: LiteralValue\n doc?: string\n annotations: Annotation[]\n}\n\nexport function hydrateEnumMember(input: EnumMember): EnumMember {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedValue = hydrateLiteralValue(input.value)\n const hydratedDoc = input.doc ? input.doc : input.doc\n const hydratedAnnotations = input.annotations.map(el => hydrateAnnotation(el))\n return {\n position: hydratedPosition,\n name: hydratedName,\n value: hydratedValue,\n doc: hydratedDoc,\n annotations: hydratedAnnotations,\n }\n}\n\nexport function validateEnumMember(input: unknown, path = \"EnumMember\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.value === undefined || obj.value === null) {\n return `${path}.value: required field is missing`;\n }\n {\n const err = validateLiteralValue(obj.value, `${path}.value`);\n if (err !== null) return err;\n }\n if (obj.annotations === undefined || obj.annotations === null) {\n return `${path}.annotations: required field is missing`;\n }\n {\n if (!Array.isArray(obj.annotations)) {\n return `${path}.annotations: expected array, got ${typeof obj.annotations}`;\n }\n for (let i = 0; i < obj.annotations.length; i++) {\n {\n const err = validateAnnotation(obj.annotations[i], `${path}.annotations[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n return null;\n}\n\n/**\n * Field Flattened object/type field definition\n */\nexport type Field = {\n position: Position\n name: string\n doc?: string\n optional: boolean\n annotations: Annotation[]\n typeRef: TypeRef\n}\n\nexport function hydrateField(input: Field): Field {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedDoc = input.doc ? input.doc : input.doc\n const hydratedOptional = input.optional\n const hydratedAnnotations = input.annotations.map(el => hydrateAnnotation(el))\n const hydratedTypeRef = hydrateTypeRef(input.typeRef)\n return {\n position: hydratedPosition,\n name: hydratedName,\n doc: hydratedDoc,\n optional: hydratedOptional,\n annotations: hydratedAnnotations,\n typeRef: hydratedTypeRef,\n }\n}\n\nexport function validateField(input: unknown, path = \"Field\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.annotations === undefined || obj.annotations === null) {\n return `${path}.annotations: required field is missing`;\n }\n {\n if (!Array.isArray(obj.annotations)) {\n return `${path}.annotations: expected array, got ${typeof obj.annotations}`;\n }\n for (let i = 0; i < obj.annotations.length; i++) {\n {\n const err = validateAnnotation(obj.annotations[i], `${path}.annotations[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.typeRef === undefined || obj.typeRef === null) {\n return `${path}.typeRef: required field is missing`;\n }\n {\n const err = validateTypeRef(obj.typeRef, `${path}.typeRef`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * IrSchema IrSchema is the generator-facing representation of a VDL program.\n * \n * This model is intentionally \"flat\" and \"resolved\":\n * \n * - spreads are already expanded\n * - references are already resolved\n * - collections are in deterministic order\n * \n * A code generator should be able to consume IrSchema directly, without needing\n * to re-run parser or semantic-analysis logic.\n */\nexport type IrSchema = {\n entryPoint: string\n constants: ConstantDef[]\n enums: EnumDef[]\n types: TypeDef[]\n docs: TopLevelDoc[]\n}\n\nexport function hydrateIrSchema(input: IrSchema): IrSchema {\n const hydratedEntryPoint = input.entryPoint\n const hydratedConstants = input.constants.map(el => hydrateConstantDef(el))\n const hydratedEnums = input.enums.map(el => hydrateEnumDef(el))\n const hydratedTypes = input.types.map(el => hydrateTypeDef(el))\n const hydratedDocs = input.docs.map(el => hydrateTopLevelDoc(el))\n return {\n entryPoint: hydratedEntryPoint,\n constants: hydratedConstants,\n enums: hydratedEnums,\n types: hydratedTypes,\n docs: hydratedDocs,\n }\n}\n\nexport function validateIrSchema(input: unknown, path = \"IrSchema\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.constants === undefined || obj.constants === null) {\n return `${path}.constants: required field is missing`;\n }\n {\n if (!Array.isArray(obj.constants)) {\n return `${path}.constants: expected array, got ${typeof obj.constants}`;\n }\n for (let i = 0; i < obj.constants.length; i++) {\n {\n const err = validateConstantDef(obj.constants[i], `${path}.constants[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.enums === undefined || obj.enums === null) {\n return `${path}.enums: required field is missing`;\n }\n {\n if (!Array.isArray(obj.enums)) {\n return `${path}.enums: expected array, got ${typeof obj.enums}`;\n }\n for (let i = 0; i < obj.enums.length; i++) {\n {\n const err = validateEnumDef(obj.enums[i], `${path}.enums[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.types === undefined || obj.types === null) {\n return `${path}.types: required field is missing`;\n }\n {\n if (!Array.isArray(obj.types)) {\n return `${path}.types: expected array, got ${typeof obj.types}`;\n }\n for (let i = 0; i < obj.types.length; i++) {\n {\n const err = validateTypeDef(obj.types[i], `${path}.types[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.docs === undefined || obj.docs === null) {\n return `${path}.docs: required field is missing`;\n }\n {\n if (!Array.isArray(obj.docs)) {\n return `${path}.docs: expected array, got ${typeof obj.docs}`;\n }\n for (let i = 0; i < obj.docs.length; i++) {\n {\n const err = validateTopLevelDoc(obj.docs[i], `${path}.docs[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n return null;\n}\n\n/**\n * LiteralValue Fully resolved literal value.\n * \n * The selected payload is determined by `kind`:\n * \n * - `string` -> `stringValue`\n * - `int` -> `intValue`\n * - `float` -> `floatValue`\n * - `bool` -> `boolValue`\n * - `object` -> `objectEntries`\n * - `array` -> `arrayItems`\n */\nexport type LiteralValue = {\n position: Position\n kind: LiteralKind\n stringValue?: string\n intValue?: number\n floatValue?: number\n boolValue?: boolean\n objectEntries?: ObjectEntry[]\n arrayItems?: LiteralValue[]\n}\n\nexport function hydrateLiteralValue(input: LiteralValue): LiteralValue {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedKind = input.kind\n const hydratedStringValue = input.stringValue ? input.stringValue : input.stringValue\n const hydratedIntValue = input.intValue ? input.intValue : input.intValue\n const hydratedFloatValue = input.floatValue ? input.floatValue : input.floatValue\n const hydratedBoolValue = input.boolValue ? input.boolValue : input.boolValue\n const hydratedObjectEntries = input.objectEntries ? input.objectEntries.map(el => hydrateObjectEntry(el)) : input.objectEntries\n const hydratedArrayItems = input.arrayItems ? input.arrayItems.map(el => hydrateLiteralValue(el)) : input.arrayItems\n return {\n position: hydratedPosition,\n kind: hydratedKind,\n stringValue: hydratedStringValue,\n intValue: hydratedIntValue,\n floatValue: hydratedFloatValue,\n boolValue: hydratedBoolValue,\n objectEntries: hydratedObjectEntries,\n arrayItems: hydratedArrayItems,\n }\n}\n\nexport function validateLiteralValue(input: unknown, path = \"LiteralValue\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.kind === undefined || obj.kind === null) {\n return `${path}.kind: required field is missing`;\n }\n {\n if (!isLiteralKind(obj.kind)) {\n return `${path}.kind: invalid enum value '${obj.kind}' for LiteralKind`;\n }\n }\n if (obj.objectEntries !== undefined && obj.objectEntries !== null) {\n {\n if (!Array.isArray(obj.objectEntries)) {\n return `${path}.objectEntries: expected array, got ${typeof obj.objectEntries}`;\n }\n for (let i = 0; i < obj.objectEntries.length; i++) {\n {\n const err = validateObjectEntry(obj.objectEntries[i], `${path}.objectEntries[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n }\n if (obj.arrayItems !== undefined && obj.arrayItems !== null) {\n {\n if (!Array.isArray(obj.arrayItems)) {\n return `${path}.arrayItems: expected array, got ${typeof obj.arrayItems}`;\n }\n for (let i = 0; i < obj.arrayItems.length; i++) {\n {\n const err = validateLiteralValue(obj.arrayItems[i], `${path}.arrayItems[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n }\n return null;\n}\n\n/**\n * ObjectEntry Key/value pair inside an object LiteralValue payload\n */\nexport type ObjectEntry = {\n position: Position\n key: string\n value: LiteralValue\n}\n\nexport function hydrateObjectEntry(input: ObjectEntry): ObjectEntry {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedKey = input.key\n const hydratedValue = hydrateLiteralValue(input.value)\n return {\n position: hydratedPosition,\n key: hydratedKey,\n value: hydratedValue,\n }\n}\n\nexport function validateObjectEntry(input: unknown, path = \"ObjectEntry\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.value === undefined || obj.value === null) {\n return `${path}.value: required field is missing`;\n }\n {\n const err = validateLiteralValue(obj.value, `${path}.value`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * PluginInput PluginInput represents the data payload sent to a plugin.\n * \n * The plugin receives this as a single argument containing the complete\n * Intermediate Representation of the VDL schema along with any user-defined\n * configuration options from `vdl.config.vdl`.\n */\nexport type PluginInput = {\n version: string\n ir: IrSchema\n options: Record<string, string>\n}\n\nexport function hydratePluginInput(input: PluginInput): PluginInput {\n const hydratedVersion = input.version\n const hydratedIr = hydrateIrSchema(input.ir)\n const hydratedOptions = input.options\n return {\n version: hydratedVersion,\n ir: hydratedIr,\n options: hydratedOptions,\n }\n}\n\nexport function validatePluginInput(input: unknown, path = \"PluginInput\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.ir === undefined || obj.ir === null) {\n return `${path}.ir: required field is missing`;\n }\n {\n const err = validateIrSchema(obj.ir, `${path}.ir`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * PluginOutput PluginOutput represents the response payload returned by the `plugin` function.\n * \n * After processing the input schema, the plugin outputs this object containing\n * all files to be generated or errors to be displayed to the user.\n * \n * If there are no errors and at least one file is returned, VDL will write each\n * file to the specified path within the output directory. If there are errors,\n * VDL will display them to the user and not write any files.\n */\nexport type PluginOutput = {\n files?: PluginOutputFile[]\n errors?: PluginOutputError[]\n}\n\nexport function hydratePluginOutput(input: PluginOutput): PluginOutput {\n const hydratedFiles = input.files ? input.files.map(el => hydratePluginOutputFile(el)) : input.files\n const hydratedErrors = input.errors ? input.errors.map(el => hydratePluginOutputError(el)) : input.errors\n return {\n files: hydratedFiles,\n errors: hydratedErrors,\n }\n}\n\nexport function validatePluginOutput(input: unknown, path = \"PluginOutput\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.files !== undefined && obj.files !== null) {\n {\n if (!Array.isArray(obj.files)) {\n return `${path}.files: expected array, got ${typeof obj.files}`;\n }\n for (let i = 0; i < obj.files.length; i++) {\n {\n const err = validatePluginOutputFile(obj.files[i], `${path}.files[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n }\n if (obj.errors !== undefined && obj.errors !== null) {\n {\n if (!Array.isArray(obj.errors)) {\n return `${path}.errors: expected array, got ${typeof obj.errors}`;\n }\n for (let i = 0; i < obj.errors.length; i++) {\n {\n const err = validatePluginOutputError(obj.errors[i], `${path}.errors[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n }\n return null;\n}\n\n/**\n * PluginOutputError A structured error reported by the plugin.\n */\nexport type PluginOutputError = {\n message: string\n position?: Position\n}\n\nexport function hydratePluginOutputError(input: PluginOutputError): PluginOutputError {\n const hydratedMessage = input.message\n const hydratedPosition = input.position ? hydratePosition(input.position) : input.position\n return {\n message: hydratedMessage,\n position: hydratedPosition,\n }\n}\n\nexport function validatePluginOutputError(input: unknown, path = \"PluginOutputError\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position !== undefined && obj.position !== null) {\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n }\n return null;\n}\n\n/**\n * PluginOutputFile PluginOutputFile represents a single generated file produced by the plugin.\n * \n * This abstraction allows plugins to generate multiple files from a single\n * invocation, enabling patterns like one-file-per-type or splitting large\n * outputs across multiple modules.\n */\nexport type PluginOutputFile = {\n path: string\n content: string\n}\n\nexport function hydratePluginOutputFile(input: PluginOutputFile): PluginOutputFile {\n const hydratedPath = input.path\n const hydratedContent = input.content\n return {\n path: hydratedPath,\n content: hydratedContent,\n }\n}\n\nexport function validatePluginOutputFile(_input: unknown, _path = \"PluginOutputFile\"): string | null {\n return null;\n}\n\n/**\n * Position It represents a position within a file and is used for error\n * reporting, diagnostics, plugins, and tooling support.\n */\nexport type Position = {\n file: string\n line: number\n column: number\n}\n\nexport function hydratePosition(input: Position): Position {\n const hydratedFile = input.file\n const hydratedLine = input.line\n const hydratedColumn = input.column\n return {\n file: hydratedFile,\n line: hydratedLine,\n column: hydratedColumn,\n }\n}\n\nexport function validatePosition(_input: unknown, _path = \"Position\"): string | null {\n return null;\n}\n\n/**\n * TopLevelDoc Standalone documentation block.\n * \n * Used for top-level docstrings that are not attached to a type/enum/constant.\n */\nexport type TopLevelDoc = {\n position: Position\n content: string\n}\n\nexport function hydrateTopLevelDoc(input: TopLevelDoc): TopLevelDoc {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedContent = input.content\n return {\n position: hydratedPosition,\n content: hydratedContent,\n }\n}\n\nexport function validateTopLevelDoc(input: unknown, path = \"TopLevelDoc\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * TypeDef Flattened type definition.\n * \n * All spreads are already expanded. The unified `typeRef` describes what this\n * type IS, a primitive, custom reference, map, array, or object with fields.\n */\nexport type TypeDef = {\n position: Position\n name: string\n doc?: string\n annotations: Annotation[]\n typeRef: TypeRef\n}\n\nexport function hydrateTypeDef(input: TypeDef): TypeDef {\n const hydratedPosition = hydratePosition(input.position)\n const hydratedName = input.name\n const hydratedDoc = input.doc ? input.doc : input.doc\n const hydratedAnnotations = input.annotations.map(el => hydrateAnnotation(el))\n const hydratedTypeRef = hydrateTypeRef(input.typeRef)\n return {\n position: hydratedPosition,\n name: hydratedName,\n doc: hydratedDoc,\n annotations: hydratedAnnotations,\n typeRef: hydratedTypeRef,\n }\n}\n\nexport function validateTypeDef(input: unknown, path = \"TypeDef\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.position === undefined || obj.position === null) {\n return `${path}.position: required field is missing`;\n }\n {\n const err = validatePosition(obj.position, `${path}.position`);\n if (err !== null) return err;\n }\n if (obj.annotations === undefined || obj.annotations === null) {\n return `${path}.annotations: required field is missing`;\n }\n {\n if (!Array.isArray(obj.annotations)) {\n return `${path}.annotations: expected array, got ${typeof obj.annotations}`;\n }\n for (let i = 0; i < obj.annotations.length; i++) {\n {\n const err = validateAnnotation(obj.annotations[i], `${path}.annotations[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n if (obj.typeRef === undefined || obj.typeRef === null) {\n return `${path}.typeRef: required field is missing`;\n }\n {\n const err = validateTypeRef(obj.typeRef, `${path}.typeRef`);\n if (err !== null) return err;\n }\n return null;\n}\n\n/**\n * TypeRef Normalized type reference used by fields and constants.\n * \n * `kind` selects which payload fields are meaningful. Generators should inspect\n * `kind` first, then read the related payload fields.\n */\nexport type TypeRef = {\n kind: TypeKind\n primitiveName?: PrimitiveType\n typeName?: string\n enumName?: string\n enumType?: EnumValueType\n arrayType?: TypeRef\n arrayDims?: number\n mapType?: TypeRef\n objectFields?: Field[]\n}\n\nexport function hydrateTypeRef(input: TypeRef): TypeRef {\n const hydratedKind = input.kind\n const hydratedPrimitiveName = input.primitiveName ? input.primitiveName : input.primitiveName\n const hydratedTypeName = input.typeName ? input.typeName : input.typeName\n const hydratedEnumName = input.enumName ? input.enumName : input.enumName\n const hydratedEnumType = input.enumType ? input.enumType : input.enumType\n const hydratedArrayType = input.arrayType ? hydrateTypeRef(input.arrayType) : input.arrayType\n const hydratedArrayDims = input.arrayDims ? input.arrayDims : input.arrayDims\n const hydratedMapType = input.mapType ? hydrateTypeRef(input.mapType) : input.mapType\n const hydratedObjectFields = input.objectFields ? input.objectFields.map(el => hydrateField(el)) : input.objectFields\n return {\n kind: hydratedKind,\n primitiveName: hydratedPrimitiveName,\n typeName: hydratedTypeName,\n enumName: hydratedEnumName,\n enumType: hydratedEnumType,\n arrayType: hydratedArrayType,\n arrayDims: hydratedArrayDims,\n mapType: hydratedMapType,\n objectFields: hydratedObjectFields,\n }\n}\n\nexport function validateTypeRef(input: unknown, path = \"TypeRef\"): string | null {\n if (input === null || input === undefined || typeof input !== \"object\") {\n return `${path}: expected object, got ${typeof input}`;\n }\n const obj = input as Record<string, unknown>;\n\n if (obj.kind === undefined || obj.kind === null) {\n return `${path}.kind: required field is missing`;\n }\n {\n if (!isTypeKind(obj.kind)) {\n return `${path}.kind: invalid enum value '${obj.kind}' for TypeKind`;\n }\n }\n if (obj.primitiveName !== undefined && obj.primitiveName !== null) {\n {\n if (!isPrimitiveType(obj.primitiveName)) {\n return `${path}.primitiveName: invalid enum value '${obj.primitiveName}' for PrimitiveType`;\n }\n }\n }\n if (obj.enumType !== undefined && obj.enumType !== null) {\n {\n if (!isEnumValueType(obj.enumType)) {\n return `${path}.enumType: invalid enum value '${obj.enumType}' for EnumValueType`;\n }\n }\n }\n if (obj.arrayType !== undefined && obj.arrayType !== null) {\n {\n const err = validateTypeRef(obj.arrayType, `${path}.arrayType`);\n if (err !== null) return err;\n }\n }\n if (obj.mapType !== undefined && obj.mapType !== null) {\n {\n const err = validateTypeRef(obj.mapType, `${path}.mapType`);\n if (err !== null) return err;\n }\n }\n if (obj.objectFields !== undefined && obj.objectFields !== null) {\n {\n if (!Array.isArray(obj.objectFields)) {\n return `${path}.objectFields: expected array, got ${typeof obj.objectFields}`;\n }\n for (let i = 0; i < obj.objectFields.length; i++) {\n {\n const err = validateField(obj.objectFields[i], `${path}.objectFields[${i}]`);\n if (err !== null) return err;\n }\n }\n }\n }\n return null;\n}\n","import type { Annotation, LiteralValue } from \"../types\";\n\n/**\n * Returns the first annotation that matches the provided name.\n */\nexport function getAnnotation(\n annotations: Annotation[] | undefined,\n name: string,\n): Annotation | undefined {\n if (!annotations) return undefined;\n return annotations.find((anno) => anno.name === name);\n}\n\n/**\n * Returns the raw literal argument stored in an annotation.\n *\n * VDL annotations currently expose a single literal argument.\n * Pair this helper with `unwrapLiteral` when you need a plain JavaScript value.\n */\nexport function getAnnotationArgs(\n annotations: Annotation[] | undefined,\n name: string,\n): LiteralValue | undefined {\n const anno = getAnnotation(annotations, name);\n return anno?.argument;\n}\n","import type { LiteralValue } from \"../types\";\n\n/**\n * Native JavaScript value produced by `unwrapLiteral`.\n *\n * `undefined` is preserved when a literal is missing its kind-specific payload.\n * `null` is returned for unknown literal kinds to keep the resolver non-throwing.\n */\nexport type UnwrappedLiteral =\n | string\n | number\n | boolean\n | null\n | undefined\n | UnwrappedLiteral[]\n | { [key: string]: UnwrappedLiteral };\n\n/**\n * Resolves a `LiteralValue` into its native JavaScript representation.\n *\n * Pass a generic when you already know the expected shape.\n * Omit it to get `unknown` and narrow the result yourself.\n *\n * The generic only affects TypeScript types. It does not validate the runtime value.\n */\nexport function unwrapLiteral<T = unknown>(value: LiteralValue): T {\n return unwrapLiteralValue(value) as T;\n}\n\n/**\n * Performs the recursive literal resolution used by `unwrapLiteral`.\n */\nfunction unwrapLiteralValue(value: LiteralValue): UnwrappedLiteral {\n switch (value.kind) {\n case \"string\":\n return value.stringValue;\n case \"int\":\n return value.intValue;\n case \"float\":\n return value.floatValue;\n case \"bool\":\n return value.boolValue;\n case \"object\": {\n const resolvedObject: { [key: string]: UnwrappedLiteral } = {};\n const entries = value.objectEntries ?? [];\n\n for (const entry of entries) {\n resolvedObject[entry.key] = unwrapLiteralValue(entry.value);\n }\n\n return resolvedObject;\n }\n case \"array\": {\n const items = value.arrayItems ?? [];\n return items.map((item) => unwrapLiteralValue(item));\n }\n default:\n return null;\n }\n}\n","/**\n * Returns a string option or the provided fallback when the key is missing.\n */\nexport function getOptionString(\n options: Record<string, string> | undefined,\n key: string,\n defaultValue: string,\n): string {\n const value = options?.[key];\n return value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns a boolean option using common truthy and falsy string values.\n *\n * Accepted truthy values: `true`, `1`, `yes`, `on`, `enable`, `enabled`, `y`.\n *\n * Accepted falsy values: `false`, `0`, `no`, `off`, `disable`, `disabled`, `n`.\n *\n * Invalid values fall back to the provided default.\n */\nexport function getOptionBool(\n options: Record<string, string> | undefined,\n key: string,\n defaultValue: boolean,\n): boolean {\n const value = options?.[key];\n\n if (value === undefined) {\n return defaultValue;\n }\n\n switch (value.trim().toLowerCase()) {\n case \"true\":\n case \"1\":\n case \"yes\":\n case \"on\":\n case \"enable\":\n case \"enabled\":\n case \"y\":\n return true;\n case \"false\":\n case \"0\":\n case \"no\":\n case \"off\":\n case \"disable\":\n case \"disabled\":\n case \"n\":\n return false;\n default:\n return defaultValue;\n }\n}\n\n/**\n * Returns a numeric option or the provided fallback when parsing fails.\n *\n * Empty, invalid, and non-finite values fall back to the default.\n */\nexport function getOptionNumber(\n options: Record<string, string> | undefined,\n key: string,\n defaultValue: number,\n): number {\n const value = options?.[key];\n\n if (value === undefined) {\n return defaultValue;\n }\n\n const trimmedValue = value.trim();\n\n if (trimmedValue === \"\") {\n return defaultValue;\n }\n\n const parsedValue = Number(trimmedValue);\n return Number.isFinite(parsedValue) ? parsedValue : defaultValue;\n}\n\n/**\n * Returns a string array option from a separator-delimited value.\n *\n * Empty items are removed and each entry is trimmed.\n *\n * Missing values return the provided default.\n *\n * @example\n * // For options: { \"features\": \"feature1, feature2, feature3\" }\n * getOptionArray(options, \"features\", [], \",\")\n * // returns [\"feature1\", \"feature2\", \"feature3\"]\n */\nexport function getOptionArray(\n options: Record<string, string> | undefined,\n key: string,\n defaultValue: string[] = [],\n separator = \",\",\n): string[] {\n const value = options?.[key];\n\n if (value === undefined) {\n return defaultValue;\n }\n\n const trimmedValue = value.trim();\n\n if (trimmedValue === \"\") {\n return [];\n }\n\n return trimmedValue\n .split(separator)\n .map((item) => item.trim())\n .filter((item) => item.length > 0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,aAAa,SAA6C;AACxE,QAAO;;;;ACbT,MAAa,oBAAqC,CAChD,UACA,MACD;AAED,SAAgB,gBAAgB,OAAwC;AACtE,QAAO,kBAAkB,SAAS,MAAuB;;AAa3D,MAAa,kBAAiC;CAC5C;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,cAAc,OAAsC;AAClE,QAAO,gBAAgB,SAAS,MAAqB;;AAQvD,MAAa,oBAAqC;CAChD;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,gBAAgB,OAAwC;AACtE,QAAO,kBAAkB,SAAS,MAAuB;;AAQ3D,MAAa,eAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,WAAW,OAAmC;AAC5D,QAAO,aAAa,SAAS,MAAkB;;AAmBjD,SAAgB,kBAAkB,OAA+B;AAI/D,QAAO;EACL,UAJuB,gBAAgB,MAAM,SAAS;EAKtD,MAJmB,MAAM;EAKzB,UAJuB,MAAM,WAAW,oBAAoB,MAAM,SAAS,GAAG,MAAM;EAKrF;;AAGH,SAAgB,mBAAmB,OAAgB,OAAO,cAA6B;AACrF,KAAI,UAAU,QAAQ,UAAU,KAAA,KAAa,OAAO,UAAU,SAC5D,QAAO,GAAG,KAAK,yBAAyB,O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EACL,KAAK;EACL,KAAK,IACH,QAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,IACH,QAAO;EACT,QACE,QAAO;;;;;;;;AASb,SAAgB,gBACd,SACA,KACA,cACQ;CACR,MAAM,QAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAQ,QAAU;AAExB,KAAI,UAAU,KAAA,EACZ,QAAO;CAGT,MAAM,eAAe,MAAM,MAAM;AAEjC,KAAI,iBAAiB,GACnB,QAAO;CAGT,MAAM,cAAc,OAAO,aAAa;AACxC,QAAO,OAAO,SAAS,YAAY,GAAG,cAAc;;;;;;;;;;;;;;AAetD,SAAgB,eACd,SACA,KACA,eAAyB,EAAE,EAC3B,YAAY,KACF;CACV,MAAM,QAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAQ,QAAU;AAExB,KAAI,UAAU,KAAA,EACZ,QAAO;CAGT,MAAM,eAAe,MAAM,MAAM;AAEjC,KAAI,iBAAiB,GACnB,QAAO,EAAE;AAGX,QAAO,aACJ,MAAM,UAAU,CAChB,KAAK,SAAS,KAAK,MAAM,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varavel/vdl-plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "SDK to build plugins for VDL using TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"varavel",
|
|
6
7
|
"vdl",
|
|
7
8
|
"vdl-plugin",
|
|
9
|
+
"vdl-plugin-sdk",
|
|
10
|
+
"vdl-sdk",
|
|
8
11
|
"sdk"
|
|
9
12
|
],
|
|
10
13
|
"homepage": "https://github.com/varavelio/vdl-plugin-sdk#readme",
|
|
@@ -17,7 +20,6 @@
|
|
|
17
20
|
},
|
|
18
21
|
"license": "MIT",
|
|
19
22
|
"author": "Varavel LLC",
|
|
20
|
-
"sideEffects": false,
|
|
21
23
|
"publishConfig": {
|
|
22
24
|
"access": "public"
|
|
23
25
|
},
|
|
@@ -25,17 +27,24 @@
|
|
|
25
27
|
"main": "./dist/index.cjs",
|
|
26
28
|
"module": "./dist/index.js",
|
|
27
29
|
"types": "./dist/index.d.ts",
|
|
30
|
+
"bin": {
|
|
31
|
+
"vdl-plugin": "./bin/vdl-plugin.js"
|
|
32
|
+
},
|
|
28
33
|
"exports": {
|
|
29
34
|
".": {
|
|
30
35
|
"types": "./dist/index.d.ts",
|
|
31
36
|
"import": "./dist/index.js",
|
|
32
37
|
"require": "./dist/index.cjs",
|
|
33
38
|
"default": "./dist/index.js"
|
|
34
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"./tsconfig.base.json": "./tsconfig.base.json"
|
|
35
41
|
},
|
|
36
42
|
"files": [
|
|
43
|
+
"bin",
|
|
44
|
+
"schemas",
|
|
37
45
|
"src",
|
|
38
46
|
"dist",
|
|
47
|
+
"tsconfig.base.json",
|
|
39
48
|
"README.md",
|
|
40
49
|
"LICENSE"
|
|
41
50
|
],
|
|
@@ -43,13 +52,17 @@
|
|
|
43
52
|
"ci": "npm run lint && npm run test && npm run build",
|
|
44
53
|
"build": "tsdown",
|
|
45
54
|
"format": "biome format",
|
|
46
|
-
"lint": "biome check",
|
|
55
|
+
"lint": "tsc --noEmit && biome check",
|
|
47
56
|
"test": "vitest run"
|
|
48
57
|
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"esbuild": "0.27.3",
|
|
60
|
+
"typescript": "5.9.3"
|
|
61
|
+
},
|
|
49
62
|
"devDependencies": {
|
|
50
63
|
"@biomejs/biome": "2.4.6",
|
|
64
|
+
"@varavel/vdl": "0.4.0-alpha.5",
|
|
51
65
|
"tsdown": "0.21.0",
|
|
52
|
-
"typescript": "5.9.3",
|
|
53
66
|
"vitest": "4.0.18"
|
|
54
67
|
}
|
|
55
68
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
It represents a position within a file and is used for error
|
|
3
|
+
reporting, diagnostics, plugins, and tooling support.
|
|
4
|
+
"""
|
|
5
|
+
type Position {
|
|
6
|
+
""" Absolute file path """
|
|
7
|
+
file: string
|
|
8
|
+
|
|
9
|
+
""" Line number (1-indexed) """
|
|
10
|
+
line: int
|
|
11
|
+
|
|
12
|
+
""" Column number (1-indexed) """
|
|
13
|
+
column: int
|
|
14
|
+
}
|
package/schemas/ir.vdl
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
include "./common/position.vdl"
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
IrSchema is the generator-facing representation of a VDL program.
|
|
5
|
+
|
|
6
|
+
This model is intentionally "flat" and "resolved":
|
|
7
|
+
|
|
8
|
+
- spreads are already expanded
|
|
9
|
+
- references are already resolved
|
|
10
|
+
- collections are in deterministic order
|
|
11
|
+
|
|
12
|
+
A code generator should be able to consume IrSchema directly, without needing
|
|
13
|
+
to re-run parser or semantic-analysis logic.
|
|
14
|
+
"""
|
|
15
|
+
type IrSchema {
|
|
16
|
+
""" Absolute path to the main file that triggered the compilation """
|
|
17
|
+
entryPoint: string
|
|
18
|
+
|
|
19
|
+
""" Constant definitions, sorted by name """
|
|
20
|
+
constants: ConstantDef[]
|
|
21
|
+
|
|
22
|
+
""" Enum definitions, sorted by name """
|
|
23
|
+
enums: EnumDef[]
|
|
24
|
+
|
|
25
|
+
""" Type definitions, sorted by name """
|
|
26
|
+
types: TypeDef[]
|
|
27
|
+
|
|
28
|
+
""" Standalone documentation blocks in source traversal order """
|
|
29
|
+
docs: TopLevelDoc[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/********
|
|
33
|
+
* ENUMS *
|
|
34
|
+
********/
|
|
35
|
+
|
|
36
|
+
""" Kind discriminator for TypeRef """
|
|
37
|
+
enum TypeKind {
|
|
38
|
+
Primitive = "primitive"
|
|
39
|
+
Type = "type"
|
|
40
|
+
Enum = "enum"
|
|
41
|
+
Array = "array"
|
|
42
|
+
Map = "map"
|
|
43
|
+
Object = "object"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
""" Primitive scalar type names """
|
|
47
|
+
enum PrimitiveType {
|
|
48
|
+
String = "string"
|
|
49
|
+
Int = "int"
|
|
50
|
+
Float = "float"
|
|
51
|
+
Bool = "bool"
|
|
52
|
+
Datetime = "datetime"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
""" Underlying storage kind used by an enum """
|
|
56
|
+
enum EnumValueType {
|
|
57
|
+
String = "string"
|
|
58
|
+
Int = "int"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
Kind discriminator for LiteralValue.
|
|
63
|
+
|
|
64
|
+
LiteralValue is used for fully resolved literal data in:
|
|
65
|
+
|
|
66
|
+
- constant values
|
|
67
|
+
- annotation arguments
|
|
68
|
+
"""
|
|
69
|
+
enum LiteralKind {
|
|
70
|
+
String = "string"
|
|
71
|
+
Int = "int"
|
|
72
|
+
Float = "float"
|
|
73
|
+
Bool = "bool"
|
|
74
|
+
Object = "object"
|
|
75
|
+
Array = "array"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*******************
|
|
79
|
+
* TYPE SYSTEM CORE *
|
|
80
|
+
*******************/
|
|
81
|
+
|
|
82
|
+
"""
|
|
83
|
+
Normalized type reference used by fields and constants.
|
|
84
|
+
|
|
85
|
+
`kind` selects which payload fields are meaningful. Generators should inspect
|
|
86
|
+
`kind` first, then read the related payload fields.
|
|
87
|
+
"""
|
|
88
|
+
type TypeRef {
|
|
89
|
+
""" Type category discriminator """
|
|
90
|
+
kind: TypeKind
|
|
91
|
+
|
|
92
|
+
""" Primitive type name when `kind` is `primitive` """
|
|
93
|
+
primitiveName?: PrimitiveType
|
|
94
|
+
|
|
95
|
+
""" Referenced type name when `kind` is `type` """
|
|
96
|
+
typeName?: string
|
|
97
|
+
|
|
98
|
+
""" Referenced enum name when `kind` is `enum` """
|
|
99
|
+
enumName?: string
|
|
100
|
+
|
|
101
|
+
""" Referenced enum underlying kind when `kind` is `enum` """
|
|
102
|
+
enumType?: EnumValueType
|
|
103
|
+
|
|
104
|
+
""" Element type when `kind` is `array` """
|
|
105
|
+
arrayType?: TypeRef
|
|
106
|
+
|
|
107
|
+
""" Array rank when `kind` is `array` (for example, 2 for `T[][]`) """
|
|
108
|
+
arrayDims?: int
|
|
109
|
+
|
|
110
|
+
""" Map value type when `kind` is `map` """
|
|
111
|
+
mapType?: TypeRef
|
|
112
|
+
|
|
113
|
+
""" Inline object fields when `kind` is `object` """
|
|
114
|
+
objectFields?: Field[]
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
"""
|
|
118
|
+
Annotation metadata preserved in IR.
|
|
119
|
+
|
|
120
|
+
`name` is the annotation identifier without the `@` prefix.
|
|
121
|
+
`argument`, when present, is fully resolved as a LiteralValue.
|
|
122
|
+
"""
|
|
123
|
+
type Annotation {
|
|
124
|
+
""" Source position of this annotation """
|
|
125
|
+
position: Position
|
|
126
|
+
|
|
127
|
+
""" Annotation name without `@` """
|
|
128
|
+
name: string
|
|
129
|
+
|
|
130
|
+
""" Optional resolved argument payload """
|
|
131
|
+
argument?: LiteralValue
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
""" Flattened object/type field definition """
|
|
135
|
+
type Field {
|
|
136
|
+
""" Source position of this field """
|
|
137
|
+
position: Position
|
|
138
|
+
|
|
139
|
+
""" Field name """
|
|
140
|
+
name: string
|
|
141
|
+
|
|
142
|
+
""" Optional field documentation """
|
|
143
|
+
doc?: string
|
|
144
|
+
|
|
145
|
+
""" True when the field is optional (`?`) """
|
|
146
|
+
optional: bool
|
|
147
|
+
|
|
148
|
+
""" Field annotations in source order """
|
|
149
|
+
annotations: Annotation[]
|
|
150
|
+
|
|
151
|
+
""" Normalized field type reference """
|
|
152
|
+
typeRef: TypeRef
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/*****************
|
|
156
|
+
* RESOLVED VALUE *
|
|
157
|
+
*****************/
|
|
158
|
+
|
|
159
|
+
"""
|
|
160
|
+
Fully resolved literal value.
|
|
161
|
+
|
|
162
|
+
The selected payload is determined by `kind`:
|
|
163
|
+
|
|
164
|
+
- `string` -> `stringValue`
|
|
165
|
+
- `int` -> `intValue`
|
|
166
|
+
- `float` -> `floatValue`
|
|
167
|
+
- `bool` -> `boolValue`
|
|
168
|
+
- `object` -> `objectEntries`
|
|
169
|
+
- `array` -> `arrayItems`
|
|
170
|
+
"""
|
|
171
|
+
type LiteralValue {
|
|
172
|
+
""" Source position of this literal value """
|
|
173
|
+
position: Position
|
|
174
|
+
|
|
175
|
+
""" Value category discriminator """
|
|
176
|
+
kind: LiteralKind
|
|
177
|
+
|
|
178
|
+
""" Payload for `kind = string` """
|
|
179
|
+
stringValue?: string
|
|
180
|
+
|
|
181
|
+
""" Payload for `kind = int` """
|
|
182
|
+
intValue?: int
|
|
183
|
+
|
|
184
|
+
""" Payload for `kind = float` """
|
|
185
|
+
floatValue?: float
|
|
186
|
+
|
|
187
|
+
""" Payload for `kind = bool` """
|
|
188
|
+
boolValue?: bool
|
|
189
|
+
|
|
190
|
+
""" Payload for `kind = object` """
|
|
191
|
+
objectEntries?: ObjectEntry[]
|
|
192
|
+
|
|
193
|
+
""" Payload for `kind = array` """
|
|
194
|
+
arrayItems?: LiteralValue[]
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
""" Key/value pair inside an object LiteralValue payload """
|
|
198
|
+
type ObjectEntry {
|
|
199
|
+
""" Source position of this key-value pair """
|
|
200
|
+
position: Position
|
|
201
|
+
|
|
202
|
+
""" Object key """
|
|
203
|
+
key: string
|
|
204
|
+
|
|
205
|
+
""" Fully resolved value for this key """
|
|
206
|
+
value: LiteralValue
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/************************
|
|
210
|
+
* TOP LEVEL DEFINITIONS *
|
|
211
|
+
************************/
|
|
212
|
+
|
|
213
|
+
"""
|
|
214
|
+
Flattened type definition.
|
|
215
|
+
|
|
216
|
+
All spreads are already expanded. The unified `typeRef` describes what this
|
|
217
|
+
type IS, a primitive, custom reference, map, array, or object with fields.
|
|
218
|
+
"""
|
|
219
|
+
type TypeDef {
|
|
220
|
+
"""
|
|
221
|
+
Source position of this type definition.
|
|
222
|
+
Will be zero valued if the type was inferred by the compiler.
|
|
223
|
+
"""
|
|
224
|
+
position: Position
|
|
225
|
+
|
|
226
|
+
""" Type name """
|
|
227
|
+
name: string
|
|
228
|
+
|
|
229
|
+
""" Optional type documentation """
|
|
230
|
+
doc?: string
|
|
231
|
+
|
|
232
|
+
""" Type annotations in source order """
|
|
233
|
+
annotations: Annotation[]
|
|
234
|
+
|
|
235
|
+
""" Unified type reference describing what this type IS """
|
|
236
|
+
typeRef: TypeRef
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
"""
|
|
240
|
+
Flattened enum definition.
|
|
241
|
+
|
|
242
|
+
All enum spreads are already expanded into `members`.
|
|
243
|
+
"""
|
|
244
|
+
type EnumDef {
|
|
245
|
+
""" Source position of this definition """
|
|
246
|
+
position: Position
|
|
247
|
+
|
|
248
|
+
""" Enum name """
|
|
249
|
+
name: string
|
|
250
|
+
|
|
251
|
+
""" Optional enum documentation """
|
|
252
|
+
doc?: string
|
|
253
|
+
|
|
254
|
+
""" Enum annotations in source order """
|
|
255
|
+
annotations: Annotation[]
|
|
256
|
+
|
|
257
|
+
""" Enum underlying storage kind """
|
|
258
|
+
enumType: EnumValueType
|
|
259
|
+
|
|
260
|
+
""" Enum members in source order after spread expansion """
|
|
261
|
+
members: EnumMember[]
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
""" Enum member definition """
|
|
265
|
+
type EnumMember {
|
|
266
|
+
""" Source position of this member """
|
|
267
|
+
position: Position
|
|
268
|
+
|
|
269
|
+
""" Member name """
|
|
270
|
+
name: string
|
|
271
|
+
|
|
272
|
+
""" Fully resolved member value """
|
|
273
|
+
value: LiteralValue
|
|
274
|
+
|
|
275
|
+
""" Optional member documentation """
|
|
276
|
+
doc?: string
|
|
277
|
+
|
|
278
|
+
""" Member annotations in source order """
|
|
279
|
+
annotations: Annotation[]
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
"""
|
|
283
|
+
Fully resolved constant definition.
|
|
284
|
+
|
|
285
|
+
`typeRef` is explicit or inferred by analysis.
|
|
286
|
+
`value` contains the fully resolved literal payload.
|
|
287
|
+
"""
|
|
288
|
+
type ConstantDef {
|
|
289
|
+
""" Source position of this definition """
|
|
290
|
+
position: Position
|
|
291
|
+
|
|
292
|
+
""" Constant name """
|
|
293
|
+
name: string
|
|
294
|
+
|
|
295
|
+
""" Optional constant documentation """
|
|
296
|
+
doc?: string
|
|
297
|
+
|
|
298
|
+
""" Constant annotations in source order """
|
|
299
|
+
annotations: Annotation[]
|
|
300
|
+
|
|
301
|
+
""" Normalized constant type reference (explicit or inferred) """
|
|
302
|
+
typeRef: TypeRef
|
|
303
|
+
|
|
304
|
+
""" Fully resolved constant value """
|
|
305
|
+
value: LiteralValue
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
"""
|
|
309
|
+
Standalone documentation block.
|
|
310
|
+
|
|
311
|
+
Used for top-level docstrings that are not attached to a type/enum/constant.
|
|
312
|
+
"""
|
|
313
|
+
type TopLevelDoc {
|
|
314
|
+
""" Source position of this documentation block """
|
|
315
|
+
position: Position
|
|
316
|
+
|
|
317
|
+
""" Resolved documentation content """
|
|
318
|
+
content: string
|
|
319
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""
|
|
2
|
+
VDL Plugin Protocol Schema
|
|
3
|
+
|
|
4
|
+
This schema defines the exact communication protocol between the VDL compiler
|
|
5
|
+
core and the sandboxed plugin environment (JavaScript via Goja).
|
|
6
|
+
|
|
7
|
+
## Protocol Overview
|
|
8
|
+
|
|
9
|
+
1. VDL parses and compiles the schema into an IrSchema.
|
|
10
|
+
2. VDL instantiates a secure JavaScript sandbox using Goja.
|
|
11
|
+
3. VDL invokes the plugin's exported `generate` function, passing a `PluginInput` object.
|
|
12
|
+
4. The `generate` function returns a `PluginOutput` object (or throws a fatal error).
|
|
13
|
+
5. VDL reads the output. If `errors` are present, it aborts and prints them. Otherwise, it writes the `files` to the disk.
|
|
14
|
+
|
|
15
|
+
A plugin SHOULD be a pure function: `function generate(input: PluginInput): PluginOutput`
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
include "./plugin_input.vdl"
|
|
19
|
+
include "./plugin_output.vdl"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
include "./ir.vdl"
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
PluginInput represents the data payload sent to a plugin.
|
|
5
|
+
|
|
6
|
+
The plugin receives this as a single argument containing the complete
|
|
7
|
+
Intermediate Representation of the VDL schema along with any user-defined
|
|
8
|
+
configuration options from `vdl.config.vdl`.
|
|
9
|
+
"""
|
|
10
|
+
type PluginInput {
|
|
11
|
+
""" The VDL binary version (without v prefix, e.g. 1.0.0) """
|
|
12
|
+
version: string
|
|
13
|
+
|
|
14
|
+
"""
|
|
15
|
+
The complete VDL Intermediate Representation.
|
|
16
|
+
|
|
17
|
+
Contains all types, enums, constants, and documentation from the compiled
|
|
18
|
+
schema, fully resolved and ready for code generation.
|
|
19
|
+
"""
|
|
20
|
+
ir: IrSchema
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
Arbitrary key-value options passed from the `vdl.config.vdl` plugin configuration.
|
|
24
|
+
|
|
25
|
+
These allow users to customize plugin behavior without modifying the plugin
|
|
26
|
+
itself. Common use cases include specifying target frameworks, API versions,
|
|
27
|
+
naming conventions, or feature flags.
|
|
28
|
+
"""
|
|
29
|
+
options: map<string>
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
include "./common/position.vdl"
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
PluginOutput represents the response payload returned by the `plugin` function.
|
|
5
|
+
|
|
6
|
+
After processing the input schema, the plugin outputs this object containing
|
|
7
|
+
all files to be generated or errors to be displayed to the user.
|
|
8
|
+
|
|
9
|
+
If there are no errors and at least one file is returned, VDL will write each
|
|
10
|
+
file to the specified path within the output directory. If there are errors,
|
|
11
|
+
VDL will display them to the user and not write any files.
|
|
12
|
+
"""
|
|
13
|
+
type PluginOutput {
|
|
14
|
+
"""
|
|
15
|
+
List of virtual files generated by the plugin.
|
|
16
|
+
|
|
17
|
+
Each file specifies a relative path within the output directory and its
|
|
18
|
+
complete textual content. Paths may include subdirectories which VDL
|
|
19
|
+
will create automatically.
|
|
20
|
+
|
|
21
|
+
If no files are returned, VDL will not write anything.
|
|
22
|
+
"""
|
|
23
|
+
files?: PluginOutputFile[]
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
List of semantic errors encountered by the plugin.
|
|
27
|
+
|
|
28
|
+
If present, VDL will stop the compilation and display them to the user.
|
|
29
|
+
"""
|
|
30
|
+
errors?: PluginOutputError[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
"""
|
|
34
|
+
PluginOutputFile represents a single generated file produced by the plugin.
|
|
35
|
+
|
|
36
|
+
This abstraction allows plugins to generate multiple files from a single
|
|
37
|
+
invocation, enabling patterns like one-file-per-type or splitting large
|
|
38
|
+
outputs across multiple modules.
|
|
39
|
+
"""
|
|
40
|
+
type PluginOutputFile {
|
|
41
|
+
"""
|
|
42
|
+
Relative path from the output directory where this file should be written.
|
|
43
|
+
|
|
44
|
+
May include subdirectory separators (e.g., "src/models/user.py").
|
|
45
|
+
Forward slashes are normalized to the appropriate separator for the
|
|
46
|
+
current operating system.
|
|
47
|
+
"""
|
|
48
|
+
path: string
|
|
49
|
+
|
|
50
|
+
"""
|
|
51
|
+
The complete textual content of the generated file.
|
|
52
|
+
|
|
53
|
+
This should be the final, formatted output ready to be written to disk.
|
|
54
|
+
VDL writes this content as-is without additional processing.
|
|
55
|
+
"""
|
|
56
|
+
content: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
A structured error reported by the plugin.
|
|
61
|
+
"""
|
|
62
|
+
type PluginOutputError {
|
|
63
|
+
""" Human-readable error message explaining what went wrong """
|
|
64
|
+
message: string
|
|
65
|
+
|
|
66
|
+
"""
|
|
67
|
+
Optional source position associated with this error.
|
|
68
|
+
If provided, VDL will print a beautiful snippet highlighting the exact code.
|
|
69
|
+
If omitted, the error is treated as a global configuration/plugin error.
|
|
70
|
+
"""
|
|
71
|
+
position?: Position
|
|
72
|
+
}
|