@pikku/kysely-sqlite 0.12.16 → 0.12.18

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.
Files changed (3) hide show
  1. package/package.json +15 -9
  2. package/CHANGELOG.md +0 -388
  3. package/run-tests.sh +0 -68
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely-sqlite",
3
- "version": "0.12.16",
3
+ "version": "0.12.18",
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.33",
26
- "kysely": "^0.29.5"
26
+ "@pikku/kysely": "^0.13.39",
27
+ "kysely": "^0.29.6"
27
28
  },
28
29
  "peerDependencies": {
29
- "@pikku/core": "^0.12.133"
30
+ "@pikku/core": "^0.12.144"
30
31
  },
31
32
  "devDependencies": {
32
- "@pikku/core": "^0.12.133"
33
+ "@pikku/core": "^0.12.144"
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,388 +0,0 @@
1
- # @pikku/kysely-sqlite
2
-
3
- ## 0.12.16
4
-
5
- ### Patch Changes
6
-
7
- - 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? })`.
8
- - Updated dependencies [a16b0ba]
9
- - Updated dependencies [21e9c3a]
10
- - Updated dependencies [a16b0ba]
11
- - Updated dependencies [a16b0ba]
12
- - @pikku/core@0.12.133
13
- - @pikku/kysely@0.13.33
14
-
15
- ## 0.12.15
16
-
17
- ### Patch Changes
18
-
19
- - 7740547: Let the SQLite and D1 Kysely factories take extra plugins, and stop the fabric
20
- coercion check from missing a bool-only map.
21
-
22
- `createNodeSqliteKysely` and `createBunSqliteKysely` both accept a `plugins`
23
- array, which is how the generated `coercionMap` reaches a Kysely instance.
24
- `createSQLiteKysely` and `createD1Kysely` did not: they hard-coded their plugin
25
- array, so the one instance a deployed Cloudflare Worker builds had no way to
26
- apply the coercion the CLI generates. They now take an options object with
27
- `plugins`, layered ahead of `SerializePlugin`, which has to stay last, and
28
- `@pikku/kysely-sqlite` re-exports `createCoercionPlugin` and `CoercionMap` the
29
- way `@pikku/kysely-node-sqlite` already did, so a worker that only depends on
30
- the SQLite package can build the plugin.
31
-
32
- The fabric `coercion-map-not-wired` check tested the generated file for
33
- `"date" | "boolean" | "json"`, but the codegen emits `bool`, never `boolean`. A
34
- project whose only annotated columns were booleans passed the check with the map
35
- unwired — exactly the case that is invisible locally, since the dev driver
36
- returns `true` where a deployed stage returns `1`.
37
-
38
- - Updated dependencies [1394385]
39
- - @pikku/core@0.12.124
40
-
41
- ## 0.12.14
42
-
43
- ### Patch Changes
44
-
45
- - 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
46
- package manager each package's `prepublishOnly` and build scripts invoke, plus
47
- the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
48
- declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
49
- its `uWebSockets.js` peer optional so a bun install of a consumer that brings
50
- its own uWS app does not try to fetch it from the registry.
51
-
52
- Three published behaviours change, all of them cases where an isolated
53
- `node_modules` or bun as the runtime had been papered over by yarn's hoisting:
54
-
55
- - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
56
- through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
57
- which silently turned every `ON DELETE CASCADE` into a no-op under
58
- `bunx --bun pikku`.
59
- - `@pikku/cli` resolves a deploy provider against the project being deployed
60
- rather than against wherever the CLI itself is installed, which is what its
61
- own "is not installed" error asks the user to arrange.
62
- - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
63
- for the modules it implements itself — as not resolved from the project, so
64
- it falls back rather than loading the runtime's own copy.
65
-
66
- - Updated dependencies [4c7a1b5]
67
- - @pikku/core@0.12.108
68
- - @pikku/kysely@0.13.25
69
-
70
- ## 0.12.13
71
-
72
- ### Patch Changes
73
-
74
- - 266e3bc: One door per name: `@pikku/core/ecosystem/*` and the package root are gone
75
-
76
- `@pikku/core` published every module twice. `ecosystem/http` re-exported
77
- `./http`, `ecosystem/services` re-exported `./services`, and a name was
78
- reachable through either — so every addition had to be made in two places, and a
79
- consumer's import said nothing about what it actually used. The package root was
80
- the same problem at a larger scale: a single barrel of 206 names that no bundler
81
- could take apart, and the one specifier that revealed nothing at all.
82
-
83
- Both are deleted. Every name now lives on the subpath that owns it, and every
84
- import carries that subpath — `@pikku/core/http`, `@pikku/core/services`,
85
- `@pikku/core/errors`, `@pikku/core/types`.
86
-
87
- Deleting the facades meant the raw subpaths had to become a superset of them,
88
- which they were not: the facade tree had accumulated 25 names with no raw home
89
- and about 26 more filed under a different area than the module they came from.
90
- Those names moved to the area that owns them, and three areas were published as
91
- new entry points rather than left on a root that is going away — `./types` (the
92
- shared type surface, the largest single destination), `./state` and
93
- `./classification`.
94
-
95
- `./classification` is one door onto one subject: what a value is and how it must
96
- be handled. Its three halves would each have been an entry point — the brands
97
- and manifest types, the stored-form helpers (`hashToken`, `unsafeAsSealed` and
98
- friends), and `SecretValue` — split by whether a name happens to be a type or a
99
- value, which is the same defect as the facades. The duration and versioned-id
100
- helpers went to `./utils`, which already published, and `PikkuRequest` went to
101
- `./function`: it is the transport-agnostic request base, not an HTTP one — HTTP
102
- has `PikkuHTTPAbstractRequest`, and the only thing outside core that extends
103
- `PikkuRequest` is Azure's timer request.
104
-
105
- `./types` inherited the root barrel's habit before it inherited its contents, so
106
- the names with an owner elsewhere were moved off it. The middleware types and the
107
- five middleware factories — `pikkuMiddleware`, `pikkuMiddlewareFactory`,
108
- `pikkuChannelMiddleware`, `pikkuChannelMiddlewareFactory` and
109
- `pikkuAgentMiddleware`, runtime values on a types entry point — are now
110
- `@pikku/core/middleware`; the function meta types are `@pikku/core/function`;
111
- `SerializedError` is `@pikku/core/errors`; and the generic TypeScript helpers
112
- (`MakeRequired`, `PickRequired`, `PickOptional`, `RequireAtLeastOne`,
113
- `JSONPrimitive`, `JSONValue`) are `@pikku/core/utils`. What is left on `./types`
114
- is the vocabulary the wirings share, which no single module owns.
115
-
116
- `pikku` was itself a root barrel — `export * from '@pikku/core'` — and
117
- now exports only the services it bundles.
118
-
119
- One module survives at the old specifier, and only for the bootstrap:
120
- `packages/cli` is generated by the _published_ CLI pinned in its `build.sh`, and
121
- that CLI still writes a bare `@pikku/core` into the files it generates for the
122
- CLI itself. `bootstrap-compat/root.ts` carries the eight types it names, a test
123
- in core fails if that list grows, and it goes when the pin moves to a CLI
124
- released from this branch. The adapter names the pinned CLI reaches for —
125
- `pikkuState` and `CreateWireServices` — are rewritten to `@pikku/core/state` and
126
- `@pikku/core/types` by the same `build.sh` patch pass, so no second shim is
127
- needed for them.
128
-
129
- A guard test keeps the root shut: it parses imports and rejects a bare
130
- `@pikku/core` rather than grepping for it, because several tests hold a user's
131
- file as a template literal, where `import … from '@pikku/core'` is fixture text
132
- rather than an import this repo makes.
133
-
134
- An agent scaffold a project generated under an older CLI is refreshed rather
135
- than left to fail: `pikku all` already deleted one importing an entry point
136
- `@pikku/core` no longer publishes, and the `#pikku` hub joins that list.
137
- Without it a project that scaffolds the agent endpoint but
138
- declares no agents keeps the old file forever — the generator that would rewrite
139
- it only runs when agents exist, and the file being present is what stops it
140
- being regenerated as missing.
141
-
142
- `pikku new addon` also wrote a tsconfig `paths` map naming only the deleted hub.
143
- An addon's `imports` map points into `dist`, so `paths` is what resolves
144
- `#pikku/<leaf>` for the addon's own source build — it now names the two leaf
145
- patterns, in both the addon and its test harness.
146
-
147
- - 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
148
- - Updated dependencies [7722ceb]
149
- - Updated dependencies [375c1ff]
150
- - Updated dependencies [02a70cd]
151
- - Updated dependencies [aeef159]
152
- - Updated dependencies [a281de6]
153
- - Updated dependencies [266e3bc]
154
- - Updated dependencies [02a70cd]
155
- - Updated dependencies [786dae5]
156
- - Updated dependencies [6eef0a0]
157
- - Updated dependencies [3561d67]
158
- - Updated dependencies [a91c433]
159
- - Updated dependencies [02a70cd]
160
- - Updated dependencies [9537f74]
161
- - Updated dependencies [2b57ca8]
162
- - Updated dependencies [266e3bc]
163
- - Updated dependencies [9fce0f1]
164
- - Updated dependencies [83683a0]
165
- - Updated dependencies [456c88b]
166
- - Updated dependencies [456c88b]
167
- - Updated dependencies [c127273]
168
- - @pikku/core@0.12.85
169
- - @pikku/kysely@0.13.17
170
-
171
- ## 0.12.12
172
-
173
- ### Patch Changes
174
-
175
- - 7406bfe: Rename the agent runtime from `AI*` to `Agent*` (#596)
176
-
177
- `AI` described the model provider, not the thing being named. Every symbol that
178
- belongs to the agent runtime now says `Agent`; the symbols that genuinely wrap a
179
- model provider — `AIEmbeddingService`, `AIProviderOptions`, `AIEmbedParams`,
180
- `AITranscriptionParams`, `AIGenerateImageParams` and their siblings, and the
181
- `@pikku/ai-vercel` / `@pikku/ai-deepinfra` / `@pikku/ai-voice` packages — keep
182
- their names.
183
-
184
- **Wiring**
185
- - `pikkuAIAgent` → `pikkuAgent`, `pikkuAIScorer` → `pikkuAgentScorer`,
186
- `pikkuAIJudge` → `pikkuAgentJudge`
187
- - `CoreAIAgent` → `CoreAgent`, `AIAgentInput` → `AgentInput`, `AIAgentStep` →
188
- `AgentStep`, `AIMessage` → `AgentMessage`, and the rest of the agent types
189
- - `AIAgentRunnerService` → `AgentRunnerService`, `AIStorageService` →
190
- `AgentStorageService`, `AIRunStateService` → `AgentRunStateService`
191
-
192
- **Entry points**
193
-
194
- `@pikku/core/agent` → `@pikku/core/agent`, `@pikku/core/agent-scorer` →
195
- `@pikku/core/agent-scorer`.
196
-
197
- **Queues**
198
-
199
- The scorer queues are now `agent-score-fast` and `agent-score-slow`. Drain the
200
- old `ai-score-fast` / `ai-score-slow` queues before deploying — jobs still
201
- sitting on them when the new workers start will never be picked up.
202
-
203
- **Scaffolds**
204
-
205
- The agent scaffold pikku wrote for your project — `<scaffold>/agent/agent.gen.ts`
206
- and its schemas file — imports `@pikku/core/ai-agent`, which no longer exists. A
207
- scaffold is normally written once and then left alone, so `pikku all` would find
208
- it present and leave the broken import in place. It now deletes an agent scaffold
209
- importing either removed entry point and regenerates it in the same run. Anything
210
- you added to that file goes with it, so move local edits out first.
211
-
212
- **Database**
213
-
214
- The agent tables are renamed: `ai_threads`, `ai_message`, `ai_tool_call`,
215
- `ai_working_memory`, `ai_run` and `ai_run_score` become `agent_threads`,
216
- `agent_message`, `agent_tool_call`, `agent_working_memory`, `agent_run` and
217
- `agent_run_score`, along with their indexes and the `ai_working_memory_pk`
218
- constraint. The same rename applies to the MongoDB collections.
219
-
220
- `ensurePikkuSchema` creates tables it cannot find, so an existing database will
221
- get empty `agent_*` tables and leave the old data stranded in `ai_*`. Rename
222
- them before the first boot on the new version:
223
-
224
- ```sql
225
- ALTER TABLE ai_threads RENAME TO agent_threads;
226
- ALTER TABLE ai_message RENAME TO agent_message;
227
- ALTER TABLE ai_tool_call RENAME TO agent_tool_call;
228
- ALTER TABLE ai_working_memory RENAME TO agent_working_memory;
229
- ALTER TABLE ai_run RENAME TO agent_run;
230
- ALTER TABLE ai_run_score RENAME TO agent_run_score;
231
- ```
232
-
233
- - 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.
234
-
235
- 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.
236
-
237
- 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.
238
-
239
- - Updated dependencies [7406bfe]
240
- - Updated dependencies [6794681]
241
- - Updated dependencies [a7fcd2e]
242
- - @pikku/core@0.12.84
243
- - @pikku/kysely@0.13.16
244
-
245
- ## 0.12.11
246
-
247
- ### Patch Changes
248
-
249
- - 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.
250
- - Updated dependencies [063f43a]
251
- - Updated dependencies [ce66bf8]
252
- - Updated dependencies [d0307a8]
253
- - Updated dependencies [ce66bf8]
254
- - Updated dependencies [3ad2131]
255
- - Updated dependencies [b930dca]
256
- - Updated dependencies [b95e77d]
257
- - Updated dependencies [fd9d834]
258
- - Updated dependencies [8978fbd]
259
- - @pikku/core@0.12.82
260
- - @pikku/kysely@0.13.15
261
-
262
- ## 0.12.10
263
-
264
- ### Patch Changes
265
-
266
- - 9d62571: Make user-defined SQL functions an explicit, checked capability of the SQLite drivers.
267
-
268
- `node:sqlite` can register scalar UDFs (`db.function()`); `bun:sqlite` cannot. Until now
269
- neither driver mentioned that, so an app that registered a UDF by reaching for the raw
270
- connection worked on Node and, on bun, failed as `no such function: …` from whichever
271
- query used it — typically one endpoint breaking in production while everything else
272
- looked healthy.
273
-
274
- Both drivers now export `registerSqliteFunctions(db, functions)` and accept a
275
- `functions` option on `createNodeSqliteKysely` / `createBunSqliteKysely`. The Node
276
- implementation registers them as deterministic; the bun implementation throws
277
- `SqliteFunctionsUnsupportedError` — exported from `@pikku/kysely-sqlite`, and naming
278
- every function requested — so the incompatibility surfaces at wiring time with a message
279
- saying what to do about it.
280
-
281
- - Updated dependencies [32277d5]
282
- - Updated dependencies [ea8aabf]
283
- - Updated dependencies [33e96ab]
284
- - Updated dependencies [fd72e58]
285
- - Updated dependencies [cabd9dc]
286
- - Updated dependencies [fd72e58]
287
- - Updated dependencies [fd72e58]
288
- - Updated dependencies [894b2f8]
289
- - Updated dependencies [dd19aa7]
290
- - Updated dependencies [50ec500]
291
- - @pikku/core@0.12.75
292
- - @pikku/kysely@0.13.8
293
-
294
- ## 0.12.9
295
-
296
- ### Patch Changes
297
-
298
- - 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`.
299
-
300
- 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.
301
-
302
- 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.
303
-
304
- Unsupported values now name their constructor — `unsupported argument type Map` rather than `unsupported argument type object`.
305
-
306
- - Updated dependencies [8a2c993]
307
- - Updated dependencies [a261006]
308
- - Updated dependencies [09973b9]
309
- - @pikku/core@0.12.71
310
- - @pikku/kysely@0.13.6
311
-
312
- ## 0.12.8
313
-
314
- ### Patch Changes
315
-
316
- - 66f3dae: Move `@pikku/core` from `dependencies` to `peerDependencies` in the last packages that still declared it as a regular dependency.
317
-
318
- `@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`).
319
-
320
- 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.
321
-
322
- 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.
323
-
324
- - Updated dependencies [ded4f90]
325
- - @pikku/core@0.12.54
326
-
327
- ## 0.12.7
328
-
329
- ### Patch Changes
330
-
331
- - 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
332
-
333
- 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.
334
-
335
- - Updated dependencies [241e6cf]
336
- - Updated dependencies [41ce2cb]
337
- - @pikku/kysely@0.13.0
338
- - @pikku/core@0.12.44
339
-
340
- ## 0.12.6
341
-
342
- ### Patch Changes
343
-
344
- - 34f254e: Bump the `kysely` dependency range to `^0.29.0` so it dedupes onto a single
345
- copy alongside Better Auth (which bundles kysely 0.29.x), avoiding two
346
- incompatible `Kysely` classes (the `#private` brand mismatch) when both pikku's
347
- adapters and Better Auth share a database connection.
348
-
349
- kysely 0.29 is ESM-only, which the unmaintained `kysely-plugin-serialize`
350
- (no `exports` map, CommonJS build) cannot import. Its `SerializePlugin` is now
351
- maintained directly in `@pikku/kysely` and re-exported, and the external
352
- dependency is dropped from `@pikku/kysely`, `@pikku/kysely-sqlite`, and
353
- `@pikku/cloudflare`.
354
-
355
- - Updated dependencies [6565b97]
356
- - Updated dependencies [34f254e]
357
- - @pikku/kysely@0.12.16
358
-
359
- ## 0.12.5
360
-
361
- ### Patch Changes
362
-
363
- - 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.
364
- - Updated dependencies [9060165]
365
- - Updated dependencies [9060165]
366
- - Updated dependencies [9060165]
367
- - @pikku/core@0.12.21
368
-
369
- ## 0.12.4
370
-
371
- ### Patch Changes
372
-
373
- - Fix workspace protocol references in published dependencies
374
-
375
- ## 0.12.3
376
-
377
- ### Patch Changes
378
-
379
- - Updated dependencies [387b2ee]
380
- - Updated dependencies [32ed003]
381
- - Updated dependencies [7d369f3]
382
- - Updated dependencies [508a796]
383
- - Updated dependencies [387b2ee]
384
- - Updated dependencies [b2b0af9]
385
- - Updated dependencies [ffe83af]
386
- - Updated dependencies [c7ff141]
387
- - @pikku/core@0.12.3
388
- - @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[@]}"