next-configure 0.1.1 → 0.1.3
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 +19 -71
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
# next-configure
|
|
2
2
|
|
|
3
|
-
Zero-config CLI to
|
|
3
|
+
Zero-config CLI to wire up Tailwind v4 + shadcn/ui and basic structure in a Next.js App Router project.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Smart `src` detection**: Puts generated folders under `src/` when it exists, otherwise in project root.
|
|
9
|
-
- **Optional shadcn/ui setup**: Can run `shadcn init` and install the `button` component for you.
|
|
10
|
-
- **Standard folders**: Can create `components`, `hooks`, and `utils` (no `pages` or `api`, App Router only).
|
|
11
|
-
- **Tailwind v4 theme generator**: Asks for primary/secondary colors and generates a Tailwind v4-compatible global theme.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
Use directly with `npx` (recommended):
|
|
7
|
+
Use directly with `npx`:
|
|
16
8
|
|
|
17
9
|
```bash
|
|
18
10
|
npx next-configure
|
|
@@ -30,74 +22,30 @@ Then run:
|
|
|
30
22
|
npx next-configure
|
|
31
23
|
```
|
|
32
24
|
|
|
33
|
-
##
|
|
25
|
+
## What it does
|
|
34
26
|
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
- `
|
|
41
|
-
- `
|
|
27
|
+
- Verifies you are in a Next.js project (`next` in `dependencies` or `devDependencies`).
|
|
28
|
+
- Detects `src/` and creates `components`, `hooks`, `utils` in `src/` or project root.
|
|
29
|
+
- Optionally runs `shadcn init` and installs the `button` component.
|
|
30
|
+
- Locates `src/app/globals.css` or `app/globals.css` and overwrites it with:
|
|
31
|
+
- Tailwind v4 imports (`@import "tailwindcss";`, `@import "tw-animate-css";`)
|
|
32
|
+
- `@theme inline` mapping Tailwind tokens to CSS variables
|
|
33
|
+
- `:root` variables for primary/secondary (with auto light/dark variants) and core UI colors
|
|
34
|
+
- A minimal `@layer base` for body and border styles
|
|
42
35
|
|
|
43
36
|
## Usage
|
|
44
37
|
|
|
45
|
-
Run
|
|
38
|
+
Run from the root of your Next.js App Router project:
|
|
46
39
|
|
|
47
40
|
```bash
|
|
48
41
|
npx next-configure
|
|
49
42
|
```
|
|
50
43
|
|
|
51
|
-
You will be
|
|
52
|
-
|
|
53
|
-
1. **Install shadcn/ui? (yes/no)**
|
|
54
|
-
- If yes, runs:
|
|
55
|
-
- `npx shadcn init`
|
|
56
|
-
- `npx shadcn add button`
|
|
57
|
-
2. **Generate standard development folders? (yes/no)**
|
|
58
|
-
- If yes:
|
|
59
|
-
- If `src/` exists:
|
|
60
|
-
- Creates `src/components`, `src/hooks`, `src/utils` (if missing).
|
|
61
|
-
- Otherwise:
|
|
62
|
-
- Creates `components`, `hooks`, `utils` in project root.
|
|
63
|
-
3. **Set color theme? (yes/no)**
|
|
64
|
-
- If no, the CLI exits successfully after steps 1–2.
|
|
65
|
-
- If yes, you will be asked for:
|
|
66
|
-
- `Enter primary color (hex without #)`
|
|
67
|
-
- `Enter secondary color (hex without #)`
|
|
68
|
-
|
|
69
|
-
The CLI validates that both colors are 6-character hex values.
|
|
70
|
-
|
|
71
|
-
## Theme generation
|
|
72
|
-
|
|
73
|
-
When you opt in to theme generation:
|
|
74
|
-
|
|
75
|
-
- The CLI locates your global CSS file:
|
|
76
|
-
- `src/app/globals.css`, or
|
|
77
|
-
- `app/globals.css`.
|
|
78
|
-
- If not found, it exits with an error.
|
|
79
|
-
- If found, it overwrites that file completely with:
|
|
80
|
-
- Tailwind v4 imports:
|
|
81
|
-
- `@import "tailwindcss";`
|
|
82
|
-
- `@import "tw-animate-css";`
|
|
83
|
-
- `@custom-variant dark` and an `@theme inline { ... }` block mapping Tailwind v4 tokens to CSS variables.
|
|
84
|
-
- A `:root` block defining:
|
|
85
|
-
- `--primary`, `--primary-light`, `--primary-dark`, `--primary-foreground`
|
|
86
|
-
- `--secondary`, `--secondary-light`, `--secondary-dark`, `--secondary-foreground`
|
|
87
|
-
- Additional variables for background, foreground, border, input, ring, and radius.
|
|
88
|
-
- A small `@layer base` section for base `body` and element styles.
|
|
89
|
-
|
|
90
|
-
Primary and secondary light/dark shades are generated automatically from your hex input using a small color utility.
|
|
91
|
-
|
|
92
|
-
## Example flows
|
|
93
|
-
|
|
94
|
-
- **New project**
|
|
95
|
-
- `npx create-next-app@latest`
|
|
96
|
-
- `cd your-app`
|
|
97
|
-
- `npx next-configure`
|
|
98
|
-
- **Existing project (theme only)**
|
|
99
|
-
- `cd your-app`
|
|
100
|
-
- `npx next-configure`
|
|
101
|
-
- Answer no to shadcn and folders, yes to theme.
|
|
44
|
+
You will be asked:
|
|
102
45
|
|
|
46
|
+
1. Whether to install shadcn/ui.
|
|
47
|
+
2. Whether to create `components`, `hooks`, `utils` folders.
|
|
48
|
+
3. Whether to set a color theme.
|
|
49
|
+
- If yes, enter primary and secondary hex colors (without `#`).
|
|
103
50
|
|
|
51
|
+
If globals.css is missing in `app/` or `src/app/`, the CLI exits with a clear error.
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-configure",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Zero-config CLI to Tailwind v4 + shadcn/ui theme and folder structure in Next.js App Router projects.",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
8
|
"next-configure": "./dist/index.js"
|