@akal/supaforge 0.0.33 → 0.0.35
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/README.md +67 -14
- package/dist/base-command.d.ts +1 -1
- package/dist/base-command.js +4 -3
- package/dist/{branch-C4ndfoj5.d.ts → branch-BppjQBv_.d.ts} +1 -1
- package/dist/{chunk-4IVN7QVY.js → chunk-44UVQJV2.js} +159 -18
- package/dist/{chunk-3HGAV5CC.js → chunk-4AGJRRBT.js} +390 -43
- package/dist/{chunk-SQPCWGQO.js → chunk-4M6OQLPO.js} +22 -121
- package/dist/{chunk-2SELREHW.js → chunk-5Q6LSLA3.js} +56 -9
- package/dist/{chunk-7NAZGZPV.js → chunk-7N63OPFN.js} +28 -21
- package/dist/chunk-AGONS5JJ.js +242 -0
- package/dist/chunk-GQPGH6YR.js +50 -0
- package/dist/{chunk-GEHPTPNZ.js → chunk-H2D3YSKM.js} +7 -3
- package/dist/{chunk-6Q7MHFBM.js → chunk-HNJ6BNNZ.js} +2 -2
- package/dist/{chunk-6WAMNZLO.js → chunk-KNXHLVF7.js} +126 -4
- package/dist/{chunk-DMIWAJRB.js → chunk-NEM5AEPQ.js} +172 -22
- package/dist/{chunk-6LJERPUN.js → chunk-NX2KKUS7.js} +20 -12
- package/dist/{chunk-SC2XHGIS.js → chunk-O5ERC2SE.js} +3 -3
- package/dist/{chunk-MIRLB5JM.js → chunk-SM7HP6EP.js} +64 -182
- package/dist/{chunk-BUOWHE36.js → chunk-T7GMPGUO.js} +613 -66
- package/dist/{chunk-G2DIPIYU.js → chunk-WK5YTINL.js} +29 -2
- package/dist/{chunk-UWAVXC57.js → chunk-WNTCZM2J.js} +34 -482
- package/dist/{chunk-GZREXCQZ.js → chunk-XLZCX6R2.js} +17 -10
- package/dist/{chunk-ORQJVE57.js → chunk-YWERIWFD.js} +18 -17
- package/dist/{chunk-NTUASFQ3.js → chunk-YZM76W22.js} +5 -5
- package/dist/{chunk-BLKJWDTL.js → chunk-ZI435CAU.js} +2 -2
- package/dist/commands/clone.d.ts +2 -2
- package/dist/commands/clone.js +14 -13
- package/dist/commands/diff.d.ts +37 -23
- package/dist/commands/diff.js +20 -17
- package/dist/commands/hukam.d.ts +2 -3
- package/dist/commands/hukam.js +16 -15
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +5 -1
- package/dist/commands/mcp.js +16 -10
- package/dist/commands/migrate/baseline.d.ts +1 -1
- package/dist/commands/migrate/baseline.js +5 -4
- package/dist/commands/migrate/create.d.ts +1 -1
- package/dist/commands/migrate/create.js +15 -9
- package/dist/commands/migrate/list.d.ts +1 -1
- package/dist/commands/migrate/list.js +6 -5
- package/dist/commands/migrate/run.d.ts +4 -1
- package/dist/commands/migrate/run.js +10 -8
- package/dist/commands/report.d.ts +1 -1
- package/dist/commands/report.js +5 -4
- package/dist/commands/restore.d.ts +1 -1
- package/dist/commands/restore.js +14 -13
- package/dist/commands/snapshot.d.ts +8 -1
- package/dist/commands/snapshot.js +37 -9
- package/dist/commands/sync.d.ts +2 -3
- package/dist/commands/sync.js +16 -15
- package/dist/{config-CTbeRlJk.d.ts → config-l3ggjw9r.d.ts} +2 -0
- package/dist/index.d.ts +21 -4
- package/dist/index.js +15 -15
- package/package.json +2 -2
- package/dist/chunk-DQQ5E563.js +0 -64
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
2
|
import { BaseCommand } from '../../base-command.js';
|
|
3
3
|
import '@oclif/core';
|
|
4
|
-
import '../../config-
|
|
4
|
+
import '../../config-l3ggjw9r.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Execute pending migrations against a Supabase environment.
|
|
@@ -26,8 +26,11 @@ declare class MigrateRun extends BaseCommand {
|
|
|
26
26
|
'dry-run': _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
27
27
|
'up-to': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
28
28
|
'allow-destructive': _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
29
|
+
force: _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
29
30
|
};
|
|
30
31
|
run(): Promise<void>;
|
|
32
|
+
/** The first pending migration written against `envName`, if the target has changed since. */
|
|
33
|
+
private changedSinceWritten;
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Destructive statements across a set of pending migration files.
|
|
@@ -2,14 +2,16 @@ import {
|
|
|
2
2
|
MigrateRun,
|
|
3
3
|
findDestructiveStatements,
|
|
4
4
|
truncateSql
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-5Q6LSLA3.js";
|
|
6
|
+
import "../../chunk-O5ERC2SE.js";
|
|
7
|
+
import "../../chunk-NEM5AEPQ.js";
|
|
8
|
+
import "../../chunk-T7GMPGUO.js";
|
|
9
|
+
import "../../chunk-WK5YTINL.js";
|
|
10
|
+
import "../../chunk-XLZCX6R2.js";
|
|
11
|
+
import "../../chunk-AGONS5JJ.js";
|
|
12
|
+
import "../../chunk-4M6OQLPO.js";
|
|
13
|
+
import "../../chunk-GQPGH6YR.js";
|
|
14
|
+
import "../../chunk-KNXHLVF7.js";
|
|
13
15
|
export {
|
|
14
16
|
MigrateRun as default,
|
|
15
17
|
findDestructiveStatements,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
2
|
import { BaseCommand } from '../base-command.js';
|
|
3
3
|
import '@oclif/core';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-l3ggjw9r.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Display recent supaforge command history from the local run log.
|
package/dist/commands/report.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sanitizeForReport
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HNJ6BNNZ.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand,
|
|
6
6
|
readRunLog,
|
|
7
7
|
runLogPath
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-XLZCX6R2.js";
|
|
9
|
+
import "../chunk-4M6OQLPO.js";
|
|
10
|
+
import "../chunk-GQPGH6YR.js";
|
|
10
11
|
import {
|
|
11
12
|
bold,
|
|
12
13
|
cmd,
|
|
13
14
|
dim,
|
|
14
15
|
ok,
|
|
15
16
|
warn
|
|
16
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-KNXHLVF7.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/report.ts
|
|
19
20
|
import { Flags } from "@oclif/core";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
2
|
import { BaseCommand } from '../base-command.js';
|
|
3
3
|
import '@oclif/core';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-l3ggjw9r.js';
|
|
5
5
|
|
|
6
6
|
declare class Restore extends BaseCommand {
|
|
7
7
|
static description: string;
|
package/dist/commands/restore.js
CHANGED
|
@@ -5,29 +5,30 @@ import {
|
|
|
5
5
|
restoreFromMigrations,
|
|
6
6
|
restoreFromSnapshot,
|
|
7
7
|
summarizeStatement
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-7N63OPFN.js";
|
|
9
|
+
import "../chunk-YZM76W22.js";
|
|
10
|
+
import "../chunk-O5ERC2SE.js";
|
|
11
|
+
import "../chunk-WNTCZM2J.js";
|
|
12
|
+
import "../chunk-NEM5AEPQ.js";
|
|
13
|
+
import "../chunk-T7GMPGUO.js";
|
|
14
|
+
import "../chunk-WK5YTINL.js";
|
|
15
15
|
import {
|
|
16
16
|
renderTip
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-ZI435CAU.js";
|
|
18
18
|
import {
|
|
19
19
|
BaseCommand
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-XLZCX6R2.js";
|
|
21
21
|
import {
|
|
22
22
|
findLatestSnapshot,
|
|
23
23
|
listSnapshots
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-SM7HP6EP.js";
|
|
25
|
+
import "../chunk-AGONS5JJ.js";
|
|
26
|
+
import "../chunk-4M6OQLPO.js";
|
|
27
|
+
import "../chunk-GQPGH6YR.js";
|
|
27
28
|
import {
|
|
28
29
|
cmd,
|
|
29
30
|
warn
|
|
30
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-KNXHLVF7.js";
|
|
31
32
|
|
|
32
33
|
// src/commands/restore.ts
|
|
33
34
|
import { Flags } from "@oclif/core";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
2
|
import { BaseCommand } from '../base-command.js';
|
|
3
3
|
import '@oclif/core';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-l3ggjw9r.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Capture and manage environment state snapshots.
|
|
@@ -24,9 +24,16 @@ declare class Snapshot extends BaseCommand {
|
|
|
24
24
|
keep: _oclif_core_interfaces.OptionFlag<number, _oclif_core_interfaces.CustomOptions>;
|
|
25
25
|
apply: _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
26
26
|
json: _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
27
|
+
'allow-schema-json-only': _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
27
28
|
output: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
28
29
|
};
|
|
29
30
|
run(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* A snapshot without schema.sql cannot restore its schema, and the time to
|
|
33
|
+
* find that out is not during a restore. It is kept — it can still be
|
|
34
|
+
* diffed — but the command fails unless that was asked for.
|
|
35
|
+
*/
|
|
36
|
+
private failIfUnrestorable;
|
|
30
37
|
private logSnapshotResult;
|
|
31
38
|
}
|
|
32
39
|
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
backup,
|
|
3
3
|
listMigrationFiles
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-YZM76W22.js";
|
|
5
|
+
import "../chunk-WK5YTINL.js";
|
|
6
6
|
import {
|
|
7
7
|
renderTip
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-ZI435CAU.js";
|
|
9
9
|
import {
|
|
10
10
|
BaseCommand
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-XLZCX6R2.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_KEEP_COUNT,
|
|
14
14
|
captureSnapshot,
|
|
15
15
|
formatSnapshotLayers,
|
|
16
16
|
listSnapshots,
|
|
17
|
-
pruneSnapshots
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import "../chunk-
|
|
17
|
+
pruneSnapshots,
|
|
18
|
+
unrestorableSchema
|
|
19
|
+
} from "../chunk-SM7HP6EP.js";
|
|
20
|
+
import "../chunk-AGONS5JJ.js";
|
|
21
|
+
import "../chunk-4M6OQLPO.js";
|
|
22
|
+
import "../chunk-GQPGH6YR.js";
|
|
21
23
|
import {
|
|
22
24
|
bold,
|
|
23
25
|
cmd,
|
|
24
26
|
dim,
|
|
25
27
|
ok,
|
|
26
28
|
warn
|
|
27
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-KNXHLVF7.js";
|
|
28
30
|
|
|
29
31
|
// src/commands/snapshot.ts
|
|
30
32
|
import { Flags } from "@oclif/core";
|
|
@@ -84,6 +86,10 @@ var Snapshot = class _Snapshot extends BaseCommand {
|
|
|
84
86
|
default: false
|
|
85
87
|
}),
|
|
86
88
|
json: Flags.boolean({ description: "Output results as JSON" }),
|
|
89
|
+
"allow-schema-json-only": Flags.boolean({
|
|
90
|
+
description: "Succeed even when no pg_dump could write schema.sql: the snapshot can still be diffed, but restore cannot recreate its schema. Without this, such a snapshot is kept and the command exits 1.",
|
|
91
|
+
default: false
|
|
92
|
+
}),
|
|
87
93
|
output: Flags.string({
|
|
88
94
|
char: "o",
|
|
89
95
|
description: "Custom output directory for snapshot files (timestamp subfolder is created inside)"
|
|
@@ -194,6 +200,7 @@ Capturing snapshot of "${envName}" with migration...
|
|
|
194
200
|
migration: result.migration,
|
|
195
201
|
migrationFile: result.migrationFile
|
|
196
202
|
});
|
|
203
|
+
this.failIfUnrestorable(result.snapshot.manifest, result.snapshot.dir, flags["allow-schema-json-only"]);
|
|
197
204
|
return;
|
|
198
205
|
}
|
|
199
206
|
this.logSnapshotResult(result.snapshot.manifest);
|
|
@@ -211,6 +218,7 @@ Capturing snapshot of "${envName}" with migration...
|
|
|
211
218
|
} else {
|
|
212
219
|
this.log(` ${dim("Migration:")} none (no changes detected)`);
|
|
213
220
|
}
|
|
221
|
+
this.failIfUnrestorable(result.snapshot.manifest, result.snapshot.dir, flags["allow-schema-json-only"]);
|
|
214
222
|
this.log(`
|
|
215
223
|
${ok("Snapshot + migration complete.")}
|
|
216
224
|
`);
|
|
@@ -223,11 +231,13 @@ Capturing snapshot of "${envName}"...
|
|
|
223
231
|
const snapshot = await captureSnapshot({ envName, env, config, outputDir: flags.output });
|
|
224
232
|
if (flags.json) {
|
|
225
233
|
this.json(snapshot.manifest);
|
|
234
|
+
this.failIfUnrestorable(snapshot.manifest, snapshot.dir, flags["allow-schema-json-only"]);
|
|
226
235
|
return;
|
|
227
236
|
}
|
|
228
237
|
this.logSnapshotResult(snapshot.manifest);
|
|
229
238
|
this.log(`
|
|
230
239
|
${dim("Snapshot saved to:")} ${snapshot.dir}`);
|
|
240
|
+
this.failIfUnrestorable(snapshot.manifest, snapshot.dir, flags["allow-schema-json-only"]);
|
|
231
241
|
const existing = await listMigrationFiles();
|
|
232
242
|
if (existing.length > 0) {
|
|
233
243
|
this.log(` \u2192 Run with ${cmd("--migration")} to also generate an incremental diff.`);
|
|
@@ -237,6 +247,24 @@ Capturing snapshot of "${envName}"...
|
|
|
237
247
|
this.log("");
|
|
238
248
|
this.log(renderTip({ command: "snapshot", snapshotMigration: false, snapshotList: false }));
|
|
239
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* A snapshot without schema.sql cannot restore its schema, and the time to
|
|
252
|
+
* find that out is not during a restore. It is kept — it can still be
|
|
253
|
+
* diffed — but the command fails unless that was asked for.
|
|
254
|
+
*/
|
|
255
|
+
failIfUnrestorable(manifest, dir, allowed) {
|
|
256
|
+
const reason = unrestorableSchema(manifest);
|
|
257
|
+
if (!reason) return;
|
|
258
|
+
if (allowed) {
|
|
259
|
+
this.warn(`This snapshot cannot restore the schema: ${reason}`);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
this.error(
|
|
263
|
+
`This snapshot cannot restore the schema: ${reason}.
|
|
264
|
+
It was kept at ${dir}, and can still be diffed. Install PostgreSQL client tools at least as new as the server (or set SUPAFORGE_PG_BIN to them) and snapshot again, or pass --allow-schema-json-only to accept a snapshot whose schema cannot be restored.`,
|
|
265
|
+
{ exit: 1 }
|
|
266
|
+
);
|
|
267
|
+
}
|
|
240
268
|
logSnapshotResult(manifest) {
|
|
241
269
|
for (const line of formatSnapshotLayers(manifest)) {
|
|
242
270
|
this.log(` ${line}`);
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import Diff from './diff.js';
|
|
2
|
-
import '@oclif/core/interfaces';
|
|
3
|
-
import '../base-command.js';
|
|
4
2
|
import '@oclif/core';
|
|
5
|
-
import '../
|
|
3
|
+
import '../base-command.js';
|
|
4
|
+
import '../config-l3ggjw9r.js';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Alias for `diff --apply` — detect and fix drift in one step.
|
package/dist/commands/sync.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Diff
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-44UVQJV2.js";
|
|
4
|
+
import "../chunk-HNJ6BNNZ.js";
|
|
5
|
+
import "../chunk-H2D3YSKM.js";
|
|
6
|
+
import "../chunk-4AGJRRBT.js";
|
|
7
|
+
import "../chunk-WNTCZM2J.js";
|
|
8
|
+
import "../chunk-NEM5AEPQ.js";
|
|
9
|
+
import "../chunk-T7GMPGUO.js";
|
|
10
|
+
import "../chunk-WK5YTINL.js";
|
|
11
|
+
import "../chunk-ZI435CAU.js";
|
|
12
|
+
import "../chunk-XLZCX6R2.js";
|
|
13
|
+
import "../chunk-YWERIWFD.js";
|
|
14
|
+
import "../chunk-SM7HP6EP.js";
|
|
15
|
+
import "../chunk-AGONS5JJ.js";
|
|
16
|
+
import "../chunk-4M6OQLPO.js";
|
|
17
|
+
import "../chunk-GQPGH6YR.js";
|
|
18
|
+
import "../chunk-KNXHLVF7.js";
|
|
18
19
|
|
|
19
20
|
// src/commands/sync.ts
|
|
20
21
|
var Sync = class extends Diff {
|
|
@@ -82,6 +82,8 @@ interface SupaForgeConfig {
|
|
|
82
82
|
source?: string;
|
|
83
83
|
target?: string;
|
|
84
84
|
ignoreSchemas?: string[];
|
|
85
|
+
/** Extensions the extensions check does not report as extra on the target. */
|
|
86
|
+
ignoreExtensions?: string[];
|
|
85
87
|
checks?: ChecksConfig;
|
|
86
88
|
}
|
|
87
89
|
interface SnapshotLayerInfo {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EnvironmentConfig, S as SupaForgeConfig, a as SnapshotManifest, M as MigrationFile } from './config-
|
|
2
|
-
export { C as ChecksConfig, b as MigrationAction, c as SnapshotLayerInfo } from './config-
|
|
3
|
-
export { B as BRANCH_DB_PREFIX, a as BranchMeta, b as BranchesManifest, C as CreateBranchOptions, c as branchDbName, d as createBranch, e as deleteBranch, l as listBranches, f as loadManifest, r as replaceDbName } from './branch-
|
|
1
|
+
import { E as EnvironmentConfig, S as SupaForgeConfig, a as SnapshotManifest, M as MigrationFile } from './config-l3ggjw9r.js';
|
|
2
|
+
export { C as ChecksConfig, b as MigrationAction, c as SnapshotLayerInfo } from './config-l3ggjw9r.js';
|
|
3
|
+
export { B as BRANCH_DB_PREFIX, a as BranchMeta, b as BranchesManifest, C as CreateBranchOptions, c as branchDbName, d as createBranch, e as deleteBranch, l as listBranches, f as loadManifest, r as replaceDbName } from './branch-BppjQBv_.js';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -19,7 +19,7 @@ declare class HookBus {
|
|
|
19
19
|
clear(): void;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
declare const CHECK_NAMES: readonly ["schema", "rls", "rls-coverage", "edge-functions", "storage", "auth", "cron", "data", "webhooks", "realtime", "vault", "extensions", "migrations", "roles"];
|
|
22
|
+
declare const CHECK_NAMES: readonly ["schema", "rls", "rls-coverage", "edge-functions", "storage", "auth", "cron", "data", "webhooks", "realtime", "vault", "extensions", "migrations", "roles", "queues", "partitions"];
|
|
23
23
|
type CheckName = (typeof CHECK_NAMES)[number];
|
|
24
24
|
type Severity = 'critical' | 'warning' | 'info';
|
|
25
25
|
declare const CHECK_META: Record<CheckName, {
|
|
@@ -72,6 +72,15 @@ interface DriftIssue {
|
|
|
72
72
|
* its SQL: a webhook is a trigger, and dropping a trigger usually isn't.
|
|
73
73
|
*/
|
|
74
74
|
destructive?: string;
|
|
75
|
+
/**
|
|
76
|
+
* What applying the fix does to a live database beyond what it changes —
|
|
77
|
+
* the locks it holds, a table rewrite, a full scan. See hazards.ts.
|
|
78
|
+
*/
|
|
79
|
+
hazards?: Array<{
|
|
80
|
+
kind: string;
|
|
81
|
+
on?: string;
|
|
82
|
+
detail: string;
|
|
83
|
+
}>;
|
|
75
84
|
}
|
|
76
85
|
interface CheckResult {
|
|
77
86
|
check: CheckName;
|
|
@@ -97,6 +106,12 @@ interface CheckResult {
|
|
|
97
106
|
count: number;
|
|
98
107
|
into: CheckName;
|
|
99
108
|
}>;
|
|
109
|
+
/**
|
|
110
|
+
* What the check could not compare or decide, said beside its findings:
|
|
111
|
+
* objects of a kind it does not compare, a rename it would not guess. Not
|
|
112
|
+
* drift — nothing to apply — so neither counted nor scored.
|
|
113
|
+
*/
|
|
114
|
+
notices?: string[];
|
|
100
115
|
durationMs: number;
|
|
101
116
|
}
|
|
102
117
|
interface ScanResult {
|
|
@@ -153,6 +168,8 @@ interface CheckContext {
|
|
|
153
168
|
* fine-grained to report simply ignore it.
|
|
154
169
|
*/
|
|
155
170
|
onDetail?: (detail: string) => void;
|
|
171
|
+
/** Sink for what the check could not compare — see CheckResult.notices. */
|
|
172
|
+
onNotice?: (notice: string) => void;
|
|
156
173
|
source: EnvironmentConfig;
|
|
157
174
|
target: EnvironmentConfig;
|
|
158
175
|
config: SupaForgeConfig;
|
package/dist/index.js
CHANGED
|
@@ -3,38 +3,38 @@ import {
|
|
|
3
3
|
createServer,
|
|
4
4
|
getLastScanResult,
|
|
5
5
|
setLastScanResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NX2KKUS7.js";
|
|
7
7
|
import {
|
|
8
8
|
previewMigrationRestore,
|
|
9
9
|
previewSnapshotRestore,
|
|
10
10
|
restoreFromMigrations,
|
|
11
11
|
restoreFromSnapshot
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7N63OPFN.js";
|
|
13
13
|
import {
|
|
14
14
|
backup,
|
|
15
15
|
listMigrationFiles,
|
|
16
16
|
loadMigrations
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-YZM76W22.js";
|
|
18
|
+
import "./chunk-O5ERC2SE.js";
|
|
19
19
|
import {
|
|
20
20
|
renderDetailed,
|
|
21
21
|
renderSummary
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-H2D3YSKM.js";
|
|
23
23
|
import {
|
|
24
24
|
CheckRegistry,
|
|
25
25
|
computeScore,
|
|
26
26
|
createDefaultRegistry,
|
|
27
27
|
scan,
|
|
28
28
|
summarize
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
29
|
+
} from "./chunk-4AGJRRBT.js";
|
|
30
|
+
import "./chunk-WNTCZM2J.js";
|
|
31
|
+
import "./chunk-NEM5AEPQ.js";
|
|
31
32
|
import {
|
|
32
33
|
CHECK_META,
|
|
33
34
|
CHECK_NAMES,
|
|
34
35
|
promote
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-G2DIPIYU.js";
|
|
36
|
+
} from "./chunk-T7GMPGUO.js";
|
|
37
|
+
import "./chunk-WK5YTINL.js";
|
|
38
38
|
import {
|
|
39
39
|
BRANCH_DB_PREFIX,
|
|
40
40
|
branchDbName,
|
|
@@ -43,23 +43,23 @@ import {
|
|
|
43
43
|
listBranches,
|
|
44
44
|
loadManifest,
|
|
45
45
|
replaceDbName
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-YWERIWFD.js";
|
|
47
47
|
import {
|
|
48
48
|
captureSnapshot,
|
|
49
49
|
findLatestSnapshot,
|
|
50
50
|
listSnapshots,
|
|
51
51
|
loadSnapshot
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
52
|
+
} from "./chunk-SM7HP6EP.js";
|
|
53
|
+
import "./chunk-AGONS5JJ.js";
|
|
54
54
|
import {
|
|
55
55
|
Check
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-4M6OQLPO.js";
|
|
57
57
|
import {
|
|
58
58
|
loadConfig,
|
|
59
59
|
resolveConfig,
|
|
60
60
|
validateConfig,
|
|
61
61
|
validateSingleEnvConfig
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-KNXHLVF7.js";
|
|
63
63
|
|
|
64
64
|
// src/hooks.ts
|
|
65
65
|
var HookBus = class {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akal/supaforge",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"mcpName": "io.github.akalsoftware/supaforge",
|
|
5
5
|
"description": "Diff and sync your Supabase environments",
|
|
6
6
|
"author": "Akal Software Ltd",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@akal/pg-conformance": "~0.0.16",
|
|
59
|
-
"@dbdiff/cli": "3.0.0-rc.
|
|
59
|
+
"@dbdiff/cli": "3.0.0-rc.29",
|
|
60
60
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
61
61
|
"@oclif/core": "^4",
|
|
62
62
|
"@supabase/supabase-js": "^2.103.0",
|
package/dist/chunk-DQQ5E563.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// src/utils/strings.ts
|
|
2
|
-
var MAX_SLUG_LENGTH = 60;
|
|
3
|
-
function slugify(name, separator = "_") {
|
|
4
|
-
const pattern = new RegExp(`[^a-z0-9]+`, "g");
|
|
5
|
-
const edgePattern = new RegExp(`^${escapeRegex(separator)}|${escapeRegex(separator)}$`, "g");
|
|
6
|
-
return name.toLowerCase().replace(pattern, separator).replace(edgePattern, "").slice(0, MAX_SLUG_LENGTH);
|
|
7
|
-
}
|
|
8
|
-
function escapeRegex(s) {
|
|
9
|
-
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
10
|
-
}
|
|
11
|
-
function parseFlagList(values) {
|
|
12
|
-
if (!Array.isArray(values)) return [];
|
|
13
|
-
return values.flatMap((v) => String(v).split(",")).map((v) => v.trim()).filter((v) => v.length > 0);
|
|
14
|
-
}
|
|
15
|
-
function globToRegExp(pattern) {
|
|
16
|
-
let out = "^";
|
|
17
|
-
for (const ch of pattern) {
|
|
18
|
-
if (ch === "*") out += ".*";
|
|
19
|
-
else if (ch === "?") out += ".";
|
|
20
|
-
else out += escapeRegex(ch);
|
|
21
|
-
}
|
|
22
|
-
return new RegExp(out + "$");
|
|
23
|
-
}
|
|
24
|
-
function matchesGlob(value, pattern) {
|
|
25
|
-
return globToRegExp(pattern.toLowerCase()).test(value.toLowerCase());
|
|
26
|
-
}
|
|
27
|
-
function normalizeRoles(roles) {
|
|
28
|
-
const arr = Array.isArray(roles) ? roles : [roles];
|
|
29
|
-
return [...new Set(
|
|
30
|
-
arr.flatMap((r) => /^\{.*\}$/s.test(r) ? arrayLiteralElements(r) : [r]).map((r) => r.trim()).filter(Boolean)
|
|
31
|
-
)].sort();
|
|
32
|
-
}
|
|
33
|
-
function arrayLiteralElements(literal) {
|
|
34
|
-
const inner = literal.slice(1, -1);
|
|
35
|
-
const out = [];
|
|
36
|
-
let i = 0;
|
|
37
|
-
while (i < inner.length) {
|
|
38
|
-
let value = "";
|
|
39
|
-
if (inner[i] === '"') {
|
|
40
|
-
for (i++; i < inner.length && inner[i] !== '"'; i++) {
|
|
41
|
-
if (inner[i] === "\\") i++;
|
|
42
|
-
value += inner[i];
|
|
43
|
-
}
|
|
44
|
-
i++;
|
|
45
|
-
} else {
|
|
46
|
-
const end = inner.indexOf(",", i);
|
|
47
|
-
value = inner.slice(i, end === -1 ? inner.length : end);
|
|
48
|
-
i = end === -1 ? inner.length : end;
|
|
49
|
-
}
|
|
50
|
-
out.push(value);
|
|
51
|
-
if (inner[i] === ",") i++;
|
|
52
|
-
}
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
slugify,
|
|
58
|
-
escapeRegex,
|
|
59
|
-
parseFlagList,
|
|
60
|
-
globToRegExp,
|
|
61
|
-
matchesGlob,
|
|
62
|
-
normalizeRoles
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=chunk-DQQ5E563.js.map
|