@typokit/plugin-axum 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @typokit/plugin-axum
2
+
3
+ A TypoKit plugin that generates a complete, production-ready **Axum** web server from TypeScript schema types and route contracts. Powered by a native Rust code generator via napi-rs.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @typokit/plugin-axum
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Add the plugin to your `typokit.config.ts`:
14
+
15
+ ```typescript
16
+ import { axumPlugin } from "@typokit/plugin-axum";
17
+
18
+ export default {
19
+ plugins: [axumPlugin({ db: "sqlx" })],
20
+ };
21
+ ```
22
+
23
+ Then run the build:
24
+
25
+ ```bash
26
+ typokit build
27
+ ```
28
+
29
+ ## Options
30
+
31
+ | Option | Type | Default | Description |
32
+ |--------|------|---------|-------------|
33
+ | `db` | `string` | `"sqlx"` | Database adapter. Currently only `"sqlx"` is supported. |
34
+ | `outDir` | `string` | Project root | Output directory for the generated Rust project. |
35
+ | `cacheFile` | `string` | `.typokit/.cache-hash` | Path to the content-hash cache file for incremental builds. |
36
+
37
+ ## How It Works
38
+
39
+ The plugin hooks into two phases of the TypoKit build pipeline:
40
+
41
+ 1. **`emit`** — Reads parsed type metadata and route contracts, then generates Rust source files via the native addon.
42
+ 2. **`compile`** — Runs `cargo build` instead of the default TypeScript compiler, setting `compileCtx.handled = true` to skip `tsc`.
43
+
44
+ ## Generated Output
45
+
46
+ ```
47
+ .typokit/ ← Auto-generated (always overwritten)
48
+ models/ ← Rust structs with serde + validator + sqlx derives
49
+ db/ ← PgPool connection & CRUD repository functions
50
+ router.rs ← Axum Router with typed route registrations
51
+ app.rs ← AppState (shared PgPool)
52
+ error.rs ← AppError enum → HTTP status codes
53
+ migrations/ ← SQL CREATE TABLE migration files
54
+
55
+ src/ ← User code (never overwritten after initial generation)
56
+ handlers/ ← Per-entity Axum handler functions
57
+ services/ ← Business logic layer
58
+ middleware/ ← Auth/logging middleware stubs
59
+ main.rs ← Tokio async entrypoint
60
+ lib.rs ← Module bridge (#[path] to .typokit/)
61
+
62
+ Cargo.toml ← Project manifest with all dependencies
63
+ ```
64
+
65
+ Files in `.typokit/` and project scaffolding (`main.rs`, `lib.rs`, `Cargo.toml`) are regenerated on every build. Handler, service, and middleware files under `src/` are generated once and **never overwritten** — this is where your application logic lives.
66
+
67
+ ## Prerequisites
68
+
69
+ - [Rust](https://rustup.rs/) 1.85+ (edition 2024)
70
+ - [PostgreSQL](https://www.postgresql.org/) 16+
71
+ - Optional: [sqlx-cli](https://crates.io/crates/sqlx-cli) for running migrations
72
+
73
+ ## Documentation
74
+
75
+ - [Plugins — @typokit/plugin-axum](https://kylebastien.github.io/typokit/core-concepts/plugins/) — Official plugin documentation
76
+ - [Building a Rust/Axum Server](https://kylebastien.github.io/typokit/guides/rust-axum-server/) — Step-by-step guide
77
+ - [Example: Todo Server (Axum)](https://github.com/KyleBastien/typokit/tree/main/packages/example-todo-server-axum) — Complete reference application
78
+
79
+ ## License
80
+
81
+ [MIT](https://github.com/KyleBastien/typokit/blob/main/LICENSE)
@@ -0,0 +1,28 @@
1
+ import type { TypoKitPlugin } from "@typokit/core";
2
+ /** Configuration options for the Axum code generation plugin */
3
+ export interface AxumPluginOptions {
4
+ /** Database adapter (currently only 'sqlx' is supported, default: 'sqlx') */
5
+ db?: string;
6
+ /** Output directory for the generated Rust project (default: project root) */
7
+ outDir?: string;
8
+ /** Path to cache hash file (defaults to ".typokit/.cache-hash" within outDir) */
9
+ cacheFile?: string;
10
+ }
11
+ /**
12
+ * Create an Axum server code generation plugin.
13
+ *
14
+ * Generates a complete Axum server (structs, router, sqlx DB layer, handlers,
15
+ * services, middleware, and project scaffold) from TypeScript schema types
16
+ * and route contracts during the build pipeline.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { axumPlugin } from '@typokit/plugin-axum';
21
+ *
22
+ * export default {
23
+ * plugins: [axumPlugin({ db: 'sqlx' })],
24
+ * };
25
+ * ```
26
+ */
27
+ export declare function axumPlugin(options?: AxumPluginOptions): TypoKitPlugin;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,eAAe,CAAC;AA2ElE,gEAAgE;AAChE,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa,CAyIzE"}
package/dist/index.js ADDED
@@ -0,0 +1,186 @@
1
+ // @typokit/plugin-axum — Axum Server Code Generation Plugin
2
+ // ─── Native Addon Loader ─────────────────────────────────────
3
+ async function loadNativeAddon() {
4
+ const g = globalThis;
5
+ const proc = g["process"];
6
+ const platform = proc?.platform ?? "unknown";
7
+ const arch = proc?.arch ?? "unknown";
8
+ const triples = {
9
+ win32: { x64: "win32-x64-msvc" },
10
+ darwin: { x64: "darwin-x64", arm64: "darwin-arm64" },
11
+ linux: { x64: "linux-x64-gnu", arm64: "linux-arm64-gnu" },
12
+ };
13
+ const triple = triples[platform]?.[arch];
14
+ if (!triple) {
15
+ throw new Error(`@typokit/plugin-axum: unsupported platform ${platform}-${arch}`);
16
+ }
17
+ const { createRequire } = (await import(/* @vite-ignore */ "module"));
18
+ const req = createRequire(import.meta.url);
19
+ try {
20
+ return req(`../index.${triple}.node`);
21
+ }
22
+ catch {
23
+ try {
24
+ return req(`@typokit/plugin-axum-${triple}`);
25
+ }
26
+ catch {
27
+ throw new Error(`@typokit/plugin-axum: failed to load native addon for ${triple}. ` +
28
+ `Make sure the native addon is built.`);
29
+ }
30
+ }
31
+ }
32
+ let _native;
33
+ let _loading;
34
+ async function getNative() {
35
+ if (_native)
36
+ return _native;
37
+ if (!_loading) {
38
+ _loading = loadNativeAddon().then((n) => {
39
+ _native = n;
40
+ return n;
41
+ });
42
+ }
43
+ return _loading;
44
+ }
45
+ // ─── Plugin Factory ──────────────────────────────────────────
46
+ /**
47
+ * Create an Axum server code generation plugin.
48
+ *
49
+ * Generates a complete Axum server (structs, router, sqlx DB layer, handlers,
50
+ * services, middleware, and project scaffold) from TypeScript schema types
51
+ * and route contracts during the build pipeline.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * import { axumPlugin } from '@typokit/plugin-axum';
56
+ *
57
+ * export default {
58
+ * plugins: [axumPlugin({ db: 'sqlx' })],
59
+ * };
60
+ * ```
61
+ */
62
+ export function axumPlugin(options = {}) {
63
+ const { db = "sqlx", outDir, cacheFile } = options;
64
+ if (db !== "sqlx") {
65
+ throw new Error(`@typokit/plugin-axum: unsupported database adapter '${db}'. Only 'sqlx' is currently supported.`);
66
+ }
67
+ return {
68
+ name: "plugin-axum",
69
+ onBuild(pipeline) {
70
+ // Tap the emit hook to generate Rust code from the parsed schemas
71
+ pipeline.hooks.emit.tap("plugin-axum", async (outputs, ctx) => {
72
+ const { join, dirname } = (await import(/* @vite-ignore */ "path"));
73
+ const nodeFs = (await import(/* @vite-ignore */ "fs"));
74
+ const native = await getNative();
75
+ const resolvedOutDir = outDir ?? ctx.rootDir;
76
+ const resolvedCacheFile = cacheFile ?? join(resolvedOutDir, ".typokit", ".cache-hash");
77
+ // Resolve type and route files from the build context
78
+ const fsAdapter = nodeFs;
79
+ const typeFiles = resolveTypeFiles(ctx.rootDir, fsAdapter, join);
80
+ const routeFiles = resolveRouteFiles(ctx.rootDir, fsAdapter, join);
81
+ if (typeFiles.length === 0 && routeFiles.length === 0) {
82
+ return;
83
+ }
84
+ // Check content hash cache
85
+ const allPaths = [...typeFiles, ...routeFiles];
86
+ const contentHash = native.computeContentHash(allPaths);
87
+ if (nodeFs.existsSync(resolvedCacheFile)) {
88
+ const cachedHash = nodeFs
89
+ .readFileSync(resolvedCacheFile, "utf-8")
90
+ .trim();
91
+ if (cachedHash === contentHash) {
92
+ return;
93
+ }
94
+ }
95
+ // Generate Rust codegen outputs
96
+ const rustOutputs = native.generateRustCodegen(typeFiles, routeFiles);
97
+ // Write generated files
98
+ for (const output of rustOutputs) {
99
+ const fullPath = join(resolvedOutDir, output.path);
100
+ const dir = dirname(fullPath);
101
+ nodeFs.mkdirSync(dir, { recursive: true });
102
+ // Respect overwrite flag: skip existing files when overwrite is false
103
+ if (!output.overwrite && nodeFs.existsSync(fullPath)) {
104
+ continue;
105
+ }
106
+ nodeFs.writeFileSync(fullPath, output.content, "utf-8");
107
+ outputs.push({
108
+ filePath: fullPath,
109
+ content: output.content,
110
+ overwrite: output.overwrite,
111
+ });
112
+ }
113
+ // Write cache hash
114
+ nodeFs.mkdirSync(dirname(resolvedCacheFile), { recursive: true });
115
+ nodeFs.writeFileSync(resolvedCacheFile, contentHash, "utf-8");
116
+ });
117
+ // Tap the compile hook to run cargo build instead of the TypeScript compiler
118
+ pipeline.hooks.compile.tap("plugin-axum", async (compileCtx, ctx) => {
119
+ const { spawnSync } = (await import(
120
+ /* @vite-ignore */ "child_process"));
121
+ const resolvedOutDir = outDir ?? ctx.rootDir;
122
+ const result = spawnSync("cargo", ["build"], {
123
+ cwd: resolvedOutDir,
124
+ encoding: "utf-8",
125
+ });
126
+ compileCtx.handled = true;
127
+ compileCtx.compiler = "cargo";
128
+ if (result.error) {
129
+ compileCtx.result = {
130
+ success: false,
131
+ errors: [result.error.message],
132
+ };
133
+ return;
134
+ }
135
+ if (result.status !== 0) {
136
+ const errorOutput = result.stderr || result.stdout || "cargo build failed";
137
+ compileCtx.result = {
138
+ success: false,
139
+ errors: [errorOutput.trim()],
140
+ };
141
+ return;
142
+ }
143
+ compileCtx.result = { success: true, errors: [] };
144
+ });
145
+ },
146
+ };
147
+ }
148
+ // ─── File Resolution Helpers ─────────────────────────────────
149
+ /**
150
+ * Resolve TypeScript type definition files from the project root.
151
+ * Looks for files matching common TypoKit type patterns.
152
+ */
153
+ function resolveTypeFiles(rootDir, fs, join) {
154
+ return resolvePatternFiles(rootDir, "types", fs, join);
155
+ }
156
+ /**
157
+ * Resolve TypeScript route contract files from the project root.
158
+ * Looks for files matching common TypoKit route patterns.
159
+ */
160
+ function resolveRouteFiles(rootDir, fs, join) {
161
+ return resolvePatternFiles(rootDir, "routes", fs, join);
162
+ }
163
+ /**
164
+ * Resolve files from a subdirectory matching .ts extension.
165
+ */
166
+ function resolvePatternFiles(rootDir, subDir, fs, join) {
167
+ const dir = join(rootDir, subDir);
168
+ if (!fs.existsSync(dir))
169
+ return [];
170
+ const results = [];
171
+ const entries = fs.readdirSync(dir);
172
+ for (const entry of entries) {
173
+ const fullPath = join(dir, entry);
174
+ try {
175
+ const stat = fs.statSync(fullPath);
176
+ if (stat.isFile() && entry.endsWith(".ts")) {
177
+ results.push(fullPath);
178
+ }
179
+ }
180
+ catch {
181
+ // Skip files that can't be stat'd
182
+ }
183
+ }
184
+ return results.sort();
185
+ }
186
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAqB5D,gEAAgE;AAEhE,KAAK,UAAU,eAAe;IAC5B,MAAM,CAAC,GAAG,UAAqC,CAAC;IAChD,MAAM,IAAI,GAAG,CAAC,CAAC,SAAS,CAAmD,CAAC;IAC5E,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,SAAS,CAAC;IAC7C,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC;IAErC,MAAM,OAAO,GAA2C;QACtD,KAAK,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE;QAChC,MAAM,EAAE,EAAE,GAAG,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file
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest run --passWithNoTests",
4
+ "build:native": "napi build --platform --dts src/index.d.ts --js false",
5
+ "build:native:release": "napi build --platform --release --dts src/index.d.ts --js false"
6
+ },
7
+ "name": "@typokit/plugin-axum",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "version": "0.2.1",
15
+ "type": "module",
16
+ "files": [
17
+ "dist",
18
+ "src",
19
+ "*.node"
20
+ ],
21
+ "main": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
23
+ "dependencies": {
24
+ "@typokit/core": "workspace:*",
25
+ "@typokit/types": "workspace:*"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^22.0.0"
29
+ },
30
+ "napi": {
31
+ "binaryName": "index",
32
+ "package": {
33
+ "name": "@typokit/plugin-axum"
34
+ },
35
+ "targets": [
36
+ "x86_64-pc-windows-msvc",
37
+ "x86_64-apple-darwin",
38
+ "aarch64-apple-darwin",
39
+ "x86_64-unknown-linux-gnu",
40
+ "aarch64-unknown-linux-gnu",
41
+ "x86_64-unknown-linux-musl"
42
+ ]
43
+ },
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/KyleBastien/typokit",
47
+ "directory": "packages/plugin-axum"
48
+ },
49
+ "optionalDependencies": {
50
+ "@typokit/plugin-axum-darwin-arm64": "0.2.1",
51
+ "@typokit/plugin-axum-darwin-x64": "0.2.1",
52
+ "@typokit/plugin-axum-linux-arm64-gnu": "0.2.1",
53
+ "@typokit/plugin-axum-linux-x64-gnu": "0.2.1",
54
+ "@typokit/plugin-axum-linux-x64-musl": "0.2.1",
55
+ "@typokit/plugin-axum-win32-x64-msvc": "0.2.1"
56
+ }
57
+ }