create-rudder-app 1.1.2 → 1.2.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/dist/cli-flags.d.ts +0 -9
- package/dist/cli-flags.d.ts.map +1 -1
- package/dist/cli-flags.js +0 -8
- package/dist/cli-flags.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/templates/app/service-provider.d.ts.map +1 -1
- package/dist/templates/app/service-provider.js +0 -15
- package/dist/templates/app/service-provider.js.map +1 -1
- package/dist/templates/components/site-header.d.ts.map +1 -1
- package/dist/templates/components/site-header.js +2 -8
- package/dist/templates/components/site-header.js.map +1 -1
- package/dist/templates/package-json.d.ts.map +1 -1
- package/dist/templates/package-json.js +4 -5
- package/dist/templates/package-json.js.map +1 -1
- package/dist/templates/pages/index.d.ts +13 -0
- package/dist/templates/pages/index.d.ts.map +1 -1
- package/dist/templates/pages/index.js +43 -0
- package/dist/templates/pages/index.js.map +1 -1
- package/dist/templates/routes/api.d.ts.map +1 -1
- package/dist/templates/routes/api.js +0 -99
- package/dist/templates/routes/api.js.map +1 -1
- package/dist/templates/routes/web.d.ts.map +1 -1
- package/dist/templates/routes/web.js +10 -83
- package/dist/templates/routes/web.js.map +1 -1
- package/dist/templates/routes-manifest.d.ts +2 -2
- package/dist/templates/routes-manifest.d.ts.map +1 -1
- package/dist/templates/routes-manifest.js +19 -22
- package/dist/templates/routes-manifest.js.map +1 -1
- package/dist/templates/views/welcome.d.ts +13 -0
- package/dist/templates/views/welcome.d.ts.map +1 -1
- package/dist/templates/views/welcome.js +53 -0
- package/dist/templates/views/welcome.js.map +1 -1
- package/dist/templates.d.ts +0 -9
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +38 -120
- package/dist/templates.js.map +1 -1
- package/package.json +1 -5
- package/dist/templates/demos/avatar.d.ts +0 -3
- package/dist/templates/demos/avatar.d.ts.map +0 -1
- package/dist/templates/demos/avatar.js +0 -174
- package/dist/templates/demos/avatar.js.map +0 -1
- package/dist/templates/demos/cache.d.ts +0 -3
- package/dist/templates/demos/cache.d.ts.map +0 -1
- package/dist/templates/demos/cache.js +0 -91
- package/dist/templates/demos/cache.js.map +0 -1
- package/dist/templates/demos/contact.d.ts +0 -3
- package/dist/templates/demos/contact.d.ts.map +0 -1
- package/dist/templates/demos/contact.js +0 -99
- package/dist/templates/demos/contact.js.map +0 -1
- package/dist/templates/demos/fibonacci.d.ts +0 -7
- package/dist/templates/demos/fibonacci.d.ts.map +0 -1
- package/dist/templates/demos/fibonacci.js +0 -164
- package/dist/templates/demos/fibonacci.js.map +0 -1
- package/dist/templates/demos/http.d.ts +0 -3
- package/dist/templates/demos/http.d.ts.map +0 -1
- package/dist/templates/demos/http.js +0 -109
- package/dist/templates/demos/http.js.map +0 -1
- package/dist/templates/demos/index-view.d.ts +0 -3
- package/dist/templates/demos/index-view.d.ts.map +0 -1
- package/dist/templates/demos/index-view.js +0 -47
- package/dist/templates/demos/index-view.js.map +0 -1
- package/dist/templates/demos/localization.d.ts +0 -4
- package/dist/templates/demos/localization.d.ts.map +0 -1
- package/dist/templates/demos/localization.js +0 -122
- package/dist/templates/demos/localization.js.map +0 -1
- package/dist/templates/demos/mail.d.ts +0 -4
- package/dist/templates/demos/mail.d.ts.map +0 -1
- package/dist/templates/demos/mail.js +0 -119
- package/dist/templates/demos/mail.js.map +0 -1
- package/dist/templates/demos/notifications.d.ts +0 -4
- package/dist/templates/demos/notifications.d.ts.map +0 -1
- package/dist/templates/demos/notifications.js +0 -125
- package/dist/templates/demos/notifications.js.map +0 -1
- package/dist/templates/demos/pennant.d.ts +0 -8
- package/dist/templates/demos/pennant.d.ts.map +0 -1
- package/dist/templates/demos/pennant.js +0 -135
- package/dist/templates/demos/pennant.js.map +0 -1
- package/dist/templates/demos/polymorphic.d.ts +0 -19
- package/dist/templates/demos/polymorphic.d.ts.map +0 -1
- package/dist/templates/demos/polymorphic.js +0 -663
- package/dist/templates/demos/polymorphic.js.map +0 -1
- package/dist/templates/demos/queue.d.ts +0 -4
- package/dist/templates/demos/queue.d.ts.map +0 -1
- package/dist/templates/demos/queue.js +0 -99
- package/dist/templates/demos/queue.js.map +0 -1
- package/dist/templates/demos/registry.d.ts +0 -26
- package/dist/templates/demos/registry.d.ts.map +0 -1
- package/dist/templates/demos/registry.js +0 -140
- package/dist/templates/demos/registry.js.map +0 -1
- package/dist/templates/demos/rudder-socket.d.ts +0 -2
- package/dist/templates/demos/rudder-socket.d.ts.map +0 -1
- package/dist/templates/demos/rudder-socket.js +0 -95
- package/dist/templates/demos/rudder-socket.js.map +0 -1
- package/dist/templates/demos/sync.d.ts +0 -2
- package/dist/templates/demos/sync.d.ts.map +0 -1
- package/dist/templates/demos/sync.js +0 -90
- package/dist/templates/demos/sync.js.map +0 -1
- package/dist/templates/demos/system-info.d.ts +0 -3
- package/dist/templates/demos/system-info.d.ts.map +0 -1
- package/dist/templates/demos/system-info.js +0 -134
- package/dist/templates/demos/system-info.js.map +0 -1
- package/dist/templates/demos/todos.d.ts +0 -6
- package/dist/templates/demos/todos.d.ts.map +0 -1
- package/dist/templates/demos/todos.js +0 -238
- package/dist/templates/demos/todos.js.map +0 -1
- package/dist/templates/demos/ws.d.ts +0 -2
- package/dist/templates/demos/ws.d.ts.map +0 -1
- package/dist/templates/demos/ws.js +0 -99
- package/dist/templates/demos/ws.js.map +0 -1
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { shouldScaffoldAnyDemo, shouldScaffoldDemo } from '../../templates.js';
|
|
2
|
-
import { demosFibonacciApiBlock } from '../demos/fibonacci.js';
|
|
3
|
-
import { demosSystemInfoApiBlock } from '../demos/system-info.js';
|
|
4
|
-
import { demosAvatarApiBlock } from '../demos/avatar.js';
|
|
5
|
-
import { demosCacheApiBlock } from '../demos/cache.js';
|
|
6
|
-
import { demosQueueApiBlock } from '../demos/queue.js';
|
|
7
|
-
import { demosMailApiBlock } from '../demos/mail.js';
|
|
8
|
-
import { demosNotificationsApiBlock } from '../demos/notifications.js';
|
|
9
|
-
import { demosLocalizationApiBlock } from '../demos/localization.js';
|
|
10
|
-
import { demosHttpApiBlock } from '../demos/http.js';
|
|
11
|
-
import { demosPolymorphicApiBlock } from '../demos/polymorphic.js';
|
|
12
1
|
export function routesApi(ctx) {
|
|
13
2
|
const imports = [
|
|
14
3
|
"import { router } from '@rudderjs/router'",
|
|
@@ -79,94 +68,6 @@ router.get('/api/passport/me', async (req, res) => {
|
|
|
79
68
|
})
|
|
80
69
|
}, [RequireBearer(), scope('read')])`);
|
|
81
70
|
}
|
|
82
|
-
if (shouldScaffoldAnyDemo(ctx)) {
|
|
83
|
-
const wantContact = shouldScaffoldDemo(ctx, 'contact');
|
|
84
|
-
const wantWs = shouldScaffoldDemo(ctx, 'ws');
|
|
85
|
-
const wantFibonacci = shouldScaffoldDemo(ctx, 'fibonacci');
|
|
86
|
-
const wantSystemInfo = shouldScaffoldDemo(ctx, 'system-info');
|
|
87
|
-
const wantAvatar = shouldScaffoldDemo(ctx, 'avatar');
|
|
88
|
-
if (wantContact)
|
|
89
|
-
imports.push(`import { z } from '@rudderjs/core'`);
|
|
90
|
-
if (wantContact && ctx.packages.auth)
|
|
91
|
-
imports.push(`import { CsrfMiddleware } from '@rudderjs/middleware'`);
|
|
92
|
-
if (wantWs)
|
|
93
|
-
imports.push(`import { broadcast, broadcastStats } from '@rudderjs/broadcast'`);
|
|
94
|
-
lines.push('');
|
|
95
|
-
lines.push(`// ── Demos ────────────────────────────────────────────────`);
|
|
96
|
-
if (wantContact) {
|
|
97
|
-
lines.push(`// POST /api/contact — Zod validation${ctx.packages.auth ? ' + CSRF' : ''}.
|
|
98
|
-
const contactSchema = z.object({
|
|
99
|
-
name: z.string().min(2, 'Name must be at least 2 characters.'),
|
|
100
|
-
email: z.string().email('Please enter a valid email address.'),
|
|
101
|
-
message: z.string().min(10, 'Message must be at least 10 characters.'),
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
router.post('/api/contact', async (req, res) => {
|
|
105
|
-
const result = contactSchema.safeParse(req.body)
|
|
106
|
-
if (!result.success) {
|
|
107
|
-
const errors = Object.fromEntries(result.error.issues.map(i => [i.path[0], i.message]))
|
|
108
|
-
return res.status(422).json({ errors })
|
|
109
|
-
}
|
|
110
|
-
return res.json({ ok: true, message: \`Thanks \${result.data.name}, your message has been received!\` })
|
|
111
|
-
}${ctx.packages.auth ? ', [CsrfMiddleware()]' : ''})`);
|
|
112
|
-
}
|
|
113
|
-
if (wantWs) {
|
|
114
|
-
lines.push('');
|
|
115
|
-
lines.push(`// POST /api/ws/broadcast — push a chat message to subscribers of the 'chat' channel.
|
|
116
|
-
router.post('/api/ws/broadcast', async (req, res) => {
|
|
117
|
-
const { user, text } = req.body as { user: string; text: string }
|
|
118
|
-
broadcast('chat', 'message', { user, text, ts: Date.now() })
|
|
119
|
-
res.json({ ok: true })
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
// GET /api/ws/ping — current connection / channel counts.
|
|
123
|
-
router.get('/api/ws/ping', (_req, res) => res.json(broadcastStats()))`);
|
|
124
|
-
}
|
|
125
|
-
if (wantFibonacci) {
|
|
126
|
-
lines.push('');
|
|
127
|
-
lines.push(demosFibonacciApiBlock());
|
|
128
|
-
}
|
|
129
|
-
if (wantSystemInfo) {
|
|
130
|
-
lines.push('');
|
|
131
|
-
lines.push(demosSystemInfoApiBlock());
|
|
132
|
-
}
|
|
133
|
-
if (wantAvatar) {
|
|
134
|
-
lines.push('');
|
|
135
|
-
lines.push(demosAvatarApiBlock());
|
|
136
|
-
}
|
|
137
|
-
if (shouldScaffoldDemo(ctx, 'cache')) {
|
|
138
|
-
lines.push('');
|
|
139
|
-
lines.push(demosCacheApiBlock());
|
|
140
|
-
}
|
|
141
|
-
if (shouldScaffoldDemo(ctx, 'queue')) {
|
|
142
|
-
lines.push('');
|
|
143
|
-
lines.push(demosQueueApiBlock());
|
|
144
|
-
}
|
|
145
|
-
if (shouldScaffoldDemo(ctx, 'mail')) {
|
|
146
|
-
lines.push('');
|
|
147
|
-
lines.push(demosMailApiBlock());
|
|
148
|
-
}
|
|
149
|
-
if (shouldScaffoldDemo(ctx, 'notifications')) {
|
|
150
|
-
lines.push('');
|
|
151
|
-
lines.push(demosNotificationsApiBlock());
|
|
152
|
-
}
|
|
153
|
-
if (shouldScaffoldDemo(ctx, 'localization')) {
|
|
154
|
-
lines.push('');
|
|
155
|
-
lines.push(demosLocalizationApiBlock());
|
|
156
|
-
}
|
|
157
|
-
if (shouldScaffoldDemo(ctx, 'http')) {
|
|
158
|
-
lines.push('');
|
|
159
|
-
lines.push(demosHttpApiBlock());
|
|
160
|
-
}
|
|
161
|
-
if (shouldScaffoldDemo(ctx, 'polymorphic')) {
|
|
162
|
-
imports.push(`import { Model } from '@rudderjs/orm'`);
|
|
163
|
-
imports.push(`import { Post } from '../app/Models/Post.ts'`);
|
|
164
|
-
imports.push(`import { Video } from '../app/Models/Video.ts'`);
|
|
165
|
-
imports.push(`import { Comment } from '../app/Models/Comment.ts'`);
|
|
166
|
-
lines.push('');
|
|
167
|
-
lines.push(demosPolymorphicApiBlock());
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
71
|
lines.push('');
|
|
171
72
|
lines.push("// Catch-all: any unmatched /api/* route returns 404");
|
|
172
73
|
lines.push("router.all('/api/*', (_req, res) => res.status(404).json({ message: 'Route not found.' }))");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/templates/routes/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/templates/routes/api.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAAoB;IAC5C,MAAM,OAAO,GAAa;QACxB,2CAA2C;KAC5C,CAAA;IACD,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAC,EA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AI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAC5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../../src/templates/routes/web.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../../src/templates/routes/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzD,wBAAgB,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CA6EtD;AAED,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAEhE"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { shouldScaffoldAnyDemo, shouldScaffoldDemo } from '../../templates.js';
|
|
2
|
-
import { demosPolymorphicWebBlock } from '../demos/polymorphic.js';
|
|
3
1
|
export function routesWeb(ctx) {
|
|
4
2
|
const hasAuth = ctx.packages.auth;
|
|
5
|
-
|
|
3
|
+
// Welcome route fires for single-framework AND no-frontend (vanilla welcome
|
|
4
|
+
// built with @rudderjs/view's html`` tag — see `welcomeViewVanilla` in
|
|
5
|
+
// templates/views/welcome.ts). Multi-framework projects use the file-based
|
|
6
|
+
// pages/index/+Page.* page instead.
|
|
7
|
+
const hasWelcome = ctx.frameworks.length <= 1;
|
|
6
8
|
// ── imports ─────────────────────────────────────────────
|
|
7
9
|
const imports = [`import { Route } from '@rudderjs/router'`];
|
|
8
10
|
if (hasWelcome) {
|
|
@@ -13,7 +15,6 @@ export function routesWeb(ctx) {
|
|
|
13
15
|
if (hasAuth) {
|
|
14
16
|
imports.push(`import { CsrfMiddleware } from '@rudderjs/middleware'`);
|
|
15
17
|
imports.push(`import { registerAuthRoutes } from '@rudderjs/auth/routes'`);
|
|
16
|
-
imports.push(`import { auth } from '@rudderjs/auth'`);
|
|
17
18
|
imports.push(`import { AuthController } from '../app/Http/Controllers/AuthController.ts'`);
|
|
18
19
|
}
|
|
19
20
|
// ── middleware chain shared with auth routes + welcome ─
|
|
@@ -45,13 +46,16 @@ Route.registerController(AuthController)
|
|
|
45
46
|
// ── welcome page wiring ─────────────────────────────────
|
|
46
47
|
// SiteHeader reads `user` from pageContext (set by @rudderjs/auth's enhancer),
|
|
47
48
|
// so the welcome controller no longer needs to pass it as a prop.
|
|
49
|
+
const welcomeFile = ctx.frameworks.length === 0
|
|
50
|
+
? 'app/Views/Welcome.ts'
|
|
51
|
+
: `app/Views/Welcome.${welcomeExt(ctx.primary)}`;
|
|
48
52
|
const welcomeBlock = hasWelcome
|
|
49
53
|
? `
|
|
50
54
|
// Read RudderJS version from @rudderjs/core's package.json at boot time.
|
|
51
55
|
const _require = createRequire(import.meta.url)
|
|
52
56
|
const rudderCorePkg = _require('@rudderjs/core/package.json') as { version: string }
|
|
53
57
|
|
|
54
|
-
// Welcome page — delete this route and
|
|
58
|
+
// Welcome page — delete this route and ${welcomeFile} to replace it.
|
|
55
59
|
Route.get('/', async () => view('welcome', {
|
|
56
60
|
appName: config<string>('app.name', 'RudderJS'),
|
|
57
61
|
rudderVersion: rudderCorePkg.version,
|
|
@@ -60,85 +64,8 @@ Route.get('/', async () => view('welcome', {
|
|
|
60
64
|
})${hasAuth ? ', webMw' : ''})
|
|
61
65
|
`
|
|
62
66
|
: '';
|
|
63
|
-
// ── demos wiring ────────────────────────────────────────
|
|
64
|
-
// Controllers for /demos and /demos/<name>. Views live under app/Views/Demos/.
|
|
65
|
-
let demosBlock = '';
|
|
66
|
-
if (shouldScaffoldAnyDemo(ctx)) {
|
|
67
|
-
if (!hasWelcome) {
|
|
68
|
-
// Demo files exist but routesWeb already has `view` imports if hasWelcome.
|
|
69
|
-
// For multi-framework projects (no welcome) we still need the view import here.
|
|
70
|
-
imports.push(`import { view } from '@rudderjs/view'`);
|
|
71
|
-
}
|
|
72
|
-
if (shouldScaffoldDemo(ctx, 'todos')) {
|
|
73
|
-
imports.push(`import { resolve } from '@rudderjs/core'`);
|
|
74
|
-
imports.push(`import { TodoService } from '../app/Modules/Todo/TodoService.ts'`);
|
|
75
|
-
}
|
|
76
|
-
if (shouldScaffoldDemo(ctx, 'polymorphic')) {
|
|
77
|
-
imports.push(`import { Post } from '../app/Models/Post.ts'`);
|
|
78
|
-
imports.push(`import { Video } from '../app/Models/Video.ts'`);
|
|
79
|
-
imports.push(`import { Tag } from '../app/Models/Tag.ts'`);
|
|
80
|
-
imports.push(`import type { Comment } from '../app/Models/Comment.ts'`);
|
|
81
|
-
}
|
|
82
|
-
if (shouldScaffoldDemo(ctx, 'pennant')) {
|
|
83
|
-
imports.push(`import { Feature, FeatureMiddleware } from '@rudderjs/pennant'`);
|
|
84
|
-
// auth().user() — Pennant demo gates on `auth` so the import is always available
|
|
85
|
-
// when this branch fires; it's also already imported above when hasAuth.
|
|
86
|
-
}
|
|
87
|
-
const lines = [
|
|
88
|
-
`// Demos — see app/Views/Demos/`,
|
|
89
|
-
`Route.get('/demos', async () => view('demos.index'))`,
|
|
90
|
-
];
|
|
91
|
-
if (shouldScaffoldDemo(ctx, 'contact'))
|
|
92
|
-
lines.push(`Route.get('/demos/contact', async () => view('demos.contact'))`);
|
|
93
|
-
if (shouldScaffoldDemo(ctx, 'todos')) {
|
|
94
|
-
lines.push(`Route.get('/demos/todos', async () => {`);
|
|
95
|
-
lines.push(` const todos = await resolve<TodoService>(TodoService).findAll()`);
|
|
96
|
-
lines.push(` return view('demos.todos', { todos })`);
|
|
97
|
-
lines.push(`})`);
|
|
98
|
-
}
|
|
99
|
-
if (shouldScaffoldDemo(ctx, 'polymorphic')) {
|
|
100
|
-
lines.push(demosPolymorphicWebBlock());
|
|
101
|
-
}
|
|
102
|
-
if (shouldScaffoldDemo(ctx, 'avatar'))
|
|
103
|
-
lines.push(`Route.get('/demos/avatar', async () => view('demos.avatar'))`);
|
|
104
|
-
if (shouldScaffoldDemo(ctx, 'fibonacci'))
|
|
105
|
-
lines.push(`Route.get('/demos/fibonacci', async () => view('demos.fibonacci'))`);
|
|
106
|
-
if (shouldScaffoldDemo(ctx, 'system-info'))
|
|
107
|
-
lines.push(`Route.get('/demos/system-info', async () => view('demos.system-info'))`);
|
|
108
|
-
if (shouldScaffoldDemo(ctx, 'cache'))
|
|
109
|
-
lines.push(`Route.get('/demos/cache', async () => view('demos.cache'))`);
|
|
110
|
-
if (shouldScaffoldDemo(ctx, 'queue'))
|
|
111
|
-
lines.push(`Route.get('/demos/queue', async () => view('demos.queue'))`);
|
|
112
|
-
if (shouldScaffoldDemo(ctx, 'mail'))
|
|
113
|
-
lines.push(`Route.get('/demos/mail', async () => view('demos.mail'))`);
|
|
114
|
-
if (shouldScaffoldDemo(ctx, 'notifications'))
|
|
115
|
-
lines.push(`Route.get('/demos/notifications', async () => view('demos.notifications'))`);
|
|
116
|
-
if (shouldScaffoldDemo(ctx, 'localization'))
|
|
117
|
-
lines.push(`Route.get('/demos/localization', async () => view('demos.localization'))`);
|
|
118
|
-
if (shouldScaffoldDemo(ctx, 'http'))
|
|
119
|
-
lines.push(`Route.get('/demos/http', async () => view('demos.http'))`);
|
|
120
|
-
if (shouldScaffoldDemo(ctx, 'pennant')) {
|
|
121
|
-
lines.push(`Route.get('/demos/pennant', async () => {`);
|
|
122
|
-
lines.push(` const current = await auth().user() as Record<string, unknown> | null`);
|
|
123
|
-
lines.push(` const values = await Feature.values(`);
|
|
124
|
-
lines.push(` ['dark-mode', 'max-uploads', 'beta-dashboard', 'new-checkout'],`);
|
|
125
|
-
lines.push(` current as { id: string | number; [k: string]: unknown } | null,`);
|
|
126
|
-
lines.push(` )`);
|
|
127
|
-
lines.push(` const user = current`);
|
|
128
|
-
lines.push(` ? { id: String(current['id']), name: String(current['name'] ?? ''), email: String(current['email'] ?? '') }`);
|
|
129
|
-
lines.push(` : null`);
|
|
130
|
-
lines.push(` return view('demos.pennant', { user, values })`);
|
|
131
|
-
lines.push(`})`);
|
|
132
|
-
lines.push(`Route.get('/demos/pennant/beta', async () => view('demos.pennant-beta'), [FeatureMiddleware('beta-dashboard')])`);
|
|
133
|
-
}
|
|
134
|
-
if (shouldScaffoldDemo(ctx, 'ws'))
|
|
135
|
-
lines.push(`Route.get('/demos/ws', async () => view('demos.ws'))`);
|
|
136
|
-
if (shouldScaffoldDemo(ctx, 'sync'))
|
|
137
|
-
lines.push(`Route.get('/demos/sync', async () => view('demos.sync'))`);
|
|
138
|
-
demosBlock = '\n' + lines.join('\n') + '\n';
|
|
139
|
-
}
|
|
140
67
|
return `${imports.join('\n')}
|
|
141
|
-
${webMwBlock}${authBlock}${welcomeBlock}
|
|
68
|
+
${webMwBlock}${authBlock}${welcomeBlock}
|
|
142
69
|
// Web routes — HTML redirects, guards, and non-API server responses
|
|
143
70
|
// These run before Vike's file-based page routing
|
|
144
71
|
// Use this file for: redirects, server-side auth guards, download routes, sitemaps, etc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../../src/templates/routes/web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../../src/templates/routes/web.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS,CAAC,GAAoB;IAC5C,MAAM,OAAO,GAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAA;IACrC,4EAA4E;IAC5E,uEAAuE;IACvE,2EAA2E;IAC3E,oCAAoC;IACpC,MAAM,UAAU,GAAI,GAAG,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,CAAA;IAE9C,2DAA2D;IAC3D,MAAM,OAAO,GAAa,CAAC,0CAA0C,CAAC,CAAA;IACtE,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAA;QAC3D,OAAO,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI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,8 @@
|
|
|
1
1
|
import type { TemplateContext } from '../templates.js';
|
|
2
2
|
/**
|
|
3
3
|
* One URL the render smoke should hit. Generated from the scaffolder profile
|
|
4
|
-
* via {@link getProfileRoutes} — each contributor (welcome, auth,
|
|
5
|
-
*
|
|
4
|
+
* via {@link getProfileRoutes} — each contributor (welcome, auth, an admin
|
|
5
|
+
* dashboard) lists its routes here so a Playwright pass can iterate them
|
|
6
6
|
* without a per-profile hand table.
|
|
7
7
|
*/
|
|
8
8
|
export interface RouteSpec {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-manifest.d.ts","sourceRoot":"","sources":["../../src/templates/routes-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"routes-manifest.d.ts","sourceRoot":"","sources":["../../src/templates/routes-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,IAAI,EAAa,MAAM,CAAA;IACvB;;;OAGG;IACH,aAAa,EAAI,MAAM,CAAA;IACvB,qEAAqE;IACrE,SAAS,CAAC,EAAO,MAAM,CAAA;IACvB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,SAAS,EAAE,CA6ClE"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { shouldScaffoldAnyDemo, shouldScaffoldDemo } from '../templates.js';
|
|
2
|
-
import { DEMOS } from './demos/registry.js';
|
|
3
1
|
/**
|
|
4
2
|
* Map a scaffolder profile (TemplateContext) → the set of URLs that should
|
|
5
3
|
* render in the booted app. Stays in lockstep with {@link routesWeb} and the
|
|
@@ -8,34 +6,33 @@ import { DEMOS } from './demos/registry.js';
|
|
|
8
6
|
*/
|
|
9
7
|
export function getProfileRoutes(ctx) {
|
|
10
8
|
const routes = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
const hasFrontend = ctx.frameworks.length >= 1;
|
|
10
|
+
const isApiOnly = ctx.frameworks.length === 0;
|
|
11
|
+
// Welcome page exists for both single-framework (routes/web.ts) and
|
|
12
|
+
// no-frontend (vanilla welcome via @rudderjs/view's html``). Multi-framework
|
|
13
|
+
// scaffolds use pages/index/+Page.* instead — same URL, different shape.
|
|
14
|
+
if (ctx.frameworks.length === 1 || isApiOnly) {
|
|
15
|
+
routes.push({ path: '/', contributedBy: 'welcome', ssrMarker: 'Built with RudderJS' });
|
|
16
|
+
}
|
|
17
|
+
else if (ctx.frameworks.length > 1) {
|
|
18
|
+
routes.push({ path: '/', contributedBy: 'welcome' });
|
|
19
|
+
}
|
|
20
|
+
// No-frontend cells additionally hit /api/health — the always-scaffolded
|
|
21
|
+
// JSON probe — so the smoke exercises the api route stack end-to-end.
|
|
22
|
+
if (isApiOnly) {
|
|
23
|
+
routes.push({ path: '/api/health', contributedBy: 'api.health', ssrMarker: '"status":"ok"' });
|
|
24
|
+
}
|
|
18
25
|
// Auth UI — login/register/forgot-password. RequireGuest middleware lets the
|
|
19
26
|
// pages through for an unauthenticated session (which is what the smoke has).
|
|
20
27
|
// Markers come from packages/auth/views/<framework>/. Only react has vendored
|
|
21
28
|
// views today; vue/solid scaffolds resolve to a missing view at boot. The
|
|
22
29
|
// smoke's auth-view copy step (mirrors index.ts) only fires for react, so we
|
|
23
30
|
// gate the manifest the same way to avoid asserting on routes whose template
|
|
24
|
-
// never reached the project.
|
|
25
|
-
|
|
31
|
+
// never reached the project. Skipped on API-only profiles (no frontend → no
|
|
32
|
+
// auth pages even when the package is selected for POST endpoints only).
|
|
33
|
+
if (hasFrontend && ctx.packages.auth && ctx.primary === 'react') {
|
|
26
34
|
routes.push({ path: '/login', contributedBy: 'auth', ssrMarker: 'Welcome back' }, { path: '/register', contributedBy: 'auth', ssrMarker: 'Create an account' }, { path: '/forgot-password', contributedBy: 'auth', ssrMarker: 'Forgot password' });
|
|
27
35
|
}
|
|
28
|
-
// Demos index + each selected demo. Demos are react-primary-only today
|
|
29
|
-
// (shouldScaffoldDemo enforces ctx.primary === 'react') so the manifest
|
|
30
|
-
// doesn't need its own framework guard.
|
|
31
|
-
if (shouldScaffoldAnyDemo(ctx)) {
|
|
32
|
-
routes.push({ path: '/demos', contributedBy: 'demos.index', ssrMarker: 'Demos' });
|
|
33
|
-
for (const demo of DEMOS) {
|
|
34
|
-
if (!shouldScaffoldDemo(ctx, demo.value))
|
|
35
|
-
continue;
|
|
36
|
-
routes.push({ path: `/demos/${demo.value}`, contributedBy: `demo:${demo.value}` });
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
36
|
// Admin dashboards — scaffolder configs leave them publicly mounted (no
|
|
40
37
|
// auth middleware), so an unauthenticated session can reach them. The title
|
|
41
38
|
// bar substring is a cheap SSR marker that won't false-fire on the welcome
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes-manifest.js","sourceRoot":"","sources":["../../src/templates/routes-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes-manifest.js","sourceRoot":"","sources":["../../src/templates/routes-manifest.ts"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAoB;IACnD,MAAM,MAAM,GAAgB,EAAE,CAAA;IAC9B,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,CAAA;IAC9C,MAAM,SAAS,GAAK,GAAG,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAA;IAE/C,oEAAoE;IACpE,6EAA6E;IAC7E,yEAAyE;IACzE,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IA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AAW,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAA;IACnH,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK;QAAM,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAM,aAAa,EAAE,OAAO,EAAM,SAAS,EAAE,OAAO,EAAE,CAAC,CAAA;IAC/G,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO;QAAI,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAI,aAAa,EAAE,SAAS,EAAI,SAAS,EAAE,SAAS,EAAE,CAAC,CAAA;IAEjH,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import type { TemplateContext } from '../../templates.js';
|
|
2
2
|
export declare function welcomeView(ctx: TemplateContext): string;
|
|
3
|
+
/**
|
|
4
|
+
* Vanilla welcome view for no-frontend recipes (api-service, minimal).
|
|
5
|
+
*
|
|
6
|
+
* Returns a SafeString built with @rudderjs/view's html`` tagged template
|
|
7
|
+
* (zero-client-JS, server-rendered HTML). No React/Vue/Solid imports → no
|
|
8
|
+
* vike-* renderer required. The @rudderjs/vite view scanner detects the
|
|
9
|
+
* .ts extension + no installed vike-renderer and generates the matching
|
|
10
|
+
* `pages/__view/welcome/+Page.ts` stub that returns the Page as a string.
|
|
11
|
+
*
|
|
12
|
+
* `pages/+config.ts` wraps the page's body in an `onRenderHtml` hook —
|
|
13
|
+
* see `templates/pages/index.ts` for the vanilla shell.
|
|
14
|
+
*/
|
|
15
|
+
export declare function welcomeViewVanilla(_ctx: TemplateContext): string;
|
|
3
16
|
export declare function welcomeViewReact(_ctx: TemplateContext): string;
|
|
4
17
|
export declare function welcomeViewVue(_ctx: TemplateContext): string;
|
|
5
18
|
export declare function welcomeViewSolid(_ctx: TemplateContext): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../../src/templates/views/welcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzD,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"welcome.d.ts","sourceRoot":"","sources":["../../../src/templates/views/welcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzD,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAOxD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAsChE;AAsCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA0E9D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA+E5D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CA2E9D"}
|
|
@@ -1,10 +1,63 @@
|
|
|
1
1
|
export function welcomeView(ctx) {
|
|
2
|
+
if (ctx.frameworks.length === 0)
|
|
3
|
+
return welcomeViewVanilla(ctx);
|
|
2
4
|
switch (ctx.primary) {
|
|
3
5
|
case 'vue': return welcomeViewVue(ctx);
|
|
4
6
|
case 'solid': return welcomeViewSolid(ctx);
|
|
5
7
|
default: return welcomeViewReact(ctx);
|
|
6
8
|
}
|
|
7
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
|
+
</footer>
|
|
57
|
+
</main>\`
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
8
61
|
const WELCOME_FEATURES = `const DEFAULT_DOCS = 'https://github.com/rudderjs/rudder'
|
|
9
62
|
const DEFAULT_GITHUB = 'https://github.com/rudderjs/rudder'
|
|
10
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../src/templates/views/welcome.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAAoB;IAC9C,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,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCvB,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAuBP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDjB,CAAA;AACD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAqB;IAClD,sEAAsE;IACtE,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,uCAAuC;IACvC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CjB,CAAA;AACD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAqB;IACpD,OAAO;;;;;;;;;;;;;;;;;;;;;;EAsBP,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDjB,CAAA;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../src/templates/views/welcome.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,GAAoB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 @@ export interface TemplateContext {
|
|
|
40
40
|
concurrency: boolean;
|
|
41
41
|
terminal: boolean;
|
|
42
42
|
};
|
|
43
|
-
/** Demo IDs to scaffold (e.g. 'contact', 'ws', 'sync'). See templates/demos/registry.ts. */
|
|
44
|
-
demos: string[];
|
|
45
43
|
}
|
|
46
44
|
export declare function getTemplates(ctx: TemplateContext): Record<string, string>;
|
|
47
|
-
/**
|
|
48
|
-
* Demos are React-primary only for v1 — vue/solid variants aren't written yet.
|
|
49
|
-
* `name` is a demo ID from `templates/demos/registry.ts` (e.g. 'contact', 'ws', 'sync').
|
|
50
|
-
* Returns true when the demo was selected AND its package gates are satisfied.
|
|
51
|
-
*/
|
|
52
|
-
export declare function shouldScaffoldDemo(ctx: TemplateContext, name: string): boolean;
|
|
53
|
-
export declare function shouldScaffoldAnyDemo(ctx: TemplateContext): boolean;
|
|
54
45
|
//# sourceMappingURL=templates.d.ts.map
|
package/dist/templates.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
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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