@crvouga/mockingbird-service-meta 1.9.0 → 1.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-meta
2
2
 
3
+ ## 1.10.1 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - schedule packages whose tasks read another package's files ([7df459d](https://github.com/crvouga/mockingbird/commit/7df459d96132b4f84fa3553b1f907871c7e4f739))
8
+
9
+ ## 1.10.0 (2026-10-24)
10
+
11
+ ### Features
12
+
13
+ - add buffered SQL durability ([288bdcc](https://github.com/crvouga/mockingbird/commit/288bdcca84582787a54c4fdf9e803db9aac0b8d7))
14
+ - add efficient browser durability ([a8be579](https://github.com/crvouga/mockingbird/commit/a8be5799a883ddf6f731208e06f399410de4661a))
15
+
3
16
  ## 1.9.0 (2026-10-21)
4
17
 
5
18
  ### Features
@@ -9,7 +9,7 @@ import {
9
9
  parseFaultHeader,
10
10
  resolveAdminPrefix,
11
11
  restoreClock
12
- } from "./chunk-TXST376Z.js";
12
+ } from "./chunk-MDZQASPD.js";
13
13
 
14
14
  // ../../adapters/node/dist/cli.js
15
15
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
3057
3057
  break;
3058
3058
  }
3059
3059
  }
3060
- targets.set(name, { ...target, packageVersion: packageVersion ?? "1.9.0" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "1.10.1" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -5018,4 +5018,4 @@ export {
5018
5018
  createServer2 as createServer,
5019
5019
  serveTarget
5020
5020
  };
5021
- //# sourceMappingURL=chunk-LMA3FF5U.js.map
5021
+ //# sourceMappingURL=chunk-ALAUBSKS.js.map
@@ -331,15 +331,24 @@ var Collection = class {
331
331
  sqlite;
332
332
  namespace;
333
333
  collectionName;
334
+ statements = /* @__PURE__ */ new Map();
335
+ prepare(sql) {
336
+ let statement = this.statements.get(sql);
337
+ if (!statement) {
338
+ statement = this.sqlite.prepare(sql);
339
+ this.statements.set(sql, statement);
340
+ }
341
+ return statement;
342
+ }
334
343
  constructor(sqlite, namespace, collectionName) {
335
344
  this.sqlite = sqlite;
336
345
  this.namespace = namespace;
337
346
  this.collectionName = collectionName;
338
347
  }
339
348
  bumpCollectionSeq() {
340
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
349
+ const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
341
350
  const next = (row?.value ?? 0) + 1;
342
- this.sqlite.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
351
+ this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
343
352
  ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
344
353
  return next;
345
354
  }
@@ -347,13 +356,13 @@ var Collection = class {
347
356
  return this.sqlite.transaction(() => this.bumpCollectionSeq());
348
357
  }
349
358
  get(id) {
350
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
359
+ const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
351
360
  if (!row)
352
361
  return void 0;
353
362
  return JSON.parse(row.value).value;
354
363
  }
355
364
  has(id) {
356
- const row = this.sqlite.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
365
+ const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
357
366
  return row !== void 0;
358
367
  }
359
368
  /** Insert a new record, assigning it the next sequence number. */
@@ -361,7 +370,7 @@ var Collection = class {
361
370
  return this.sqlite.transaction(() => {
362
371
  const seq = this.bumpCollectionSeq();
363
372
  const stored = { seq, value };
364
- this.sqlite.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
373
+ this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
365
374
  VALUES (?, ?, ?, ?, ?)
366
375
  ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
367
376
  return stored;
@@ -370,25 +379,25 @@ var Collection = class {
370
379
  /** Replace an existing record's value, keeping its position. */
371
380
  update(id, value) {
372
381
  return this.sqlite.transaction(() => {
373
- const row = this.sqlite.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
382
+ const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
374
383
  if (!row)
375
384
  return void 0;
376
385
  const stored = { seq: row.seq, value };
377
- this.sqlite.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
386
+ this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
378
387
  return stored;
379
388
  });
380
389
  }
381
390
  delete(id) {
382
- const result = this.sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
391
+ const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
383
392
  return result.changes > 0;
384
393
  }
385
394
  /** How many records the collection holds, without reading them. */
386
395
  count() {
387
- const row = this.sqlite.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
396
+ const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
388
397
  return Number(row?.n ?? 0);
389
398
  }
390
399
  list(options = {}) {
391
- const rows = this.sqlite.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
400
+ const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
392
401
  const out = [];
393
402
  for (const row of rows) {
394
403
  const stored = JSON.parse(row.value);
@@ -4006,7 +4015,7 @@ var stateAdminRoutes = (routes) => {
4006
4015
  };
4007
4016
 
4008
4017
  // ../core/dist/version.js
4009
- var PACKAGE_VERSION = true ? "1.9.0" : UNRELEASED_VERSION;
4018
+ var PACKAGE_VERSION = true ? "1.10.1" : UNRELEASED_VERSION;
4010
4019
 
4011
4020
  // ../core/dist/webhooks.js
4012
4021
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5674,4 +5683,4 @@ export {
5674
5683
  accessTokenCredential,
5675
5684
  MetaAPI
5676
5685
  };
5677
- //# sourceMappingURL=chunk-TXST376Z.js.map
5686
+ //# sourceMappingURL=chunk-MDZQASPD.js.map