@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
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sansavision/aurora",
|
|
3
|
+
"version": "0.1.0-alpha.20260212.4",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"aurora": "./src/bin/aurora.ts"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "bun test",
|
|
11
|
+
"typecheck": "bunx --bun tsc --noEmit",
|
|
12
|
+
"aurora": "bun run ./src/bin/aurora.ts"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "restricted"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export type AiDiagnosticSeverity = "error" | "warning" | "info";
|
|
2
|
+
|
|
3
|
+
export interface AiDiagnosticLocation {
|
|
4
|
+
file?: string;
|
|
5
|
+
line?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AiDiagnosticInput {
|
|
9
|
+
code: string;
|
|
10
|
+
severity: "error" | "warn" | "warning" | "info";
|
|
11
|
+
message: string;
|
|
12
|
+
remediation?: string;
|
|
13
|
+
category?: string;
|
|
14
|
+
file?: string;
|
|
15
|
+
line?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AiReadableDiagnostic {
|
|
19
|
+
code: string;
|
|
20
|
+
severity: AiDiagnosticSeverity;
|
|
21
|
+
whatWentWrong: string;
|
|
22
|
+
why: string;
|
|
23
|
+
howToFix: string;
|
|
24
|
+
docs: string;
|
|
25
|
+
category?: string;
|
|
26
|
+
location?: AiDiagnosticLocation;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface DiagnosticTemplate {
|
|
30
|
+
why: string;
|
|
31
|
+
docs: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DIAGNOSTIC_TEMPLATES: Record<string, DiagnosticTemplate> = {
|
|
35
|
+
BOUNDARY_CLIENT_IMPORTS_SERVER: {
|
|
36
|
+
why:
|
|
37
|
+
"Client bundles cannot safely execute server-only modules and may leak secrets or break hydration semantics.",
|
|
38
|
+
docs: "https://aurora.dev/docs/concepts/module-boundaries",
|
|
39
|
+
},
|
|
40
|
+
DEPRECATED_ROUTE_API: {
|
|
41
|
+
why:
|
|
42
|
+
"Manual route registration bypasses Aurora's file-convention inference and future metadata/type guarantees.",
|
|
43
|
+
docs: "https://aurora.dev/docs/routing/file-conventions",
|
|
44
|
+
},
|
|
45
|
+
MIGRATION_MANUAL_ROUTES_ARRAY: {
|
|
46
|
+
why:
|
|
47
|
+
"Manual route arrays are a migration risk and can drift from inferred runtime behavior.",
|
|
48
|
+
docs: "https://aurora.dev/docs/migrations/manual-routes",
|
|
49
|
+
},
|
|
50
|
+
SECURITY_DYNAMIC_CODE_EXECUTION: {
|
|
51
|
+
why:
|
|
52
|
+
"Dynamic code execution prevents static verification and can enable injection vulnerabilities.",
|
|
53
|
+
docs: "https://aurora.dev/docs/security/dynamic-code",
|
|
54
|
+
},
|
|
55
|
+
SECURITY_RAW_SQL_STRING: {
|
|
56
|
+
why:
|
|
57
|
+
"Raw SQL strings are difficult to audit and increase SQL injection risk when interpolation slips in.",
|
|
58
|
+
docs: "https://aurora.dev/docs/security/raw-sql",
|
|
59
|
+
},
|
|
60
|
+
PERF_UNBOUNDED_QUERY: {
|
|
61
|
+
why:
|
|
62
|
+
"Unbounded queries can cause high memory/latency spikes and unstable response times under growth.",
|
|
63
|
+
docs: "https://aurora.dev/docs/performance/query-bounds",
|
|
64
|
+
},
|
|
65
|
+
PERF_N_PLUS_ONE_LOOP_AWAIT: {
|
|
66
|
+
why:
|
|
67
|
+
"Serial awaits in loops create avoidable N+1 latency and lower throughput.",
|
|
68
|
+
docs: "https://aurora.dev/docs/performance/n-plus-one",
|
|
69
|
+
},
|
|
70
|
+
A11Y_IMAGE_MISSING_ALT: {
|
|
71
|
+
why:
|
|
72
|
+
"Images without alt text are not announced correctly by assistive technology.",
|
|
73
|
+
docs: "https://aurora.dev/docs/accessibility/images",
|
|
74
|
+
},
|
|
75
|
+
A11Y_CLICKABLE_NON_INTERACTIVE: {
|
|
76
|
+
why:
|
|
77
|
+
"Non-semantic clickable elements often miss keyboard and screen-reader affordances.",
|
|
78
|
+
docs: "https://aurora.dev/docs/accessibility/interactive-elements",
|
|
79
|
+
},
|
|
80
|
+
GOVERNANCE_MISSING_MODULE_OWNER: {
|
|
81
|
+
why:
|
|
82
|
+
"Without declared ownership, review routing and escalation paths become ambiguous in team-scale delivery.",
|
|
83
|
+
docs: "https://aurora.dev/docs/governance/module-ownership",
|
|
84
|
+
},
|
|
85
|
+
GOVERNANCE_INVALID_OWNERS_EXPORT: {
|
|
86
|
+
why:
|
|
87
|
+
"Invalid ownership metadata breaks automation and review policy enforcement.",
|
|
88
|
+
docs: "https://aurora.dev/docs/governance/module-ownership",
|
|
89
|
+
},
|
|
90
|
+
AI_PROMPT_UNDERSPECIFIED: {
|
|
91
|
+
why:
|
|
92
|
+
"The prompt omitted key product/domain details, reducing scaffold relevance and confidence.",
|
|
93
|
+
docs: "https://aurora.dev/docs/ai/prompting-guide",
|
|
94
|
+
},
|
|
95
|
+
AI_SCAFFOLD_FAILED: {
|
|
96
|
+
why:
|
|
97
|
+
"AI intent inference succeeded, but scaffold generation could not be applied safely in the current workspace.",
|
|
98
|
+
docs: "https://aurora.dev/docs/ai/troubleshooting",
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export function toAiReadableDiagnostic(
|
|
103
|
+
input: AiDiagnosticInput,
|
|
104
|
+
): AiReadableDiagnostic {
|
|
105
|
+
const template = DIAGNOSTIC_TEMPLATES[input.code];
|
|
106
|
+
|
|
107
|
+
return {
|
|
108
|
+
code: input.code,
|
|
109
|
+
severity: normalizeSeverity(input.severity),
|
|
110
|
+
whatWentWrong:
|
|
111
|
+
normalizeMessage(input.message) ?? "Aurora reported a diagnostic event.",
|
|
112
|
+
why:
|
|
113
|
+
template?.why ??
|
|
114
|
+
"Aurora detected behavior that may violate framework safety, correctness, or maintainability rules.",
|
|
115
|
+
howToFix:
|
|
116
|
+
normalizeMessage(input.remediation) ??
|
|
117
|
+
"Apply the remediation hint and rerun the command to confirm the issue is resolved.",
|
|
118
|
+
docs:
|
|
119
|
+
template?.docs ??
|
|
120
|
+
`https://aurora.dev/docs/diagnostics#${input.code.toLowerCase()}`,
|
|
121
|
+
category: normalizeMessage(input.category),
|
|
122
|
+
location:
|
|
123
|
+
input.file || typeof input.line === "number"
|
|
124
|
+
? {
|
|
125
|
+
file: normalizeMessage(input.file),
|
|
126
|
+
line:
|
|
127
|
+
typeof input.line === "number" && Number.isFinite(input.line)
|
|
128
|
+
? Math.max(1, Math.trunc(input.line))
|
|
129
|
+
: undefined,
|
|
130
|
+
}
|
|
131
|
+
: undefined,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function normalizeSeverity(
|
|
136
|
+
value: AiDiagnosticInput["severity"],
|
|
137
|
+
): AiDiagnosticSeverity {
|
|
138
|
+
if (value === "error") {
|
|
139
|
+
return "error";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (value === "warn" || value === "warning") {
|
|
143
|
+
return "warning";
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return "info";
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function normalizeMessage(value: string | undefined): string | undefined {
|
|
150
|
+
if (typeof value !== "string") {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const normalized = value.trim().replace(/\s+/g, " ");
|
|
155
|
+
return normalized.length > 0 ? normalized : undefined;
|
|
156
|
+
}
|