Repository navigation
feat: Inertia and lean profile support for Fastify - #26
Merged
Merged
Conversation
The template built its CORS options in the Application constructor, before the env global exists, so lean projects crashed on start. Plugin options can now be a function, and the template's middleware config type-checks.
Lean projects have no api routes, so a missing file is no longer logged as an error.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Follow-ups to #23 that bring Fastify level with Express and H3.
Inertia
@arkstack/driver-fastify/middlewaresexportsinertia(). It runs the rest of the request inside Inertia's context and upgrades302redirects to303for InertiaPUT,PATCHandDELETEvisits.create-arkstackno longer blocks Inertia for the Fastify template. Its existing setup step wires the middleware and the root route without changes.Lean profile
Applicationconstructor, before theenvglobal exists. Plugin options can now be a function that Fastify calls when it loads the plugin, and the template uses that.api.ts. A file that fails to load is still logged.reqwas implicitlyany).Docs
express-leanandh3-leanas template aliases, but those aliases were removed. They now describe lean and full as profiles of every template, chosen at the prompt or with--leanor--full.Testing
packages/driver-fastify: 44 tests pass, including new ones for the Inertia middleware, function plugin options and missing or broken route files.create-arkstackandpackages/inertiatests pass, and lint is clean.makeLeanProfile. It serves/and answers CORS preflights with the configured origin.applyInertia(…, 'vue'), built it and started it./returns the Inertia page object forX-Inertiarequests and the HTML document otherwise.