@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.
Files changed (150) hide show
  1. package/README.md +4 -0
  2. package/package.json +17 -0
  3. package/src/ai-diagnostics.ts +156 -0
  4. package/src/ai.ts +574 -0
  5. package/src/analyze.ts +669 -0
  6. package/src/bin/aurora.ts +15 -0
  7. package/src/build.ts +431 -0
  8. package/src/bun-test-shims.d.ts +17 -0
  9. package/src/create-feature.ts +419 -0
  10. package/src/create-route.ts +581 -0
  11. package/src/create.ts +425 -0
  12. package/src/dev.ts +126 -0
  13. package/src/devtools.ts +1143 -0
  14. package/src/doctor.ts +611 -0
  15. package/src/explain.ts +855 -0
  16. package/src/help.ts +39 -0
  17. package/src/index.ts +34 -0
  18. package/src/init.ts +1011 -0
  19. package/src/inspect-cache.ts +464 -0
  20. package/src/lsp-inline-hints.ts +254 -0
  21. package/src/node-shims.d.ts +26 -0
  22. package/src/process.d.ts +11 -0
  23. package/src/query-profiler.ts +520 -0
  24. package/src/realtime-monitor.ts +389 -0
  25. package/src/registry.ts +303 -0
  26. package/src/run.ts +37 -0
  27. package/src/start.ts +56 -0
  28. package/src/test.ts +289 -0
  29. package/templates/basic/README.md +16 -0
  30. package/templates/basic/package.json +10 -0
  31. package/templates/basic/src/actions/createMessage.action.server.ts +22 -0
  32. package/templates/basic/src/lib/auth.server.ts +11 -0
  33. package/templates/basic/src/queries/listMessages.server.ts +17 -0
  34. package/templates/basic/src/routes/index.tsx +12 -0
  35. package/templates/blog/README.md +17 -0
  36. package/templates/blog/package.json +12 -0
  37. package/templates/blog/public/assets/og-default.svg +17 -0
  38. package/templates/blog/src/content/loadPosts.server.ts +22 -0
  39. package/templates/blog/src/content/posts/hello-world.md +11 -0
  40. package/templates/blog/src/content/posts/release-notes.md +9 -0
  41. package/templates/blog/src/routes/index.tsx +22 -0
  42. package/templates/blog/src/routes/posts/[slug].tsx +19 -0
  43. package/templates/blog/src/seo/meta.ts +19 -0
  44. package/templates/dashboard/README.md +18 -0
  45. package/templates/dashboard/package.json +10 -0
  46. package/templates/dashboard/src/actions/acknowledgeAlert.action.server.ts +6 -0
  47. package/templates/dashboard/src/queries/getDashboardMetrics.server.ts +30 -0
  48. package/templates/dashboard/src/realtime/useDashboardRealtime.client.ts +13 -0
  49. package/templates/dashboard/src/routes/index.tsx +19 -0
  50. package/templates/dashboard/src/widgets/DataGrid.client.ts +8 -0
  51. package/templates/dashboard/src/widgets/MetricChart.client.ts +8 -0
  52. package/templates/desktop/README.md +18 -0
  53. package/templates/desktop/package.json +11 -0
  54. package/templates/desktop/src/actions/saveDesktopPreference.action.server.ts +28 -0
  55. package/templates/desktop/src/desktop/secureStorage.client.ts +20 -0
  56. package/templates/desktop/src/desktop/tauriBridge.client.ts +14 -0
  57. package/templates/desktop/src/queries/getDesktopSyncStatus.server.ts +9 -0
  58. package/templates/desktop/src/routes/index.tsx +27 -0
  59. package/templates/desktop/src/sync/offlineSyncBoundary.server.ts +27 -0
  60. package/templates/feature-skeleton/README.md +13 -0
  61. package/templates/feature-skeleton/actions/createFeature.action.server.ts +19 -0
  62. package/templates/feature-skeleton/index.ts +8 -0
  63. package/templates/feature-skeleton/queries/listFeature.server.ts +15 -0
  64. package/templates/feature-skeleton/realtime/useFeatureRealtime.client.ts +16 -0
  65. package/templates/feature-skeleton/template.manifest.json +15 -0
  66. package/templates/feature-skeleton/ui/FeatureView.client.tsx +14 -0
  67. package/templates/mobile/README.md +17 -0
  68. package/templates/mobile/package.json +11 -0
  69. package/templates/mobile/src/mobile/auth/session-handoff.client.ts +69 -0
  70. package/templates/mobile/src/mobile/generated/mobile-api-sdk.ts +62 -0
  71. package/templates/mobile/src/mobile/transport/mobile-api-transport.client.ts +122 -0
  72. package/templates/mobile/src/routes/index.tsx +134 -0
  73. package/templates/monorepo/README.md +18 -0
  74. package/templates/monorepo/apps/web/package.json +9 -0
  75. package/templates/monorepo/apps/web/src/routes/index.tsx +1 -0
  76. package/templates/monorepo/package.json +13 -0
  77. package/templates/monorepo/packages/shared/README.md +3 -0
  78. package/templates/monorepo/packages/ui/README.md +3 -0
  79. package/templates/saas/README.md +17 -0
  80. package/templates/saas/package.json +10 -0
  81. package/templates/saas/src/admin/getDashboard.server.ts +18 -0
  82. package/templates/saas/src/auth/session.server.ts +13 -0
  83. package/templates/saas/src/billing/checkout.server.ts +11 -0
  84. package/templates/saas/src/email/sendWelcome.server.ts +8 -0
  85. package/templates/saas/src/realtime/notifications.server.ts +8 -0
  86. package/templates/saas/src/routes/index.tsx +20 -0
  87. package/test/ai.test.ts +94 -0
  88. package/test/analyze.test.ts +301 -0
  89. package/test/build.test.ts +135 -0
  90. package/test/create-feature.test.ts +145 -0
  91. package/test/create-route.test.ts +117 -0
  92. package/test/create.test.ts +222 -0
  93. package/test/dev.test.ts +52 -0
  94. package/test/devtools.test.ts +130 -0
  95. package/test/doctor.test.ts +129 -0
  96. package/test/explain.test.ts +232 -0
  97. package/test/feature-skeleton.test.ts +53 -0
  98. package/test/fixtures/analyze/cache-input.invalid.json +1 -0
  99. package/test/fixtures/analyze/cache-input.missing-keyhash.v1.json +10 -0
  100. package/test/fixtures/analyze/cache-input.unsupported-version.v2.json +10 -0
  101. package/test/fixtures/analyze/cache-input.v1.json +12 -0
  102. package/test/fixtures/analyze/compiler-manifest/manifest.json +11 -0
  103. package/test/fixtures/analyze/guardrails-input.unsupported-version.v2.json +4 -0
  104. package/test/fixtures/analyze/guardrails-input.v1.json +49 -0
  105. package/test/fixtures/analyze/query-input.invalid-cache-status.v1.json +11 -0
  106. package/test/fixtures/analyze/query-input.unsupported-version.v2.json +11 -0
  107. package/test/fixtures/analyze/query-input.v1.json +18 -0
  108. package/test/fixtures/analyze/realtime-input.missing-lag-p95.v1.json +10 -0
  109. package/test/fixtures/analyze/realtime-input.unsupported-version.v2.json +8 -0
  110. package/test/fixtures/analyze/realtime-input.v1.json +12 -0
  111. package/test/fixtures/cache-inspector/cache-input.v1.json +23 -0
  112. package/test/fixtures/cache-inspector/invalid.json +1 -0
  113. package/test/fixtures/cache-inspector/snapshot.v1.json +34 -0
  114. package/test/fixtures/cache-inspector/unsupported-version.v2.json +13 -0
  115. package/test/fixtures/devtools/healthy.v1.json +130 -0
  116. package/test/fixtures/devtools/invalid.json +1 -0
  117. package/test/fixtures/devtools/unsupported-version.v2.json +8 -0
  118. package/test/fixtures/devtools/warn.v1.json +114 -0
  119. package/test/fixtures/doctor/clean/src/page.tsx +3 -0
  120. package/test/fixtures/doctor/findings/src/accessibility.client.tsx +7 -0
  121. package/test/fixtures/doctor/findings/src/migration.config.ts +3 -0
  122. package/test/fixtures/doctor/findings/src/page.client.tsx +5 -0
  123. package/test/fixtures/doctor/findings/src/perf.server.ts +15 -0
  124. package/test/fixtures/doctor/findings/src/routes.js +3 -0
  125. package/test/fixtures/doctor/findings/src/security.server.ts +7 -0
  126. package/test/fixtures/doctor/findings/src/users.server.ts +3 -0
  127. package/test/fixtures/doctor/governance/src/features/analytics/OWNERS.ts +2 -0
  128. package/test/fixtures/doctor/governance/src/features/analytics/page.tsx +3 -0
  129. package/test/fixtures/doctor/governance/src/features/billing/page.tsx +3 -0
  130. package/test/fixtures/explain/invalid.json +1 -0
  131. package/test/fixtures/explain/module-report.unsupported-version.v2.json +6 -0
  132. package/test/fixtures/explain/module-report.v1.json +72 -0
  133. package/test/fixtures/query-profiler/healthy.v1.json +11 -0
  134. package/test/fixtures/query-profiler/invalid.json +1 -0
  135. package/test/fixtures/query-profiler/unsupported-version.v2.json +6 -0
  136. package/test/fixtures/query-profiler/warning.v1.json +10 -0
  137. package/test/fixtures/realtime-monitor/healthy.v1.json +8 -0
  138. package/test/fixtures/realtime-monitor/invalid.json +1 -0
  139. package/test/fixtures/realtime-monitor/unsupported-version.v2.json +8 -0
  140. package/test/fixtures/realtime-monitor/warning.v1.json +8 -0
  141. package/test/help-parity.test.ts +104 -0
  142. package/test/init.test.ts +164 -0
  143. package/test/inspect-cache.test.ts +112 -0
  144. package/test/lsp-inline-hints.test.ts +65 -0
  145. package/test/query-profiler.test.ts +123 -0
  146. package/test/realtime-monitor.test.ts +115 -0
  147. package/test/registry.test.ts +41 -0
  148. package/test/start.test.ts +23 -0
  149. package/test/test-command.test.ts +65 -0
  150. package/tsconfig.json +19 -0
package/src/run.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { renderCommandHelp, renderGlobalHelp } from "./help";
2
+ import { type CommandResult, findCommand } from "./registry";
3
+
4
+ export interface RunCliOptions {
5
+ cwd?: string;
6
+ }
7
+
8
+ function stdout(message: string): CommandResult {
9
+ return { exitCode: 0, stdout: message };
10
+ }
11
+
12
+ function stderr(message: string, exitCode = 1): CommandResult {
13
+ return { exitCode, stderr: message };
14
+ }
15
+
16
+ export function runAuroraCli(
17
+ argv: ReadonlyArray<string>,
18
+ options: RunCliOptions = {},
19
+ ): CommandResult {
20
+ const [firstArg, ...restArgs] = argv;
21
+ const cwd = options.cwd ?? process.cwd();
22
+
23
+ if (!firstArg || firstArg === "help" || firstArg === "-h" || firstArg === "--help") {
24
+ return stdout(renderGlobalHelp());
25
+ }
26
+
27
+ const command = findCommand(firstArg);
28
+ if (!command) {
29
+ return stderr(`Unknown command: ${firstArg}\nRun \`aurora --help\` to list available commands.`);
30
+ }
31
+
32
+ if (restArgs.includes("--help") || restArgs.includes("-h")) {
33
+ return stdout(renderCommandHelp(command));
34
+ }
35
+
36
+ return command.run(restArgs, { cwd });
37
+ }
package/src/start.ts ADDED
@@ -0,0 +1,56 @@
1
+ import { resolve } from "node:path";
2
+
3
+ import { type CommandContext, type CommandResult } from "./registry";
4
+
5
+ interface StartBootstrapReport {
6
+ mode: "start";
7
+ cwd: string;
8
+ runtimeBundlePath: string;
9
+ url: string;
10
+ }
11
+
12
+ function parseStartArgs(args: ReadonlyArray<string>): CommandResult | undefined {
13
+ if (args.length === 0) {
14
+ return undefined;
15
+ }
16
+
17
+ const first = args[0];
18
+ return {
19
+ exitCode: 2,
20
+ stderr: `aurora start: unknown option '${first}'`,
21
+ };
22
+ }
23
+
24
+ function buildStartBootstrapReport(context: CommandContext): StartBootstrapReport {
25
+ return {
26
+ mode: "start",
27
+ cwd: context.cwd,
28
+ runtimeBundlePath: resolve(context.cwd, ".aurora/build/node/server.mjs"),
29
+ url: "http://localhost:3000",
30
+ };
31
+ }
32
+
33
+ function renderStartBootstrapReport(report: StartBootstrapReport): string {
34
+ return [
35
+ "aurora start bootstrap",
36
+ `cwd: ${report.cwd}`,
37
+ `runtime_bundle: ${report.runtimeBundlePath}`,
38
+ `url: ${report.url}`,
39
+ ].join("\n");
40
+ }
41
+
42
+ export function runStartCommand(
43
+ args: ReadonlyArray<string>,
44
+ context: CommandContext,
45
+ ): CommandResult {
46
+ const parseError = parseStartArgs(args);
47
+ if (parseError) {
48
+ return parseError;
49
+ }
50
+
51
+ const report = buildStartBootstrapReport(context);
52
+ return {
53
+ exitCode: 0,
54
+ stdout: renderStartBootstrapReport(report),
55
+ };
56
+ }
package/src/test.ts ADDED
@@ -0,0 +1,289 @@
1
+ import { resolve } from "node:path";
2
+
3
+ import {
4
+ loadMatrixProjectConfig,
5
+ type MatrixBuildTarget,
6
+ type MatrixProjectSpec,
7
+ type MatrixTemplateId,
8
+ } from "../../qa/e2e-matrix/src";
9
+
10
+ import { runBuildCommand } from "./build";
11
+ import { runCreateCommand } from "./create";
12
+ import { type CommandContext, type CommandResult } from "./registry";
13
+ import { runStartCommand } from "./start";
14
+
15
+ type TestOutputFormat = "text" | "json";
16
+
17
+ interface TestOptions {
18
+ template?: MatrixTemplateId;
19
+ format: TestOutputFormat;
20
+ }
21
+
22
+ interface MatrixBuildExecution {
23
+ target: MatrixBuildTarget;
24
+ exitCode: number;
25
+ stderr?: string;
26
+ }
27
+
28
+ interface MatrixStartExecution {
29
+ exitCode: number;
30
+ stderr?: string;
31
+ }
32
+
33
+ interface MatrixProjectExecution {
34
+ id: string;
35
+ template: MatrixTemplateId;
36
+ projectRoot: string;
37
+ createExitCode: number;
38
+ createStderr?: string;
39
+ builds: readonly MatrixBuildExecution[];
40
+ start?: MatrixStartExecution;
41
+ passed: boolean;
42
+ errors: readonly string[];
43
+ }
44
+
45
+ interface TestRunnerReport {
46
+ mode: "test";
47
+ cwd: string;
48
+ matrixVersion: 1;
49
+ templateFilter?: MatrixTemplateId;
50
+ projectsTotal: number;
51
+ projectsPassed: number;
52
+ projectsFailed: number;
53
+ durationMs: number;
54
+ results: readonly MatrixProjectExecution[];
55
+ }
56
+
57
+ let runCounter = 0;
58
+
59
+ export function runTestCommand(
60
+ args: ReadonlyArray<string>,
61
+ context: CommandContext,
62
+ ): CommandResult {
63
+ const options = parseTestOptions(args);
64
+ if ("exitCode" in options) {
65
+ return options;
66
+ }
67
+
68
+ const matrix = loadMatrixProjectConfig();
69
+ const projects = options.template
70
+ ? matrix.projects.filter((project) => project.template === options.template)
71
+ : matrix.projects;
72
+
73
+ if (projects.length === 0) {
74
+ return {
75
+ exitCode: 2,
76
+ stderr: `aurora test: no matrix projects found for template '${options.template}'.`,
77
+ };
78
+ }
79
+
80
+ const startedAt = Date.now();
81
+ const results = projects.map((project) => runMatrixProject(project));
82
+ const projectsFailed = results.filter((result) => !result.passed).length;
83
+ const report: TestRunnerReport = {
84
+ mode: "test",
85
+ cwd: context.cwd,
86
+ matrixVersion: 1,
87
+ templateFilter: options.template,
88
+ projectsTotal: results.length,
89
+ projectsPassed: results.length - projectsFailed,
90
+ projectsFailed,
91
+ durationMs: Date.now() - startedAt,
92
+ results,
93
+ };
94
+
95
+ const stdout =
96
+ options.format === "json"
97
+ ? JSON.stringify(report, null, 2)
98
+ : renderTestRunnerReport(report);
99
+
100
+ return {
101
+ exitCode: projectsFailed === 0 ? 0 : 1,
102
+ stdout,
103
+ };
104
+ }
105
+
106
+ function parseTestOptions(args: ReadonlyArray<string>): TestOptions | CommandResult {
107
+ const options: TestOptions = {
108
+ format: "text",
109
+ };
110
+
111
+ for (let index = 0; index < args.length; index += 1) {
112
+ const arg = args[index];
113
+
114
+ if (arg === "--template") {
115
+ const parsedTemplate = parseTemplateFilter(args[index + 1]);
116
+ if (typeof parsedTemplate !== "string") {
117
+ return parsedTemplate;
118
+ }
119
+
120
+ options.template = parsedTemplate;
121
+ index += 1;
122
+ continue;
123
+ }
124
+
125
+ if (arg === "--format") {
126
+ const parsedFormat = parseOutputFormat(args[index + 1]);
127
+ if (typeof parsedFormat !== "string") {
128
+ return parsedFormat;
129
+ }
130
+
131
+ options.format = parsedFormat;
132
+ index += 1;
133
+ continue;
134
+ }
135
+
136
+ return {
137
+ exitCode: 2,
138
+ stderr: `aurora test: unknown option '${arg}'`,
139
+ };
140
+ }
141
+
142
+ return options;
143
+ }
144
+
145
+ function parseTemplateFilter(
146
+ value: string | undefined,
147
+ ): MatrixTemplateId | CommandResult {
148
+ if (!value) {
149
+ return {
150
+ exitCode: 2,
151
+ stderr:
152
+ "aurora test: --template requires one of 'basic', 'saas', 'blog', or 'dashboard'",
153
+ };
154
+ }
155
+
156
+ if (value === "basic" || value === "saas" || value === "blog" || value === "dashboard") {
157
+ return value;
158
+ }
159
+
160
+ return {
161
+ exitCode: 2,
162
+ stderr:
163
+ `aurora test: invalid template '${value}'. Expected basic, saas, blog, or dashboard`,
164
+ };
165
+ }
166
+
167
+ function parseOutputFormat(value: string | undefined): TestOutputFormat | CommandResult {
168
+ if (!value) {
169
+ return {
170
+ exitCode: 2,
171
+ stderr: "aurora test: --format requires 'text' or 'json'",
172
+ };
173
+ }
174
+
175
+ if (value === "text" || value === "json") {
176
+ return value;
177
+ }
178
+
179
+ return {
180
+ exitCode: 2,
181
+ stderr: `aurora test: invalid format '${value}'. Expected 'text' or 'json'`,
182
+ };
183
+ }
184
+
185
+ function runMatrixProject(project: MatrixProjectSpec): MatrixProjectExecution {
186
+ runCounter += 1;
187
+
188
+ const projectName = `${project.id}-matrix-${Date.now()}-${runCounter}`;
189
+ const matrixRoot = resolve("/tmp", `aurora-cli-test-${projectName}`);
190
+
191
+ const createResult = runCreateCommand(
192
+ [projectName, "--template", project.template],
193
+ { cwd: matrixRoot },
194
+ );
195
+ const projectRoot = resolve(matrixRoot, projectName);
196
+
197
+ const errors: string[] = [];
198
+
199
+ if (createResult.exitCode !== 0) {
200
+ errors.push(createResult.stderr ?? "create command failed");
201
+ }
202
+
203
+ const builds: MatrixBuildExecution[] = [];
204
+ if (createResult.exitCode === 0) {
205
+ for (const target of project.buildTargets) {
206
+ const buildResult = runBuildCommand(["--target", target], {
207
+ cwd: projectRoot,
208
+ });
209
+
210
+ builds.push({
211
+ target,
212
+ exitCode: buildResult.exitCode,
213
+ stderr: buildResult.stderr,
214
+ });
215
+
216
+ if (buildResult.exitCode !== 0) {
217
+ errors.push(buildResult.stderr ?? `build failed for target ${target}`);
218
+ }
219
+ }
220
+ }
221
+
222
+ let start: MatrixStartExecution | undefined;
223
+ if (createResult.exitCode === 0 && project.runStart) {
224
+ const startResult = runStartCommand([], {
225
+ cwd: projectRoot,
226
+ });
227
+
228
+ start = {
229
+ exitCode: startResult.exitCode,
230
+ stderr: startResult.stderr,
231
+ };
232
+
233
+ if (startResult.exitCode !== 0) {
234
+ errors.push(startResult.stderr ?? "start command failed");
235
+ }
236
+ }
237
+
238
+ return {
239
+ id: project.id,
240
+ template: project.template,
241
+ projectRoot,
242
+ createExitCode: createResult.exitCode,
243
+ createStderr: createResult.stderr,
244
+ builds,
245
+ start,
246
+ passed: errors.length === 0,
247
+ errors,
248
+ };
249
+ }
250
+
251
+ function renderTestRunnerReport(report: TestRunnerReport): string {
252
+ const templates = report.templateFilter
253
+ ? report.templateFilter
254
+ : report.results.map((result) => result.template).join(", ");
255
+
256
+ const lines: string[] = [
257
+ "aurora test integration runner",
258
+ `cwd: ${report.cwd}`,
259
+ `matrix_version: ${report.matrixVersion}`,
260
+ `templates: ${templates}`,
261
+ `projects_total: ${report.projectsTotal}`,
262
+ `projects_passed: ${report.projectsPassed}`,
263
+ `projects_failed: ${report.projectsFailed}`,
264
+ `duration_ms: ${report.durationMs}`,
265
+ "results:",
266
+ ];
267
+
268
+ for (const result of report.results) {
269
+ lines.push(`- ${result.id} (${result.template}): ${result.passed ? "PASS" : "FAIL"}`);
270
+
271
+ for (const build of result.builds) {
272
+ lines.push(
273
+ ` build ${build.target}: ${build.exitCode === 0 ? "PASS" : `FAIL (${build.exitCode})`}`,
274
+ );
275
+ }
276
+
277
+ if (result.start) {
278
+ lines.push(
279
+ ` start: ${result.start.exitCode === 0 ? "PASS" : `FAIL (${result.start.exitCode})`}`,
280
+ );
281
+ }
282
+
283
+ for (const error of result.errors) {
284
+ lines.push(` error: ${error}`);
285
+ }
286
+ }
287
+
288
+ return lines.join("\n");
289
+ }
@@ -0,0 +1,16 @@
1
+ # __AURORA_APP_NAME__
2
+
3
+ Aurora basic starter template.
4
+
5
+ Includes:
6
+
7
+ - file-based route example
8
+ - server query example
9
+ - server action example
10
+ - auth seam stub for local development
11
+
12
+ ## Commands
13
+
14
+ - `aurora dev`
15
+ - `aurora build`
16
+ - `aurora start`
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "__AURORA_APP_NAME__",
3
+ "private": true,
4
+ "scripts": {
5
+ "dev": "aurora dev",
6
+ "build": "aurora build",
7
+ "start": "aurora start",
8
+ "test": "aurora test"
9
+ }
10
+ }
@@ -0,0 +1,22 @@
1
+ import { requireUser } from "../lib/auth.server";
2
+
3
+ export interface CreateMessageInput {
4
+ text: string;
5
+ }
6
+
7
+ export interface MessageRecord {
8
+ id: string;
9
+ text: string;
10
+ authorId: string;
11
+ createdAt: number;
12
+ }
13
+
14
+ export async function createMessage(input: CreateMessageInput): Promise<MessageRecord> {
15
+ const user = await requireUser();
16
+ return {
17
+ id: `msg-${Date.now()}`,
18
+ text: input.text,
19
+ authorId: user.id,
20
+ createdAt: Date.now(),
21
+ };
22
+ }
@@ -0,0 +1,11 @@
1
+ export interface AuthUser {
2
+ id: string;
3
+ role: "admin" | "user";
4
+ }
5
+
6
+ export async function requireUser(): Promise<AuthUser> {
7
+ return {
8
+ id: "demo-user",
9
+ role: "admin",
10
+ };
11
+ }
@@ -0,0 +1,17 @@
1
+ export interface MessageListItem {
2
+ id: string;
3
+ text: string;
4
+ createdAt: number;
5
+ }
6
+
7
+ const seed: MessageListItem[] = [
8
+ {
9
+ id: "seed-1",
10
+ text: "Welcome to Aurora basic starter.",
11
+ createdAt: 1707609600000,
12
+ },
13
+ ];
14
+
15
+ export async function listMessages(): Promise<MessageListItem[]> {
16
+ return seed;
17
+ }
@@ -0,0 +1,12 @@
1
+ import { createMessage } from "../actions/createMessage.action.server";
2
+ import { listMessages } from "../queries/listMessages.server";
3
+
4
+ export async function HomePage(): Promise<string> {
5
+ const messages = await listMessages();
6
+
7
+ if (messages.length === 0) {
8
+ await createMessage({ text: "Hello from Aurora basic starter." });
9
+ }
10
+
11
+ return `<main><h1>Aurora Basic Starter</h1><p>messages: ${messages.length}</p></main>`;
12
+ }
@@ -0,0 +1,17 @@
1
+ # __AURORA_APP_NAME__
2
+
3
+ Aurora blog starter template.
4
+
5
+ Includes:
6
+
7
+ - static-friendly blog list/detail route seams
8
+ - markdown content examples
9
+ - SEO metadata helper seam
10
+ - default social preview asset
11
+
12
+ ## Commands
13
+
14
+ - `aurora dev`
15
+ - `aurora build --target static`
16
+ - `aurora build --target node`
17
+ - `aurora start`
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "__AURORA_APP_NAME__",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "aurora dev",
7
+ "build": "aurora build --target static",
8
+ "build:node": "aurora build --target node",
9
+ "start": "aurora start",
10
+ "test": "aurora test"
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 630" role="img" aria-label="Aurora Blog">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0%" stop-color="#0f172a"/>
5
+ <stop offset="100%" stop-color="#1d4ed8"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="1200" height="630" fill="url(#bg)"/>
9
+ <circle cx="150" cy="150" r="90" fill="#38bdf8" opacity="0.25"/>
10
+ <circle cx="1050" cy="520" r="110" fill="#22c55e" opacity="0.2"/>
11
+ <text x="96" y="320" font-family="ui-monospace, Menlo, Monaco, Consolas, monospace" font-size="76" fill="#e2e8f0">
12
+ Aurora Blog Starter
13
+ </text>
14
+ <text x="96" y="390" font-family="ui-monospace, Menlo, Monaco, Consolas, monospace" font-size="36" fill="#bfdbfe">
15
+ static + markdown + seo
16
+ </text>
17
+ </svg>
@@ -0,0 +1,22 @@
1
+ export interface BlogPostSummary {
2
+ slug: string;
3
+ title: string;
4
+ description: string;
5
+ }
6
+
7
+ const seedPosts: BlogPostSummary[] = [
8
+ {
9
+ slug: "hello-world",
10
+ title: "Hello Aurora Blog",
11
+ description: "First post in the Aurora blog starter.",
12
+ },
13
+ {
14
+ slug: "release-notes",
15
+ title: "Release Notes Template",
16
+ description: "Example changelog-style post.",
17
+ },
18
+ ];
19
+
20
+ export async function loadPosts(): Promise<BlogPostSummary[]> {
21
+ return seedPosts;
22
+ }
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: Hello Aurora Blog
3
+ slug: hello-world
4
+ description: First post in the Aurora blog starter.
5
+ ---
6
+
7
+ # Hello Aurora
8
+
9
+ Welcome to the Aurora blog starter.
10
+
11
+ This markdown file is part of the static content seed set.
@@ -0,0 +1,9 @@
1
+ ---
2
+ title: Release Notes Template
3
+ slug: release-notes
4
+ description: Example changelog-style post.
5
+ ---
6
+
7
+ # Release Notes
8
+
9
+ Use this post as a baseline for changelog and release-note pages.
@@ -0,0 +1,22 @@
1
+ import { loadPosts } from "../content/loadPosts.server";
2
+ import { buildSeoMeta } from "../seo/meta";
3
+
4
+ export async function HomePage(): Promise<string> {
5
+ const posts = await loadPosts();
6
+ const meta = buildSeoMeta({
7
+ title: "Aurora Blog",
8
+ description: "Static-friendly Aurora blog starter.",
9
+ canonicalPath: "/",
10
+ });
11
+
12
+ return [
13
+ "<main>",
14
+ `<h1>${meta.title}</h1>`,
15
+ "<ul>",
16
+ ...posts.map(
17
+ (post) => `<li><a href="/posts/${post.slug}">${post.title}</a> - ${post.description}</li>`,
18
+ ),
19
+ "</ul>",
20
+ "</main>",
21
+ ].join("");
22
+ }
@@ -0,0 +1,19 @@
1
+ import { loadPosts } from "../../content/loadPosts.server";
2
+ import { buildSeoMeta } from "../../seo/meta";
3
+
4
+ export async function BlogPostPage(slug: string): Promise<string> {
5
+ const posts = await loadPosts();
6
+ const post = posts.find((entry) => entry.slug === slug);
7
+
8
+ if (!post) {
9
+ return "<main><h1>Post not found</h1></main>";
10
+ }
11
+
12
+ const meta = buildSeoMeta({
13
+ title: post.title,
14
+ description: post.description,
15
+ canonicalPath: `/posts/${post.slug}`,
16
+ });
17
+
18
+ return `<main><h1>${meta.title}</h1><p>${post.description}</p></main>`;
19
+ }
@@ -0,0 +1,19 @@
1
+ export interface SeoMetaInput {
2
+ title: string;
3
+ description: string;
4
+ canonicalPath: string;
5
+ }
6
+
7
+ export function buildSeoMeta(input: SeoMetaInput): {
8
+ title: string;
9
+ description: string;
10
+ canonicalUrl: string;
11
+ openGraphImage: string;
12
+ } {
13
+ return {
14
+ title: input.title,
15
+ description: input.description,
16
+ canonicalUrl: `https://example.com${input.canonicalPath}`,
17
+ openGraphImage: "/assets/og-default.svg",
18
+ };
19
+ }
@@ -0,0 +1,18 @@
1
+ # __AURORA_APP_NAME__
2
+
3
+ Template: dashboard
4
+
5
+ Aurora dashboard starter template.
6
+
7
+ Includes:
8
+
9
+ - metrics query for dashboard cards/charts
10
+ - data-grid style table projection
11
+ - realtime subscription seam for dashboard refresh
12
+ - action seam for acknowledging alerts
13
+
14
+ ## Commands
15
+
16
+ - `aurora dev`
17
+ - `aurora build`
18
+ - `aurora start`
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "__AURORA_APP_NAME__",
3
+ "private": true,
4
+ "scripts": {
5
+ "dev": "aurora dev",
6
+ "build": "aurora build",
7
+ "start": "aurora start",
8
+ "test": "aurora test"
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ export async function acknowledgeAlert(alertId: string): Promise<{ ok: true; id: string }> {
2
+ return {
3
+ ok: true,
4
+ id: alertId,
5
+ };
6
+ }