[PR #1032] feat: add create-vinext-app CLI for scaffolding new projects #1035

Open
opened 2026-05-06 13:11:40 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/1032
Author: @Divkix
Created: 5/3/2026
Status: 🔄 Open

Base: mainHead: feat/create-vinext-app


📝 Commits (10+)

  • e8b0a51 chore: scaffold create-vinext-app package structure
  • 934a2b9 feat(create-vinext-app): add package manager detection and install command builder
  • 44ca4ed feat(create-vinext-app): add project name validation and path resolution
  • 1e00020 feat(create-vinext-app): add catalog version baking from pnpm-workspace.yaml
  • bdca5b0 feat(create-vinext-app): add template scaffolding with variable substitution
  • c26edfe feat(create-vinext-app): add interactive prompts with @clack/prompts
  • afdab2f feat(create-vinext-app): add main CLI entry point with arg parsing and scaffold wiring
  • a3fd0be feat(create-vinext-app): add App Router template
  • 0964d64 feat(create-vinext-app): add Pages Router template
  • 046f7a8 feat(create-vinext-app): add integration tests for App Router and Pages Router templates

📊 Changes

43 files changed (+2456 additions, -253 deletions)

View changed files

📝 .github/workflows/ci.yml (+30 -1)
📝 .github/workflows/publish.yml (+168 -1)
📝 README.md (+24 -3)
📝 examples/pages-router-cloudflare/worker/index.ts (+6 -237)
📝 knip.ts (+9 -0)
packages/create-vinext-app/README.md (+98 -0)
packages/create-vinext-app/package.json (+32 -0)
packages/create-vinext-app/scripts/bake-versions.mjs (+78 -0)
packages/create-vinext-app/src/catalog.ts (+118 -0)
packages/create-vinext-app/src/index.ts (+249 -0)
packages/create-vinext-app/src/install.ts (+24 -0)
packages/create-vinext-app/src/prompts.ts (+50 -0)
packages/create-vinext-app/src/scaffold.ts (+122 -0)
packages/create-vinext-app/src/validate.ts (+84 -0)
packages/create-vinext-app/templates/app-router/README.md.tmpl (+30 -0)
packages/create-vinext-app/templates/app-router/_gitignore (+4 -0)
packages/create-vinext-app/templates/app-router/app/globals.css (+15 -0)
packages/create-vinext-app/templates/app-router/app/layout.tsx (+16 -0)
packages/create-vinext-app/templates/app-router/app/page.tsx (+10 -0)
packages/create-vinext-app/templates/app-router/package.json.tmpl (+26 -0)

...and 23 more files

📄 Description

Summary

This PR introduces create-vinext-app, a CLI tool for scaffolding new vinext projects targeting Cloudflare Workers.

What's Included

Core CLI Features

  • Interactive prompts with @clack/prompts for project name and template selection
  • CLI arguments: --yes, --template <app|pages>, --skip-install, --no-git
  • Package manager auto-detection: npm, pnpm, yarn, bun
  • Project name validation: npm naming conventions, reserved names, scoped packages
  • Catalog version baking: Reads pnpm-workspace.yaml to inject real dependency versions

Templates

  • App Router template: RSC, API routes, Cloudflare Workers configuration
  • Pages Router template: Full middleware/routing/SSR, API routes, Link components

Testing & CI

  • 59 passing tests (unit + integration)
  • New CI job create-vinext-app tests both templates
  • Publish workflow job for automated releases

Usage

# Interactive
npm create vinext-app

# Quick start with defaults
npm create vinext-app my-app --yes

# Choose template
npm create vinext-app my-app --template pages

Files Added

packages/create-vinext-app/
├── src/
│   ├── index.ts          # CLI entry with arg parsing
│   ├── install.ts        # Package manager detection
│   ├── validate.ts       # Project name validation
│   ├── catalog.ts        # Version baking from workspace
│   ├── scaffold.ts       # Template copying
│   └── prompts.ts        # Interactive prompts
├── templates/
│   ├── app-router/       # 10 template files
│   └── pages-router/     # 9 template files
├── test/
│   ├── cli.test.ts       # 39 tests
│   ├── scaffold.test.ts  # 10 tests
│   └── integration.test.ts # 10 tests
└── README.md

Checklist

  • All 59 tests passing
  • Build successful
  • Manual CLI testing verified
  • CI workflow updated
  • Publish workflow added
  • README documentation added
  • Root README updated

Closes the gap for users wanting to start fresh vinext projects without migrating from Next.js.

Ref: #407


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/1032 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 5/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/create-vinext-app` --- ### 📝 Commits (10+) - [`e8b0a51`](https://github.com/cloudflare/vinext/commit/e8b0a515ebccf04153e2a95731135d5e3d568325) chore: scaffold create-vinext-app package structure - [`934a2b9`](https://github.com/cloudflare/vinext/commit/934a2b9e742869b3f8d599eaac0f3dfffda9d719) feat(create-vinext-app): add package manager detection and install command builder - [`44ca4ed`](https://github.com/cloudflare/vinext/commit/44ca4ed7e82a1d656b9c4c53edd2d79bbe68e194) feat(create-vinext-app): add project name validation and path resolution - [`1e00020`](https://github.com/cloudflare/vinext/commit/1e00020da49eb1f2bb11574df1fc9cb495148655) feat(create-vinext-app): add catalog version baking from pnpm-workspace.yaml - [`bdca5b0`](https://github.com/cloudflare/vinext/commit/bdca5b0d86608260154ddd150a693d85050f4ef7) feat(create-vinext-app): add template scaffolding with variable substitution - [`c26edfe`](https://github.com/cloudflare/vinext/commit/c26edfe8ac72133eaa08a6133095ba5fe233dcc0) feat(create-vinext-app): add interactive prompts with @clack/prompts - [`afdab2f`](https://github.com/cloudflare/vinext/commit/afdab2fe0b6dfbb577e32e3012741ce8fe4d1ebb) feat(create-vinext-app): add main CLI entry point with arg parsing and scaffold wiring - [`a3fd0be`](https://github.com/cloudflare/vinext/commit/a3fd0bede34b47562c25d19a1fc1a0769bfbe3bb) feat(create-vinext-app): add App Router template - [`0964d64`](https://github.com/cloudflare/vinext/commit/0964d6479554aa5bec78571f20e5eb544e3bfbde) feat(create-vinext-app): add Pages Router template - [`046f7a8`](https://github.com/cloudflare/vinext/commit/046f7a8c3e6db50f2a2d408eb8f40ff6e2fdbe28) feat(create-vinext-app): add integration tests for App Router and Pages Router templates ### 📊 Changes **43 files changed** (+2456 additions, -253 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+30 -1) 📝 `.github/workflows/publish.yml` (+168 -1) 📝 `README.md` (+24 -3) 📝 `examples/pages-router-cloudflare/worker/index.ts` (+6 -237) 📝 `knip.ts` (+9 -0) ➕ `packages/create-vinext-app/README.md` (+98 -0) ➕ `packages/create-vinext-app/package.json` (+32 -0) ➕ `packages/create-vinext-app/scripts/bake-versions.mjs` (+78 -0) ➕ `packages/create-vinext-app/src/catalog.ts` (+118 -0) ➕ `packages/create-vinext-app/src/index.ts` (+249 -0) ➕ `packages/create-vinext-app/src/install.ts` (+24 -0) ➕ `packages/create-vinext-app/src/prompts.ts` (+50 -0) ➕ `packages/create-vinext-app/src/scaffold.ts` (+122 -0) ➕ `packages/create-vinext-app/src/validate.ts` (+84 -0) ➕ `packages/create-vinext-app/templates/app-router/README.md.tmpl` (+30 -0) ➕ `packages/create-vinext-app/templates/app-router/_gitignore` (+4 -0) ➕ `packages/create-vinext-app/templates/app-router/app/globals.css` (+15 -0) ➕ `packages/create-vinext-app/templates/app-router/app/layout.tsx` (+16 -0) ➕ `packages/create-vinext-app/templates/app-router/app/page.tsx` (+10 -0) ➕ `packages/create-vinext-app/templates/app-router/package.json.tmpl` (+26 -0) _...and 23 more files_ </details> ### 📄 Description ## Summary This PR introduces `create-vinext-app`, a CLI tool for scaffolding new vinext projects targeting Cloudflare Workers. ## What's Included ### Core CLI Features - **Interactive prompts** with @clack/prompts for project name and template selection - **CLI arguments**: `--yes`, `--template <app|pages>`, `--skip-install`, `--no-git` - **Package manager auto-detection**: npm, pnpm, yarn, bun - **Project name validation**: npm naming conventions, reserved names, scoped packages - **Catalog version baking**: Reads `pnpm-workspace.yaml` to inject real dependency versions ### Templates - **App Router template**: RSC, API routes, Cloudflare Workers configuration - **Pages Router template**: Full middleware/routing/SSR, API routes, Link components ### Testing & CI - 59 passing tests (unit + integration) - New CI job `create-vinext-app` tests both templates - Publish workflow job for automated releases ## Usage ```bash # Interactive npm create vinext-app # Quick start with defaults npm create vinext-app my-app --yes # Choose template npm create vinext-app my-app --template pages ``` ## Files Added ``` packages/create-vinext-app/ ├── src/ │ ├── index.ts # CLI entry with arg parsing │ ├── install.ts # Package manager detection │ ├── validate.ts # Project name validation │ ├── catalog.ts # Version baking from workspace │ ├── scaffold.ts # Template copying │ └── prompts.ts # Interactive prompts ├── templates/ │ ├── app-router/ # 10 template files │ └── pages-router/ # 9 template files ├── test/ │ ├── cli.test.ts # 39 tests │ ├── scaffold.test.ts # 10 tests │ └── integration.test.ts # 10 tests └── README.md ``` ## Checklist - [x] All 59 tests passing - [x] Build successful - [x] Manual CLI testing verified - [x] CI workflow updated - [x] Publish workflow added - [x] README documentation added - [x] Root README updated Closes the gap for users wanting to start fresh vinext projects without migrating from Next.js. Ref: #407 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#1035
No description provided.