@gadicc/loom 1.27.0 → 1.28.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 -3
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +76 -13
- package/package.json +2 -2
- package/script/src/cli/mod.d.ts.map +1 -1
- package/script/src/cli/mod.js +76 -13
- package/skills/loom-auth/SKILL.md +32 -0
- package/skills/modernize-app/SKILL.md +90 -0
- package/skills/modernize-app/agents/openai.yaml +4 -0
- package/skills/modernize-app/references/architecture-and-characterization.md +205 -0
- package/skills/modernize-app/references/identity-and-data.md +251 -0
- package/skills/modernize-app/references/offline-and-media.md +403 -0
- package/skills/modernize-app/references/rollout-and-shared-work.md +400 -0
package/README.md
CHANGED
|
@@ -362,6 +362,10 @@ The package now publishes Codex skill folders under `skills/`.
|
|
|
362
362
|
dependency-upgrade workflow covering compatibility groups, rollback safety,
|
|
363
363
|
failure isolation, major migrations, reviewable commits, and exact-tree final
|
|
364
364
|
verification.
|
|
365
|
+
- `skills/modernize-app` guides staged modernization of an existing application,
|
|
366
|
+
including identity/data preservation, optional offline/media transitions and
|
|
367
|
+
verified rollout. Dependency-only work stays with `upgrade-deps`; new apps use
|
|
368
|
+
scaffolding rather than this migration workflow.
|
|
365
369
|
- `skills/loom-db` provides DB-feature guidance for Neon/Drizzle wiring, managed
|
|
366
370
|
local schema blueprints, Valibot generation, and the shared PGlite harness.
|
|
367
371
|
- `skills/loom-auth` covers Better Auth secrets, rotation, environment trust
|
|
@@ -375,9 +379,9 @@ Projects do not need to copy these files manually. `loom init`, `loom add db`,
|
|
|
375
379
|
`loom add jobs`, and `loom check` manage a small project-local `AGENTS.md` Loom
|
|
376
380
|
block plus `.agents/skills/*` symlinks that point to the installed
|
|
377
381
|
`node_modules/@gadicc/loom/skills/*` folders. The global `loom`,
|
|
378
|
-
`loom-torvalds-review`,
|
|
379
|
-
initialized project; feature skills are linked when their matching
|
|
380
|
-
active.
|
|
382
|
+
`loom-torvalds-review`, `upgrade-deps`, and `modernize-app` skills are linked
|
|
383
|
+
for every initialized project; feature skills are linked when their matching
|
|
384
|
+
feature is active.
|
|
381
385
|
|
|
382
386
|
Third-party skills are not packaged with Loom. Loom carries a metadata-only
|
|
383
387
|
catalog containing source URLs, immutable commits, content hashes, and license
|
package/esm/src/cli/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/cli/mod.ts"],"names":[],"mappings":"AAgCA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAuBjC,OAAO,EAUL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,2DACyB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAC9E,eAAO,MAAM,uBAAuB,qCAAqC,CAAC;AAC1E,eAAO,MAAM,8BAA8B,8CACE,CAAC;AAC9C,eAAO,MAAM,4BAA4B,4CACE,CAAC;AAC5C,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AACtE,eAAO,MAAM,kCAAkC,yBAAyB,CAAC;AACzE,eAAO,MAAM,mCAAmC,yBAAyB,CAAC;AAI1E,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAO,CAAC;AAwCtD,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,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GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,EACrD,OAAO,GAAE,mBAAwB;;;;GA0LlC;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,EACrD,OAAO,GAAE,mBAAwB;;;eAMxB,MAAM;gBACL,sBAAsB;;;;GA2GjC;AAuFD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,uBAAuB,EAC9B,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,YAoClD;AA4gCD,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,EAAE,SAAS,EACb,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,aAAa,CAAC;CAC1B,mBAiBP;AAopBD,wBAAsB,MAAM,CAC1B,IAAI,MAAwB,EAC5B,EAAE,GAAE,SAGH,mBA6KF"}
|
package/esm/src/cli/mod.js
CHANGED
|
@@ -95,6 +95,11 @@ const managedSkills = [
|
|
|
95
95
|
relativePackagePath: "skills/upgrade-deps",
|
|
96
96
|
skillName: "upgrade-deps",
|
|
97
97
|
},
|
|
98
|
+
{
|
|
99
|
+
label: "legacy app modernization skill",
|
|
100
|
+
relativePackagePath: "skills/modernize-app",
|
|
101
|
+
skillName: "modernize-app",
|
|
102
|
+
},
|
|
98
103
|
{
|
|
99
104
|
featureKey: "db",
|
|
100
105
|
label: "loom db skill",
|
|
@@ -1156,6 +1161,10 @@ async function mergeAuthConfig(cwd, framework, featureConfig) {
|
|
|
1156
1161
|
...defaults.modules,
|
|
1157
1162
|
...featureConfig?.modules,
|
|
1158
1163
|
},
|
|
1164
|
+
// Recorded by the app; Loom never infers or rewrites this choice.
|
|
1165
|
+
...(featureConfig?.requestSessionReaders
|
|
1166
|
+
? { requestSessionReaders: featureConfig.requestSessionReaders }
|
|
1167
|
+
: {}),
|
|
1159
1168
|
};
|
|
1160
1169
|
}
|
|
1161
1170
|
function dependencyExecutable(tooling, executable) {
|
|
@@ -3935,15 +3944,35 @@ function matchesAuthRouteWrapper(text, expectedSources, expectedExportName) {
|
|
|
3935
3944
|
if (!matchesImportSource(normalized, expectedSources)) {
|
|
3936
3945
|
return false;
|
|
3937
3946
|
}
|
|
3938
|
-
|
|
3939
|
-
|
|
3947
|
+
// Exactly one handler set, so every exported method is traceable to it.
|
|
3948
|
+
const calls = [
|
|
3949
|
+
...normalized.matchAll(/toNextJsHandler\(\s*([A-Za-z_$][\w$]*)\s*\)/g),
|
|
3950
|
+
];
|
|
3951
|
+
if (calls.length !== 1) {
|
|
3940
3952
|
return false;
|
|
3941
3953
|
}
|
|
3942
|
-
const
|
|
3943
|
-
if (
|
|
3954
|
+
const instanceName = calls[0][1];
|
|
3955
|
+
if (expectedExportName && instanceName !== expectedExportName) {
|
|
3944
3956
|
return false;
|
|
3945
3957
|
}
|
|
3946
|
-
|
|
3958
|
+
const match = normalized.match(/export\s+const\s+\{\s*([^}]+)\s*\}\s*=\s*toNextJsHandler\(/);
|
|
3959
|
+
if (match) {
|
|
3960
|
+
const actualSpecifiers = new Set(match[1].split(",").map((specifier) => specifier.trim()).filter(Boolean));
|
|
3961
|
+
return actualSpecifiers.has("GET") && actualSpecifiers.has("POST");
|
|
3962
|
+
}
|
|
3963
|
+
// An app may wrap the handlers, for example to fail closed until a
|
|
3964
|
+
// migration completes. Each exported method must still come from the
|
|
3965
|
+
// handlers that call returned.
|
|
3966
|
+
const handlers = normalized.match(/(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*toNextJsHandler\(/);
|
|
3967
|
+
if (!handlers) {
|
|
3968
|
+
return false;
|
|
3969
|
+
}
|
|
3970
|
+
const handlersName = handlers[1];
|
|
3971
|
+
return ["GET", "POST"].every((method) => {
|
|
3972
|
+
const exported = normalized.match(new RegExp(`export\\s+const\\s+${method}\\s*=([^;]*);`));
|
|
3973
|
+
return Boolean(exported &&
|
|
3974
|
+
new RegExp(`\\b${escapeRegExp(handlersName)}\\.${method}\\b`).test(exported[1]));
|
|
3975
|
+
});
|
|
3947
3976
|
}
|
|
3948
3977
|
function authClientTemplate(config, authExportName) {
|
|
3949
3978
|
return `"use client";
|
|
@@ -9257,6 +9286,7 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9257
9286
|
const config = await mergeAuthConfig(cwd, framework, feature.config);
|
|
9258
9287
|
const requiredFiles = [
|
|
9259
9288
|
config.modules.authModule,
|
|
9289
|
+
config.modules.authRuntimeModule,
|
|
9260
9290
|
config.modules.authClientModule,
|
|
9261
9291
|
config.entrypoints.routeHandler,
|
|
9262
9292
|
config.modules.authServerModule,
|
|
@@ -9272,6 +9302,37 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9272
9302
|
const authExportName = authModuleText
|
|
9273
9303
|
? detectBetterAuthExportName(authModuleText)
|
|
9274
9304
|
: null;
|
|
9305
|
+
// An app may build its instance in a separate runtime module, so the shared
|
|
9306
|
+
// helpers can be split across the two. Only a runtime module that imports
|
|
9307
|
+
// the auth module counts: otherwise its text proves nothing about the
|
|
9308
|
+
// instance this feature checks.
|
|
9309
|
+
const authRuntimeModule = config.modules.authRuntimeModule;
|
|
9310
|
+
const authRuntimeText = authRuntimeModule
|
|
9311
|
+
? await readTextIfExists(join(cwd, authRuntimeModule))
|
|
9312
|
+
: null;
|
|
9313
|
+
let creditedRuntimeText = null;
|
|
9314
|
+
if (authRuntimeModule && authRuntimeText) {
|
|
9315
|
+
if (matchesImportSource(authRuntimeText, getImportSpecifierCandidates(authRuntimeModule, config.modules.authModule))) {
|
|
9316
|
+
creditedRuntimeText = authRuntimeText;
|
|
9317
|
+
}
|
|
9318
|
+
else {
|
|
9319
|
+
issues.push(`Auth runtime module does not import the configured auth module: ${authRuntimeModule}`);
|
|
9320
|
+
suggestions.add("Point modules.authRuntimeModule at the module that builds the configured auth instance, or remove it from loom.json.");
|
|
9321
|
+
}
|
|
9322
|
+
}
|
|
9323
|
+
const authWiringSources = [
|
|
9324
|
+
{ path: config.modules.authModule, text: authModuleText },
|
|
9325
|
+
...(creditedRuntimeText
|
|
9326
|
+
? [{ path: authRuntimeModule, text: creditedRuntimeText }]
|
|
9327
|
+
: []),
|
|
9328
|
+
].filter((source) => source.text);
|
|
9329
|
+
// Modules reach the instance through whichever of the two exports it.
|
|
9330
|
+
const authImportCandidates = (fromPath) => [
|
|
9331
|
+
...getImportSpecifierCandidates(fromPath, config.modules.authModule),
|
|
9332
|
+
...(creditedRuntimeText && authRuntimeModule
|
|
9333
|
+
? getImportSpecifierCandidates(fromPath, authRuntimeModule)
|
|
9334
|
+
: []),
|
|
9335
|
+
];
|
|
9275
9336
|
if (authModuleText) {
|
|
9276
9337
|
const authModuleChecks = [
|
|
9277
9338
|
[
|
|
@@ -9284,8 +9345,8 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9284
9345
|
],
|
|
9285
9346
|
];
|
|
9286
9347
|
for (const [pattern, message] of authModuleChecks) {
|
|
9287
|
-
if (!pattern.test(
|
|
9288
|
-
issues.push(`${message}: ${
|
|
9348
|
+
if (!authWiringSources.some((source) => pattern.test(source.text))) {
|
|
9349
|
+
issues.push(`${message}: ${authWiringSources.map((source) => source.path).join(", ")}`);
|
|
9289
9350
|
suggestions.add("Update the auth module to use the shared Loom Better Auth helpers, or rerun `loom add auth` and reapply any app-local customizations.");
|
|
9290
9351
|
}
|
|
9291
9352
|
}
|
|
@@ -9294,15 +9355,16 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9294
9355
|
warnings.push(`Auth module uses a dynamic Better Auth baseURL without trusted proxy headers; trusted reverse proxies such as \`vercel dev\` can leak an internal callback host: ${config.modules.authModule}`);
|
|
9295
9356
|
suggestions.add("Use createBetterAuthLocalDevelopmentConfig for loopback development behind a trusted proxy, or explicitly enable Better Auth trustedProxyHeaders only where that proxy boundary is trusted.");
|
|
9296
9357
|
}
|
|
9297
|
-
if (
|
|
9358
|
+
if (config.requestSessionReaders !== "app-owned" &&
|
|
9359
|
+
!config.modules.authServerModule &&
|
|
9298
9360
|
!authModuleText.includes("createRequestAuthSessionReaders")) {
|
|
9299
9361
|
issues.push(`Auth module is missing Loom request-scoped session readers: ${config.modules.authModule}`);
|
|
9300
|
-
suggestions.add(
|
|
9362
|
+
suggestions.add('Either wire createRequestAuthSessionReaders into the auth module, add an auth server helper module and record it in loom.json, or record requestSessionReaders: "app-owned" when the app must read sessions its own way.');
|
|
9301
9363
|
}
|
|
9302
9364
|
}
|
|
9303
9365
|
const authClientText = await readTextIfExists(join(cwd, config.modules.authClientModule));
|
|
9304
9366
|
if (authClientText) {
|
|
9305
|
-
const authClientImportCandidates =
|
|
9367
|
+
const authClientImportCandidates = authImportCandidates(config.modules.authClientModule);
|
|
9306
9368
|
const authClientChecks = [
|
|
9307
9369
|
[
|
|
9308
9370
|
authClientText.includes("createAuthClient"),
|
|
@@ -9326,7 +9388,7 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9326
9388
|
}
|
|
9327
9389
|
const routeHandlerText = await readTextIfExists(join(cwd, config.entrypoints.routeHandler));
|
|
9328
9390
|
if (routeHandlerText) {
|
|
9329
|
-
const routeImportCandidates =
|
|
9391
|
+
const routeImportCandidates = authImportCandidates(config.entrypoints.routeHandler);
|
|
9330
9392
|
if (!matchesAuthRouteWrapper(routeHandlerText, routeImportCandidates, authExportName)) {
|
|
9331
9393
|
issues.push(`Auth route-handler wrapper does not match loom manifest config: ${config.entrypoints.routeHandler}`);
|
|
9332
9394
|
suggestions.add("Run `loom add auth` to restore the thin auth route wrapper, or update loom.json if the app intentionally uses different auth paths.");
|
|
@@ -9335,10 +9397,11 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9335
9397
|
if (config.modules.authServerModule) {
|
|
9336
9398
|
const authServerText = await readTextIfExists(join(cwd, config.modules.authServerModule));
|
|
9337
9399
|
if (authServerText) {
|
|
9338
|
-
const authServerImportCandidates =
|
|
9400
|
+
const authServerImportCandidates = authImportCandidates(config.modules.authServerModule);
|
|
9339
9401
|
const authServerChecks = [
|
|
9340
9402
|
[
|
|
9341
|
-
|
|
9403
|
+
config.requestSessionReaders === "app-owned" ||
|
|
9404
|
+
authServerText.includes("createRequestAuthSessionReaders"),
|
|
9342
9405
|
"Auth server module is not wired to Loom request-scoped session readers",
|
|
9343
9406
|
],
|
|
9344
9407
|
[
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadicc/loom",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "Deno-first shared helpers for extracting common Next.js app code.",
|
|
5
5
|
"homepage": "https://github.com/gadicc/loom#readme",
|
|
6
6
|
"repository": {
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
},
|
|
232
232
|
"scripts": {},
|
|
233
233
|
"loom": {
|
|
234
|
-
"gitCommit": "
|
|
234
|
+
"gitCommit": "e381c057d5eb321d4982119984d98ec292d79c41"
|
|
235
235
|
},
|
|
236
236
|
"bin": {
|
|
237
237
|
"loom": "script/bin/loom.js"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/cli/mod.ts"],"names":[],"mappings":"AAgCA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAC;AAuBjC,OAAO,EAUL,KAAK,cAAc,EAMpB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,oBAAoB,2DACyB,CAAC;AAC3D,eAAO,MAAM,yBAAyB,uCAAuC,CAAC;AAC9E,eAAO,MAAM,uBAAuB,qCAAq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,MAAwB,EAC5B,EAAE,GAAE,SAGH,mBA6KF"}
|
package/script/src/cli/mod.js
CHANGED
|
@@ -166,6 +166,11 @@ const managedSkills = [
|
|
|
166
166
|
relativePackagePath: "skills/upgrade-deps",
|
|
167
167
|
skillName: "upgrade-deps",
|
|
168
168
|
},
|
|
169
|
+
{
|
|
170
|
+
label: "legacy app modernization skill",
|
|
171
|
+
relativePackagePath: "skills/modernize-app",
|
|
172
|
+
skillName: "modernize-app",
|
|
173
|
+
},
|
|
169
174
|
{
|
|
170
175
|
featureKey: "db",
|
|
171
176
|
label: "loom db skill",
|
|
@@ -1227,6 +1232,10 @@ async function mergeAuthConfig(cwd, framework, featureConfig) {
|
|
|
1227
1232
|
...defaults.modules,
|
|
1228
1233
|
...featureConfig?.modules,
|
|
1229
1234
|
},
|
|
1235
|
+
// Recorded by the app; Loom never infers or rewrites this choice.
|
|
1236
|
+
...(featureConfig?.requestSessionReaders
|
|
1237
|
+
? { requestSessionReaders: featureConfig.requestSessionReaders }
|
|
1238
|
+
: {}),
|
|
1230
1239
|
};
|
|
1231
1240
|
}
|
|
1232
1241
|
function dependencyExecutable(tooling, executable) {
|
|
@@ -4006,15 +4015,35 @@ function matchesAuthRouteWrapper(text, expectedSources, expectedExportName) {
|
|
|
4006
4015
|
if (!matchesImportSource(normalized, expectedSources)) {
|
|
4007
4016
|
return false;
|
|
4008
4017
|
}
|
|
4009
|
-
|
|
4010
|
-
|
|
4018
|
+
// Exactly one handler set, so every exported method is traceable to it.
|
|
4019
|
+
const calls = [
|
|
4020
|
+
...normalized.matchAll(/toNextJsHandler\(\s*([A-Za-z_$][\w$]*)\s*\)/g),
|
|
4021
|
+
];
|
|
4022
|
+
if (calls.length !== 1) {
|
|
4011
4023
|
return false;
|
|
4012
4024
|
}
|
|
4013
|
-
const
|
|
4014
|
-
if (
|
|
4025
|
+
const instanceName = calls[0][1];
|
|
4026
|
+
if (expectedExportName && instanceName !== expectedExportName) {
|
|
4015
4027
|
return false;
|
|
4016
4028
|
}
|
|
4017
|
-
|
|
4029
|
+
const match = normalized.match(/export\s+const\s+\{\s*([^}]+)\s*\}\s*=\s*toNextJsHandler\(/);
|
|
4030
|
+
if (match) {
|
|
4031
|
+
const actualSpecifiers = new Set(match[1].split(",").map((specifier) => specifier.trim()).filter(Boolean));
|
|
4032
|
+
return actualSpecifiers.has("GET") && actualSpecifiers.has("POST");
|
|
4033
|
+
}
|
|
4034
|
+
// An app may wrap the handlers, for example to fail closed until a
|
|
4035
|
+
// migration completes. Each exported method must still come from the
|
|
4036
|
+
// handlers that call returned.
|
|
4037
|
+
const handlers = normalized.match(/(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*toNextJsHandler\(/);
|
|
4038
|
+
if (!handlers) {
|
|
4039
|
+
return false;
|
|
4040
|
+
}
|
|
4041
|
+
const handlersName = handlers[1];
|
|
4042
|
+
return ["GET", "POST"].every((method) => {
|
|
4043
|
+
const exported = normalized.match(new RegExp(`export\\s+const\\s+${method}\\s*=([^;]*);`));
|
|
4044
|
+
return Boolean(exported &&
|
|
4045
|
+
new RegExp(`\\b${escapeRegExp(handlersName)}\\.${method}\\b`).test(exported[1]));
|
|
4046
|
+
});
|
|
4018
4047
|
}
|
|
4019
4048
|
function authClientTemplate(config, authExportName) {
|
|
4020
4049
|
return `"use client";
|
|
@@ -9328,6 +9357,7 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9328
9357
|
const config = await mergeAuthConfig(cwd, framework, feature.config);
|
|
9329
9358
|
const requiredFiles = [
|
|
9330
9359
|
config.modules.authModule,
|
|
9360
|
+
config.modules.authRuntimeModule,
|
|
9331
9361
|
config.modules.authClientModule,
|
|
9332
9362
|
config.entrypoints.routeHandler,
|
|
9333
9363
|
config.modules.authServerModule,
|
|
@@ -9343,6 +9373,37 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9343
9373
|
const authExportName = authModuleText
|
|
9344
9374
|
? detectBetterAuthExportName(authModuleText)
|
|
9345
9375
|
: null;
|
|
9376
|
+
// An app may build its instance in a separate runtime module, so the shared
|
|
9377
|
+
// helpers can be split across the two. Only a runtime module that imports
|
|
9378
|
+
// the auth module counts: otherwise its text proves nothing about the
|
|
9379
|
+
// instance this feature checks.
|
|
9380
|
+
const authRuntimeModule = config.modules.authRuntimeModule;
|
|
9381
|
+
const authRuntimeText = authRuntimeModule
|
|
9382
|
+
? await readTextIfExists((0, node_path_1.join)(cwd, authRuntimeModule))
|
|
9383
|
+
: null;
|
|
9384
|
+
let creditedRuntimeText = null;
|
|
9385
|
+
if (authRuntimeModule && authRuntimeText) {
|
|
9386
|
+
if (matchesImportSource(authRuntimeText, getImportSpecifierCandidates(authRuntimeModule, config.modules.authModule))) {
|
|
9387
|
+
creditedRuntimeText = authRuntimeText;
|
|
9388
|
+
}
|
|
9389
|
+
else {
|
|
9390
|
+
issues.push(`Auth runtime module does not import the configured auth module: ${authRuntimeModule}`);
|
|
9391
|
+
suggestions.add("Point modules.authRuntimeModule at the module that builds the configured auth instance, or remove it from loom.json.");
|
|
9392
|
+
}
|
|
9393
|
+
}
|
|
9394
|
+
const authWiringSources = [
|
|
9395
|
+
{ path: config.modules.authModule, text: authModuleText },
|
|
9396
|
+
...(creditedRuntimeText
|
|
9397
|
+
? [{ path: authRuntimeModule, text: creditedRuntimeText }]
|
|
9398
|
+
: []),
|
|
9399
|
+
].filter((source) => source.text);
|
|
9400
|
+
// Modules reach the instance through whichever of the two exports it.
|
|
9401
|
+
const authImportCandidates = (fromPath) => [
|
|
9402
|
+
...getImportSpecifierCandidates(fromPath, config.modules.authModule),
|
|
9403
|
+
...(creditedRuntimeText && authRuntimeModule
|
|
9404
|
+
? getImportSpecifierCandidates(fromPath, authRuntimeModule)
|
|
9405
|
+
: []),
|
|
9406
|
+
];
|
|
9346
9407
|
if (authModuleText) {
|
|
9347
9408
|
const authModuleChecks = [
|
|
9348
9409
|
[
|
|
@@ -9355,8 +9416,8 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9355
9416
|
],
|
|
9356
9417
|
];
|
|
9357
9418
|
for (const [pattern, message] of authModuleChecks) {
|
|
9358
|
-
if (!pattern.test(
|
|
9359
|
-
issues.push(`${message}: ${
|
|
9419
|
+
if (!authWiringSources.some((source) => pattern.test(source.text))) {
|
|
9420
|
+
issues.push(`${message}: ${authWiringSources.map((source) => source.path).join(", ")}`);
|
|
9360
9421
|
suggestions.add("Update the auth module to use the shared Loom Better Auth helpers, or rerun `loom add auth` and reapply any app-local customizations.");
|
|
9361
9422
|
}
|
|
9362
9423
|
}
|
|
@@ -9365,15 +9426,16 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9365
9426
|
warnings.push(`Auth module uses a dynamic Better Auth baseURL without trusted proxy headers; trusted reverse proxies such as \`vercel dev\` can leak an internal callback host: ${config.modules.authModule}`);
|
|
9366
9427
|
suggestions.add("Use createBetterAuthLocalDevelopmentConfig for loopback development behind a trusted proxy, or explicitly enable Better Auth trustedProxyHeaders only where that proxy boundary is trusted.");
|
|
9367
9428
|
}
|
|
9368
|
-
if (
|
|
9429
|
+
if (config.requestSessionReaders !== "app-owned" &&
|
|
9430
|
+
!config.modules.authServerModule &&
|
|
9369
9431
|
!authModuleText.includes("createRequestAuthSessionReaders")) {
|
|
9370
9432
|
issues.push(`Auth module is missing Loom request-scoped session readers: ${config.modules.authModule}`);
|
|
9371
|
-
suggestions.add(
|
|
9433
|
+
suggestions.add('Either wire createRequestAuthSessionReaders into the auth module, add an auth server helper module and record it in loom.json, or record requestSessionReaders: "app-owned" when the app must read sessions its own way.');
|
|
9372
9434
|
}
|
|
9373
9435
|
}
|
|
9374
9436
|
const authClientText = await readTextIfExists((0, node_path_1.join)(cwd, config.modules.authClientModule));
|
|
9375
9437
|
if (authClientText) {
|
|
9376
|
-
const authClientImportCandidates =
|
|
9438
|
+
const authClientImportCandidates = authImportCandidates(config.modules.authClientModule);
|
|
9377
9439
|
const authClientChecks = [
|
|
9378
9440
|
[
|
|
9379
9441
|
authClientText.includes("createAuthClient"),
|
|
@@ -9397,7 +9459,7 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9397
9459
|
}
|
|
9398
9460
|
const routeHandlerText = await readTextIfExists((0, node_path_1.join)(cwd, config.entrypoints.routeHandler));
|
|
9399
9461
|
if (routeHandlerText) {
|
|
9400
|
-
const routeImportCandidates =
|
|
9462
|
+
const routeImportCandidates = authImportCandidates(config.entrypoints.routeHandler);
|
|
9401
9463
|
if (!matchesAuthRouteWrapper(routeHandlerText, routeImportCandidates, authExportName)) {
|
|
9402
9464
|
issues.push(`Auth route-handler wrapper does not match loom manifest config: ${config.entrypoints.routeHandler}`);
|
|
9403
9465
|
suggestions.add("Run `loom add auth` to restore the thin auth route wrapper, or update loom.json if the app intentionally uses different auth paths.");
|
|
@@ -9406,10 +9468,11 @@ async function checkAuthFeature(cwd, framework, manifest) {
|
|
|
9406
9468
|
if (config.modules.authServerModule) {
|
|
9407
9469
|
const authServerText = await readTextIfExists((0, node_path_1.join)(cwd, config.modules.authServerModule));
|
|
9408
9470
|
if (authServerText) {
|
|
9409
|
-
const authServerImportCandidates =
|
|
9471
|
+
const authServerImportCandidates = authImportCandidates(config.modules.authServerModule);
|
|
9410
9472
|
const authServerChecks = [
|
|
9411
9473
|
[
|
|
9412
|
-
|
|
9474
|
+
config.requestSessionReaders === "app-owned" ||
|
|
9475
|
+
authServerText.includes("createRequestAuthSessionReaders"),
|
|
9413
9476
|
"Auth server module is not wired to Loom request-scoped session readers",
|
|
9414
9477
|
],
|
|
9415
9478
|
[
|
|
@@ -102,6 +102,38 @@ The helper accepts only loopback hosts and origins by default. Do not spread it
|
|
|
102
102
|
into production configuration or enable trusted proxy headers when requests can
|
|
103
103
|
bypass or spoof the intended proxy boundary.
|
|
104
104
|
|
|
105
|
+
## App layouts the manifest records
|
|
106
|
+
|
|
107
|
+
`loom.json` describes the app's shape; the checks follow it rather than one
|
|
108
|
+
layout. Record `modules.authRuntimeModule` when the Better Auth factory stays
|
|
109
|
+
free of environment reads and another module builds the instance: the shared
|
|
110
|
+
secret and session helpers may then live in either, and either may be the module
|
|
111
|
+
the client, route and server import. That module must import the configured auth
|
|
112
|
+
module, otherwise its text says nothing about the instance being checked.
|
|
113
|
+
|
|
114
|
+
The route may wrap its handlers, for example to fail closed while a migration
|
|
115
|
+
completes, as long as one `toNextJsHandler(<instance>)` call supplies every
|
|
116
|
+
exported `GET` and `POST`.
|
|
117
|
+
|
|
118
|
+
## Request-scoped sessions
|
|
119
|
+
|
|
120
|
+
`createRequestAuthSessionReaders` returns request-cached readers, so within one
|
|
121
|
+
request `getFreshSession` reads the cookie once. That suits page and layout
|
|
122
|
+
reads. An authorization boundary that must re-check after awaited work needs an
|
|
123
|
+
uncached read; a cached one can answer from before a revocation. Keep such a
|
|
124
|
+
reader app-owned, validate the session where you read it, and record
|
|
125
|
+
`requestSessionReaders: "app-owned"` so the check expects it.
|
|
126
|
+
|
|
127
|
+
## Anonymous identity checks
|
|
128
|
+
|
|
129
|
+
An endpoint that answers "who is signed in" to a page should return 200 with a
|
|
130
|
+
null user for anonymous visitors, not 401. Anonymous pages ask on each load and
|
|
131
|
+
tab refocus, and browsers log every 401 as a failed request, which fills the
|
|
132
|
+
console during ordinary anonymous use. Keep 401 for endpoints that refuse to do
|
|
133
|
+
the work without a session. Clients cached before such a change must already
|
|
134
|
+
accept the new body: an old client that treats a null user as malformed shows an
|
|
135
|
+
error until it reloads.
|
|
136
|
+
|
|
105
137
|
## Local test login
|
|
106
138
|
|
|
107
139
|
Developer UI login is distinct from a production-build E2E auth harness. Use
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: modernize-app
|
|
3
|
+
description: Modernize an existing legacy web app toward Loom through staged tooling, framework, authentication, persistence and client-data migrations. Use for an app-wide modernization, especially Mongo/Gongo applications; use upgrade-deps alone for a dependency-only update and loom-scaffold for a new app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Modernize an Existing App
|
|
7
|
+
|
|
8
|
+
Preserve the useful product and its data while replacing the underlying stack in
|
|
9
|
+
reviewable stages. Discover the actual starting point: recollection, old config
|
|
10
|
+
files and a dependency's presence do not establish which runtime paths are used.
|
|
11
|
+
Match the requested phase: for research-only work, inspect and design without
|
|
12
|
+
beginning application changes or provisioning resources. Treat the rollout
|
|
13
|
+
reference as acceptance criteria, not a ready-to-run recipe.
|
|
14
|
+
|
|
15
|
+
## Establish a plan that can survive implementation
|
|
16
|
+
|
|
17
|
+
Use `loom` first in a consumer, read `loom.json`, and follow its recorded
|
|
18
|
+
tooling and feature contracts. If `loom.json` is absent, including an older
|
|
19
|
+
partial Loom adoption, inspect the existing tooling, imports and wrappers before
|
|
20
|
+
using existing-app adoption; do not scaffold over them. Use the matching
|
|
21
|
+
installed feature skill when adopting or changing a Loom feature.
|
|
22
|
+
|
|
23
|
+
Record active routes, important user journeys, authoritative services, server
|
|
24
|
+
and browser data, deployed runtime/region, branch/worktree, verification
|
|
25
|
+
commands and independent backup coverage. Classify findings as observed,
|
|
26
|
+
operator-decided, locally verified, provider-verified or pending. Keep current
|
|
27
|
+
status separate from historical checkpoint notes.
|
|
28
|
+
|
|
29
|
+
Ask about ambiguous product behavior before encoding it: ownership versus
|
|
30
|
+
access, who can create or publish, anonymous adoption, required offline use,
|
|
31
|
+
supported devices, reauthentication and recovery expectations. Continue
|
|
32
|
+
independent work. Reuse explicit decisions and authorization; do not make users
|
|
33
|
+
approve the same choice after every resume or commit.
|
|
34
|
+
|
|
35
|
+
Read only the relevant reference:
|
|
36
|
+
|
|
37
|
+
- [Architecture and characterization](references/architecture-and-characterization.md)
|
|
38
|
+
for feature boundaries, tests, tooling upgrades and retained formats.
|
|
39
|
+
- [Identity and data](references/identity-and-data.md) for Gongo/internal-auth
|
|
40
|
+
or NextAuth bridges, canonical IDs, SQL constraints and import preservation.
|
|
41
|
+
- [Offline data and media](references/offline-and-media.md) for browser data,
|
|
42
|
+
queued work, private downloads, uploads and rendered resource dependencies.
|
|
43
|
+
- [Rollout and shared work](references/rollout-and-shared-work.md) for provider
|
|
44
|
+
placement, rehearsals, production activation and extracting Loom improvements.
|
|
45
|
+
|
|
46
|
+
## Order by dependencies, with useful intermediate behavior
|
|
47
|
+
|
|
48
|
+
Once implementation is authorized, establish reproducible checks and
|
|
49
|
+
characterize the next changing boundary. Run `upgrade-deps` for the dependency
|
|
50
|
+
campaign, grouping coupled packages and recording supported deferrals. Introduce
|
|
51
|
+
application services over the current authoritative store; port simpler features
|
|
52
|
+
first. Prepare SQL schemas and pure import planners locally, then exercise
|
|
53
|
+
protected real input without publishing private fixtures. Build browser recovery
|
|
54
|
+
before retiring any legacy store or protocol it depends on.
|
|
55
|
+
|
|
56
|
+
Choose authentication and persistence release boundaries from actual ID/session
|
|
57
|
+
dependencies. A verified NextAuth-to-Gongo bridge can allow staged replacement;
|
|
58
|
+
it is an option, not a mandatory intermediate destination. A database adapter is
|
|
59
|
+
useful only when its supported synchronization subset costs less than migrating
|
|
60
|
+
remaining features. Avoid implementing a generic Mongo emulator by accident.
|
|
61
|
+
|
|
62
|
+
Keep one authoritative writer at each stage. A passing schema, parser,
|
|
63
|
+
repository or provider probe is a completed foundation, not runtime activation.
|
|
64
|
+
Enable a feature only after its identity, permission, transport, persistence, UI
|
|
65
|
+
and recovery boundaries work together. Do not postpone integration tests that
|
|
66
|
+
could disprove the architecture until every foundation is finished.
|
|
67
|
+
|
|
68
|
+
## Review and leave usable checkpoints
|
|
69
|
+
|
|
70
|
+
Before a meaningful commit, use `loom-torvalds-review` with the relevant app or
|
|
71
|
+
shared-package profile. Challenge account switching, stale callbacks, retries,
|
|
72
|
+
concurrent changes, bypass paths, partial failure, existing clients and
|
|
73
|
+
recovery. Use an independent reviewer when delegation is authorized and
|
|
74
|
+
valuable; otherwise make the adversarial pass explicit. Tie findings to
|
|
75
|
+
reachable behavior and add meaningful regression checks. Review the final
|
|
76
|
+
integrated diff, not only a staged subagent patch, and rerun checks affected by
|
|
77
|
+
review fixes.
|
|
78
|
+
|
|
79
|
+
Respect the operator's model and usage budget. When delegated implementation is
|
|
80
|
+
authorized, give workers bounded tasks and only the context they need; retain
|
|
81
|
+
the requested orchestration and review ownership. Reuse established baseline and
|
|
82
|
+
identical-artifact evidence instead of repeating unchanged checks. Repeat checks
|
|
83
|
+
when edits, failures or unresolved concerns justify them.
|
|
84
|
+
|
|
85
|
+
When commits are authorized, commit each passing compatibility unit with a
|
|
86
|
+
consistent manifest/lockfile and the repository's attribution rules. Keep shared
|
|
87
|
+
configuration and integration under one owner when work runs in parallel. Record
|
|
88
|
+
what changed, exact verification scope, limitations, activation state and next
|
|
89
|
+
gate. Continue authorized work without routine confirmation; publishing,
|
|
90
|
+
provider changes and cutover remain bounded by the user's actual authorization.
|