@better-t-stack/template-generator 3.30.2 → 3.31.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/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +418 -231
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -5398,18 +5398,29 @@ import { getClerkAuthToken } from "@/utils/clerk-auth";
|
|
|
5398
5398
|
{{/if}}
|
|
5399
5399
|
{{/if}}
|
|
5400
5400
|
|
|
5401
|
-
export
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
});
|
|
5401
|
+
export function createQueryClient() {
|
|
5402
|
+
return new QueryClient({
|
|
5403
|
+
queryCache: new QueryCache({
|
|
5404
|
+
onError: (error, query) => {
|
|
5405
|
+
toast.error(\`Error: \${error.message}\`, {
|
|
5406
|
+
action: {
|
|
5407
|
+
label: "retry",
|
|
5408
|
+
onClick: () => {
|
|
5409
|
+
query.invalidate();
|
|
5410
|
+
},
|
|
5411
|
+
},
|
|
5412
|
+
});
|
|
5413
|
+
},
|
|
5414
|
+
}),
|
|
5415
|
+
{{#if (includes frontend "tanstack-start")}}
|
|
5416
|
+
defaultOptions: { queries: { staleTime: 60 * 1000 } },
|
|
5417
|
+
{{/if}}
|
|
5418
|
+
});
|
|
5419
|
+
}
|
|
5420
|
+
|
|
5421
|
+
{{#unless (includes frontend "tanstack-start")}}
|
|
5422
|
+
export const queryClient = createQueryClient();
|
|
5423
|
+
{{/unless}}
|
|
5413
5424
|
|
|
5414
5425
|
{{#if (and (includes frontend "tanstack-start") (eq backend "self"))}}
|
|
5415
5426
|
const getORPCClient = createIsomorphicFn()
|
|
@@ -6109,7 +6120,9 @@ export const queryClient = new QueryClient({
|
|
|
6109
6120
|
toast.error(error.message, {
|
|
6110
6121
|
action: {
|
|
6111
6122
|
label: "retry",
|
|
6112
|
-
onClick:
|
|
6123
|
+
onClick: () => {
|
|
6124
|
+
query.invalidate();
|
|
6125
|
+
},
|
|
6113
6126
|
},
|
|
6114
6127
|
});
|
|
6115
6128
|
},
|
|
@@ -6179,7 +6192,9 @@ export const queryClient = new QueryClient({
|
|
|
6179
6192
|
toast.error(error.message, {
|
|
6180
6193
|
action: {
|
|
6181
6194
|
label: "retry",
|
|
6182
|
-
onClick:
|
|
6195
|
+
onClick: () => {
|
|
6196
|
+
query.invalidate();
|
|
6197
|
+
},
|
|
6183
6198
|
},
|
|
6184
6199
|
});
|
|
6185
6200
|
},
|
|
@@ -8889,28 +8904,20 @@ export const authClient = createAuthClient({
|
|
|
8889
8904
|
plugins: [convexClient(), crossDomainClient()],
|
|
8890
8905
|
});
|
|
8891
8906
|
`],
|
|
8892
|
-
["auth/better-auth/convex/web/react/tanstack-router/src/routes/dashboard.tsx.hbs", `import
|
|
8893
|
-
import SignUpForm from "@/components/sign-up-form";
|
|
8894
|
-
import UserMenu from "@/components/user-menu";
|
|
8907
|
+
["auth/better-auth/convex/web/react/tanstack-router/src/routes/_auth/dashboard.tsx.hbs", `import UserMenu from "@/components/user-menu";
|
|
8895
8908
|
{{#if (eq payments "polar")}}
|
|
8896
8909
|
import { CheckoutLink, CustomerPortalLink } from "@convex-dev/polar/react";
|
|
8897
8910
|
import { buttonVariants } from "@{{projectName}}/ui/components/button";
|
|
8898
8911
|
{{/if}}
|
|
8899
8912
|
import { api } from "@{{projectName}}/backend/convex/_generated/api";
|
|
8900
8913
|
import { createFileRoute } from "@tanstack/react-router";
|
|
8901
|
-
import {
|
|
8902
|
-
Authenticated,
|
|
8903
|
-
AuthLoading,
|
|
8904
|
-
Unauthenticated,
|
|
8905
|
-
useQuery,
|
|
8906
|
-
} from "convex/react";
|
|
8907
|
-
import { useState } from "react";
|
|
8914
|
+
import { useQuery } from "convex/react";
|
|
8908
8915
|
|
|
8909
|
-
export const Route = createFileRoute("/dashboard")({
|
|
8910
|
-
component:
|
|
8916
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
8917
|
+
component: DashboardContent,
|
|
8911
8918
|
});
|
|
8912
8919
|
|
|
8913
|
-
function
|
|
8920
|
+
function DashboardContent() {
|
|
8914
8921
|
const privateData = useQuery(api.privateData.get);
|
|
8915
8922
|
{{#if (eq payments "polar")}}
|
|
8916
8923
|
const products = useQuery(api.polar.listAllProducts);
|
|
@@ -8954,14 +8961,24 @@ function PrivateDashboardContent() {
|
|
|
8954
8961
|
</div>
|
|
8955
8962
|
);
|
|
8956
8963
|
}
|
|
8964
|
+
`],
|
|
8965
|
+
["auth/better-auth/convex/web/react/tanstack-router/src/routes/_auth/route.tsx.hbs", `import SignInForm from "@/components/sign-in-form";
|
|
8966
|
+
import SignUpForm from "@/components/sign-up-form";
|
|
8967
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
8968
|
+
import { Authenticated, AuthLoading, Unauthenticated } from "convex/react";
|
|
8969
|
+
import { useState } from "react";
|
|
8957
8970
|
|
|
8958
|
-
|
|
8971
|
+
export const Route = createFileRoute("/_auth")({
|
|
8972
|
+
component: AuthLayout,
|
|
8973
|
+
});
|
|
8974
|
+
|
|
8975
|
+
function AuthLayout() {
|
|
8959
8976
|
const [showSignIn, setShowSignIn] = useState(false);
|
|
8960
8977
|
|
|
8961
8978
|
return (
|
|
8962
8979
|
<>
|
|
8963
8980
|
<Authenticated>
|
|
8964
|
-
<
|
|
8981
|
+
<Outlet />
|
|
8965
8982
|
</Authenticated>
|
|
8966
8983
|
<Unauthenticated>
|
|
8967
8984
|
{showSignIn ? (
|
|
@@ -9338,40 +9355,20 @@ export const {
|
|
|
9338
9355
|
convexSiteUrl: env.VITE_CONVEX_SITE_URL,
|
|
9339
9356
|
});
|
|
9340
9357
|
`],
|
|
9341
|
-
["auth/better-auth/convex/web/react/tanstack-start/src/routes/
|
|
9342
|
-
import { handler } from "@/lib/auth-server";
|
|
9343
|
-
|
|
9344
|
-
export const Route = createFileRoute("/api/auth/$")({
|
|
9345
|
-
server: {
|
|
9346
|
-
handlers: {
|
|
9347
|
-
GET: ({ request }) => handler(request),
|
|
9348
|
-
POST: ({ request }) => handler(request),
|
|
9349
|
-
},
|
|
9350
|
-
},
|
|
9351
|
-
});
|
|
9352
|
-
`],
|
|
9353
|
-
["auth/better-auth/convex/web/react/tanstack-start/src/routes/dashboard.tsx.hbs", `import SignInForm from "@/components/sign-in-form";
|
|
9354
|
-
import SignUpForm from "@/components/sign-up-form";
|
|
9355
|
-
import UserMenu from "@/components/user-menu";
|
|
9358
|
+
["auth/better-auth/convex/web/react/tanstack-start/src/routes/_auth/dashboard.tsx.hbs", `import UserMenu from "@/components/user-menu";
|
|
9356
9359
|
{{#if (eq payments "polar")}}
|
|
9357
9360
|
import { CheckoutLink, CustomerPortalLink } from "@convex-dev/polar/react";
|
|
9358
9361
|
import { buttonVariants } from "@{{projectName}}/ui/components/button";
|
|
9359
9362
|
{{/if}}
|
|
9360
9363
|
import { api } from "@{{projectName}}/backend/convex/_generated/api";
|
|
9361
9364
|
import { createFileRoute } from "@tanstack/react-router";
|
|
9362
|
-
import {
|
|
9363
|
-
Authenticated,
|
|
9364
|
-
AuthLoading,
|
|
9365
|
-
Unauthenticated,
|
|
9366
|
-
useQuery,
|
|
9367
|
-
} from "convex/react";
|
|
9368
|
-
import { useState } from "react";
|
|
9365
|
+
import { useQuery } from "convex/react";
|
|
9369
9366
|
|
|
9370
|
-
export const Route = createFileRoute("/dashboard")({
|
|
9371
|
-
component:
|
|
9367
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
9368
|
+
component: DashboardContent,
|
|
9372
9369
|
});
|
|
9373
9370
|
|
|
9374
|
-
function
|
|
9371
|
+
function DashboardContent() {
|
|
9375
9372
|
const privateData = useQuery(api.privateData.get);
|
|
9376
9373
|
{{#if (eq payments "polar")}}
|
|
9377
9374
|
const products = useQuery(api.polar.listAllProducts);
|
|
@@ -9415,14 +9412,24 @@ function PrivateDashboardContent() {
|
|
|
9415
9412
|
</div>
|
|
9416
9413
|
);
|
|
9417
9414
|
}
|
|
9415
|
+
`],
|
|
9416
|
+
["auth/better-auth/convex/web/react/tanstack-start/src/routes/_auth/route.tsx.hbs", `import SignInForm from "@/components/sign-in-form";
|
|
9417
|
+
import SignUpForm from "@/components/sign-up-form";
|
|
9418
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
9419
|
+
import { Authenticated, AuthLoading, Unauthenticated } from "convex/react";
|
|
9420
|
+
import { useState } from "react";
|
|
9418
9421
|
|
|
9419
|
-
|
|
9422
|
+
export const Route = createFileRoute("/_auth")({
|
|
9423
|
+
component: AuthLayout,
|
|
9424
|
+
});
|
|
9425
|
+
|
|
9426
|
+
function AuthLayout() {
|
|
9420
9427
|
const [showSignIn, setShowSignIn] = useState(false);
|
|
9421
9428
|
|
|
9422
9429
|
return (
|
|
9423
9430
|
<>
|
|
9424
9431
|
<Authenticated>
|
|
9425
|
-
<
|
|
9432
|
+
<Outlet />
|
|
9426
9433
|
</Authenticated>
|
|
9427
9434
|
<Unauthenticated>
|
|
9428
9435
|
{showSignIn ? (
|
|
@@ -9437,6 +9444,18 @@ function RouteComponent() {
|
|
|
9437
9444
|
</>
|
|
9438
9445
|
);
|
|
9439
9446
|
}
|
|
9447
|
+
`],
|
|
9448
|
+
["auth/better-auth/convex/web/react/tanstack-start/src/routes/api/auth/$.ts.hbs", `import { createFileRoute } from "@tanstack/react-router";
|
|
9449
|
+
import { handler } from "@/lib/auth-server";
|
|
9450
|
+
|
|
9451
|
+
export const Route = createFileRoute("/api/auth/$")({
|
|
9452
|
+
server: {
|
|
9453
|
+
handlers: {
|
|
9454
|
+
GET: ({ request }) => handler(request),
|
|
9455
|
+
POST: ({ request }) => handler(request),
|
|
9456
|
+
},
|
|
9457
|
+
},
|
|
9458
|
+
});
|
|
9440
9459
|
`],
|
|
9441
9460
|
["auth/better-auth/fullstack/astro/src/env.d.ts.hbs", `/// <reference path="../.astro/types.d.ts" />
|
|
9442
9461
|
|
|
@@ -13414,7 +13433,7 @@ onMounted(async () => {
|
|
|
13414
13433
|
})
|
|
13415
13434
|
|
|
13416
13435
|
const hasProSubscription = computed(() =>
|
|
13417
|
-
customerState.value?.activeSubscriptions?.length
|
|
13436
|
+
(customerState.value?.activeSubscriptions?.length ?? 0) > 0
|
|
13418
13437
|
)
|
|
13419
13438
|
{{/if}}
|
|
13420
13439
|
<\/script>
|
|
@@ -13585,8 +13604,7 @@ export default function Dashboard({
|
|
|
13585
13604
|
{{/if}}
|
|
13586
13605
|
|
|
13587
13606
|
{{#if (eq payments "polar")}}
|
|
13588
|
-
const hasProSubscription = customerState?.activeSubscriptions?.length
|
|
13589
|
-
console.log("Active subscriptions:", customerState?.activeSubscriptions);
|
|
13607
|
+
const hasProSubscription = (customerState?.activeSubscriptions?.length ?? 0) > 0;
|
|
13590
13608
|
{{/if}}
|
|
13591
13609
|
|
|
13592
13610
|
return (
|
|
@@ -14408,7 +14426,7 @@ import { orpc } from "@/utils/orpc";
|
|
|
14408
14426
|
{{#if (eq api "trpc")}}
|
|
14409
14427
|
import { trpc } from "@/utils/trpc";
|
|
14410
14428
|
{{/if}}
|
|
14411
|
-
{{#if (
|
|
14429
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
14412
14430
|
import { useQuery } from "@tanstack/react-query";
|
|
14413
14431
|
{{/if}}
|
|
14414
14432
|
import { useEffect, useState } from "react";
|
|
@@ -14452,15 +14470,14 @@ export default function Dashboard() {
|
|
|
14452
14470
|
}
|
|
14453
14471
|
|
|
14454
14472
|
{{#if (eq payments "polar")}}
|
|
14455
|
-
const hasProSubscription = customerState?.activeSubscriptions?.length
|
|
14456
|
-
console.log("Active subscriptions:", customerState?.activeSubscriptions);
|
|
14473
|
+
const hasProSubscription = (customerState?.activeSubscriptions?.length ?? 0) > 0;
|
|
14457
14474
|
{{/if}}
|
|
14458
14475
|
|
|
14459
14476
|
return (
|
|
14460
14477
|
<div>
|
|
14461
14478
|
<h1>Dashboard</h1>
|
|
14462
14479
|
<p>Welcome {session?.user.name}</p>
|
|
14463
|
-
{{#if (
|
|
14480
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
14464
14481
|
<p>API: {privateData.data?.message}</p>
|
|
14465
14482
|
{{/if}}
|
|
14466
14483
|
{{#if (eq payments "polar")}}
|
|
@@ -14854,38 +14871,23 @@ export default function UserMenu() {
|
|
|
14854
14871
|
);
|
|
14855
14872
|
}
|
|
14856
14873
|
`],
|
|
14857
|
-
["auth/better-auth/web/react/tanstack-router/src/routes/dashboard.tsx.hbs", `{{#if (eq payments "polar")}}
|
|
14874
|
+
["auth/better-auth/web/react/tanstack-router/src/routes/_auth/dashboard.tsx.hbs", `{{#if (eq payments "polar")}}
|
|
14858
14875
|
import { Button } from "@{{projectName}}/ui/components/button";
|
|
14859
|
-
{{/if}}
|
|
14860
14876
|
import { authClient } from "@/lib/auth-client";
|
|
14877
|
+
{{/if}}
|
|
14861
14878
|
{{#if (eq api "orpc")}}
|
|
14862
14879
|
import { orpc } from "@/utils/orpc";
|
|
14863
14880
|
{{/if}}
|
|
14864
14881
|
{{#if (eq api "trpc")}}
|
|
14865
14882
|
import { trpc } from "@/utils/trpc";
|
|
14866
14883
|
{{/if}}
|
|
14867
|
-
{{#if (
|
|
14884
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
14868
14885
|
import { useQuery } from "@tanstack/react-query";
|
|
14869
14886
|
{{/if}}
|
|
14870
|
-
import { createFileRoute
|
|
14887
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
14871
14888
|
|
|
14872
|
-
export const Route = createFileRoute("/dashboard")({
|
|
14889
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
14873
14890
|
component: RouteComponent,
|
|
14874
|
-
beforeLoad: async () => {
|
|
14875
|
-
const session = await authClient.getSession();
|
|
14876
|
-
if (!session.data) {
|
|
14877
|
-
redirect({
|
|
14878
|
-
to: "/login",
|
|
14879
|
-
throw: true
|
|
14880
|
-
});
|
|
14881
|
-
}
|
|
14882
|
-
{{#if (eq payments "polar")}}
|
|
14883
|
-
const {data: customerState} = await authClient.customer.state()
|
|
14884
|
-
return { session, customerState };
|
|
14885
|
-
{{else}}
|
|
14886
|
-
return { session };
|
|
14887
|
-
{{/if}}
|
|
14888
|
-
}
|
|
14889
14891
|
});
|
|
14890
14892
|
|
|
14891
14893
|
function RouteComponent() {
|
|
@@ -14899,15 +14901,14 @@ function RouteComponent() {
|
|
|
14899
14901
|
{{/if}}
|
|
14900
14902
|
|
|
14901
14903
|
{{#if (eq payments "polar")}}
|
|
14902
|
-
const hasProSubscription = customerState?.activeSubscriptions?.length
|
|
14903
|
-
console.log("Active subscriptions:", customerState?.activeSubscriptions)
|
|
14904
|
+
const hasProSubscription = (customerState?.activeSubscriptions?.length ?? 0) > 0;
|
|
14904
14905
|
{{/if}}
|
|
14905
14906
|
|
|
14906
14907
|
return (
|
|
14907
14908
|
<div>
|
|
14908
14909
|
<h1>Dashboard</h1>
|
|
14909
14910
|
<p>Welcome {session.data?.user.name}</p>
|
|
14910
|
-
{{#if (
|
|
14911
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
14911
14912
|
<p>API: {privateData.data?.message}</p>
|
|
14912
14913
|
{{/if}}
|
|
14913
14914
|
{{#if (eq payments "polar")}}
|
|
@@ -14925,6 +14926,31 @@ function RouteComponent() {
|
|
|
14925
14926
|
</div>
|
|
14926
14927
|
);
|
|
14927
14928
|
}
|
|
14929
|
+
`],
|
|
14930
|
+
["auth/better-auth/web/react/tanstack-router/src/routes/_auth/route.tsx.hbs", `import { authClient } from "@/lib/auth-client";
|
|
14931
|
+
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
|
|
14932
|
+
|
|
14933
|
+
export const Route = createFileRoute("/_auth")({
|
|
14934
|
+
component: AuthLayout,
|
|
14935
|
+
beforeLoad: async () => {
|
|
14936
|
+
const session = await authClient.getSession();
|
|
14937
|
+
if (!session.data) {
|
|
14938
|
+
throw redirect({
|
|
14939
|
+
to: "/login",
|
|
14940
|
+
});
|
|
14941
|
+
}
|
|
14942
|
+
{{#if (eq payments "polar")}}
|
|
14943
|
+
const { data: customerState } = await authClient.customer.state();
|
|
14944
|
+
return { session, customerState };
|
|
14945
|
+
{{else}}
|
|
14946
|
+
return { session };
|
|
14947
|
+
{{/if}}
|
|
14948
|
+
},
|
|
14949
|
+
});
|
|
14950
|
+
|
|
14951
|
+
function AuthLayout() {
|
|
14952
|
+
return <Outlet />;
|
|
14953
|
+
}
|
|
14928
14954
|
`],
|
|
14929
14955
|
["auth/better-auth/web/react/tanstack-router/src/routes/login.tsx.hbs", `import SignInForm from "@/components/sign-in-form";
|
|
14930
14956
|
import SignUpForm from "@/components/sign-up-form";
|
|
@@ -15348,11 +15374,9 @@ export const authMiddleware = createMiddleware().server(
|
|
|
15348
15374
|
);
|
|
15349
15375
|
{{/if}}
|
|
15350
15376
|
`],
|
|
15351
|
-
["auth/better-auth/web/react/tanstack-start/src/routes/dashboard.tsx.hbs", `
|
|
15352
|
-
{{#if (eq payments "polar") }}
|
|
15377
|
+
["auth/better-auth/web/react/tanstack-start/src/routes/_auth/dashboard.tsx.hbs", `{{#if (eq payments "polar") }}
|
|
15353
15378
|
import { Button } from "@{{projectName}}/ui/components/button";
|
|
15354
15379
|
import { authClient } from "@/lib/auth-client";
|
|
15355
|
-
import { getPayment } from "@/functions/get-payment";
|
|
15356
15380
|
{{/if}}
|
|
15357
15381
|
{{#if (eq api "trpc") }}
|
|
15358
15382
|
import { useTRPC } from "@/utils/trpc";
|
|
@@ -15362,26 +15386,10 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
15362
15386
|
import { orpc } from "@/utils/orpc";
|
|
15363
15387
|
import { useQuery } from "@tanstack/react-query";
|
|
15364
15388
|
{{/if}}
|
|
15365
|
-
import { createFileRoute
|
|
15389
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
15366
15390
|
|
|
15367
|
-
export const Route = createFileRoute("/dashboard")({
|
|
15391
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
15368
15392
|
component: RouteComponent,
|
|
15369
|
-
beforeLoad: async () => {
|
|
15370
|
-
const session = await getUser();
|
|
15371
|
-
{{#if (eq payments "polar") }}
|
|
15372
|
-
const customerState = await getPayment();
|
|
15373
|
-
return { session, customerState };
|
|
15374
|
-
{{else}}
|
|
15375
|
-
return { session };
|
|
15376
|
-
{{/if}}
|
|
15377
|
-
},
|
|
15378
|
-
loader: async ({ context }) => {
|
|
15379
|
-
if (!context.session) {
|
|
15380
|
-
throw redirect({
|
|
15381
|
-
to: "/login",
|
|
15382
|
-
});
|
|
15383
|
-
}
|
|
15384
|
-
},
|
|
15385
15393
|
});
|
|
15386
15394
|
|
|
15387
15395
|
function RouteComponent() {
|
|
@@ -15397,13 +15405,16 @@ function RouteComponent() {
|
|
|
15397
15405
|
|
|
15398
15406
|
{{#if (eq payments "polar") }}
|
|
15399
15407
|
const hasProSubscription = (customerState?.activeSubscriptions?.length ?? 0) > 0;
|
|
15400
|
-
// For debugging: console.log("Active subscriptions:", customerState?.activeSubscriptions);
|
|
15401
15408
|
{{/if}}
|
|
15402
15409
|
|
|
15403
15410
|
return (
|
|
15404
15411
|
<div>
|
|
15405
15412
|
<h1>Dashboard</h1>
|
|
15413
|
+
{{#if (eq backend "self")}}
|
|
15406
15414
|
<p>Welcome {session?.user.name}</p>
|
|
15415
|
+
{{else}}
|
|
15416
|
+
<p>Welcome {session.data?.user.name}</p>
|
|
15417
|
+
{{/if}}
|
|
15407
15418
|
{{#if (eq api "trpc") }}
|
|
15408
15419
|
<p>API: {privateData.data?.message}</p>
|
|
15409
15420
|
{{else if (eq api "orpc") }}
|
|
@@ -15431,7 +15442,67 @@ function RouteComponent() {
|
|
|
15431
15442
|
{{/if}}
|
|
15432
15443
|
</div>
|
|
15433
15444
|
);
|
|
15434
|
-
}
|
|
15445
|
+
}
|
|
15446
|
+
`],
|
|
15447
|
+
["auth/better-auth/web/react/tanstack-start/src/routes/_auth/route.tsx.hbs", `{{#if (eq backend "self")}}
|
|
15448
|
+
import { getUser } from "@/functions/get-user";
|
|
15449
|
+
{{else}}
|
|
15450
|
+
import { authClient } from "@/lib/auth-client";
|
|
15451
|
+
{{/if}}
|
|
15452
|
+
{{#if (and (eq backend "self") (eq payments "polar"))}}
|
|
15453
|
+
import { getPayment } from "@/functions/get-payment";
|
|
15454
|
+
{{/if}}
|
|
15455
|
+
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
|
|
15456
|
+
|
|
15457
|
+
export const Route = createFileRoute("/_auth")({
|
|
15458
|
+
{{#unless (eq backend "self")}}
|
|
15459
|
+
ssr: false,
|
|
15460
|
+
{{/unless}}
|
|
15461
|
+
component: AuthLayout,
|
|
15462
|
+
beforeLoad: async () => {
|
|
15463
|
+
{{#if (eq backend "self")}}
|
|
15464
|
+
const session = await getUser();
|
|
15465
|
+
if (!session) {
|
|
15466
|
+
throw redirect({
|
|
15467
|
+
to: "/login",
|
|
15468
|
+
});
|
|
15469
|
+
}
|
|
15470
|
+
{{#if (eq payments "polar") }}
|
|
15471
|
+
const customerState = await getPayment();
|
|
15472
|
+
return { session, customerState };
|
|
15473
|
+
{{else}}
|
|
15474
|
+
return { session };
|
|
15475
|
+
{{/if}}
|
|
15476
|
+
{{else}}
|
|
15477
|
+
const session = await authClient.getSession();
|
|
15478
|
+
if (!session.data) {
|
|
15479
|
+
throw redirect({
|
|
15480
|
+
to: "/login",
|
|
15481
|
+
});
|
|
15482
|
+
}
|
|
15483
|
+
{{#if (eq payments "polar") }}
|
|
15484
|
+
const { data: customerState } = await authClient.customer.state();
|
|
15485
|
+
return { session, customerState };
|
|
15486
|
+
{{else}}
|
|
15487
|
+
return { session };
|
|
15488
|
+
{{/if}}
|
|
15489
|
+
{{/if}}
|
|
15490
|
+
},
|
|
15491
|
+
{{#if (eq backend "self")}}
|
|
15492
|
+
loader: async ({ context }) => {
|
|
15493
|
+
if (!context.session) {
|
|
15494
|
+
throw redirect({
|
|
15495
|
+
to: "/login",
|
|
15496
|
+
});
|
|
15497
|
+
}
|
|
15498
|
+
},
|
|
15499
|
+
{{/if}}
|
|
15500
|
+
});
|
|
15501
|
+
|
|
15502
|
+
function AuthLayout() {
|
|
15503
|
+
return <Outlet />;
|
|
15504
|
+
}
|
|
15505
|
+
`],
|
|
15435
15506
|
["auth/better-auth/web/react/tanstack-start/src/routes/login.tsx.hbs", `import SignInForm from "@/components/sign-in-form";
|
|
15436
15507
|
import SignUpForm from "@/components/sign-up-form";
|
|
15437
15508
|
import { createFileRoute } from "@tanstack/react-router";
|
|
@@ -15834,7 +15905,7 @@ function RouteComponent() {
|
|
|
15834
15905
|
|
|
15835
15906
|
{{#if (eq payments "polar")}}
|
|
15836
15907
|
const hasProSubscription = () =>
|
|
15837
|
-
customerState?.activeSubscriptions?.length
|
|
15908
|
+
(customerState?.activeSubscriptions?.length ?? 0) > 0;
|
|
15838
15909
|
{{/if}}
|
|
15839
15910
|
|
|
15840
15911
|
return (
|
|
@@ -16905,33 +16976,42 @@ export default function Dashboard() {
|
|
|
16905
16976
|
);
|
|
16906
16977
|
}
|
|
16907
16978
|
`],
|
|
16908
|
-
["auth/clerk/convex/web/react/tanstack-router/src/routes/dashboard.tsx.hbs", `import {
|
|
16979
|
+
["auth/clerk/convex/web/react/tanstack-router/src/routes/_auth/dashboard.tsx.hbs", `import { UserButton, useUser } from "@clerk/react";
|
|
16909
16980
|
import { api } from "@{{projectName}}/backend/convex/_generated/api";
|
|
16910
16981
|
import { createFileRoute } from "@tanstack/react-router";
|
|
16911
|
-
import {
|
|
16912
|
-
Authenticated,
|
|
16913
|
-
AuthLoading,
|
|
16914
|
-
Unauthenticated,
|
|
16915
|
-
useQuery,
|
|
16916
|
-
} from "convex/react";
|
|
16982
|
+
import { useQuery } from "convex/react";
|
|
16917
16983
|
|
|
16918
|
-
export const Route = createFileRoute("/dashboard")({
|
|
16984
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
16919
16985
|
component: RouteComponent,
|
|
16920
16986
|
});
|
|
16921
16987
|
|
|
16922
16988
|
function RouteComponent() {
|
|
16923
16989
|
const privateData = useQuery(api.privateData.get);
|
|
16924
|
-
const user = useUser()
|
|
16990
|
+
const user = useUser();
|
|
16925
16991
|
|
|
16992
|
+
return (
|
|
16993
|
+
<div>
|
|
16994
|
+
<h1>Dashboard</h1>
|
|
16995
|
+
<p>Welcome {user.user?.fullName}</p>
|
|
16996
|
+
<p>privateData: {privateData?.message}</p>
|
|
16997
|
+
<UserButton />
|
|
16998
|
+
</div>
|
|
16999
|
+
);
|
|
17000
|
+
}
|
|
17001
|
+
`],
|
|
17002
|
+
["auth/clerk/convex/web/react/tanstack-router/src/routes/_auth/route.tsx.hbs", `import { SignInButton } from "@clerk/react";
|
|
17003
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
17004
|
+
import { Authenticated, AuthLoading, Unauthenticated } from "convex/react";
|
|
17005
|
+
|
|
17006
|
+
export const Route = createFileRoute("/_auth")({
|
|
17007
|
+
component: AuthLayout,
|
|
17008
|
+
});
|
|
17009
|
+
|
|
17010
|
+
function AuthLayout() {
|
|
16926
17011
|
return (
|
|
16927
17012
|
<>
|
|
16928
17013
|
<Authenticated>
|
|
16929
|
-
<
|
|
16930
|
-
<h1>Dashboard</h1>
|
|
16931
|
-
<p>Welcome {user.user?.fullName}</p>
|
|
16932
|
-
<p>privateData: {privateData?.message}</p>
|
|
16933
|
-
<UserButton />
|
|
16934
|
-
</div>
|
|
17014
|
+
<Outlet />
|
|
16935
17015
|
</Authenticated>
|
|
16936
17016
|
<Unauthenticated>
|
|
16937
17017
|
<SignInButton />
|
|
@@ -16943,17 +17023,12 @@ function RouteComponent() {
|
|
|
16943
17023
|
);
|
|
16944
17024
|
}
|
|
16945
17025
|
`],
|
|
16946
|
-
["auth/clerk/convex/web/react/tanstack-start/src/routes/dashboard.tsx.hbs", `import {
|
|
17026
|
+
["auth/clerk/convex/web/react/tanstack-start/src/routes/_auth/dashboard.tsx.hbs", `import { UserButton, useUser } from "@clerk/tanstack-react-start";
|
|
16947
17027
|
import { api } from "@{{projectName}}/backend/convex/_generated/api";
|
|
16948
17028
|
import { createFileRoute } from "@tanstack/react-router";
|
|
16949
|
-
import {
|
|
16950
|
-
Authenticated,
|
|
16951
|
-
AuthLoading,
|
|
16952
|
-
Unauthenticated,
|
|
16953
|
-
useQuery,
|
|
16954
|
-
} from "convex/react";
|
|
17029
|
+
import { useQuery } from "convex/react";
|
|
16955
17030
|
|
|
16956
|
-
export const Route = createFileRoute("/dashboard")({
|
|
17031
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
16957
17032
|
component: RouteComponent,
|
|
16958
17033
|
});
|
|
16959
17034
|
|
|
@@ -16961,15 +17036,29 @@ function RouteComponent() {
|
|
|
16961
17036
|
const privateData = useQuery(api.privateData.get);
|
|
16962
17037
|
const user = useUser();
|
|
16963
17038
|
|
|
17039
|
+
return (
|
|
17040
|
+
<div>
|
|
17041
|
+
<h1>Dashboard</h1>
|
|
17042
|
+
<p>Welcome {user.user?.fullName}</p>
|
|
17043
|
+
<p>privateData: {privateData?.message}</p>
|
|
17044
|
+
<UserButton />
|
|
17045
|
+
</div>
|
|
17046
|
+
);
|
|
17047
|
+
}
|
|
17048
|
+
`],
|
|
17049
|
+
["auth/clerk/convex/web/react/tanstack-start/src/routes/_auth/route.tsx.hbs", `import { SignInButton } from "@clerk/tanstack-react-start";
|
|
17050
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
17051
|
+
import { Authenticated, AuthLoading, Unauthenticated } from "convex/react";
|
|
17052
|
+
|
|
17053
|
+
export const Route = createFileRoute("/_auth")({
|
|
17054
|
+
component: AuthLayout,
|
|
17055
|
+
});
|
|
17056
|
+
|
|
17057
|
+
function AuthLayout() {
|
|
16964
17058
|
return (
|
|
16965
17059
|
<>
|
|
16966
17060
|
<Authenticated>
|
|
16967
|
-
<
|
|
16968
|
-
<h1>Dashboard</h1>
|
|
16969
|
-
<p>Welcome {user.user?.fullName}</p>
|
|
16970
|
-
<p>privateData: {privateData?.message}</p>
|
|
16971
|
-
<UserButton />
|
|
16972
|
-
</div>
|
|
17061
|
+
<Outlet />
|
|
16973
17062
|
</Authenticated>
|
|
16974
17063
|
<Unauthenticated>
|
|
16975
17064
|
<SignInButton />
|
|
@@ -17651,7 +17740,7 @@ export default function Dashboard() {
|
|
|
17651
17740
|
);
|
|
17652
17741
|
}
|
|
17653
17742
|
`],
|
|
17654
|
-
["auth/clerk/web/react/tanstack-router/src/routes/dashboard.tsx.hbs", `{{#if (eq api "orpc")}}
|
|
17743
|
+
["auth/clerk/web/react/tanstack-router/src/routes/_auth/dashboard.tsx.hbs", `{{#if (eq api "orpc")}}
|
|
17655
17744
|
import { useQuery } from "@tanstack/react-query";
|
|
17656
17745
|
import { orpc } from "@/utils/orpc";
|
|
17657
17746
|
{{/if}}
|
|
@@ -17659,10 +17748,10 @@ import { orpc } from "@/utils/orpc";
|
|
|
17659
17748
|
import { useQuery } from "@tanstack/react-query";
|
|
17660
17749
|
import { trpc } from "@/utils/trpc";
|
|
17661
17750
|
{{/if}}
|
|
17662
|
-
import {
|
|
17751
|
+
import { UserButton, useUser } from "@clerk/react";
|
|
17663
17752
|
import { createFileRoute } from "@tanstack/react-router";
|
|
17664
17753
|
|
|
17665
|
-
export const Route = createFileRoute("/dashboard")({
|
|
17754
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
17666
17755
|
component: RouteComponent,
|
|
17667
17756
|
});
|
|
17668
17757
|
|
|
@@ -17689,6 +17778,28 @@ function RouteComponent() {
|
|
|
17689
17778
|
});
|
|
17690
17779
|
{{/if}}
|
|
17691
17780
|
|
|
17781
|
+
return (
|
|
17782
|
+
<div className="space-y-4 p-6">
|
|
17783
|
+
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
|
17784
|
+
<p>Welcome {displayName}</p>
|
|
17785
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
17786
|
+
<p>API: {privateData.data?.message}</p>
|
|
17787
|
+
{{/if}}
|
|
17788
|
+
<UserButton />
|
|
17789
|
+
</div>
|
|
17790
|
+
);
|
|
17791
|
+
}
|
|
17792
|
+
`],
|
|
17793
|
+
["auth/clerk/web/react/tanstack-router/src/routes/_auth/route.tsx.hbs", `import { SignInButton, useUser } from "@clerk/react";
|
|
17794
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
17795
|
+
|
|
17796
|
+
export const Route = createFileRoute("/_auth")({
|
|
17797
|
+
component: AuthLayout,
|
|
17798
|
+
});
|
|
17799
|
+
|
|
17800
|
+
function AuthLayout() {
|
|
17801
|
+
const user = useUser();
|
|
17802
|
+
|
|
17692
17803
|
if (!user.isLoaded) {
|
|
17693
17804
|
return <div className="p-6">Loading...</div>;
|
|
17694
17805
|
}
|
|
@@ -17701,19 +17812,10 @@ function RouteComponent() {
|
|
|
17701
17812
|
);
|
|
17702
17813
|
}
|
|
17703
17814
|
|
|
17704
|
-
return
|
|
17705
|
-
<div className="space-y-4 p-6">
|
|
17706
|
-
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
|
17707
|
-
<p>Welcome {displayName}</p>
|
|
17708
|
-
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
17709
|
-
<p>API: {privateData.data?.message}</p>
|
|
17710
|
-
{{/if}}
|
|
17711
|
-
<UserButton />
|
|
17712
|
-
</div>
|
|
17713
|
-
);
|
|
17815
|
+
return <Outlet />;
|
|
17714
17816
|
}
|
|
17715
17817
|
`],
|
|
17716
|
-
["auth/clerk/web/react/tanstack-start/src/routes/dashboard.tsx.hbs", `{{#if (eq api "trpc")}}
|
|
17818
|
+
["auth/clerk/web/react/tanstack-start/src/routes/_auth/dashboard.tsx.hbs", `{{#if (eq api "trpc")}}
|
|
17717
17819
|
import { useTRPC } from "@/utils/trpc";
|
|
17718
17820
|
import { useQuery } from "@tanstack/react-query";
|
|
17719
17821
|
{{/if}}
|
|
@@ -17721,10 +17823,10 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
17721
17823
|
import { useQuery } from "@tanstack/react-query";
|
|
17722
17824
|
import { orpc } from "@/utils/orpc";
|
|
17723
17825
|
{{/if}}
|
|
17724
|
-
import {
|
|
17826
|
+
import { UserButton, useUser } from "@clerk/tanstack-react-start";
|
|
17725
17827
|
import { createFileRoute } from "@tanstack/react-router";
|
|
17726
17828
|
|
|
17727
|
-
export const Route = createFileRoute("/dashboard")({
|
|
17829
|
+
export const Route = createFileRoute("/_auth/dashboard")({
|
|
17728
17830
|
component: RouteComponent,
|
|
17729
17831
|
});
|
|
17730
17832
|
|
|
@@ -17752,6 +17854,28 @@ function RouteComponent() {
|
|
|
17752
17854
|
});
|
|
17753
17855
|
{{/if}}
|
|
17754
17856
|
|
|
17857
|
+
return (
|
|
17858
|
+
<div className="space-y-4 p-6">
|
|
17859
|
+
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
|
17860
|
+
<p>Welcome {displayName}</p>
|
|
17861
|
+
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
17862
|
+
<p>API: {privateData.data?.message}</p>
|
|
17863
|
+
{{/if}}
|
|
17864
|
+
<UserButton />
|
|
17865
|
+
</div>
|
|
17866
|
+
);
|
|
17867
|
+
}
|
|
17868
|
+
`],
|
|
17869
|
+
["auth/clerk/web/react/tanstack-start/src/routes/_auth/route.tsx.hbs", `import { SignInButton, useUser } from "@clerk/tanstack-react-start";
|
|
17870
|
+
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
17871
|
+
|
|
17872
|
+
export const Route = createFileRoute("/_auth")({
|
|
17873
|
+
component: AuthLayout,
|
|
17874
|
+
});
|
|
17875
|
+
|
|
17876
|
+
function AuthLayout() {
|
|
17877
|
+
const user = useUser();
|
|
17878
|
+
|
|
17755
17879
|
if (!user.isLoaded) {
|
|
17756
17880
|
return <div className="p-6">Loading...</div>;
|
|
17757
17881
|
}
|
|
@@ -17764,16 +17888,7 @@ function RouteComponent() {
|
|
|
17764
17888
|
);
|
|
17765
17889
|
}
|
|
17766
17890
|
|
|
17767
|
-
return
|
|
17768
|
-
<div className="space-y-4 p-6">
|
|
17769
|
-
<h1 className="text-2xl font-semibold">Dashboard</h1>
|
|
17770
|
-
<p>Welcome {displayName}</p>
|
|
17771
|
-
{{#if (or (eq api "orpc") (eq api "trpc"))}}
|
|
17772
|
-
<p>API: {privateData.data?.message}</p>
|
|
17773
|
-
{{/if}}
|
|
17774
|
-
<UserButton />
|
|
17775
|
-
</div>
|
|
17776
|
-
);
|
|
17891
|
+
return <Outlet />;
|
|
17777
17892
|
}
|
|
17778
17893
|
`],
|
|
17779
17894
|
["auth/clerk/web/react/tanstack-start/src/start.ts.hbs", `import { clerkMiddleware } from '@clerk/tanstack-react-start/server'
|
|
@@ -27695,6 +27810,16 @@ export function useColorScheme() {
|
|
|
27695
27810
|
const { getDefaultConfig } = require("expo/metro-config");
|
|
27696
27811
|
|
|
27697
27812
|
const config = getDefaultConfig(__dirname);
|
|
27813
|
+
{{#if (or (eq webDeploy "cloudflare") (eq serverDeploy "cloudflare"))}}
|
|
27814
|
+
// Alchemy writes runtime state here; block it to avoid Metro refresh loops.
|
|
27815
|
+
const blockList = config.resolver.blockList ?? [];
|
|
27816
|
+
const blockListPatterns = Array.isArray(blockList) ? blockList : [blockList];
|
|
27817
|
+
|
|
27818
|
+
config.resolver.blockList = [
|
|
27819
|
+
...blockListPatterns,
|
|
27820
|
+
/[/\\\\]packages[/\\\\]infra[/\\\\]\\.alchemy(?:[/\\\\]|$)/,
|
|
27821
|
+
];
|
|
27822
|
+
{{/if}}
|
|
27698
27823
|
|
|
27699
27824
|
module.exports = config;
|
|
27700
27825
|
`],
|
|
@@ -28996,6 +29121,16 @@ import './unistyles';
|
|
|
28996
29121
|
["frontend/native/unistyles/metro.config.js.hbs", `const { getDefaultConfig } = require("expo/metro-config");
|
|
28997
29122
|
|
|
28998
29123
|
const config = getDefaultConfig(__dirname);
|
|
29124
|
+
{{#if (or (eq webDeploy "cloudflare") (eq serverDeploy "cloudflare"))}}
|
|
29125
|
+
// Alchemy writes runtime state here; block it to avoid Metro refresh loops.
|
|
29126
|
+
const blockList = config.resolver.blockList ?? [];
|
|
29127
|
+
const blockListPatterns = Array.isArray(blockList) ? blockList : [blockList];
|
|
29128
|
+
|
|
29129
|
+
config.resolver.blockList = [
|
|
29130
|
+
...blockListPatterns,
|
|
29131
|
+
/[/\\\\]packages[/\\\\]infra[/\\\\]\\.alchemy(?:[/\\\\]|$)/,
|
|
29132
|
+
];
|
|
29133
|
+
{{/if}}
|
|
28999
29134
|
|
|
29000
29135
|
module.exports = config;
|
|
29001
29136
|
`],
|
|
@@ -30113,6 +30248,16 @@ const { wrapWithReanimatedMetroConfig } = require("react-native-reanimated/metro
|
|
|
30113
30248
|
|
|
30114
30249
|
/** @type {import('expo/metro-config').MetroConfig} */
|
|
30115
30250
|
const config = getDefaultConfig(__dirname);
|
|
30251
|
+
{{#if (or (eq webDeploy "cloudflare") (eq serverDeploy "cloudflare"))}}
|
|
30252
|
+
// Alchemy writes runtime state here; block it to avoid Metro refresh loops.
|
|
30253
|
+
const blockList = config.resolver.blockList ?? [];
|
|
30254
|
+
const blockListPatterns = Array.isArray(blockList) ? blockList : [blockList];
|
|
30255
|
+
|
|
30256
|
+
config.resolver.blockList = [
|
|
30257
|
+
...blockListPatterns,
|
|
30258
|
+
/[/\\\\]packages[/\\\\]infra[/\\\\]\\.alchemy(?:[/\\\\]|$)/,
|
|
30259
|
+
];
|
|
30260
|
+
{{/if}}
|
|
30116
30261
|
|
|
30117
30262
|
const uniwindConfig = withUniwindConfig(wrapWithReanimatedMetroConfig(config), {
|
|
30118
30263
|
cssEntryFile: "./global.css",
|
|
@@ -31971,7 +32116,7 @@ import { getClerkAuthToken } from "@/utils/clerk-auth";
|
|
|
31971
32116
|
{{/if}}
|
|
31972
32117
|
{{else if (eq api "orpc")}}
|
|
31973
32118
|
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
|
|
31974
|
-
import {
|
|
32119
|
+
import { createQueryClient, orpc } from "./utils/orpc";
|
|
31975
32120
|
{{/if}}
|
|
31976
32121
|
{{/if}}
|
|
31977
32122
|
|
|
@@ -32011,19 +32156,23 @@ export function getRouter() {
|
|
|
32011
32156
|
}
|
|
32012
32157
|
{{else}}
|
|
32013
32158
|
{{#if (eq api "trpc")}}
|
|
32014
|
-
|
|
32015
|
-
|
|
32016
|
-
|
|
32017
|
-
|
|
32018
|
-
|
|
32019
|
-
|
|
32020
|
-
|
|
32021
|
-
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32025
|
-
|
|
32026
|
-
}
|
|
32159
|
+
function createQueryClient() {
|
|
32160
|
+
return new QueryClient({
|
|
32161
|
+
queryCache: new QueryCache({
|
|
32162
|
+
onError: (error, query) => {
|
|
32163
|
+
toast.error(error.message, {
|
|
32164
|
+
action: {
|
|
32165
|
+
label: "retry",
|
|
32166
|
+
onClick: () => {
|
|
32167
|
+
query.invalidate();
|
|
32168
|
+
},
|
|
32169
|
+
},
|
|
32170
|
+
});
|
|
32171
|
+
},
|
|
32172
|
+
}),
|
|
32173
|
+
defaultOptions: { queries: { staleTime: 60 * 1000 } },
|
|
32174
|
+
});
|
|
32175
|
+
}
|
|
32027
32176
|
|
|
32028
32177
|
const trpcClient = createTRPCClient<AppRouter>({
|
|
32029
32178
|
links: [
|
|
@@ -32046,15 +32195,20 @@ const trpcClient = createTRPCClient<AppRouter>({
|
|
|
32046
32195
|
}),
|
|
32047
32196
|
],
|
|
32048
32197
|
});
|
|
32049
|
-
|
|
32050
|
-
const trpc = createTRPCOptionsProxy({
|
|
32051
|
-
client: trpcClient,
|
|
32052
|
-
queryClient: queryClient,
|
|
32053
|
-
});
|
|
32054
32198
|
{{else if (eq api "orpc")}}
|
|
32055
32199
|
{{/if}}
|
|
32056
32200
|
|
|
32057
32201
|
export const getRouter = () => {
|
|
32202
|
+
{{#if (eq api "trpc")}}
|
|
32203
|
+
const queryClient = createQueryClient();
|
|
32204
|
+
const trpc = createTRPCOptionsProxy({
|
|
32205
|
+
client: trpcClient,
|
|
32206
|
+
queryClient,
|
|
32207
|
+
});
|
|
32208
|
+
{{else if (eq api "orpc")}}
|
|
32209
|
+
const queryClient = createQueryClient();
|
|
32210
|
+
{{/if}}
|
|
32211
|
+
|
|
32058
32212
|
const router = createTanStackRouter({
|
|
32059
32213
|
routeTree,
|
|
32060
32214
|
scrollRestoration: true,
|
|
@@ -33721,6 +33875,53 @@ const db = await D1Database("database", {
|
|
|
33721
33875
|
});
|
|
33722
33876
|
{{/if}}
|
|
33723
33877
|
|
|
33878
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
33879
|
+
export const server = await Worker("server", {
|
|
33880
|
+
cwd: "../../apps/server",
|
|
33881
|
+
entrypoint: "src/index.ts",
|
|
33882
|
+
compatibility: "node",
|
|
33883
|
+
url: true,
|
|
33884
|
+
bindings: {
|
|
33885
|
+
{{#if (eq dbSetup "d1")}}
|
|
33886
|
+
DB: db,
|
|
33887
|
+
{{else if (ne database "none")}}
|
|
33888
|
+
DATABASE_URL: alchemy.secret.env.DATABASE_URL!,
|
|
33889
|
+
{{/if}}
|
|
33890
|
+
CORS_ORIGIN: alchemy.env.CORS_ORIGIN!,
|
|
33891
|
+
{{#if (eq auth "better-auth")}}
|
|
33892
|
+
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET!,
|
|
33893
|
+
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL!,
|
|
33894
|
+
{{/if}}
|
|
33895
|
+
{{#if (eq auth "clerk")}}
|
|
33896
|
+
CLERK_SECRET_KEY: alchemy.secret.env.CLERK_SECRET_KEY!,
|
|
33897
|
+
{{#if (and (ne api "none") (or (eq backend "self") (eq backend "hono") (eq backend "elysia")))}}
|
|
33898
|
+
CLERK_PUBLISHABLE_KEY: alchemy.env.CLERK_PUBLISHABLE_KEY!,
|
|
33899
|
+
{{/if}}
|
|
33900
|
+
{{/if}}
|
|
33901
|
+
{{#if (includes examples "ai")}}
|
|
33902
|
+
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY!,
|
|
33903
|
+
{{/if}}
|
|
33904
|
+
{{#if (eq payments "polar")}}
|
|
33905
|
+
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN!,
|
|
33906
|
+
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL!,
|
|
33907
|
+
{{/if}}
|
|
33908
|
+
{{#if (eq dbSetup "turso")}}
|
|
33909
|
+
DATABASE_AUTH_TOKEN: alchemy.secret.env.DATABASE_AUTH_TOKEN!,
|
|
33910
|
+
{{/if}}
|
|
33911
|
+
{{#if (eq database "mysql")}}
|
|
33912
|
+
{{#if (eq orm "drizzle")}}
|
|
33913
|
+
DATABASE_HOST: alchemy.env.DATABASE_HOST!,
|
|
33914
|
+
DATABASE_USERNAME: alchemy.env.DATABASE_USERNAME!,
|
|
33915
|
+
DATABASE_PASSWORD: alchemy.secret.env.DATABASE_PASSWORD!,
|
|
33916
|
+
{{/if}}
|
|
33917
|
+
{{/if}}
|
|
33918
|
+
},
|
|
33919
|
+
dev: {
|
|
33920
|
+
port: 3000,
|
|
33921
|
+
},
|
|
33922
|
+
});
|
|
33923
|
+
{{/if}}
|
|
33924
|
+
|
|
33724
33925
|
{{#if (eq webDeploy "cloudflare")}}
|
|
33725
33926
|
{{#if (includes frontend "next")}}
|
|
33726
33927
|
export const web = await Nextjs("web", {
|
|
@@ -33732,8 +33933,12 @@ export const web = await Nextjs("web", {
|
|
|
33732
33933
|
NEXT_PUBLIC_CONVEX_SITE_URL: alchemy.env.NEXT_PUBLIC_CONVEX_SITE_URL!,
|
|
33733
33934
|
{{/if}}
|
|
33734
33935
|
{{else if (ne backend "self")}}
|
|
33936
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
33937
|
+
NEXT_PUBLIC_SERVER_URL: server.url!,
|
|
33938
|
+
{{else}}
|
|
33735
33939
|
NEXT_PUBLIC_SERVER_URL: alchemy.env.NEXT_PUBLIC_SERVER_URL!,
|
|
33736
33940
|
{{/if}}
|
|
33941
|
+
{{/if}}
|
|
33737
33942
|
{{#if (eq dbSetup "d1")}}
|
|
33738
33943
|
DB: db,
|
|
33739
33944
|
{{else if (ne database "none")}}
|
|
@@ -33786,8 +33991,12 @@ export const web = await Nuxt("web", {
|
|
|
33786
33991
|
NUXT_PUBLIC_CONVEX_SITE_URL: alchemy.env.NUXT_PUBLIC_CONVEX_SITE_URL!,
|
|
33787
33992
|
{{/if}}
|
|
33788
33993
|
{{else if (ne backend "self")}}
|
|
33994
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
33995
|
+
NUXT_PUBLIC_SERVER_URL: server.url!,
|
|
33996
|
+
{{else}}
|
|
33789
33997
|
NUXT_PUBLIC_SERVER_URL: alchemy.env.NUXT_PUBLIC_SERVER_URL!,
|
|
33790
33998
|
{{/if}}
|
|
33999
|
+
{{/if}}
|
|
33791
34000
|
{{#if (eq backend "self")}}
|
|
33792
34001
|
{{#if (eq dbSetup "d1")}}
|
|
33793
34002
|
DB: db,
|
|
@@ -33837,8 +34046,12 @@ export const web = await SvelteKit("web", {
|
|
|
33837
34046
|
PUBLIC_CONVEX_SITE_URL: alchemy.env.PUBLIC_CONVEX_SITE_URL!,
|
|
33838
34047
|
{{/if}}
|
|
33839
34048
|
{{else if (ne backend "self")}}
|
|
34049
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34050
|
+
PUBLIC_SERVER_URL: server.url!,
|
|
34051
|
+
{{else}}
|
|
33840
34052
|
PUBLIC_SERVER_URL: alchemy.env.PUBLIC_SERVER_URL!,
|
|
33841
34053
|
{{/if}}
|
|
34054
|
+
{{/if}}
|
|
33842
34055
|
{{#if (eq backend "self")}}
|
|
33843
34056
|
{{#if (eq dbSetup "d1")}}
|
|
33844
34057
|
DB: db,
|
|
@@ -33883,8 +34096,12 @@ export const web = await TanStackStart("web", {
|
|
|
33883
34096
|
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL!,
|
|
33884
34097
|
{{/if}}
|
|
33885
34098
|
{{else if (ne backend "self")}}
|
|
34099
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34100
|
+
VITE_SERVER_URL: server.url!,
|
|
34101
|
+
{{else}}
|
|
33886
34102
|
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL!,
|
|
33887
34103
|
{{/if}}
|
|
34104
|
+
{{/if}}
|
|
33888
34105
|
{{#if (eq dbSetup "d1")}}
|
|
33889
34106
|
DB: db,
|
|
33890
34107
|
{{else if (ne database "none")}}
|
|
@@ -33933,8 +34150,12 @@ export const web = await Vite("web", {
|
|
|
33933
34150
|
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL!,
|
|
33934
34151
|
{{/if}}
|
|
33935
34152
|
{{else if (ne backend "self")}}
|
|
34153
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34154
|
+
VITE_SERVER_URL: server.url!,
|
|
34155
|
+
{{else}}
|
|
33936
34156
|
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL!,
|
|
33937
34157
|
{{/if}}
|
|
34158
|
+
{{/if}}
|
|
33938
34159
|
}
|
|
33939
34160
|
});
|
|
33940
34161
|
{{else if (includes frontend "react-router")}}
|
|
@@ -33947,8 +34168,12 @@ export const web = await ReactRouter("web", {
|
|
|
33947
34168
|
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL!,
|
|
33948
34169
|
{{/if}}
|
|
33949
34170
|
{{else if (ne backend "self")}}
|
|
34171
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34172
|
+
VITE_SERVER_URL: server.url!,
|
|
34173
|
+
{{else}}
|
|
33950
34174
|
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL!,
|
|
33951
34175
|
{{/if}}
|
|
34176
|
+
{{/if}}
|
|
33952
34177
|
}
|
|
33953
34178
|
});
|
|
33954
34179
|
{{else if (includes frontend "solid")}}
|
|
@@ -33962,8 +34187,12 @@ export const web = await Vite("web", {
|
|
|
33962
34187
|
VITE_CONVEX_SITE_URL: alchemy.env.VITE_CONVEX_SITE_URL!,
|
|
33963
34188
|
{{/if}}
|
|
33964
34189
|
{{else if (ne backend "self")}}
|
|
34190
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34191
|
+
VITE_SERVER_URL: server.url!,
|
|
34192
|
+
{{else}}
|
|
33965
34193
|
VITE_SERVER_URL: alchemy.env.VITE_SERVER_URL!,
|
|
33966
34194
|
{{/if}}
|
|
34195
|
+
{{/if}}
|
|
33967
34196
|
}
|
|
33968
34197
|
});
|
|
33969
34198
|
{{else if (includes frontend "astro")}}
|
|
@@ -33976,8 +34205,12 @@ export const web = await Astro("web", {
|
|
|
33976
34205
|
{{/if}}
|
|
33977
34206
|
bindings: {
|
|
33978
34207
|
{{#if (ne backend "self")}}
|
|
34208
|
+
{{#if (eq serverDeploy "cloudflare")}}
|
|
34209
|
+
PUBLIC_SERVER_URL: server.url!,
|
|
34210
|
+
{{else}}
|
|
33979
34211
|
PUBLIC_SERVER_URL: alchemy.env.PUBLIC_SERVER_URL!,
|
|
33980
34212
|
{{/if}}
|
|
34213
|
+
{{/if}}
|
|
33981
34214
|
{{#if (eq backend "self")}}
|
|
33982
34215
|
{{#if (eq dbSetup "d1")}}
|
|
33983
34216
|
DB: db,
|
|
@@ -34009,52 +34242,6 @@ export const web = await Astro("web", {
|
|
|
34009
34242
|
{{/if}}
|
|
34010
34243
|
{{/if}}
|
|
34011
34244
|
|
|
34012
|
-
{{#if (eq serverDeploy "cloudflare")}}
|
|
34013
|
-
export const server = await Worker("server", {
|
|
34014
|
-
cwd: "../../apps/server",
|
|
34015
|
-
entrypoint: "src/index.ts",
|
|
34016
|
-
compatibility: "node",
|
|
34017
|
-
bindings: {
|
|
34018
|
-
{{#if (eq dbSetup "d1")}}
|
|
34019
|
-
DB: db,
|
|
34020
|
-
{{else if (ne database "none")}}
|
|
34021
|
-
DATABASE_URL: alchemy.secret.env.DATABASE_URL!,
|
|
34022
|
-
{{/if}}
|
|
34023
|
-
CORS_ORIGIN: alchemy.env.CORS_ORIGIN!,
|
|
34024
|
-
{{#if (eq auth "better-auth")}}
|
|
34025
|
-
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET!,
|
|
34026
|
-
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL!,
|
|
34027
|
-
{{/if}}
|
|
34028
|
-
{{#if (eq auth "clerk")}}
|
|
34029
|
-
CLERK_SECRET_KEY: alchemy.secret.env.CLERK_SECRET_KEY!,
|
|
34030
|
-
{{#if (and (ne api "none") (or (eq backend "self") (eq backend "hono") (eq backend "elysia")))}}
|
|
34031
|
-
CLERK_PUBLISHABLE_KEY: alchemy.env.CLERK_PUBLISHABLE_KEY!,
|
|
34032
|
-
{{/if}}
|
|
34033
|
-
{{/if}}
|
|
34034
|
-
{{#if (includes examples "ai")}}
|
|
34035
|
-
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY!,
|
|
34036
|
-
{{/if}}
|
|
34037
|
-
{{#if (eq payments "polar")}}
|
|
34038
|
-
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN!,
|
|
34039
|
-
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL!,
|
|
34040
|
-
{{/if}}
|
|
34041
|
-
{{#if (eq dbSetup "turso")}}
|
|
34042
|
-
DATABASE_AUTH_TOKEN: alchemy.secret.env.DATABASE_AUTH_TOKEN!,
|
|
34043
|
-
{{/if}}
|
|
34044
|
-
{{#if (eq database "mysql")}}
|
|
34045
|
-
{{#if (eq orm "drizzle")}}
|
|
34046
|
-
DATABASE_HOST: alchemy.env.DATABASE_HOST!,
|
|
34047
|
-
DATABASE_USERNAME: alchemy.env.DATABASE_USERNAME!,
|
|
34048
|
-
DATABASE_PASSWORD: alchemy.secret.env.DATABASE_PASSWORD!,
|
|
34049
|
-
{{/if}}
|
|
34050
|
-
{{/if}}
|
|
34051
|
-
},
|
|
34052
|
-
dev: {
|
|
34053
|
-
port: 3000,
|
|
34054
|
-
},
|
|
34055
|
-
});
|
|
34056
|
-
{{/if}}
|
|
34057
|
-
|
|
34058
34245
|
{{#if (and (eq webDeploy "cloudflare") (eq serverDeploy "cloudflare"))}}
|
|
34059
34246
|
console.log(\`Web -> \${web.url}\`);
|
|
34060
34247
|
console.log(\`Server -> \${server.url}\`);
|
|
@@ -35085,7 +35272,7 @@ function SuccessPage() {
|
|
|
35085
35272
|
</div>
|
|
35086
35273
|
`]
|
|
35087
35274
|
]);
|
|
35088
|
-
const TEMPLATE_COUNT =
|
|
35275
|
+
const TEMPLATE_COUNT = 483;
|
|
35089
35276
|
//#endregion
|
|
35090
35277
|
export { EMBEDDED_TEMPLATES, GeneratorError, Handlebars, TEMPLATE_COUNT, VirtualFileSystem, dependencyVersionMap, generate, generateReproducibleCommand, isBinaryFile, processAddonTemplates, processAddonsDeps, processFileContent, processTemplateString, transformFilename, writeBtsConfigToVfs };
|
|
35091
35278
|
|