@ticket-gate/supabase-next 0.0.0 → 0.1.0-rc.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/LICENSE +202 -0
- package/README.md +55 -0
- package/checks/db-schema.mjs +455 -0
- package/checks/env-keys.mjs +122 -0
- package/checks/kill-group.mjs +13 -0
- package/checks/stack-preflight.mjs +482 -0
- package/checks/stack.mjs +29 -0
- package/commands.mjs +54 -0
- package/index.mjs +41 -0
- package/mutations/next-served.mjs +25 -0
- package/mutations/next-typecheck.mjs +180 -0
- package/mutations/pack.mjs +12 -0
- package/mutations/snapshot.mjs +421 -0
- package/mutations/sql-channel.mjs +100 -0
- package/mutations/sql-check.mjs +18 -0
- package/mutations/sql-kind.mjs +433 -0
- package/mutations/sql-object.mjs +214 -0
- package/nightly/stack-payload.mjs +48 -0
- package/package.json +21 -1
- package/profile-build.mjs +10 -0
- package/profile-hooks.mjs +72 -0
- package/score.mjs +26 -0
- package/selection/next-routes.mjs +40 -0
- package/selection/supabase-rules.mjs +18 -0
- package/selection/workspace-exports.mjs +44 -0
- package/sql-ranges.mjs +185 -0
- package/stack.mjs +4 -0
- package/step-defaults.mjs +41 -0
- package/tools.mjs +22 -0
package/stack.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// The supabase-next pack's step defaults: the db:reset command, the e2e trigger test and
|
|
2
|
+
// the summaries the project's gate.config.mjs shares between its db and seed steps.
|
|
3
|
+
import { pick } from '#engine/config.mjs';
|
|
4
|
+
import { tools } from './tools.mjs';
|
|
5
|
+
|
|
6
|
+
// db:reset regenerates db.types.ts and supabase/schema/, so
|
|
7
|
+
// RESET only checks both generated outputs. The untracked guard comes first
|
|
8
|
+
// because `git diff` ignores a new snapshot file.
|
|
9
|
+
const DRIFT =
|
|
10
|
+
'! git ls-files --others --exclude-standard supabase/schema/ | grep . && git diff --exit-code packages/core/src/db.types.ts supabase/schema/';
|
|
11
|
+
export const RESET = `pnpm db:reset && ${DRIFT}`;
|
|
12
|
+
|
|
13
|
+
export const E2E_FULL_CMD = 'pnpm test:e2e';
|
|
14
|
+
|
|
15
|
+
export const resetSummary = (out) =>
|
|
16
|
+
pick(out, [/Finished .*db reset/i, /Applying migration/]) ??
|
|
17
|
+
'db:reset applied; db.types.ts clean';
|
|
18
|
+
|
|
19
|
+
const isTrigger = (p) =>
|
|
20
|
+
tools.e2eAreas.FULL_TRIGGERS.some((t) => p === t || p.startsWith(t));
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* G1 and R4 (a)-(d): does this diff need an e2e run? (e), a tools/ file the
|
|
24
|
+
* harness imports, needs the selector and is main's.
|
|
25
|
+
*/
|
|
26
|
+
export function e2eWhen(paths) {
|
|
27
|
+
if (paths.some((p) => p.startsWith('apps/web'))) return true;
|
|
28
|
+
// prettier-ignore
|
|
29
|
+
if (paths.some((p) => p.startsWith('packages/core/src/') && !tools.e2eAreas.TEST_FILE_RE.test(p))) return true;
|
|
30
|
+
if (
|
|
31
|
+
paths.some(
|
|
32
|
+
(p) =>
|
|
33
|
+
p.startsWith('supabase/migrations/') ||
|
|
34
|
+
p === 'supabase/seed.sql' ||
|
|
35
|
+
p.startsWith('supabase/functions/'),
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
return true;
|
|
39
|
+
if (paths.some(isTrigger)) return true;
|
|
40
|
+
return false;
|
|
41
|
+
}
|
package/tools.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The project modules this pack calls, injected by supabaseNext({ tools }) in index.mjs
|
|
2
|
+
// (gate.config.mjs passes them). The pack imports nothing outside tools/gate/ and node:.
|
|
3
|
+
// Keys: e2eAreas (a module
|
|
4
|
+
// namespace, or any object with the same named exports).
|
|
5
|
+
let bound = null;
|
|
6
|
+
|
|
7
|
+
export function bindTools(tools) {
|
|
8
|
+
bound = tools;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const tools = new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get(_, key) {
|
|
15
|
+
if (!bound)
|
|
16
|
+
throw new Error(
|
|
17
|
+
'supabase-next: no project tools bound. Construct the pack first: supabaseNext({ tools }) in gate.config.mjs.',
|
|
18
|
+
);
|
|
19
|
+
return bound[key];
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
);
|