Skip to content

[EXPERIMENTAL] A minimal, human-readable, machine-parsable configuration format with built-in schema validation \\v0/VZ/Vzero

License

Notifications You must be signed in to change notification settings

skorotkiewicz/vzparse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VZparse Monorepo

A minimal, human-readable, machine-parsable configuration format with built-in schema validation.

What is VZparse?

VZparse is a modern configuration format that combines the simplicity of YAML with the power of JSON, plus advanced features like schema validation, template strings, and imports.

Features

  • Minimal syntax - Simple and intuitive
  • Schema validation - Built-in type checking with constraints
  • Template strings - Dynamic values with ${variable} syntax
  • Import system - Modular configuration with imports
  • Multiline strings - Rich text with metadata support
  • Comments - Full documentation support
  • Type-safe - Built-in support for all data types
  • Error handling - Detailed error messages with context

Quick Example

# Application configuration
app: {
  name: "MyApp"
  version: "1.0.0"
  debug: true
}

# Schema validation
schema: {
  id: "int(min:1,max:1000)!"
  name: "string(minLength:3,maxLength:50)!"
  email: "string(format:email)!"
}

# Template strings
user: {
  name: "Alice"
  role: "admin"
}

greeting: "Hello, ${user.name}! You are a ${user.role}."

# Multiline strings with metadata
readme: |markdown
  # MyApp Configuration
  
  This is a comprehensive configuration file.
  
  ## Features
  - Authentication
  - API endpoints
  - Database connection

Monorepo Structure

This monorepo contains:

  • apps/vzparse-js-sdk - VZparse parser library for TS/JS
  • apps/vz-vscode - VS Code extension for VZparse
  • apps/vzparse-website - Documentation website

Getting Started

Installation

# Install dependencies
bun install

# Build all packages
bun run build

# Run tests
bun run test

# Start development
bun run dev

Using the Parser

# Install the parser
cd apps/parser
bun install

# Run examples
bun run examples

# Run tests
bun test
import { VZ } from 'vzparse';

const config = VZ.parse(`
  app: {
    name: "MyApp"
    version: "1.0.0"
  }
  
  user: {
    name: "Alice"
    role: "admin"
  }
  
  greeting: "Hello, ${user.name}! You are a ${user.role}."
`, {
  resolveTemplates: true,
  context: { user: { name: 'Alice', role: 'admin' } }
});

console.log(config.greeting); // "Hello, Alice! You are an admin."

VS Code Extension

# Package the extension
cd apps/vz-vscode
bun run package

# Install the extension
code --install-extension vz-vscode-0.2.0.vsix

Documentation Website

# Start the development server
cd apps/website
bun run dev

# Build for production
bun run build

Scripts

  • bun run build - Build all packages
  • bun run dev - Start development servers
  • bun run test - Run all tests
  • bun run lint - Lint all packages
  • bun run format - Format all code
  • bun run clean - Clean all build artifacts
  • bun run examples - Run parser examples
  • bun run package:vscode - Package VS Code extension
  • bun run publish:vscode - Publish VS Code extension

Development

Prerequisites

Setup

# Clone the repository
git clone https://github.com/skorotkiewicz/vzparse.git
cd vzparse

# Install dependencies
bun install

# Build all packages
bun run build

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: bun run test
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

We use Biome for code formatting and linting:

# Format code
bun run format

# Lint code
bun run lint

Documentation

License

MIT License - see LICENSE for details.

Acknowledgments

  • Inspired by YAML, JSON, and modern configuration languages
  • Built with TypeScript and Bun
  • Documentation powered by VitePress

About

[EXPERIMENTAL] A minimal, human-readable, machine-parsable configuration format with built-in schema validation \\v0/VZ/Vzero

Topics

Resources

License

Stars

Watchers

Forks