Skip to content

romancitodev/devconf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DevConf πŸš€

The definitive configuration language for modern applications

DevConf is a powerful, human-friendly configuration language designed for developers who want more than basic key-value pairs. With built-in templating, environment variable interpolation, and expressive syntax, DevConf makes managing complex application configurations simple and maintainable.

Warning

This repo is in Heavy Development and in an alpha stage, some things doesn't work yet but will do it soon. For more info, go to The current status

✨ Features

  • 🎯 Simple & Intuitive: Clean syntax that's easy to read and write
  • πŸ”„ Environment Interpolation: Dynamic values with ${VAR} syntax and defaults
  • πŸ“ Template System: Reusable configuration templates with parameters
  • πŸ—οΈ Dot Notation: Hierarchical configuration with app.database.host syntax
  • πŸ“Š Rich Data Types: Strings, numbers, booleans, arrays, and nested objects
  • πŸ’¬ Comments: Full comment support for documentation
  • πŸ”’ Number Formatting: Underscore separators for readability (1_000_000)
  • ⚑ Conditional Logic: @if statements for dynamic configuration
  • 🎨 Flexible Syntax: Multiple ways to express the same configuration

πŸš€ Quick Start

# Basic configuration
name: "my-app"
version: "1.0.0"
debug: ${NODE_ENV == "debug"}

# Nested configuration with dot notation
app.port: ${PORT:int || 8080}
app.database.host: "localhost"
app.database.pool_size: 10

# Arrays and objects
features: [auth, logging, metrics]
cache: {
  enabled: true,
  ttl: 300,
  type: "redis"
}

# Templates for reusable configurations
@template service(name, port, database=null):
  services.${name}.port: ${port}
  services.${name}.health_check: "/health"
  @if database != null:
    services.${name}.database: ${database}

# Use templates
@use service("api", 8001, "main_db")
@use service("worker", 8002)

πŸ“– Language Guide

Basic Types

# Strings (quoted or unquoted)
app_name: "My Application"
environment: production

# Numbers with optional underscores
users_count: 1_000_000
response_time: 45.67
percentage: 0.95

# Booleans
debug_enabled: true
maintenance_mode: false

# Arrays
languages: [rust, python, javascript]
ports: [8080, 8081, 8082]

# Objects
database: {
  host: "localhost",
  port: 5432,
  ssl: true
}

Environment Variables

# Simple interpolation
api_key: ${API_KEY}

# With defaults
port: ${PORT:int || 3000}
host: ${HOST || "localhost"}

# Conditional expressions
debug: ${NODE_ENV == "development"}

Templates

Templates allow you to create reusable configuration patterns:

@template microservice(name, port, database=null):
  services.${name}.port: ${port}
  services.${name}.health_check: "/health"
  services.${name}.metrics: "/metrics"
  @if database != null:
    services.${name}.database: ${database}

# Usage
@use microservice("user-service", 8001, "users_db")
@use microservice("auth-service", 8002)

Dot Notation

Build hierarchical configurations naturally:

# These are equivalent:
app.server.host: "localhost"
app.server.port: 8080

app: {
  server: {
    host: "localhost",
    port: 8080
  }
}

Conditional Configuration

@if ${NODE_ENV} == "production":
  logging.level: "warn"
  cache.enabled: true

@if ${FEATURE_FLAGS.new_ui}:
  ui.theme: "modern"

πŸ—οΈ Use Cases

  • Microservices: Define service configurations with templates
  • Multi-environment: Use environment interpolation for different deployments
  • Complex Applications: Leverage hierarchical configuration and conditionals
  • DevOps: Simplify configuration management across teams

πŸ› οΈ Implementation Status

Lexer βœ…

  • Punctuation tokenization
  • String literals (quoted and unquoted)
  • Identifiers and keywords
  • Numeric literals (integers and floats)
  • Boolean literals
  • Array and object structures
  • Indentation handling

Parser βœ…

  • Primitive value parsing
  • Comment support
  • Array and object parsing
  • Environment variable interpolation
  • Dot notation
  • Template system
  • Conditional expressions

Runtime βœ…

  • Property table creation
  • Nested property handling
  • Object literal flattening
  • Array and primitive value support
  • Environment variable evaluation
  • Template expansion
  • Conditional logic evaluation

Type Checker βœ…

  • Basic type validation
  • Complex nested expressions
  • Error reporting

🚧 Roadmap

  • Complete dot notation support
  • Conditional logic (@if statements)
  • Template system implementation
  • Expression evaluation
  • CLI tool for validation and conversion
  • IDE extensions (VS Code, Vim, etc.)
  • Integration libraries for popular frameworks

🀝 Contributing

DevConf is built with Rust and welcomes contributions! Whether you're interested in:

  • Adding new language features
  • Improving parser performance
  • Writing documentation
  • Creating IDE extensions
  • Building integrations

πŸ“ License

This project is licensed under the MIT License.

🌟 Why DevConf?

Tired of juggling YAML indentation, JSON verbosity, and TOML limitations? DevConf combines the best of all worlds:

  • More expressive than TOML - Templates and conditionals
  • More reliable than YAML - No indentation nightmares
  • More readable than JSON - Comments and flexible syntax
  • More powerful than INI - Rich data types and nesting

Perfect for modern applications that need sophisticated configuration management without the complexity.

About

πŸš€ Modern configuration language with templates, environment interpolation & dot notation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published