[PR #406] [CLOSED] feat: add create-vinext-app scaffolding CLI #549

Closed
opened 2026-05-06 13:08:43 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/406
Author: @Divkix
Created: 3/10/2026
Status: Closed

Base: mainHead: feat/create-vinext-app


📝 Commits (10+)

  • bf46d29 feat: add create-vinext-app scaffolding CLI
  • 4b73bc3 fix(create-vinext-app): use vinext entry instead of missing worker/index.ts in app-router template
  • 9b700ce fix(create-vinext-app): extract basename from absolute paths on Windows
  • 82f4cfd fix(vinext): pre-bundle React CJS packages for Cloudflare worker environments
  • 6a54993 ci(create-vinext-app): add pages-router template to integration test matrix
  • aed831e fix(create-vinext-app): handle "." project name and clean up validation
  • e3d3255 fix(create-vinext-app): address PR review feedback
  • 12e6bbf fix(vinext): restore React CJS pre-bundling for Cloudflare worker environments
  • 2a0664c style(vinext): apply oxfmt formatting
  • 2fff1a3 Merge branch 'cloudflare:main' into feat/create-vinext-app

📊 Changes

42 files changed (+2317 additions, -24 deletions)

View changed files

📝 .agents/skills/migrate-to-vinext/SKILL.md (+10 -0)
📝 .agents/skills/migrate-to-vinext/references/compatibility.md (+1 -1)
📝 .github/workflows/ci.yml (+57 -0)
📝 .github/workflows/publish.yml (+12 -2)
📝 AGENTS.md (+27 -17)
📝 CONTRIBUTING.md (+17 -0)
📝 README.md (+12 -3)
packages/create-vinext-app/package.json (+39 -0)
packages/create-vinext-app/src/index.ts (+238 -0)
packages/create-vinext-app/src/install.ts (+25 -0)
packages/create-vinext-app/src/prompts.ts (+52 -0)
packages/create-vinext-app/src/scaffold.ts (+115 -0)
packages/create-vinext-app/src/validate.ts (+120 -0)
packages/create-vinext-app/templates/app-router/_gitignore (+4 -0)
packages/create-vinext-app/templates/app-router/app/api/hello/route.ts (+5 -0)
packages/create-vinext-app/templates/app-router/app/layout.tsx (+12 -0)
packages/create-vinext-app/templates/app-router/app/page.tsx (+17 -0)
packages/create-vinext-app/templates/app-router/package.json.tmpl (+24 -0)
packages/create-vinext-app/templates/app-router/tsconfig.json (+13 -0)
packages/create-vinext-app/templates/app-router/vite.config.ts.tmpl (+15 -0)

...and 22 more files

📄 Description

Summary

Closes #407

Adds packages/create-vinext-app/ — a standalone CLI for npm create vinext-app@latest that scaffolds new vinext projects targeting Cloudflare Workers with a single command.

Previously, starting a new vinext project required npm create next-app@latestvinext init → manually creating wrangler.jsonc, worker/index.ts, and installing extra deps (8-12 manual steps). This reduces it to one command.

  • Two templates: App Router (with RSC + @vitejs/plugin-rsc) and Pages Router (with worker entry)
  • Interactive prompts via @clack/prompts with --yes flag for CI/non-interactive usage
  • Package manager auto-detection from npm_config_user_agent (works with npm/pnpm/yarn/bun)
  • .tmpl variable substitution for {{PROJECT_NAME}} and {{WORKER_NAME}}
  • 102 tests across 6 files: unit (validate, install), integration (templates, scaffold, cli), e2e
  • CI job to verify scaffolded projects start with HTTP 200 (ubuntu + windows matrix)
  • Publish workflow updated to version bump and publish alongside vinext
  • Docs updated: README, AGENTS.md, CONTRIBUTING.md, migration skill

Before merging: npm setup required

create-vinext-app is a brand new package. Before the publish workflow can ship it, a maintainer needs to:

  1. Register the package name on npm — either do a manual first publish (npm publish --access public from the built package) or create a placeholder via npm init create-vinext-app on npmjs.com
  2. Configure OIDC trusted publishing — link the cloudflare/vinext GitHub repo as a trusted publisher for create-vinext-app on npmjs.com (Settings → Publishing access → Add trusted publisher), same as already done for vinext

Without this, the npm publish --provenance step in publish.yml (line 86) will fail on first run with a 403.

After that one-time setup, future publishes are fully automated — the workflow bumps both packages to the same version and publishes them together.

Test plan

  • pnpm --filter create-vinext-app test — 102/102 tests pass
  • pnpm run build — both packages build
  • pnpm run lint && pnpm run fmt:check && pnpm run typecheck — all clean
  • Manual: scaffold app-router project, verify dev server starts
  • Manual: scaffold pages-router project, verify dev server starts
  • CI: create-vinext-app job passes on ubuntu + windows

🔄 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/406 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 3/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/create-vinext-app` --- ### 📝 Commits (10+) - [`bf46d29`](https://github.com/cloudflare/vinext/commit/bf46d29ec65bb58d9f499f03b4176a6e1d12b3e9) feat: add create-vinext-app scaffolding CLI - [`4b73bc3`](https://github.com/cloudflare/vinext/commit/4b73bc36c492c37fe7b25d3cc9bceb7f58b34053) fix(create-vinext-app): use vinext entry instead of missing worker/index.ts in app-router template - [`9b700ce`](https://github.com/cloudflare/vinext/commit/9b700ced11dc963389ced01cd4f148f8ba657e6f) fix(create-vinext-app): extract basename from absolute paths on Windows - [`82f4cfd`](https://github.com/cloudflare/vinext/commit/82f4cfdd5b8be6134054c1d1ea051d47d00af3f0) fix(vinext): pre-bundle React CJS packages for Cloudflare worker environments - [`6a54993`](https://github.com/cloudflare/vinext/commit/6a54993675db8590fe45987c1f1db3304fc2a383) ci(create-vinext-app): add pages-router template to integration test matrix - [`aed831e`](https://github.com/cloudflare/vinext/commit/aed831eae9ede8fa1516638aff7874294dad881a) fix(create-vinext-app): handle "." project name and clean up validation - [`e3d3255`](https://github.com/cloudflare/vinext/commit/e3d3255220c428bfad17592679c4ee97f52ba019) fix(create-vinext-app): address PR review feedback - [`12e6bbf`](https://github.com/cloudflare/vinext/commit/12e6bbfb4a110fbeb454abda2f4539b96de780e6) fix(vinext): restore React CJS pre-bundling for Cloudflare worker environments - [`2a0664c`](https://github.com/cloudflare/vinext/commit/2a0664ca8cf6cffd9be24f0447f2ec8b54673748) style(vinext): apply oxfmt formatting - [`2fff1a3`](https://github.com/cloudflare/vinext/commit/2fff1a3f2549ae76147208f24d6e46799657a55c) Merge branch 'cloudflare:main' into feat/create-vinext-app ### 📊 Changes **42 files changed** (+2317 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `.agents/skills/migrate-to-vinext/SKILL.md` (+10 -0) 📝 `.agents/skills/migrate-to-vinext/references/compatibility.md` (+1 -1) 📝 `.github/workflows/ci.yml` (+57 -0) 📝 `.github/workflows/publish.yml` (+12 -2) 📝 `AGENTS.md` (+27 -17) 📝 `CONTRIBUTING.md` (+17 -0) 📝 `README.md` (+12 -3) ➕ `packages/create-vinext-app/package.json` (+39 -0) ➕ `packages/create-vinext-app/src/index.ts` (+238 -0) ➕ `packages/create-vinext-app/src/install.ts` (+25 -0) ➕ `packages/create-vinext-app/src/prompts.ts` (+52 -0) ➕ `packages/create-vinext-app/src/scaffold.ts` (+115 -0) ➕ `packages/create-vinext-app/src/validate.ts` (+120 -0) ➕ `packages/create-vinext-app/templates/app-router/_gitignore` (+4 -0) ➕ `packages/create-vinext-app/templates/app-router/app/api/hello/route.ts` (+5 -0) ➕ `packages/create-vinext-app/templates/app-router/app/layout.tsx` (+12 -0) ➕ `packages/create-vinext-app/templates/app-router/app/page.tsx` (+17 -0) ➕ `packages/create-vinext-app/templates/app-router/package.json.tmpl` (+24 -0) ➕ `packages/create-vinext-app/templates/app-router/tsconfig.json` (+13 -0) ➕ `packages/create-vinext-app/templates/app-router/vite.config.ts.tmpl` (+15 -0) _...and 22 more files_ </details> ### 📄 Description ## Summary Closes #407 Adds `packages/create-vinext-app/` — a standalone CLI for `npm create vinext-app@latest` that scaffolds new vinext projects targeting Cloudflare Workers with a single command. Previously, starting a new vinext project required `npm create next-app@latest` → `vinext init` → manually creating `wrangler.jsonc`, `worker/index.ts`, and installing extra deps (8-12 manual steps). This reduces it to one command. - **Two templates:** App Router (with RSC + `@vitejs/plugin-rsc`) and Pages Router (with worker entry) - **Interactive prompts** via `@clack/prompts` with `--yes` flag for CI/non-interactive usage - **Package manager auto-detection** from `npm_config_user_agent` (works with npm/pnpm/yarn/bun) - **`.tmpl` variable substitution** for `{{PROJECT_NAME}}` and `{{WORKER_NAME}}` - **102 tests** across 6 files: unit (validate, install), integration (templates, scaffold, cli), e2e - **CI job** to verify scaffolded projects start with HTTP 200 (ubuntu + windows matrix) - **Publish workflow** updated to version bump and publish alongside vinext - **Docs updated:** README, AGENTS.md, CONTRIBUTING.md, migration skill ## Before merging: npm setup required > **`create-vinext-app` is a brand new package.** Before the publish workflow can ship it, a maintainer needs to: > > 1. **Register the package name on npm** — either do a manual first publish (`npm publish --access public` from the built package) or create a placeholder via `npm init create-vinext-app` on npmjs.com > 2. **Configure OIDC trusted publishing** — link the `cloudflare/vinext` GitHub repo as a trusted publisher for `create-vinext-app` on npmjs.com (Settings → Publishing access → Add trusted publisher), same as already done for `vinext` > > Without this, the `npm publish --provenance` step in `publish.yml` (line 86) will fail on first run with a 403. > > After that one-time setup, future publishes are fully automated — the workflow bumps both packages to the same version and publishes them together. ## Test plan - [x] `pnpm --filter create-vinext-app test` — 102/102 tests pass - [x] `pnpm run build` — both packages build - [x] `pnpm run lint && pnpm run fmt:check && pnpm run typecheck` — all clean - [x] Manual: scaffold app-router project, verify dev server starts - [x] Manual: scaffold pages-router project, verify dev server starts - [x] CI: `create-vinext-app` job passes on ubuntu + windows --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:08:43 +02:00
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#549
No description provided.