Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nextworks

jblh2.3kMIT0.2.0-alpha.7TypeScript support: included

Nextworks CLI - Blocks installer for Next.js apps

nextjs, app-router, blocks, frontend-blocks, kits, feature-kits, scaffold, starter, shadcn, cli, nextworks, generator

readme

nextworks

nextworks is a CLI that installs the Nextworks Blocks kit (core UI, sections, and page templates) into your Next.js project.

90-second install demo (silent)

Watch a fresh create-next-app + npx nextworks add blocks --sections --templates run end-to-end (includes a quick browser tour of the gallery + templates):

Nextworks install demo

This repository contains the source for the nextworks CLI and its MIT-licensed core building blocks.

Status: alpha
See the GitHub Releases page for notes on each release.

Install / try it (alpha quickstart):

npx create-next-app@latest
cd <your-app>
npx nextworks@latest add blocks --sections --templates
npm install
npm run dev

For the canonical CLI README (install steps, kits, and troubleshooting), see: https://github.com/jblh/nextworks-cli/tree/main/cli

If you want/need to install the underlying packages directly, prefer @latest to avoid stale pins:

npm install \
  nextworks@latest \
  @nextworks/blocks-core@latest \
  @nextworks/blocks-sections@latest \
  @nextworks/blocks-templates@latest
  • cli/ – the CLI that powers npx nextworks@latest ... and the install commands for Blocks.
  • cli/kits/ – the code that nextworks installs into your Next.js app (Blocks kit).
  • cli_manifests/ – manifests that describe what the CLI installs.

  • packages/blocks-* – reusable UI/component packages used by the kits.

  • docs/ – quickstarts and guides.

Status: Early-access alpha

nextworks is currently in early-access alpha. Expect rough edges and occasional breaking changes.

Best for: experimenting in new or non-critical projects and giving feedback.

Not recommended yet for: production apps with strict stability requirements.

Compatibility (alpha)

Support matrix

CI-tested:

  • OS: Windows, macOS, Linux
  • Node: 20.x and 22.x
  • Next.js (sandbox pin): 16.0.7 and 16.1.4 (via create-next-app in CI)
  • Router: App Router and Pages Router
  • Package managers: npm, pnpm, yarn

Note: CI uses pinned Next.js versions for stability and security (see CVE-2025-66478 / RSC protocol advisory).

Repo build CI (not an install test):

  • npm run build on Node 18.x and 20.x (Ubuntu)

Dev mode: Turbopack (default in Next 16) and Webpack

Other 16.x versions will likely work; older versions are best effort. If you hit an issue, please include your Next.js version, Node version, package manager, OS, and relevant logs when reporting it.

Known issues (alpha)

  • Existing files may be overwritten if they collide with kit paths (see Safety + docs/FILE_CHANGES.md).
  • Router entrypoint patching can conflict with heavily customized app/layout.tsx (App Router) or pages/_app.tsx (Pages Router).
  • 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.

Safety (read this first)

nextworks installs kits by copying files into your Next.js project. If a destination path already exists, kit installs may overwrite your files.

Before running installs, strongly consider:

  • Commit first, then install:
    • git add -A && git commit -m "baseline"
  • Review changes after install:
    • git diff --name-status
  • To undo everything quickly:
    • git reset --hard
    • (optional) remove untracked files created by installs: git clean -fd

If you’ve customized any of these paths, expect manual merge work:

  • app/layout.tsx (App Router)
  • pages/_app.tsx and pages/_document.tsx (Pages Router)
  • lib/utils.ts
  • components/ui/**

Kits may also:

  • merge dependencies into package.json
  • edit your router entrypoint (Blocks)
    • App Router: app/layout.tsx
    • Pages Router: pages/_app.tsx (and may create/update pages/_document.tsx)
  • create/update .nextworks/config.json

For a transparent breakdown of what each kit writes/edits, see:

  • docs/FILE_CHANGES.md

Getting started

Install / try it (alpha quickstart):

npx create-next-app@latest
cd <your-app>
# Nextworks assumes TypeScript + Tailwind CSS (required for Blocks/templates)
npx nextworks@latest add blocks --sections --templates

Templates are installed in a router-native location:

  • App Router:
    • app/templates/<template>/page.tsx
    • supporting template files live alongside it: app/templates/<template>/**
  • Pages Router:
    • route entry file: pages/templates/<template>/index.tsx
    • supporting template files: components/templates/<template>/** (installed outside pages/ so Next doesn’t treat helpers as routable pages)

See docs/QUICKSTART.md and the Blocks quickstarts/guides in docs/ for more detail.

Feedback & issues

During alpha, the most useful feedback is:

  1. Install failures or environment incompatibilities (Next.js/Node/package manager).
  2. Broken generated code or runtime errors after running nextworks commands.
  3. Confusing or missing documentation / CLI output.

Where to post feedback

Bug reports

For reproducible bugs / errors (especially install/runtime issues), please open a GitHub Issue using the templates in .github/ISSUE_TEMPLATE/.

Branding

"nextworks" is the name of this project.

You're very welcome to say that your project "uses nextworks" or "is built with nextworks". Please just avoid:

  • presenting your project as if it were the official nextworks project, or
  • using the name or any future logos in a way that suggests official endorsement or affiliation.

changelog

Changelog

All notable changes to this project will be documented in this file.

This project is currently early-access alpha; expect breaking changes.

Unreleased

  • Pages Router templates install fix:

    • Only the template route entry file is installed under pages/ (pages/templates/<template>/index.tsx).
    • Supporting template files (components/helpers like PresetThemeVars) are installed under components/templates/<template>/** to avoid Next.js treating them as routable pages during next build type validation.
    • Docs updated to reflect the new installed paths.
  • Internal metadata updates (copyright notice). No functional change.

  • Fix: @nextworks/blocks-core/server now correctly type-exports AppProviders as a named export (matching runtime), so import { AppProviders } from "@nextworks/blocks-core/server"; typechecks in Next.js production builds (Vercel/Turbopack).

  • Turbopack-safe refactor for Blocks theme/font bootstrapping:

    • @nextworks/blocks-core/server AppProviders no longer imports next/font/*.
    • Fonts are configured in the consuming app’s app/layout.tsx (the CLI patches this).
    • Server-side theme CSS variables are injected based on cookies.
  • CLI layout patcher hardening:
    • Merges existing next/font/google imports instead of duplicating them.
    • Handles semicolon-less and multi-line import styles.
    • Ensures font instances exist for Geist + Outfit + Inter + Poppins.
  • Acceptance testing:
    • Added a Turbopack canary check for /templates/gallery.