From 8042108f1c5125ab02f5ee0e4bea1c08c7a9e036 Mon Sep 17 00:00:00 2001 From: Anto Subash Date: Thu, 26 Mar 2026 21:34:58 +0100 Subject: [PATCH] feat: add CI/CD workflows with NuGet and npm publishing --- .github/workflows/ci.yml | 99 +++-------- .github/workflows/release.yml | 160 ++++++++++++++++++ Directory.Build.props | 10 ++ biome.json | 25 +-- framework/Directory.Build.props | 10 ++ framework/SimpleModule.Blazor/README.md | 30 ++++ .../SimpleModule.Blazor.csproj | 3 +- framework/SimpleModule.Core/README.md | 37 ++++ .../SimpleModule.Core.csproj | 5 +- framework/SimpleModule.Database/README.md | 32 ++++ .../SimpleModule.Database.csproj | 5 +- framework/SimpleModule.DevTools/README.md | 30 ++++ .../SimpleModule.DevTools.csproj | 3 +- framework/SimpleModule.Generator/README.md | 42 +++++ .../SimpleModule.Generator.csproj | 3 +- framework/SimpleModule.Hosting/README.md | 33 ++++ .../SimpleModule.Hosting.csproj | 3 +- .../SimpleModule.Storage.Azure/README.md | 31 ++++ .../SimpleModule.Storage.Azure.csproj | 1 + .../SimpleModule.Storage.Local/README.md | 30 ++++ .../SimpleModule.Storage.Local.csproj | 1 + framework/SimpleModule.Storage.S3/README.md | 31 ++++ .../SimpleModule.Storage.S3.csproj | 1 + framework/SimpleModule.Storage/README.md | 41 +++++ .../SimpleModule.Storage.csproj | 1 + package-lock.json | 28 ++- packages/SimpleModule.Client/README.md | 42 +++++ packages/SimpleModule.Client/package.json | 1 - packages/SimpleModule.Theme.Default/README.md | 29 ++++ .../SimpleModule.Theme.Default/package.json | 1 - packages/SimpleModule.UI/README.md | 37 ++++ packages/SimpleModule.UI/package.json | 1 - version.json | 1 + 33 files changed, 700 insertions(+), 107 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 framework/Directory.Build.props create mode 100644 framework/SimpleModule.Blazor/README.md create mode 100644 framework/SimpleModule.Core/README.md create mode 100644 framework/SimpleModule.Database/README.md create mode 100644 framework/SimpleModule.DevTools/README.md create mode 100644 framework/SimpleModule.Generator/README.md create mode 100644 framework/SimpleModule.Hosting/README.md create mode 100644 framework/SimpleModule.Storage.Azure/README.md create mode 100644 framework/SimpleModule.Storage.Local/README.md create mode 100644 framework/SimpleModule.Storage.S3/README.md create mode 100644 framework/SimpleModule.Storage/README.md create mode 100644 packages/SimpleModule.Client/README.md create mode 100644 packages/SimpleModule.Theme.Default/README.md create mode 100644 packages/SimpleModule.UI/README.md create mode 100644 version.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7caa756d..af49a6ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,31 +6,31 @@ on: pull_request: branches: [main] +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: - build: + lint: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - dotnet-version: '10.0.x' + node-version: '22' + cache: 'npm' - - name: Download Tailwind CSS - run: bash tools/download-tailwind.sh - - - name: Restore - run: dotnet restore + - name: Install npm dependencies + run: npm ci - - name: Build - run: dotnet build --no-restore + - name: Lint and format check + run: npm run check - test-sqlite: + build: runs-on: ubuntu-latest - needs: build - + needs: lint steps: - uses: actions/checkout@v4 @@ -39,68 +39,23 @@ jobs: with: dotnet-version: '10.0.x' - - name: Download Tailwind CSS - run: bash tools/download-tailwind.sh - - - name: Test - run: dotnet test --verbosity normal - - test-postgresql: - runs-on: ubuntu-latest - needs: build - - services: - postgres: - image: postgres:16 - env: - POSTGRES_USER: test - POSTGRES_PASSWORD: test - POSTGRES_DB: simplemodule_test - ports: - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - dotnet-version: '10.0.x' + node-version: '22' + cache: 'npm' - name: Download Tailwind CSS run: bash tools/download-tailwind.sh - - name: Test with PostgreSQL - run: dotnet test --verbosity normal - env: - Database__DefaultConnection: "Host=localhost;Database=simplemodule_test;Username=test;Password=test" - - - name: Verify migrations are up-to-date - working-directory: template/SimpleModule.Host - env: - Database__DefaultConnection: "Host=localhost;Database=simplemodule_test;Username=test;Password=test" - run: dotnet ef migrations has-pending-model-changes - - publish: - runs-on: ubuntu-latest - needs: [test-sqlite, test-postgresql] - if: github.ref == 'refs/heads/main' - - steps: - - uses: actions/checkout@v4 + - name: Restore .NET + run: dotnet restore - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' + - name: Build .NET + run: dotnet build --no-restore - - name: Download Tailwind CSS - run: bash tools/download-tailwind.sh + - name: Install npm dependencies + run: npm ci - - name: Publish - run: dotnet publish template/SimpleModule.Host/SimpleModule.Host.csproj -c Release + - name: Build frontend + run: npm run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d17b41b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,160 @@ +name: Release + +on: + workflow_dispatch: + inputs: + bump: + description: 'Version bump type' + required: true + default: 'patch' + type: choice + options: + - patch + - minor + - major + + workflow_run: + workflows: [CI] + types: [completed] + branches: [main] + +concurrency: + group: release + cancel-in-progress: false + +permissions: + contents: write + +jobs: + version: + runs-on: ubuntu-latest + if: >- + github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'main') + outputs: + version: ${{ steps.bump.outputs.version }} + skip: ${{ steps.check.outputs.skip }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Check if release commit + id: check + run: | + # For workflow_run, check the commit that triggered CI (not current HEAD) + if [ "${{ github.event_name }}" = "workflow_run" ]; then + SHA="${{ github.event.workflow_run.head_sha }}" + else + SHA="HEAD" + fi + MSG=$(git log -1 --pretty=%s "$SHA") + if [[ "$MSG" == release:* ]]; then + echo "skip=true" >> "$GITHUB_OUTPUT" + echo "Skipping: commit $SHA is a release commit" + else + echo "skip=false" >> "$GITHUB_OUTPUT" + fi + + - name: Determine bump type + if: steps.check.outputs.skip != 'true' + id: bump-type + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "bump=${{ inputs.bump }}" >> "$GITHUB_OUTPUT" + else + echo "bump=patch" >> "$GITHUB_OUTPUT" + fi + + - name: Bump version + if: steps.check.outputs.skip != 'true' + id: bump + run: | + CURRENT=$(jq -r .version version.json) + IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" + + BUMP="${{ steps.bump-type.outputs.bump }}" + case "$BUMP" in + major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;; + minor) MINOR=$((MINOR + 1)); PATCH=0 ;; + patch) PATCH=$((PATCH + 1)) ;; + esac + + NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}" + jq -n --arg v "$NEW_VERSION" '{"version": $v}' > version.json + echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT" + echo "Bumped $CURRENT -> $NEW_VERSION ($BUMP)" + + - name: Commit and tag + if: steps.check.outputs.skip != 'true' + run: | + VERSION="${{ steps.bump.outputs.version }}" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add version.json + git commit -m "release: v${VERSION}" + git tag "v${VERSION}" + git push origin main --follow-tags + + publish-nuget: + runs-on: ubuntu-latest + needs: version + if: needs.version.outputs.skip != 'true' + steps: + - uses: actions/checkout@v4 + with: + ref: v${{ needs.version.outputs.version }} + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.0.x' + + - name: Download Tailwind CSS + run: bash tools/download-tailwind.sh + + - name: Restore + run: dotnet restore + + - name: Pack + run: | + VERSION="${{ needs.version.outputs.version }}" + for csproj in framework/*/*.csproj; do + dotnet pack "$csproj" -c Release -p:Version=$VERSION --no-restore -o ./nupkgs + done + + - name: Push to NuGet + run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate + + publish-npm: + runs-on: ubuntu-latest + needs: version + if: needs.version.outputs.skip != 'true' + steps: + - uses: actions/checkout@v4 + with: + ref: v${{ needs.version.outputs.version }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Build frontend + run: npm run build + + - name: Set version and publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + VERSION="${{ needs.version.outputs.version }}" + for pkg in packages/SimpleModule.Client packages/SimpleModule.UI packages/SimpleModule.Theme.Default; do + (cd "$pkg" && npm version "$VERSION" --no-git-tag-version && npm publish --access public) + done diff --git a/Directory.Build.props b/Directory.Build.props index 0a22021b..853974b7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -16,6 +16,16 @@ true + + + SimpleModule + MIT + https://github.com/antosubash/SimpleModule + https://github.com/antosubash/SimpleModule + git + modular-monolith;aspnetcore;blazor;react;inertia + Copyright (c) SimpleModule contributors + latest-all diff --git a/biome.json b/biome.json index 18588aad..450cc98d 100644 --- a/biome.json +++ b/biome.json @@ -38,23 +38,14 @@ } } }, - "overrides": [ - { - "includes": ["modules/*/src/*/types.ts"], - "linter": { - "rules": { - "suspicious": { - "noExplicitAny": "off" - }, - "complexity": { - "noBannedTypes": "off", - "noEmptyTypeParameters": "off" - } - } - } - } - ], "files": { - "includes": ["modules/**", "packages/**", "template/**", "tests/**", "!**/wwwroot"] + "includes": [ + "modules/**", + "packages/**", + "template/**", + "tests/**", + "!**/wwwroot", + "!**/types.ts" + ] } } diff --git a/framework/Directory.Build.props b/framework/Directory.Build.props new file mode 100644 index 00000000..cdf0bfc4 --- /dev/null +++ b/framework/Directory.Build.props @@ -0,0 +1,10 @@ + + + + true + README.md + + + + + diff --git a/framework/SimpleModule.Blazor/README.md b/framework/SimpleModule.Blazor/README.md new file mode 100644 index 00000000..2a75568f --- /dev/null +++ b/framework/SimpleModule.Blazor/README.md @@ -0,0 +1,30 @@ +# SimpleModule.Blazor + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Blazor.svg)](https://www.nuget.org/packages/SimpleModule.Blazor) + +Blazor SSR integration for SimpleModule, bridging server-side rendering with Inertia.js and React. + +## Installation + +```bash +dotnet add package SimpleModule.Blazor +``` + +## Quick Start + +The Blazor package is automatically configured when using SimpleModule.Hosting. It provides the SSR shell that renders the initial HTML page with Inertia.js props for React hydration. + +```csharp +// In an endpoint: +return Inertia.Render("Products/Browse", new { Products = products }); +``` + +## Key Features + +- **Blazor SSR shell** renders the initial HTML with embedded JSON props +- **Inertia.js middleware** bridges ASP.NET responses to React client navigation +- **Razor component discovery** for module-provided Blazor components + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Blazor/SimpleModule.Blazor.csproj b/framework/SimpleModule.Blazor/SimpleModule.Blazor.csproj index 456c0153..36426b50 100644 --- a/framework/SimpleModule.Blazor/SimpleModule.Blazor.csproj +++ b/framework/SimpleModule.Blazor/SimpleModule.Blazor.csproj @@ -1,8 +1,7 @@ net10.0 - true - 0.1.0-local + Blazor SSR integration for SimpleModule. Bridges Blazor server-side rendering with Inertia.js and React frontend. diff --git a/framework/SimpleModule.Core/README.md b/framework/SimpleModule.Core/README.md new file mode 100644 index 00000000..e800f79a --- /dev/null +++ b/framework/SimpleModule.Core/README.md @@ -0,0 +1,37 @@ +# SimpleModule.Core + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Core.svg)](https://www.nuget.org/packages/SimpleModule.Core) + +Core interfaces and attributes for the SimpleModule modular monolith framework. + +## Installation + +```bash +dotnet add package SimpleModule.Core +``` + +## Quick Start + +```csharp +[Module("Products", RoutePrefix = "products")] +public sealed class ProductsModule : IModule +{ + public void ConfigureServices(IServiceCollection services) + { + // Register module services + } +} +``` + +## Key Features + +- **IModule** interface for defining self-contained modules +- **IEndpoint** interface for auto-discovered Minimal API endpoints +- **[Dto]** attribute for cross-module data transfer types with TypeScript generation +- **IEventBus** for decoupled module-to-module communication +- **IMenuRegistry** for dynamic navigation menu registration +- **Inertia.js integration** for server-driven React page rendering + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Core/SimpleModule.Core.csproj b/framework/SimpleModule.Core/SimpleModule.Core.csproj index b7ebe8e5..eafe3ebc 100644 --- a/framework/SimpleModule.Core/SimpleModule.Core.csproj +++ b/framework/SimpleModule.Core/SimpleModule.Core.csproj @@ -2,11 +2,10 @@ net10.0 Library - true - 0.1.0-local + Core interfaces and attributes for SimpleModule modular monolith framework. Includes IModule, IEndpoint, [Dto], event bus, menu system, and Inertia.js integration. - + diff --git a/framework/SimpleModule.Database/README.md b/framework/SimpleModule.Database/README.md new file mode 100644 index 00000000..c6d24e11 --- /dev/null +++ b/framework/SimpleModule.Database/README.md @@ -0,0 +1,32 @@ +# SimpleModule.Database + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Database.svg)](https://www.nuget.org/packages/SimpleModule.Database) + +Multi-provider database support for SimpleModule with schema isolation per module. + +## Installation + +```bash +dotnet add package SimpleModule.Database +``` + +## Quick Start + +```csharp +public sealed class ProductsDbContext : ModuleDbContext +{ + public DbSet Products => Set(); +} +``` + +## Key Features + +- **Schema isolation** -- each module gets its own database schema (or table prefix for SQLite) +- **SQLite** support for development and lightweight deployments +- **PostgreSQL** support for production workloads +- **SQL Server** support for enterprise environments +- **EF Core** integration with per-module DbContext registration + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Database/SimpleModule.Database.csproj b/framework/SimpleModule.Database/SimpleModule.Database.csproj index 4533a4b6..d32eee98 100644 --- a/framework/SimpleModule.Database/SimpleModule.Database.csproj +++ b/framework/SimpleModule.Database/SimpleModule.Database.csproj @@ -2,12 +2,11 @@ net10.0 Library - true - 0.1.0-local + Multi-provider database support for SimpleModule. Schema isolation per module with SQLite, PostgreSQL, and SQL Server providers. - + diff --git a/framework/SimpleModule.DevTools/README.md b/framework/SimpleModule.DevTools/README.md new file mode 100644 index 00000000..316da38a --- /dev/null +++ b/framework/SimpleModule.DevTools/README.md @@ -0,0 +1,30 @@ +# SimpleModule.DevTools + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.DevTools.svg)](https://www.nuget.org/packages/SimpleModule.DevTools) + +Development-time tooling for SimpleModule, including Vite dev watch and diagnostics. + +## Installation + +```bash +dotnet add package SimpleModule.DevTools +``` + +## Quick Start + +DevTools is automatically included when you reference SimpleModule.Hosting. During development, it provides: + +```bash +npm run dev +# Starts ASP.NET backend + Vite watch for all modules +``` + +## Key Features + +- **Vite dev watch service** -- auto-rebuilds module frontend assets on file changes +- **Diagnostics** -- development-time health checks and module status reporting +- **Hot reload support** -- works with .NET hot reload and Vite HMR + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.DevTools/SimpleModule.DevTools.csproj b/framework/SimpleModule.DevTools/SimpleModule.DevTools.csproj index b5faa767..dadf23a0 100644 --- a/framework/SimpleModule.DevTools/SimpleModule.DevTools.csproj +++ b/framework/SimpleModule.DevTools/SimpleModule.DevTools.csproj @@ -2,8 +2,7 @@ net10.0 Library - true - 0.1.0-local + Development-time tooling for SimpleModule. Includes Vite dev watch service and diagnostics for local development. diff --git a/framework/SimpleModule.Generator/README.md b/framework/SimpleModule.Generator/README.md new file mode 100644 index 00000000..4d231f09 --- /dev/null +++ b/framework/SimpleModule.Generator/README.md @@ -0,0 +1,42 @@ +# SimpleModule.Generator + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Generator.svg)](https://www.nuget.org/packages/SimpleModule.Generator) + +Roslyn source generator that auto-discovers modules, endpoints, and DTOs at compile time. + +## Installation + +```bash +dotnet add package SimpleModule.Generator +``` + +## Quick Start + +The generator runs automatically at build time. Reference it in your host project and call the generated extension methods: + +```csharp +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddModules(); // Generated method + +var app = builder.Build(); +app.MapModuleEndpoints(); // Generated method +``` + +## What It Generates + +- **AddModules()** -- registers all discovered module services +- **MapModuleEndpoints()** -- maps all IEndpoint implementations +- **CollectModuleMenuItems()** -- gathers menu registrations from all modules +- **JSON serializer contexts** for all [Dto] types +- **TypeScript interface definitions** embedded as resources +- **Razor component assembly discovery** for Blazor SSR + +## Key Features + +- Compile-time module discovery with zero runtime reflection +- Incremental generation via Roslyn IIncrementalGenerator +- Targets netstandard2.0 for broad analyzer compatibility + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Generator/SimpleModule.Generator.csproj b/framework/SimpleModule.Generator/SimpleModule.Generator.csproj index 0ac228ba..d19208b6 100644 --- a/framework/SimpleModule.Generator/SimpleModule.Generator.csproj +++ b/framework/SimpleModule.Generator/SimpleModule.Generator.csproj @@ -3,8 +3,7 @@ netstandard2.0 latest true - true - 0.1.0-local + Roslyn source generator for SimpleModule. Auto-discovers modules, endpoints, and DTOs at compile time. Generates registration methods, JSON serializers, and TypeScript definitions. false true $(NoWarn);NU5128 diff --git a/framework/SimpleModule.Hosting/README.md b/framework/SimpleModule.Hosting/README.md new file mode 100644 index 00000000..bdc47c25 --- /dev/null +++ b/framework/SimpleModule.Hosting/README.md @@ -0,0 +1,33 @@ +# SimpleModule.Hosting + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Hosting.svg)](https://www.nuget.org/packages/SimpleModule.Hosting) + +Host builder extensions for SimpleModule that configure module registration, endpoint mapping, and the middleware pipeline. + +## Installation + +```bash +dotnet add package SimpleModule.Hosting +``` + +## Quick Start + +```csharp +var builder = WebApplication.CreateBuilder(args); +builder.AddSimpleModule(); + +var app = builder.Build(); +app.UseSimpleModule(); +app.Run(); +``` + +## Key Features + +- **AddSimpleModule()** registers all framework services, modules, and database providers +- **UseSimpleModule()** configures middleware, maps endpoints, and sets up Inertia.js +- **Swagger/OpenAPI** integration via Swashbuckle +- **MSBuild targets** for build-time module wiring + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Hosting/SimpleModule.Hosting.csproj b/framework/SimpleModule.Hosting/SimpleModule.Hosting.csproj index e437a1f1..d03d705e 100644 --- a/framework/SimpleModule.Hosting/SimpleModule.Hosting.csproj +++ b/framework/SimpleModule.Hosting/SimpleModule.Hosting.csproj @@ -2,8 +2,7 @@ net10.0 Library - true - 0.1.0-local + Host builder extensions for SimpleModule. Configures module registration, endpoint mapping, and middleware pipeline. diff --git a/framework/SimpleModule.Storage.Azure/README.md b/framework/SimpleModule.Storage.Azure/README.md new file mode 100644 index 00000000..370b5d6f --- /dev/null +++ b/framework/SimpleModule.Storage.Azure/README.md @@ -0,0 +1,31 @@ +# SimpleModule.Storage.Azure + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Storage.Azure.svg)](https://www.nuget.org/packages/SimpleModule.Storage.Azure) + +Azure Blob Storage provider for SimpleModule.Storage. + +## Installation + +```bash +dotnet add package SimpleModule.Storage.Azure +``` + +## Quick Start + +```csharp +builder.Services.AddAzureBlobStorage(options => +{ + options.ConnectionString = "your-connection-string"; + options.ContainerName = "uploads"; +}); +``` + +## Key Features + +- **Upload, download, list, and delete** files in Azure Blob containers +- **Implements IStorageProvider** from SimpleModule.Storage +- **Azure SDK** integration via Azure.Storage.Blobs + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Storage.Azure/SimpleModule.Storage.Azure.csproj b/framework/SimpleModule.Storage.Azure/SimpleModule.Storage.Azure.csproj index 2ecb3afc..9bb6669d 100644 --- a/framework/SimpleModule.Storage.Azure/SimpleModule.Storage.Azure.csproj +++ b/framework/SimpleModule.Storage.Azure/SimpleModule.Storage.Azure.csproj @@ -2,6 +2,7 @@ net10.0 Library + Azure Blob Storage provider for SimpleModule.Storage. Upload, download, list, and delete files in Azure Blob containers. diff --git a/framework/SimpleModule.Storage.Local/README.md b/framework/SimpleModule.Storage.Local/README.md new file mode 100644 index 00000000..d9171d52 --- /dev/null +++ b/framework/SimpleModule.Storage.Local/README.md @@ -0,0 +1,30 @@ +# SimpleModule.Storage.Local + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Storage.Local.svg)](https://www.nuget.org/packages/SimpleModule.Storage.Local) + +Local filesystem storage provider for SimpleModule.Storage. + +## Installation + +```bash +dotnet add package SimpleModule.Storage.Local +``` + +## Quick Start + +```csharp +builder.Services.AddLocalStorage(options => +{ + options.RootPath = Path.Combine(builder.Environment.ContentRootPath, "uploads"); +}); +``` + +## Key Features + +- **Stores files on the local disk** for development and single-server deployments +- **Implements IStorageProvider** from SimpleModule.Storage +- **Zero external dependencies** -- no cloud SDK required + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Storage.Local/SimpleModule.Storage.Local.csproj b/framework/SimpleModule.Storage.Local/SimpleModule.Storage.Local.csproj index 01b3a0b2..9c999b04 100644 --- a/framework/SimpleModule.Storage.Local/SimpleModule.Storage.Local.csproj +++ b/framework/SimpleModule.Storage.Local/SimpleModule.Storage.Local.csproj @@ -2,6 +2,7 @@ net10.0 Library + Local filesystem storage provider for SimpleModule.Storage. Stores files on the local disk for development and single-server deployments. diff --git a/framework/SimpleModule.Storage.S3/README.md b/framework/SimpleModule.Storage.S3/README.md new file mode 100644 index 00000000..2c4bdf91 --- /dev/null +++ b/framework/SimpleModule.Storage.S3/README.md @@ -0,0 +1,31 @@ +# SimpleModule.Storage.S3 + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Storage.S3.svg)](https://www.nuget.org/packages/SimpleModule.Storage.S3) + +AWS S3 storage provider for SimpleModule.Storage. + +## Installation + +```bash +dotnet add package SimpleModule.Storage.S3 +``` + +## Quick Start + +```csharp +builder.Services.AddS3Storage(options => +{ + options.BucketName = "my-app-uploads"; + options.Region = "us-east-1"; +}); +``` + +## Key Features + +- **Upload, download, list, and delete** files in S3 buckets +- **Implements IStorageProvider** from SimpleModule.Storage +- **AWS SDK** integration via AWSSDK.S3 + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Storage.S3/SimpleModule.Storage.S3.csproj b/framework/SimpleModule.Storage.S3/SimpleModule.Storage.S3.csproj index 711d0f01..3f592848 100644 --- a/framework/SimpleModule.Storage.S3/SimpleModule.Storage.S3.csproj +++ b/framework/SimpleModule.Storage.S3/SimpleModule.Storage.S3.csproj @@ -2,6 +2,7 @@ net10.0 Library + AWS S3 storage provider for SimpleModule.Storage. Upload, download, list, and delete files in S3 buckets. diff --git a/framework/SimpleModule.Storage/README.md b/framework/SimpleModule.Storage/README.md new file mode 100644 index 00000000..11643764 --- /dev/null +++ b/framework/SimpleModule.Storage/README.md @@ -0,0 +1,41 @@ +# SimpleModule.Storage + +[![NuGet](https://img.shields.io/nuget/v/SimpleModule.Storage.svg)](https://www.nuget.org/packages/SimpleModule.Storage) + +Storage abstraction for SimpleModule with a pluggable provider interface for file storage backends. + +## Installation + +```bash +dotnet add package SimpleModule.Storage +``` + +## Quick Start + +```csharp +public class MyService(IStorageProvider storage) +{ + public async Task UploadAsync(Stream file, string path) + { + await storage.UploadAsync(path, file); + } +} +``` + +## Available Providers + +| Provider | Package | +|----------|---------| +| Local filesystem | `SimpleModule.Storage.Local` | +| Azure Blob Storage | `SimpleModule.Storage.Azure` | +| AWS S3 | `SimpleModule.Storage.S3` | + +## Key Features + +- **IStorageProvider** interface for upload, download, list, and delete operations +- **Provider-agnostic** -- swap storage backends without changing application code +- **Stream-based API** for efficient large file handling + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/framework/SimpleModule.Storage/SimpleModule.Storage.csproj b/framework/SimpleModule.Storage/SimpleModule.Storage.csproj index 6504fa4c..6ad03b93 100644 --- a/framework/SimpleModule.Storage/SimpleModule.Storage.csproj +++ b/framework/SimpleModule.Storage/SimpleModule.Storage.csproj @@ -2,5 +2,6 @@ net10.0 Library + Storage abstraction for SimpleModule. Defines IStorageProvider interface for pluggable file storage backends. diff --git a/package-lock.json b/package-lock.json index b98308ec..f857e5a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,6 +53,14 @@ "react-dom": "^19.0.0" } }, + "modules/FileStorage/src/FileStorage": { + "name": "@simplemodule/filestorage", + "version": "0.0.0", + "peerDependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0" + } + }, "modules/OpenIddict/src/OpenIddict": { "name": "@simplemodule/openiddict", "version": "0.0.0", @@ -135,6 +143,7 @@ "version": "7.29.0", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -1073,6 +1082,7 @@ "node_modules/@inertiajs/react": { "version": "2.3.18", "license": "MIT", + "peer": true, "dependencies": { "@inertiajs/core": "2.3.18", "@types/lodash-es": "^4.17.12", @@ -2925,6 +2935,10 @@ "resolved": "tests/e2e", "link": true }, + "node_modules/@simplemodule/filestorage": { + "resolved": "modules/FileStorage/src/FileStorage", + "link": true + }, "node_modules/@simplemodule/openiddict": { "resolved": "modules/OpenIddict/src/OpenIddict", "link": true @@ -3375,6 +3389,7 @@ "version": "19.2.14", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -3383,6 +3398,7 @@ "version": "19.2.3", "devOptional": true, "license": "MIT", + "peer": true, "peerDependencies": { "@types/react": "^19.2.0" } @@ -3484,6 +3500,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -3937,6 +3954,7 @@ "version": "0.25.12", "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -4173,6 +4191,7 @@ "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz", "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==", "license": "MIT", + "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/immer" @@ -4641,6 +4660,7 @@ "node_modules/picomatch": { "version": "4.0.3", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -4763,6 +4783,7 @@ "node_modules/react": { "version": "19.2.4", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -4792,6 +4813,7 @@ "node_modules/react-dom": { "version": "19.2.4", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -4821,6 +4843,7 @@ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz", "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==", "license": "MIT", + "peer": true, "dependencies": { "@types/use-sync-external-store": "^0.0.6", "use-sync-external-store": "^1.4.0" @@ -4944,7 +4967,8 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/redux-thunk": { "version": "3.1.0", @@ -5294,6 +5318,7 @@ "node_modules/use-sync-external-store": { "version": "1.6.0", "license": "MIT", + "peer": true, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } @@ -5336,6 +5361,7 @@ "node_modules/vite": { "version": "6.4.1", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", diff --git a/packages/SimpleModule.Client/README.md b/packages/SimpleModule.Client/README.md new file mode 100644 index 00000000..3fdadb0e --- /dev/null +++ b/packages/SimpleModule.Client/README.md @@ -0,0 +1,42 @@ +# @simplemodule/client + +[![npm](https://img.shields.io/npm/v/@simplemodule/client.svg)](https://www.npmjs.com/package/@simplemodule/client) + +Vite plugin and utilities for building SimpleModule frontend modules. + +## Installation + +```bash +npm install @simplemodule/client +``` + +## Quick Start + +```typescript +// vite.config.ts +import { defineModuleConfig } from '@simplemodule/client/module'; + +export default defineModuleConfig({ + moduleName: 'Products', +}); +``` + +```typescript +// app.tsx +import { resolvePage } from '@simplemodule/client/resolve-page'; + +createInertiaApp({ + resolve: resolvePage, + // ... +}); +``` + +## Key Features + +- **defineModuleConfig** -- Vite configuration factory for module library builds +- **resolvePage** -- dynamic page resolver that loads module bundles by route name +- **Vite vendor plugin** -- bundles shared dependencies (React, Inertia) for module consumption + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/packages/SimpleModule.Client/package.json b/packages/SimpleModule.Client/package.json index 82b71240..0ce930d9 100644 --- a/packages/SimpleModule.Client/package.json +++ b/packages/SimpleModule.Client/package.json @@ -1,5 +1,4 @@ { - "private": true, "name": "@simplemodule/client", "version": "0.0.0", "type": "module", diff --git a/packages/SimpleModule.Theme.Default/README.md b/packages/SimpleModule.Theme.Default/README.md new file mode 100644 index 00000000..38eb495f --- /dev/null +++ b/packages/SimpleModule.Theme.Default/README.md @@ -0,0 +1,29 @@ +# @simplemodule/theme-default + +[![npm](https://img.shields.io/npm/v/@simplemodule/theme-default.svg)](https://www.npmjs.com/package/@simplemodule/theme-default) + +Default Tailwind CSS theme for SimpleModule applications. + +## Installation + +```bash +npm install @simplemodule/theme-default +``` + +## Quick Start + +Import the theme CSS in your application entry point: + +```typescript +import '@simplemodule/theme-default/theme.css'; +``` + +## Key Features + +- **Base Tailwind CSS theme** with CSS custom properties for colors, spacing, and typography +- **Light and dark mode** support via CSS variables +- **Designed for @simplemodule/ui** -- provides the default styling for all UI components + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/packages/SimpleModule.Theme.Default/package.json b/packages/SimpleModule.Theme.Default/package.json index ff74820a..e87ce0a4 100644 --- a/packages/SimpleModule.Theme.Default/package.json +++ b/packages/SimpleModule.Theme.Default/package.json @@ -1,5 +1,4 @@ { - "private": true, "name": "@simplemodule/theme-default", "version": "0.0.0", "main": "theme.css" diff --git a/packages/SimpleModule.UI/README.md b/packages/SimpleModule.UI/README.md new file mode 100644 index 00000000..2a2b1807 --- /dev/null +++ b/packages/SimpleModule.UI/README.md @@ -0,0 +1,37 @@ +# @simplemodule/ui + +[![npm](https://img.shields.io/npm/v/@simplemodule/ui.svg)](https://www.npmjs.com/package/@simplemodule/ui) + +Pre-built React UI component library for SimpleModule, built on Radix UI primitives with Tailwind CSS styling. + +## Installation + +```bash +npm install @simplemodule/ui +``` + +## Quick Start + +```tsx +import { Button } from '@simplemodule/ui/components'; +import { cn } from '@simplemodule/ui/lib/utils'; + +export function MyPage() { + return ; +} +``` + +## Components + +Accordion, Alert, AspectRatio, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Chart, Checkbox, Collapsible, Command, Container, DataGrid, DataGridPage, DatePicker, Dialog, DropdownMenu, Field, Grid, HoverCard, Input, Label, PageHeader, PageShell, Popover, Progress, RadioGroup, Resizable, ScrollArea, Section, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Spinner, Stack, Switch, Table, Tabs, Textarea, Toast, Toggle, ToggleGroup, Tooltip + +## Key Features + +- **48 components** built on Radix UI primitives +- **Tailwind CSS** styling with full theme customization +- **Accessible** -- ARIA-compliant via Radix UI +- **Tree-shakeable** -- import only what you use + +## Links + +- [GitHub Repository](https://github.com/antosubash/SimpleModule) diff --git a/packages/SimpleModule.UI/package.json b/packages/SimpleModule.UI/package.json index 0287159b..bf105794 100644 --- a/packages/SimpleModule.UI/package.json +++ b/packages/SimpleModule.UI/package.json @@ -1,5 +1,4 @@ { - "private": true, "name": "@simplemodule/ui", "version": "0.0.0", "type": "module", diff --git a/version.json b/version.json new file mode 100644 index 00000000..5f37da13 --- /dev/null +++ b/version.json @@ -0,0 +1 @@ +{ "version": "0.0.1" }