@brickkit/core 0.0.0-stage → 0.1.3
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 +27 -2
- package/dist/index.d.ts +799 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2031 -0
- package/dist/index.js.map +1 -0
- package/dist/pg.d.ts +9 -0
- package/dist/pg.d.ts.map +1 -0
- package/dist/pg.js +3 -0
- package/package.json +43 -4
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @brickkit/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Core engine primitives for the Brick-TS framework: typed services, actions,
|
|
4
|
+
resources, databases (SQLite/Postgres via Drizzle), secrets, and pub/sub —
|
|
5
|
+
all validated with TypeBox and runnable on Bun or Node.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bun add @brickkit/core drizzle-orm postgres
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { defineDatabase } from "@brickkit/core";
|
|
13
|
+
import { pgTable, text } from "@brickkit/core/pg";
|
|
14
|
+
|
|
15
|
+
const pages = pgTable("pages", {
|
|
16
|
+
id: text("id").primaryKey(),
|
|
17
|
+
title: text("title").notNull(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const db = defineDatabase({
|
|
21
|
+
engine: "postgres",
|
|
22
|
+
tables: { pages },
|
|
23
|
+
url: process.env.DATABASE_URL!,
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Bun-only APIs are lazy-loaded, so the package imports cleanly under
|
|
28
|
+
strict Node ESM too. Source: <https://github.com/Chandraprakash-Darji/brick>.
|