No description
Find a file
dependabot[bot] 9bc1e4cb17
Bump pymdown-extensions from 10.19.1 to 10.20 (#805)
Bumps [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) from 10.19.1 to 10.20.
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.19.1...10.20)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-version: '10.20'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-01 13:03:17 +00:00
.circleci update circle node image 2025-04-02 22:09:19 -07:00
.github a bunch of minor fixes lol 2025-04-02 21:51:00 -07:00
.vscode Formatted BUILD files and added .editorconfig 2021-06-13 15:45:52 -07:00
build_defs/nim Formatted BUILD files and added .editorconfig 2021-06-13 15:45:52 -07:00
docs more wiki updates lol 2025-07-29 14:34:31 -07:00
examples add swift support 2025-06-15 16:44:22 -07:00
scripts Remove please dependency and add arm64 Mac support (#688) 2025-02-19 00:17:45 -08:00
src Bump @types/node from 25.0.2 to 25.0.3 in /src/tsUtil (#803) 2025-12-17 13:02:49 +00:00
.ackrc Basic support for interface with abstract functions 2020-07-27 00:19:56 -07:00
.editorconfig Formatted BUILD files and added .editorconfig 2021-06-13 15:45:52 -07:00
.gitattributes Upgrade to nim 1.4.0 and add const.nim to repo 2020-11-25 15:54:16 -08:00
.gitignore add openssl and fix github ci 2025-04-02 12:32:14 -07:00
.mergify.yml a bunch of minor fixes lol 2025-04-02 21:51:00 -07:00
.plzconfig Fix install script set path 2021-06-06 20:24:45 -07:00
LICENSE Added a simple design page to explain how this works at a high level. 2020-07-12 22:05:06 -07:00
mkdocs.yml more wiki updates lol 2025-07-29 14:34:31 -07:00
pleasew Initial commit 2019-07-02 23:59:00 -07:00
README.md more wiki updates lol 2025-07-29 14:34:31 -07:00
requirements.txt Bump pymdown-extensions from 10.19.1 to 10.20 (#805) 2026-01-01 13:03:17 +00:00
wings.json add swift support 2025-06-15 16:44:22 -07:00
wings.nimble release v0.0.10 2025-06-17 00:13:24 -07:00

Wings - Cross-Language Code Generator

Wings is a simple, customizable cross-language code generator that helps maintain consistency across your multi-language tech stack. Define your data structures once in .wings files, and generate corresponding code in multiple programming languages automatically.

GitHub Action Status CircleCI codecov CodeFactor

Gitter Website

GitHub all releases Visual Studio Marketplace Downloads npm

🚀 Quick Start

Installation

Script Installation (Recommended)

curl -s https://wings.sh/install.sh | sh

Using Nimble

nimble install wings

Manual Installation

  1. Download the appropriate binary from GitHub Releases
  2. Add to your PATH and rename to wings
  3. Make executable: chmod +x wings

Build from Source

git clone https://github.com/binhonglee/wings.git
cd wings
nim c -r src/main/wings.nim

Your First Wings File

Create a file named person.wings:

# Define output paths for different languages
go-filepath examples/go
ts-filepath examples/ts
py-filepath examples/py

# Define a simple struct
struct Person {
    id int -1
    name str ""
    email str ""
    age int 0
    is_active bool true
}

Generate code:

wings person.wings

This creates corresponding struct/class files in the configured languages with proper type definitions and JSON serialization.

Requirements

*Note: There are also other packages needed for deployment due to cross compilation (like gcc-multilib, gcc-arm-linux-gnueabihf, mingw-w64, libevent-dev etc...).

Development Tools (scripts)

  • Run mkdocs development server for realtime feedback on changes made docs folder (requires mkdocs)
    • nim src/main/scripts/docs.nims
  • Build release binaries for distribution
    • nim src/main/scripts/release.nims (This will only build the version compatible to your environment by default. You can do nim src/main/scripts/release.nims --all to try cross-compiling for other environments.)
  • Generate / Update the lang folder (src/main/wingspkg/lang) based on the files in the examples/input/templates folder
    • nim c -r -d:ssl src/main/staticlang/main.nim
  • Run tests
    • ./scripts/test.sh (This isn't a proper test for everything. Recommend reading the script, < 20 lines, before running it.)

For some more comprehensive set up / testing procedure, .github/workflows/main.yml file might be a good place to start looking into.

📋 Table of Contents

  1. Core Concepts
  2. Language Configuration
  3. Struct Definition
  4. Enum Definition
  5. Configuration File
  6. Examples
  7. Contributing

🎯 Core Concepts

What Wings Does

Wings solves the problem of maintaining identical data structures across multiple programming languages. Instead of manually keeping structs, classes, and enums synchronized across your different services, you define them once and generate consistent code.

Key Benefits

  • Single Source of Truth: Define structures once, use everywhere
  • Type Safety: Generates proper type definitions for each language
  • Consistency: Ensures field names, types, and defaults are identical
  • Simplicity: Straightforward syntax and minimal configuration

🔧 Language Configuration

Output Path Configuration

Define where generated files should be placed:

# Single language
go-filepath src/models

# Multiple languages
go-filepath backend/models
ts-filepath frontend/src/types
py-filepath services/shared/models

Import Configuration

Control how imports are handled:

# Import external wings files
import shared/common.wings
import validation/rules.wings

🏗️ Struct Definition

Basic Syntax

struct StructName {
    field_name field_type default_value
    another_field another_type
}

Field Types

Primitive Types

struct DataTypes {
    # Integers
    user_id int 0
    count int 0
    
    # Strings
    name str ""
    description str "No description"
    
    # Booleans
    is_active bool true
    is_deleted bool false
    
    # Floating point
    price float 0.0
}

Complex Types

struct ComplexTypes {
    # Arrays/Lists
    tags []str
    scores []int
    
    # Maps/Dictionaries (if supported)
    metadata Map<str,str>
    counts Map<str,int>
    
    # Custom types (from other wings files)
    address Address
    permissions []Permission
}

Optional Fields and Defaults

struct UserProfile {
    # Required fields (no default)
    id int
    email str
    
    # Optional with defaults
    name str "Anonymous"
    age int 0
    bio str ""
    
    # Optional arrays
    tags []str
}

🔢 Enum Definition

Basic Enum

enum Status {
    Active
    Inactive
    Pending
    Suspended
}

Enum with Comments

# User account status
enum UserStatus {
    # Account is active and user can log in
    Active
    
    # Account is temporarily disabled
    Inactive
    
    # Account is waiting for email verification
    Pending
    
    # Account is suspended due to policy violation
    Suspended
}

Using Enums in Structs

import enums/status.wings

struct User {
    id int
    name str
    status Status Status.Active
}

⚙️ Configuration File

Create a wings.json configuration file for advanced settings:

{
  "header": [
    "This is a generated file",
    "Do not edit manually"
  ],
  "acronyms": ["ID", "URL", "API", "HTTP", "JSON"],
  "langFilter": ["go", "ts", "py"],
  "skipImport": false,
  "logging": 2
}

Configuration Options

Option Type Description
header []string Header comments for generated files
acronyms []string Words to keep as ALL_CAPS in naming
langFilter []string Only generate these languages
skipImport bool Skip processing imported files
logging int Logging verbosity (0-4)

🎨 Best Practices

File Organization

project/
├── wings/
│   ├── shared/
│   │   ├── common.wings
│   │   └── enums.wings
│   ├── models/
│   │   ├── user.wings
│   │   └── product.wings
├── wings.json
└── generated/
    ├── go/
    ├── ts/
    └── py/

Naming Conventions

  • Use snake_case for field names in wings files
  • Wings will automatically convert to language-appropriate naming
  • Use descriptive names for structs and enums

Default Values

  • Always provide sensible defaults for optional fields
  • Use empty strings "" for optional text fields
  • Use false for boolean flags that default to off
  • Use 0 for numeric counters

Comments and Documentation

# This comment describes the entire struct
struct User {
    # User's unique identifier
    id int
    
    # Full name of the user
    name str ""
    
    # Email address for authentication
    email str
}

📚 Examples

Simple API Model

# wings/api/user.wings
struct User {
    id int
    name str
    email str
    is_active bool true
    created_at str
}

enum UserRole {
    Admin
    User
    Guest
}

struct UserWithRole {
    id int
    name str
    email str
    role UserRole UserRole.User
}

E-commerce Product

# wings/ecommerce/product.wings
import shared/common.wings

struct Product {
    id int
    name str
    description str ""
    price float
    is_available bool true
    tags []str
}

enum ProductCategory {
    Electronics
    Clothing
    Books
    Home
}

🤝 Contributing

Development Setup

# Clone the repository
git clone https://github.com/binhonglee/wings.git
cd wings

# Build from source (requires Nim)
nim c -r src/main/wings.nim

# Run tests
./scripts/test.sh

Reporting Issues

  • Use GitHub Issues for bugs and feature requests
  • Include wings file examples and configuration
  • Provide generated output when relevant
  • Specify operating system and wings version

📖 Further Reading