@pikku/kysely-sqlite 0.12.17 → 0.12.19

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.
@@ -1,6 +1,7 @@
1
1
  import { Kysely, type KyselyPlugin, type SqliteDatabase } from 'kysely';
2
+ import { type TraceDriverOptions } from '@pikku/kysely';
2
3
  import type { KyselyPikkuDB } from '@pikku/kysely';
3
- export interface CreateSQLiteKyselyOptions {
4
+ export interface CreateSQLiteKyselyOptions extends Omit<TraceDriverOptions, 'system'> {
4
5
  /** Extra plugins to layer on, ahead of the always-last SerializePlugin. */
5
6
  plugins?: KyselyPlugin[];
6
7
  }
@@ -1,8 +1,13 @@
1
1
  import { Kysely, SqliteDialect, } from 'kysely';
2
- import { SerializePlugin } from '@pikku/kysely';
2
+ import { SerializePlugin, traceDialect, } from '@pikku/kysely';
3
3
  export function createSQLiteKysely(database, options = {}) {
4
4
  return new Kysely({
5
- dialect: new SqliteDialect({ database }),
5
+ dialect: traceDialect(new SqliteDialect({ database }), {
6
+ tracer: options.tracer,
7
+ currentTrace: options.currentTrace,
8
+ recordSqlText: options.recordSqlText,
9
+ system: 'sqlite',
10
+ }),
6
11
  plugins: [...(options.plugins ?? []), new SerializePlugin()],
7
12
  });
8
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely-sqlite",
3
- "version": "0.12.17",
3
+ "version": "0.12.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -15,23 +15,29 @@
15
15
  "scripts": {
16
16
  "tsc": "tsc",
17
17
  "ncu": "npx npm-check-updates",
18
- "build": "tsc -b",
18
+ "build": "bun run clean && tsc -b",
19
19
  "test": "bash run-tests.sh",
20
20
  "test:watch": "bash run-tests.sh --watch",
21
21
  "test:coverage": "bash run-tests.sh --coverage",
22
- "prepublishOnly": "bun run build"
22
+ "prepublishOnly": "bun run build",
23
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
23
24
  },
24
25
  "dependencies": {
25
- "@pikku/kysely": "^0.13.35",
26
- "kysely": "^0.29.5"
26
+ "@pikku/kysely": "^0.13.43",
27
+ "kysely": "^0.29.6"
27
28
  },
28
29
  "peerDependencies": {
29
- "@pikku/core": "^0.12.138"
30
+ "@pikku/core": "^0.12.156"
30
31
  },
31
32
  "devDependencies": {
32
- "@pikku/core": "^0.12.138"
33
+ "@pikku/core": "^0.12.156"
33
34
  },
34
35
  "exports": {
35
- ".": "./dist/src/index.js"
36
- }
36
+ ".": "./dist/src/index.js",
37
+ "./package.json": "./package.json"
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "!dist/**/*.tsbuildinfo"
42
+ ]
37
43
  }
package/CHANGELOG.md DELETED
@@ -1,422 +0,0 @@
1
- # @pikku/kysely-sqlite
2
-
3
- ## 0.12.17
4
-
5
- ### Patch Changes
6
-
7
- - 15c4968: The default runtime path no longer needs `node:*`, `Buffer` or an unguarded `process`, so it loads on edge runtimes (Web APIs only).
8
-
9
- **Breaking:** `FileScenarioRunStore`, `scenarioArtifactContentType` and `scenarioRunSummary` leave the `@pikku/core/services` barrel because they use `node:fs`. Import them from `@pikku/core/services/file-scenario-run-store`. Pre-0.13 breaking changes still ship as a patch.
10
-
11
- **Breaking:** the HMAC helpers in `@pikku/core/hmac` run on Web Crypto, which is async. `hmacSha256Hex`, `hmacDigest`, `verifyHmacSignature` and `verifyPublicKeySignature` now return a Promise; `timingSafeStringEqual` stays synchronous. `WebhookService.sign` and `WebhookService.verify` return a Promise, and so does `verifySlackSignature` in `@pikku/gateway-slack`: `await` them. A function-style `verify` on a webhook source may return a Promise as well. `verifyPublicKeySignature` accepts RSA and EC (P-256, P-384, P-521) PEM keys; Ed25519 and RSA-PSS keys verify as false.
12
-
13
- `isProduction()` (and the `PIKKU_MODEL_ALIASES` and `PIKKU_ENV` reads) now ask the registered singleton services' `variables` service first, then `process.env` when `process` exists. With neither, `isProduction()` is true, so an edge deployment never exposes error details by accident. `LocalVariablesService` resolves its `process.env` default when constructed and falls back to an empty store without `process`.
14
-
15
- Workflow invocation ids use a built-in SHA-1 and stay byte-identical. `@pikku/kysely` and the Cloudflare hibernation server use `globalThis.crypto.randomUUID()` and no `Buffer`; `@pikku/kysely` is marked `sideEffects: false`. `@pikku/ai-deepinfra` reads `DEEPINFRA_API_KEY` only when `process` exists and decodes base64 audio without `Buffer`.
16
-
17
- Runtime tiers. A package declares where it can run in `package.json`: `"pikku": { "runtime": "edge" | "serverless" | "server" }`, with optional per-subpath overrides (`"exports": { "./dev": "server" }`). `server` is the default. `@pikku/core` and the default services are `edge` (core's Node-only subpaths are `server`), `@pikku/better-auth`, `@pikku/addon-admin` and `@pikku/cloudflare` are `serverless` (better-auth statically imports `node:crypto` scrypt), and `@pikku/addon-console` is `server` and must never land in a deployed unit.
18
-
19
- `pikku deploy` now verifies each deployed unit before bundling it. The unit is bundled with esbuild (neutral platform, `workerd`/`worker`/`browser` conditions) under its tier's profile, ahead of the adapter's aliases and stubs so they cannot hide anything, and the build fails when the bundle holds a package declared above the unit's tier or a Node built-in the runtime does not provide. The error names the unit, package, import chain and the fix. A built-in the provider stubs is a warning. On an edge unit, a bundled `InMemory*` class also fails the build. The unit's tier is its `runtime`, else the project's own `pikku.runtime`, else the provider default (`serverless` on Cloudflare). Packages that declare nothing are judged by their imports only.
20
-
21
- `ProviderAdapter.getRuntimeProfile(tier?)` returns the compat date, compat flags, the built-ins the runtime provides (keyed by compat date), the stubbed ones and the externals. The Cloudflare adapter derives `wrangler.toml`, the upload metadata and the bundle externals from it; `node:os` and `node:fs` are not provided before compat date 2025-09-15. The default is `nodejs_compat_v2` with compat date 2024-12-18, which is what `wrangler.toml` and Fabric's live workers already use, so Fabric deploys see no runtime change. Only the direct-API upload in `@pikku/deploy-cloudflare` (`createWorker`, used by its own `deploy()`) moves: it sent `nodejs_compat` with 2024-01-01 before. A newer date or flag is opt-in through the adapter option `new CloudflareProviderAdapter({ compatDate })` or `getCloudflareRuntimeProfile(tier, compatDate)`. From 2025-08-15 `node:http` and `node:https` exist, and from 2025-09-15 `node:os`, `node:fs` (stubbed by the build regardless) and `node:perf_hooks`; the verifier's allowed built-ins follow the effective date. A newer date changes the runtime of every worker deployed with it.
22
-
23
- `declareScopes(['pikku:console'])` (from `@pikku/core/scope`) declares scopes by id without wiring anything. `wireAddon({ scopes })` only requires a scope of an addon's functions; the tree arrives with the addon's metadata, so a role granting `pikku:console` used to fail PKU124 unless the addon was wired, and a wired `@pikku/addon-console` lands in every unit carrying the `/rpc` catch-all. An app that grants the scope without the console now calls `declareScopes` and no longer needs the scaffold or the addon. When the addon is wired its tree and descriptions win and the bare id adds nothing.
24
-
25
- More packages declare a tier after bundling each with the edge profile. `edge`: `@pikku/addon-graph`, `@pikku/pino`, `@pikku/jose`, `@pikku/ai-vercel`, `@pikku/ai-voice`. `serverless`: `@pikku/kysely-postgres` (postgres.js needs `node:buffer`, `stream`, `events`), `@pikku/backblaze` (`copyFile` reads a local file, which the build stubs), `@pikku/gateway-slack` (`@slack/web-api` imports `node:os` and `zlib`). `server`: `@pikku/schedule` (`cron` imports `child_process`), `@pikku/aws-services` (the AWS SDK's Node handler needs `node:http2`), `@pikku/browser` (puppeteer), and `@pikku/modelcontextprotocol` except its `./fetch` subpath, which is `edge`.
26
-
27
- `@pikku/addon-graph` no longer needs `node:crypto` or `Buffer`: the Crypto function hashes and HMACs on Web Crypto (MD5 is built in, since Web Crypto has none) and encodes with `TextEncoder`/`atob`/`btoa`, with output unchanged.
28
-
29
- - Updated dependencies [6f11bb5]
30
- - Updated dependencies [0c67e33]
31
- - Updated dependencies [15c4968]
32
- - Updated dependencies [d75a23d]
33
- - Updated dependencies [9b12c8a]
34
- - @pikku/core@0.12.138
35
- - @pikku/kysely@0.13.35
36
-
37
- ## 0.12.16
38
-
39
- ### Patch Changes
40
-
41
- - a16b0ba: Persistent workflow services take a required `leaseService` (`WorkflowServiceOptions`) and lock runs and steps on it. The Postgres advisory and MySQL `GET_LOCK` step locks, and Redis's own `SET NX` run and step locks, are removed; `RedisWorkflowService` now takes `(connection, { leaseService, keyPrefix? })`.
42
- - Updated dependencies [a16b0ba]
43
- - Updated dependencies [21e9c3a]
44
- - Updated dependencies [a16b0ba]
45
- - Updated dependencies [a16b0ba]
46
- - @pikku/core@0.12.133
47
- - @pikku/kysely@0.13.33
48
-
49
- ## 0.12.15
50
-
51
- ### Patch Changes
52
-
53
- - 7740547: Let the SQLite and D1 Kysely factories take extra plugins, and stop the fabric
54
- coercion check from missing a bool-only map.
55
-
56
- `createNodeSqliteKysely` and `createBunSqliteKysely` both accept a `plugins`
57
- array, which is how the generated `coercionMap` reaches a Kysely instance.
58
- `createSQLiteKysely` and `createD1Kysely` did not: they hard-coded their plugin
59
- array, so the one instance a deployed Cloudflare Worker builds had no way to
60
- apply the coercion the CLI generates. They now take an options object with
61
- `plugins`, layered ahead of `SerializePlugin`, which has to stay last, and
62
- `@pikku/kysely-sqlite` re-exports `createCoercionPlugin` and `CoercionMap` the
63
- way `@pikku/kysely-node-sqlite` already did, so a worker that only depends on
64
- the SQLite package can build the plugin.
65
-
66
- The fabric `coercion-map-not-wired` check tested the generated file for
67
- `"date" | "boolean" | "json"`, but the codegen emits `bool`, never `boolean`. A
68
- project whose only annotated columns were booleans passed the check with the map
69
- unwired — exactly the case that is invisible locally, since the dev driver
70
- returns `true` where a deployed stage returns `1`.
71
-
72
- - Updated dependencies [1394385]
73
- - @pikku/core@0.12.124
74
-
75
- ## 0.12.14
76
-
77
- ### Patch Changes
78
-
79
- - 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
80
- package manager each package's `prepublishOnly` and build scripts invoke, plus
81
- the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
82
- declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
83
- its `uWebSockets.js` peer optional so a bun install of a consumer that brings
84
- its own uWS app does not try to fetch it from the registry.
85
-
86
- Three published behaviours change, all of them cases where an isolated
87
- `node_modules` or bun as the runtime had been papered over by yarn's hoisting:
88
-
89
- - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
90
- through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
91
- which silently turned every `ON DELETE CASCADE` into a no-op under
92
- `bunx --bun pikku`.
93
- - `@pikku/cli` resolves a deploy provider against the project being deployed
94
- rather than against wherever the CLI itself is installed, which is what its
95
- own "is not installed" error asks the user to arrange.
96
- - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
97
- for the modules it implements itself — as not resolved from the project, so
98
- it falls back rather than loading the runtime's own copy.
99
-
100
- - Updated dependencies [4c7a1b5]
101
- - @pikku/core@0.12.108
102
- - @pikku/kysely@0.13.25
103
-
104
- ## 0.12.13
105
-
106
- ### Patch Changes
107
-
108
- - 266e3bc: One door per name: `@pikku/core/ecosystem/*` and the package root are gone
109
-
110
- `@pikku/core` published every module twice. `ecosystem/http` re-exported
111
- `./http`, `ecosystem/services` re-exported `./services`, and a name was
112
- reachable through either — so every addition had to be made in two places, and a
113
- consumer's import said nothing about what it actually used. The package root was
114
- the same problem at a larger scale: a single barrel of 206 names that no bundler
115
- could take apart, and the one specifier that revealed nothing at all.
116
-
117
- Both are deleted. Every name now lives on the subpath that owns it, and every
118
- import carries that subpath — `@pikku/core/http`, `@pikku/core/services`,
119
- `@pikku/core/errors`, `@pikku/core/types`.
120
-
121
- Deleting the facades meant the raw subpaths had to become a superset of them,
122
- which they were not: the facade tree had accumulated 25 names with no raw home
123
- and about 26 more filed under a different area than the module they came from.
124
- Those names moved to the area that owns them, and three areas were published as
125
- new entry points rather than left on a root that is going away — `./types` (the
126
- shared type surface, the largest single destination), `./state` and
127
- `./classification`.
128
-
129
- `./classification` is one door onto one subject: what a value is and how it must
130
- be handled. Its three halves would each have been an entry point — the brands
131
- and manifest types, the stored-form helpers (`hashToken`, `unsafeAsSealed` and
132
- friends), and `SecretValue` — split by whether a name happens to be a type or a
133
- value, which is the same defect as the facades. The duration and versioned-id
134
- helpers went to `./utils`, which already published, and `PikkuRequest` went to
135
- `./function`: it is the transport-agnostic request base, not an HTTP one — HTTP
136
- has `PikkuHTTPAbstractRequest`, and the only thing outside core that extends
137
- `PikkuRequest` is Azure's timer request.
138
-
139
- `./types` inherited the root barrel's habit before it inherited its contents, so
140
- the names with an owner elsewhere were moved off it. The middleware types and the
141
- five middleware factories — `pikkuMiddleware`, `pikkuMiddlewareFactory`,
142
- `pikkuChannelMiddleware`, `pikkuChannelMiddlewareFactory` and
143
- `pikkuAgentMiddleware`, runtime values on a types entry point — are now
144
- `@pikku/core/middleware`; the function meta types are `@pikku/core/function`;
145
- `SerializedError` is `@pikku/core/errors`; and the generic TypeScript helpers
146
- (`MakeRequired`, `PickRequired`, `PickOptional`, `RequireAtLeastOne`,
147
- `JSONPrimitive`, `JSONValue`) are `@pikku/core/utils`. What is left on `./types`
148
- is the vocabulary the wirings share, which no single module owns.
149
-
150
- `pikku` was itself a root barrel — `export * from '@pikku/core'` — and
151
- now exports only the services it bundles.
152
-
153
- One module survives at the old specifier, and only for the bootstrap:
154
- `packages/cli` is generated by the _published_ CLI pinned in its `build.sh`, and
155
- that CLI still writes a bare `@pikku/core` into the files it generates for the
156
- CLI itself. `bootstrap-compat/root.ts` carries the eight types it names, a test
157
- in core fails if that list grows, and it goes when the pin moves to a CLI
158
- released from this branch. The adapter names the pinned CLI reaches for —
159
- `pikkuState` and `CreateWireServices` — are rewritten to `@pikku/core/state` and
160
- `@pikku/core/types` by the same `build.sh` patch pass, so no second shim is
161
- needed for them.
162
-
163
- A guard test keeps the root shut: it parses imports and rejects a bare
164
- `@pikku/core` rather than grepping for it, because several tests hold a user's
165
- file as a template literal, where `import … from '@pikku/core'` is fixture text
166
- rather than an import this repo makes.
167
-
168
- An agent scaffold a project generated under an older CLI is refreshed rather
169
- than left to fail: `pikku all` already deleted one importing an entry point
170
- `@pikku/core` no longer publishes, and the `#pikku` hub joins that list.
171
- Without it a project that scaffolds the agent endpoint but
172
- declares no agents keeps the old file forever — the generator that would rewrite
173
- it only runs when agents exist, and the file being present is what stops it
174
- being regenerated as missing.
175
-
176
- `pikku new addon` also wrote a tsconfig `paths` map naming only the deleted hub.
177
- An addon's `imports` map points into `dist`, so `paths` is what resolves
178
- `#pikku/<leaf>` for the addon's own source build — it now names the two leaf
179
- patterns, in both the addon and its test harness.
180
-
181
- - 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
182
- - Updated dependencies [7722ceb]
183
- - Updated dependencies [375c1ff]
184
- - Updated dependencies [02a70cd]
185
- - Updated dependencies [aeef159]
186
- - Updated dependencies [a281de6]
187
- - Updated dependencies [266e3bc]
188
- - Updated dependencies [02a70cd]
189
- - Updated dependencies [786dae5]
190
- - Updated dependencies [6eef0a0]
191
- - Updated dependencies [3561d67]
192
- - Updated dependencies [a91c433]
193
- - Updated dependencies [02a70cd]
194
- - Updated dependencies [9537f74]
195
- - Updated dependencies [2b57ca8]
196
- - Updated dependencies [266e3bc]
197
- - Updated dependencies [9fce0f1]
198
- - Updated dependencies [83683a0]
199
- - Updated dependencies [456c88b]
200
- - Updated dependencies [456c88b]
201
- - Updated dependencies [c127273]
202
- - @pikku/core@0.12.85
203
- - @pikku/kysely@0.13.17
204
-
205
- ## 0.12.12
206
-
207
- ### Patch Changes
208
-
209
- - 7406bfe: Rename the agent runtime from `AI*` to `Agent*` (#596)
210
-
211
- `AI` described the model provider, not the thing being named. Every symbol that
212
- belongs to the agent runtime now says `Agent`; the symbols that genuinely wrap a
213
- model provider — `AIEmbeddingService`, `AIProviderOptions`, `AIEmbedParams`,
214
- `AITranscriptionParams`, `AIGenerateImageParams` and their siblings, and the
215
- `@pikku/ai-vercel` / `@pikku/ai-deepinfra` / `@pikku/ai-voice` packages — keep
216
- their names.
217
-
218
- **Wiring**
219
- - `pikkuAIAgent` → `pikkuAgent`, `pikkuAIScorer` → `pikkuAgentScorer`,
220
- `pikkuAIJudge` → `pikkuAgentJudge`
221
- - `CoreAIAgent` → `CoreAgent`, `AIAgentInput` → `AgentInput`, `AIAgentStep` →
222
- `AgentStep`, `AIMessage` → `AgentMessage`, and the rest of the agent types
223
- - `AIAgentRunnerService` → `AgentRunnerService`, `AIStorageService` →
224
- `AgentStorageService`, `AIRunStateService` → `AgentRunStateService`
225
-
226
- **Entry points**
227
-
228
- `@pikku/core/agent` → `@pikku/core/agent`, `@pikku/core/agent-scorer` →
229
- `@pikku/core/agent-scorer`.
230
-
231
- **Queues**
232
-
233
- The scorer queues are now `agent-score-fast` and `agent-score-slow`. Drain the
234
- old `ai-score-fast` / `ai-score-slow` queues before deploying — jobs still
235
- sitting on them when the new workers start will never be picked up.
236
-
237
- **Scaffolds**
238
-
239
- The agent scaffold pikku wrote for your project — `<scaffold>/agent/agent.gen.ts`
240
- and its schemas file — imports `@pikku/core/ai-agent`, which no longer exists. A
241
- scaffold is normally written once and then left alone, so `pikku all` would find
242
- it present and leave the broken import in place. It now deletes an agent scaffold
243
- importing either removed entry point and regenerates it in the same run. Anything
244
- you added to that file goes with it, so move local edits out first.
245
-
246
- **Database**
247
-
248
- The agent tables are renamed: `ai_threads`, `ai_message`, `ai_tool_call`,
249
- `ai_working_memory`, `ai_run` and `ai_run_score` become `agent_threads`,
250
- `agent_message`, `agent_tool_call`, `agent_working_memory`, `agent_run` and
251
- `agent_run_score`, along with their indexes and the `ai_working_memory_pk`
252
- constraint. The same rename applies to the MongoDB collections.
253
-
254
- `ensurePikkuSchema` creates tables it cannot find, so an existing database will
255
- get empty `agent_*` tables and leave the old data stranded in `ai_*`. Rename
256
- them before the first boot on the new version:
257
-
258
- ```sql
259
- ALTER TABLE ai_threads RENAME TO agent_threads;
260
- ALTER TABLE ai_message RENAME TO agent_message;
261
- ALTER TABLE ai_tool_call RENAME TO agent_tool_call;
262
- ALTER TABLE ai_working_memory RENAME TO agent_working_memory;
263
- ALTER TABLE ai_run RENAME TO agent_run;
264
- ALTER TABLE ai_run_score RENAME TO agent_run_score;
265
- ```
266
-
267
- - 6794681: Publish the ecosystem surface as per-area sub-barrels under `@pikku/core/ecosystem/*`, and point generated code, the CLI, the inspector and the runtime adapters at them.
268
-
269
- 348 names that only generated code, the toolchain or a runtime adapter ever imports now have a second home on `@pikku/core/ecosystem/<area>` — one sub-barrel per area, matching how core already publishes its entrypoints, so no single barrel grows without bound and a consumer only pulls in the area it uses.
270
-
271
- This step is additive: every name is still exported from the entrypoint it was published from before, so nothing downstream breaks. Removing them from the app-facing barrels is a later change, and needs a release carrying `./ecosystem/*` first.
272
-
273
- - Updated dependencies [7406bfe]
274
- - Updated dependencies [6794681]
275
- - Updated dependencies [a7fcd2e]
276
- - @pikku/core@0.12.84
277
- - @pikku/kysely@0.13.16
278
-
279
- ## 0.12.11
280
-
281
- ### Patch Changes
282
-
283
- - fd9d834: Stop publishing internals that only their own package or file used. The declarations stay; only the entrypoint re-export is removed, so nothing that imported a name from where it is declared is affected.
284
- - Updated dependencies [063f43a]
285
- - Updated dependencies [ce66bf8]
286
- - Updated dependencies [d0307a8]
287
- - Updated dependencies [ce66bf8]
288
- - Updated dependencies [3ad2131]
289
- - Updated dependencies [b930dca]
290
- - Updated dependencies [b95e77d]
291
- - Updated dependencies [fd9d834]
292
- - Updated dependencies [8978fbd]
293
- - @pikku/core@0.12.82
294
- - @pikku/kysely@0.13.15
295
-
296
- ## 0.12.10
297
-
298
- ### Patch Changes
299
-
300
- - 9d62571: Make user-defined SQL functions an explicit, checked capability of the SQLite drivers.
301
-
302
- `node:sqlite` can register scalar UDFs (`db.function()`); `bun:sqlite` cannot. Until now
303
- neither driver mentioned that, so an app that registered a UDF by reaching for the raw
304
- connection worked on Node and, on bun, failed as `no such function: …` from whichever
305
- query used it — typically one endpoint breaking in production while everything else
306
- looked healthy.
307
-
308
- Both drivers now export `registerSqliteFunctions(db, functions)` and accept a
309
- `functions` option on `createNodeSqliteKysely` / `createBunSqliteKysely`. The Node
310
- implementation registers them as deterministic; the bun implementation throws
311
- `SqliteFunctionsUnsupportedError` — exported from `@pikku/kysely-sqlite`, and naming
312
- every function requested — so the incompatibility surfaces at wiring time with a message
313
- saying what to do about it.
314
-
315
- - Updated dependencies [32277d5]
316
- - Updated dependencies [ea8aabf]
317
- - Updated dependencies [33e96ab]
318
- - Updated dependencies [fd72e58]
319
- - Updated dependencies [cabd9dc]
320
- - Updated dependencies [fd72e58]
321
- - Updated dependencies [fd72e58]
322
- - Updated dependencies [894b2f8]
323
- - Updated dependencies [dd19aa7]
324
- - Updated dependencies [50ec500]
325
- - @pikku/core@0.12.75
326
- - @pikku/kysely@0.13.8
327
-
328
- ## 0.12.9
329
-
330
- ### Patch Changes
331
-
332
- - c335f73: `LibsqlWebDialect` now encodes a `Date` bind parameter as an ISO-8601 string and an array or plain record as JSON, instead of throwing `libsql: unsupported argument type object`.
333
-
334
- This closes a dev/prod split that broke every write in a deployed libsql app. The CLI's `node:sqlite` dev runtime already coerced dates and objects before binding them, so a query that stamps a `createdAt` or writes a JSON column passed under `pikku dev` — and then threw on the same code path once the app was deployed to a Worker, where this dialect is the one in use. Reads were unaffected, so the symptom was an app whose every insert and update failed while every list and get worked.
335
-
336
- Both runtimes also stop accepting objects JSON cannot faithfully represent. A `Map`, a `RegExp` or a class instance stringifies to `"{}"` or to a partial view of itself, so binding one used to persist an empty JSON blob where the caller meant something; it now throws. Only arrays and plain records (including null-prototype ones) are JSON-encoded. The two coercions are deliberately identical — a value that binds under `pikku dev` binds the same way once deployed, which is the property whose absence caused the original bug.
337
-
338
- Unsupported values now name their constructor — `unsupported argument type Map` rather than `unsupported argument type object`.
339
-
340
- - Updated dependencies [8a2c993]
341
- - Updated dependencies [a261006]
342
- - Updated dependencies [09973b9]
343
- - @pikku/core@0.12.71
344
- - @pikku/kysely@0.13.6
345
-
346
- ## 0.12.8
347
-
348
- ### Patch Changes
349
-
350
- - 66f3dae: Move `@pikku/core` from `dependencies` to `peerDependencies` in the last packages that still declared it as a regular dependency.
351
-
352
- `@pikku/core` holds a single `pikkuState` registry and must resolve to exactly one copy at runtime — every wiring (workflows, RPCs, queue workers, middleware) registers into the copy it imports, and the runner reads the copy it imports. 35 packages already declare core as a peer for this reason; these six were the stragglers. Because they carried a regular `@pikku/core` dependency, bumping any one of them could leave a second, older core locked in a consumer's tree, splitting the registry so wirings silently fail to resolve (surfaced as `[PKU717] Multiple @pikku/core versions installed`).
353
-
354
- Making core a peer everywhere means the consuming app provides the one copy (the react/react-dom singleton pattern), so duplication is structurally impossible. `@pikku/core` is also kept as a devDependency in each package so it still builds/typechecks standalone.
355
-
356
- Backward-compatible for consumers that already list `@pikku/core` directly (every template does). A consumer that only pulled core transitively now gets a loud install-time peer warning instead of a silent runtime split — strictly better.
357
-
358
- - Updated dependencies [ded4f90]
359
- - @pikku/core@0.12.54
360
-
361
- ## 0.12.7
362
-
363
- ### Patch Changes
364
-
365
- - 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
366
-
367
- All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.
368
-
369
- - Updated dependencies [241e6cf]
370
- - Updated dependencies [41ce2cb]
371
- - @pikku/kysely@0.13.0
372
- - @pikku/core@0.12.44
373
-
374
- ## 0.12.6
375
-
376
- ### Patch Changes
377
-
378
- - 34f254e: Bump the `kysely` dependency range to `^0.29.0` so it dedupes onto a single
379
- copy alongside Better Auth (which bundles kysely 0.29.x), avoiding two
380
- incompatible `Kysely` classes (the `#private` brand mismatch) when both pikku's
381
- adapters and Better Auth share a database connection.
382
-
383
- kysely 0.29 is ESM-only, which the unmaintained `kysely-plugin-serialize`
384
- (no `exports` map, CommonJS build) cannot import. Its `SerializePlugin` is now
385
- maintained directly in `@pikku/kysely` and re-exported, and the external
386
- dependency is dropped from `@pikku/kysely`, `@pikku/kysely-sqlite`, and
387
- `@pikku/cloudflare`.
388
-
389
- - Updated dependencies [6565b97]
390
- - Updated dependencies [34f254e]
391
- - @pikku/kysely@0.12.16
392
-
393
- ## 0.12.5
394
-
395
- ### Patch Changes
396
-
397
- - 9060165: New `@pikku/kysely-node-sqlite` provides a Kysely dialect and migrator for Node's built-in `node:sqlite`. `@pikku/kysely-sqlite` adds a `LibsqlWebDialect` for running Kysely against Cloudflare Workers and Turso databases over HTTP.
398
- - Updated dependencies [9060165]
399
- - Updated dependencies [9060165]
400
- - Updated dependencies [9060165]
401
- - @pikku/core@0.12.21
402
-
403
- ## 0.12.4
404
-
405
- ### Patch Changes
406
-
407
- - Fix workspace protocol references in published dependencies
408
-
409
- ## 0.12.3
410
-
411
- ### Patch Changes
412
-
413
- - Updated dependencies [387b2ee]
414
- - Updated dependencies [32ed003]
415
- - Updated dependencies [7d369f3]
416
- - Updated dependencies [508a796]
417
- - Updated dependencies [387b2ee]
418
- - Updated dependencies [b2b0af9]
419
- - Updated dependencies [ffe83af]
420
- - Updated dependencies [c7ff141]
421
- - @pikku/core@0.12.3
422
- - @pikku/kysely@0.12.3
package/run-tests.sh DELETED
@@ -1,68 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Enable nullglob to handle cases where no files match the pattern
4
- shopt -s nullglob
5
-
6
- # Initialize variables for options
7
- watch_mode=false
8
- coverage_mode=false
9
-
10
- # Parse command-line options
11
- while [[ $# -gt 0 ]]; do
12
- case $1 in
13
- --watch)
14
- watch_mode=true
15
- shift
16
- ;;
17
- --coverage)
18
- coverage_mode=true
19
- shift
20
- ;;
21
- *)
22
- echo "Unknown option: $1"
23
- exit 1
24
- ;;
25
- esac
26
- done
27
-
28
- # Define the pattern to match your test files
29
- pattern="src/*.test.ts"
30
-
31
- # Expand the pattern into an array of files
32
- files=($(find src -type f -name "*.test.ts"))
33
-
34
- # Check if any files matched the pattern
35
- if [ ${#files[@]} -eq 0 ]; then
36
- echo "No test files found matching pattern: $pattern"
37
- if [ "${STRICT_TEST_DISCOVERY}" = "1" ]; then
38
- exit 1
39
- fi
40
- exit 0
41
- fi
42
-
43
- # Construct the bun command
44
- #
45
- # --parallel gives every test file its own worker process, which is what node's
46
- # `--test` did. Several suites keep module-level caches (a TypeScript program, a
47
- # temp fixture directory) that a shared process would leak between files.
48
- #
49
- # --timeout because bun caps a test at 5s by default where node had no cap, and
50
- # the suites that build real TypeScript programs run well past that.
51
- bun_cmd=(bun test --parallel --timeout 120000)
52
-
53
- # Append options based on flags
54
- if [ "$watch_mode" = true ]; then
55
- # --watch reruns in one process; parallel workers have nothing to watch.
56
- bun_cmd=(bun test --watch --timeout 120000)
57
- fi
58
-
59
- if [ "$coverage_mode" = true ]; then
60
- # --coverage-dir=. keeps lcov.info at the package root: CI merges every
61
- # package's report by prefixing its SF paths with the file's own directory,
62
- # so a nested coverage/ directory would re-root them one level too deep.
63
- bun_cmd+=(--coverage --coverage-reporter=lcov --coverage-reporter=text --coverage-dir=.)
64
- export PIKKU_TEST_COVERAGE=1
65
- fi
66
-
67
- # Execute the bun command with the expanded list of files
68
- "${bun_cmd[@]}" "${files[@]}"