projdesk-kernel

    ProjDesk MoonBit kernel — six independent algorithm engines (DSL compiler, constraint solver, migration, equivalence, round-trip, schema solvability) over one model description, projected to seven targets

    moonbit
    moonmodel
    json-schema
    openapi
    sql
    graphql
    projection
    dsl
    migration
    constraint
    equivalence
    modeling
    schema-solvability
    Download zip
    Author
    Version
    0.3.0
    License
    MIT
    Last updated
    24 days ago
    Downloads
    69

    #ProjDesk MoonBit Kernel

    The algorithm core of ProjDesk — a model engineering workbench. One model description, five independent algorithm engines, seven projection targets.

    #Engines

    EngineModulesWhat it does
    DSL compilerdsl_lexer dsl_parser dsl_expr dsl_codegen dsl_printer dsl_semantic dsl_resolveHand-written lexer, recursive descent parser, constraint-expression evaluator, AST codegen, inverse AST printer, semantic checks, cross-field bound resolution
    Constraint solversolver solver_propagateConflict / redundancy / containment analysis, cross-field bound resolution, fixed-point interval propagation, reference-cycle detection
    Migration enginemigrationStructured semantic diff, SQL ALTER TABLE, breaking-change classification
    Equivalence checkerequivType subtyping, constraint containment, version compatibility
    Round-trip verifierroundtripFormal generate-parse-compare correctness verification

    #Scope

    This package provides the kernel. Projection formats (JSON Schema, OpenAPI, SQL DDL, GraphQL SDL) come from moonbitstack/moonmodel; TypeScript, Zod and Prisma emitters live in main/codegen.mbt.

    #Using it

    moon add Tino-hue/projdesk-kernel

    The package exports the WASM ABI, so it is a foreign library — a consuming package imports it under an alias:

    # cmd/demo/moon.pkg import { "Tino-hue/projdesk-kernel/main" @projdesk, } pkgtype(kind: "executable")

    // cmd/demo/main.mbt
    fn main {
    let (projections, problems) = @projdesk.dsl_project(
    "model User {\n id: Big @unique\n name: Text [shortest=1, longest=64]\n}",
    )
    println(projections)
    for problem in problems {
    println(problem)
    }
    }

    moon run cmd/demo

    The alias is not optional in practice: the kernel's package is called main, and so is the package you would import it from.

    node scripts/verify-registry-consumption.js (from the repository root) checks that the published package — not this checkout — is consumable by a module that has nothing to do with the project.

    #Build

    moon build --target wasm-gc --release moon test

    #License

    MIT — see the repository root for the full text.