metadsl
v3.0.5
Published
Create schema and check YAML files
Readme
MetaDSL
A powerful TypeScript library for defining schemas, validating YAML configuration files, and providing IntelliSense features (completions, hover documentation) for structured data.
Links
Features
- Schema Definition: Define structured schemas with type safety using TypeScript types
- YAML Validation: Validate YAML configuration files against defined schemas
- IntelliSense Support: Provide auto-completions and hover documentation for configuration files
- Advanced Validation: Support for synchronous and asynchronous validation functions
- Complex Relationships: Define field dependencies (
with,without,orconditions) - Enum Support: Enumerated values with conditional logic
- Numeric Types: Strict numeric type validation (int8-128, uint8-128, float16-64, etc.)
- Custom Metadata: Add documentation, deprecation notices, and details for fields
Best Practices
- Define Complete Schemas: Always provide default values and metadata for better IntelliSense
- Use Strict Numeric Types: When dealing with binary protocols or specific ranges
- Leverage Async Validation: For checks that require I/O (database, network, file system)
- Provide Documentation: Use metadata fields to help users understand configuration options
- Test Validation: Test both valid and invalid configurations to ensure proper error messages
Integration with VS Code
MetaDSL can be integrated with VS Code extensions to provide IntelliSense for custom configuration formats. Use getCompletions and getHoverItem methods to implement language server features.
License
MIT - See LICENSE file for details.
