Repository navigation
Add auto publish workflow script #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) | [](https://pub.dev/packages/inertia_dart) | Core protocol — framework-agnostic props, SSR, asset helpers, and testing utilities | | ||
| | [`routed_inertia`](packages/routed_inertia) | [](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) | [](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( | ||
|
kingwill101 marked this conversation as resolved.
Resolved
|
||
| 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'}, | ||
| ); | ||
| }); | ||
| } | ||
| } | ||
| ``` | ||
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.