nextworks 0.2.0-alpha.5 → 0.2.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 CHANGED
@@ -1,12 +1,28 @@
1
1
  # nextworks
2
2
 
3
+ ## 90-second install demo (silent)
4
+
5
+ Fresh `create-next-app` + `npx nextworks add blocks --sections --templates`, plus a quick browser tour of the gallery + templates:
6
+
7
+ [![Nextworks install demo](https://img.youtube.com/vi/7YKmGFmFY5c/hqdefault.jpg)](https://www.youtube.com/watch?v=7YKmGFmFY5c)
8
+
3
9
  Nextworks is a CLI that installs **modular Next.js building blocks** into your app:
4
10
 
5
11
  - **Blocks** – UI sections, templates, and core UI primitives.
6
12
 
7
13
  > **Status:** early‑access alpha. Expect rough edges and breaking changes between alpha releases.
8
14
  >
9
- > **Package managers:** npm, pnpm, and yarn are supported.
15
+ > **Support matrix:**
16
+ >
17
+ > **CI-tested:**
18
+ >
19
+ > - OS: Windows, macOS, Linux
20
+ > - Node: 20.x and 22.x
21
+ > - Next.js (sandbox pin): 16.0.7 and 16.1.4 (via create-next-app in CI)
22
+ > - Router: App Router and Pages Router
23
+ > - Package managers: npm, pnpm, yarn
24
+ >
25
+ > Note: CI uses pinned Next.js versions for stability and security (see CVE-2025-66478 / RSC protocol advisory).
10
26
  >
11
27
  > In this alpha, the most reliable setup is:
12
28
  >
@@ -47,6 +63,14 @@ Nextworks is a CLI that installs **modular Next.js building blocks** into your a
47
63
 
48
64
  ---
49
65
 
66
+ ## Known issues (alpha)
67
+
68
+ - **Existing files may be overwritten** if they collide with kit paths. Commit first.
69
+ - **Router entrypoint patching can conflict** with heavily customized `app/layout.tsx` or `pages/_app.tsx`.
70
+ - **Fonts/providers wiring:** Blocks configures fonts in your router entrypoint (not inside shared packages) for Turbopack compatibility. If you manually edit fonts/providers and see errors, re-run the Blocks install to re-apply the patch.
71
+
72
+ ---
73
+
50
74
  ## Safety (read this first)
51
75
 
52
76
  `nextworks` installs kits by copying files into your Next.js project. If a destination path already exists, kit installs may **overwrite** your files.
@@ -84,6 +108,8 @@ Nextworks is early‑access alpha and I’m actively looking for feedback from e
84
108
  - **Start here (installation + where to post feedback):** https://github.com/jblh/nextworks-cli/discussions/1
85
109
  - **Alpha feedback thread (what broke / what’s missing):** https://github.com/jblh/nextworks-cli/discussions/2
86
110
 
111
+ If you’re reporting an install/runtime issue, please include OS, Node version, Next.js version, package manager, the exact command you ran, and the error output.
112
+
87
113
  ### Bug reports
88
114
 
89
115
  For reproducible bugs / errors (especially install/runtime issues), please open a GitHub Issue using the templates in `.github/ISSUE_TEMPLATE/`.
@@ -1 +1 @@
1
- {"version":3,"file":"remove-blocks.d.ts","sourceRoot":"","sources":["../../src/commands/remove-blocks.ts"],"names":[],"mappings":"AAiBA,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAC3C,4DAA4D;IAC5D,EAAE,CAAC,EAAE,OAAO,0BAA0B,EAAE,cAAc,CAAC;CACxD,GAAG,OAAO,CAAC,IAAI,CAAC,CA+ChB"}
1
+ {"version":3,"file":"remove-blocks.d.ts","sourceRoot":"","sources":["../../src/commands/remove-blocks.ts"],"names":[],"mappings":"AAiBA,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAC3C,4DAA4D;IAC5D,EAAE,CAAC,EAAE,OAAO,0BAA0B,EAAE,cAAc,CAAC;CACxD,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEhB"}
@@ -7,9 +7,24 @@ const package_manager_1 = require("../utils/package-manager");
7
7
  async function removeBlocks(options) {
8
8
  console.log("Removing blocks kit...");
9
9
  try {
10
- const manifestPath = (0, file_operations_1.resolveAssetPath)("cli_manifests", "blocks_manifest.json");
11
- const manifest = await (0, file_operations_1.readJsonFile)(manifestPath);
12
- const files = manifest.files || [];
10
+ const config = await (0, installation_tracker_1.getLpkConfig)();
11
+ const installed = config.installedKits.find((k) => k.name === "blocks");
12
+ // Prefer removing exactly what was installed (tracked in .nextworks/config.json)
13
+ // so we don't accidentally delete user-owned files or miss router-mapped paths.
14
+ let files = installed?.files ?? [];
15
+ // Fallback: if the kit isn't tracked (older installs), remove the union of
16
+ // manifest groups plus manifest.files.
17
+ if (files.length === 0) {
18
+ const manifestPath = (0, file_operations_1.resolveAssetPath)("cli_manifests", "blocks_manifest.json");
19
+ const manifest = await (0, file_operations_1.readJsonFile)(manifestPath);
20
+ const groupFiles = manifest.groups
21
+ ? Object.values(manifest.groups).flatMap((g) => g?.files ?? [])
22
+ : [];
23
+ files = Array.from(new Set([...(manifest.files ?? []), ...groupFiles].filter(Boolean)));
24
+ }
25
+ if (files.length === 0) {
26
+ console.log("ℹ️ No tracked blocks files found to remove (is the blocks kit installed?)");
27
+ }
13
28
  // Get safe-to-remove dependencies (not shared with other kits)
14
29
  const safeToRemove = await (0, installation_tracker_1.getSafeToRemoveDependencies)("blocks");
15
30
  // Remove files
@@ -26,7 +41,7 @@ async function removeBlocks(options) {
26
41
  }
27
42
  // Remove from installation tracker
28
43
  await (0, installation_tracker_1.removeInstalledKit)("blocks");
29
- console.log("✓ blocks kit removed successfully!");
44
+ console.log("✓ Blocks kit removed successfully!");
30
45
  const pm = options?.pm ?? (await (0, package_manager_1.detectPackageManager)(process.cwd()));
31
46
  const installCmd = (0, package_manager_1.getInstallCommand)(pm);
32
47
  console.log(`\n💡 You may want to run '${installCmd}' to clean up node_modules`);
@@ -1 +1 @@
1
- {"version":3,"file":"remove-blocks.js","sourceRoot":"","sources":["../../src/commands/remove-blocks.ts"],"names":[],"mappings":";;AAiBA,oCAkDC;AAnED,8DAMkC;AAClC,wEAGuC;AACvC,8DAGkC;AAG3B,KAAK,UAAU,YAAY,CAAC,OAGlC;IACC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAA,kCAAgB,EACnC,eAAe,EACf,sBAAsB,CACvB,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,IAAA,8BA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2B,EAAC,QAAQ,CAAC,CAAC;QAEjE,eAAe;QACf,MAAM,IAAA,6BAAW,EAAC,KAAK,CAAC,CAAC;QAEzB,uBAAuB;QACvB,MAAM,IAAA,oCAAkB,EAAC,KAAK,CAAC,CAAC;QAEhC,gCAAgC;QAChC,IACE,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YACpC,YAAY,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EACvC,CAAC;YACD,MAAM,IAAA,wCAAsB,EAC1B,YAAY,CAAC,YAAY,EACzB,YAAY,CAAC,eAAe,CAC7B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACxE,CAAC;QAED,mCAAmC;QACnC,MAAM,IAAA,yCAAkB,EAAC,QAAQ,CAAC,CAAC;QAEnC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,MAAM,IAAA,sCAAoB,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,IAAA,mCAAiB,EAAC,EAAE,CAAC,CAAC;QAEzC,OAAO,CAAC,GAAG,CACT,6BAA6B,UAAU,4BAA4B,CACpE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAC7C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -2,18 +2,34 @@
2
2
  "use strict";
3
3
  // Copyright (c) 2025 Jakob Hansen
4
4
  // SPDX-License-Identifier: MIT
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
5
8
  Object.defineProperty(exports, "__esModule", { value: true });
6
9
  const commander_1 = require("commander");
10
+ const fs_1 = __importDefault(require("fs"));
11
+ const path_1 = __importDefault(require("path"));
7
12
  const blocks_1 = require("./commands/blocks");
8
13
  const remove_blocks_1 = require("./commands/remove-blocks");
9
14
  const installation_tracker_1 = require("./utils/installation-tracker");
10
15
  const package_manager_1 = require("./utils/package-manager");
11
16
  const yarn_pnp_1 = require("./utils/yarn-pnp");
12
17
  const program = new commander_1.Command();
18
+ const cliVersion = (() => {
19
+ try {
20
+ // When running from dist/, __dirname is: <pkgRoot>/dist
21
+ const pkgPath = path_1.default.resolve(__dirname, "..", "package.json");
22
+ const raw = fs_1.default.readFileSync(pkgPath, "utf8");
23
+ return JSON.parse(raw)?.version ?? "0.0.0";
24
+ }
25
+ catch {
26
+ return "0.0.0";
27
+ }
28
+ })();
13
29
  program
14
30
  .name("nextworks")
15
31
  .description("Nextworks CLI - Feature kits installer for Next.js apps")
16
- .version("0.1.0");
32
+ .version(cliVersion);
17
33
  program
18
34
  .command("add <kit>")
19
35
  .description("Add a feature kit to your project")
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,+BAA+B;;AAE/B,yCAAoC;AACpC,8CAA8C;AAC9C,4DAAwD;AACxD,uEAAgE;AAChE,6DAIiC;AACjC,+CAG0B;AAE1B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,yDAAyD,CAAC;KACtE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,mCAAmC,CAAC;KAChD,MAAM,CACL,YAAY,EACZ,wDAAwD,CACzD;KACA,MAAM,CACL,aAAa,EACb,uFAAuF,CACxF;KACA,MAAM,CAAC,WAAW,EAAE,0CAA0C,CAAC;KAC/D,MAAM,CACL,WAAW,EACX,yDAAyD,CAC1D;KACA,M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E,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"}
@@ -1,116 +1,100 @@
1
- # Blocks Quickstart
2
-
3
- This document explains the Blocks kit: prebuilt UI sections, templates and core UI primitives included in this repository. The Blocks kit is intended to be a non-invasive copyable kit (shadCN-style) you can install into any Next.js project (App Router **or** Pages Router) with TypeScript + Tailwind.
4
-
5
- > **Alpha note**
6
- > Other kits (Auth Core, Forms, Data) are currently tested and supported on top of a default Blocks install.
7
- > For the smoothest experience, install **Blocks first** in your app before adding other kits.
8
-
9
- > If you are using the `nextworks` CLI in your own app, you can install this Blocks kit by running:
10
- >
11
- > ```bash
12
- > npx nextworks@latest add blocks --sections --templates
13
- > ```
14
- >
15
- > This installs **core UI primitives, sections, and page templates**, so the example templates work out of the box.
16
-
17
- The CLI will copy files into your project under `components/`, `lib/`, and `public/`. Template pages are installed in a router-native location:
18
-
19
- - **App Router projects:** `app/templates/<template>/**`
20
- - **Pages Router projects:**
21
- - route entry file: `pages/templates/<template>/index.tsx`
22
- - supporting template files: `components/templates/<template>/**` (installed outside `pages/` so Next doesn’t treat helpers as routable pages)
23
-
24
- What’s included
25
-
26
- - Page templates (composed from sections):
27
- - `/templates/productlaunch`
28
- - `/templates/saasdashboard`
29
- - `/templates/digitalagency`
30
- - `/templates/gallery`
31
- - Reusable UI sections: components/sections/\* (Navbar, Hero, Features, Pricing, Testimonials, FAQ, Contact, Footer, etc.)
32
- - Core UI primitives: components/ui/\* (Button, Input, Card, Select, Checkbox, Switch, Theme toggle/selector, Form primitives)
33
- - Theme helpers and presets: components/PresetThemeVars in each template and lib/themes.ts
34
- - Global styles: app/globals.css and optional theme variables in each template's PresetThemeVars file
35
- - Sample placeholder assets: public/placeholders/\*
36
-
37
- Where to look
38
-
39
- - Templates:
40
- - App Router:
41
- - page: `app/templates/<template>/page.tsx`
42
- - supporting files: `app/templates/<template>/**`
43
- - Pages Router:
44
- - page: `pages/templates/<template>/index.tsx`
45
- - supporting files: `components/templates/<template>/**`
46
- - Sections:
47
- - components/sections/\*.tsx
48
- - UI primitives and form building blocks:
49
- - components/ui/button.tsx
50
- - components/ui/input.tsx
51
- - components/ui/label.tsx
52
- - components/ui/card.tsx
53
- - components/ui/textarea.tsx
54
- - components/ui/select.tsx
55
- - components/ui/checkbox.tsx
56
- - components/ui/switch.tsx
57
- - components/ui/form/\* (Form, FormField, FormItem, FormControl, FormLabel, FormMessage, FormDescription)
58
- - Theme and providers:
59
- - components/theme-provider.tsx
60
- - components/enhanced-theme-provider.tsx
61
- - lib/themes.ts
62
-
63
- Minimal steps to render a template locally
64
-
65
- 1. Install dependencies and run the dev server:
66
-
67
- npm install
68
- npm run dev
69
-
70
- 2. Open the productlaunch template in your browser:
71
-
72
- http://localhost:3000/templates/productlaunch
73
-
74
- 3. The templates use global styles (`app/globals.css`). No environment variables are required for Blocks-only usage.
75
- - App Router: `app/layout.tsx` imports `./globals.css`.
76
- - Pages Router: the CLI patches `pages/_app.tsx` to import `../app/globals.css` and `../app/tw-animate.css` so styling matches the templates.
77
-
78
- How to adopt / override template pieces
79
-
80
- - Slots & component overrides
81
- - Each template composes small sections from components/sections/\*.tsx. To override a section, copy the desired section file into your project (or replace the import) and update props or classNames.
82
- - Example: to override the Navbar, copy components/sections/Navbar.tsx into your app and update the markup or styles. The template imports Navbar from the components directory.
83
-
84
- - Styling and utility classes
85
- - Tailwind is used across components. Prefer adding or modifying Tailwind utility classes on the exported component or pass className props (many components accept className).
86
-
87
- - Theme variables and PresetThemeVars
88
- - Each template has a PresetThemeVars component/file that injects CSS variables for theme presets:
89
- - App Router install: `app/templates/<template>/PresetThemeVars.tsx`
90
- - Pages Router install: `components/templates/<template>/PresetThemeVars.tsx`
91
- - To change default palette or add presets, edit the template PresetThemeVars and lib/themes.ts.
92
- - Theme providers are implemented in components/theme-provider.tsx and components/enhanced-theme-provider.tsx — wrap your app with these if you extract blocks into another project.
93
-
94
- Import examples
95
-
96
- - Import a primitive in your code:
97
-
98
- import Button from "@/components/ui/button";
99
- import { Form, FormField } from "@/components/ui/form/form"; // path depends on your project alias
100
-
101
- - Use a section in a page:
102
-
103
- import Navbar from "@/components/sections/Navbar";
104
-
105
- export default function Page() {
106
- return (
107
- <>
108
- <Navbar />
109
- <main>{/_ ... _/}</main>
110
- </>
111
- );
112
- }
113
-
114
- Public assets and placeholders
115
-
116
- - The templates reference placeholder images in public/placeholders/. If you copy templates to another project, copy the referenced assets (public/placeholders/gallery/\*) or replace with your own images.
1
+ # Blocks Quickstart (in your project)
2
+
3
+ This is the fastest path to verify your Blocks install is working and find the right files to edit.
4
+
5
+ > Blocks is a “copy into your repo” kit (shadcn-style): you own the files and can modify them directly.
6
+
7
+ ---
8
+
9
+ ## 0) Prereqs
10
+
11
+ - Next.js project (App Router **or** Pages Router)
12
+ - TypeScript + Tailwind CSS
13
+
14
+ ---
15
+
16
+ ## 1) Install Blocks (recommended)
17
+
18
+ From your app root:
19
+
20
+ ```bash
21
+ npx nextworks@latest add blocks --sections --templates
22
+ npm install
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2) Run dev and verify routes
28
+
29
+ ```bash
30
+ npm run dev
31
+ ```
32
+
33
+ Then visit:
34
+
35
+ - `http://localhost:3000/templates/productlaunch`
36
+ - `http://localhost:3000/templates/saasdashboard`
37
+ - `http://localhost:3000/templates/digitalagency`
38
+ - `http://localhost:3000/templates/gallery`
39
+
40
+ If those load and look styled, you’re in good shape.
41
+
42
+ ---
43
+
44
+ ## 3) If styling is missing (quick checks)
45
+
46
+ Blocks relies on global CSS files:
47
+
48
+ - `app/globals.css`
49
+ - `app/tw-animate.css`
50
+
51
+ The correct import location depends on your router:
52
+
53
+ - **App Router:** `app/layout.tsx` should import `./globals.css` (and `./tw-animate.css` if used).
54
+ - **Pages Router:** `pages/_app.tsx` should import:
55
+ - `../app/globals.css`
56
+ - `../app/tw-animate.css`
57
+
58
+ The CLI normally patches this automatically.
59
+
60
+ ---
61
+
62
+ ## 4) Where the files are
63
+
64
+ ### Template routes
65
+
66
+ - **App Router:** `app/templates/<template>/page.tsx`
67
+ - **Pages Router:** `pages/templates/<template>/index.tsx`
68
+
69
+ Supporting template components live alongside the template:
70
+
71
+ - App Router: `app/templates/<template>/**`
72
+ - Pages Router: `components/templates/<template>/**` (kept outside `pages/` so helpers aren’t treated as pages)
73
+
74
+ ### Sections and UI primitives
75
+
76
+ - Sections: `components/sections/**`
77
+ - UI primitives: `components/ui/**`
78
+
79
+ ---
80
+
81
+ ## 5) What to edit first (common tasks)
82
+
83
+ - Customize a template page:
84
+ - edit its route file (see paths above)
85
+ - tweak the imported sections/components
86
+
87
+ - Customize a reusable section (Navbar/Hero/etc.):
88
+ - edit `components/sections/<Section>.tsx`
89
+
90
+ - Customize theme/palette:
91
+ - see `.nextworks/docs/THEME_GUIDE.md`
92
+ - start with `lib/themes.ts`
93
+ - each template has a `PresetThemeVars` file you can modify
94
+
95
+ ---
96
+
97
+ ## 6) Need deeper detail?
98
+
99
+ - `.nextworks/docs/BLOCKS_README.md` (what got installed + where things live)
100
+ - `.nextworks/docs/THEME_GUIDE.md` (theme system + presets)
@@ -1,68 +1,105 @@
1
- Blocks kit (cli/kits/blocks)
1
+ # Blocks kit
2
2
 
3
- This folder contains the files that the CLI copies into a target Next.js project when installing the "blocks" kit.
3
+ This folder is the **Blocks kit** installed by the Nextworks CLI. It’s copied into your Next.js project so you can edit everything locally (shadcn-style): components, sections, templates, and theme utilities.
4
4
 
5
- What the kit includes
5
+ If you’re reading this inside your app repo, you’ll also find companion docs at:
6
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
7
+ - `.nextworks/docs/BLOCKS_QUICKSTART.md` (start here)
8
+ - `.nextworks/docs/THEME_GUIDE.md`
11
9
 
12
- Install behavior
10
+ ---
13
11
 
14
- > **Alpha note**
15
- > Other kits (Auth Core, Forms, Data) are currently tested and supported on top of a Blocks install that includes sections and templates. For the smoothest experience, run `npx nextworks@latest add blocks --sections --templates` before adding additional kits.
12
+ ## What this adds to your project
16
13
 
17
- - For a full UI kit, run `npx nextworks@latest add blocks --sections --templates` to install **core UI primitives, sections, and templates** so the example templates work out of the box.
18
- - You can pass flags to control what gets installed:
19
- - `npx nextworks@latest add blocks --ui-only` → core UI primitives only (no sections/templates).
20
- - `npx nextworks@latest add blocks --sections` → core + sections only.
21
- - `npx nextworks@latest add blocks --templates` → core + templates only.
22
- - `npx nextworks@latest add blocks --sections --templates` → same as the default (core + sections + templates).
14
+ Depending on install flags, Blocks adds:
23
15
 
24
- 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.
16
+ - **UI primitives** under `components/ui/**` (Button, Input, Card, Select, Checkbox, Switch, Toaster, etc.)
17
+ - **Reusable marketing sections** under `components/sections/**` (Navbar, Hero variants, Features, Pricing, Testimonials, FAQ, Contact, Footer, …)
18
+ - **Full page templates** under a router-native path (see below)
19
+ - **Theme + provider utilities** under `components/**` and `lib/**`
20
+ - **Global styles**: `app/globals.css` and `app/tw-animate.css`
21
+ - **Placeholder images** under `public/placeholders/**`
25
22
 
26
- Post-install notes
23
+ ---
27
24
 
28
- 1. Install dependencies copied by the kit (the CLI will merge package-deps.json into your package.json):
25
+ ## Install commands / options
29
26
 
27
+ > ```bash
28
+ > npx nextworks@latest add blocks --sections --templates
29
+ > ```
30
+
31
+ Blocks supports these install shapes:
32
+
33
+ - `npx nextworks@latest add blocks --ui-only` → core UI primitives only
34
+ - `npx nextworks@latest add blocks --sections` → core + sections
35
+ - `npx nextworks@latest add blocks --templates` → core + templates
36
+ - `npx nextworks@latest add blocks --sections --templates` → core + sections + templates (recommended)
37
+
38
+ ---
39
+
40
+ ## After install: what to run
41
+
42
+ 1. Install merged dependencies:
43
+
44
+ ```bash
30
45
  npm install
46
+ ```
47
+
48
+ 2. Start dev:
49
+
50
+ ```bash
51
+ npm run dev
52
+ ```
53
+
54
+ 3. Visit template routes (when templates are installed):
55
+ - `/templates/productlaunch`
56
+ - `/templates/saasdashboard`
57
+ - `/templates/digitalagency`
58
+ - `/templates/gallery`
59
+
60
+ ---
61
+
62
+ ## Where templates live (App Router vs Pages Router)
63
+
64
+ Templates are installed in a router-native location:
65
+
66
+ - **App Router:**
67
+ - `app/templates/<template>/page.tsx`
68
+ - `app/templates/<template>/**`
69
+
70
+ - **Pages Router:**
71
+ - route entry file: `pages/templates/<template>/index.tsx`
72
+ - supporting template files: `components/templates/<template>/**` (kept outside `pages/` so helpers are not treated as routable pages)
73
+
74
+ ---
75
+
76
+ ## Required wiring (providers + CSS)
77
+
78
+ Blocks expects your app to be wrapped in the kit’s local `AppProviders`.
79
+
80
+ - **App Router:** patched in `app/layout.tsx`
81
+ - **Pages Router:** patched in `pages/_app.tsx` (and may create/update `pages/_document.tsx`)
82
+
83
+ The CLI normally patches this automatically.
84
+
85
+ Notes:
86
+
87
+ - Pages Router installs also ensure CSS imports exist in `pages/_app.tsx`:
88
+ - `../app/globals.css`
89
+ - `../app/tw-animate.css`
90
+ - The kit’s `components/app-providers.*` wrappers are **local kit providers** (they wrap the kit-local `BlocksAppProviders`) so providers/hooks resolve to the same React context instance under Turbopack/HMR.
91
+
92
+ ---
93
+
94
+ ## What to edit first
95
+
96
+ - Want to change the look/branding quickly? Start with:
97
+ - `.nextworks/docs/THEME_GUIDE.md`
98
+ - `lib/themes.ts`
99
+ - each template’s `PresetThemeVars` file
100
+
101
+ - Want to customize a section (Navbar/Hero/etc.)?
102
+ - edit files directly under `components/sections/**`
31
103
 
32
- 2. Wrap your app with the AppProviders wrapper (the CLI patches this automatically).
33
- - App Router: `app/layout.tsx`
34
- - Pages Router: `pages/_app.tsx`
35
-
36
- Example (App Router):
37
-
38
- // at the top of app/layout.tsx
39
- import "./globals.css"; // optional if you already import it elsewhere in your project
40
- import AppProviders from "@/components/app-providers";
41
-
42
- export default function RootLayout({ children }) {
43
- return (
44
- <html lang="en">
45
- <body>
46
- <AppProviders>
47
- {children}
48
- </AppProviders>
49
- </body>
50
- </html>
51
- );
52
- }
53
-
54
- Notes:
55
- - The kit’s `components/app-providers.*` files are **local kit providers** (they wrap with the kit-local `BlocksAppProviders`), so templates/hooks and providers resolve to the same React context instance under Turbopack/HMR.
56
- - On Pages Router installs, the CLI also ensures kit CSS imports are present in `pages/_app.tsx`:
57
- - `../app/globals.css`
58
- - `../app/tw-animate.css`
59
-
60
- 3. Ensure `app/globals.css` exists in your project and that Tailwind is configured (the Blocks kit expects Tailwind).
61
-
62
- 4. Templates are installed in a router-native location:
63
- - App Router: `app/templates/<template>/**`
64
- - Pages Router:
65
- - route entry file: `pages/templates/<template>/index.tsx`
66
- - supporting template files: `components/templates/<template>/**`
67
-
68
- 5. 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.
104
+ - Want to customize a template page?
105
+ - edit the template route file (see paths above) and its local components.
@@ -13,9 +13,9 @@
13
13
  "next-themes": "^0.4.6",
14
14
  "motion": "^12.24.10",
15
15
  "sonner": "^2.0.7",
16
- "@nextworks/blocks-core": "0.2.0-alpha.5",
17
- "@nextworks/blocks-sections": "0.2.0-alpha.5",
18
- "@nextworks/blocks-templates": "0.2.0-alpha.5"
16
+ "@nextworks/blocks-core": "0.2.0-alpha.7",
17
+ "@nextworks/blocks-sections": "0.2.0-alpha.7",
18
+ "@nextworks/blocks-templates": "0.2.0-alpha.7"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tailwindcss": "^4.1.12"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextworks",
3
- "version": "0.2.0-alpha.5",
3
+ "version": "0.2.0-alpha.7",
4
4
  "description": "Nextworks CLI - Blocks installer for Next.js apps",
5
5
  "main": "dist/index.js",
6
6
  "bin": {