create-ereo 0.1.26 → 0.1.28
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 +10 -10
- package/dist/index.js +120 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,20 +5,20 @@ Scaffold a new EreoJS project with a single command. Creates a fully configured
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
bunx create-ereo my-app
|
|
8
|
+
bunx create-ereo@latest my-app
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Or with npm/npx:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx create-ereo my-app
|
|
14
|
+
npx create-ereo@latest my-app
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
# Create a new project with the default template
|
|
21
|
-
bunx create-ereo my-app
|
|
21
|
+
bunx create-ereo@latest my-app
|
|
22
22
|
|
|
23
23
|
# Navigate to the project
|
|
24
24
|
cd my-app
|
|
@@ -35,13 +35,13 @@ Choose from multiple starter templates:
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
# Minimal template - bare essentials
|
|
38
|
-
bunx create-ereo my-app --template minimal
|
|
38
|
+
bunx create-ereo@latest my-app --template minimal
|
|
39
39
|
|
|
40
40
|
# Default template - standard setup
|
|
41
|
-
bunx create-ereo my-app --template default
|
|
41
|
+
bunx create-ereo@latest my-app --template default
|
|
42
42
|
|
|
43
43
|
# Tailwind template - full-featured with Tailwind CSS (default)
|
|
44
|
-
bunx create-ereo my-app --template tailwind
|
|
44
|
+
bunx create-ereo@latest my-app --template tailwind
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
### Template Contents
|
|
@@ -76,16 +76,16 @@ bunx create-ereo my-app --template tailwind
|
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
# Create with minimal template
|
|
79
|
-
bunx create-ereo my-app -t minimal
|
|
79
|
+
bunx create-ereo@latest my-app -t minimal
|
|
80
80
|
|
|
81
81
|
# Create without TypeScript
|
|
82
|
-
bunx create-ereo my-app --no-typescript
|
|
82
|
+
bunx create-ereo@latest my-app --no-typescript
|
|
83
83
|
|
|
84
84
|
# Create without installing dependencies
|
|
85
|
-
bunx create-ereo my-app --no-install
|
|
85
|
+
bunx create-ereo@latest my-app --no-install
|
|
86
86
|
|
|
87
87
|
# Create without git initialization
|
|
88
|
-
bunx create-ereo my-app --no-git
|
|
88
|
+
bunx create-ereo@latest my-app --no-git
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
## Project Structure
|
package/dist/index.js
CHANGED
|
@@ -5,12 +5,34 @@
|
|
|
5
5
|
import { join, resolve, dirname } from "path";
|
|
6
6
|
import { mkdir } from "fs/promises";
|
|
7
7
|
var pkgJsonPath = join(dirname(import.meta.dir), "package.json");
|
|
8
|
-
var
|
|
8
|
+
var LOCAL_VERSION = (await Bun.file(pkgJsonPath).json()).version;
|
|
9
|
+
var EREO_VERSION = `^${LOCAL_VERSION}`;
|
|
10
|
+
async function checkForUpdates() {
|
|
11
|
+
try {
|
|
12
|
+
const controller = new AbortController;
|
|
13
|
+
const timeout = setTimeout(() => controller.abort(), 3000);
|
|
14
|
+
const res = await fetch("https://registry.npmjs.org/create-ereo/latest", {
|
|
15
|
+
signal: controller.signal
|
|
16
|
+
});
|
|
17
|
+
clearTimeout(timeout);
|
|
18
|
+
if (!res.ok)
|
|
19
|
+
return;
|
|
20
|
+
const { version: latest } = await res.json();
|
|
21
|
+
if (latest && latest !== LOCAL_VERSION) {
|
|
22
|
+
console.log(` \x1B[33m\u26A0\x1B[0m You are running \x1B[1mcreate-ereo@${LOCAL_VERSION}\x1B[0m.`);
|
|
23
|
+
console.log(` The latest version is \x1B[1m\x1B[32m${latest}\x1B[0m. Update with:
|
|
24
|
+
`);
|
|
25
|
+
console.log(` \x1B[36mbunx create-ereo@latest ${process.argv[2] ?? "<project-name>"}\x1B[0m
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
} catch {}
|
|
29
|
+
}
|
|
9
30
|
var defaultOptions = {
|
|
10
31
|
template: "tailwind",
|
|
11
32
|
typescript: true,
|
|
12
33
|
git: true,
|
|
13
|
-
install: true
|
|
34
|
+
install: true,
|
|
35
|
+
trace: false
|
|
14
36
|
};
|
|
15
37
|
function printBanner() {
|
|
16
38
|
console.log(`
|
|
@@ -22,18 +44,19 @@ function printBanner() {
|
|
|
22
44
|
function printHelp() {
|
|
23
45
|
console.log(`
|
|
24
46
|
\x1B[1mUsage:\x1B[0m
|
|
25
|
-
bunx create-ereo <project-name> [options]
|
|
47
|
+
bunx create-ereo@latest <project-name> [options]
|
|
26
48
|
|
|
27
49
|
\x1B[1mOptions:\x1B[0m
|
|
28
50
|
-t, --template <name> Template to use (minimal, default, tailwind)
|
|
29
51
|
--no-typescript Use JavaScript instead of TypeScript
|
|
30
52
|
--no-git Skip git initialization
|
|
31
53
|
--no-install Skip package installation
|
|
54
|
+
--trace Include @ereo/trace for full-stack observability
|
|
32
55
|
|
|
33
56
|
\x1B[1mExamples:\x1B[0m
|
|
34
|
-
bunx create-ereo my-app
|
|
35
|
-
bunx create-ereo my-app --template minimal
|
|
36
|
-
bunx create-ereo my-app --no-typescript
|
|
57
|
+
bunx create-ereo@latest my-app
|
|
58
|
+
bunx create-ereo@latest my-app --template minimal
|
|
59
|
+
bunx create-ereo@latest my-app --no-typescript
|
|
37
60
|
`);
|
|
38
61
|
}
|
|
39
62
|
function parseArgs(args) {
|
|
@@ -64,6 +87,8 @@ function parseArgs(args) {
|
|
|
64
87
|
options.git = false;
|
|
65
88
|
} else if (arg === "--no-install") {
|
|
66
89
|
options.install = false;
|
|
90
|
+
} else if (arg === "--trace") {
|
|
91
|
+
options.trace = true;
|
|
67
92
|
} else if (!arg.startsWith("-") && !projectName) {
|
|
68
93
|
projectName = arg;
|
|
69
94
|
}
|
|
@@ -138,7 +163,7 @@ coverage
|
|
|
138
163
|
*.tgz
|
|
139
164
|
`;
|
|
140
165
|
}
|
|
141
|
-
async function generateMinimalProject(projectDir, projectName, typescript) {
|
|
166
|
+
async function generateMinimalProject(projectDir, projectName, typescript, trace = false) {
|
|
142
167
|
const ext = typescript ? "tsx" : "jsx";
|
|
143
168
|
await mkdir(projectDir, { recursive: true });
|
|
144
169
|
await mkdir(join(projectDir, "app/routes"), { recursive: true });
|
|
@@ -148,7 +173,7 @@ async function generateMinimalProject(projectDir, projectName, typescript) {
|
|
|
148
173
|
version: "0.1.0",
|
|
149
174
|
type: "module",
|
|
150
175
|
scripts: {
|
|
151
|
-
dev: "ereo dev",
|
|
176
|
+
dev: trace ? "ereo dev --trace" : "ereo dev",
|
|
152
177
|
build: "ereo build",
|
|
153
178
|
start: "ereo start"
|
|
154
179
|
},
|
|
@@ -159,6 +184,7 @@ async function generateMinimalProject(projectDir, projectName, typescript) {
|
|
|
159
184
|
"@ereo/client": EREO_VERSION,
|
|
160
185
|
"@ereo/data": EREO_VERSION,
|
|
161
186
|
"@ereo/cli": EREO_VERSION,
|
|
187
|
+
...trace ? { "@ereo/trace": EREO_VERSION } : {},
|
|
162
188
|
react: "^18.2.0",
|
|
163
189
|
"react-dom": "^18.2.0"
|
|
164
190
|
},
|
|
@@ -188,9 +214,6 @@ export default function RootLayout({ children }${typescript ? ": { children: Rea
|
|
|
188
214
|
<meta charSet="utf-8" />
|
|
189
215
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
190
216
|
<title>${projectName}</title>
|
|
191
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
192
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
|
193
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
194
217
|
<style dangerouslySetInnerHTML={{ __html: \`
|
|
195
218
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
196
219
|
:root {
|
|
@@ -219,7 +242,7 @@ export default function RootLayout({ children }${typescript ? ": { children: Rea
|
|
|
219
242
|
}
|
|
220
243
|
}
|
|
221
244
|
body {
|
|
222
|
-
font-family:
|
|
245
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
223
246
|
background: var(--bg);
|
|
224
247
|
color: var(--text);
|
|
225
248
|
line-height: 1.6;
|
|
@@ -261,7 +284,7 @@ export default function RootLayout({ children }${typescript ? ": { children: Rea
|
|
|
261
284
|
.code-dot-r { background: #ff5f57; }
|
|
262
285
|
.code-dot-y { background: #febc2e; }
|
|
263
286
|
.code-dot-g { background: #28c840; }
|
|
264
|
-
.code-body { padding: 1.25rem; font-family: '
|
|
287
|
+
.code-body { padding: 1.25rem; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.875rem; color: #a5b4fc; line-height: 1.8; }
|
|
265
288
|
.code-body .prompt { color: #6ee7b7; }
|
|
266
289
|
.quickstart-section { background: var(--bg-soft); padding: 5rem 2rem; text-align: center; }
|
|
267
290
|
.quickstart-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
|
|
@@ -366,7 +389,7 @@ export default function HomePage() {
|
|
|
366
389
|
<span className="code-dot code-dot-g" />
|
|
367
390
|
</div>
|
|
368
391
|
<div className="code-body">
|
|
369
|
-
<div><span className="prompt">$</span> bunx create-ereo my-app</div>
|
|
392
|
+
<div><span className="prompt">$</span> bunx create-ereo@latest my-app</div>
|
|
370
393
|
<div><span className="prompt">$</span> cd my-app</div>
|
|
371
394
|
<div><span className="prompt">$</span> bun run dev</div>
|
|
372
395
|
</div>
|
|
@@ -409,7 +432,7 @@ dist
|
|
|
409
432
|
await Bun.write(join(projectDir, "Dockerfile"), generateDockerfile(typescript));
|
|
410
433
|
await Bun.write(join(projectDir, ".dockerignore"), generateDockerignore());
|
|
411
434
|
}
|
|
412
|
-
async function generateTailwindProject(projectDir, projectName, typescript) {
|
|
435
|
+
async function generateTailwindProject(projectDir, projectName, typescript, trace = false) {
|
|
413
436
|
const ext = typescript ? "tsx" : "jsx";
|
|
414
437
|
const ts = typescript;
|
|
415
438
|
await mkdir(projectDir, { recursive: true });
|
|
@@ -422,7 +445,7 @@ async function generateTailwindProject(projectDir, projectName, typescript) {
|
|
|
422
445
|
version: "0.1.0",
|
|
423
446
|
type: "module",
|
|
424
447
|
scripts: {
|
|
425
|
-
dev: "ereo dev",
|
|
448
|
+
dev: trace ? "ereo dev --trace" : "ereo dev",
|
|
426
449
|
build: "ereo build",
|
|
427
450
|
start: "ereo start",
|
|
428
451
|
test: "bun test",
|
|
@@ -437,6 +460,7 @@ async function generateTailwindProject(projectDir, projectName, typescript) {
|
|
|
437
460
|
"@ereo/cli": EREO_VERSION,
|
|
438
461
|
"@ereo/runtime-bun": EREO_VERSION,
|
|
439
462
|
"@ereo/plugin-tailwind": EREO_VERSION,
|
|
463
|
+
...trace ? { "@ereo/trace": EREO_VERSION } : {},
|
|
440
464
|
react: "^18.2.0",
|
|
441
465
|
"react-dom": "^18.2.0"
|
|
442
466
|
},
|
|
@@ -507,8 +531,8 @@ export default {
|
|
|
507
531
|
theme: {
|
|
508
532
|
extend: {
|
|
509
533
|
fontFamily: {
|
|
510
|
-
sans: ['
|
|
511
|
-
mono: ['
|
|
534
|
+
sans: ['system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'sans-serif'],
|
|
535
|
+
mono: ['ui-monospace', 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'monospace'],
|
|
512
536
|
},
|
|
513
537
|
colors: {
|
|
514
538
|
primary: {
|
|
@@ -557,8 +581,6 @@ export default {
|
|
|
557
581
|
`.trim();
|
|
558
582
|
await Bun.write(join(projectDir, "tailwind.config.js"), tailwindConfig);
|
|
559
583
|
const styles = `
|
|
560
|
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');
|
|
561
|
-
|
|
562
584
|
@tailwind base;
|
|
563
585
|
@tailwind components;
|
|
564
586
|
@tailwind utilities;
|
|
@@ -646,6 +668,49 @@ export interface ActionResult<T = unknown> {
|
|
|
646
668
|
`.trim();
|
|
647
669
|
await Bun.write(join(projectDir, "app/lib/types.ts"), types);
|
|
648
670
|
}
|
|
671
|
+
const tracingBlogPost = trace ? `
|
|
672
|
+
{
|
|
673
|
+
slug: 'full-stack-tracing',
|
|
674
|
+
title: 'Full-Stack Tracing with @ereo/trace',
|
|
675
|
+
excerpt: 'See every request from HTTP to database in a beautiful timeline. Zero-config observability for your EreoJS app.',
|
|
676
|
+
content: \\\`
|
|
677
|
+
# Full-Stack Tracing with @ereo/trace
|
|
678
|
+
|
|
679
|
+
EreoJS includes built-in full-stack observability that traces every request across all 11 framework layers.
|
|
680
|
+
|
|
681
|
+
## Enabling Tracing
|
|
682
|
+
|
|
683
|
+
Tracing is already configured in this project! Run \\\\\\\`bun run dev\\\\\\\` and open http://localhost:3000/__ereo/traces to see the trace viewer.
|
|
684
|
+
|
|
685
|
+
## What Gets Traced
|
|
686
|
+
|
|
687
|
+
- **Request lifecycle** \u2014 HTTP method, path, status, total duration
|
|
688
|
+
- **Route matching** \u2014 Which route patterns matched, layout chains
|
|
689
|
+
- **Data loading** \u2014 Loader execution time, cache hits/misses
|
|
690
|
+
- **Form actions** \u2014 Validation, processing, error counts
|
|
691
|
+
- **Database queries** \u2014 SQL statements, row counts, duration
|
|
692
|
+
|
|
693
|
+
## CLI Output
|
|
694
|
+
|
|
695
|
+
The CLI reporter shows a live tree view of every request:
|
|
696
|
+
|
|
697
|
+
\\\\\\\`\\\\\\\`\\\\\\\`
|
|
698
|
+
GET /blog 200 42.1ms
|
|
699
|
+
|-- routing 1.2ms matched /blog
|
|
700
|
+
|-- data 38.4ms
|
|
701
|
+
| |-- posts 35.1ms db query
|
|
702
|
+
\\\\\\\\\\\\\\\`-- render 2.5ms
|
|
703
|
+
\\\\\\\`\\\\\\\`\\\\\\\`
|
|
704
|
+
|
|
705
|
+
## Production
|
|
706
|
+
|
|
707
|
+
For production, alias \\\\\\\`@ereo/trace\\\\\\\` to \\\\\\\`@ereo/trace/noop\\\\\\\` \u2014 a 592-byte no-op that tree-shakes to zero runtime cost.
|
|
708
|
+
\\\`.trim(),
|
|
709
|
+
author: 'EreoJS Team',
|
|
710
|
+
date: '2024-02-01',
|
|
711
|
+
readTime: '3 min read',
|
|
712
|
+
tags: ['ereo', 'tracing', 'devtools'],
|
|
713
|
+
},` : "";
|
|
649
714
|
const mockData = `
|
|
650
715
|
${ts ? `import type { Post } from './types';
|
|
651
716
|
` : ""}
|
|
@@ -674,7 +739,7 @@ EreoJS is a modern React fullstack framework that runs on Bun, offering exceptio
|
|
|
674
739
|
## Quick Start
|
|
675
740
|
|
|
676
741
|
\\\`\\\`\\\`bash
|
|
677
|
-
bunx create-ereo my-app
|
|
742
|
+
bunx create-ereo@latest my-app
|
|
678
743
|
cd my-app
|
|
679
744
|
bun run dev
|
|
680
745
|
\\\`\\\`\\\`
|
|
@@ -766,7 +831,7 @@ export default function Button({ children }) {
|
|
|
766
831
|
date: '2024-01-25',
|
|
767
832
|
readTime: '4 min read',
|
|
768
833
|
tags: ['ereo', 'tailwind', 'css'],
|
|
769
|
-
}
|
|
834
|
+
},${tracingBlogPost}
|
|
770
835
|
];
|
|
771
836
|
|
|
772
837
|
/**
|
|
@@ -784,7 +849,8 @@ export function getPostBySlug(slug${ts ? ": string" : ""})${ts ? ": Post | undef
|
|
|
784
849
|
}
|
|
785
850
|
|
|
786
851
|
/**
|
|
787
|
-
* Simulate API delay for demo purposes
|
|
852
|
+
* Simulate API delay for demo purposes.${trace ? `
|
|
853
|
+
* When tracing is enabled, these delays create visible spans in the trace viewer.` : ""}
|
|
788
854
|
*/
|
|
789
855
|
export async function simulateDelay(ms${ts ? ": number" : ""} = 100)${ts ? ": Promise<void>" : ""} {
|
|
790
856
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -996,9 +1062,6 @@ export default function RootLayout({ children }${ts ? ": RootLayoutProps" : ""})
|
|
|
996
1062
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
997
1063
|
<meta name="description" content="A modern web application built with EreoJS" />
|
|
998
1064
|
<title>${projectName}</title>
|
|
999
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1000
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
|
|
1001
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
1002
1065
|
<link rel="stylesheet" href="/__tailwind.css" />
|
|
1003
1066
|
</head>
|
|
1004
1067
|
<body className="min-h-screen flex flex-col bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
|
|
@@ -1099,7 +1162,7 @@ export default function HomePage({ loaderData }${ts ? ": HomePageProps" : ""}) {
|
|
|
1099
1162
|
<span className="code-window-dot bg-green-500" />
|
|
1100
1163
|
</div>
|
|
1101
1164
|
<div className="px-5 py-4 font-mono text-sm text-primary-300 leading-relaxed">
|
|
1102
|
-
<div><span className="text-emerald-400">$</span> bunx create-ereo my-app</div>
|
|
1165
|
+
<div><span className="text-emerald-400">$</span> bunx create-ereo@latest my-app</div>
|
|
1103
1166
|
<div><span className="text-emerald-400">$</span> cd my-app</div>
|
|
1104
1167
|
<div><span className="text-emerald-400">$</span> bun run dev</div>
|
|
1105
1168
|
</div>
|
|
@@ -1279,7 +1342,7 @@ export async function action({ request }) {
|
|
|
1279
1342
|
<span className="code-window-dot bg-green-500" />
|
|
1280
1343
|
</div>
|
|
1281
1344
|
<div className="px-5 py-3 font-mono text-sm text-primary-300">
|
|
1282
|
-
<span className="text-emerald-400">$</span> bunx create-ereo my-app
|
|
1345
|
+
<span className="text-emerald-400">$</span> bunx create-ereo@latest my-app
|
|
1283
1346
|
</div>
|
|
1284
1347
|
</div>
|
|
1285
1348
|
<div className="flex flex-wrap gap-4 justify-center">
|
|
@@ -1650,7 +1713,11 @@ export default function AboutPage() {
|
|
|
1650
1713
|
<li className="flex items-center gap-2">
|
|
1651
1714
|
<span className="text-green-500">\u2713</span>
|
|
1652
1715
|
Tailwind CSS styling
|
|
1653
|
-
</li
|
|
1716
|
+
</li>${trace ? `
|
|
1717
|
+
<li className="flex items-center gap-2">
|
|
1718
|
+
<span className="text-green-500">\u2713</span>
|
|
1719
|
+
Full-stack tracing & observability
|
|
1720
|
+
</li>` : ""}
|
|
1654
1721
|
</ul>
|
|
1655
1722
|
</div>
|
|
1656
1723
|
|
|
@@ -1801,7 +1868,8 @@ This project demonstrates:
|
|
|
1801
1868
|
- **Nested Layouts** - Shared layouts per route segment
|
|
1802
1869
|
- **Islands Architecture** - Selective hydration for interactivity
|
|
1803
1870
|
- **Error Boundaries** - Graceful error handling
|
|
1804
|
-
- **Tailwind CSS** - Utility-first styling
|
|
1871
|
+
- **Tailwind CSS** - Utility-first styling${trace ? `
|
|
1872
|
+
- **Full-Stack Tracing** - Request-level observability with \`@ereo/trace\`` : ""}
|
|
1805
1873
|
|
|
1806
1874
|
## Getting Started
|
|
1807
1875
|
|
|
@@ -1809,10 +1877,11 @@ This project demonstrates:
|
|
|
1809
1877
|
# Install dependencies
|
|
1810
1878
|
bun install
|
|
1811
1879
|
|
|
1812
|
-
# Start development server
|
|
1880
|
+
# Start development server${trace ? " (tracing enabled by default)" : ""}
|
|
1813
1881
|
bun run dev
|
|
1814
1882
|
|
|
1815
|
-
# Open http://localhost:3000
|
|
1883
|
+
# Open http://localhost:3000${trace ? `
|
|
1884
|
+
# Open http://localhost:3000/__ereo/traces for the trace viewer` : ""}
|
|
1816
1885
|
\`\`\`
|
|
1817
1886
|
|
|
1818
1887
|
## Project Structure
|
|
@@ -1849,7 +1918,17 @@ app/
|
|
|
1849
1918
|
- \`bun test\` - Run tests
|
|
1850
1919
|
- \`bun run typecheck\` - TypeScript type checking
|
|
1851
1920
|
|
|
1852
|
-
|
|
1921
|
+
${trace ? `## Tracing
|
|
1922
|
+
|
|
1923
|
+
This project includes \`@ereo/trace\` for full-stack observability.
|
|
1924
|
+
|
|
1925
|
+
- **CLI Reporter** \u2014 Live tree view in your terminal for every request
|
|
1926
|
+
- **Trace Viewer** \u2014 Open http://localhost:3000/__ereo/traces for a timeline UI
|
|
1927
|
+
- **11 Layers** \u2014 Traces request, routing, data, forms, signals, RPC, database, auth, islands, build, and errors
|
|
1928
|
+
|
|
1929
|
+
For production, alias \`@ereo/trace\` to \`@ereo/trace/noop\` in your bundler for zero runtime cost (592 bytes).
|
|
1930
|
+
|
|
1931
|
+
` : ""}## Learn More
|
|
1853
1932
|
|
|
1854
1933
|
- [EreoJS Documentation](https://ereo.dev/docs)
|
|
1855
1934
|
- [Bun Documentation](https://bun.sh/docs)
|
|
@@ -1858,11 +1937,11 @@ app/
|
|
|
1858
1937
|
await Bun.write(join(projectDir, "README.md"), readme);
|
|
1859
1938
|
}
|
|
1860
1939
|
async function generateProject(projectDir, projectName, options) {
|
|
1861
|
-
const { template, typescript } = options;
|
|
1940
|
+
const { template, typescript, trace } = options;
|
|
1862
1941
|
if (template === "minimal") {
|
|
1863
|
-
await generateMinimalProject(projectDir, projectName, typescript);
|
|
1942
|
+
await generateMinimalProject(projectDir, projectName, typescript, trace);
|
|
1864
1943
|
} else {
|
|
1865
|
-
await generateTailwindProject(projectDir, projectName, typescript);
|
|
1944
|
+
await generateTailwindProject(projectDir, projectName, typescript, trace);
|
|
1866
1945
|
}
|
|
1867
1946
|
}
|
|
1868
1947
|
async function initGit(projectDir) {
|
|
@@ -1890,6 +1969,7 @@ async function installDeps(projectDir) {
|
|
|
1890
1969
|
}
|
|
1891
1970
|
async function main() {
|
|
1892
1971
|
printBanner();
|
|
1972
|
+
await checkForUpdates();
|
|
1893
1973
|
const args = process.argv.slice(2);
|
|
1894
1974
|
const { projectName, options } = parseArgs(args);
|
|
1895
1975
|
if (!projectName) {
|
|
@@ -1913,7 +1993,8 @@ async function main() {
|
|
|
1913
1993
|
console.log(` Creating \x1B[36m${projectName}\x1B[0m...
|
|
1914
1994
|
`);
|
|
1915
1995
|
console.log(` Template: ${finalOptions.template}`);
|
|
1916
|
-
console.log(` TypeScript: ${finalOptions.typescript ? "Yes" : "No"}
|
|
1996
|
+
console.log(` TypeScript: ${finalOptions.typescript ? "Yes" : "No"}`);
|
|
1997
|
+
console.log(` Tracing: ${finalOptions.trace ? "Yes" : "No"}
|
|
1917
1998
|
`);
|
|
1918
1999
|
await generateProject(projectDir, projectName, finalOptions);
|
|
1919
2000
|
console.log(" \x1B[32m\u2713\x1B[0m Project files created");
|
|
@@ -1933,7 +2014,8 @@ async function main() {
|
|
|
1933
2014
|
${!finalOptions.install ? `\x1B[36mbun install\x1B[0m
|
|
1934
2015
|
` : ""}\x1B[36mbun run dev\x1B[0m
|
|
1935
2016
|
|
|
1936
|
-
Open http://localhost:3000 to see your app.
|
|
2017
|
+
Open http://localhost:3000 to see your app.${finalOptions.trace ? `
|
|
2018
|
+
Open http://localhost:3000/__ereo/traces for the trace viewer.` : ""}
|
|
1937
2019
|
|
|
1938
2020
|
Happy coding!
|
|
1939
2021
|
`);
|