create-vue-turbo
v0.3.5
Published
CLI to scaffold the Vue Turbo starter monorepo
Maintainers
Readme
create-vue-turbo
CLI for scaffolding a Turborepo starter with Vue as the default frontend and selectable backend stacks.
Usage
Bun
bun create vue-turbo my-app
bun create vue-turbo my-app --backend laravelnpm
npm create vue-turbo@latest my-app
npm create vue-turbo@latest my-app -- --backend laravelAlternatively (equivalent, explicit):
npx create-vue-turbo@latest my-app
npx create-vue-turbo@latest my-app --backend laravelYarn
yarn create vue-turbo my-app
yarn create vue-turbo my-app --backend laravelpnpm
pnpm create vue-turbo my-app
pnpm create vue-turbo my-app --backend laravelIf no backend is passed, the CLI prompts you to choose one interactively.
Architecture
- Frontend is always Vue in
apps/vue - Backend is optional and added alongside Vue in
apps/only after a backend module is selected - Backend dependency checks are backend-specific. Laravel checks run only when
laravelis selected. - Current backend options:
nonelaravel
The CLI flow is:
parse args
prompt for project name when missing
prompt for backend when --backend is missing
scaffold base workspace + Vue
run selected backend setup module
print next stepsBackends are registered as modules:
export const backends = [noneBackend, laravelBackend];Each backend owns its own validation, install prompts, and setup command:
export interface BackendDefinition {
id: string;
label: string;
description: string;
appDirectory?: string;
setup(context: BackendSetupContext): Promise<BackendSetupResult>;
}Backend modules can also apply backend-specific package transforms after their
project is generated. Laravel uses updatePackageJsonScripts to replace the
generated scripts with Turborepo-friendly commands:
await updatePackageJsonScripts(
path.join(backendPath, "package.json"),
{
build: "echo 'Laravel build step'",
migrate: "php artisan migrate",
test: "php artisan test",
dev: "php artisan serve",
},
{
name: "laravel",
private: true,
strategy: "replace",
},
);Laravel uses this fallback chain:
1. If PHP, Composer, and Laravel CLI exist:
laravel new laravel
2. Else if PHP and Composer exist:
composer create-project laravel/laravel laravel
3. Else:
show missing dependencies
ask for Quick install, Manual instructions, or Skip backend setupQuick install mode detects the host OS, shows the exact command before running it, asks for confirmation, streams installer output, then checks Composer again. Composer remains required for Laravel; the CLI does not bypass it.
Shared process helpers live in src/process.ts:
await commandExists("php");
detectOs();
await runCommand(
"composer",
["create-project", "laravel/laravel", "laravel"],
appsDir,
);
await runShellCommand(installCommand, projectDir);To add another backend, create a module in src/backends/, export a
BackendDefinition, and register it in src/backends/index.ts.
Local development
Run these commands from the repository root:
bun install
bun run devOr:
npm install
npm run devyarn
yarn devpnpm install
pnpm devYou can also build and run the compiled output:
bun run build
node dist/index.js my-app
node dist/index.js my-app --backend laravelTemplate layout
src/
backends/
index.ts
laravel.ts
none.ts
types.ts
process.ts
template/
base/
frontend/
vue/
backends/
laravel/template/base contains the shared workspace root and shared packages.
template/frontend/vue is always copied into apps/vue. Backend modules may
use commands, templates, or both, but their checks and setup logic stay inside
the selected backend module.
Building checklist
bun run check-types
bun run build