@crvouga/mockingbird-service-linear 0.8.0 → 0.9.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-linear
2
2
 
3
+ ## 0.9.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
+ ## 0.9.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
  ## 0.8.0 (2026-10-21)
4
17
 
5
18
  ### Features
@@ -460,15 +460,24 @@ var Collection = class {
460
460
  sqlite;
461
461
  namespace;
462
462
  collectionName;
463
+ statements = /* @__PURE__ */ new Map();
464
+ prepare(sql) {
465
+ let statement = this.statements.get(sql);
466
+ if (!statement) {
467
+ statement = this.sqlite.prepare(sql);
468
+ this.statements.set(sql, statement);
469
+ }
470
+ return statement;
471
+ }
463
472
  constructor(sqlite, namespace, collectionName) {
464
473
  this.sqlite = sqlite;
465
474
  this.namespace = namespace;
466
475
  this.collectionName = collectionName;
467
476
  }
468
477
  bumpCollectionSeq() {
469
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
478
+ const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
470
479
  const next = (row?.value ?? 0) + 1;
471
- this.sqlite.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
480
+ this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
472
481
  ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
473
482
  return next;
474
483
  }
@@ -476,13 +485,13 @@ var Collection = class {
476
485
  return this.sqlite.transaction(() => this.bumpCollectionSeq());
477
486
  }
478
487
  get(id) {
479
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
488
+ const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
480
489
  if (!row)
481
490
  return void 0;
482
491
  return JSON.parse(row.value).value;
483
492
  }
484
493
  has(id) {
485
- const row = this.sqlite.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
494
+ const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
486
495
  return row !== void 0;
487
496
  }
488
497
  /** Insert a new record, assigning it the next sequence number. */
@@ -490,7 +499,7 @@ var Collection = class {
490
499
  return this.sqlite.transaction(() => {
491
500
  const seq = this.bumpCollectionSeq();
492
501
  const stored = { seq, value };
493
- this.sqlite.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
502
+ this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
494
503
  VALUES (?, ?, ?, ?, ?)
495
504
  ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
496
505
  return stored;
@@ -499,25 +508,25 @@ var Collection = class {
499
508
  /** Replace an existing record's value, keeping its position. */
500
509
  update(id, value) {
501
510
  return this.sqlite.transaction(() => {
502
- const row = this.sqlite.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
511
+ const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
503
512
  if (!row)
504
513
  return void 0;
505
514
  const stored = { seq: row.seq, value };
506
- this.sqlite.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
515
+ this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
507
516
  return stored;
508
517
  });
509
518
  }
510
519
  delete(id) {
511
- const result = this.sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
520
+ const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
512
521
  return result.changes > 0;
513
522
  }
514
523
  /** How many records the collection holds, without reading them. */
515
524
  count() {
516
- const row = this.sqlite.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
525
+ const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
517
526
  return Number(row?.n ?? 0);
518
527
  }
519
528
  list(options = {}) {
520
- const rows = this.sqlite.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
529
+ const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
521
530
  const out = [];
522
531
  for (const row of rows) {
523
532
  const stored = JSON.parse(row.value);
@@ -3808,7 +3817,7 @@ var stateAdminRoutes = (routes) => {
3808
3817
  };
3809
3818
 
3810
3819
  // ../core/dist/version.js
3811
- var PACKAGE_VERSION = true ? "0.8.0" : UNRELEASED_VERSION;
3820
+ var PACKAGE_VERSION = true ? "0.9.1" : UNRELEASED_VERSION;
3812
3821
 
3813
3822
  // ../core/dist/webhooks.js
3814
3823
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -9572,4 +9581,4 @@ export {
9572
9581
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
9573
9582
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
9574
9583
  */
9575
- //# sourceMappingURL=chunk-QT32CARK.js.map
9584
+ //# sourceMappingURL=chunk-2JKIWI4U.js.map