@gadicc/loom 1.29.0 → 1.31.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/README.md +7 -0
- package/esm/mod.d.ts +1 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -0
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +134 -10
- package/esm/src/cli/vercelProjectRelease.d.ts +38 -0
- package/esm/src/cli/vercelProjectRelease.d.ts.map +1 -0
- package/esm/src/cli/vercelProjectRelease.js +600 -0
- package/esm/src/clientData/identity.d.ts +89 -0
- package/esm/src/clientData/identity.d.ts.map +1 -0
- package/esm/src/clientData/identity.js +127 -0
- package/esm/src/clientData/mod.d.ts +3 -0
- package/esm/src/clientData/mod.d.ts.map +1 -0
- package/esm/src/clientData/mod.js +1 -0
- package/esm/src/next/auth/client.d.ts +7 -0
- package/esm/src/next/auth/client.d.ts.map +1 -1
- package/esm/src/next/auth/client.js +7 -0
- package/package.json +14 -2
- package/script/mod.d.ts +1 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -0
- package/script/src/cli/mod.d.ts.map +1 -1
- package/script/src/cli/mod.js +134 -10
- package/script/src/cli/vercelProjectRelease.d.ts +38 -0
- package/script/src/cli/vercelProjectRelease.d.ts.map +1 -0
- package/script/src/cli/vercelProjectRelease.js +606 -0
- package/script/src/clientData/identity.d.ts +89 -0
- package/script/src/clientData/identity.d.ts.map +1 -0
- package/script/src/clientData/identity.js +134 -0
- package/script/src/clientData/mod.d.ts +3 -0
- package/script/src/clientData/mod.d.ts.map +1 -0
- package/script/src/clientData/mod.js +18 -0
- package/script/src/next/auth/client.d.ts +7 -0
- package/script/src/next/auth/client.d.ts.map +1 -1
- package/script/src/next/auth/client.js +7 -0
- package/skills/loom/SKILL.md +6 -4
- package/skills/loom-auth/SKILL.md +9 -7
- package/skills/loom-db/SKILL.md +7 -2
- package/skills/modernize-app/SKILL.md +6 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export type ClientDataIdentityStatus = "active" | "signed-out" | "unknown";
|
|
2
|
+
/**
|
|
3
|
+
* Storage-neutral identity fence for account-owned browser data.
|
|
4
|
+
*
|
|
5
|
+
* Owner IDs are opaque strings. The consuming app remains responsible for
|
|
6
|
+
* validating their format before calling these helpers.
|
|
7
|
+
*/
|
|
8
|
+
export interface ClientDataIdentityState<TOwnerId extends string = string> {
|
|
9
|
+
/** Last verified owner, retained while signed out so stored rows stay attributable. */
|
|
10
|
+
readonly lastOwnerId: TOwnerId | null;
|
|
11
|
+
/** Whether the last durable identity decision activated or fenced the owner. */
|
|
12
|
+
readonly status: ClientDataIdentityStatus;
|
|
13
|
+
/** Monotonic ordering for identity writes and cross-context notifications. */
|
|
14
|
+
readonly revision: number;
|
|
15
|
+
/** Revision of the newest sign-out explicitly requested by the user. */
|
|
16
|
+
readonly explicitSignOutRevision: number;
|
|
17
|
+
}
|
|
18
|
+
export type ClientDataIdentitySignal<TOwnerId extends string = string> = {
|
|
19
|
+
readonly type: "owner-active";
|
|
20
|
+
readonly ownerId: TOwnerId;
|
|
21
|
+
readonly revision: number;
|
|
22
|
+
} | {
|
|
23
|
+
readonly type: "signed-out";
|
|
24
|
+
readonly explicit: boolean;
|
|
25
|
+
/** An immediate pre-persistence sign-out fence intentionally has no revision. */
|
|
26
|
+
readonly revision?: number;
|
|
27
|
+
};
|
|
28
|
+
export interface ClientDataIdentitySignalDecision {
|
|
29
|
+
readonly accepted: boolean;
|
|
30
|
+
readonly appliedRevision: number;
|
|
31
|
+
}
|
|
32
|
+
export type ClientDataSignOutTransition<TOwnerId extends string = string> = {
|
|
33
|
+
readonly outcome: "applied";
|
|
34
|
+
readonly revision: number;
|
|
35
|
+
readonly signal: Extract<ClientDataIdentitySignal<TOwnerId>, {
|
|
36
|
+
type: "signed-out";
|
|
37
|
+
}>;
|
|
38
|
+
readonly state: ClientDataIdentityState<TOwnerId>;
|
|
39
|
+
} | {
|
|
40
|
+
readonly outcome: "stale" | "unchanged";
|
|
41
|
+
readonly state: ClientDataIdentityState<TOwnerId>;
|
|
42
|
+
};
|
|
43
|
+
export type ClientDataActivationTransition<TOwnerId extends string = string> = {
|
|
44
|
+
readonly outcome: "applied";
|
|
45
|
+
readonly revision: number;
|
|
46
|
+
readonly signal: Extract<ClientDataIdentitySignal<TOwnerId>, {
|
|
47
|
+
type: "owner-active";
|
|
48
|
+
}>;
|
|
49
|
+
readonly state: ClientDataIdentityState<TOwnerId>;
|
|
50
|
+
} | {
|
|
51
|
+
readonly outcome: "blocked";
|
|
52
|
+
readonly state: ClientDataIdentityState<TOwnerId>;
|
|
53
|
+
};
|
|
54
|
+
/** Creates the durable state used before this device has verified an owner. */
|
|
55
|
+
export declare function createClientDataIdentityState<TOwnerId extends string = string>(): ClientDataIdentityState<TOwnerId>;
|
|
56
|
+
/** Returns the owner that may be reopened offline, or null while fenced. */
|
|
57
|
+
export declare function activeClientDataOwner<TOwnerId extends string>(state: ClientDataIdentityState<TOwnerId>): TOwnerId | null;
|
|
58
|
+
/**
|
|
59
|
+
* Applies a signed-out identity answer to a state read in the same transaction.
|
|
60
|
+
*
|
|
61
|
+
* Pass `expectedRevision` from before an asynchronous session check. A newer
|
|
62
|
+
* identity write then makes that delayed answer stale instead of allowing it to
|
|
63
|
+
* fence the newly activated owner.
|
|
64
|
+
*/
|
|
65
|
+
export declare function transitionClientDataSignOut<TOwnerId extends string>(state: ClientDataIdentityState<TOwnerId>, options?: {
|
|
66
|
+
readonly expectedRevision?: number;
|
|
67
|
+
readonly explicit?: boolean;
|
|
68
|
+
}): ClientDataSignOutTransition<TOwnerId>;
|
|
69
|
+
/**
|
|
70
|
+
* Activates a freshly verified owner and advances the durable identity revision.
|
|
71
|
+
*
|
|
72
|
+
* `baselineRevision` only fences an explicit sign-out that happened after the
|
|
73
|
+
* caller began verification. It does not order competing owner verifications.
|
|
74
|
+
* Within one runtime, callers must abort or generation-check asynchronous
|
|
75
|
+
* session requests. Across tabs or workers, the persistence adapter must also
|
|
76
|
+
* compare the durable revision with the request's original revision, or apply
|
|
77
|
+
* equivalent durable ordering, before calling this transition. Otherwise an
|
|
78
|
+
* older owner-A response can overtake a newer owner-B activation.
|
|
79
|
+
*/
|
|
80
|
+
export declare function transitionClientDataActivation<TOwnerId extends string>(state: ClientDataIdentityState<TOwnerId>, ownerId: TOwnerId, options?: {
|
|
81
|
+
readonly baselineRevision?: number;
|
|
82
|
+
}): ClientDataActivationTransition<TOwnerId>;
|
|
83
|
+
/**
|
|
84
|
+
* Orders a validated cross-context identity signal against the newest applied
|
|
85
|
+
* durable revision. An unrevisioned sign-out is an immediate fence and always
|
|
86
|
+
* applies; the storage adapter must later reconcile it with durable state.
|
|
87
|
+
*/
|
|
88
|
+
export declare function acceptClientDataIdentitySignal<TOwnerId extends string>(appliedRevision: number, signal: ClientDataIdentitySignal<TOwnerId>): ClientDataIdentitySignalDecision;
|
|
89
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/src/clientData/identity.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IACvE,uFAAuF;IACvF,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,MAAM,wBAAwB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACjE;IACA,QAAQ,CAAC,IAAI,EAAE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
|
+
exports.activeClientDataOwner = activeClientDataOwner;
|
|
5
|
+
exports.transitionClientDataSignOut = transitionClientDataSignOut;
|
|
6
|
+
exports.transitionClientDataActivation = transitionClientDataActivation;
|
|
7
|
+
exports.acceptClientDataIdentitySignal = acceptClientDataIdentitySignal;
|
|
8
|
+
function assertRevision(value, label) {
|
|
9
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
10
|
+
throw new TypeError(`${label} must be a non-negative safe integer.`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function assertState(state) {
|
|
14
|
+
assertRevision(state.revision, "Identity revision");
|
|
15
|
+
assertRevision(state.explicitSignOutRevision, "Explicit sign-out revision");
|
|
16
|
+
if (state.explicitSignOutRevision > state.revision) {
|
|
17
|
+
throw new TypeError("Explicit sign-out revision cannot exceed the identity revision.");
|
|
18
|
+
}
|
|
19
|
+
if (state.status !== "active" &&
|
|
20
|
+
state.status !== "signed-out" &&
|
|
21
|
+
state.status !== "unknown") {
|
|
22
|
+
throw new TypeError("Identity status is invalid.");
|
|
23
|
+
}
|
|
24
|
+
if ((state.lastOwnerId !== null && typeof state.lastOwnerId !== "string") ||
|
|
25
|
+
(state.status === "active" && state.lastOwnerId === null)) {
|
|
26
|
+
throw new TypeError("Active client data must have a string owner ID.");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function nextRevision(revision) {
|
|
30
|
+
if (revision === Number.MAX_SAFE_INTEGER) {
|
|
31
|
+
throw new RangeError("Identity revision is exhausted.");
|
|
32
|
+
}
|
|
33
|
+
return revision + 1;
|
|
34
|
+
}
|
|
35
|
+
/** Creates the durable state used before this device has verified an owner. */
|
|
36
|
+
function createClientDataIdentityState() {
|
|
37
|
+
return {
|
|
38
|
+
lastOwnerId: null,
|
|
39
|
+
status: "unknown",
|
|
40
|
+
revision: 0,
|
|
41
|
+
explicitSignOutRevision: 0,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/** Returns the owner that may be reopened offline, or null while fenced. */
|
|
45
|
+
function activeClientDataOwner(state) {
|
|
46
|
+
assertState(state);
|
|
47
|
+
return state.status === "active" ? state.lastOwnerId : null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Applies a signed-out identity answer to a state read in the same transaction.
|
|
51
|
+
*
|
|
52
|
+
* Pass `expectedRevision` from before an asynchronous session check. A newer
|
|
53
|
+
* identity write then makes that delayed answer stale instead of allowing it to
|
|
54
|
+
* fence the newly activated owner.
|
|
55
|
+
*/
|
|
56
|
+
function transitionClientDataSignOut(state, options = {}) {
|
|
57
|
+
assertState(state);
|
|
58
|
+
if (options.expectedRevision !== undefined) {
|
|
59
|
+
assertRevision(options.expectedRevision, "Expected identity revision");
|
|
60
|
+
if (options.expectedRevision !== state.revision) {
|
|
61
|
+
return { outcome: "stale", state };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const explicit = options.explicit === true;
|
|
65
|
+
if (state.status === "signed-out" && !explicit) {
|
|
66
|
+
return { outcome: "unchanged", state };
|
|
67
|
+
}
|
|
68
|
+
const revision = nextRevision(state.revision);
|
|
69
|
+
const next = {
|
|
70
|
+
...state,
|
|
71
|
+
status: "signed-out",
|
|
72
|
+
revision,
|
|
73
|
+
explicitSignOutRevision: explicit
|
|
74
|
+
? revision
|
|
75
|
+
: state.explicitSignOutRevision,
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
outcome: "applied",
|
|
79
|
+
revision,
|
|
80
|
+
signal: { type: "signed-out", explicit, revision },
|
|
81
|
+
state: next,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Activates a freshly verified owner and advances the durable identity revision.
|
|
86
|
+
*
|
|
87
|
+
* `baselineRevision` only fences an explicit sign-out that happened after the
|
|
88
|
+
* caller began verification. It does not order competing owner verifications.
|
|
89
|
+
* Within one runtime, callers must abort or generation-check asynchronous
|
|
90
|
+
* session requests. Across tabs or workers, the persistence adapter must also
|
|
91
|
+
* compare the durable revision with the request's original revision, or apply
|
|
92
|
+
* equivalent durable ordering, before calling this transition. Otherwise an
|
|
93
|
+
* older owner-A response can overtake a newer owner-B activation.
|
|
94
|
+
*/
|
|
95
|
+
function transitionClientDataActivation(state, ownerId, options = {}) {
|
|
96
|
+
assertState(state);
|
|
97
|
+
if (typeof ownerId !== "string") {
|
|
98
|
+
throw new TypeError("Client-data owner ID must be a string.");
|
|
99
|
+
}
|
|
100
|
+
if (options.baselineRevision !== undefined) {
|
|
101
|
+
assertRevision(options.baselineRevision, "Baseline identity revision");
|
|
102
|
+
if (state.explicitSignOutRevision > options.baselineRevision) {
|
|
103
|
+
return { outcome: "blocked", state };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const revision = nextRevision(state.revision);
|
|
107
|
+
const next = {
|
|
108
|
+
...state,
|
|
109
|
+
lastOwnerId: ownerId,
|
|
110
|
+
status: "active",
|
|
111
|
+
revision,
|
|
112
|
+
};
|
|
113
|
+
return {
|
|
114
|
+
outcome: "applied",
|
|
115
|
+
revision,
|
|
116
|
+
signal: { type: "owner-active", ownerId, revision },
|
|
117
|
+
state: next,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Orders a validated cross-context identity signal against the newest applied
|
|
122
|
+
* durable revision. An unrevisioned sign-out is an immediate fence and always
|
|
123
|
+
* applies; the storage adapter must later reconcile it with durable state.
|
|
124
|
+
*/
|
|
125
|
+
function acceptClientDataIdentitySignal(appliedRevision, signal) {
|
|
126
|
+
assertRevision(appliedRevision, "Applied identity revision");
|
|
127
|
+
if (signal.revision === undefined) {
|
|
128
|
+
return { accepted: true, appliedRevision };
|
|
129
|
+
}
|
|
130
|
+
assertRevision(signal.revision, "Signal identity revision");
|
|
131
|
+
return signal.revision < appliedRevision
|
|
132
|
+
? { accepted: false, appliedRevision }
|
|
133
|
+
: { accepted: true, appliedRevision: signal.revision };
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/clientData/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("../../_dnt.polyfills.js");
|
|
18
|
+
__exportStar(require("./identity.js"), exports);
|
|
@@ -22,6 +22,13 @@ type PendingSessionState = {
|
|
|
22
22
|
*
|
|
23
23
|
* Server renders never settle, so hydration still starts from the pending
|
|
24
24
|
* state the server rendered.
|
|
25
|
+
*
|
|
26
|
+
* This works around Better Auth deriving `isPending` from "has no data"
|
|
27
|
+
* (`isPending: current.data === null` in its session atom) rather than from
|
|
28
|
+
* "has had no answer yet". If a Better Auth release separates those, this
|
|
29
|
+
* whole module and its tests can go, and consumers can call the client's
|
|
30
|
+
* `useSession` directly again; the manifest's auth client module is the only
|
|
31
|
+
* other place to check.
|
|
25
32
|
*/
|
|
26
33
|
export declare function createSettledSessionHook<TState extends PendingSessionState>(useSession: () => TState): () => TState;
|
|
27
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/src/next/auth/client.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAGpC;;;;;GAKG;AAEH,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/src/next/auth/client.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAGpC;;;;;GAKG;AAEH,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,SAAS,mBAAmB,EACzE,UAAU,EAAE,MAAM,MAAM,GACvB,MAAM,MAAM,CAWd"}
|
|
@@ -17,6 +17,13 @@ require("../../../_dnt.polyfills.js");
|
|
|
17
17
|
*
|
|
18
18
|
* Server renders never settle, so hydration still starts from the pending
|
|
19
19
|
* state the server rendered.
|
|
20
|
+
*
|
|
21
|
+
* This works around Better Auth deriving `isPending` from "has no data"
|
|
22
|
+
* (`isPending: current.data === null` in its session atom) rather than from
|
|
23
|
+
* "has had no answer yet". If a Better Auth release separates those, this
|
|
24
|
+
* whole module and its tests can go, and consumers can call the client's
|
|
25
|
+
* `useSession` directly again; the manifest's auth client module is the only
|
|
26
|
+
* other place to check.
|
|
20
27
|
*/
|
|
21
28
|
function createSettledSessionHook(useSession) {
|
|
22
29
|
let settled = false;
|
package/skills/loom/SKILL.md
CHANGED
|
@@ -69,10 +69,12 @@ from the consumer's working directory.
|
|
|
69
69
|
precedence, then runs the command from the project root.
|
|
70
70
|
- Implementation files, generated wrappers, Drizzle configs, and direct job
|
|
71
71
|
runners should not import `dotenv` or `@next/env` by hand.
|
|
72
|
-
- After `vercel pull
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
- After `vercel pull`, or after project-scoped preparation with
|
|
73
|
+
`loom db release prepare-vercel-project production`, treat
|
|
74
|
+
`.vercel/.env.<target>.local` as a plaintext secret file. Mask usable pulled
|
|
75
|
+
values before build output. Sensitive values are not readable there or through
|
|
76
|
+
`vercel env run`; CLI versions may write either an empty value or a redaction
|
|
77
|
+
sentinel.
|
|
76
78
|
- For external prebuilds, query Vercel env metadata, preserve usable pulled
|
|
77
79
|
values, add unique build-only placeholders only for confirmed Sensitive
|
|
78
80
|
entries, and reject any marker across the complete deployable artifact graph,
|
|
@@ -27,13 +27,15 @@ Use this skill for the shared Better Auth boundary in a consuming app.
|
|
|
27
27
|
- Sensitive values are write-only after creation. Depending on Vercel CLI
|
|
28
28
|
version, `vercel pull` represents them as empty strings or non-secret
|
|
29
29
|
redaction sentinels; external CI does not receive their plaintext.
|
|
30
|
-
- For a local `vercel build --prod`,
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`
|
|
30
|
+
- For a local `vercel build --prod`, prepare Production values and metadata with
|
|
31
|
+
`loom db release prepare-vercel-project production` when CI uses a
|
|
32
|
+
project-scoped token. Legacy team-token workflows may continue to use
|
|
33
|
+
`vercel pull` plus `vercel env ls production --format=json`. Preserve every
|
|
34
|
+
usable pulled value and replace only confirmed unreadable Sensitive values
|
|
35
|
+
with unique, build-only placeholders. Keep the required keys and expected
|
|
36
|
+
Sensitive types in an app-local policy. Use the `versioned-secret` placeholder
|
|
37
|
+
kind for `BETTER_AUTH_SECRETS` so build-time validation receives a
|
|
38
|
+
syntactically valid `1:<placeholder>` value.
|
|
37
39
|
- Scan `.vercel/output` for every unique placeholder before
|
|
38
40
|
`vercel deploy --prebuilt`. Server-only variables are attached from the Vercel
|
|
39
41
|
project at runtime, but the scan proves a build-time reference did not reach
|
package/skills/loom-db/SKILL.md
CHANGED
|
@@ -84,8 +84,13 @@ Use this skill when working on the shared DB stack from a consuming app.
|
|
|
84
84
|
`MIGRATION_DATABASE_URL_UNPOOLED` and expose it only to validation and
|
|
85
85
|
migration steps. `vercel pull` and `vercel env run` cannot recover Sensitive
|
|
86
86
|
values. The pulled URL and legacy `DATABASE_URL_UNPOOLED` secret remain
|
|
87
|
-
supported during gradual adoption.
|
|
88
|
-
CLI release commands
|
|
87
|
+
supported during gradual adoption. Team-token workflows pass
|
|
88
|
+
`--scope "$VERCEL_ORG_ID"` to Vercel CLI release commands. Project-token
|
|
89
|
+
workflows instead run `loom db release prepare-vercel-project production` with
|
|
90
|
+
explicit private env, metadata, and project-link outputs, then build without
|
|
91
|
+
the token. Stage the materialized artifact with both `VERCEL_ORG_ID` and
|
|
92
|
+
`VERCEL_PROJECT_ID` removed from that process and promote it with
|
|
93
|
+
`loom db release promote-vercel`; do not mix these two release modes.
|
|
89
94
|
- Query Vercel Production variable metadata before an external build. Preserve
|
|
90
95
|
usable pulled values, insert unique placeholders only for confirmed unreadable
|
|
91
96
|
Sensitive values, and scan `.vercel/output` for those markers before uploading
|
|
@@ -53,6 +53,12 @@ first. Prepare SQL schemas and pure import planners locally, then exercise
|
|
|
53
53
|
protected real input without publishing private fixtures. Build browser recovery
|
|
54
54
|
before retiring any legacy store or protocol it depends on.
|
|
55
55
|
|
|
56
|
+
A migrated app usually ends up with auth wiring that differs from a greenfield
|
|
57
|
+
shape: a factory kept free of environment reads, a guarded catch-all route, or
|
|
58
|
+
app-owned session readers. Record those paths in `loom.json` and adopt the
|
|
59
|
+
feature around them. Reshaping working authentication to match a default layout
|
|
60
|
+
buys nothing and risks a live boundary.
|
|
61
|
+
|
|
56
62
|
Choose authentication and persistence release boundaries from actual ID/session
|
|
57
63
|
dependencies. A verified NextAuth-to-Gongo bridge can allow staged replacement;
|
|
58
64
|
it is an option, not a mandatory intermediate destination. A database adapter is
|