Skip to content

Improve Cratis Web template with @cratis/components, proper Workbench-style configuration, and complete sample feature#2

Merged
einari merged 4 commits intotemplatesfrom
copilot/sub-pr-1
Mar 1, 2026
Merged

Improve Cratis Web template with @cratis/components, proper Workbench-style configuration, and complete sample feature#2
einari merged 4 commits intotemplatesfrom
copilot/sub-pr-1

Conversation

Copy link

Copilot AI commented Mar 1, 2026

  • Analyze existing template structure and Chronicle Workbench PR #2695
  • Fix C# namespaces (AnAppCratisApp) and add GlobalUsings.cs
  • Update Listing.cs with IMongoCollection<Listing>.Observe() + IProjectionFor<Listing> projection
  • Fix appsettings.json route configuration (SegmentsToSkipForRoute: 2) to match proxy generator
  • Update package.json with all required dependencies (@cratis/components, @cratis/arc.*, PrimeReact, mobx, etc.)
  • Update vite.config.ts with EmitMetadataPlugin, tailwindcss plugin, and path aliases (ApiFeatures)
  • Update tsconfig.json with decorator support (experimentalDecorators, emitDecoratorMetadata) and path aliases
  • Update index.css to import PrimeReact theme and Tailwind CSS
  • Create Bindings.ts for MVVM initialization
  • Update main.tsx with PrimeReactProvider, Bindings, and mobx setup
  • Update App.tsx with BrowserRouter, DialogComponents (using @cratis/components/Dialogs)
  • Create Features/SomeFeature/SomeFeature.tsx with DataTableForObservableQuery and CommandDialog
  • Create generated proxy files: Register.ts (command), Listing.ts (read model type), AllListings.ts (observable query)
  • Simplify template.json post-actions (add Cratis.Arc.MongoDB, single yarn install)
  • Add package.json exclusion to CratisApp.csproj
  • Fix CI: Add <IncludeBuildOutput>false</IncludeBuildOutput> to Cratis.Templates.csproj so dotnet pack --no-build works
  • Fix CI: Fix Listing.cs to use IMongoCollection<Listing>.Observe() (correct ISubject<IEnumerable<T>> return type)
  • Fix CI: Add global using MongoDB.Driver to GlobalUsings.cs

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…rvableQuery, CommandDialog

Co-authored-by: einari <134365+einari@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 1, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.npmjs.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update web template configuration based on Chronicle Workbench Improve Cratis Web template with @cratis/components, proper Workbench-style configuration, and complete sample feature Mar 1, 2026
@einari
Copy link
Contributor

einari commented Mar 1, 2026

@copilot fix the build

@einari
Copy link
Contributor

einari commented Mar 1, 2026

Also, let's drop the Arc.MVVM package and MobX for this - which means dropping the Bindings.ts file also.

…ve() for observable queries

Co-authored-by: einari <134365+einari@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 1, 2026

@copilot fix the build

Fixed in commit 8c6d92a. Two issues were causing the build to fail:

  1. NU5026: Cratis.Templates.dll not found — The workflow runs dotnet pack --no-build without a prior dotnet build. Added <IncludeBuildOutput>false</IncludeBuildOutput> to Cratis.Templates.csproj, which is the standard fix for template-only NuGet packages that contain content (not compiled code).

  2. CS0266 in Listing.csIReadModels.Watch<T>() returns IObservable<ReadModelChangeset<T>>, not ISubject<IEnumerable<T>>. Updated to use the established Cratis pattern IMongoCollection<Listing>.Observe() from Cratis.Arc.MongoDB (matching the Samples Library approach). Added Cratis.Arc.MongoDB as a post-action package and global using MongoDB.Driver to GlobalUsings.cs.

@einari einari marked this pull request as ready for review March 1, 2026 17:45
@einari einari merged commit a4423b2 into templates Mar 1, 2026
2 of 3 checks passed
@einari einari deleted the copilot/sub-pr-1 branch March 1, 2026 17:47
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.

2 participants