Skip to content

Commit 8d932ac

Browse files
committed
feat(klesia): add build and start
1 parent e25fd52 commit 8d932ac

File tree

8 files changed

+35
-22
lines changed

8 files changed

+35
-22
lines changed

apps/klesia/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"name": "@mina-js/klesia",
3+
"type": "module",
34
"scripts": {
4-
"dev": "bun run --hot src/index.ts"
5+
"build": "tsc --noEmit && bun build src/index.ts --outdir dist",
6+
"dev": "bun run --hot src/index.ts",
7+
"start": "bun dist/index.js"
58
},
69
"dependencies": {
710
"@hono/zod-openapi": "^0.16.0",

apps/klesia/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
22
import { apiReference } from "@scalar/hono-api-reference";
3+
import { logger } from "hono/logger";
34
import { match } from "ts-pattern";
45
import { mina } from "./methods/mina";
56
import { RpcMethodSchema, RpcResponseSchema } from "./schema";
67
import { buildResponse } from "./utils/build-response";
78

89
const api = new OpenAPIHono();
910

11+
api.use(logger());
12+
1013
api.doc("/api/openapi", {
1114
openapi: "3.0.0",
1215
info: {

apps/klesia/src/utils/node.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { Client, cacheExchange, fetchExchange } from "@urql/core";
22
import { match } from "ts-pattern";
3+
import { z } from "zod";
34

4-
const MINA_NETWORK = process.env.MINA_NETWORK;
5+
const NetworkMatcher = z.enum(["devnet", "mainnet"]);
6+
7+
const MINA_NETWORK = NetworkMatcher.parse(process.env.MINA_NETWORK);
8+
const NODE_API_DEVNET = z.string().parse(process.env.NODE_API_DEVNET);
9+
const NODE_API_MAINNET = z.string().parse(process.env.NODE_API_MAINNET);
510

611
export const getNodeApiUrl = () => {
712
return match(MINA_NETWORK)
8-
.with("devnet", () => process.env.NODE_API_DEVNET)
9-
.with("mainnet", () => process.env.NODE_API_MAINNET)
10-
.run();
13+
.with("devnet", () => NODE_API_DEVNET)
14+
.with("mainnet", () => NODE_API_MAINNET)
15+
.exhaustive();
1116
};
1217

1318
export const getNodeClient = () => {

apps/klesia/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2+
"extends": "@tsconfig/bun/tsconfig.json",
23
"compilerOptions": {
34
"strict": true,
45
"jsx": "react-jsx",
5-
"jsxImportSource": "hono/jsx"
6+
"jsxImportSource": "hono/jsx",
7+
"noPropertyAccessFromIndexSignature": false
68
}
79
}

packages/accounts/.turbo/turbo-build.log

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
CJS Build start
1111
CJS dist/index.js 2.25 KB
1212
CJS dist/index.js.map 1.44 KB
13-
CJS ⚡️ Build success in 8ms
13+
CJS ⚡️ Build success in 6ms
1414
ESM dist/index.mjs 575.00 B
1515
ESM dist/index.mjs.map 1.35 KB
16-
ESM ⚡️ Build success in 8ms
16+
ESM ⚡️ Build success in 7ms
1717
DTS Build start
18-
DTS ⚡️ Build success in 499ms
18+
DTS ⚡️ Build success in 516ms
1919
DTS dist/index.d.mts 631.00 B
2020
DTS dist/index.d.ts 631.00 B

packages/connect/.turbo/turbo-build.log

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
CJS Build start
1111
CJS dist/index.js 3.07 KB
1212
CJS dist/index.js.map 6.11 KB
13-
CJS ⚡️ Build success in 7ms
13+
CJS ⚡️ Build success in 5ms
1414
ESM dist/index.mjs 1.99 KB
1515
ESM dist/index.mjs.map 5.61 KB
16-
ESM ⚡️ Build success in 7ms
16+
ESM ⚡️ Build success in 6ms
1717
DTS Build start
18-
DTS ⚡️ Build success in 574ms
18+
DTS ⚡️ Build success in 594ms
1919
DTS dist/index.d.mts 2.51 KB
2020
DTS dist/index.d.ts 2.51 KB

packages/providers/.turbo/turbo-build.log

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
CJS Build start
1111
ESM dist/index.js 1.52 KB
1212
ESM dist/index.js.map 3.07 KB
13-
ESM ⚡️ Build success in 7ms
13+
ESM ⚡️ Build success in 6ms
1414
CJS dist/index.cjs 3.40 KB
1515
CJS dist/index.cjs.map 3.24 KB
16-
CJS ⚡️ Build success in 7ms
16+
CJS ⚡️ Build success in 6ms
1717
DTS Build start
18-
DTS ⚡️ Build success in 670ms
19-
DTS dist/index.d.ts 12.32 KB
20-
DTS dist/index.d.cts 12.32 KB
18+
DTS ⚡️ Build success in 643ms
19+
DTS dist/index.d.ts 12.33 KB
20+
DTS dist/index.d.cts 12.33 KB

packages/shared/.turbo/turbo-build.log

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
CLI Cleaning output folder
99
ESM Build start
1010
CJS Build start
11-
ESM dist/index.js 2.33 KB
12-
ESM dist/index.js.map 4.16 KB
13-
ESM ⚡️ Build success in 7ms
1411
CJS dist/index.cjs 4.62 KB
1512
CJS dist/index.cjs.map 4.36 KB
16-
CJS ⚡️ Build success in 7ms
13+
CJS ⚡️ Build success in 6ms
14+
ESM dist/index.js 2.33 KB
15+
ESM dist/index.js.map 4.16 KB
16+
ESM ⚡️ Build success in 6ms
1717
DTS Build start
18-
DTS ⚡️ Build success in 728ms
18+
DTS ⚡️ Build success in 719ms
1919
DTS dist/index.d.ts 11.44 KB
2020
DTS dist/index.d.cts 11.44 KB

0 commit comments

Comments
 (0)