@better-t-stack/template-generator 3.24.0 → 3.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +191 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -145,7 +145,7 @@ declare const dependencyVersionMap: {
|
|
|
145
145
|
readonly "@orpc/client": "^1.12.2";
|
|
146
146
|
readonly "@orpc/openapi": "^1.12.2";
|
|
147
147
|
readonly "@orpc/zod": "^1.12.2";
|
|
148
|
-
readonly "@orpc/tanstack-query": "^1.
|
|
148
|
+
readonly "@orpc/tanstack-query": "^1.13.6";
|
|
149
149
|
readonly "@trpc/tanstack-react-query": "^11.7.2";
|
|
150
150
|
readonly "@trpc/server": "^11.7.2";
|
|
151
151
|
readonly "@trpc/client": "^11.7.2";
|
|
@@ -159,8 +159,8 @@ declare const dependencyVersionMap: {
|
|
|
159
159
|
readonly "@convex-dev/better-auth": "^0.10.13";
|
|
160
160
|
readonly "@tanstack/svelte-query": "^5.85.3";
|
|
161
161
|
readonly "@tanstack/svelte-query-devtools": "^5.85.3";
|
|
162
|
-
readonly "@tanstack/vue-query-devtools": "^
|
|
163
|
-
readonly "@tanstack/vue-query": "^5.
|
|
162
|
+
readonly "@tanstack/vue-query-devtools": "^6.1.5";
|
|
163
|
+
readonly "@tanstack/vue-query": "^5.92.9";
|
|
164
164
|
readonly "@tanstack/react-query-devtools": "^5.91.1";
|
|
165
165
|
readonly "@tanstack/react-query": "^5.90.12";
|
|
166
166
|
readonly "@tanstack/react-form": "^1.28.0";
|
|
@@ -176,8 +176,9 @@ declare const dependencyVersionMap: {
|
|
|
176
176
|
readonly "nitro-cloudflare-dev": "^0.2.2";
|
|
177
177
|
readonly "@sveltejs/adapter-cloudflare": "^7.2.4";
|
|
178
178
|
readonly "@cloudflare/workers-types": "^4.20251213.0";
|
|
179
|
-
readonly "@astrojs/cloudflare": "^
|
|
180
|
-
readonly
|
|
179
|
+
readonly "@astrojs/cloudflare": "^13.0.1";
|
|
180
|
+
readonly "@astrojs/node": "^10.0.0-beta.9";
|
|
181
|
+
readonly alchemy: "^0.87.0";
|
|
181
182
|
readonly dotenv: "^17.2.2";
|
|
182
183
|
readonly tsdown: "^0.16.5";
|
|
183
184
|
readonly zod: "^4.1.13";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/core/virtual-fs.ts","../src/core/template-processor.ts","../src/template-handlers/utils.ts","../src/template-handlers/addons.ts","../src/generator.ts","../src/processors/addons-deps.ts","../src/bts-config.ts","../src/templates.generated.ts","../src/utils/add-deps.ts","../src/utils/reproducible-command.ts"],"sourcesContent":[],"mappings":";;;;;;;cAOa,iBAAA;;;;;;EAAA,QAAA,CAAA,QAAA,EAAA,MAAiB,CAAA,EAAA,MAAA,GAAA,SAAA;EA6Ea,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAkCX,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAgB,eAcrC,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAA,KAGJ,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAAA,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;2CAnDoC;;EC1E3B,WAAA,CAAA,CAAA,EAAA,MAAA,EAAA;EAIA,iBAAY,CAAA,CAAA,EAAA,MAAA,EAAA;EAIZ,YAAA,CAAA,CAAA,EAAA,MAAiB;EAUjB,iBAAA,CAAA,CAAA,EAAkB,MAAA;6BD0FF;;eAAgB,MAAA,CAcrC;EE/HC,KAAA,CAAA,CAAA,EF+HD,MAAA,CAGJ,GElIoB;;;;ECAL,QAAA,aAAA;;;;iBFKN,qBAAA,2BAAgD;iBAIhD,YAAA;iBAIA,iBAAA;iBAUA,kBAAA,6CAGL;;;KC1BC,YAAA,GAAe;;;iBCAL,qBAAA,MACf,8BACM,sBACH,gBACP;;;;;AHFH;;;;;;;;;ACGA;AAIA;AAIgB,iBG+BM,QAAA,CH/BW,OAAA,EGgCtB,gBHhCsB,CAAA,EGiC9B,OHjC8B,CGiCtB,MHjCsB,CGiCf,eHjCe,EGiCE,cHjCF,CAAA,CAAA;;;iBIJjB,iBAAA,MAAuB,2BAA2B;;;;;;;iBCJlD,mBAAA,MACT,kCACU;;;cCTJ,oBAAoB;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/core/virtual-fs.ts","../src/core/template-processor.ts","../src/template-handlers/utils.ts","../src/template-handlers/addons.ts","../src/generator.ts","../src/processors/addons-deps.ts","../src/bts-config.ts","../src/templates.generated.ts","../src/utils/add-deps.ts","../src/utils/reproducible-command.ts"],"sourcesContent":[],"mappings":";;;;;;;cAOa,iBAAA;;;;;;EAAA,QAAA,CAAA,QAAA,EAAA,MAAiB,CAAA,EAAA,MAAA,GAAA,SAAA;EA6Ea,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAkCX,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAgB,eAcrC,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAA,KAGJ,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAAA,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;2CAnDoC;;EC1E3B,WAAA,CAAA,CAAA,EAAA,MAAA,EAAA;EAIA,iBAAY,CAAA,CAAA,EAAA,MAAA,EAAA;EAIZ,YAAA,CAAA,CAAA,EAAA,MAAiB;EAUjB,iBAAA,CAAA,CAAA,EAAkB,MAAA;6BD0FF;;eAAgB,MAAA,CAcrC;EE/HC,KAAA,CAAA,CAAA,EF+HD,MAAA,CAGJ,GElIoB;;;;ECAL,QAAA,aAAA;;;;iBFKN,qBAAA,2BAAgD;iBAIhD,YAAA;iBAIA,iBAAA;iBAUA,kBAAA,6CAGL;;;KC1BC,YAAA,GAAe;;;iBCAL,qBAAA,MACf,8BACM,sBACH,gBACP;;;;;AHFH;;;;;;;;;ACGA;AAIA;AAIgB,iBG+BM,QAAA,CH/BW,OAAA,EGgCtB,gBHhCsB,CAAA,EGiC9B,OHjC8B,CGiCtB,MHjCsB,CGiCf,eHjCe,EGiCE,cHjCF,CAAA,CAAA;;;iBIJjB,iBAAA,MAAuB,2BAA2B;;;;;;;iBCJlD,mBAAA,MACT,kCACU;;;cCTJ,oBAAoB;cAiv0BpB,cAAA;;;cCvu0BA;;;ERNA,SAAA,mBAAiB,EAAA,OAAA;EA6Ea,SAAA,eAAA,EAAA,SAAA;EAkCX,SAAA,oBAAA,EAAA,SAAA;EAAgB,SAcrC,6BAAA,EAAA,SAAA;EAAA,SAGJ,mBAAA,EAAA,UAAA;EAAA,SAAA,aAAA,EAAA,SAAA;;;;EC7HS,SAAA,MAAA,EAAA,QAAqB;EAIrB,SAAA,0BAAY,EAAA,QAAA;EAIZ,SAAA,EAAA,EAAA,SAAiB;EAUjB,SAAA,WAAA,EAAkB,SAAA;;;;ECvBtB,SAAA,gBAAY,EAAG,QAAG;;;;ECAR,SAAA,yBAAqB,EAAA,QAAA;EACpC,SAAA,wBAAA,EAAA,QAAA;EACM,SAAA,gCAAA,EAAA,QAAA;EACH,SAAA,oBAAA,EAAA,QAAA;EACP,SAAA,6BAAA,EAAA,QAAA;EAAO,SAAA,QAAA,EAAA,SAAA;;;;ECwCY,SAAA,gBAAQ,EAAA,QAAA;EACnB,SAAA,MAAA,EAAA,SAAA;EACO,SAAA,KAAA,EAAA,SAAA;EAAiB,SAAA,KAAA,EAAA,QAAA;EAAxB,SAAA,QAAA,EAAA,SAAA;EAAR,SAAA,aAAA,EAAA,SAAA;EAAO,SAAA,GAAA,EAAA,SAAA;;;;ECrCM,SAAA,gBAAiB,EAAA,QAAM;;;;ECJvB,SAAA,mBAAmB,EAAA,QAC5B;;;;ECRM,SAAA,gBA+u0BX,EAAA,QA/u0B+B;EAiv0BpB,SAAA,aAAc,EAAA,SAAA;;;;ECvu0Bd,SAAA,EAAA,EAAA,SAAA;EAkJD,SAAA,EAAA,EAAA,QAAA;;;;ECpII,SAAA,eAAA,EAAA,QAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KDoI/B,qBAAA,gBAAqC;;;iBCpIjC,2BAAA,SAAoC"}
|
package/dist/index.mjs
CHANGED
|
@@ -496,6 +496,10 @@ function updateRootPackageJson(vfs, config) {
|
|
|
496
496
|
scripts.destroy = pmConfig.filter(infraPackageName, "destroy");
|
|
497
497
|
}
|
|
498
498
|
pkgJson.packageManager = `${packageManager}@latest`;
|
|
499
|
+
if (config.api === "orpc" && config.frontend.includes("nuxt")) pkgJson.overrides = {
|
|
500
|
+
...pkgJson.overrides || {},
|
|
501
|
+
"@vue/devtools-api": "^8.0.7"
|
|
502
|
+
};
|
|
499
503
|
if (backend === "convex") {
|
|
500
504
|
if (!workspaces.includes("packages/*")) workspaces.push("packages/*");
|
|
501
505
|
if ((config.frontend.length > 0 || addons.includes("starlight")) && !workspaces.includes("apps/*")) workspaces.push("apps/*");
|
|
@@ -601,6 +605,7 @@ function updateDbPackageJson(vfs, config) {
|
|
|
601
605
|
scripts["db:push"] = "prisma db push";
|
|
602
606
|
scripts["db:generate"] = "prisma generate";
|
|
603
607
|
scripts["db:migrate"] = "prisma migrate dev";
|
|
608
|
+
scripts.postinstall ??= "prisma generate";
|
|
604
609
|
if (!isD1Alchemy) scripts["db:studio"] = "prisma studio";
|
|
605
610
|
} else if (orm === "drizzle") {
|
|
606
611
|
scripts["db:push"] = "drizzle-kit push";
|
|
@@ -766,7 +771,7 @@ const dependencyVersionMap = {
|
|
|
766
771
|
"@orpc/client": "^1.12.2",
|
|
767
772
|
"@orpc/openapi": "^1.12.2",
|
|
768
773
|
"@orpc/zod": "^1.12.2",
|
|
769
|
-
"@orpc/tanstack-query": "^1.
|
|
774
|
+
"@orpc/tanstack-query": "^1.13.6",
|
|
770
775
|
"@trpc/tanstack-react-query": "^11.7.2",
|
|
771
776
|
"@trpc/server": "^11.7.2",
|
|
772
777
|
"@trpc/client": "^11.7.2",
|
|
@@ -780,8 +785,8 @@ const dependencyVersionMap = {
|
|
|
780
785
|
"@convex-dev/better-auth": "^0.10.13",
|
|
781
786
|
"@tanstack/svelte-query": "^5.85.3",
|
|
782
787
|
"@tanstack/svelte-query-devtools": "^5.85.3",
|
|
783
|
-
"@tanstack/vue-query-devtools": "^
|
|
784
|
-
"@tanstack/vue-query": "^5.
|
|
788
|
+
"@tanstack/vue-query-devtools": "^6.1.5",
|
|
789
|
+
"@tanstack/vue-query": "^5.92.9",
|
|
785
790
|
"@tanstack/react-query-devtools": "^5.91.1",
|
|
786
791
|
"@tanstack/react-query": "^5.90.12",
|
|
787
792
|
"@tanstack/react-form": "^1.28.0",
|
|
@@ -797,8 +802,9 @@ const dependencyVersionMap = {
|
|
|
797
802
|
"nitro-cloudflare-dev": "^0.2.2",
|
|
798
803
|
"@sveltejs/adapter-cloudflare": "^7.2.4",
|
|
799
804
|
"@cloudflare/workers-types": "^4.20251213.0",
|
|
800
|
-
"@astrojs/cloudflare": "^
|
|
801
|
-
|
|
805
|
+
"@astrojs/cloudflare": "^13.0.1",
|
|
806
|
+
"@astrojs/node": "^10.0.0-beta.9",
|
|
807
|
+
alchemy: "^0.87.0",
|
|
802
808
|
dotenv: "^17.2.2",
|
|
803
809
|
tsdown: "^0.16.5",
|
|
804
810
|
zod: "^4.1.13",
|
|
@@ -2245,6 +2251,20 @@ function setupAIDependencies(vfs, config) {
|
|
|
2245
2251
|
});
|
|
2246
2252
|
}
|
|
2247
2253
|
|
|
2254
|
+
//#endregion
|
|
2255
|
+
//#region src/processors/frontend-deps.ts
|
|
2256
|
+
function processFrontendDeps(vfs, config) {
|
|
2257
|
+
const { frontend, webDeploy } = config;
|
|
2258
|
+
if (!frontend.includes("astro") || webDeploy === "cloudflare") return;
|
|
2259
|
+
const webPackagePath = "apps/web/package.json";
|
|
2260
|
+
if (!vfs.exists(webPackagePath)) return;
|
|
2261
|
+
addPackageDependency({
|
|
2262
|
+
vfs,
|
|
2263
|
+
packagePath: webPackagePath,
|
|
2264
|
+
dependencies: ["@astrojs/node"]
|
|
2265
|
+
});
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2248
2268
|
//#endregion
|
|
2249
2269
|
//#region src/processors/infra-deps.ts
|
|
2250
2270
|
function processInfraDeps(vfs, config) {
|
|
@@ -3101,6 +3121,7 @@ function getRuntimeDevDeps(runtime, backend) {
|
|
|
3101
3121
|
//#region src/processors/index.ts
|
|
3102
3122
|
function processDependencies(vfs, config) {
|
|
3103
3123
|
processWorkspaceDeps(vfs, config);
|
|
3124
|
+
processFrontendDeps(vfs, config);
|
|
3104
3125
|
processEnvDeps(vfs, config);
|
|
3105
3126
|
processInfraDeps(vfs, config);
|
|
3106
3127
|
processDatabaseDeps(vfs, config);
|
|
@@ -3506,7 +3527,7 @@ async function processExtrasTemplates(vfs, templates, config) {
|
|
|
3506
3527
|
}
|
|
3507
3528
|
if (config.packageManager === "bun") processTemplatesFromPrefix(vfs, templates, "extras/bunfig.toml", "", config);
|
|
3508
3529
|
if (config.packageManager === "pnpm" && (hasNative || hasNuxt)) processTemplatesFromPrefix(vfs, templates, "extras/_npmrc", "", config);
|
|
3509
|
-
if (config.serverDeploy === "cloudflare") processSingleTemplate(vfs, templates, "extras/env.d.ts", "packages/env/env.d.ts", config);
|
|
3530
|
+
if (config.serverDeploy === "cloudflare" || config.backend === "self" && config.webDeploy === "cloudflare") processSingleTemplate(vfs, templates, "extras/env.d.ts", "packages/env/env.d.ts", config);
|
|
3510
3531
|
}
|
|
3511
3532
|
|
|
3512
3533
|
//#endregion
|
|
@@ -4650,6 +4671,11 @@ export default defineNuxtPlugin((nuxt) => {
|
|
|
4650
4671
|
const toast = useToast()
|
|
4651
4672
|
|
|
4652
4673
|
const queryClient = new QueryClient({
|
|
4674
|
+
defaultOptions: {
|
|
4675
|
+
queries: {
|
|
4676
|
+
staleTime: 5_000,
|
|
4677
|
+
},
|
|
4678
|
+
},
|
|
4653
4679
|
queryCache: new QueryCache({
|
|
4654
4680
|
onError: (error) => {
|
|
4655
4681
|
console.log(error)
|
|
@@ -9947,6 +9973,8 @@ export const auth = betterAuth({
|
|
|
9947
9973
|
emailAndPassword: {
|
|
9948
9974
|
enabled: true,
|
|
9949
9975
|
},
|
|
9976
|
+
secret: env.BETTER_AUTH_SECRET,
|
|
9977
|
+
baseURL: env.BETTER_AUTH_URL,
|
|
9950
9978
|
{{#if (ne backend "self")}}
|
|
9951
9979
|
advanced: {
|
|
9952
9980
|
defaultCookieAttributes: {
|
|
@@ -10018,6 +10046,8 @@ export const auth = betterAuth({
|
|
|
10018
10046
|
emailAndPassword: {
|
|
10019
10047
|
enabled: true,
|
|
10020
10048
|
},
|
|
10049
|
+
secret: env.BETTER_AUTH_SECRET,
|
|
10050
|
+
baseURL: env.BETTER_AUTH_URL,
|
|
10021
10051
|
{{#if (ne backend "self")}}
|
|
10022
10052
|
advanced: {
|
|
10023
10053
|
defaultCookieAttributes: {
|
|
@@ -10165,6 +10195,8 @@ export const auth = betterAuth({
|
|
|
10165
10195
|
emailAndPassword: {
|
|
10166
10196
|
enabled: true,
|
|
10167
10197
|
},
|
|
10198
|
+
secret: env.BETTER_AUTH_SECRET,
|
|
10199
|
+
baseURL: env.BETTER_AUTH_URL,
|
|
10168
10200
|
{{#if (ne backend "self")}}
|
|
10169
10201
|
advanced: {
|
|
10170
10202
|
defaultCookieAttributes: {
|
|
@@ -10227,6 +10259,8 @@ export const auth = betterAuth({
|
|
|
10227
10259
|
emailAndPassword: {
|
|
10228
10260
|
enabled: true,
|
|
10229
10261
|
},
|
|
10262
|
+
secret: env.BETTER_AUTH_SECRET,
|
|
10263
|
+
baseURL: env.BETTER_AUTH_URL,
|
|
10230
10264
|
{{#if (ne backend "self")}}
|
|
10231
10265
|
advanced: {
|
|
10232
10266
|
defaultCookieAttributes: {
|
|
@@ -18167,22 +18201,48 @@ import { Chat } from '@ai-sdk/vue'
|
|
|
18167
18201
|
import type { UIMessage } from 'ai'
|
|
18168
18202
|
import { getTextFromMessage } from '@nuxt/ui/utils/ai'
|
|
18169
18203
|
import { DefaultChatTransport } from 'ai'
|
|
18170
|
-
import { ref } from 'vue'
|
|
18204
|
+
import { computed, ref } from 'vue'
|
|
18205
|
+
|
|
18206
|
+
const SUGGESTIONS = [
|
|
18207
|
+
{
|
|
18208
|
+
title: 'Plan a feature',
|
|
18209
|
+
prompt: 'Help me break down a small product feature into implementation steps.'
|
|
18210
|
+
},
|
|
18211
|
+
{
|
|
18212
|
+
title: 'Design the schema',
|
|
18213
|
+
prompt: 'Suggest a database schema for a collaborative notes app.'
|
|
18214
|
+
},
|
|
18215
|
+
{
|
|
18216
|
+
title: 'Add auth flow',
|
|
18217
|
+
prompt: 'What is the cleanest way to add login, signup, and protected routes here?'
|
|
18218
|
+
},
|
|
18219
|
+
{
|
|
18220
|
+
title: 'Deploy checklist',
|
|
18221
|
+
prompt: 'Give me a production deployment checklist for this stack.'
|
|
18222
|
+
}
|
|
18223
|
+
] as const
|
|
18171
18224
|
|
|
18172
|
-
const config = useRuntimeConfig()
|
|
18173
18225
|
const messages: UIMessage[] = []
|
|
18174
18226
|
const input = ref('')
|
|
18227
|
+
const aiApiUrl = {{#if (eq backend "self")}}'/api/ai'{{else}}\`\${useRuntimeConfig().public.serverUrl}/ai\`{{/if}}
|
|
18175
18228
|
|
|
18176
18229
|
const chat = new Chat({
|
|
18177
18230
|
messages,
|
|
18178
18231
|
transport: new DefaultChatTransport({
|
|
18179
|
-
api:
|
|
18232
|
+
api: aiApiUrl,
|
|
18180
18233
|
}),
|
|
18181
18234
|
onError(error) {
|
|
18182
18235
|
console.error('Chat error:', error)
|
|
18183
18236
|
}
|
|
18184
18237
|
})
|
|
18185
18238
|
|
|
18239
|
+
const hasMessages = computed(() => chat.messages.length > 0)
|
|
18240
|
+
const isLoading = computed(() => chat.status === 'submitted' || chat.status === 'streaming')
|
|
18241
|
+
|
|
18242
|
+
function applySuggestion(prompt: string) {
|
|
18243
|
+
input.value = prompt
|
|
18244
|
+
}
|
|
18245
|
+
|
|
18186
18246
|
async function handleSubmit(e: Event) {
|
|
18187
18247
|
e.preventDefault()
|
|
18188
18248
|
const userInput = input.value
|
|
@@ -18195,27 +18255,95 @@ async function handleSubmit(e: Event) {
|
|
|
18195
18255
|
<\/script>
|
|
18196
18256
|
|
|
18197
18257
|
<template>
|
|
18198
|
-
<UContainer class="h-
|
|
18199
|
-
<div class="
|
|
18200
|
-
<
|
|
18201
|
-
<
|
|
18202
|
-
<div class="
|
|
18203
|
-
|
|
18204
|
-
|
|
18258
|
+
<UContainer class="flex min-h-[calc(100vh-var(--ui-header-height)-2rem)] max-w-5xl flex-col py-4 sm:py-6">
|
|
18259
|
+
<div class="min-h-0 flex-1">
|
|
18260
|
+
<div v-if="!hasMessages" class="flex h-full items-center">
|
|
18261
|
+
<div class="mx-auto flex w-full max-w-3xl flex-col gap-8">
|
|
18262
|
+
<div class="space-y-3 text-center">
|
|
18263
|
+
<UBadge label="AI Chat" color="primary" variant="subtle" class="rounded-full" />
|
|
18264
|
+
<div class="space-y-2">
|
|
18265
|
+
<h1 class="text-3xl font-semibold tracking-tight text-highlighted sm:text-4xl">
|
|
18266
|
+
Ask the starter for your next move.
|
|
18267
|
+
</h1>
|
|
18268
|
+
<p class="mx-auto max-w-2xl text-sm leading-6 text-muted sm:text-base">
|
|
18269
|
+
Use the built-in chat to plan features, sketch schemas, or unblock implementation work without leaving the app.
|
|
18270
|
+
</p>
|
|
18271
|
+
</div>
|
|
18272
|
+
</div>
|
|
18273
|
+
|
|
18274
|
+
<div class="grid gap-3 sm:grid-cols-2">
|
|
18275
|
+
<UButton
|
|
18276
|
+
v-for="suggestion in SUGGESTIONS"
|
|
18277
|
+
:key="suggestion.title"
|
|
18278
|
+
color="neutral"
|
|
18279
|
+
variant="soft"
|
|
18280
|
+
class="h-auto justify-start rounded-2xl px-4 py-4 text-left"
|
|
18281
|
+
@click="applySuggestion(suggestion.prompt)"
|
|
18282
|
+
>
|
|
18283
|
+
<div class="space-y-1">
|
|
18284
|
+
<div class="text-sm font-medium text-highlighted">\\{{ suggestion.title }}</div>
|
|
18285
|
+
<div class="text-sm leading-6 text-muted">\\{{ suggestion.prompt }}</div>
|
|
18286
|
+
</div>
|
|
18287
|
+
</UButton>
|
|
18288
|
+
</div>
|
|
18289
|
+
</div>
|
|
18290
|
+
</div>
|
|
18291
|
+
|
|
18292
|
+
<div v-else class="mx-auto flex h-full w-full max-w-3xl min-h-0 flex-col">
|
|
18293
|
+
<UChatMessages
|
|
18294
|
+
:messages="chat.messages"
|
|
18295
|
+
:status="chat.status"
|
|
18296
|
+
:assistant="{
|
|
18297
|
+
variant: 'outline',
|
|
18298
|
+
avatar: {
|
|
18299
|
+
icon: 'i-lucide-bot'
|
|
18300
|
+
}
|
|
18301
|
+
}"
|
|
18302
|
+
:user="{
|
|
18303
|
+
variant: 'soft',
|
|
18304
|
+
avatar: {
|
|
18305
|
+
icon: 'i-lucide-user'
|
|
18306
|
+
}
|
|
18307
|
+
}"
|
|
18308
|
+
class="min-h-0 flex-1 px-1"
|
|
18309
|
+
>
|
|
18310
|
+
<template #content="{ message }">
|
|
18311
|
+
<div class="whitespace-pre-wrap text-sm leading-6">\\{{ getTextFromMessage(message) }}</div>
|
|
18312
|
+
</template>
|
|
18313
|
+
</UChatMessages>
|
|
18314
|
+
</div>
|
|
18205
18315
|
</div>
|
|
18206
18316
|
|
|
18207
|
-
<div class="
|
|
18208
|
-
<
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18215
|
-
|
|
18317
|
+
<div class="sticky bottom-0 mt-4 border-t border-default bg-default pt-4">
|
|
18318
|
+
<div class="mx-auto w-full max-w-3xl">
|
|
18319
|
+
<UChatPrompt
|
|
18320
|
+
v-model="input"
|
|
18321
|
+
icon="i-lucide-sparkles"
|
|
18322
|
+
variant="soft"
|
|
18323
|
+
:rows="1"
|
|
18324
|
+
:maxrows="8"
|
|
18325
|
+
:loading="isLoading"
|
|
18326
|
+
:error="chat.error"
|
|
18327
|
+
:placeholder="hasMessages ? 'Keep the conversation going...' : 'Ask about your app, schema, auth, or deployment...'"
|
|
18328
|
+
@submit="handleSubmit"
|
|
18329
|
+
>
|
|
18330
|
+
<UChatPromptSubmit
|
|
18331
|
+
class="ms-auto"
|
|
18332
|
+
:status="chat.status"
|
|
18333
|
+
@stop="() => chat.stop()"
|
|
18334
|
+
@reload="() => chat.regenerate()"
|
|
18335
|
+
/>
|
|
18336
|
+
</UChatPrompt>
|
|
18337
|
+
|
|
18338
|
+
<div class="mt-2 flex items-center justify-between gap-3 px-1 text-xs text-muted">
|
|
18339
|
+
<span>Press Enter to send and Shift+Enter for a new line.</span>
|
|
18340
|
+
<span>\\{{ hasMessages ? \`\${chat.messages.length} messages\` : 'Ready when you are.' }}</span>
|
|
18341
|
+
</div>
|
|
18342
|
+
</div>
|
|
18216
18343
|
</div>
|
|
18217
18344
|
</UContainer>
|
|
18218
|
-
</template
|
|
18345
|
+
</template>
|
|
18346
|
+
`],
|
|
18219
18347
|
["examples/ai/web/react/next/src/app/ai/page.tsx.hbs", `{{#if (eq backend "convex")}}
|
|
18220
18348
|
"use client";
|
|
18221
18349
|
|
|
@@ -21048,6 +21176,12 @@ const queryClient = useQueryClient()
|
|
|
21048
21176
|
|
|
21049
21177
|
const todos = useQuery($orpc.todo.getAll.queryOptions())
|
|
21050
21178
|
|
|
21179
|
+
onServerPrefetch(async () => {
|
|
21180
|
+
try {
|
|
21181
|
+
await todos.suspense()
|
|
21182
|
+
} catch {}
|
|
21183
|
+
})
|
|
21184
|
+
|
|
21051
21185
|
const createMutation = useMutation($orpc.todo.create.mutationOptions({
|
|
21052
21186
|
onSuccess: () => {
|
|
21053
21187
|
queryClient.invalidateQueries()
|
|
@@ -22699,7 +22833,11 @@ linker = "hoisted" # having issues with Nuxt when linker is isolated
|
|
|
22699
22833
|
{{else}}
|
|
22700
22834
|
linker = "isolated"
|
|
22701
22835
|
{{/if}}`],
|
|
22702
|
-
["extras/env.d.ts.hbs", `
|
|
22836
|
+
["extras/env.d.ts.hbs", `{{#if (eq serverDeploy "cloudflare")}}
|
|
22837
|
+
import { type server } from "@{{projectName}}/infra/alchemy.run";
|
|
22838
|
+
{{else}}
|
|
22839
|
+
import { type web as server } from "@{{projectName}}/infra/alchemy.run";
|
|
22840
|
+
{{/if}}
|
|
22703
22841
|
|
|
22704
22842
|
// This file infers types for the cloudflare:workers environment from your Alchemy Worker.
|
|
22705
22843
|
// @see https://alchemy.run/concepts/bindings/#type-safe-bindings
|
|
@@ -22782,8 +22920,7 @@ export default defineConfig({
|
|
|
22782
22920
|
"astro": "astro"
|
|
22783
22921
|
},
|
|
22784
22922
|
"dependencies": {
|
|
22785
|
-
"
|
|
22786
|
-
"astro": "^5.16.11"
|
|
22923
|
+
"astro": "^6.0.1"
|
|
22787
22924
|
},
|
|
22788
22925
|
"devDependencies": {
|
|
22789
22926
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -26034,18 +26171,11 @@ logs
|
|
|
26034
26171
|
|
|
26035
26172
|
`],
|
|
26036
26173
|
["frontend/nuxt/app/app.config.ts.hbs", `export default defineAppConfig({
|
|
26037
|
-
// https://ui.nuxt.com/getting-started/theme#design-system
|
|
26038
26174
|
ui: {
|
|
26039
26175
|
colors: {
|
|
26040
26176
|
primary: 'emerald',
|
|
26041
26177
|
neutral: 'neutral',
|
|
26042
26178
|
},
|
|
26043
|
-
button: {
|
|
26044
|
-
defaultVariants: {
|
|
26045
|
-
// Set default button color to neutral
|
|
26046
|
-
// color: 'neutral'
|
|
26047
|
-
}
|
|
26048
|
-
}
|
|
26049
26179
|
}
|
|
26050
26180
|
})
|
|
26051
26181
|
`],
|
|
@@ -26056,6 +26186,8 @@ import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
|
|
|
26056
26186
|
<\/script>
|
|
26057
26187
|
|
|
26058
26188
|
<template>
|
|
26189
|
+
<NuxtAnnouncer />
|
|
26190
|
+
<NuxtRouteAnnouncer />
|
|
26059
26191
|
<NuxtLoadingIndicator />
|
|
26060
26192
|
<UApp>
|
|
26061
26193
|
<NuxtLayout>
|
|
@@ -26114,7 +26246,7 @@ const items = computed<NavigationMenuItem[]>(() => [
|
|
|
26114
26246
|
["frontend/nuxt/app/layouts/default.vue.hbs", `<script setup><\/script>
|
|
26115
26247
|
|
|
26116
26248
|
<template>
|
|
26117
|
-
<div
|
|
26249
|
+
<div>
|
|
26118
26250
|
<Header />
|
|
26119
26251
|
<UMain>
|
|
26120
26252
|
<slot />
|
|
@@ -26154,6 +26286,12 @@ const healthCheck = useConvexQuery(api.healthCheck.get, {});
|
|
|
26154
26286
|
{{else}}
|
|
26155
26287
|
{{#unless (eq api "none")}}
|
|
26156
26288
|
const healthCheck = useQuery($orpc.healthCheck.queryOptions())
|
|
26289
|
+
|
|
26290
|
+
onServerPrefetch(async () => {
|
|
26291
|
+
try {
|
|
26292
|
+
await healthCheck.suspense()
|
|
26293
|
+
} catch {}
|
|
26294
|
+
})
|
|
26157
26295
|
{{/unless}}
|
|
26158
26296
|
{{/if}}
|
|
26159
26297
|
<\/script>
|
|
@@ -26226,6 +26364,9 @@ const healthCheck = useQuery($orpc.healthCheck.queryOptions())
|
|
|
26226
26364
|
export default defineNuxtConfig({
|
|
26227
26365
|
compatibilityDate: 'latest',
|
|
26228
26366
|
devtools: { enabled: true },
|
|
26367
|
+
experimental: {
|
|
26368
|
+
payloadExtraction: 'client',
|
|
26369
|
+
},
|
|
26229
26370
|
modules: [
|
|
26230
26371
|
'@nuxt/ui'
|
|
26231
26372
|
{{#if (eq backend "convex")}},
|
|
@@ -26240,7 +26381,7 @@ export default defineNuxtConfig({
|
|
|
26240
26381
|
convex: {
|
|
26241
26382
|
url: process.env.NUXT_PUBLIC_CONVEX_URL,
|
|
26242
26383
|
},
|
|
26243
|
-
{{else if (ne backend "self")}}
|
|
26384
|
+
{{else if (and (ne backend "self") (ne backend "none"))}}
|
|
26244
26385
|
runtimeConfig: {
|
|
26245
26386
|
public: {
|
|
26246
26387
|
serverUrl: process.env.NUXT_PUBLIC_SERVER_URL,
|
|
@@ -26261,17 +26402,12 @@ export default defineNuxtConfig({
|
|
|
26261
26402
|
"postinstall": "nuxt prepare"
|
|
26262
26403
|
},
|
|
26263
26404
|
"dependencies": {
|
|
26264
|
-
"@nuxt/ui": "4.
|
|
26265
|
-
"
|
|
26266
|
-
"@nuxtjs/mdc": "^0.17.4",
|
|
26267
|
-
"nuxt": "^4.1.2",
|
|
26268
|
-
"vue": "^3.5.21",
|
|
26269
|
-
"vue-router": "^4.5.1",
|
|
26270
|
-
"@vue/devtools-api": "^8.0.5"
|
|
26405
|
+
"@nuxt/ui": "^4.5.1",
|
|
26406
|
+
"nuxt": "^4.4.2"
|
|
26271
26407
|
},
|
|
26272
26408
|
"devDependencies": {
|
|
26273
|
-
"tailwindcss": "^4.1
|
|
26274
|
-
"@iconify-json/lucide": "^1.2.
|
|
26409
|
+
"tailwindcss": "^4.2.1",
|
|
26410
|
+
"@iconify-json/lucide": "^1.2.96"
|
|
26275
26411
|
}
|
|
26276
26412
|
}
|
|
26277
26413
|
`],
|
|
@@ -28949,7 +29085,7 @@ export const env = createEnv({
|
|
|
28949
29085
|
runtimeEnv: process.env,
|
|
28950
29086
|
emptyStringAsUndefined: true,
|
|
28951
29087
|
});`],
|
|
28952
|
-
["packages/env/src/server.ts.hbs", `{{#if (eq serverDeploy "cloudflare")}}
|
|
29088
|
+
["packages/env/src/server.ts.hbs", `{{#if (or (eq serverDeploy "cloudflare") (and (eq backend "self") (eq webDeploy "cloudflare")))}}
|
|
28953
29089
|
/// <reference path="../env.d.ts" />
|
|
28954
29090
|
// For Cloudflare Workers, env is accessed via cloudflare:workers module
|
|
28955
29091
|
// Types are defined in env.d.ts based on your alchemy.run.ts bindings
|
|
@@ -28987,7 +29123,8 @@ export const env = createEnv({
|
|
|
28987
29123
|
runtimeEnv: process.env,
|
|
28988
29124
|
emptyStringAsUndefined: true,
|
|
28989
29125
|
});
|
|
28990
|
-
{{/if}}
|
|
29126
|
+
{{/if}}
|
|
29127
|
+
`],
|
|
28991
29128
|
["packages/env/src/web.ts.hbs", `{{#if (includes frontend "next")}}
|
|
28992
29129
|
import { createEnv } from "@t3-oss/env-nextjs";
|
|
28993
29130
|
{{else if (includes frontend "nuxt")}}
|
|
@@ -29353,6 +29490,11 @@ export const web = await Vite("web", {
|
|
|
29353
29490
|
{{else if (includes frontend "astro")}}
|
|
29354
29491
|
export const web = await Astro("web", {
|
|
29355
29492
|
cwd: "../../apps/web",
|
|
29493
|
+
entrypoint: "dist/server/entry.mjs",
|
|
29494
|
+
assets: "dist/client",
|
|
29495
|
+
{{#if (eq backend "self")}}
|
|
29496
|
+
compatibility: "node",
|
|
29497
|
+
{{/if}}
|
|
29356
29498
|
bindings: {
|
|
29357
29499
|
{{#if (ne backend "self")}}
|
|
29358
29500
|
PUBLIC_SERVER_URL: alchemy.env.PUBLIC_SERVER_URL!,
|