nextworks 0.1.0-alpha.5 → 0.1.0-alpha.7
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 +8 -10
- package/dist/cli_manifests/auth_manifest.json +1 -0
- package/dist/cli_manifests/blocks_manifest.json +1 -0
- package/dist/cli_manifests/data_manifest.json +1 -0
- package/dist/cli_manifests/forms_manifest.json +1 -0
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/kits/auth-core/LICENSE +21 -0
- package/dist/kits/blocks/LICENSE +21 -0
- package/dist/kits/data/LICENSE +21 -0
- package/dist/kits/forms/LICENSE +21 -0
- package/package.json +9 -4
- package/dist/.gitkeep +0 -0
- package/dist/kits/auth-core/README.md +0 -106
- package/dist/kits/blocks/README.md +0 -53
- package/dist/kits/blocks/components/ui/button_bck.tsx +0 -93
- package/dist/kits/blocks/lib/themes_old.ts +0 -37
- package/dist/kits/blocks/notes/THEMING_CONVERSION_SUMMARY.md +0 -14
- package/dist/kits/data/README.md +0 -104
- package/dist/kits/forms/README.md +0 -49
package/README.md
CHANGED
|
@@ -19,6 +19,14 @@ Nextworks is a CLI that installs **modular Next.js building blocks** into your a
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
+
## Feedback / Contact
|
|
23
|
+
|
|
24
|
+
Nextworks is early‑access alpha and I’m actively looking for feedback from early testers. If you run into issues, have questions, or want to suggest improvements or pro‑level features, I’m happy to help and would really appreciate hearing from you:
|
|
25
|
+
|
|
26
|
+
- Email: nextjsworks@gmail.com
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
22
30
|
## Install and run the CLI
|
|
23
31
|
|
|
24
32
|
From your Next.js app root, use `npx`:
|
|
@@ -207,16 +215,6 @@ You can add a short “Nextworks setup” section to your app README:
|
|
|
207
215
|
|
|
208
216
|
---
|
|
209
217
|
|
|
210
|
-
## Feedback / Contact
|
|
211
|
-
|
|
212
|
-
Nextworks is early-access alpha and not yet recommended for production use. Expect rough edges and breaking changes between alpha releases.
|
|
213
|
-
|
|
214
|
-
If you run into issues, have questions, or want to share feedback, you can reach me at:
|
|
215
|
-
|
|
216
|
-
- Email: nextjsworks@gmail.com
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
218
|
## Troubleshooting
|
|
221
219
|
|
|
222
220
|
- **Prisma errors or missing migrations**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"name": "auth",
|
|
3
3
|
"description": "NextAuth + Prisma credentials signup/login, optional GitHub OAuth, session helpers and auth UI",
|
|
4
4
|
"files": [
|
|
5
|
+
"LICENSE",
|
|
5
6
|
"components/auth/login-form.tsx",
|
|
6
7
|
"components/auth/signup-form.tsx",
|
|
7
8
|
"components/auth/forgot-password-form.tsx",
|
package/dist/index.js
CHANGED
|
@@ -10,8 +10,6 @@ const commander_1 = require("commander");
|
|
|
10
10
|
const auth_core_1 = require("./commands/auth-core");
|
|
11
11
|
const blocks_1 = require("./commands/blocks");
|
|
12
12
|
const forms_1 = __importDefault(require("./commands/forms"));
|
|
13
|
-
// NOTE: auth-forms, admin-users, and admin-posts are planned but not yet implemented as real kits.
|
|
14
|
-
// We temporarily remove them from the public CLI surface to avoid advertising non-existent kits.
|
|
15
13
|
const data_1 = __importDefault(require("./commands/data"));
|
|
16
14
|
const remove_auth_core_1 = require("./commands/remove-auth-core");
|
|
17
15
|
const remove_blocks_1 = require("./commands/remove-blocks");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,4CAA4C;AAC5C,+BAA+B;;;;;AAE/B,yCAAoC;AACpC,oDAAmD;AACnD,8CAA8C;AAC9C,6DAAwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,4CAA4C;AAC5C,+BAA+B;;;;;AAE/B,yCAA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AAC;QACH,MAAM,aAAa,GAAG,MAAM,IAAA,uCAAgB,GAAE,CAAC;QAE/C,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAClC,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jakob Bro Liebe Hansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jakob Bro Liebe Hansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jakob Bro Liebe Hansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jakob Bro Liebe Hansen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextworks",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"description": "Nextworks CLI - Feature kits installer for Next.js apps",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nextworks": "dist/index.js"
|
|
8
8
|
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/jblh/nextworks-cli.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/jblh/nextworks-cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/jblh/nextworks-cli#readme",
|
|
9
17
|
"scripts": {
|
|
10
18
|
"build": "tsc",
|
|
11
19
|
"postbuild": "node ./scripts/copy-assets.js",
|
|
@@ -34,9 +42,6 @@
|
|
|
34
42
|
],
|
|
35
43
|
"author": "JBLH",
|
|
36
44
|
"license": "MIT",
|
|
37
|
-
"bugs": {
|
|
38
|
-
"email": "nextjsworks@gmail.com"
|
|
39
|
-
},
|
|
40
45
|
"dependencies": {
|
|
41
46
|
"commander": "^12.1.0",
|
|
42
47
|
"fs-extra": "^11.3.2",
|
package/dist/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
Auth core kit (cli/kits/auth-core)
|
|
2
|
-
|
|
3
|
-
This folder contains the files that the `nextworks` CLI copies into a target Next.js project when you run:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx nextworks add auth-core
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
What the kit includes
|
|
10
|
-
|
|
11
|
-
- NextAuth configuration and handler: lib/auth.ts
|
|
12
|
-
- Prisma client helper: lib/prisma.ts
|
|
13
|
-
- Validation schemas: lib/validation/forms.ts
|
|
14
|
-
- ApiResult helpers: lib/server/result.ts
|
|
15
|
-
- Email helpers for dev and SMTP: lib/email/\*
|
|
16
|
-
- Signup API: app/api/signup/route.ts
|
|
17
|
-
- NextAuth API: app/api/auth/[...nextauth]/route.ts
|
|
18
|
-
- Login/Signup UI components: components/auth/\*
|
|
19
|
-
- SessionProvider and RequireAuth utilities
|
|
20
|
-
- Prisma snippet: prisma/auth-models.prisma
|
|
21
|
-
|
|
22
|
-
Database requirements
|
|
23
|
-
|
|
24
|
-
- The auth kit is designed and tested with **PostgreSQL** (for example using a managed service like [Neon](https://neon.tech/), Supabase, Railway, or a self‑hosted Postgres instance).
|
|
25
|
-
- Any Prisma‑supported provider _may_ work, but **Postgres is the recommended and tested path**.
|
|
26
|
-
|
|
27
|
-
Quick start with Postgres (recommended):
|
|
28
|
-
|
|
29
|
-
1. Create a Postgres database (for example on Neon).
|
|
30
|
-
2. Copy the connection string into your `.env` as:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
DATABASE_URL="postgres://..."
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
3. Merge the Prisma models from `prisma/auth-models.prisma` into your project's `prisma/schema.prisma`.
|
|
37
|
-
4. Run:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npx prisma generate
|
|
41
|
-
npx prisma migrate dev -n init_auth
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
If you choose a different database provider, update the `provider` field in your Prisma schema and carefully review indexes/constraints before running migrations.
|
|
45
|
-
|
|
46
|
-
Environment variables
|
|
47
|
-
|
|
48
|
-
The kit relies on the following environment variables. Document these in post-install output or in your project's README:
|
|
49
|
-
|
|
50
|
-
Required (for core auth):
|
|
51
|
-
|
|
52
|
-
- DATABASE_URL
|
|
53
|
-
- NEXTAUTH_URL (e.g. http://localhost:3000)
|
|
54
|
-
- NEXTAUTH_SECRET
|
|
55
|
-
|
|
56
|
-
Optional / password reset & email:
|
|
57
|
-
|
|
58
|
-
- NEXTWORKS_ENABLE_PASSWORD_RESET=1 (enable password reset scaffold)
|
|
59
|
-
- NEXTWORKS_USE_DEV_EMAIL=1 (enable Ethereal dev email transport)
|
|
60
|
-
- SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, NOREPLY_EMAIL (when using real SMTP provider)
|
|
61
|
-
- GITHUB_ID, GITHUB_SECRET (optional) — the GitHub provider is enabled only when both are present
|
|
62
|
-
- NODE_ENV
|
|
63
|
-
|
|
64
|
-
Post-install steps (recommended)
|
|
65
|
-
|
|
66
|
-
1. Install dependencies copied by the kit (the CLI will merge `package-deps.json` into your `package.json`). Ensure `nodemailer` is installed if you will enable dev email:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm install
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
2. Copy or merge `prisma/auth-models.prisma` into your Prisma schema (`prisma/schema.prisma`) and run:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
npx prisma generate
|
|
76
|
-
npx prisma migrate dev -n init
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
3. (Optional) Seed demo data for testing:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
SEED_ADMIN_EMAIL=admin@example.com SEED_ADMIN_PASSWORD=password123 node ./scripts/seed-demo.mjs
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
4. Start your dev server:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm run dev
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
5. Verify the basic flows:
|
|
92
|
-
|
|
93
|
-
- Signup: /auth/signup
|
|
94
|
-
- Login: /auth/login
|
|
95
|
-
- Protected dashboard: /dashboard (requires sign in)
|
|
96
|
-
- If enabled, forgot password POST to /api/auth/forgot-password and reset flows at /api/auth/reset-password
|
|
97
|
-
|
|
98
|
-
Notes & security
|
|
99
|
-
|
|
100
|
-
- Password reset is intentionally opt-in. Do not enable NEXTWORKS_ENABLE_PASSWORD_RESET in production unless you have configured a real mail provider and replaced the in-memory rate limiter.
|
|
101
|
-
- NEXTWORKS_USE_DEV_EMAIL=1 uses Ethereal (nodemailer) and prints a preview URL to server logs for development testing.
|
|
102
|
-
- Email verification on signup is **not yet implemented**. Stub endpoints and UI are in place at `/api/auth/send-verify-email` and `/auth/verify-email`. The Prisma `VerificationToken` model is already included so a future implementation can be added as a non-breaking enhancement.
|
|
103
|
-
|
|
104
|
-
CLI behavior (for maintainers)
|
|
105
|
-
|
|
106
|
-
- In the Nextworks repo, the CLI copies the files listed in `cli/cli_manifests/auth_manifest.json`. Keep that manifest and this kit folder in sync when editing the repo.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
Blocks kit (cli/kits/blocks)
|
|
2
|
-
|
|
3
|
-
This folder contains the files that the CLI copies into a target Next.js project when installing the "blocks" kit.
|
|
4
|
-
|
|
5
|
-
What the kit includes
|
|
6
|
-
|
|
7
|
-
- UI primitive components (Button, Input, Card, Form primitives, Checkbox, Switch, Toaster)
|
|
8
|
-
- Sections and templates (About, CTA, Contact, Hero variants, Navbar, Pricing, Features, etc.)
|
|
9
|
-
- Theme and provider utilities (theme-provider, enhanced-theme-provider, lib/themes)
|
|
10
|
-
- app/globals.css and placeholder assets used by templates
|
|
11
|
-
|
|
12
|
-
Files included are defined in `cli/cli_manifests/blocks_manifest.json` in the Nextworks repository. When updating this kit inside the repo, keep that manifest and this kit folder in sync.
|
|
13
|
-
|
|
14
|
-
Post-install notes
|
|
15
|
-
|
|
16
|
-
1. Install dependencies copied by the kit (the CLI will merge package-deps.json into your package.json):
|
|
17
|
-
|
|
18
|
-
npm install
|
|
19
|
-
|
|
20
|
-
2. Wrap your app with the AppProviders wrapper in app/layout.tsx to enable fonts, presets, CSS variable injection, session provider, and the app toaster. Example:
|
|
21
|
-
|
|
22
|
-
// at the top of app/layout.tsx
|
|
23
|
-
import "./globals.css"; // optional if you already import it elsewhere in your project
|
|
24
|
-
import AppProviders from "@/components/app-providers";
|
|
25
|
-
|
|
26
|
-
export default function RootLayout({ children }) {
|
|
27
|
-
return (
|
|
28
|
-
<html lang="en">
|
|
29
|
-
<body>
|
|
30
|
-
<AppProviders>
|
|
31
|
-
{children}
|
|
32
|
-
</AppProviders>
|
|
33
|
-
</body>
|
|
34
|
-
</html>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
Notes:
|
|
39
|
-
- AppProviders imports globals.css for you, so you don't strictly need to import it separately, but ensure you have the file copied into your project (app/globals.css).
|
|
40
|
-
- If you prefer to only use the EnhancedThemeProvider, you can still import it directly from "@/components/enhanced-theme-provider".
|
|
41
|
-
|
|
42
|
-
3. Ensure `app/globals.css` exists in your project and that Tailwind is configured.
|
|
43
|
-
|
|
44
|
-
4. Placeholder assets are located under `public/placeholders`. These should already have been copied by the CLI; if you move files around, keep the paths aligned or update the template image references.
|
|
45
|
-
|
|
46
|
-
Publishing notes (for maintainers)
|
|
47
|
-
|
|
48
|
-
- This kit is UI-only and has no server/api or prisma files.
|
|
49
|
-
- The manifest file `cli/cli_manifests/blocks_manifest.json` is used by the CLI to determine which files to copy when you build and publish the `nextworks` CLI.
|
|
50
|
-
|
|
51
|
-
CLI behavior (for maintainers)
|
|
52
|
-
|
|
53
|
-
- The CLI copies the files listed in `cli/cli_manifests/blocks_manifest.json`. Keep that manifest and this kit folder in sync when editing the Nextworks repo.
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default:
|
|
13
|
-
"bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
|
|
14
|
-
destructive:
|
|
15
|
-
"bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
|
|
16
|
-
outline:
|
|
17
|
-
"bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
18
|
-
secondary:
|
|
19
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",
|
|
20
|
-
ghost:
|
|
21
|
-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
-
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
27
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
|
-
icon: "size-9",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
variant: "default",
|
|
33
|
-
size: "default",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
function Button({
|
|
39
|
-
className,
|
|
40
|
-
variant,
|
|
41
|
-
size,
|
|
42
|
-
asChild = false,
|
|
43
|
-
unstyled = false,
|
|
44
|
-
...props
|
|
45
|
-
}: React.ComponentProps<"button"> &
|
|
46
|
-
VariantProps<typeof buttonVariants> & {
|
|
47
|
-
asChild?: boolean;
|
|
48
|
-
/** When true, bypasses tokenized buttonVariants so callers fully control classes */
|
|
49
|
-
unstyled?: boolean;
|
|
50
|
-
}) {
|
|
51
|
-
const Comp = asChild ? Slot : "button";
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<Comp
|
|
55
|
-
data-slot="button"
|
|
56
|
-
className={
|
|
57
|
-
unstyled
|
|
58
|
-
? cn(
|
|
59
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap disabled:pointer-events-none disabled:opacity-50",
|
|
60
|
-
className,
|
|
61
|
-
)
|
|
62
|
-
: cn(
|
|
63
|
-
buttonVariants({ variant, size }),
|
|
64
|
-
// Color var hooks (ignored when vars are unset; tokens from variants apply)
|
|
65
|
-
"text-[var(--btn-fg)]",
|
|
66
|
-
"bg-[var(--btn-bg)]",
|
|
67
|
-
"hover:bg-[var(--btn-hover-bg)]",
|
|
68
|
-
"hover:text-[var(--btn-hover-fg)]",
|
|
69
|
-
// explicit dark variants to compete with dark: utilities from variants like outline
|
|
70
|
-
"dark:bg-[var(--btn-bg)]",
|
|
71
|
-
"dark:hover:bg-[var(--btn-hover-bg)]",
|
|
72
|
-
"dark:hover:text-[var(--btn-hover-fg)]",
|
|
73
|
-
// Focus ring and border hooks
|
|
74
|
-
"focus-visible:ring-[var(--btn-ring)]",
|
|
75
|
-
"border-[var(--btn-border)]",
|
|
76
|
-
"dark:border-[var(--btn-border)]",
|
|
77
|
-
className,
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
style={{
|
|
81
|
-
...(props.style as React.CSSProperties),
|
|
82
|
-
color: "var(--btn-fg)",
|
|
83
|
-
backgroundColor: "var(--btn-bg)",
|
|
84
|
-
borderColor: "var(--btn-border)",
|
|
85
|
-
// @ts-expect-error custom CSS var for Tailwind ring color
|
|
86
|
-
"--tw-ring-color": "var(--btn-ring)",
|
|
87
|
-
}}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { Button, buttonVariants };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// TypeScript cli/kits/blocks/lib/themes.ts
|
|
2
|
-
|
|
3
|
-
export type Theme = {
|
|
4
|
-
name: string;
|
|
5
|
-
colors: {
|
|
6
|
-
primary: string;
|
|
7
|
-
background: string;
|
|
8
|
-
surface: string;
|
|
9
|
-
text: string;
|
|
10
|
-
muted: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const themes: Theme[] = [
|
|
15
|
-
{
|
|
16
|
-
name: "light",
|
|
17
|
-
colors: {
|
|
18
|
-
primary: "#7c3aed",
|
|
19
|
-
background: "#ffffff",
|
|
20
|
-
surface: "#f8fafc",
|
|
21
|
-
text: "#0f172a",
|
|
22
|
-
muted: "#64748b",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "dark",
|
|
27
|
-
colors: {
|
|
28
|
-
primary: "#8b5cf6",
|
|
29
|
-
background: "#0b1220",
|
|
30
|
-
surface: "#071026",
|
|
31
|
-
text: "#e6eef8",
|
|
32
|
-
muted: "#93c5fd",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export const defaultTheme = themes[0];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Theming Conversion Summary
|
|
2
|
-
|
|
3
|
-
This document summarizes the changes made when converting the components to the new theming system.
|
|
4
|
-
|
|
5
|
-
Key changes
|
|
6
|
-
|
|
7
|
-
- All hardcoded tailwind classes for colors were replaced with semantic theme tokens defined in lib/themes.ts.
|
|
8
|
-
- Components now read theme values via CSS variables injected by the EnhancedThemeProvider.
|
|
9
|
-
- PresetThemeVars components in each template set CSS variables for each preset theme.
|
|
10
|
-
|
|
11
|
-
Recommended follow-ups
|
|
12
|
-
|
|
13
|
-
- Review components for any remaining hardcoded colors and replace them with theme tokens.
|
|
14
|
-
- Add more theme presets into lib/themes.ts and update the PresetThemeVars where necessary.
|
package/dist/kits/data/README.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
Data kit (cli/kits/data)
|
|
2
|
-
|
|
3
|
-
This kit provides a standalone example Data layer with Posts + Users CRUD: API routes, admin UI, Prisma helpers and a seed script. The kit is designed to be installed via the `nextworks` CLI:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx nextworks add data
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
and is packaged with its own kit dependencies metadata.
|
|
10
|
-
|
|
11
|
-
What the kit includes
|
|
12
|
-
|
|
13
|
-
- API routes:
|
|
14
|
-
- app/api/posts/route.ts
|
|
15
|
-
- app/api/posts/[id]/route.ts
|
|
16
|
-
- app/api/users/route.ts
|
|
17
|
-
- app/api/users/[id]/route.ts
|
|
18
|
-
- app/api/users/check-unique/route.ts
|
|
19
|
-
- app/api/users/check-email/route.ts
|
|
20
|
-
- app/api/seed-demo/route.ts
|
|
21
|
-
- Admin UI components (now standalone in the kit):
|
|
22
|
-
- components/admin/posts-manager.tsx
|
|
23
|
-
- components/admin/users-manager.tsx
|
|
24
|
-
- Protected admin pages:
|
|
25
|
-
- app/(protected)/admin/posts/page.tsx
|
|
26
|
-
- app/(protected)/admin/users/page.tsx
|
|
27
|
-
- Example/demo pages and helpers:
|
|
28
|
-
- app/examples/demo/create-post-form.tsx
|
|
29
|
-
- app/examples/demo/page.tsx
|
|
30
|
-
- app/examples/demo/README.md
|
|
31
|
-
- Prisma helpers and utilities:
|
|
32
|
-
- lib/prisma.ts
|
|
33
|
-
- lib/server/result.ts (ApiResult helpers)
|
|
34
|
-
- lib/utils.ts
|
|
35
|
-
- Seed script: scripts/seed-demo.mjs
|
|
36
|
-
- Kit metadata: package-deps.json (declares @prisma/client and zod; prisma is a devDependency)
|
|
37
|
-
|
|
38
|
-
Database requirements
|
|
39
|
-
|
|
40
|
-
- The data kit is designed and tested with **PostgreSQL**, using a Postgres database hosted on [Neon](https://neon.tech/) during development.
|
|
41
|
-
- Any Prisma‑supported provider _may_ work, but **Postgres is the recommended and currently tested path**.
|
|
42
|
-
|
|
43
|
-
Quick start with Postgres (recommended):
|
|
44
|
-
|
|
45
|
-
1. Create a Postgres database (for example on Neon).
|
|
46
|
-
2. Copy the connection string into your `.env` as:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
DATABASE_URL="postgres://..."
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
3. Merge the Data/Auth Prisma models into your project's `prisma/schema.prisma` (see `prisma/auth-models.prisma` referenced by the manifest).
|
|
53
|
-
4. Run:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npx prisma generate
|
|
57
|
-
npx prisma migrate dev -n init_data
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
If you choose a different database provider, update the `provider` field in your Prisma schema and carefully review indexes/constraints before running migrations.
|
|
61
|
-
|
|
62
|
-
Notes and important behavior
|
|
63
|
-
|
|
64
|
-
- Kit dependencies:
|
|
65
|
-
- Data depends on Auth (for RBAC/session) and Forms (for form primitives/validation). The CLI currently auto-installs `auth-core` and `forms` when you run `nextworks add data` to ensure the required pieces are present. If you prefer an interactive prompt instead of auto-install, the CLI can be adjusted to prompt (ask the maintainers).
|
|
66
|
-
- The kit's package-deps.json lists runtime and dev dependencies that the CLI will merge into the project's package.json; after installation you must run npm install in the project.
|
|
67
|
-
|
|
68
|
-
- Standalone admin components:
|
|
69
|
-
- The admin UI components have been copied into the kit so the Data kit is self-contained. They may still import shared UI primitives (for example from a Blocks or shared ui package) — ensure the consumer project has those UI packages or the CLI installs the required kits.
|
|
70
|
-
|
|
71
|
-
- Auth overlap:
|
|
72
|
-
- The Data kit references the signup API route (app/api/signup/route.ts) in its manifest but does not duplicate the signup implementation — signup is provided by the Auth kit.
|
|
73
|
-
|
|
74
|
-
- Prisma schema & migrations:
|
|
75
|
-
- The kit manifest references prisma/schema.prisma, prisma/migrations/\* and prisma/auth-models.prisma snippets, but the kit does not ship a full migrations directory. You must merge the provided model snippets into your project's prisma/schema.prisma, then run:
|
|
76
|
-
1. npx prisma generate
|
|
77
|
-
2. npx prisma migrate dev
|
|
78
|
-
|
|
79
|
-
Post-install checklist
|
|
80
|
-
|
|
81
|
-
1. Run `npm install` in your project to install dependencies merged by the kit.
|
|
82
|
-
2. Merge the Data/Auth Prisma models into your project's `prisma/schema.prisma` (see `prisma/auth-models.prisma` referenced by the manifest) and run:
|
|
83
|
-
- `npx prisma generate`
|
|
84
|
-
- `npx prisma migrate dev`
|
|
85
|
-
3. Populate demo data if desired:
|
|
86
|
-
- Either run the kit seed script locally: `node scripts/seed-demo.mjs`
|
|
87
|
-
- Or call the included API seed endpoint (POST to `/api/seed-demo`) if you prefer an HTTP-driven seed.
|
|
88
|
-
|
|
89
|
-
CLI behavior and packaging (for maintainers)
|
|
90
|
-
|
|
91
|
-
- Command: the CLI exposes the command `nextworks add data` which copies the files listed in `cli/cli_manifests/data_manifest.json` into your project and merges `package-deps.json` entries.
|
|
92
|
-
- Auto-install: when running the command the CLI ensures Forms and Auth are installed first (auto-installs them if missing).
|
|
93
|
-
- Manifest: keep cli_manifests/data_manifest.json and the files in this kit folder in sync — the CLI uses the manifest to know which files to copy.
|
|
94
|
-
- Packaging: the kit includes package-deps.json and is included in the CLI distribution tarball (dist/kits/data). When the CLI package is built/packed it will include the standalone Data kit files.
|
|
95
|
-
|
|
96
|
-
Caveats & tips
|
|
97
|
-
|
|
98
|
-
- The kit is intended as example/demo code — consumers should review and adapt for production use (security, RBAC rules, validation, etc.).
|
|
99
|
-
- If you want the CLI to prompt before installing Auth/Forms instead of auto-installing, open an issue or request the interactive behavior; it can be added.
|
|
100
|
-
- If you want a timestamped or additional tarball build, the CLI packing step can be re-run to produce another artifact.
|
|
101
|
-
|
|
102
|
-
CLI manifest
|
|
103
|
-
|
|
104
|
-
- In the Nextworks repo, the CLI copies files listed in `cli/cli_manifests/data_manifest.json`. Keep that manifest and this kit folder in sync when editing the repo.
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
Forms kit (cli/kits/forms)
|
|
2
|
-
|
|
3
|
-
This folder contains the files that the `nextworks` CLI copies into a target Next.js project when you run:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx nextworks add forms
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
What the kit includes
|
|
10
|
-
|
|
11
|
-
- Form primitives built on React Hook Form + Zod: components/ui/form/\*
|
|
12
|
-
- Select / Checkbox / Switch primitives wired for form usage
|
|
13
|
-
- Shared validation schemas: lib/validation/forms.ts and lib/validation/wizard.ts
|
|
14
|
-
- Form error mapping helper: lib/forms/map-errors.ts
|
|
15
|
-
- Example pages:
|
|
16
|
-
- Basic form: app/examples/forms/basic/page.tsx
|
|
17
|
-
- Server action form: app/examples/forms/server-action/page.tsx and form-client.tsx
|
|
18
|
-
- Wizard example: app/examples/forms/wizard/page.tsx and wizard-client.tsx
|
|
19
|
-
- Wizard API route: app/api/wizard/route.ts
|
|
20
|
-
|
|
21
|
-
Notes
|
|
22
|
-
|
|
23
|
-
- The forms primitives are UI-only and do not require Prisma or NextAuth.
|
|
24
|
-
- The wizard example assumes a basic app/api/wizard/route.ts endpoint; adjust it as needed for your project.
|
|
25
|
-
- Keep this kit folder in sync with cli_manifests/forms_manifest.json.
|
|
26
|
-
|
|
27
|
-
Post-install steps (recommended)
|
|
28
|
-
|
|
29
|
-
1. Install dependencies (the CLI will merge `package-deps.json` into your `package.json`):
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
2. Ensure you have React Hook Form and Zod installed (if not already present). The CLI will attempt to add these via `package-deps.json`.
|
|
36
|
-
|
|
37
|
-
3. Start your dev server and explore the examples:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run dev
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
- /examples/forms/basic
|
|
44
|
-
- /examples/forms/server-action
|
|
45
|
-
- /examples/forms/wizard
|
|
46
|
-
|
|
47
|
-
CLI behavior (for maintainers)
|
|
48
|
-
|
|
49
|
-
- In the Nextworks repo, the CLI copies the files listed in `cli/cli_manifests/forms_manifest.json`. Keep that manifest and this kit folder in sync when editing the repo.
|