stackkit 0.1.8 → 0.2.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/README.md +18 -24
- package/dist/cli/add.js +4 -4
- package/modules/auth/authjs/files/lib/auth.ts +1 -1
- package/modules/auth/authjs/generator.json +2 -2
- package/modules/auth/better-auth/files/lib/auth.ts +2 -2
- package/package.json +1 -1
- package/templates/express/README.md +48 -0
- package/templates/nextjs/README.md +28 -2
- package/templates/nextjs/app/page.tsx +3 -3
- package/templates/react/README.md +39 -3
- package/templates/react/src/pages/Home.tsx +3 -3
package/README.md
CHANGED
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
# StackKit CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI for scaffolding and composing modular JavaScript applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Quick Start
|
|
6
|
+
-----------
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
npm install -g stackkit
|
|
9
|
-
# or
|
|
10
|
-
npx stackkit
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Create New Project
|
|
8
|
+
Create a new project without installing globally:
|
|
14
9
|
|
|
15
10
|
```bash
|
|
16
|
-
npx stackkit create my-app
|
|
11
|
+
npx stackkit@latest create my-app
|
|
17
12
|
```
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
Add features to an existing project:
|
|
20
15
|
|
|
21
16
|
```bash
|
|
22
|
-
npx stackkit add
|
|
23
|
-
# or non-interactive
|
|
24
|
-
npx stackkit add auth
|
|
25
|
-
npx stackkit add database
|
|
17
|
+
npx stackkit@latest add <module>
|
|
26
18
|
```
|
|
27
19
|
|
|
28
|
-
|
|
20
|
+
Check project health:
|
|
29
21
|
|
|
30
22
|
```bash
|
|
31
|
-
npx stackkit doctor
|
|
23
|
+
npx stackkit@latest doctor
|
|
32
24
|
```
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
Supported technologies
|
|
27
|
+
----------------------
|
|
35
28
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
29
|
+
- Frameworks: Next.js, React, Express
|
|
30
|
+
- Databases: Prisma, Mongoose
|
|
31
|
+
- Auth: Auth.js / Better Auth
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
Links
|
|
34
|
+
-----
|
|
41
35
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
36
|
+
- Website: https://stackkit.tariqul.dev
|
|
37
|
+
- Repo: https://github.com/tariqul420/stackkit
|
package/dist/cli/add.js
CHANGED
|
@@ -44,15 +44,15 @@ async function getAddConfig(module, options, projectInfo) {
|
|
|
44
44
|
return await getInteractiveConfig(modulesDir, projectInfo);
|
|
45
45
|
}
|
|
46
46
|
// Only allow: no-arg interactive, or explicit category + --provider.
|
|
47
|
-
// Disallow positional provider names like `npx stackkit add better-auth` or
|
|
48
|
-
// `npx stackkit add auth prisma-postgresql` — require `--provider` flag.
|
|
47
|
+
// Disallow positional provider names like `npx stackkit@latest add better-auth` or
|
|
48
|
+
// `npx stackkit@latest add auth prisma-postgresql` — require `--provider` flag.
|
|
49
49
|
if (module === "database" || module === "auth") {
|
|
50
50
|
if (!options?.provider) {
|
|
51
51
|
if (module === "database") {
|
|
52
|
-
throw new Error("Provider is required for database. Use: `npx stackkit add database --provider <provider>`");
|
|
52
|
+
throw new Error("Provider is required for database. Use: `npx stackkit@latest add database --provider <provider>`");
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
throw new Error("Provider is required for auth. Use: `npx stackkit add auth --provider <provider>`");
|
|
55
|
+
throw new Error("Provider is required for auth. Use: `npx stackkit@latest add auth --provider <provider>`");
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
if (module === "database") {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{
|
|
17
17
|
"type": "create-file",
|
|
18
18
|
"destination": "proxy.ts",
|
|
19
|
-
"content": "export { auth as middleware } from \"@/auth\""
|
|
19
|
+
"content": "export { auth as middleware } from \"@/lib/auth\""
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"type": "patch-file",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"type": "add-dependency",
|
|
34
34
|
"condition": { "database": "prisma" },
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@auth/prisma-adapter": "^
|
|
36
|
+
"@auth/prisma-adapter": "^2.11.1"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -3,11 +3,11 @@ import { sendEmail } from "./email/email-service";
|
|
|
3
3
|
import { getVerificationEmailTemplate, getPasswordResetEmailTemplate } from "./email/email-templates";
|
|
4
4
|
{{#switch database}}
|
|
5
5
|
{{#case prisma}}
|
|
6
|
-
import { prisma } from "
|
|
6
|
+
import { prisma } from "./prisma";
|
|
7
7
|
import { prismaAdapter } from "better-auth/adapters/prisma";
|
|
8
8
|
{{/case}}
|
|
9
9
|
{{#case mongoose}}
|
|
10
|
-
import { mongoose } from "
|
|
10
|
+
import { mongoose } from "./mongoose";
|
|
11
11
|
import { mongodbAdapter } from "better-auth/adapters/mongodb";
|
|
12
12
|
{{/case}}
|
|
13
13
|
{{/switch}}
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Express Template
|
|
2
|
+
|
|
3
|
+
Production-ready Express (TypeScript) starter for building REST APIs and backend services.
|
|
4
|
+
|
|
5
|
+
Requirements
|
|
6
|
+
------------
|
|
7
|
+
|
|
8
|
+
- Node.js 18+ (LTS recommended)
|
|
9
|
+
- pnpm or npm
|
|
10
|
+
|
|
11
|
+
Quick Start
|
|
12
|
+
-----------
|
|
13
|
+
|
|
14
|
+
Install dependencies and start the development server:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# using pnpm (recommended)
|
|
18
|
+
pnpm install
|
|
19
|
+
pnpm dev
|
|
20
|
+
|
|
21
|
+
# or using npm
|
|
22
|
+
npm install
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Scripts
|
|
27
|
+
-------
|
|
28
|
+
|
|
29
|
+
- `npm run dev` - Start development server
|
|
30
|
+
- `npm run build` - Build TypeScript
|
|
31
|
+
- `npm start` - Start production server
|
|
32
|
+
|
|
33
|
+
Environment
|
|
34
|
+
-----------
|
|
35
|
+
|
|
36
|
+
Use a `.env` file or environment variables for configuration. See `.env.example` for available keys.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Generated with StackKit
|
|
41
|
+
|
|
42
|
+
This project was scaffolded using **StackKit** — a CLI toolkit for building production-ready applications.
|
|
43
|
+
|
|
44
|
+
- Generated via: `npx stackkit@latest create`
|
|
45
|
+
|
|
46
|
+
Learn more about StackKit:
|
|
47
|
+
https://github.com/tariqul420/stackkit
|
|
48
|
+
|
|
@@ -2,9 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Production-ready Next.js starter with TypeScript and App Router.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Requirements
|
|
6
|
+
------------
|
|
7
|
+
|
|
8
|
+
- Node.js 18+ (LTS recommended)
|
|
9
|
+
- pnpm or npm
|
|
10
|
+
|
|
11
|
+
Quick Start
|
|
12
|
+
-----------
|
|
13
|
+
|
|
14
|
+
Install dependencies and start a development server:
|
|
6
15
|
|
|
7
16
|
```bash
|
|
17
|
+
# using pnpm (recommended)
|
|
18
|
+
pnpm install
|
|
19
|
+
pnpm dev
|
|
20
|
+
|
|
21
|
+
# or using npm
|
|
8
22
|
npm install
|
|
9
23
|
npm run dev
|
|
10
24
|
```
|
|
@@ -40,7 +54,7 @@ public/ # Static assets
|
|
|
40
54
|
|
|
41
55
|
## Environment Variables
|
|
42
56
|
|
|
43
|
-
Create `.env.local` file for environment variables.
|
|
57
|
+
Create a `.env.local` (Next.js) file for local environment variables. Keep secrets out of the repository.
|
|
44
58
|
|
|
45
59
|
## Deployment
|
|
46
60
|
|
|
@@ -50,3 +64,15 @@ npm run start
|
|
|
50
64
|
```
|
|
51
65
|
|
|
52
66
|
Deploy to Vercel, Netlify, or any Node.js hosting service.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Generated with StackKit
|
|
71
|
+
|
|
72
|
+
This project was scaffolded using **StackKit** — a CLI toolkit for building production-ready applications.
|
|
73
|
+
|
|
74
|
+
- Generated via: `npx stackkit@latest create`
|
|
75
|
+
|
|
76
|
+
Learn more about StackKit:
|
|
77
|
+
https://github.com/tariqul420/stackkit
|
|
78
|
+
|
|
@@ -5,7 +5,7 @@ export default function Home() {
|
|
|
5
5
|
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
|
6
6
|
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
|
7
7
|
<div className="flex items-center gap-4 mb-8">
|
|
8
|
-
<div className="text-2xl font-bold text-black dark:text-white">
|
|
8
|
+
<div className="text-2xl font-bold text-black dark:text-white">StackKit</div>
|
|
9
9
|
<span className="text-xl text-zinc-400">+</span>
|
|
10
10
|
<Image
|
|
11
11
|
className="dark:invert"
|
|
@@ -21,14 +21,14 @@ export default function Home() {
|
|
|
21
21
|
To get started, edit the page.tsx file.
|
|
22
22
|
</h1>
|
|
23
23
|
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
|
|
24
|
-
This template includes Next.js, Tailwind CSS, and
|
|
24
|
+
This template includes Next.js, Tailwind CSS, and StackKit best practices. Check out the{" "}
|
|
25
25
|
<a
|
|
26
26
|
href="https://github.com/tariqul420/stackkit"
|
|
27
27
|
className="font-medium text-zinc-950 dark:text-zinc-50 hover:underline"
|
|
28
28
|
target="_blank"
|
|
29
29
|
rel="noopener noreferrer"
|
|
30
30
|
>
|
|
31
|
-
|
|
31
|
+
StackKit repository
|
|
32
32
|
</a>{" "}
|
|
33
33
|
for more info.
|
|
34
34
|
</p>
|
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Production-ready React starter with TypeScript, Vite, and essential libraries.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Requirements
|
|
6
|
+
------------
|
|
7
|
+
|
|
8
|
+
- Node.js 18+ (LTS recommended)
|
|
9
|
+
- pnpm (recommended) or npm
|
|
10
|
+
|
|
11
|
+
Quick Start
|
|
12
|
+
-----------
|
|
13
|
+
|
|
14
|
+
Install dependencies and run the dev server:
|
|
6
15
|
|
|
7
16
|
```bash
|
|
17
|
+
# using pnpm (recommended)
|
|
8
18
|
pnpm install
|
|
9
19
|
pnpm dev
|
|
20
|
+
|
|
21
|
+
# or using npm
|
|
22
|
+
npm install
|
|
23
|
+
npm run dev
|
|
10
24
|
```
|
|
11
25
|
|
|
12
26
|
## Features
|
|
@@ -27,7 +41,9 @@ pnpm dev
|
|
|
27
41
|
|
|
28
42
|
## Environment Variables
|
|
29
43
|
|
|
30
|
-
Copy `.env.example` to `.env` and configure
|
|
44
|
+
Copy `.env.example` to `.env` and configure local values. Do not commit secrets.
|
|
45
|
+
|
|
46
|
+
Example:
|
|
31
47
|
|
|
32
48
|
```env
|
|
33
49
|
VITE_API_URL=http://localhost:3000/api
|
|
@@ -49,8 +65,28 @@ src/
|
|
|
49
65
|
|
|
50
66
|
## Deployment
|
|
51
67
|
|
|
68
|
+
Build for production and serve or deploy the static output:
|
|
69
|
+
|
|
52
70
|
```bash
|
|
71
|
+
# pnpm
|
|
53
72
|
pnpm build
|
|
73
|
+
pnpm preview
|
|
74
|
+
|
|
75
|
+
# npm
|
|
76
|
+
npm run build
|
|
77
|
+
npm run preview
|
|
54
78
|
```
|
|
55
79
|
|
|
56
|
-
Deploy the `dist
|
|
80
|
+
Deploy the resulting `dist`/build output to your hosting platform (Vercel, Netlify, etc.).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Generated with StackKit
|
|
85
|
+
|
|
86
|
+
This project was scaffolded using **StackKit** — a CLI toolkit for building production-ready applications.
|
|
87
|
+
|
|
88
|
+
- Generated via: `npx stackkit@latest create`
|
|
89
|
+
|
|
90
|
+
Learn more about StackKit:
|
|
91
|
+
https://github.com/tariqul420/stackkit
|
|
92
|
+
|
|
@@ -7,7 +7,7 @@ export default function Home() {
|
|
|
7
7
|
<div className="flex min-h-screen items-center justify-center bg-black">
|
|
8
8
|
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-black sm:items-start">
|
|
9
9
|
<div className="flex items-center gap-4 mb-8">
|
|
10
|
-
<div className="text-2xl font-bold text-white">
|
|
10
|
+
<div className="text-2xl font-bold text-white">StackKit</div>
|
|
11
11
|
<span className="text-xl text-zinc-400">+</span>
|
|
12
12
|
<img src="https://react.dev/favicon.ico" alt="React logo" width={32} height={32} />
|
|
13
13
|
</div>
|
|
@@ -28,7 +28,7 @@ export default function Home() {
|
|
|
28
28
|
|
|
29
29
|
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
|
|
30
30
|
<a
|
|
31
|
-
className="flex h-12 w-full items-center justify-center rounded-full bg-white text-black px-5 transition-colors hover:bg-zinc-200 md:w-
|
|
31
|
+
className="flex h-12 w-full items-center justify-center rounded-full bg-white text-black px-5 transition-colors hover:bg-zinc-200 md:w-40"
|
|
32
32
|
href="https://react.dev"
|
|
33
33
|
target="_blank"
|
|
34
34
|
rel="noopener noreferrer"
|
|
@@ -36,7 +36,7 @@ export default function Home() {
|
|
|
36
36
|
Get Started
|
|
37
37
|
</a>
|
|
38
38
|
<a
|
|
39
|
-
className="flex h-12 w-full items-center justify-center rounded-full px-5 transition-colors hover:
|
|
39
|
+
className="flex h-12 w-full items-center justify-center rounded-full bg-black text-white px-5 transition-colors hover:bg-zinc-900 md:w-40"
|
|
40
40
|
href="/about"
|
|
41
41
|
>
|
|
42
42
|
Documentation
|