fix: enable Scala syntax highlighting in documentation site#584
Open
g-dumas wants to merge 58 commits into
Open
fix: enable Scala syntax highlighting in documentation site#584g-dumas wants to merge 58 commits into
g-dumas wants to merge 58 commits into
Conversation
* Add CLAUDE.md with project guidance Provides development setup, build commands, project structure, and module documentation for working with the Edomata codebase. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * Enrich tutorials for non-expert developers Add beginner-friendly explanations throughout all 5 tutorials: - 0_getting_started: Problem statement, architecture diagram, aggregate and pure function explanations, Edomaton vs Stomaton decision guide - 1-1_eventsourcing: Event sourcing intro, Decision analogy, Scala syntax notes, ValidatedNec and fold explanations, testing benefits - 1-2_cqrs: CQRS intro, state diagrams, EitherNec vs Decision comparison, Stomaton vs Edomaton decision matrix - 2_backends: Backend concept, program/interpreter pattern, persistence tables explained, outbox and idempotency, minimal setup example - 3_processes: Process intro, outbox pattern diagram, stream explanation, process manager and saga patterns with examples Each technical term now includes real-world analogies and practical context for developers unfamiliar with Scala, event sourcing, DDD, or CQRS concepts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Convert ASCII diagrams to Mermaid in tutorials Replace ASCII art diagrams with Mermaid for better rendering: - 0_getting_started: Layer architecture flowchart - 1-2_cqrs: Traditional vs CQRS comparison, order state diagram - 2_backends: Pure/backend architecture, database ER diagram - 3_processes: System architecture, outbox sequence diagram, saga flow Mermaid diagrams render properly in GitHub, documentation sites, and most modern markdown viewers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: GitHub Actions Bot <actions@github.com> Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Adds fork-aware ticket workflow instructions so Claude Code automatically detects fork vs root repo and targets PRs accordingly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: add contribution workflow to CLAUDE.md
Adds context7.json so Edomata can be indexed on Context7, enabling AI coding assistants (Claude Code, Cursor, Copilot) to look up Edomata documentation directly. Fixes hnaderi#573 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add PGNaming sealed trait with Schema and Prefixed variants, allowing
tables to use a name prefix (e.g. auth_journal) instead of a dedicated
PostgreSQL schema (e.g. "auth".journal). This is useful for projects
using Flyway migrations in a single schema.
API: PGNamespace.prefixed("auth") or PGNaming.prefixed("auth")
Fixes hnaderi#574
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add SkunkPrefixedPersistenceSuite and SkunkPrefixedCQRSSuite - Add DoobiePrefixedPersistenceSuite and DoobiePrefixedCQRSSuite - Document table prefix mode in skunk.md, doobie.md, and backends tutorial Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add PGSchema utility to generate DDL SQL strings for migration files (eventsourcing and cqrs variants with configurable payload types) - Add skipSetup parameter to all driver .from() methods to disable automatic schema/table creation at startup - Add 10 unit tests for PGSchema DDL generation - Document Flyway workflow in skunk.md and doobie.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive AI agent documentation covering: - Table naming strategies (Schema vs Prefixed) - DDL extraction with PGSchema for Flyway workflows - skipSetup parameter for disabling automatic DDL - Guide for adding new tables with proper naming flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CLAUDE.md: SBT 1.12.1 -> 1.12.8, Doobie RC11 -> RC12, docker credentials test/test -> postgres/postgres - tutorials/2_backends.md: replace non-existent SkunkBackend API with actual Backend.builder().use(SkunkDriver(...)) pattern, fix connection credentials Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a pre-PR documentation audit process to CLAUDE.md that AI agents must run before opening any PR. Includes a detailed audit prompt that checks CLAUDE.md, backend docs, tutorials, and features against actual source code (versions, API signatures, file paths, code examples). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
examples/ is a root-level directory, not under modules/. Found by documentation audit agent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add language requirement: all commits, PRs, comments, docs, and branch names must be in English for this international open-source library. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: add Context7 documentation indexing
docs: add expert-flow.ai to adopters
feat: table prefix mode, DDL extraction, and Flyway support
…ards Introduces edomata-saas, a cross-platform module providing generic multi-tenant CRUD abstractions. Services extending the SaaS base traits get automatic tenant isolation and role-based authorization before any business logic runs, for both event-sourcing and CQRS approaches. Key features: - SaaSDomainDSL / SaaSCQRSDomainDSL with guardedRouter (auto-guarded) and unsafeUnguardedRouter (explicit bypass for super-admin) - CrudState[A] enum with tenant+owner tracking - TenantScopedQuery / UnsafeCrossTenantQuery for read-side enforcement - Selective re-exports in package.scala to prevent raw DSL usage - 15 unit tests for guard logic - Documentation page (docs/tutorials/4_saas.md) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Full Todo CQRS example showing: domain types, SaaS service with guardedRouter, SkunkHandler for SQL read-model projection, TenantScopedQuery for tenant-scoped reads, admin bypass with unsafeUnguardedRouter, and backend wiring - Integration tests exercising guardedRouter through the Stomaton pipeline: tenant mismatch rejection, missing roles rejection, Create bypass, unsafe bypass, and notification emission - 9 new tests (24 total for the saas module) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New test suites: - SaaSDomainDSLSuite: 24 tests covering the event-sourcing guarded DSL (guardedRouter, unsafeUnguardedRouter, guarded, unsafeUnguarded, caller/command/entityState/aggregateId accessors, pure, unit, reject, decide, publish, validate, notifications, Deleted state handling) - TenantAwareReaderSuite: 8 tests covering read-side abstractions (TenantScopedQuery factory and tenant filtering, UnsafeCrossTenantQuery, TenantAwareReader trait implementation) - SaaSServiceSuite: 20 tests covering service traits, CQRS DSL methods, event-sourced service, CrudState patterns, types, and package re-exports (domain field, set, modifyS, decideS, eval, DomainModel transitions, TenantId/UserId round-trips, SaaSCommand covariance, CrudAction enum, CommandMessage/Decision/MessageMetadata re-exports) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hardcoded CallerIdentity with generic Auth type parameter throughout the SaaS module. Authorization logic is now defined by implementing the AuthPolicy[Auth] trait, which provides: - tenantId(auth): extract tenant from any auth context - authorize(auth, action): custom authorization check CallerIdentity remains as a default implementation, with RoleBasedPolicy for role-based access control. Changes: - Add AuthPolicy[Auth] trait and RoleBasedPolicy class - SaaSCommand[C] -> SaaSCommand[Auth, C] - DSLs, services, readers all parameterized by Auth - SaaSGuard.checkRoles -> SaaSGuard.checkAuthorization (delegates to policy) - caller accessor -> auth accessor - rolesFor param removed from DSL/Service constructors (moved to AuthPolicy) - Tests updated + custom AuthPolicy test (ApiKeyAuth example) - 77 tests pass Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite documentation to reflect the generic auth refactor: - Add AuthPolicy typeclass section with full API - Add Custom Auth Types section with JwtClaims, ApiKeyAuth examples - Update all code samples: SaaSCommand[Auth, C], auth accessor, RoleBasedPolicy, TenantScopedQuery with Auth type param - Rename "Role check" to "Authorization check" throughout - Update overview to emphasize pluggable authorization Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add multi-tenant SaaS CRUD module
…ions Add a complete Product Catalog example demonstrating: - Custom AuthPolicy (ApiKeyContext with scopes, not CallerIdentity) - Typed rejections (ProductRejection enum, not String) - Product lifecycle state machine (Draft → Published → Archived → Deleted) - SQL DDL for CQRS backend tables and custom read-model projection - Flyway migration workflow with skipSetup Include 27 pure domain unit tests covering CRUD lifecycle, state machine validation, scope-based authorization, multi-tenant isolation, admin bypass, notification emission, and price validation. Update SaaS tutorial with full Product Catalog section including generated SQL examples, custom auth patterns, and test snippets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tenant-aware database tables to the SaaS module, enabling Row-Level Security, tenant-scoped indexes, and SQL-level audit queries. Changes: - Add TenantExtractor typeclass to extract tenant/owner from CrudState - Add SaaSPGSchema for DDL generation with tenant_id, owner_id columns, tenant indexes, and optional RLS policies - Create saas-skunk module with SaaSSkunkCQRSDriver that persists tenant_id/owner_id as first-class columns in states and outbox tables - Update ProductCatalogExample to use SaaS-aware driver - Add 13 new tests (TenantExtractor + SaaSPGSchema DDL validation) Test coverage: 93.7% statements, 100% branches on saas module. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add SaaS multi-tenant CQRS example + tenant-aware backend
Add Flyway-like event migration support that automatically tracks and applies pending migrations on startup. Migrations transform journal payloads in-place with compile-time exhaustivity checking via Scala 3 sealed enum pattern matching. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add automatic event journal migration system
Remove external dependencies (Sonatype credentials, PGP keys) from the CI pipeline. Each merge to main now publishes all platforms (JVM, JS, Native) directly to GitHub Packages via a self-contained workflow. - Disable tlCiReleaseBranches to remove auto-generated publish job - Add publish-ghp.yml: multi-platform build+test+publish pipeline - Add publish-ghp.sbt: conditional GitHub Packages publish config - Remove ci.yml artifact upload/download and Sonatype steps - Remove clean.yml (indiscriminate artifact deletion) - Remove greetings.yml (upstream community feature) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: replace Sonatype publish with GitHub Packages
Add a weekly GitHub Actions workflow to run Scala Steward for automated dependency updates. Update Mergify config to allow guillaumebadin and scala-steward[bot] as auto-merge authors. Co-authored-by: GitHub Actions Bot <actions@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: replace JVM-only IO.realTimeInstant with cross-platform IO.realTime IO.realTimeInstant is not available on Scala.js/Native platforms, breaking compilation of examples on those targets. Use IO.realTime with manual Instant conversion instead. Fixes #12 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove unused PGNaming imports in compatibility test suites Unused imports cause compilation failures under Scala 3's -Wunused fatal warnings, blocking all test jobs. Fixes #11 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove non-existent tlSonatypeUseLegacyHost setting This setting does not exist in sbt-typelevel 0.8.x, causing project loading to fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs: fix CLAUDE.md scalafmt version and add missing modules Update Scalafmt version from 3.10.4 to 3.10.7 to match .scalafmt.conf, and add saas/saas-skunk modules to project structure listing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * style: format examples after IO.realTime refactor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: GitHub Actions Bot <actions@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add auto-tag workflow that creates the next v0.12.x tag on every push to main. Publish workflow now only triggers on tags to avoid duplicate builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: auto-increment patch version tag on merge to main
Add publishTo and credentials settings for GitHub Packages. Change organization from dev.hnaderi to dev.bsg. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: configure GitHub Packages publishing with dev.bsg org
Explain how to configure resolvers, credentials, and dependencies to consume the BSG fork from GitHub Packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
List all published modules with artifact names, platform support, and descriptions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add documentation table linking to all docs/ files - Update CI badge to point to beyond-scale-group/edomata - Remove upstream-specific badges (Scala Index, Javadoc) - Add fork notice with link to upstream repo - Fix Projects section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove credentials setup and CI token steps since GitHub Packages does not require authentication for reading from public repositories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changing organizationName broke headerCheck because all source files have the original author's copyright header. Keep organization as dev.bsg for artifact publishing but preserve the original copyright. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace "Copyright 2021 Hossein Naderi" with "Copyright 2021 Beyond Scale Group" in all 152 source files to match the new organizationName in build.sbt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No prior dev.bsg artifacts have been published, so MiMa cannot resolve previous versions. Disable until the first release is published. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update all dependency examples in README, tutorials, and backend docs to use the dev.bsg group ID. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mimaPreviousArtifacts is overridden by sbt-typelevel. Use the typelevel-specific tlMimaPreviousVersions := Set.empty instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: add GitHub Packages installation instructions
The e2e test module still referenced the old dev.hnaderi package namespace after the organization migration to dev.bsg. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: rename e2e package from dev.hnaderi to dev.bsg
Update base URL and navigation links from edomata.ir to beyond-scale-group.github.io/edomata/ for GitHub Pages deployment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
docs: publish site on GitHub Pages
Replace the Typelevel sbt-typelevel-site (Laika/Helium) with Docusaurus 3 for a modern documentation experience with dark mode, better search, and a distinctive visual identity. - Remove EdomataSitePlugin.scala and sbt-typelevel-site dependency - Configure mdoc to output to website/docs/ for Docusaurus consumption - Add Docusaurus project with custom purple theme, landing page with hero section, feature cards, and ecosystem links - Migrate all 16 doc files with Docusaurus frontmatter and fixed links - Update CI workflow: sbt docs/mdoc → npm run build → GitHub Pages The mdoc compilation step still validates all Scala code examples, ensuring documentation accuracy at build time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mdoc copies source files to website/docs/, so the source filenames must already match Docusaurus conventions. This fixes the duplicate doc ID error in CI. - Rename tutorial files (remove numeric prefixes, use hyphens) - Add Docusaurus frontmatter to source docs - Convert @:api() syntax and fix internal links in source - Remove Laika directory.conf files (use sidebar_position instead) - Add website/docs/ to .gitignore (generated by mdoc) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: migrate docs site to Docusaurus
…#28) Show copy-paste SBT snippets with latest version (0.12.5) for JVM, Scala.js, and Scala Native. Fix stale documentation links in README. Co-authored-by: GitHub Actions Bot <actions@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add "scala" to Prism's additionalLanguages in Docusaurus config. Scala is not included in prism-react-renderer's default language set, so all Scala code blocks rendered as plain grey text without highlighting. Also tag an untagged ASCII diagram code block in migrations.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"scala"to Prism'sadditionalLanguagesin Docusaurus config — Scala is not in prism-react-renderer's default language set, causing all Scala code blocks to render as plain grey text without syntax highlighting or copy buttondocs/tutorials/migrations.mdastextTest plan
Fixes #29
🤖 Generated with Claude Code