create-restack-pattern 0.1.0 → 0.1.1

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
  Scaffold a new Next.js + Hono + Drizzle ORM monorepo using the Restack Pattern
4
4
  (Semi-DDD / Feature-Driven) architecture — the same template built out in
5
- [the main repo](../../README.md), bundled as a copy-and-go generator.
5
+ [the main repo](https://github.com/NicholasChandraa/restack-pattern), bundled as a copy-and-go generator.
6
6
 
7
7
  ## Usage
8
8
 
@@ -51,8 +51,7 @@ pnpm --filter frontend dev # http://localhost:3000
51
51
  This is the first, deliberately minimal version of the CLI. It does not yet
52
52
  ask about package manager, database, or auth-provider choices — it always
53
53
  scaffolds the exact pnpm + Postgres + Drizzle stack from the template as-is.
54
- Those choices are tracked as follow-up work in the main repo's
55
- `docs/concerns.md`.
54
+ Those choices are tracked as follow-up work in the main repository's roadmap.
56
55
 
57
56
  ## For maintainers: keeping the template in sync
58
57
 
package/dist/index.js CHANGED
@@ -26,7 +26,24 @@ function renameGitignoreFilesBack(dir) {
26
26
  renameSync(full, path.join(dir, ".gitignore"));
27
27
  }
28
28
  }
29
+ function isPnpmInstalled() {
30
+ try {
31
+ execSync("pnpm --version", { stdio: "ignore" });
32
+ return true;
33
+ }
34
+ catch {
35
+ return false;
36
+ }
37
+ }
29
38
  async function main() {
39
+ if (!isPnpmInstalled()) {
40
+ console.error("\n\x1b[31mError: pnpm is not installed.\x1b[0m");
41
+ console.error("This template is configured as a pnpm workspace monorepo and requires pnpm to run.");
42
+ console.error("Please install pnpm before continuing:");
43
+ console.error(" npm install -g pnpm");
44
+ console.error("Or visit https://pnpm.io for more installation options.\n");
45
+ process.exit(1);
46
+ }
30
47
  const argName = process.argv[2];
31
48
  const projectName = argName ?? (await promptProjectName());
32
49
  if (!projectName || !isValidProjectName(projectName)) {
@@ -59,12 +76,32 @@ async function main() {
59
76
  // git not available — non-fatal, scaffolding still succeeded
60
77
  }
61
78
  console.log(`
62
- Done! Next steps:
79
+ \x1b[32m✔ Scaffolded project successfully!\x1b[0m
80
+
81
+ Next steps to get started:
82
+
83
+ 1. Go to your project directory:
84
+ \x1b[36mcd ${projectName}\x1b[0m
85
+
86
+ 2. Configure environment variables:
87
+ • For Backend:
88
+ \x1b[36mcp backend/.env.example backend/.env\x1b[0m
89
+ (Open backend/.env and set \x1b[33mDATABASE_URL\x1b[0m and a min-32-chars \x1b[33mJWT_SECRET\x1b[0m)
90
+
91
+ • For Frontend:
92
+ \x1b[36mcp frontend/.env.example frontend/.env.local\x1b[0m
93
+
94
+ 3. Push database tables (creates users & auth_sessions tables):
95
+ \x1b[36mpnpm --filter backend db:push\x1b[0m
96
+
97
+ 4. Start development servers:
98
+ • Backend (running at http://localhost:3001):
99
+ \x1b[36mpnpm --filter backend dev\x1b[0m
100
+
101
+ • Frontend (running at http://localhost:3000):
102
+ \x1b[36mpnpm --filter frontend dev\x1b[0m
63
103
 
64
- cd ${projectName}
65
- cp backend/.env.example backend/.env # fill in DATABASE_URL and JWT_SECRET
66
- pnpm --filter backend dev
67
- pnpm --filter frontend dev
104
+ Enjoy building your app with the Restack Pattern!
68
105
  `);
69
106
  }
70
107
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-restack-pattern",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Scaffold a new Next.js + Hono + Drizzle monorepo using the Restack Pattern (Semi-DDD) template.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -5,4 +5,4 @@ PORT=3001
5
5
  FRONTEND_URL=http://localhost:3000,https://myapp.vercel.app
6
6
  # COOKIE_SAME_SITE=Lax # override default (None in production, Lax in development)
7
7
  # COOKIE_DOMAIN=.example.com # only set if FE/BE share a domain, e.g. app.example.com + api.example.com
8
- # # see docs/deployment-verification.md before deploying cross-domain
8
+ # # see docs/deployment-verification.md before deploying cross-domain
@@ -0,0 +1 @@
1
+ NEXT_PUBLIC_API_URL=http://localhost:3001
@@ -32,4 +32,9 @@ Thumbs.db
32
32
  .idea/
33
33
 
34
34
  # Claude Code local overrides (personal, not shared with the team)
35
- .claude/settings.local.json
35
+ .claude/settings.local.json
36
+ test-project/
37
+ test-app/
38
+
39
+ # Exclude concerns from git
40
+ docs/concerns.md