Skip to content

react - #1

Merged
antosubash merged 62 commits into
mainfrom
react
Mar 16, 2026
Merged

antosubash merged 62 commits into
mainfrom
react

Conversation

@antosubash

Copy link
Copy Markdown
Owner

No description provided.

antosubash and others added 30 commits March 12, 2026 00:26
Implement server-side Inertia protocol (InertiaResult + InertiaMiddleware) in Core,
React host app with per-module page resolution via dynamic imports, and full admin
CRUD for users and roles with proper authorization.

Key additions:
- Inertia protocol: X-Inertia header detection, JSON/HTML responses, version management
- React host app with import map for shared vendor bundles (react, react-dom, @inertiajs/react)
- Custom esbuild vendor bundler (build-vendors.mjs) for proper CJS→ESM conversion
- Admin users: list with search/pagination, edit details, role assignment, lock/unlock
- Admin roles: list with user counts, create, edit, delete with guard
- Per-module React page bundles (Products.pages.js, Users.pages.js)
- TypeScript type generation from C# DTOs via source generator
- 100 tests passing (including 40 new integration tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…Layout

Render Inertia HTML shell via Blazor SSR's HtmlRenderer, reusing MainLayout.razor
as the single source of truth for nav, user dropdown, and page chrome.

- Add IInertiaPageRenderer interface in Core (decouples from Blazor)
- Add InertiaShell.razor wrapping InertiaPage via LayoutView+MainLayout
- Add InertiaPageRenderer using HtmlRenderer to render InertiaShell
- Slim InertiaResult from ~130 lines of inline HTML to 3-line delegation
- Extract shared user menu JS to shell.js (used by both Blazor and Inertia)
- Replace NavigationManager with HttpContext.Request.Path in MainLayout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Refactor AdminUsersEndpoint and AdminRolesEndpoint with improved structure
- Update Inertia middleware with enhanced version handling
- Simplify React admin pages (Users, Roles, RolesCreate, RolesEdit, UsersEdit)
- Add admin nav links to ManageLayout and ManageNav
- Update Products module registration
- Update source generator with improved module discovery
- Update Vite config and package dependencies
- Update integration tests for admin endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tailwind CSS (app.css), Vite app bundle (app.js), and module page
bundles (*.pages.js) are build artifacts regenerated on every build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Modules can now contribute navbar and user dropdown menu items via
ConfigureMenu(IMenuBuilder). The source generator emits CollectModuleMenuItems()
which wires everything into a singleton IMenuRegistry. MainLayout renders
menu items dynamically instead of hardcoding links.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix Tailwind CSS v4 cascade issue by wrapping loose styles into proper
  @layer blocks (components/base), preventing them from overriding utility
  classes in module pages
- Replace standalone build-vendors.mjs script with a Vite plugin that uses
  esbuild directly for CJS→ESM vendor bundle generation
- Add RepoRoot property in Directory.Build.props to eliminate fragile
  relative paths in module csproj files
- Move vendor bundles to .gitignore as generated artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… source generator

Introduce IEndpoint interface and RoutePrefix on [Module] attribute so the source
generator auto-discovers and registers endpoints without manual wiring. Modules can
still use ConfigureEndpoints as an escape hatch for non-standard routes.

- Add IEndpoint interface to SimpleModule.Core
- Add RoutePrefix property to ModuleAttribute
- Extend source generator to discover IEndpoint implementors per module assembly
  and generate MapGroup + endpoint registration code
- Restructure Orders/Products/Users from Features/ to Endpoints/ folder layout
- Convert Orders and Products endpoints to IEndpoint (auto-discovered)
- Keep Users module using ConfigureEndpoints escape hatch for auth/admin routes
- Update CLI scaffolding (new module, new feature, doctor) for Endpoints/ pattern
- Update CLAUDE.md documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added DeleteEndpoint for Products to handle product deletion.
- Added UpdateEndpoint for Products to handle product updates.
- Created Create and Edit pages for Products with form handling.
- Implemented Manage page for displaying and managing products.
- Updated ProductService to include methods for creating, updating, and deleting products.
- Modified ProductsModule to configure new endpoints and routes for product management.
- Added integration tests for product creation, updating, and deletion.
- Introduced CreateUserRequest and UpdateUserRequest for user management.
- Implemented Create, Update, and Delete endpoints for Users.
- Enhanced UserService with methods for user creation, updating, and deletion.
- Added integration tests for user creation, updating, and deletion.
- Updated fake data generators to support new request models for products and users.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e.Blazor

Move InertiaPageRenderer, InertiaShell, InertiaPage, and DarkModeScript
from SimpleModule.Api into SimpleModule.Blazor so the rendering infrastructure
is reusable. The Api InertiaShell is now a thin wrapper that passes host-specific
content (fonts, CSS, scripts) via RenderFragment parameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
….Blazor

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…n and page resolver

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tem CSS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scaffolds the Dashboard module following the standard module pattern and
converts the Blazor Home.razor (312 LOC) to a React/Inertia component.
Also fixes @simplemodule/client ESM resolution by adding .ts extensions
and subpath exports, and applies biome formatting across all modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…uplicate shell.js

The InertiaPageRenderer defaulted to the Blazor package's InertiaShell,
missing the host's fonts, CSS, layout, and nav. Now configured to use the
host's wrapper component. Also removed duplicate shell.js script tag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Moved existing product pages (Browse, Create, Edit, Manage) to a new Views directory.
- Updated imports in index.ts to reflect new view paths.
- Created new endpoint classes for each view to handle routing.
- Removed old routing logic from ProductsModule and replaced it with new endpoint mappings.
- Added a script to extract auto-generated Pages/index.ts from ViewPages_*.g.cs files.
- Updated tests to ensure correct view discovery and routing behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…om Swagger

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
API endpoints in Endpoints/ are now auto-registered by the generator.
Form-based handlers removed — frontend should POST JSON to API endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tial class

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…artial class

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
antosubash and others added 29 commits March 16, 2026 12:22
Added all UI components (button, input, textarea, label, select,
checkbox, radio-group, switch, dialog, dropdown-menu, popover, tabs,
table, card, badge, alert, separator, spinner) using the add-component
CLI tool. Fixed SVG accessibility warnings with aria-hidden, updated
spinner to use semantic <output> element, fixed Windows compatibility
in CLI tool (shell: true for execFileSync), and excluded registry
templates from tsconfig to avoid false TS errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace raw HTML button/table elements with Button, Table, TableHeader,
TableBody, TableRow, TableHead, and TableCell from @simplemodule/ui.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace raw HTML form elements (input, label, button) with Card,
CardContent, Button, Input, and Label from @simplemodule/ui.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sible, command, hover-card, progress, scroll-area, sheet, skeleton, slider, toast, toggle, toggle-group, tooltip)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ction, Sidebar, Resizable, AspectRatio)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Radix UI's use-sync-external-store dependency references
process.env.NODE_ENV which is not available in browser bundles.
Adding the define option ensures Vite replaces it at build time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The UI component library's Tailwind classes (Button gradients,
CardHeader spacing, etc.) were not being generated because Tailwind
only scanned the modules directory, not the UI component source files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e registry exports and improve code formatting in templates
- Changed layout reference in Manage page imports to use ManageLayout directly.
- Deleted ManageNav and StatusMessage components, replacing them with new implementations in SimpleModule.Blazor.
- Updated _Imports.razor to include new namespaces for shared components.
- Refactored Authorization, Logout, and Userinfo endpoints to use new constants for routes and error messages.
- Added new constants for authentication, client configuration, and personal data keys.
- Introduced MainLayout and ManageLayout components for improved layout structure.
- Implemented new navigation and status message components for better user experience.
Each module now produces its own pre-built CSS via @tailwindcss/vite,
enabling modules distributed as NuGet packages to include styles without
requiring source .tsx files on disk. The source generator emits a
ModuleCssProvider that auto-injects module CSS <link> tags into the
Inertia shell. Host app.css no longer scans module sources directly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three issues fixed:
- Use glob pattern for @source to scan .razor files for Tailwind classes
- Wrap module CSS utilities in @layer(utilities) to prevent non-layered
  CSS from overriding the host's layered responsive utilities
- Declare correct layer order (theme, base, components, utilities) in
  module CSS to match the host's Tailwind layer ordering

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Converted static endpoint classes to instance classes implementing IEndpoint.
- Updated method signatures to accept IEndpointRouteBuilder as a parameter.
- Removed Inertia rendering from user and admin role listing endpoints.
- Added new endpoints for user personal data download and account management features.
- Introduced new view endpoints for roles and users management in the admin section.
- Enhanced authorization requirements for admin endpoints.
- Cleaned up unused code and organized endpoint mappings for better maintainability.
Move src/ into cli/, framework/, modules/, packages/, and template/ directories.
Add missing version fields to all workspace package.json files to fix npm
semver errors. Add @rollup/rollup-win32-arm64-msvc for ARM64 Windows support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@antosubash
antosubash merged commit acabd34 into main Mar 16, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant