@sansavision/aurora 0.1.0-alpha.20260212.4
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 +4 -0
- package/package.json +17 -0
- package/src/ai-diagnostics.ts +156 -0
- package/src/ai.ts +574 -0
- package/src/analyze.ts +669 -0
- package/src/bin/aurora.ts +15 -0
- package/src/build.ts +431 -0
- package/src/bun-test-shims.d.ts +17 -0
- package/src/create-feature.ts +419 -0
- package/src/create-route.ts +581 -0
- package/src/create.ts +425 -0
- package/src/dev.ts +126 -0
- package/src/devtools.ts +1143 -0
- package/src/doctor.ts +611 -0
- package/src/explain.ts +855 -0
- package/src/help.ts +39 -0
- package/src/index.ts +34 -0
- package/src/init.ts +1011 -0
- package/src/inspect-cache.ts +464 -0
- package/src/lsp-inline-hints.ts +254 -0
- package/src/node-shims.d.ts +26 -0
- package/src/process.d.ts +11 -0
- package/src/query-profiler.ts +520 -0
- package/src/realtime-monitor.ts +389 -0
- package/src/registry.ts +303 -0
- package/src/run.ts +37 -0
- package/src/start.ts +56 -0
- package/src/test.ts +289 -0
- package/templates/basic/README.md +16 -0
- package/templates/basic/package.json +10 -0
- package/templates/basic/src/actions/createMessage.action.server.ts +22 -0
- package/templates/basic/src/lib/auth.server.ts +11 -0
- package/templates/basic/src/queries/listMessages.server.ts +17 -0
- package/templates/basic/src/routes/index.tsx +12 -0
- package/templates/blog/README.md +17 -0
- package/templates/blog/package.json +12 -0
- package/templates/blog/public/assets/og-default.svg +17 -0
- package/templates/blog/src/content/loadPosts.server.ts +22 -0
- package/templates/blog/src/content/posts/hello-world.md +11 -0
- package/templates/blog/src/content/posts/release-notes.md +9 -0
- package/templates/blog/src/routes/index.tsx +22 -0
- package/templates/blog/src/routes/posts/[slug].tsx +19 -0
- package/templates/blog/src/seo/meta.ts +19 -0
- package/templates/dashboard/README.md +18 -0
- package/templates/dashboard/package.json +10 -0
- package/templates/dashboard/src/actions/acknowledgeAlert.action.server.ts +6 -0
- package/templates/dashboard/src/queries/getDashboardMetrics.server.ts +30 -0
- package/templates/dashboard/src/realtime/useDashboardRealtime.client.ts +13 -0
- package/templates/dashboard/src/routes/index.tsx +19 -0
- package/templates/dashboard/src/widgets/DataGrid.client.ts +8 -0
- package/templates/dashboard/src/widgets/MetricChart.client.ts +8 -0
- package/templates/desktop/README.md +18 -0
- package/templates/desktop/package.json +11 -0
- package/templates/desktop/src/actions/saveDesktopPreference.action.server.ts +28 -0
- package/templates/desktop/src/desktop/secureStorage.client.ts +20 -0
- package/templates/desktop/src/desktop/tauriBridge.client.ts +14 -0
- package/templates/desktop/src/queries/getDesktopSyncStatus.server.ts +9 -0
- package/templates/desktop/src/routes/index.tsx +27 -0
- package/templates/desktop/src/sync/offlineSyncBoundary.server.ts +27 -0
- package/templates/feature-skeleton/README.md +13 -0
- package/templates/feature-skeleton/actions/createFeature.action.server.ts +19 -0
- package/templates/feature-skeleton/index.ts +8 -0
- package/templates/feature-skeleton/queries/listFeature.server.ts +15 -0
- package/templates/feature-skeleton/realtime/useFeatureRealtime.client.ts +16 -0
- package/templates/feature-skeleton/template.manifest.json +15 -0
- package/templates/feature-skeleton/ui/FeatureView.client.tsx +14 -0
- package/templates/mobile/README.md +17 -0
- package/templates/mobile/package.json +11 -0
- package/templates/mobile/src/mobile/auth/session-handoff.client.ts +69 -0
- package/templates/mobile/src/mobile/generated/mobile-api-sdk.ts +62 -0
- package/templates/mobile/src/mobile/transport/mobile-api-transport.client.ts +122 -0
- package/templates/mobile/src/routes/index.tsx +134 -0
- package/templates/monorepo/README.md +18 -0
- package/templates/monorepo/apps/web/package.json +9 -0
- package/templates/monorepo/apps/web/src/routes/index.tsx +1 -0
- package/templates/monorepo/package.json +13 -0
- package/templates/monorepo/packages/shared/README.md +3 -0
- package/templates/monorepo/packages/ui/README.md +3 -0
- package/templates/saas/README.md +17 -0
- package/templates/saas/package.json +10 -0
- package/templates/saas/src/admin/getDashboard.server.ts +18 -0
- package/templates/saas/src/auth/session.server.ts +13 -0
- package/templates/saas/src/billing/checkout.server.ts +11 -0
- package/templates/saas/src/email/sendWelcome.server.ts +8 -0
- package/templates/saas/src/realtime/notifications.server.ts +8 -0
- package/templates/saas/src/routes/index.tsx +20 -0
- package/test/ai.test.ts +94 -0
- package/test/analyze.test.ts +301 -0
- package/test/build.test.ts +135 -0
- package/test/create-feature.test.ts +145 -0
- package/test/create-route.test.ts +117 -0
- package/test/create.test.ts +222 -0
- package/test/dev.test.ts +52 -0
- package/test/devtools.test.ts +130 -0
- package/test/doctor.test.ts +129 -0
- package/test/explain.test.ts +232 -0
- package/test/feature-skeleton.test.ts +53 -0
- package/test/fixtures/analyze/cache-input.invalid.json +1 -0
- package/test/fixtures/analyze/cache-input.missing-keyhash.v1.json +10 -0
- package/test/fixtures/analyze/cache-input.unsupported-version.v2.json +10 -0
- package/test/fixtures/analyze/cache-input.v1.json +12 -0
- package/test/fixtures/analyze/compiler-manifest/manifest.json +11 -0
- package/test/fixtures/analyze/guardrails-input.unsupported-version.v2.json +4 -0
- package/test/fixtures/analyze/guardrails-input.v1.json +49 -0
- package/test/fixtures/analyze/query-input.invalid-cache-status.v1.json +11 -0
- package/test/fixtures/analyze/query-input.unsupported-version.v2.json +11 -0
- package/test/fixtures/analyze/query-input.v1.json +18 -0
- package/test/fixtures/analyze/realtime-input.missing-lag-p95.v1.json +10 -0
- package/test/fixtures/analyze/realtime-input.unsupported-version.v2.json +8 -0
- package/test/fixtures/analyze/realtime-input.v1.json +12 -0
- package/test/fixtures/cache-inspector/cache-input.v1.json +23 -0
- package/test/fixtures/cache-inspector/invalid.json +1 -0
- package/test/fixtures/cache-inspector/snapshot.v1.json +34 -0
- package/test/fixtures/cache-inspector/unsupported-version.v2.json +13 -0
- package/test/fixtures/devtools/healthy.v1.json +130 -0
- package/test/fixtures/devtools/invalid.json +1 -0
- package/test/fixtures/devtools/unsupported-version.v2.json +8 -0
- package/test/fixtures/devtools/warn.v1.json +114 -0
- package/test/fixtures/doctor/clean/src/page.tsx +3 -0
- package/test/fixtures/doctor/findings/src/accessibility.client.tsx +7 -0
- package/test/fixtures/doctor/findings/src/migration.config.ts +3 -0
- package/test/fixtures/doctor/findings/src/page.client.tsx +5 -0
- package/test/fixtures/doctor/findings/src/perf.server.ts +15 -0
- package/test/fixtures/doctor/findings/src/routes.js +3 -0
- package/test/fixtures/doctor/findings/src/security.server.ts +7 -0
- package/test/fixtures/doctor/findings/src/users.server.ts +3 -0
- package/test/fixtures/doctor/governance/src/features/analytics/OWNERS.ts +2 -0
- package/test/fixtures/doctor/governance/src/features/analytics/page.tsx +3 -0
- package/test/fixtures/doctor/governance/src/features/billing/page.tsx +3 -0
- package/test/fixtures/explain/invalid.json +1 -0
- package/test/fixtures/explain/module-report.unsupported-version.v2.json +6 -0
- package/test/fixtures/explain/module-report.v1.json +72 -0
- package/test/fixtures/query-profiler/healthy.v1.json +11 -0
- package/test/fixtures/query-profiler/invalid.json +1 -0
- package/test/fixtures/query-profiler/unsupported-version.v2.json +6 -0
- package/test/fixtures/query-profiler/warning.v1.json +10 -0
- package/test/fixtures/realtime-monitor/healthy.v1.json +8 -0
- package/test/fixtures/realtime-monitor/invalid.json +1 -0
- package/test/fixtures/realtime-monitor/unsupported-version.v2.json +8 -0
- package/test/fixtures/realtime-monitor/warning.v1.json +8 -0
- package/test/help-parity.test.ts +104 -0
- package/test/init.test.ts +164 -0
- package/test/inspect-cache.test.ts +112 -0
- package/test/lsp-inline-hints.test.ts +65 -0
- package/test/query-profiler.test.ts +123 -0
- package/test/realtime-monitor.test.ts +115 -0
- package/test/registry.test.ts +41 -0
- package/test/start.test.ts +23 -0
- package/test/test-command.test.ts +65 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from "bun:test";
|
|
5
|
+
|
|
6
|
+
import { runAuroraCli } from "../src";
|
|
7
|
+
|
|
8
|
+
const projectRoot = join(import.meta.dir, "..");
|
|
9
|
+
|
|
10
|
+
function fixturePath(name: string): string {
|
|
11
|
+
return join("test/fixtures/explain", name);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function readFixture(name: string): string {
|
|
15
|
+
return readFileSync(join(import.meta.dir, "fixtures/explain", name), "utf8");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe("aurora explain", () => {
|
|
19
|
+
it("renders inferred behavior from a schemaVersion 1 explain report", () => {
|
|
20
|
+
const result = runAuroraCli(
|
|
21
|
+
[
|
|
22
|
+
"explain",
|
|
23
|
+
"routes/guestbook/guestbook.server.ts",
|
|
24
|
+
"--input",
|
|
25
|
+
fixturePath("module-report.v1.json"),
|
|
26
|
+
],
|
|
27
|
+
{ cwd: projectRoot },
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
expect(result.exitCode).toBe(0);
|
|
31
|
+
expect(result.stdout).toContain("aurora explain report");
|
|
32
|
+
expect(result.stdout).toContain("module: routes/guestbook/guestbook.server.ts");
|
|
33
|
+
expect(result.stdout).toContain("query: listMessages");
|
|
34
|
+
expect(result.stdout).toContain("key: [\"routes/guestbook/guestbook.server\",\"listMessages\",\"hash(args)\"] (inferred)");
|
|
35
|
+
expect(result.stdout).toContain("action: addMessage");
|
|
36
|
+
expect(result.stdout).toContain("invalidates: [guestbook:messages] (explicit)");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("supports json output", () => {
|
|
40
|
+
const result = runAuroraCli(
|
|
41
|
+
[
|
|
42
|
+
"explain",
|
|
43
|
+
"routes/guestbook/guestbook.server.ts",
|
|
44
|
+
"--input",
|
|
45
|
+
fixturePath("module-report.v1.json"),
|
|
46
|
+
"--format",
|
|
47
|
+
"json",
|
|
48
|
+
],
|
|
49
|
+
{ cwd: projectRoot },
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
expect(result.exitCode).toBe(0);
|
|
53
|
+
|
|
54
|
+
const parsed = JSON.parse(result.stdout ?? "{}") as {
|
|
55
|
+
mode?: string;
|
|
56
|
+
schemaVersion?: number;
|
|
57
|
+
module?: string;
|
|
58
|
+
queries?: Array<{ name?: string }>;
|
|
59
|
+
actions?: Array<{ name?: string }>;
|
|
60
|
+
warnings?: string[];
|
|
61
|
+
inlineHints?: Array<{ kind?: string; symbol?: string; label?: string }>;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
expect(parsed.mode).toBe("explain");
|
|
65
|
+
expect(parsed.schemaVersion).toBe(1);
|
|
66
|
+
expect(parsed.module).toBe("routes/guestbook/guestbook.server.ts");
|
|
67
|
+
expect(parsed.queries?.[0]?.name).toBe("listMessages");
|
|
68
|
+
expect(parsed.actions?.[0]?.name).toBe("addMessage");
|
|
69
|
+
expect(parsed.warnings).toEqual([]);
|
|
70
|
+
expect(parsed.inlineHints).toEqual([]);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("includes inline hints when module source is available", () => {
|
|
74
|
+
const cwd = createTempWorkspace("aurora-explain-inline-hints");
|
|
75
|
+
const modulePath = join(cwd, "routes", "guestbook", "guestbook.server.ts");
|
|
76
|
+
mkdirSync(join(cwd, "routes", "guestbook"), { recursive: true });
|
|
77
|
+
writeFileSync(
|
|
78
|
+
modulePath,
|
|
79
|
+
[
|
|
80
|
+
'export const runtime = "edge";',
|
|
81
|
+
'export const auth = "user";',
|
|
82
|
+
"",
|
|
83
|
+
"export const listMessages = defineQuery({});",
|
|
84
|
+
"export const addMessage = defineAction({});",
|
|
85
|
+
].join("\n"),
|
|
86
|
+
"utf8",
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
writeFileSync(
|
|
90
|
+
join(cwd, "module-report.v1.json"),
|
|
91
|
+
readFixture("module-report.v1.json"),
|
|
92
|
+
"utf8",
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const result = runAuroraCli(
|
|
96
|
+
[
|
|
97
|
+
"explain",
|
|
98
|
+
"routes/guestbook/guestbook.server.ts",
|
|
99
|
+
"--input",
|
|
100
|
+
"module-report.v1.json",
|
|
101
|
+
"--format",
|
|
102
|
+
"json",
|
|
103
|
+
],
|
|
104
|
+
{ cwd },
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
expect(result.exitCode).toBe(0);
|
|
108
|
+
|
|
109
|
+
const parsed = JSON.parse(result.stdout ?? "{}") as {
|
|
110
|
+
inlineHints?: Array<{ kind?: string; label?: string; symbol?: string }>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
expect((parsed.inlineHints ?? []).length >= 7).toBe(true);
|
|
114
|
+
expect(parsed.inlineHints?.some((hint) => hint.kind === "runtime" && hint.label === "runtime: edge")).toBe(true);
|
|
115
|
+
expect(parsed.inlineHints?.some((hint) => hint.kind === "key" && hint.symbol === "listMessages")).toBe(true);
|
|
116
|
+
expect(parsed.inlineHints?.some((hint) => hint.kind === "invalidation" && hint.symbol === "addMessage")).toBe(true);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("reports module mismatch warning when requested module differs from snapshot module", () => {
|
|
120
|
+
const result = runAuroraCli(
|
|
121
|
+
[
|
|
122
|
+
"explain",
|
|
123
|
+
"routes/chat/chat.server.ts",
|
|
124
|
+
"--input",
|
|
125
|
+
fixturePath("module-report.v1.json"),
|
|
126
|
+
"--format",
|
|
127
|
+
"json",
|
|
128
|
+
],
|
|
129
|
+
{ cwd: projectRoot },
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
expect(result.exitCode).toBe(0);
|
|
133
|
+
|
|
134
|
+
const parsed = JSON.parse(result.stdout ?? "{}") as {
|
|
135
|
+
warnings?: string[];
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
expect(parsed.warnings?.[0]).toContain("snapshot module");
|
|
139
|
+
expect(parsed.warnings?.[0]).toContain("requested module");
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("requires a module path", () => {
|
|
143
|
+
const result = runAuroraCli(["explain"], { cwd: projectRoot });
|
|
144
|
+
|
|
145
|
+
expect(result.exitCode).toBe(2);
|
|
146
|
+
expect(result.stderr).toContain("module path is required");
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("rejects unknown explain options", () => {
|
|
150
|
+
const result = runAuroraCli(
|
|
151
|
+
[
|
|
152
|
+
"explain",
|
|
153
|
+
"routes/guestbook/guestbook.server.ts",
|
|
154
|
+
"--unknown",
|
|
155
|
+
],
|
|
156
|
+
{ cwd: projectRoot },
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
expect(result.exitCode).toBe(2);
|
|
160
|
+
expect(result.stderr).toContain("unknown option '--unknown'");
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it("returns readable errors for invalid json", () => {
|
|
164
|
+
const inputPath = fixturePath("invalid.json");
|
|
165
|
+
const result = runAuroraCli(
|
|
166
|
+
[
|
|
167
|
+
"explain",
|
|
168
|
+
"routes/guestbook/guestbook.server.ts",
|
|
169
|
+
"--input",
|
|
170
|
+
inputPath,
|
|
171
|
+
],
|
|
172
|
+
{ cwd: projectRoot },
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
expect(result.exitCode).toBe(1);
|
|
176
|
+
expect(result.stderr).toContain(`aurora explain: invalid json input at ${inputPath}`);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it("fails explain report parsing for unsupported schema versions", () => {
|
|
180
|
+
const result = runAuroraCli(
|
|
181
|
+
[
|
|
182
|
+
"explain",
|
|
183
|
+
"routes/guestbook/guestbook.server.ts",
|
|
184
|
+
"--input",
|
|
185
|
+
fixturePath("module-report.unsupported-version.v2.json"),
|
|
186
|
+
],
|
|
187
|
+
{ cwd: projectRoot },
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
expect(result.exitCode).toBe(1);
|
|
191
|
+
expect(result.stderr).toContain("unsupported schemaVersion 2; expected 1");
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it("uses the default explain snapshot path when --input is omitted", () => {
|
|
195
|
+
const cwd = createTempWorkspace("aurora-explain-default-input");
|
|
196
|
+
mkdirSync(join(cwd, ".aurora", "explain"), { recursive: true });
|
|
197
|
+
writeFileSync(
|
|
198
|
+
join(cwd, ".aurora", "explain", "routes__guestbook__guestbook.server.ts.explain.v1.json"),
|
|
199
|
+
readFixture("module-report.v1.json"),
|
|
200
|
+
"utf8",
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
const result = runAuroraCli(["explain", "routes/guestbook/guestbook.server.ts"], {
|
|
204
|
+
cwd,
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
expect(result.exitCode).toBe(0);
|
|
208
|
+
expect(result.stdout).toContain(
|
|
209
|
+
"input: .aurora/explain/routes__guestbook__guestbook.server.ts.explain.v1.json",
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("returns a clear error when the explain snapshot file does not exist", () => {
|
|
214
|
+
const cwd = createTempWorkspace("aurora-explain-missing-snapshot");
|
|
215
|
+
|
|
216
|
+
const result = runAuroraCli(["explain", "routes/guestbook/guestbook.server.ts"], {
|
|
217
|
+
cwd,
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
expect(result.exitCode).toBe(1);
|
|
221
|
+
expect(result.stderr).toContain(
|
|
222
|
+
"aurora explain: unable to read input at .aurora/explain/routes__guestbook__guestbook.server.ts.explain.v1.json",
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
function createTempWorkspace(prefix: string): string {
|
|
228
|
+
const unique = `${prefix}-${Date.now()}-${Math.floor(Math.random() * 1_000_000)}`;
|
|
229
|
+
const cwd = join("/tmp", unique);
|
|
230
|
+
mkdirSync(cwd, { recursive: true });
|
|
231
|
+
return cwd;
|
|
232
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from "bun:test";
|
|
5
|
+
|
|
6
|
+
const templateRoot = join(import.meta.dir, "../templates/feature-skeleton");
|
|
7
|
+
|
|
8
|
+
describe("feature skeleton template assets", () => {
|
|
9
|
+
it("includes required ui/query/action/realtime scaffold files", () => {
|
|
10
|
+
const required = [
|
|
11
|
+
"README.md",
|
|
12
|
+
"template.manifest.json",
|
|
13
|
+
"index.ts",
|
|
14
|
+
"ui/FeatureView.client.tsx",
|
|
15
|
+
"queries/listFeature.server.ts",
|
|
16
|
+
"actions/createFeature.action.server.ts",
|
|
17
|
+
"realtime/useFeatureRealtime.client.ts",
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
for (const relativePath of required) {
|
|
21
|
+
expect(existsSync(join(templateRoot, relativePath))).toBe(true);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("keeps placeholder contract tokens for future generator wiring", () => {
|
|
26
|
+
const placeholderFiles = [
|
|
27
|
+
"ui/FeatureView.client.tsx",
|
|
28
|
+
"queries/listFeature.server.ts",
|
|
29
|
+
"actions/createFeature.action.server.ts",
|
|
30
|
+
"realtime/useFeatureRealtime.client.ts",
|
|
31
|
+
"index.ts",
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
for (const relativePath of placeholderFiles) {
|
|
35
|
+
const source = readFileSync(join(templateRoot, relativePath), "utf8");
|
|
36
|
+
expect(source).toContain("__AURORA_FEATURE_NAME__");
|
|
37
|
+
expect(source).toContain("__AURORA_FEATURE_SLUG__");
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("keeps manifest module list aligned with scaffold files", () => {
|
|
42
|
+
const manifestRaw = readFileSync(join(templateRoot, "template.manifest.json"), "utf8");
|
|
43
|
+
const manifest = JSON.parse(manifestRaw) as { modules?: string[] };
|
|
44
|
+
|
|
45
|
+
expect(Array.isArray(manifest.modules)).toBe(true);
|
|
46
|
+
const modules = manifest.modules ?? [];
|
|
47
|
+
expect(modules.length > 0).toBe(true);
|
|
48
|
+
|
|
49
|
+
for (const modulePath of modules) {
|
|
50
|
+
expect(existsSync(join(templateRoot, modulePath))).toBe(true);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "schemaVersion": 1, "entries": [ { "hash": "users:u1" }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"queries": [
|
|
4
|
+
{
|
|
5
|
+
"name": "users.list",
|
|
6
|
+
"returnsArray": true,
|
|
7
|
+
"hasLimit": false,
|
|
8
|
+
"file": "routes/users/page.tsx",
|
|
9
|
+
"line": 12
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"payloads": [
|
|
13
|
+
{
|
|
14
|
+
"name": "users.export",
|
|
15
|
+
"bytes": 6200000,
|
|
16
|
+
"warnBytes": 1000000,
|
|
17
|
+
"errorBytes": 5000000,
|
|
18
|
+
"surface": "loader",
|
|
19
|
+
"file": "routes/users/export.server.ts",
|
|
20
|
+
"line": 24
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"nPlusOne": [
|
|
24
|
+
{
|
|
25
|
+
"file": "routes/users/page.tsx",
|
|
26
|
+
"line": 33,
|
|
27
|
+
"parentQuery": "users.list",
|
|
28
|
+
"childQuery": "teams.byUser",
|
|
29
|
+
"parentRows": 20,
|
|
30
|
+
"childCalls": 44
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"staleClosures": [
|
|
34
|
+
{
|
|
35
|
+
"file": "routes/users/page.tsx",
|
|
36
|
+
"line": 49,
|
|
37
|
+
"signal": "filters",
|
|
38
|
+
"context": "setInterval",
|
|
39
|
+
"stale": true
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"bundles": [
|
|
43
|
+
{
|
|
44
|
+
"route": "/users",
|
|
45
|
+
"bytes": 260000,
|
|
46
|
+
"budgetBytes": 180000
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"hash": "users:u1",
|
|
6
|
+
"labels": ["users", "user:u1"],
|
|
7
|
+
"sizeBytes": 128,
|
|
8
|
+
"stale": false
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"hash": "users:u2",
|
|
12
|
+
"labels": ["users", "user:u2"],
|
|
13
|
+
"sizeBytes": 256,
|
|
14
|
+
"stale": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"hash": "teams:list",
|
|
18
|
+
"labels": ["teams"],
|
|
19
|
+
"sizeBytes": 64,
|
|
20
|
+
"stale": false
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "version": 1, "entries": [ { "key": "users:u1" }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"generatedAt": "2026-02-10T00:00:00.000Z",
|
|
4
|
+
"entries": [
|
|
5
|
+
{
|
|
6
|
+
"key": "users:u1",
|
|
7
|
+
"value": {
|
|
8
|
+
"id": "u1",
|
|
9
|
+
"name": "Ada"
|
|
10
|
+
},
|
|
11
|
+
"tags": ["users", "user:u1"],
|
|
12
|
+
"createdAt": 1707523200000
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"key": "teams:list",
|
|
16
|
+
"value": [
|
|
17
|
+
{ "id": "t1" },
|
|
18
|
+
{ "id": "t2" }
|
|
19
|
+
],
|
|
20
|
+
"tags": ["teams", "dashboard"],
|
|
21
|
+
"createdAt": 1707523201000,
|
|
22
|
+
"expiresAt": 1
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "metrics:dashboard",
|
|
26
|
+
"value": {
|
|
27
|
+
"panels": 12,
|
|
28
|
+
"updatedAt": "2026-02-10T00:00:00.000Z"
|
|
29
|
+
},
|
|
30
|
+
"tags": ["metrics", "dashboard"],
|
|
31
|
+
"createdAt": 1707523202000
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"explain": {
|
|
4
|
+
"module": "routes/guestbook/guestbook.server.ts",
|
|
5
|
+
"queries": [
|
|
6
|
+
{
|
|
7
|
+
"name": "listMessages",
|
|
8
|
+
"auth": { "value": "user" },
|
|
9
|
+
"realtime": { "value": "subscribed via tags" }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "listMembers",
|
|
13
|
+
"auth": "admin",
|
|
14
|
+
"realtime": "none"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"actions": [
|
|
18
|
+
{
|
|
19
|
+
"name": "addMessage",
|
|
20
|
+
"auth": { "value": "user" }
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "archiveMessage",
|
|
24
|
+
"auth": "admin"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"warnings": []
|
|
28
|
+
},
|
|
29
|
+
"waterfall": {
|
|
30
|
+
"requestId": "req-healthy",
|
|
31
|
+
"operations": [
|
|
32
|
+
{
|
|
33
|
+
"name": "middleware.auth",
|
|
34
|
+
"kind": "middleware",
|
|
35
|
+
"startMs": 0,
|
|
36
|
+
"durationMs": 2,
|
|
37
|
+
"blocking": false
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "route.match",
|
|
41
|
+
"kind": "routing",
|
|
42
|
+
"startMs": 0,
|
|
43
|
+
"durationMs": 3,
|
|
44
|
+
"blocking": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "listMessages",
|
|
48
|
+
"kind": "query",
|
|
49
|
+
"startMs": 3,
|
|
50
|
+
"durationMs": 25,
|
|
51
|
+
"blocking": true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "listMembers",
|
|
55
|
+
"kind": "query",
|
|
56
|
+
"startMs": 4,
|
|
57
|
+
"durationMs": 20,
|
|
58
|
+
"blocking": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "render",
|
|
62
|
+
"kind": "render",
|
|
63
|
+
"startMs": 29,
|
|
64
|
+
"durationMs": 8,
|
|
65
|
+
"blocking": true
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"phases": [
|
|
69
|
+
{
|
|
70
|
+
"name": "routing",
|
|
71
|
+
"durationMs": 3
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "data",
|
|
75
|
+
"durationMs": 25
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "render",
|
|
79
|
+
"durationMs": 8
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"performance": {
|
|
84
|
+
"routes": [
|
|
85
|
+
{
|
|
86
|
+
"route": "/",
|
|
87
|
+
"jsBytes": 42000,
|
|
88
|
+
"payloadBytes": 1200,
|
|
89
|
+
"lcpMs": 210
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"route": "/guestbook",
|
|
93
|
+
"jsBytes": 58000,
|
|
94
|
+
"payloadBytes": 3200,
|
|
95
|
+
"lcpMs": 310
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
"realtime": {
|
|
100
|
+
"connectionState": "connected",
|
|
101
|
+
"eventsPerSecond": 24.5,
|
|
102
|
+
"lagP95Ms": 140,
|
|
103
|
+
"droppedRatio": 0.012,
|
|
104
|
+
"subscriptions": [
|
|
105
|
+
{
|
|
106
|
+
"tag": "guestbook:messages",
|
|
107
|
+
"channel": "guestbook.ws",
|
|
108
|
+
"state": "active",
|
|
109
|
+
"authScope": "user"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"tag": "guestbook:admins",
|
|
113
|
+
"channel": "guestbook.ws",
|
|
114
|
+
"state": "active",
|
|
115
|
+
"authScope": "admin"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"auth": {
|
|
120
|
+
"sessionStatus": "active",
|
|
121
|
+
"routeAuth": "user",
|
|
122
|
+
"userId": "u_123",
|
|
123
|
+
"role": "user",
|
|
124
|
+
"permissions": [
|
|
125
|
+
"guestbook:read",
|
|
126
|
+
"guestbook:write"
|
|
127
|
+
],
|
|
128
|
+
"tokenExpiresInSec": 3600
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "schemaVersion": 1,
|