create-rudder 1.4.0 → 1.5.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 +23 -5
- package/dist/agent-detect.d.ts +21 -0
- package/dist/agent-detect.d.ts.map +1 -0
- package/dist/agent-detect.js +36 -0
- package/dist/agent-detect.js.map +1 -0
- package/dist/cli-flags.d.ts +60 -0
- package/dist/cli-flags.d.ts.map +1 -0
- package/dist/cli-flags.js +251 -0
- package/dist/cli-flags.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +642 -0
- package/dist/index.js.map +1 -0
- package/dist/logo.d.ts +6 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +52 -0
- package/dist/logo.js.map +1 -0
- package/dist/templates/app/auth-controller.d.ts +2 -0
- package/dist/templates/app/auth-controller.d.ts.map +1 -0
- package/dist/templates/app/auth-controller.js +53 -0
- package/dist/templates/app/auth-controller.js.map +1 -0
- package/dist/templates/app/mcp-echo-server.d.ts +2 -0
- package/dist/templates/app/mcp-echo-server.d.ts.map +1 -0
- package/dist/templates/app/mcp-echo-server.js +13 -0
- package/dist/templates/app/mcp-echo-server.js.map +1 -0
- package/dist/templates/app/mcp-echo-tool.d.ts +2 -0
- package/dist/templates/app/mcp-echo-tool.d.ts.map +1 -0
- package/dist/templates/app/mcp-echo-tool.js +20 -0
- package/dist/templates/app/mcp-echo-tool.js.map +1 -0
- package/dist/templates/app/service-provider.d.ts +3 -0
- package/dist/templates/app/service-provider.d.ts.map +1 -0
- package/dist/templates/app/service-provider.js +33 -0
- package/dist/templates/app/service-provider.js.map +1 -0
- package/dist/templates/app/terminal-dashboard.d.ts +2 -0
- package/dist/templates/app/terminal-dashboard.d.ts.map +1 -0
- package/dist/templates/app/terminal-dashboard.js +22 -0
- package/dist/templates/app/terminal-dashboard.js.map +1 -0
- package/dist/templates/app/user-model.d.ts +2 -0
- package/dist/templates/app/user-model.d.ts.map +1 -0
- package/dist/templates/app/user-model.js +19 -0
- package/dist/templates/app/user-model.js.map +1 -0
- package/dist/templates/bootstrap/app.d.ts +3 -0
- package/dist/templates/bootstrap/app.d.ts.map +1 -0
- package/dist/templates/bootstrap/app.js +41 -0
- package/dist/templates/bootstrap/app.js.map +1 -0
- package/dist/templates/bootstrap/providers.d.ts +3 -0
- package/dist/templates/bootstrap/providers.d.ts.map +1 -0
- package/dist/templates/bootstrap/providers.js +27 -0
- package/dist/templates/bootstrap/providers.js.map +1 -0
- package/dist/templates/components/site-header.d.ts +4 -0
- package/dist/templates/components/site-header.d.ts.map +1 -0
- package/dist/templates/components/site-header.js +233 -0
- package/dist/templates/components/site-header.js.map +1 -0
- package/dist/templates/configs/ai.d.ts +2 -0
- package/dist/templates/configs/ai.d.ts.map +1 -0
- package/dist/templates/configs/ai.js +32 -0
- package/dist/templates/configs/ai.js.map +1 -0
- package/dist/templates/configs/app.d.ts +2 -0
- package/dist/templates/configs/app.d.ts.map +1 -0
- package/dist/templates/configs/app.js +12 -0
- package/dist/templates/configs/app.js.map +1 -0
- package/dist/templates/configs/auth.d.ts +3 -0
- package/dist/templates/configs/auth.d.ts.map +1 -0
- package/dist/templates/configs/auth.js +16 -0
- package/dist/templates/configs/auth.js.map +1 -0
- package/dist/templates/configs/cache.d.ts +2 -0
- package/dist/templates/configs/cache.d.ts.map +1 -0
- package/dist/templates/configs/cache.js +28 -0
- package/dist/templates/configs/cache.js.map +1 -0
- package/dist/templates/configs/crypt.d.ts +2 -0
- package/dist/templates/configs/crypt.d.ts.map +1 -0
- package/dist/templates/configs/crypt.js +16 -0
- package/dist/templates/configs/crypt.js.map +1 -0
- package/dist/templates/configs/database.d.ts +3 -0
- package/dist/templates/configs/database.d.ts.map +1 -0
- package/dist/templates/configs/database.js +28 -0
- package/dist/templates/configs/database.js.map +1 -0
- package/dist/templates/configs/hash.d.ts +2 -0
- package/dist/templates/configs/hash.d.ts.map +1 -0
- package/dist/templates/configs/hash.js +12 -0
- package/dist/templates/configs/hash.js.map +1 -0
- package/dist/templates/configs/horizon.d.ts +2 -0
- package/dist/templates/configs/horizon.d.ts.map +1 -0
- package/dist/templates/configs/horizon.js +30 -0
- package/dist/templates/configs/horizon.js.map +1 -0
- package/dist/templates/configs/index.d.ts +3 -0
- package/dist/templates/configs/index.d.ts.map +1 -0
- package/dist/templates/configs/index.js +92 -0
- package/dist/templates/configs/index.js.map +1 -0
- package/dist/templates/configs/localization.d.ts +2 -0
- package/dist/templates/configs/localization.d.ts.map +1 -0
- package/dist/templates/configs/localization.js +13 -0
- package/dist/templates/configs/localization.js.map +1 -0
- package/dist/templates/configs/log.d.ts +2 -0
- package/dist/templates/configs/log.d.ts.map +1 -0
- package/dist/templates/configs/log.js +40 -0
- package/dist/templates/configs/log.js.map +1 -0
- package/dist/templates/configs/mail.d.ts +2 -0
- package/dist/templates/configs/mail.d.ts.map +1 -0
- package/dist/templates/configs/mail.js +33 -0
- package/dist/templates/configs/mail.js.map +1 -0
- package/dist/templates/configs/passport.d.ts +2 -0
- package/dist/templates/configs/passport.d.ts.map +1 -0
- package/dist/templates/configs/passport.js +22 -0
- package/dist/templates/configs/passport.js.map +1 -0
- package/dist/templates/configs/pennant.d.ts +2 -0
- package/dist/templates/configs/pennant.d.ts.map +1 -0
- package/dist/templates/configs/pennant.js +16 -0
- package/dist/templates/configs/pennant.js.map +1 -0
- package/dist/templates/configs/pulse.d.ts +2 -0
- package/dist/templates/configs/pulse.d.ts.map +1 -0
- package/dist/templates/configs/pulse.js +21 -0
- package/dist/templates/configs/pulse.js.map +1 -0
- package/dist/templates/configs/queue.d.ts +2 -0
- package/dist/templates/configs/queue.d.ts.map +1 -0
- package/dist/templates/configs/queue.js +28 -0
- package/dist/templates/configs/queue.js.map +1 -0
- package/dist/templates/configs/sanctum.d.ts +2 -0
- package/dist/templates/configs/sanctum.d.ts.map +1 -0
- package/dist/templates/configs/sanctum.js +19 -0
- package/dist/templates/configs/sanctum.js.map +1 -0
- package/dist/templates/configs/server.d.ts +2 -0
- package/dist/templates/configs/server.d.ts.map +1 -0
- package/dist/templates/configs/server.js +15 -0
- package/dist/templates/configs/server.js.map +1 -0
- package/dist/templates/configs/session.d.ts +2 -0
- package/dist/templates/configs/session.d.ts.map +1 -0
- package/dist/templates/configs/session.js +26 -0
- package/dist/templates/configs/session.js.map +1 -0
- package/dist/templates/configs/socialite.d.ts +2 -0
- package/dist/templates/configs/socialite.d.ts.map +1 -0
- package/dist/templates/configs/socialite.js +27 -0
- package/dist/templates/configs/socialite.js.map +1 -0
- package/dist/templates/configs/storage.d.ts +2 -0
- package/dist/templates/configs/storage.d.ts.map +1 -0
- package/dist/templates/configs/storage.js +35 -0
- package/dist/templates/configs/storage.js.map +1 -0
- package/dist/templates/configs/sync.d.ts +3 -0
- package/dist/templates/configs/sync.d.ts.map +1 -0
- package/dist/templates/configs/sync.js +17 -0
- package/dist/templates/configs/sync.js.map +1 -0
- package/dist/templates/configs/telescope.d.ts +2 -0
- package/dist/templates/configs/telescope.d.ts.map +1 -0
- package/dist/templates/configs/telescope.js +25 -0
- package/dist/templates/configs/telescope.js.map +1 -0
- package/dist/templates/css/index.d.ts +3 -0
- package/dist/templates/css/index.d.ts.map +1 -0
- package/dist/templates/css/index.js +140 -0
- package/dist/templates/css/index.js.map +1 -0
- package/dist/templates/css/plain.d.ts +2 -0
- package/dist/templates/css/plain.d.ts.map +1 -0
- package/dist/templates/css/plain.js +373 -0
- package/dist/templates/css/plain.js.map +1 -0
- package/dist/templates/css/tailwind.d.ts +2 -0
- package/dist/templates/css/tailwind.d.ts.map +1 -0
- package/dist/templates/css/tailwind.js +176 -0
- package/dist/templates/css/tailwind.js.map +1 -0
- package/dist/templates/env.d.ts +7 -0
- package/dist/templates/env.d.ts.map +1 -0
- package/dist/templates/env.js +113 -0
- package/dist/templates/env.js.map +1 -0
- package/dist/templates/package-json.d.ts +3 -0
- package/dist/templates/package-json.d.ts.map +1 -0
- package/dist/templates/package-json.js +204 -0
- package/dist/templates/package-json.js.map +1 -0
- package/dist/templates/package-managers.d.ts +14 -0
- package/dist/templates/package-managers.d.ts.map +1 -0
- package/dist/templates/package-managers.js +49 -0
- package/dist/templates/package-managers.js.map +1 -0
- package/dist/templates/pages/ai-chat.d.ts +7 -0
- package/dist/templates/pages/ai-chat.d.ts.map +1 -0
- package/dist/templates/pages/ai-chat.js +285 -0
- package/dist/templates/pages/ai-chat.js.map +1 -0
- package/dist/templates/pages/demo.d.ts +4 -0
- package/dist/templates/pages/demo.d.ts.map +1 -0
- package/dist/templates/pages/demo.js +71 -0
- package/dist/templates/pages/demo.js.map +1 -0
- package/dist/templates/pages/error.d.ts +7 -0
- package/dist/templates/pages/error.d.ts.map +1 -0
- package/dist/templates/pages/error.js +148 -0
- package/dist/templates/pages/error.js.map +1 -0
- package/dist/templates/pages/index.d.ts +22 -0
- package/dist/templates/pages/index.d.ts.map +1 -0
- package/dist/templates/pages/index.js +374 -0
- package/dist/templates/pages/index.js.map +1 -0
- package/dist/templates/prisma/auth.d.ts +2 -0
- package/dist/templates/prisma/auth.d.ts.map +1 -0
- package/dist/templates/prisma/auth.js +22 -0
- package/dist/templates/prisma/auth.js.map +1 -0
- package/dist/templates/prisma/base.d.ts +3 -0
- package/dist/templates/prisma/base.d.ts.map +1 -0
- package/dist/templates/prisma/base.js +14 -0
- package/dist/templates/prisma/base.js.map +1 -0
- package/dist/templates/prisma/config.d.ts +3 -0
- package/dist/templates/prisma/config.d.ts.map +1 -0
- package/dist/templates/prisma/config.js +15 -0
- package/dist/templates/prisma/config.js.map +1 -0
- package/dist/templates/prisma/notification.d.ts +2 -0
- package/dist/templates/prisma/notification.d.ts.map +1 -0
- package/dist/templates/prisma/notification.js +16 -0
- package/dist/templates/prisma/notification.js.map +1 -0
- package/dist/templates/prisma/passport.d.ts +2 -0
- package/dist/templates/prisma/passport.d.ts.map +1 -0
- package/dist/templates/prisma/passport.js +69 -0
- package/dist/templates/prisma/passport.js.map +1 -0
- package/dist/templates/routes/api.d.ts +3 -0
- package/dist/templates/routes/api.d.ts.map +1 -0
- package/dist/templates/routes/api.js +76 -0
- package/dist/templates/routes/api.js.map +1 -0
- package/dist/templates/routes/console.d.ts +3 -0
- package/dist/templates/routes/console.d.ts.map +1 -0
- package/dist/templates/routes/console.js +29 -0
- package/dist/templates/routes/console.js.map +1 -0
- package/dist/templates/routes/web.d.ts +4 -0
- package/dist/templates/routes/web.d.ts.map +1 -0
- package/dist/templates/routes/web.js +77 -0
- package/dist/templates/routes/web.js.map +1 -0
- package/dist/templates/routes-manifest.d.ts +28 -0
- package/dist/templates/routes-manifest.d.ts.map +1 -0
- package/dist/templates/routes-manifest.js +48 -0
- package/dist/templates/routes-manifest.js.map +1 -0
- package/dist/templates/server.d.ts +2 -0
- package/dist/templates/server.d.ts.map +1 -0
- package/dist/templates/server.js +10 -0
- package/dist/templates/server.js.map +1 -0
- package/dist/templates/tsconfig.d.ts +3 -0
- package/dist/templates/tsconfig.d.ts.map +1 -0
- package/dist/templates/tsconfig.js +33 -0
- package/dist/templates/tsconfig.js.map +1 -0
- package/dist/templates/views/welcome.d.ts +19 -0
- package/dist/templates/views/welcome.d.ts.map +1 -0
- package/dist/templates/views/welcome.js +338 -0
- package/dist/templates/views/welcome.js.map +1 -0
- package/dist/templates/vite.d.ts +3 -0
- package/dist/templates/vite.d.ts.map +1 -0
- package/dist/templates/vite.js +66 -0
- package/dist/templates/vite.js.map +1 -0
- package/dist/templates.d.ts +45 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +202 -0
- package/dist/templates.js.map +1 -0
- package/package.json +27 -7
- package/bin/index.mjs +0 -18
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
export function welcomeView(ctx) {
|
|
2
|
+
if (ctx.frameworks.length === 0)
|
|
3
|
+
return welcomeViewVanilla(ctx);
|
|
4
|
+
switch (ctx.primary) {
|
|
5
|
+
case 'vue': return welcomeViewVue(ctx);
|
|
6
|
+
case 'solid': return welcomeViewSolid(ctx);
|
|
7
|
+
default: return welcomeViewReact(ctx);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Vanilla welcome view for no-frontend recipes (api-service, minimal).
|
|
12
|
+
*
|
|
13
|
+
* Returns a SafeString built with @rudderjs/view's html`` tagged template
|
|
14
|
+
* (zero-client-JS, server-rendered HTML). No React/Vue/Solid imports → no
|
|
15
|
+
* vike-* renderer required. The @rudderjs/vite view scanner detects the
|
|
16
|
+
* .ts extension + no installed vike-renderer and generates the matching
|
|
17
|
+
* `pages/__view/welcome/+Page.ts` stub that returns the Page as a string.
|
|
18
|
+
*
|
|
19
|
+
* `pages/+config.ts` wraps the page's body in an `onRenderHtml` hook —
|
|
20
|
+
* see `templates/pages/index.ts` for the vanilla shell.
|
|
21
|
+
*/
|
|
22
|
+
export function welcomeViewVanilla(_ctx) {
|
|
23
|
+
return `import { html } from '@rudderjs/view'
|
|
24
|
+
|
|
25
|
+
// URL this view is served at — MUST match the Route.get('/', ...) in routes/web.ts.
|
|
26
|
+
export const route = '/'
|
|
27
|
+
|
|
28
|
+
export interface WelcomeProps {
|
|
29
|
+
appName: string
|
|
30
|
+
rudderVersion: string
|
|
31
|
+
nodeVersion: string
|
|
32
|
+
env: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default function Welcome(props: WelcomeProps) {
|
|
36
|
+
return html\`<main class="page">
|
|
37
|
+
<section class="hero">
|
|
38
|
+
<h1>\${props.appName}</h1>
|
|
39
|
+
<p>
|
|
40
|
+
Laravel's developer experience, Vike's performance, Node's ecosystem.
|
|
41
|
+
This is a no-frontend scaffold — every request is served by a controller in <code>routes/api.ts</code>.
|
|
42
|
+
</p>
|
|
43
|
+
<p>
|
|
44
|
+
<small>RudderJS v\${props.rudderVersion} · Node \${props.nodeVersion} · env=\${props.env}</small>
|
|
45
|
+
</p>
|
|
46
|
+
</section>
|
|
47
|
+
<section>
|
|
48
|
+
<h2>Try the API</h2>
|
|
49
|
+
<ul>
|
|
50
|
+
<li><a href="/api/health"><code>GET /api/health</code></a> — health probe</li>
|
|
51
|
+
</ul>
|
|
52
|
+
</section>
|
|
53
|
+
<footer>
|
|
54
|
+
Built with RudderJS. Edit <code>app/Views/Welcome.ts</code> to customize this page,
|
|
55
|
+
or delete it and rely on <code>/api/*</code> only.
|
|
56
|
+
<br />
|
|
57
|
+
<small>Something not working? Run <code>pnpm rudder doctor</code> for a green/yellow/red checkup.</small>
|
|
58
|
+
</footer>
|
|
59
|
+
</main>\`
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
const WELCOME_FEATURES = `const DEFAULT_DOCS = 'https://github.com/rudderjs/rudder'
|
|
64
|
+
const DEFAULT_GITHUB = 'https://github.com/rudderjs/rudder'
|
|
65
|
+
|
|
66
|
+
const features: Feature[] = [
|
|
67
|
+
{
|
|
68
|
+
title: 'Controllers & Routing',
|
|
69
|
+
description: 'Explicit routes in routes/api.ts with middleware, params, named routes, and return types that just work.',
|
|
70
|
+
href: \`\${DEFAULT_DOCS}#routing\`,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: 'Eloquent ORM',
|
|
74
|
+
description: 'Laravel-style models on Prisma or Drizzle. Query relationships, scopes, and eager loading without changing mental models.',
|
|
75
|
+
href: \`\${DEFAULT_DOCS}#orm\`,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'Controller Views',
|
|
79
|
+
description: "The page you're looking at — return view() from a controller, rendered through Vike SSR. Zero adapter, full SPA nav.",
|
|
80
|
+
href: \`\${DEFAULT_DOCS}#views\`,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: 'Rudder CLI',
|
|
84
|
+
description: 'Laravel-style make:* generators, schedule, db:seed, and custom commands. Run \\\`pnpm rudder\\\` for the full list.',
|
|
85
|
+
href: \`\${DEFAULT_DOCS}#cli\`,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: 'Queues & Jobs',
|
|
89
|
+
description: 'Dispatch background jobs with sync, database, or Redis drivers. Monitor them with @rudderjs/horizon.',
|
|
90
|
+
href: \`\${DEFAULT_DOCS}#queue\`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'Auth, Guards, Policies',
|
|
94
|
+
description: 'Session-backed auth, password reset, gates, and RequireAuth / RequireGuest middleware — all through one provider.',
|
|
95
|
+
href: \`\${DEFAULT_DOCS}#auth\`,
|
|
96
|
+
},
|
|
97
|
+
]`;
|
|
98
|
+
export function welcomeViewReact(_ctx) {
|
|
99
|
+
return `import '@/index.css'
|
|
100
|
+
import { SiteHeader } from 'App/Components/SiteHeader.js'
|
|
101
|
+
|
|
102
|
+
// URL this view is served at — MUST match the Route.get('/', ...) in routes/web.ts.
|
|
103
|
+
// The scanner reads this constant and writes it into the generated +route.ts,
|
|
104
|
+
// so Vike's client router can SPA-navigate here instead of doing full reloads.
|
|
105
|
+
export const route = '/'
|
|
106
|
+
|
|
107
|
+
export interface WelcomeProps {
|
|
108
|
+
appName: string
|
|
109
|
+
rudderVersion: string
|
|
110
|
+
nodeVersion: string
|
|
111
|
+
env: string
|
|
112
|
+
docsUrl?: string
|
|
113
|
+
githubUrl?: string
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface Feature {
|
|
117
|
+
title: string
|
|
118
|
+
description: string
|
|
119
|
+
href: string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${WELCOME_FEATURES}
|
|
123
|
+
|
|
124
|
+
export default function Welcome(props: WelcomeProps) {
|
|
125
|
+
const docsUrl = props.docsUrl ?? DEFAULT_DOCS
|
|
126
|
+
const githubUrl = props.githubUrl ?? DEFAULT_GITHUB
|
|
127
|
+
|
|
128
|
+
return (
|
|
129
|
+
<div className="page">
|
|
130
|
+
<SiteHeader />
|
|
131
|
+
|
|
132
|
+
<section className="hero">
|
|
133
|
+
<h1 className="hero-title">{props.appName}</h1>
|
|
134
|
+
<p className="hero-lead">
|
|
135
|
+
Laravel's developer experience, Vike's performance, Node's ecosystem.
|
|
136
|
+
This page is served by a controller, rendered through{' '}
|
|
137
|
+
<code className="inline-code">view('welcome')</code>.
|
|
138
|
+
</p>
|
|
139
|
+
<div className="hero-meta">
|
|
140
|
+
<span>RudderJS v{props.rudderVersion}</span>
|
|
141
|
+
<span>•</span>
|
|
142
|
+
<span>Node {props.nodeVersion}</span>
|
|
143
|
+
<span>•</span>
|
|
144
|
+
<span>env={props.env}</span>
|
|
145
|
+
</div>
|
|
146
|
+
</section>
|
|
147
|
+
|
|
148
|
+
<section className="feature-section">
|
|
149
|
+
<div className="feature-grid">
|
|
150
|
+
{features.map(f => (
|
|
151
|
+
<a key={f.title} href={f.href} className="feature-card">
|
|
152
|
+
<h3 className="feature-title">{f.title}</h3>
|
|
153
|
+
<p className="feature-desc">{f.description}</p>
|
|
154
|
+
</a>
|
|
155
|
+
))}
|
|
156
|
+
</div>
|
|
157
|
+
</section>
|
|
158
|
+
|
|
159
|
+
<footer className="page-footer">
|
|
160
|
+
<div className="footer-inner">
|
|
161
|
+
<div>
|
|
162
|
+
Built with RudderJS. Edit <code>app/Views/Welcome.tsx</code> to customize this page.<br />
|
|
163
|
+
<small>Something not working? Run <code>pnpm rudder doctor</code> for a green/yellow/red checkup.</small>
|
|
164
|
+
</div>
|
|
165
|
+
<div className="footer-links">
|
|
166
|
+
<a href={docsUrl} className="footer-link">Docs</a>
|
|
167
|
+
<a href={githubUrl} className="footer-link">GitHub</a>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</footer>
|
|
171
|
+
</div>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
export function welcomeViewVue(_ctx) {
|
|
177
|
+
// Vue SFC quirk: top-level `export` statements must live in a regular
|
|
178
|
+
// <script> block, NOT <script setup> (the compiler rejects exports there).
|
|
179
|
+
// The scanner reads both blocks as plain text, so the route override is
|
|
180
|
+
// still picked up. Keep this dual-script structure whenever a Vue view
|
|
181
|
+
// needs `export const route = '/...'`.
|
|
182
|
+
return `<script lang="ts">
|
|
183
|
+
// URL this view is served at — see the React variant for rationale.
|
|
184
|
+
export const route = '/'
|
|
185
|
+
</script>
|
|
186
|
+
|
|
187
|
+
<script setup lang="ts">
|
|
188
|
+
import '@/index.css'
|
|
189
|
+
import SiteHeader from 'App/Components/SiteHeader.vue'
|
|
190
|
+
|
|
191
|
+
export interface WelcomeProps {
|
|
192
|
+
appName: string
|
|
193
|
+
rudderVersion: string
|
|
194
|
+
nodeVersion: string
|
|
195
|
+
env: string
|
|
196
|
+
docsUrl?: string
|
|
197
|
+
githubUrl?: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const props = defineProps<WelcomeProps>()
|
|
201
|
+
|
|
202
|
+
interface Feature {
|
|
203
|
+
title: string
|
|
204
|
+
description: string
|
|
205
|
+
href: string
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
${WELCOME_FEATURES}
|
|
209
|
+
|
|
210
|
+
const docsUrl = props.docsUrl ?? DEFAULT_DOCS
|
|
211
|
+
const githubUrl = props.githubUrl ?? DEFAULT_GITHUB
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
<template>
|
|
215
|
+
<div class="page">
|
|
216
|
+
<SiteHeader />
|
|
217
|
+
|
|
218
|
+
<section class="hero">
|
|
219
|
+
<h1 class="hero-title">{{ props.appName }}</h1>
|
|
220
|
+
<p class="hero-lead">
|
|
221
|
+
Laravel's developer experience, Vike's performance, Node's ecosystem.
|
|
222
|
+
This page is served by a controller, rendered through
|
|
223
|
+
<code class="inline-code">view('welcome')</code>.
|
|
224
|
+
</p>
|
|
225
|
+
<div class="hero-meta">
|
|
226
|
+
<span>RudderJS v{{ props.rudderVersion }}</span>
|
|
227
|
+
<span>•</span>
|
|
228
|
+
<span>Node {{ props.nodeVersion }}</span>
|
|
229
|
+
<span>•</span>
|
|
230
|
+
<span>env={{ props.env }}</span>
|
|
231
|
+
</div>
|
|
232
|
+
</section>
|
|
233
|
+
|
|
234
|
+
<section class="feature-section">
|
|
235
|
+
<div class="feature-grid">
|
|
236
|
+
<a v-for="f in features" :key="f.title" :href="f.href" class="feature-card">
|
|
237
|
+
<h3 class="feature-title">{{ f.title }}</h3>
|
|
238
|
+
<p class="feature-desc">{{ f.description }}</p>
|
|
239
|
+
</a>
|
|
240
|
+
</div>
|
|
241
|
+
</section>
|
|
242
|
+
|
|
243
|
+
<footer class="page-footer">
|
|
244
|
+
<div class="footer-inner">
|
|
245
|
+
<div>
|
|
246
|
+
Built with RudderJS. Edit <code>app/Views/Welcome.vue</code> to customize this page.<br />
|
|
247
|
+
<small>Something not working? Run <code>pnpm rudder doctor</code> for a green/yellow/red checkup.</small>
|
|
248
|
+
</div>
|
|
249
|
+
<div class="footer-links">
|
|
250
|
+
<a :href="docsUrl" class="footer-link">Docs</a>
|
|
251
|
+
<a :href="githubUrl" class="footer-link">GitHub</a>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</footer>
|
|
255
|
+
</div>
|
|
256
|
+
</template>
|
|
257
|
+
`;
|
|
258
|
+
}
|
|
259
|
+
export function welcomeViewSolid(_ctx) {
|
|
260
|
+
return `import '@/index.css'
|
|
261
|
+
import { For } from 'solid-js'
|
|
262
|
+
import { SiteHeader } from 'App/Components/SiteHeader.js'
|
|
263
|
+
|
|
264
|
+
// URL this view is served at — see the React variant for rationale.
|
|
265
|
+
export const route = '/'
|
|
266
|
+
|
|
267
|
+
export interface WelcomeProps {
|
|
268
|
+
appName: string
|
|
269
|
+
rudderVersion: string
|
|
270
|
+
nodeVersion: string
|
|
271
|
+
env: string
|
|
272
|
+
docsUrl?: string
|
|
273
|
+
githubUrl?: string
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
interface Feature {
|
|
277
|
+
title: string
|
|
278
|
+
description: string
|
|
279
|
+
href: string
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
${WELCOME_FEATURES}
|
|
283
|
+
|
|
284
|
+
export default function Welcome(props: WelcomeProps) {
|
|
285
|
+
const docsUrl = () => props.docsUrl ?? DEFAULT_DOCS
|
|
286
|
+
const githubUrl = () => props.githubUrl ?? DEFAULT_GITHUB
|
|
287
|
+
|
|
288
|
+
return (
|
|
289
|
+
<div class="page">
|
|
290
|
+
<SiteHeader />
|
|
291
|
+
|
|
292
|
+
<section class="hero">
|
|
293
|
+
<h1 class="hero-title">{props.appName}</h1>
|
|
294
|
+
<p class="hero-lead">
|
|
295
|
+
Laravel's developer experience, Vike's performance, Node's ecosystem.
|
|
296
|
+
This page is served by a controller, rendered through{' '}
|
|
297
|
+
<code class="inline-code">view('welcome')</code>.
|
|
298
|
+
</p>
|
|
299
|
+
<div class="hero-meta">
|
|
300
|
+
<span>RudderJS v{props.rudderVersion}</span>
|
|
301
|
+
<span>•</span>
|
|
302
|
+
<span>Node {props.nodeVersion}</span>
|
|
303
|
+
<span>•</span>
|
|
304
|
+
<span>env={props.env}</span>
|
|
305
|
+
</div>
|
|
306
|
+
</section>
|
|
307
|
+
|
|
308
|
+
<section class="feature-section">
|
|
309
|
+
<div class="feature-grid">
|
|
310
|
+
<For each={features}>
|
|
311
|
+
{(f) => (
|
|
312
|
+
<a href={f.href} class="feature-card">
|
|
313
|
+
<h3 class="feature-title">{f.title}</h3>
|
|
314
|
+
<p class="feature-desc">{f.description}</p>
|
|
315
|
+
</a>
|
|
316
|
+
)}
|
|
317
|
+
</For>
|
|
318
|
+
</div>
|
|
319
|
+
</section>
|
|
320
|
+
|
|
321
|
+
<footer class="page-footer">
|
|
322
|
+
<div class="footer-inner">
|
|
323
|
+
<div>
|
|
324
|
+
Built with RudderJS. Edit <code>app/Views/Welcome.tsx</code> to customize this page.<br />
|
|
325
|
+
<small>Something not working? Run <code>pnpm rudder doctor</code> for a green/yellow/red checkup.</small>
|
|
326
|
+
</div>
|
|
327
|
+
<div class="footer-links">
|
|
328
|
+
<a href={docsUrl()} class="footer-link">Docs</a>
|
|
329
|
+
<a href={githubUrl()} class="footer-link">GitHub</a>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
332
|
+
</footer>
|
|
333
|
+
</div>
|
|
334
|
+
)
|
|
335
|
+
}
|
|
336
|
+
`;
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=welcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../src/templates/views/welcome.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAA;IAC/D,QAAQ,GAAG,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,KAAK,CAAC,CAAG,OAAO,cAAc,CAAC,GAAG,CAAC,CAAA;QACxC,KAAK,OAAO,CAAC,CAAC,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAA;QAC1C,OAAO,CAAC,CAAM,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACtD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCR,CAAA;AACD,CAAC;AAED,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCvB,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAuBP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDjB,CAAA;AACD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAqB;IAClD,sEAAsE;IACtE,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,uCAAuC;IACvC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDjB,CAAA;AACD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;EAsBP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAA;AACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../src/templates/vite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,wBAAgB,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CA8DvD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export function viteConfig(ctx) {
|
|
2
|
+
const { frameworks, primary, tailwind } = ctx;
|
|
3
|
+
const hasReact = frameworks.includes('react');
|
|
4
|
+
const hasVue = frameworks.includes('vue');
|
|
5
|
+
const hasSolid = frameworks.includes('solid');
|
|
6
|
+
const hasReactSolidConflict = hasReact && hasSolid;
|
|
7
|
+
const imports = [
|
|
8
|
+
`import { defineConfig } from 'vite'`,
|
|
9
|
+
`import vike from 'vike/plugin'`,
|
|
10
|
+
`import rudderjs from '@rudderjs/vite'`,
|
|
11
|
+
];
|
|
12
|
+
if (tailwind)
|
|
13
|
+
imports.push(`import tailwindcss from '@tailwindcss/vite'`);
|
|
14
|
+
if (hasReact)
|
|
15
|
+
imports.push(`import react from '@vitejs/plugin-react'`);
|
|
16
|
+
if (hasVue)
|
|
17
|
+
imports.push(`import vue from '@vitejs/plugin-vue'`);
|
|
18
|
+
if (hasSolid)
|
|
19
|
+
imports.push(`import solid from 'vike-solid/vite'`);
|
|
20
|
+
// `rudderjs()` BEFORE `vike()` — the views-scanner writes auto-generated
|
|
21
|
+
// stubs to `pages/__view/` during plugin construction, and Vike scans
|
|
22
|
+
// `pages/` during its own construction, so the stubs must exist before
|
|
23
|
+
// `vike()` is called.
|
|
24
|
+
const plugins = ['rudderjs()', 'vike()'];
|
|
25
|
+
if (tailwind)
|
|
26
|
+
plugins.push('tailwindcss()');
|
|
27
|
+
if (hasReact) {
|
|
28
|
+
if (hasReactSolidConflict) {
|
|
29
|
+
if (primary === 'react') {
|
|
30
|
+
plugins.push(`react({ exclude: ['**/pages/solid-demo/**'] })`);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
plugins.push(`react({ include: ['**/pages/react-demo/**'] })`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
plugins.push('react()');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (hasVue) {
|
|
41
|
+
plugins.push('vue()');
|
|
42
|
+
}
|
|
43
|
+
if (hasSolid) {
|
|
44
|
+
if (hasReactSolidConflict) {
|
|
45
|
+
if (primary === 'solid') {
|
|
46
|
+
plugins.push(`solid({ exclude: ['**/pages/react-demo/**'] })`);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
plugins.push(`solid({ include: ['**/pages/solid-demo/**'] })`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
plugins.push('solid()');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const pluginsStr = plugins.map(p => ` ${p},`).join('\n');
|
|
57
|
+
return `${imports.join('\n')}
|
|
58
|
+
|
|
59
|
+
export default defineConfig({
|
|
60
|
+
plugins: [
|
|
61
|
+
${pluginsStr}
|
|
62
|
+
],
|
|
63
|
+
})
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=vite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../../src/templates/vite.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,UAAU,CAAC,GAAoB;IAC7C,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IAC7C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC7C,MAAM,MAAM,GAAK,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC7C,MAAM,qBAAqB,GAAG,QAAQ,IAAI,QAAQ,CAAA;IAElD,MAAM,OAAO,GAAa;QACxB,qCAAqC;QACrC,gCAAgC;QAChC,uCAAuC;KACxC,CAAA;IACD,IAAI,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAA;IACzE,IAAI,QAAQ;QAAG,OAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;IACvE,IAAI,MAAM;QAAK,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAA;IACnE,IAAI,QAAQ;QAAG,OAAO,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAA;IAElE,yEAAyE;IACzE,sEAAsE;IACtE,uEAAuE;IACvE,sBAAsB;IACtB,MAAM,OAAO,GAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;IAClD,IAAI,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAE3C,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,qBAAqB,EAAE,CAAC;YAC1B,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAChE,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAChE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACzB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACvB,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,qBAAqB,EAAE,CAAC;YAC1B,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAChE,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAChE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACzB,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAE3D,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;;;;EAI5B,UAAU;;;CAGX,CAAA;AACD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { detectPackageManager, pmExec, pmInstall, pmRun, type PackageManager } from './templates/package-managers.js';
|
|
2
|
+
export { detectPackageManager, pmExec, pmInstall, pmRun };
|
|
3
|
+
export type { PackageManager };
|
|
4
|
+
export interface TemplateContext {
|
|
5
|
+
name: string;
|
|
6
|
+
db: 'sqlite' | 'postgresql' | 'mysql';
|
|
7
|
+
orm: 'prisma' | 'drizzle' | false;
|
|
8
|
+
authSecret: string;
|
|
9
|
+
/** Random base64-encoded 32-byte key for @rudderjs/crypt's APP_KEY. */
|
|
10
|
+
appKey: string;
|
|
11
|
+
frameworks: ('react' | 'vue' | 'solid')[];
|
|
12
|
+
primary: 'react' | 'vue' | 'solid';
|
|
13
|
+
tailwind: boolean;
|
|
14
|
+
shadcn: boolean;
|
|
15
|
+
pm: PackageManager;
|
|
16
|
+
packages: {
|
|
17
|
+
auth: boolean;
|
|
18
|
+
sanctum: boolean;
|
|
19
|
+
passport: boolean;
|
|
20
|
+
socialite: boolean;
|
|
21
|
+
queue: boolean;
|
|
22
|
+
storage: boolean;
|
|
23
|
+
scheduler: boolean;
|
|
24
|
+
image: boolean;
|
|
25
|
+
mail: boolean;
|
|
26
|
+
notifications: boolean;
|
|
27
|
+
broadcast: boolean;
|
|
28
|
+
sync: boolean;
|
|
29
|
+
ai: boolean;
|
|
30
|
+
mcp: boolean;
|
|
31
|
+
boost: boolean;
|
|
32
|
+
localization: boolean;
|
|
33
|
+
pennant: boolean;
|
|
34
|
+
telescope: boolean;
|
|
35
|
+
pulse: boolean;
|
|
36
|
+
horizon: boolean;
|
|
37
|
+
crypt: boolean;
|
|
38
|
+
http: boolean;
|
|
39
|
+
process: boolean;
|
|
40
|
+
concurrency: boolean;
|
|
41
|
+
terminal: boolean;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare function getTemplates(ctx: TemplateContext): Record<string, string>;
|
|
45
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAW,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAqD9H,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;AACzD,YAAY,EAAE,cAAc,EAAE,CAAA;AAE9B,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAQ,MAAM,CAAA;IAClB,EAAE,EAAU,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAA;IAC7C,GAAG,EAAS,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAA;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,MAAM,EAAM,MAAM,CAAA;IAClB,UAAU,EAAE,CAAC,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;IACzC,OAAO,EAAK,OAAO,GAAG,KAAK,GAAG,OAAO,CAAA;IACrC,QAAQ,EAAI,OAAO,CAAA;IACnB,MAAM,EAAM,OAAO,CAAA;IACnB,EAAE,EAAU,cAAc,CAAA;IAC1B,QAAQ,EAAE;QACR,IAAI,EAAW,OAAO,CAAA;QACtB,OAAO,EAAQ,OAAO,CAAA;QACtB,QAAQ,EAAO,OAAO,CAAA;QACtB,SAAS,EAAM,OAAO,CAAA;QACtB,KAAK,EAAU,OAAO,CAAA;QACtB,OAAO,EAAQ,OAAO,CAAA;QACtB,SAAS,EAAM,OAAO,CAAA;QACtB,KAAK,EAAU,OAAO,CAAA;QACtB,IAAI,EAAW,OAAO,CAAA;QACtB,aAAa,EAAE,OAAO,CAAA;QACtB,SAAS,EAAM,OAAO,CAAA;QACtB,IAAI,EAAW,OAAO,CAAA;QACtB,EAAE,EAAa,OAAO,CAAA;QACtB,GAAG,EAAY,OAAO,CAAA;QACtB,KAAK,EAAU,OAAO,CAAA;QACtB,YAAY,EAAG,OAAO,CAAA;QACtB,OAAO,EAAQ,OAAO,CAAA;QACtB,SAAS,EAAM,OAAO,CAAA;QACtB,KAAK,EAAU,OAAO,CAAA;QACtB,OAAO,EAAQ,OAAO,CAAA;QACtB,KAAK,EAAU,OAAO,CAAA;QACtB,IAAI,EAAW,OAAO,CAAA;QACtB,OAAO,EAAQ,OAAO,CAAA;QACtB,WAAW,EAAI,OAAO,CAAA;QACtB,QAAQ,EAAO,OAAO,CAAA;KACvB,CAAA;CACF;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmIzE"}
|