@coreframe/scripts 0.1.0 → 0.1.2

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 (96) hide show
  1. package/dist/config.d.ts +18 -4
  2. package/dist/config.js +1 -3
  3. package/dist/coreframe.d.ts +243 -241
  4. package/dist/coreframe.js +1 -239
  5. package/dist/db/client.d.ts +26 -18
  6. package/dist/db/client.js +1 -29
  7. package/dist/db/config.d.ts +22 -19
  8. package/dist/db/config.js +1 -32
  9. package/dist/db/drizzle-kit.d.ts +6 -5
  10. package/dist/db/drizzle-kit.js +1 -21
  11. package/dist/db/ensure.d.ts +20 -2
  12. package/dist/db/ensure.js +1 -39
  13. package/dist/db/migrate-held.d.ts +16 -10
  14. package/dist/db/migrate-held.js +3 -112
  15. package/dist/db/migrate.d.ts +4 -2
  16. package/dist/db/migrate.js +1 -24
  17. package/dist/db/project.d.ts +19 -7
  18. package/dist/db/project.js +1 -9
  19. package/dist/db/reset.d.ts +4 -2
  20. package/dist/db/reset.js +1 -18
  21. package/dist/db/schema-push.d.ts +22 -0
  22. package/dist/db/schema-push.js +1 -0
  23. package/dist/db/seed.d.ts +6 -3
  24. package/dist/db/seed.js +1 -22
  25. package/dist/db/setup.d.ts +6 -3
  26. package/dist/db/setup.js +1 -14
  27. package/dist/deploy/check-migrations.d.ts +4 -2
  28. package/dist/deploy/check-migrations.js +1 -17
  29. package/dist/deploy/checks.d.ts +6 -2
  30. package/dist/deploy/checks.js +1 -27
  31. package/dist/deploy/config.d.ts +47 -44
  32. package/dist/deploy/config.js +1 -9
  33. package/dist/deploy/migrations.d.ts +21 -18
  34. package/dist/deploy/migrations.js +4 -203
  35. package/dist/deploy/pending-migrations.d.ts +9 -5
  36. package/dist/deploy/pending-migrations.js +1 -30
  37. package/dist/deploy/tauri-release.d.ts +93 -73
  38. package/dist/deploy/tauri-release.js +1 -512
  39. package/dist/deploy/version.d.ts +15 -13
  40. package/dist/deploy/version.js +1 -41
  41. package/dist/deploy.d.ts +16 -15
  42. package/dist/deploy.js +1 -246
  43. package/dist/dev.d.ts +23 -12
  44. package/dist/dev.js +1 -95
  45. package/dist/image-generator.d.ts +18 -2
  46. package/dist/image-generator.js +1 -59
  47. package/dist/project.d.ts +4 -1
  48. package/dist/project.js +1 -13
  49. package/dist/typecheck.d.ts +4 -2
  50. package/dist/typecheck.js +1 -44
  51. package/dist/upgrade/check-skill-current.d.ts +10 -5
  52. package/dist/upgrade/check-skill-current.js +1 -87
  53. package/dist/upgrade/ensure-template-remote.d.ts +10 -5
  54. package/dist/upgrade/ensure-template-remote.js +1 -56
  55. package/dist/upgrade/fast-forward-template-files.d.ts +8 -6
  56. package/dist/upgrade/fast-forward-template-files.js +1 -279
  57. package/package.json +7 -2
  58. package/config.test.ts +0 -15
  59. package/config.ts +0 -9
  60. package/coreframe.ts +0 -272
  61. package/db/client.ts +0 -72
  62. package/db/config.ts +0 -41
  63. package/db/drizzle-kit.test.ts +0 -27
  64. package/db/drizzle-kit.ts +0 -39
  65. package/db/ensure.ts +0 -67
  66. package/db/migrate-held.test.ts +0 -81
  67. package/db/migrate-held.ts +0 -166
  68. package/db/migrate.ts +0 -39
  69. package/db/project.ts +0 -28
  70. package/db/reset.ts +0 -24
  71. package/db/seed.ts +0 -38
  72. package/db/setup.ts +0 -18
  73. package/deploy/check-migrations.ts +0 -31
  74. package/deploy/checks.ts +0 -38
  75. package/deploy/config.test.ts +0 -24
  76. package/deploy/config.ts +0 -68
  77. package/deploy/migrations.test.ts +0 -110
  78. package/deploy/migrations.ts +0 -317
  79. package/deploy/pending-migrations.test.ts +0 -93
  80. package/deploy/pending-migrations.ts +0 -45
  81. package/deploy/tauri-release.test.ts +0 -196
  82. package/deploy/tauri-release.ts +0 -816
  83. package/deploy/version.test.ts +0 -29
  84. package/deploy/version.ts +0 -65
  85. package/deploy.test.ts +0 -101
  86. package/deploy.ts +0 -346
  87. package/dev.test.ts +0 -153
  88. package/dev.ts +0 -155
  89. package/image-generator.ts +0 -84
  90. package/project.ts +0 -6
  91. package/tsconfig.build.json +0 -12
  92. package/tsconfig.json +0 -20
  93. package/typecheck.ts +0 -55
  94. package/upgrade/check-skill-current.ts +0 -112
  95. package/upgrade/ensure-template-remote.ts +0 -79
  96. package/upgrade/fast-forward-template-files.ts +0 -408
@@ -1,203 +1,4 @@
1
- import { access, readFile, readdir } from "node:fs/promises";
2
- import { basename, join, relative, resolve } from "node:path";
3
- import { HELD_MIGRATIONS_FOLDER, MIGRATIONS_FOLDER } from "../db/config.js";
4
- const staticBlockedPatterns = [
5
- {
6
- code: "drop-schema-object",
7
- pattern: /\bdrop\s+(?:table|view|materialized\s+view|index|sequence|type|schema|function|trigger|policy)\b/giu,
8
- reason: "drops schema that the currently deployed app may still depend on",
9
- },
10
- {
11
- code: "drop-column",
12
- pattern: /\balter\s+table\b[^;]*?\bdrop\s+column\b/giu,
13
- reason: "removes a column that the currently deployed app may still read or write",
14
- },
15
- {
16
- code: "drop-constraint",
17
- pattern: /\balter\s+table\b[^;]*?\bdrop\s+constraint\b/giu,
18
- reason: "removes a constraint outside the staged contract phase",
19
- },
20
- {
21
- code: "truncate",
22
- pattern: /\btruncate\b/giu,
23
- reason: "removes data outside the deploy-safe migration path",
24
- },
25
- {
26
- code: "rename-table-or-column",
27
- pattern: /\balter\s+table\b[^;]*?\brename(?:\s+column)?\b/giu,
28
- reason: "renames schema in a way old and new app versions cannot both address",
29
- },
30
- {
31
- code: "rewrite-column-type",
32
- pattern: /\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\btype\b/giu,
33
- reason: "rewrites a column type outside a staged expand/contract rollout",
34
- },
35
- {
36
- code: "set-not-null",
37
- pattern: /\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\bset\s+not\s+null\b/giu,
38
- reason: "enforces NOT NULL before a separate backfill and verification step",
39
- },
40
- {
41
- code: "set-default",
42
- pattern: /\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\bset\s+default\b/giu,
43
- reason: "changes default write behavior while old app code may still be running",
44
- },
45
- {
46
- code: "broad-update",
47
- pattern: /\bupdate\b/giu,
48
- reason: "changes data outside a separately reviewed backfill or held migration",
49
- },
50
- {
51
- code: "broad-delete",
52
- pattern: /\bdelete\s+from\b/giu,
53
- reason: "removes data outside a held migration",
54
- },
55
- ];
56
- export async function collectDeployMigrationFiles(cwd = process.cwd()) {
57
- return collectDrizzleMigrationFiles(resolve(cwd, MIGRATIONS_FOLDER), cwd);
58
- }
59
- export async function collectHeldMigrationFiles(cwd = process.cwd()) {
60
- return collectFlatSqlFiles(resolve(cwd, HELD_MIGRATIONS_FOLDER), cwd);
61
- }
62
- export async function scanDeployMigrationFiles(migrations) {
63
- const results = await Promise.all(migrations.map(async (migration) => {
64
- const sql = await readFile(migration.path, "utf8");
65
- return {
66
- migration,
67
- risks: scanMigrationSql(sql),
68
- };
69
- }));
70
- return results.filter((result) => result.risks.length > 0);
71
- }
72
- export function scanMigrationSql(sql) {
73
- const maskedSql = maskSql(sql);
74
- const createdTables = collectCreatedTables(maskedSql);
75
- const risks = [];
76
- for (const blocked of staticBlockedPatterns) {
77
- for (const match of maskedSql.matchAll(blocked.pattern)) {
78
- risks.push(riskForMatch(sql, match, blocked.code, blocked.reason));
79
- }
80
- }
81
- for (const match of maskedSql.matchAll(/\balter\s+table\s+(?:if\s+exists\s+|only\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)\s+add\s+column\b[^;]*?\bnot\s+null\b/giu)) {
82
- if (!createdTables.has(normalizeIdentifier(match.groups?.table))) {
83
- risks.push(riskForMatch(sql, match, "add-not-null-column", "adds a required column to an existing table before a separate compatibility rollout"));
84
- }
85
- }
86
- for (const match of maskedSql.matchAll(/\balter\s+table\s+(?:if\s+exists\s+|only\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)\s+add\s+constraint\b[^;]*?\b(?:foreign\s+key|unique|primary\s+key|check)\b/giu)) {
87
- if (!createdTables.has(normalizeIdentifier(match.groups?.table))) {
88
- risks.push(riskForMatch(sql, match, "add-constraint", "enforces a constraint on an existing table before a separate validation step"));
89
- }
90
- }
91
- for (const match of maskedSql.matchAll(/\bcreate\s+unique\s+index(?:\s+concurrently)?(?:\s+if\s+not\s+exists)?\s+(?:"[^"]+"|\w+)\s+on\s+(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)/giu)) {
92
- if (!createdTables.has(normalizeIdentifier(match.groups?.table))) {
93
- risks.push(riskForMatch(sql, match, "create-unique-index", "adds uniqueness to existing data before a separate dedupe and validation step"));
94
- }
95
- }
96
- return risks.sort((left, right) => left.line - right.line || left.code.localeCompare(right.code));
97
- }
98
- export function formatMigrationScanFailures(results) {
99
- return results
100
- .flatMap((result) => result.risks.map((risk) => `${result.migration.relativePath}:${risk.line} ${risk.code}: ${risk.reason} (${risk.match.trim()})`))
101
- .join("\n");
102
- }
103
- export function formatMigrationList(migrations) {
104
- if (migrations.length === 0) {
105
- return "No migration files found.";
106
- }
107
- return migrations.map((migration) => `- ${migration.relativePath}`).join("\n");
108
- }
109
- function collectCreatedTables(sql) {
110
- const tables = new Set();
111
- for (const match of sql.matchAll(/\bcreate\s+(?:temporary\s+|temp\s+)?table\s+(?:if\s+not\s+exists\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)/giu)) {
112
- tables.add(normalizeIdentifier(match.groups?.table));
113
- }
114
- return tables;
115
- }
116
- async function collectDrizzleMigrationFiles(migrationsPath, cwd) {
117
- const entries = await readDirectoryOrEmpty(migrationsPath);
118
- const migrations = [];
119
- for (const entry of entries) {
120
- const entryPath = join(migrationsPath, entry.name);
121
- if (entry.isDirectory()) {
122
- const migrationPath = join(entryPath, "migration.sql");
123
- if (await fileExists(migrationPath)) {
124
- migrations.push(migrationFileFromPath(migrationPath, cwd, entry.name));
125
- }
126
- continue;
127
- }
128
- if (entry.isFile() && entry.name.endsWith(".sql")) {
129
- migrations.push(migrationFileFromPath(entryPath, cwd, entry.name.replace(/\.sql$/u, "")));
130
- }
131
- }
132
- return migrations.sort((left, right) => left.id.localeCompare(right.id));
133
- }
134
- async function collectFlatSqlFiles(directory, cwd) {
135
- const entries = await readDirectoryOrEmpty(directory);
136
- const migrations = entries
137
- .filter((entry) => entry.isFile() && entry.name.endsWith(".sql"))
138
- .map((entry) => migrationFileFromPath(join(directory, entry.name), cwd, entry.name.replace(/\.sql$/u, "")));
139
- return migrations.sort((left, right) => left.id.localeCompare(right.id));
140
- }
141
- async function readDirectoryOrEmpty(directory) {
142
- try {
143
- return await readdir(directory, { withFileTypes: true });
144
- }
145
- catch (error) {
146
- if (error instanceof Error && "code" in error && error.code === "ENOENT") {
147
- return [];
148
- }
149
- throw error;
150
- }
151
- }
152
- async function fileExists(path) {
153
- try {
154
- await access(path);
155
- return true;
156
- }
157
- catch (error) {
158
- if (error instanceof Error && "code" in error && error.code === "ENOENT") {
159
- return false;
160
- }
161
- throw error;
162
- }
163
- }
164
- function migrationFileFromPath(path, cwd, id = basename(path, ".sql")) {
165
- return {
166
- id,
167
- path,
168
- relativePath: relative(cwd, path),
169
- };
170
- }
171
- function maskSql(sql) {
172
- return sql
173
- .replace(/--[^\n\r]*/gu, blank)
174
- .replace(/\/\*[\s\S]*?\*\//gu, blank)
175
- .replace(/\$([A-Za-z_][A-Za-z0-9_]*)?\$[\s\S]*?\$\1\$/gu, blank)
176
- .replace(/'(?:''|[^'])*'/gu, blank);
177
- }
178
- function blank(match) {
179
- return match.replace(/[^\n\r]/gu, " ");
180
- }
181
- function normalizeIdentifier(identifier) {
182
- return ((identifier ?? "")
183
- .split(".")
184
- .map((part) => part.trim().replace(/^"|"$/gu, "").toLowerCase())
185
- .at(-1) ?? "");
186
- }
187
- function riskForMatch(sql, match, code, reason) {
188
- return {
189
- code,
190
- line: lineForIndex(sql, match.index ?? 0),
191
- match: sql.slice(match.index ?? 0, (match.index ?? 0) + match[0].length),
192
- reason,
193
- };
194
- }
195
- function lineForIndex(value, index) {
196
- let line = 1;
197
- for (let offset = 0; offset < index; offset += 1) {
198
- if (value[offset] === "\n") {
199
- line += 1;
200
- }
201
- }
202
- return line;
203
- }
1
+ import{HELD_MIGRATIONS_FOLDER as e,MIGRATIONS_FOLDER as t}from"../db/config.js";import{access as n,readFile as r,readdir as i}from"node:fs/promises";import{basename as a,join as o,relative as s,resolve as c}from"node:path";const l=[{code:`drop-schema-object`,pattern:/\bdrop\s+(?:table|view|materialized\s+view|index|sequence|type|schema|function|trigger|policy)\b/giu,reason:`drops schema that the currently deployed app may still depend on`},{code:`drop-column`,pattern:/\balter\s+table\b[^;]*?\bdrop\s+column\b/giu,reason:`removes a column that the currently deployed app may still read or write`},{code:`drop-constraint`,pattern:/\balter\s+table\b[^;]*?\bdrop\s+constraint\b/giu,reason:`removes a constraint outside the staged contract phase`},{code:`truncate`,pattern:/\btruncate\b/giu,reason:`removes data outside the deploy-safe migration path`},{code:`rename-table-or-column`,pattern:/\balter\s+table\b[^;]*?\brename(?:\s+column)?\b/giu,reason:`renames schema in a way old and new app versions cannot both address`},{code:`rewrite-column-type`,pattern:/\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\btype\b/giu,reason:`rewrites a column type outside a staged expand/contract rollout`},{code:`set-not-null`,pattern:/\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\bset\s+not\s+null\b/giu,reason:`enforces NOT NULL before a separate backfill and verification step`},{code:`set-default`,pattern:/\balter\s+table\b[^;]*?\balter\s+column\b[^;]*?\bset\s+default\b/giu,reason:`changes default write behavior while old app code may still be running`},{code:`broad-update`,pattern:/\bupdate\b/giu,reason:`changes data outside a separately reviewed backfill or held migration`},{code:`broad-delete`,pattern:/\bdelete\s+from\b/giu,reason:`removes data outside a held migration`}];async function u(e=process.cwd()){return _(c(e,t),e)}async function d(t=process.cwd()){return v(c(t,e),t)}async function f(e){return(await Promise.all(e.map(async e=>({migration:e,risks:p(await r(e.path,`utf8`))})))).filter(e=>e.risks.length>0)}function p(e){let t=S(e),n=g(t),r=[];for(let n of l)for(let i of t.matchAll(n.pattern))r.push(T(e,i,n.code,n.reason));for(let i of t.matchAll(/\balter\s+table\s+(?:if\s+exists\s+|only\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)\s+add\s+column\b[^;]*?\bnot\s+null\b/giu))n.has(w(i.groups?.table))||r.push(T(e,i,`add-not-null-column`,`adds a required column to an existing table before a separate compatibility rollout`));for(let i of t.matchAll(/\balter\s+table\s+(?:if\s+exists\s+|only\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)\s+add\s+constraint\b[^;]*?\b(?:foreign\s+key|unique|primary\s+key|check)\b/giu))n.has(w(i.groups?.table))||r.push(T(e,i,`add-constraint`,`enforces a constraint on an existing table before a separate validation step`));for(let i of t.matchAll(/\bcreate\s+unique\s+index(?:\s+concurrently)?(?:\s+if\s+not\s+exists)?\s+(?:"[^"]+"|\w+)\s+on\s+(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)/giu))n.has(w(i.groups?.table))||r.push(T(e,i,`create-unique-index`,`adds uniqueness to existing data before a separate dedupe and validation step`));return r.sort((e,t)=>e.line-t.line||e.code.localeCompare(t.code))}function m(e){return e.flatMap(e=>e.risks.map(t=>`${e.migration.relativePath}:${t.line} ${t.code}: ${t.reason} (${t.match.trim()})`)).join(`
2
+ `)}function h(e){return e.length===0?`No migration files found.`:e.map(e=>`- ${e.relativePath}`).join(`
3
+ `)}function g(e){let t=new Set;for(let n of e.matchAll(/\bcreate\s+(?:temporary\s+|temp\s+)?table\s+(?:if\s+not\s+exists\s+)?(?<table>(?:"[^"]+"|\w+)(?:\s*\.\s*(?:"[^"]+"|\w+))?)/giu))t.add(w(n.groups?.table));return t}async function _(e,t){let n=await y(e),r=[];for(let i of n){let n=o(e,i.name);if(i.isDirectory()){let e=o(n,`migration.sql`);await b(e)&&r.push(x(e,t,i.name));continue}i.isFile()&&i.name.endsWith(`.sql`)&&r.push(x(n,t,i.name.replace(/\.sql$/u,``)))}return r.sort((e,t)=>e.id.localeCompare(t.id))}async function v(e,t){return(await y(e)).filter(e=>e.isFile()&&e.name.endsWith(`.sql`)).map(n=>x(o(e,n.name),t,n.name.replace(/\.sql$/u,``))).sort((e,t)=>e.id.localeCompare(t.id))}async function y(e){try{return await i(e,{withFileTypes:!0})}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return[];throw e}}async function b(e){try{return await n(e),!0}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return!1;throw e}}function x(e,t,n=a(e,`.sql`)){return{id:n,path:e,relativePath:s(t,e)}}function S(e){return e.replace(/--[^\n\r]*/gu,C).replace(/\/\*[\s\S]*?\*\//gu,C).replace(/\$([A-Za-z_][A-Za-z0-9_]*)?\$[\s\S]*?\$\1\$/gu,C).replace(/'(?:''|[^'])*'/gu,C)}function C(e){return e.replace(/[^\n\r]/gu,` `)}function w(e){return(e??``).split(`.`).map(e=>e.trim().replace(/^"|"$/gu,``).toLowerCase()).at(-1)??``}function T(e,t,n,r){return{code:n,line:E(e,t.index??0),match:e.slice(t.index??0,(t.index??0)+t[0].length),reason:r}}function E(e,t){let n=1;for(let r=0;r<t;r+=1)e[r]===`
4
+ `&&(n+=1);return n}export{u as collectDeployMigrationFiles,d as collectHeldMigrationFiles,h as formatMigrationList,m as formatMigrationScanFailures,f as scanDeployMigrationFiles,p as scanMigrationSql};
@@ -1,5 +1,9 @@
1
- import type { CoreframeDatabaseClient, CoreframeDatabaseDialect } from "../db/client.ts";
2
- import type { MigrationFile } from "./migrations.ts";
3
- export declare function filterPendingMigrations(migrations: MigrationFile[], appliedNames: Iterable<string>): MigrationFile[];
4
- export declare function readAppliedMigrationNames(database: CoreframeDatabaseClient): Promise<Set<string>>;
5
- export declare function appliedMigrationsQuery(dialect: CoreframeDatabaseDialect): "select name from drizzle.__drizzle_migrations where name is not null" | "select name from __drizzle_migrations where name is not null";
1
+ import { DatabaseClient, DatabaseDialect } from "../db/client.js";
2
+ import { MigrationFile } from "./migrations.js";
3
+
4
+ //#region deploy/pending-migrations.d.ts
5
+ declare function filterPendingMigrations(migrations: MigrationFile[], appliedNames: Iterable<string>): MigrationFile[];
6
+ declare function readAppliedMigrationNames(database: DatabaseClient): Promise<Set<string>>;
7
+ declare function appliedMigrationsQuery(dialect: DatabaseDialect): "select name from drizzle.__drizzle_migrations where name is not null" | "select name from __drizzle_migrations where name is not null";
8
+ //#endregion
9
+ export { appliedMigrationsQuery, filterPendingMigrations, readAppliedMigrationNames };
@@ -1,30 +1 @@
1
- export function filterPendingMigrations(migrations, appliedNames) {
2
- const applied = new Set(appliedNames);
3
- return migrations.filter((migration) => !applied.has(migration.id));
4
- }
5
- export async function readAppliedMigrationNames(database) {
6
- try {
7
- const result = await database.execute(appliedMigrationsQuery(database.dialect));
8
- return new Set(result.rows.flatMap((row) => (row.name ? [row.name] : [])));
9
- }
10
- catch (error) {
11
- if (isMissingMigrationTableError(error)) {
12
- return new Set();
13
- }
14
- throw error;
15
- }
16
- }
17
- export function appliedMigrationsQuery(dialect) {
18
- switch (dialect) {
19
- case "postgres":
20
- return "select name from drizzle.__drizzle_migrations where name is not null";
21
- case "sqlite":
22
- return "select name from __drizzle_migrations where name is not null";
23
- }
24
- }
25
- function isMissingMigrationTableError(error) {
26
- return (error instanceof Error &&
27
- (("code" in error && (error.code === "42P01" || error.code === "3F000")) ||
28
- error.message.includes("no such table") ||
29
- error.message.includes("no such schema")));
30
- }
1
+ function e(e,t){let n=new Set(t);return e.filter(e=>!n.has(e.id))}async function t(e){try{let t=await e.execute(n(e.dialect));return new Set(t.rows.flatMap(e=>e.name?[e.name]:[]))}catch(e){if(r(e))return new Set;throw e}}function n(e){switch(e){case`postgres`:return`select name from drizzle.__drizzle_migrations where name is not null`;case`sqlite`:return`select name from __drizzle_migrations where name is not null`}}function r(e){return e instanceof Error&&(`code`in e&&(e.code===`42P01`||e.code===`3F000`)||e.message.includes(`no such table`)||e.message.includes(`no such schema`))}export{n as appliedMigrationsQuery,e as filterPendingMigrations,t as readAppliedMigrationNames};
@@ -1,85 +1,105 @@
1
- import type { TauriReleaseConfig, TauriReleasePlatform } from "./config.ts";
2
- export type TauriReleaseArgs = {
3
- tauriLocalPlatforms: TauriReleasePlatform[];
4
- tauriWorkflowPlatforms: TauriReleasePlatform[];
5
- tauriWorkflowName?: string;
6
- tauriWorkflowRef?: string;
1
+ import { TauriReleaseConfig, TauriReleasePlatform } from "./config.js";
2
+
3
+ //#region deploy/tauri-release.d.ts
4
+ type TauriReleaseArgs = {
5
+ tauriLocalPlatforms: TauriReleasePlatform[];
6
+ tauriWorkflowPlatforms: TauriReleasePlatform[];
7
+ tauriWorkflowName?: string;
8
+ tauriWorkflowRef?: string;
7
9
  };
8
- export type TauriReleasePlan = {
9
- artifactDownloadDir: string;
10
- b2ApplicationKey?: string;
11
- b2ApplicationKeyId?: string;
12
- b2Bucket?: string;
13
- enabled: boolean;
14
- latestManifestPath: string;
15
- localPlatforms: TauriReleasePlatform[];
16
- platform: Record<TauriReleasePlatform, ResolvedTauriReleasePlatformConfig>;
17
- publicBaseUrl?: string;
18
- publicPathPrefix: string;
19
- releaseNotesPath?: string;
20
- releasePath: string;
21
- releaseUploadDir: string;
22
- signingPrivateKey?: string;
23
- workflowName: string;
24
- workflowPlatforms: TauriReleasePlatform[];
25
- workflowPollIntervalMs: number;
26
- workflowRef?: string;
27
- workflowTimeoutMs: number;
10
+ type TauriReleasePlan = {
11
+ artifactDownloadDir: string;
12
+ b2ApplicationKey?: string;
13
+ b2ApplicationKeyId?: string;
14
+ b2Bucket?: string;
15
+ enabled: boolean;
16
+ latestManifestPath: string;
17
+ localPlatforms: TauriReleasePlatform[];
18
+ platform: Record<TauriReleasePlatform, ResolvedTauriReleasePlatformConfig>;
19
+ publicBaseUrl?: string;
20
+ publicPathPrefix: string;
21
+ releaseNotesPath?: string;
22
+ releasePath: string;
23
+ releaseUploadDir: string;
24
+ signingPrivateKey?: string;
25
+ workflowName: string;
26
+ workflowPlatforms: TauriReleasePlatform[];
27
+ workflowPollIntervalMs: number;
28
+ workflowRef?: string;
29
+ workflowTimeoutMs: number;
28
30
  };
29
- export type TauriReleaseMetadataSnapshot = {
30
- files: {
31
- path: string;
32
- source: string;
33
- }[];
31
+ type TauriReleaseMetadataSnapshot = {
32
+ files: {
33
+ path: string;
34
+ source: string;
35
+ }[];
34
36
  };
35
- export type PreparedTauriRelease = {
36
- manifestPath: string;
37
- uploadDir: string;
37
+ type PreparedTauriRelease = {
38
+ manifestPath: string;
39
+ uploadDir: string;
38
40
  };
39
41
  type ResolvedTauriReleasePlatformConfig = {
40
- artifactGlobs: string[];
41
- buildArgs: string[];
42
- targetTriple: string;
43
- updatePlatform: string;
42
+ artifactGlobs: string[];
43
+ buildArgs: string[];
44
+ targetTriple: string;
45
+ updatePlatform: string;
44
46
  };
45
47
  type TauriUpdateManifest = {
46
- notes?: string;
47
- platforms: Record<string, {
48
- signature: string;
49
- url: string;
50
- }>;
51
- pub_date: string;
52
- version: string;
48
+ notes?: string;
49
+ platforms: Record<string, {
50
+ signature: string;
51
+ url: string;
52
+ }>;
53
+ pub_date: string;
54
+ version: string;
53
55
  };
54
- export declare function parseTauriReleasePlatformList(value: string | undefined): ("macos" | "windows" | "linux" | "ios" | "android")[];
55
- export declare function parseTauriReleasePlatform(value: string): TauriReleasePlatform;
56
- export declare function resolveTauriReleasePlan({ args, config, env, }: {
57
- args: TauriReleaseArgs;
58
- config?: TauriReleaseConfig;
59
- env: NodeJS.ProcessEnv;
56
+ declare function parseTauriReleasePlatformList(value: string | undefined): ("macos" | "windows" | "linux" | "ios" | "android")[];
57
+ declare function parseTauriReleasePlatform(value: string): TauriReleasePlatform;
58
+ declare function resolveTauriReleasePlan({
59
+ args,
60
+ config,
61
+ env
62
+ }: {
63
+ args: TauriReleaseArgs;
64
+ config?: TauriReleaseConfig;
65
+ env: NodeJS.ProcessEnv;
60
66
  }): TauriReleasePlan;
61
- export declare function validateTauriReleasePlan(plan: TauriReleasePlan, cwd?: string): Promise<void>;
62
- export declare function writeTauriReleaseMetadata(plan: TauriReleasePlan, version: string, cwd?: string): Promise<TauriReleaseMetadataSnapshot>;
63
- export declare function restoreTauriReleaseMetadata(snapshot: TauriReleaseMetadataSnapshot): Promise<void>;
64
- export declare function prepareTauriRelease({ env, plan, releaseName, version, }: {
65
- env: NodeJS.ProcessEnv;
66
- plan: TauriReleasePlan;
67
- releaseName: string;
68
- version: string;
67
+ declare function validateTauriReleasePlan(plan: TauriReleasePlan, cwd?: string): Promise<void>;
68
+ declare function writeTauriReleaseMetadata(plan: TauriReleasePlan, version: string, cwd?: string): Promise<TauriReleaseMetadataSnapshot>;
69
+ declare function restoreTauriReleaseMetadata(snapshot: TauriReleaseMetadataSnapshot): Promise<void>;
70
+ declare function prepareTauriRelease({
71
+ env,
72
+ plan,
73
+ releaseName,
74
+ version
75
+ }: {
76
+ env: NodeJS.ProcessEnv;
77
+ plan: TauriReleasePlan;
78
+ releaseName: string;
79
+ version: string;
69
80
  }): Promise<PreparedTauriRelease | undefined>;
70
- export declare function uploadTauriReleaseToB2(plan: TauriReleasePlan, release: PreparedTauriRelease): Promise<void>;
71
- export declare function createTauriUpdateManifest({ artifacts, notes, pubDate, version, }: {
72
- artifacts: {
73
- signature: string;
74
- updatePlatform: string;
75
- url: string;
76
- }[];
77
- notes?: string;
78
- pubDate?: Date;
79
- version: string;
81
+ declare function uploadTauriReleaseToB2(plan: TauriReleasePlan, release: PreparedTauriRelease): Promise<void>;
82
+ declare function createTauriUpdateManifest({
83
+ artifacts,
84
+ notes,
85
+ pubDate,
86
+ version
87
+ }: {
88
+ artifacts: {
89
+ signature: string;
90
+ updatePlatform: string;
91
+ url: string;
92
+ }[];
93
+ notes?: string;
94
+ pubDate?: Date;
95
+ version: string;
80
96
  }): TauriUpdateManifest;
81
- export declare function createTauriReleaseUpload({ plan, version, }: {
82
- plan: TauriReleasePlan;
83
- version: string;
97
+ declare function createTauriReleaseUpload({
98
+ plan,
99
+ version
100
+ }: {
101
+ plan: TauriReleasePlan;
102
+ version: string;
84
103
  }): Promise<PreparedTauriRelease>;
85
- export {};
104
+ //#endregion
105
+ export { PreparedTauriRelease, TauriReleaseArgs, TauriReleaseMetadataSnapshot, TauriReleasePlan, createTauriReleaseUpload, createTauriUpdateManifest, parseTauriReleasePlatform, parseTauriReleasePlatformList, prepareTauriRelease, resolveTauriReleasePlan, restoreTauriReleaseMetadata, uploadTauriReleaseToB2, validateTauriReleasePlan, writeTauriReleaseMetadata };