@crvouga/mockingbird-service-junction 2.3.1 → 3.0.0

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,24 @@
1
1
  # Changelog — @crvouga/mockingbird-service-junction
2
2
 
3
+ ## 3.0.0 (2026-10-07)
4
+
5
+ ### ⚠️ Breaking changes
6
+
7
+ - point the repo at crvouga/mockingbird ([1bf35a4](https://github.com/crvouga/mockingbird/commit/1bf35a422b84a85b50b09b72bd7cc7093082a86e))
8
+ - point the repo at crvouga/emulates ([cdb5e53](https://github.com/crvouga/mockingbird/commit/cdb5e536ed8c1f52345e3984f089001c25fdb08a))
9
+ - rename Emulators to Emulates ([2e10d9c](https://github.com/crvouga/mockingbird/commit/2e10d9cff84c54ac37768fc9a19d1aefd3943744))
10
+ - rebrand Mockingbird to Emulators ([1adca65](https://github.com/crvouga/mockingbird/commit/1adca65ce28242f11cff98eac05d2be88f680cbe))
11
+
12
+ ### Fixes and improvements
13
+
14
+ - typecheck the brand gate before builds ([fc36095](https://github.com/crvouga/mockingbird/commit/fc3609514de70ffe3170a5d216fb8a49f9ce7cbb))
15
+ - format the emulates records query ([8698872](https://github.com/crvouga/mockingbird/commit/8698872509d06002be5a8fcdc85d79f8462320c3))
16
+ - preserve JSON prototype keys ([fba8e4d](https://github.com/crvouga/mockingbird/commit/fba8e4d2e4219d825f1ca705cabc44b5dbbb8f02))
17
+
18
+ ### Dependencies
19
+
20
+ - `@crvouga/mockingbird-service-sqlite`
21
+
3
22
  ## 2.3.1 (2026-10-05)
4
23
 
5
24
  ### Fixes and improvements
@@ -57,8 +57,38 @@ var CORE_MIGRATIONS = [
57
57
  `
58
58
  }
59
59
  ];
60
+ var LEGACY_TABLES = [
61
+ ["emulates_records", "mockingbird_records"],
62
+ ["emulators_records", "mockingbird_records"],
63
+ ["emulates_sequences", "mockingbird_sequences"],
64
+ ["emulators_sequences", "mockingbird_sequences"]
65
+ ];
66
+ var LEGACY_INDEXES = [
67
+ ["emulates_records_seq", "mockingbird_records_seq"],
68
+ ["emulators_records_seq", "mockingbird_records_seq"]
69
+ ];
70
+ var namesOf = (sqlite, type) => new Set(sqlite.prepare("SELECT name FROM sqlite_master WHERE type = ?").all(type).map((row) => row.name));
60
71
  var migrateCore = (sqlite) => {
61
72
  migrate(sqlite, CORE_MIGRATIONS);
73
+ const tables = namesOf(sqlite, "table");
74
+ const indexes = namesOf(sqlite, "index");
75
+ sqlite.transaction(() => {
76
+ for (const [from, to] of LEGACY_TABLES) {
77
+ if (!tables.has(from) || tables.has(to))
78
+ continue;
79
+ sqlite.exec(`ALTER TABLE ${from} RENAME TO ${to}`);
80
+ tables.delete(from);
81
+ tables.add(to);
82
+ }
83
+ for (const [from, to] of LEGACY_INDEXES) {
84
+ if (!indexes.has(from) || indexes.has(to))
85
+ continue;
86
+ sqlite.exec(`DROP INDEX ${from}`);
87
+ sqlite.exec(`CREATE INDEX ${to} ON mockingbird_records (namespace, collection, seq)`);
88
+ indexes.delete(from);
89
+ indexes.add(to);
90
+ }
91
+ });
62
92
  };
63
93
  var clearNamespace = (sqlite, namespace) => {
64
94
  sqlite.transaction(() => {
@@ -2108,7 +2138,7 @@ var stateAdminRoutes = (routes) => {
2108
2138
  };
2109
2139
 
2110
2140
  // ../core/dist/version.js
2111
- var PACKAGE_VERSION = true ? "2.3.1" : UNRELEASED_VERSION;
2141
+ var PACKAGE_VERSION = true ? "3.0.0" : UNRELEASED_VERSION;
2112
2142
 
2113
2143
  // ../core/dist/webhooks.js
2114
2144
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -10899,4 +10929,4 @@ export {
10899
10929
  JunctionAPI,
10900
10930
  LabAccountConflict
10901
10931
  };
10902
- //# sourceMappingURL=chunk-UHZKTYBX.js.map
10932
+ //# sourceMappingURL=chunk-G3BD4D34.js.map