@amirulabu/create-recurring-rabbit-app 0.2.45 → 0.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> A production-ready CLI tool that scaffolds an opinionated micro‑SaaS starter with TanStack Start, tRPC, Drizzle, Better-auth, and Tailwind CSS.
|
|
4
4
|
|
|
5
|
-
**Current Version**: v0.2.
|
|
5
|
+
**Current Version**: v0.2.45 | **Status**: ✅ Production Ready - Ready for Public Launch
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
package/dist/index.js
CHANGED
|
@@ -11,16 +11,24 @@ import crypto from 'crypto';
|
|
|
11
11
|
|
|
12
12
|
async function copyTemplateFiles(templateDir, targetDir) {
|
|
13
13
|
const copyRecursive = async (src, dest) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
try {
|
|
15
|
+
const stat = await fs.stat(src);
|
|
16
|
+
if (stat.isDirectory()) {
|
|
17
|
+
const entries = await fs.readdir(src);
|
|
18
|
+
await fs.mkdir(dest, { recursive: true });
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
const srcPath = path6.join(src, entry);
|
|
21
|
+
const destPath = path6.join(dest, entry);
|
|
22
|
+
await copyRecursive(srcPath, destPath);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
const destParentDir = path6.dirname(dest);
|
|
26
|
+
await fs.mkdir(destParentDir, { recursive: true });
|
|
27
|
+
await fs.copyFile(src, dest);
|
|
20
28
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.error(`Failed to copy ${src} to ${dest}:`, error);
|
|
31
|
+
throw error;
|
|
24
32
|
}
|
|
25
33
|
};
|
|
26
34
|
await copyRecursive(templateDir, targetDir);
|
|
@@ -28,6 +36,30 @@ async function copyTemplateFiles(templateDir, targetDir) {
|
|
|
28
36
|
async function copyDirectory(src, dest) {
|
|
29
37
|
await copyTemplateFiles(src, dest);
|
|
30
38
|
}
|
|
39
|
+
async function verifyTemplateCopy(templateDir, targetDir) {
|
|
40
|
+
const verifyRecursive = async (src, dest) => {
|
|
41
|
+
const srcStat = await fs.stat(src);
|
|
42
|
+
if (srcStat.isDirectory()) {
|
|
43
|
+
const destPath = dest;
|
|
44
|
+
const destExists = await fs.access(destPath).then(() => true).catch(() => false);
|
|
45
|
+
if (!destExists) {
|
|
46
|
+
throw new Error(`Directory not copied: ${destPath}`);
|
|
47
|
+
}
|
|
48
|
+
const entries = await fs.readdir(src);
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const srcEntryPath = path6.join(src, entry);
|
|
51
|
+
const destEntryPath = path6.join(dest, entry);
|
|
52
|
+
await verifyRecursive(srcEntryPath, destEntryPath);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
const destExists = await fs.access(dest).then(() => true).catch(() => false);
|
|
56
|
+
if (!destExists) {
|
|
57
|
+
throw new Error(`File not copied: ${dest}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
await verifyRecursive(templateDir, targetDir);
|
|
62
|
+
}
|
|
31
63
|
async function generatePackageJson(targetDir, config) {
|
|
32
64
|
const packageJsonPath = path6.join(targetDir, "package.json");
|
|
33
65
|
const packageJson = {
|
|
@@ -71,7 +103,7 @@ async function generatePackageJson(targetDir, config) {
|
|
|
71
103
|
"@trpc/react-query": "^11.8.1",
|
|
72
104
|
"@trpc/server": "^11.8.1",
|
|
73
105
|
"@t3-oss/env-core": "^0.10.0",
|
|
74
|
-
"better-auth": "
|
|
106
|
+
"better-auth": "~1.2.12",
|
|
75
107
|
"better-sqlite3": "^12.0.0",
|
|
76
108
|
"class-variance-authority": "^0.7.0",
|
|
77
109
|
clsx: "^2.1.0",
|
|
@@ -95,7 +127,7 @@ async function generatePackageJson(targetDir, config) {
|
|
|
95
127
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
96
128
|
"@typescript-eslint/parser": "^8.0.0",
|
|
97
129
|
"@vitejs/plugin-react": "^4.3.0",
|
|
98
|
-
"@vitest/coverage-v8": "^
|
|
130
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
99
131
|
eslint: "^9.39.2",
|
|
100
132
|
"eslint-plugin-react": "^7.37.0",
|
|
101
133
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
@@ -595,6 +627,7 @@ async function scaffoldProject(projectName, targetPath) {
|
|
|
595
627
|
spinner.succeed("Project directory will be created");
|
|
596
628
|
spinner.start("Copying template files...");
|
|
597
629
|
await copyDirectory(TEMPLATE_DIR, projectPath);
|
|
630
|
+
await verifyTemplateCopy(TEMPLATE_DIR, projectPath);
|
|
598
631
|
projectCreated = true;
|
|
599
632
|
spinner.succeed("Template files copied");
|
|
600
633
|
spinner.start("Generating package.json...");
|
package/package.json
CHANGED
|
@@ -16,11 +16,9 @@
|
|
|
16
16
|
* When the dev server runs, this file will be replaced with the full route tree.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { rootRoute } from './__root'
|
|
20
|
-
|
|
21
19
|
// Stub route tree - this allows TypeScript to compile without errors
|
|
22
20
|
// The real route tree with proper types will be generated when you run the dev server
|
|
23
|
-
export const routeTree =
|
|
21
|
+
export const routeTree = {} as any
|
|
24
22
|
|
|
25
23
|
// Type augmentation to allow any route ID during development
|
|
26
24
|
declare module '@tanstack/react-router' {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { betterAuth } from 'better-auth'
|
|
29
29
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
|
30
|
-
import {
|
|
30
|
+
import { reactStartCookies } from 'better-auth/react-start'
|
|
31
31
|
import { db } from '@/server/db'
|
|
32
32
|
import { users, sessions, accounts, verifications } from '@/server/db/schema'
|
|
33
33
|
import { env } from '@/lib/env'
|
|
@@ -258,8 +258,8 @@ export const auth = betterAuth({
|
|
|
258
258
|
*
|
|
259
259
|
* Extends better-auth functionality with additional features.
|
|
260
260
|
*
|
|
261
|
-
* IMPORTANT:
|
|
261
|
+
* IMPORTANT: reactStartCookies plugin must be the LAST plugin in the array
|
|
262
262
|
* to ensure proper cookie handling for TanStack Start.
|
|
263
263
|
*/
|
|
264
|
-
plugins: [
|
|
264
|
+
plugins: [reactStartCookies()],
|
|
265
265
|
})
|