From 9d0ad1aae778b6177b5e51d8e6e481db03a0cca5 Mon Sep 17 00:00:00 2001 From: kingwill101 Date: Fri, 3 Apr 2026 16:05:30 -0500 Subject: [PATCH 1/4] Add auto publish workflow --- .github/workflows/publish.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..637c860 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,25 @@ +name: Publish + +# When a pull request is opened or updated the job will run the validation +# steps (using firehose, this checks for correct pubspec versioning, changelog entries, etc.). +# When you push a tag (for a package), firehose will attempt to publish that package. +on: + pull_request: + branches: [ master ] + types: [ opened, synchronize, reopened, labeled, unlabeled ] + push: + # For mono repos the tag must be prefixed with the package name, + # e.g. "inertia-dart-v1.0.0". Adjust the regular expression as needed. + tags: + - 'v*.*.*' + - '*-v*.*.*' + workflow_dispatch: + +jobs: + publish: + # This job uses the common publish workflow provided by the ecosystem. + # See https://github.com/dart-lang/ecosystem/wiki/Publishing-automation + uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main + permissions: + id-token: write + pull-requests: write From 31832555f8083092d722ae54a269c4359cb2cbdf Mon Sep 17 00:00:00 2001 From: kingwill101 Date: Fri, 3 Apr 2026 17:10:56 -0500 Subject: [PATCH 2/4] readme + prep for release --- README.md | 90 ++++++++++++++++++++++----- packages/inertia/CHANGELOG.md | 5 +- packages/inertia/README.md | 8 +++ packages/inertia/pubspec.yaml | 6 +- packages/routed_inertia/CHANGELOG.md | 2 +- packages/routed_inertia/pubspec.yaml | 8 +-- packages/serinus_inertia/pubspec.yaml | 4 +- 7 files changed, 96 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 32dc6cf..054956c 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,84 @@ # inertia_dart -Standalone repository for the Dart implementation of the Inertia.js server-side -protocol. +Dart implementation of the [Inertia.js](https://inertiajs.com) server-side protocol. Build +single-page apps without building an API — pair any Dart HTTP server with a client adapter +like `@inertiajs/react`, `@inertiajs/vue3`, or `@inertiajs/svelte`. -This repository contains the core `inertia_dart` package and standalone -examples built around `dart:io`. +## Packages + +| Package | pub.dev | Description | +| --- | --- | --- | +| [`inertia_dart`](packages/inertia) | [![pub](https://img.shields.io/pub/v/inertia_dart.svg)](https://pub.dev/packages/inertia_dart) | Core protocol — framework-agnostic props, SSR, asset helpers, and testing utilities | +| [`routed_inertia`](packages/routed_inertia) | [![pub](https://img.shields.io/pub/v/routed_inertia.svg)](https://pub.dev/packages/routed_inertia) | [Routed](https://pub.dev/packages/routed) integration — middleware, `EngineContext` helpers, config-driven setup, and SSR | +| [`serinus_inertia`](packages/serinus_inertia) | [![pub](https://img.shields.io/pub/v/serinus_inertia.svg)](https://pub.dev/packages/serinus_inertia) | [Serinus](https://pub.dev/packages/serinus) integration — `InertiaModule`, `RequestContext.inertia()`, and managed SSR | + +--- + +### `inertia_dart` — Core Package + +The framework-agnostic foundation. Use it directly with `dart:io` or as the +building block for higher-level integrations. + +```dart +import 'package:inertia_dart/inertia_dart.dart'; -## Workspace +final request = inertiaRequestFromHttp(httpRequest); +final page = InertiaResponseFactory().buildPageData( + component: 'Dashboard', + props: { + 'user': {'name': 'Ada'}, + 'stats': LazyProp(() => loadStats()), + }, + url: request.url, + context: request.createContext(), + version: '1.0.0', +); -```bash -dart pub get +await writeInertiaResponse(httpRequest.response, InertiaResponse.json(page)); ``` -## Packages +[Full docs →](https://kingwill101.github.io/docs/inertia_dart/) + +--- + +### `serinus_inertia` — Serinus Integration -- `packages/inertia` implements the core Inertia protocol helpers for Dart. -- `packages/routed_inertia` adds Routed middleware, `EngineContext` helpers, - config wiring, and SSR support for Inertia responses. -- `packages/serinus_inertia` adds Serinus request/response adapters and - `RequestContext` helpers for Inertia responses. +Provides a first-class [Serinus](https://pub.dev/packages/serinus) experience via +`InertiaModule` and `RequestContext.inertia()`. -## Examples +```dart +import 'package:serinus/serinus.dart'; +import 'package:serinus_inertia/serinus_inertia.dart'; -- `examples/contacts_app` shows standalone `dart:io` usage. -- `packages/inertia/example/*` contains focused package examples. +class AppModule extends Module { + AppModule() + : super( + imports: [ + InertiaModule( + options: SerinusInertiaOptions( + version: '1.0.0', + assets: SerinusInertiaAssetOptions( + entry: 'src/main.jsx', + clientDirectory: 'client', + includeReactRefresh: true, + ), + ), + ), + ], + controllers: [AppController()], + ); +} +``` + +```dart +class AppController extends Controller { + AppController() : super('/') { + on(Route.get('/'), (context) async { + return context.inertia( + component: 'Home', + props: {'title': 'Hello from Serinus'}, + ); + }); + } +} +``` diff --git a/packages/inertia/CHANGELOG.md b/packages/inertia/CHANGELOG.md index f75ce28..0527c4d 100644 --- a/packages/inertia/CHANGELOG.md +++ b/packages/inertia/CHANGELOG.md @@ -1,5 +1,8 @@ -## 0.1.1 +## 1.0.0 +- Targets Inertia.js 3.x client adapters. For Inertia.js 2.x and earlier, use + `inertia_dart` `<1.0.0`. +- Updated `artisanal` to `^0.3.0`. - Fixed case-sensitive header lookups -- `InertiaHeaderUtils` now performs case-insensitive matching via a new `_get()` helper, fixing compatibility with `dart:io` `HttpHeaders` which lowercases header names. diff --git a/packages/inertia/README.md b/packages/inertia/README.md index 13908ec..5710573 100644 --- a/packages/inertia/README.md +++ b/packages/inertia/README.md @@ -7,12 +7,19 @@ support, and testing utilities. Pair it with a client adapter like > **New here?** Follow the [Build a Contacts App](https://kingwill101.github.io/docs/inertia_dart/tutorial) tutorial for a hands-on walkthrough using just `dart:io`. +> **Using Serinus?** Use the [`serinus_inertia`](https://pub.dev/packages/serinus_inertia) package for a more integrated experience — it provides `InertiaModule`, `RequestContext.inertia()`, and managed SSR support out of the box. + ## Install ```bash dart pub add inertia_dart ``` +| Inertia.js client version | `inertia_dart` package version | +| --- | --- | +| 3.x | `>=1.0.0` | +| `<3.0` | `<1.0.0` | + ## CLI Scaffold a Vite client with Inertia already wired: @@ -248,3 +255,4 @@ response.assertInertia((page) { - [Inertia Dart docs](https://kingwill101.github.io/docs/inertia_dart/) -- full API reference and tutorial - [Inertia core docs](https://inertiajs.com) -- protocol specification and client adapters +- [`serinus_inertia`](https://pub.dev/packages/serinus_inertia) -- Serinus adapter with `InertiaModule`, `RequestContext.inertia()`, and managed SSR diff --git a/packages/inertia/pubspec.yaml b/packages/inertia/pubspec.yaml index ba1573f..7bed5ff 100644 --- a/packages/inertia/pubspec.yaml +++ b/packages/inertia/pubspec.yaml @@ -1,6 +1,6 @@ name: inertia_dart description: Dart implementation of Inertia.js protocol -version: 0.1.1 +version: 1.0.0 repository: https://github.com/kingwill101/inertia_dart tags: - inertia @@ -17,13 +17,13 @@ environment: sdk: ">=3.9.0 <4.0.0" dependencies: - artisanal: ^0.1.2 + artisanal: ^0.3.0 http: ^1.6.0 json_annotation: ^4.9.0 meta: ^1.18.0 html: ^0.15.5 path: ^1.9.1 - server_testing: ^0.3.2 + server_testing: ^0.3.3 test: ^1.29.0 executables: diff --git a/packages/routed_inertia/CHANGELOG.md b/packages/routed_inertia/CHANGELOG.md index 0531d41..6f58b7e 100644 --- a/packages/routed_inertia/CHANGELOG.md +++ b/packages/routed_inertia/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.1.1 +## 1.0.0 - Eliminated code duplication -- extracted shared helpers (`inertiaRequestUrl`, `inertiaDefaultHtml`, `consumeFlash`, `consumeErrors`, diff --git a/packages/routed_inertia/pubspec.yaml b/packages/routed_inertia/pubspec.yaml index 2f18b3b..02101d2 100644 --- a/packages/routed_inertia/pubspec.yaml +++ b/packages/routed_inertia/pubspec.yaml @@ -1,6 +1,6 @@ name: routed_inertia description: Inertia.js integration for Routed that adds middleware, EngineContext helpers, SSR gateway wiring, and asset manifest support for hybrid apps. -version: 0.1.1 +version: 1.0.0 repository: https://github.com/kingwill101/inertia_dart tags: - routed @@ -11,8 +11,8 @@ environment: sdk: ">=3.9.0 <4.0.0" dependencies: - inertia_dart: ^0.1.1 - routed: ^0.3.2 + inertia_dart: ^1.0.0 + routed: ^0.3.3 json_schema_builder: ^0.1.3 meta: ^1.18.0 @@ -21,5 +21,5 @@ dev_dependencies: test: ^1.29.0 lints: ^6.0.0 routed_testing: ^0.3.2 - server_testing: ^0.3.2 + server_testing: ^0.3.3 file: ^7.0.1 diff --git a/packages/serinus_inertia/pubspec.yaml b/packages/serinus_inertia/pubspec.yaml index b523279..fcdad67 100644 --- a/packages/serinus_inertia/pubspec.yaml +++ b/packages/serinus_inertia/pubspec.yaml @@ -14,8 +14,8 @@ environment: sdk: ">=3.10.0 <4.0.0" dependencies: - artisanal: ^0.1.2 - inertia_dart: ^0.1.1 + artisanal: ^0.3.0 + inertia_dart: ^1.0.0 path: ^1.9.1 serinus: ^2.1.7 From 38ab5effeb18aee29cfe455e53d9f0857c2aa22c Mon Sep 17 00:00:00 2001 From: kingwill101 Date: Fri, 3 Apr 2026 18:08:36 -0500 Subject: [PATCH 3/4] Bump routed_inertia version to 0.2.0 --- packages/routed_inertia/CHANGELOG.md | 2 +- packages/routed_inertia/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/routed_inertia/CHANGELOG.md b/packages/routed_inertia/CHANGELOG.md index 6f58b7e..d42b23c 100644 --- a/packages/routed_inertia/CHANGELOG.md +++ b/packages/routed_inertia/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.0.0 +## 0.2.0 - Eliminated code duplication -- extracted shared helpers (`inertiaRequestUrl`, `inertiaDefaultHtml`, `consumeFlash`, `consumeErrors`, diff --git a/packages/routed_inertia/pubspec.yaml b/packages/routed_inertia/pubspec.yaml index 02101d2..81421c8 100644 --- a/packages/routed_inertia/pubspec.yaml +++ b/packages/routed_inertia/pubspec.yaml @@ -1,6 +1,6 @@ name: routed_inertia description: Inertia.js integration for Routed that adds middleware, EngineContext helpers, SSR gateway wiring, and asset manifest support for hybrid apps. -version: 1.0.0 +version: 0.2.0 repository: https://github.com/kingwill101/inertia_dart tags: - routed From 29f7f46a13a92131b8926d0bd791220f5f7d7497 Mon Sep 17 00:00:00 2001 From: kingwill101 Date: Sat, 4 Apr 2026 04:11:09 -0500 Subject: [PATCH 4/4] use correct inertia class names --- packages/serinus_inertia/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/serinus_inertia/README.md b/packages/serinus_inertia/README.md index 0a45db8..1204623 100644 --- a/packages/serinus_inertia/README.md +++ b/packages/serinus_inertia/README.md @@ -50,9 +50,9 @@ class AppModule extends Module { : super( imports: [ InertiaModule( - options: SerinusInertiaOptions( + options: InertiaOptions( version: '1.0.0', - assets: SerinusInertiaAssetOptions( + assets: InertiaAssetOptions( entry: 'src/main.jsx', clientDirectory: 'client', includeReactRefresh: true, @@ -164,7 +164,7 @@ Open `http://127.0.0.1:4000`. `InertiaModule` is the high-level integration point. Use it when you want shared defaults instead of repeating options in every handler. -`SerinusInertiaOptions` can define: +`InertiaOptions` can define: - `version` - `elementId` @@ -183,7 +183,7 @@ If `htmlBuilder` is omitted, the default wrapper renders: ## Client Assets -Use `SerinusInertiaAssetOptions` when you want the package to know where the +Use `InertiaAssetOptions` when you want the package to know where the frontend lives. For development asset resolution, the package uses this order: @@ -201,8 +201,8 @@ manually, use `writeInertiaViteHotFilePlugin(Directory('client'))` from ```dart InertiaModule( - options: SerinusInertiaOptions( - assets: SerinusInertiaAssetOptions( + options: InertiaOptions( + assets: InertiaAssetOptions( entry: 'src/main.jsx', clientDirectory: 'client', // Optional overrides: @@ -221,7 +221,7 @@ hand-writing script and stylesheet tags. If your dev server runs somewhere unusual, either point directly at it: ```dart -assets: SerinusInertiaAssetOptions( +assets: InertiaAssetOptions( entry: 'src/main.jsx', clientDirectory: 'client', devServerUrl: 'http://127.0.0.1:5174', @@ -231,7 +231,7 @@ assets: SerinusInertiaAssetOptions( or override the hot file path if your tooling writes it somewhere else: ```dart -assets: SerinusInertiaAssetOptions( +assets: InertiaAssetOptions( entry: 'src/main.jsx', clientDirectory: 'client', hotFile: 'frontend/public/hot', @@ -240,7 +240,7 @@ assets: SerinusInertiaAssetOptions( ## SSR -Use `SerinusInertiaSsrOptions` for first-visit SSR. +Use `InertiaSsrOptions` for first-visit SSR. ### Managed by Serinus @@ -249,8 +249,8 @@ separate child process during startup and stop it again on shutdown. ```dart InertiaModule( - options: SerinusInertiaOptions( - ssr: SerinusInertiaSsrOptions( + options: InertiaOptions( + ssr: InertiaSsrOptions( enabled: true, manageProcess: true, runtime: 'node', // or 'bun' @@ -271,8 +271,8 @@ existing endpoint instead: ```dart InertiaModule( - options: SerinusInertiaOptions( - ssr: SerinusInertiaSsrOptions( + options: InertiaOptions( + ssr: InertiaSsrOptions( enabled: true, endpoint: Uri.parse('http://127.0.0.1:13714/render'), // Optional: @@ -306,8 +306,8 @@ directly: ```dart InertiaModule( - options: SerinusInertiaOptions( - ssr: SerinusInertiaSsrOptions( + options: InertiaOptions( + ssr: InertiaSsrOptions( enabled: true, gateway: MyCustomSsrGateway(), ),