Skip to content

BuildFlow

Edgar Mesquita edited this page Jan 29, 2026 · 6 revisions

eQuantic.UI Build Flow

This document describes the eQuantic.UI build flow, demonstrating how the framework maintains zero external dependencies for the consumer.

Visual Flow

┌─────────────────────────────────────────────────────────────────────────────┐
│                           DEVELOPMENT (source tree)                         │
└─────────────────────────────────────────────────────────────────────────────┘

  reconciler.ts, component.ts, etc.
         │
         ▼
  ┌──────────────────────────────────┐
  │  npm run build                   │  (only during development)
  │  (eQuantic.UI.Runtime)           │
  └──────────────────────────────────┘
         │
         ▼
  dist/index.js (compiled runtime)
         │
         │
  boot.ts ──────imports────────┘
         │
         ▼
  ┌──────────────────────────────────┐
  │  dotnet build                    │
  │  (eQuantic.UI.Server)            │
  │                                  │
  │  ResolveBunForServer target:     │
  │  ├─ Looks for Bun in:            │
  │  │  Runtime.Osx64/tools/bun/     │
  │  │  Runtime.Win64/tools/bun/     │
  │  │  Runtime.Linux64/tools/bun/   │
  │  ├─ Extracts from .zip if needed │
  │  └─ chmod +x (Unix)              │
  │                                  │
  │  BundleRuntime target:           │
  │  └─ "$(_BunPath)" build boot.ts  │
  └──────────────────────────────────┘
         │
         ▼
  wwwroot/runtime.js (embedded in Server.dll)
         │
         ▼
  ┌──────────────────────────────────┐
  │  dotnet pack                     │
  │  (eQuantic.UI.Server)            │
  └──────────────────────────────────┘
         │
         ▼
  artifacts/packages/eQuantic.UI.Server.0.1.1.nupkg


┌─────────────────────────────────────────────────────────────────────────────┐
│                        CONSUMER (client project)                            │
└─────────────────────────────────────────────────────────────────────────────┘

  MyApp.csproj
  ├─ Sdk="eQuantic.UI.Sdk/0.1.1"
  └─ PackageReference: eQuantic.UI.Server, eQuantic.UI.Runtime

         │
         ▼
  ┌──────────────────────────────────┐
  │  dotnet restore                  │
  │                                  │
  │  NuGet installs packages:        │
  │  ├─ eQuantic.UI.Sdk              │
  │  ├─ eQuantic.UI.Server           │
  │  ├─ eQuantic.UI.Runtime          │
  │  │  └─ (meta-package)            │
  │  └─ eQuantic.UI.Runtime.Osx64    │  ◄── Bun embedded here!
  │     └─ tools/bun/bun-darwin.zip  │
  └──────────────────────────────────┘
         │
         ▼
  ┌──────────────────────────────────┐
  │  dotnet build                    │
  │                                  │
  │  SDK.targets executes:           │
  │                                  │
  │  1. ResolveBunZipPath            │
  │     └─ $(PkgeQuantic_UI_Runtime_ │
  │        Osx64)/tools/bun/*.zip    │
  │                                  │
  │  2. EnsureBunExtracted           │
  │     ├─ Unzip if needed           │
  │     └─ chmod +x (Unix)           │
  │                                  │
  │  3. ResolveBunPath               │
  │     └─ Defines $(BunPath)        │
  │                                  │
  │  4. CompileEQuanticUI            │
  │     └─ dotnet eqc.dll ... --bun  │
  │        "$(BunPath)"              │
  │                                  │
  │  5. BuildCSS (Tailwind)          │
  │     └─ "$(BunPath)" x            │
  │        @tailwindcss/cli ...      │
  └──────────────────────────────────┘
         │
         ▼
  wwwroot/_equantic/*.js (compiled components)
         │
         ▼
  ┌──────────────────────────────────┐
  │  dotnet run                      │
  │                                  │
  │  Server serves:                  │
  │  ├─ runtime.js (from Server.dll) │
  │  └─ *.js (from wwwroot/_equantic)│
  └──────────────────────────────────┘
         │
         ▼
  Browser loads application

Bun Source by Component

Component Bun Source
Server (package build) eQuantic.UI.Runtime.{OS}/tools/bun/ (source tree)
SDK (consumer) $(PkgeQuantic_UI_Runtime_{OS})/tools/bun/ (NuGet cache)
Tailwind Uses $(BunPath) resolved by SDK

Consumer Requirements

The consumer only needs:

  • .NET SDK 8.0
  • dotnet restore + dotnet build

No Node.js, npm, or global Bun installation required.

Key Files

File Responsibility
Sdk/Sdk.targets Resolves Bun from NuGet cache, compiles components
Server.csproj Resolves Bun from source tree, bundles runtime.js
Tailwind.targets Uses $(BunPath) to generate CSS
Runtime.{OS}.csproj Packages Bun executable for each platform

MSBuild Targets (Execution Order)

In SDK (consumer)

  1. ResolveBunZipPath - Finds the Bun .zip in NuGet cache
  2. EnsureBunExtracted - Extracts the executable if needed
  3. ResolveBunPath - Defines $(BunPath) for later use
  4. CompileEQuanticUI - Transpiles C# → TypeScript → JavaScript
  5. BuildCSS (Tailwind) - Generates CSS with Tailwind CLI

In Server (development)

  1. ResolveBunForServer - Finds Bun in source tree
  2. BundleRuntime - Compiles boot.ts → runtime.js

Clone this wiki locally