create-better-t-stack 3.1.2 → 3.1.4-canary.78f76984
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.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-D0KtbO1R.js → src-Do-jrPff.js} +14 -5
- package/package.json +1 -1
- package/templates/db/drizzle/mysql/src/index.ts.hbs +8 -0
- package/templates/db/drizzle/postgres/src/index.ts.hbs +8 -0
- package/templates/db/drizzle/sqlite/src/index.ts.hbs +8 -0
- package/templates/frontend/native/nativewind/metro.config.js.hbs +5 -24
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1388,7 +1388,7 @@ const getLatestCLIVersion = () => {
|
|
|
1388
1388
|
*/
|
|
1389
1389
|
function isTelemetryEnabled() {
|
|
1390
1390
|
const BTS_TELEMETRY_DISABLED = process.env.BTS_TELEMETRY_DISABLED;
|
|
1391
|
-
const BTS_TELEMETRY = "
|
|
1391
|
+
const BTS_TELEMETRY = "0";
|
|
1392
1392
|
if (BTS_TELEMETRY_DISABLED !== void 0) return BTS_TELEMETRY_DISABLED !== "1";
|
|
1393
1393
|
if (BTS_TELEMETRY !== void 0) return BTS_TELEMETRY === "1";
|
|
1394
1394
|
return true;
|
|
@@ -1396,8 +1396,8 @@ function isTelemetryEnabled() {
|
|
|
1396
1396
|
|
|
1397
1397
|
//#endregion
|
|
1398
1398
|
//#region src/utils/analytics.ts
|
|
1399
|
-
const POSTHOG_API_KEY = "
|
|
1400
|
-
const POSTHOG_HOST = "
|
|
1399
|
+
const POSTHOG_API_KEY = "random";
|
|
1400
|
+
const POSTHOG_HOST = "random";
|
|
1401
1401
|
function generateSessionId() {
|
|
1402
1402
|
const rand = Math.random().toString(36).slice(2);
|
|
1403
1403
|
return `cli_${Date.now().toString(36)}${rand}`;
|
|
@@ -4184,7 +4184,7 @@ function getFrontendType(frontend) {
|
|
|
4184
4184
|
hasNative: frontend.some((f) => nativeFrontends.includes(f))
|
|
4185
4185
|
};
|
|
4186
4186
|
}
|
|
4187
|
-
function getApiDependencies(api, frontendType) {
|
|
4187
|
+
function getApiDependencies(api, frontendType, backend) {
|
|
4188
4188
|
const deps = {};
|
|
4189
4189
|
if (api === "orpc") deps.server = { dependencies: [
|
|
4190
4190
|
"@orpc/server",
|
|
@@ -4193,6 +4193,11 @@ function getApiDependencies(api, frontendType) {
|
|
|
4193
4193
|
"@orpc/zod"
|
|
4194
4194
|
] };
|
|
4195
4195
|
else if (api === "trpc") deps.server = { dependencies: ["@trpc/server", "@trpc/client"] };
|
|
4196
|
+
if (backend !== "self" && backend !== "convex" && backend !== "none") {
|
|
4197
|
+
if (!deps.server) deps.server = { dependencies: [] };
|
|
4198
|
+
if (backend === "hono") deps.server.dependencies.push("hono");
|
|
4199
|
+
else if (backend === "elysia") deps.server.dependencies.push("elysia");
|
|
4200
|
+
}
|
|
4196
4201
|
if (frontendType.hasReactWeb) {
|
|
4197
4202
|
if (api === "orpc") deps.web = { dependencies: [
|
|
4198
4203
|
"@orpc/tanstack-query",
|
|
@@ -4285,7 +4290,7 @@ async function setupApi(config) {
|
|
|
4285
4290
|
await fs.pathExists(serverDir);
|
|
4286
4291
|
const frontendType = getFrontendType(frontend);
|
|
4287
4292
|
if (!isConvex && api !== "none") {
|
|
4288
|
-
const apiDeps = getApiDependencies(api, frontendType);
|
|
4293
|
+
const apiDeps = getApiDependencies(api, frontendType, backend);
|
|
4289
4294
|
const apiPackageDir = path.join(projectDir, "packages/api");
|
|
4290
4295
|
if (apiDeps.server) {
|
|
4291
4296
|
await addPackageDependency({
|
|
@@ -4391,6 +4396,10 @@ async function setupBetterAuthPlugins(projectDir, config) {
|
|
|
4391
4396
|
pluginsToAdd.push("reactStartCookies()");
|
|
4392
4397
|
importsToAdd.push("import { reactStartCookies } from \"better-auth/react-start\";");
|
|
4393
4398
|
}
|
|
4399
|
+
if (config.backend === "self" && config.frontend?.includes("next")) {
|
|
4400
|
+
pluginsToAdd.push("nextCookies()");
|
|
4401
|
+
importsToAdd.push("import { nextCookies } from \"better-auth/next-js\";");
|
|
4402
|
+
}
|
|
4394
4403
|
if (config.frontend?.includes("native-nativewind") || config.frontend?.includes("native-unistyles")) {
|
|
4395
4404
|
pluginsToAdd.push("expo()");
|
|
4396
4405
|
importsToAdd.push("import { expo } from \"@better-auth/expo\";");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4-canary.78f76984",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
|
|
2
|
+
{{#if (and (ne backend "self") (includes frontend "next"))}}
|
|
3
|
+
import dotenv from "dotenv";
|
|
4
|
+
|
|
5
|
+
dotenv.config({
|
|
6
|
+
path: "../../apps/server/.env",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
{{/if}}
|
|
2
10
|
{{#if (eq dbSetup "planetscale")}}
|
|
3
11
|
import { drizzle } from "drizzle-orm/planetscale-serverless";
|
|
4
12
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
|
|
2
|
+
{{#if (and (ne backend "self") (includes frontend "next"))}}
|
|
3
|
+
import dotenv from "dotenv";
|
|
4
|
+
|
|
5
|
+
dotenv.config({
|
|
6
|
+
path: "../../apps/server/.env",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
{{/if}}
|
|
2
10
|
{{#if (eq dbSetup "neon")}}
|
|
3
11
|
import { neon, neonConfig } from '@neondatabase/serverless';
|
|
4
12
|
import { drizzle } from 'drizzle-orm/neon-http';
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{{#if (or (eq runtime "bun") (eq runtime "node") (eq runtime "none"))}}
|
|
2
|
+
{{#if (and (ne backend "self") (includes frontend "next"))}}
|
|
3
|
+
import dotenv from "dotenv";
|
|
4
|
+
|
|
5
|
+
dotenv.config({
|
|
6
|
+
path: "../../apps/server/.env",
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
{{/if}}
|
|
2
10
|
import { drizzle } from "drizzle-orm/libsql";
|
|
3
11
|
import { createClient } from "@libsql/client";
|
|
4
12
|
|
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
2
2
|
const { getDefaultConfig } = require("expo/metro-config");
|
|
3
|
-
const { FileStore } = require("metro-cache");
|
|
4
3
|
const { withNativeWind } = require("nativewind/metro");
|
|
5
|
-
const path = require("node:path");
|
|
6
4
|
|
|
7
|
-
const config =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}),
|
|
12
|
-
);
|
|
5
|
+
const config = withNativeWind(getDefaultConfig(__dirname), {
|
|
6
|
+
input: "./global.css",
|
|
7
|
+
configPath: "./tailwind.config.js",
|
|
8
|
+
});
|
|
13
9
|
|
|
14
10
|
config.resolver.unstable_enablePackageExports = true;
|
|
15
11
|
|
|
16
|
-
module.exports = config;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Move the Metro cache to the `.cache/metro` folder.
|
|
20
|
-
* If you have any environment variables, you can configure Turborepo to invalidate it when needed.
|
|
21
|
-
*
|
|
22
|
-
* @see https://turbo.build/repo/docs/reference/configuration#env
|
|
23
|
-
* @param {import('expo/metro-config').MetroConfig} config
|
|
24
|
-
* @returns {import('expo/metro-config').MetroConfig}
|
|
25
|
-
*/
|
|
26
|
-
function withTurborepoManagedCache(config) {
|
|
27
|
-
config.cacheStores = [
|
|
28
|
-
new FileStore({ root: path.join(__dirname, ".cache/metro") }),
|
|
29
|
-
];
|
|
30
|
-
return config;
|
|
31
|
-
}
|
|
12
|
+
module.exports = config;
|