File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ - [ 2026-01-14] [ Add template arg to CLI] ( https://github.com/rubriclab/create-rubric-app/commit/b3de12e510b02a839f5d833f11caed7ede2bda02 )
12- [ 2026-01-09] [ Reconcile changelog] ( https://github.com/rubriclab/create-rubric-app/commit/65c2411412e1873ba12b0b45ff7e9c36babf3407 )
23- [ 2025-12-22] [ Correct example env] ( https://github.com/rubriclab/create-rubric-app/commit/c7200451c9d2cac4338bc7ddd2f0a66b7bd7b55e )
34- [ 2025-12-19] [ Fix build] ( https://github.com/rubriclab/create-rubric-app/commit/c78aa752e2b9eb8eec685670e610ea85d8821a3b )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bun
22
3- import { existsSync } from 'node:fs'
3+ import { existsSync , readdirSync } from 'node:fs'
44import path from 'node:path'
55import { createCLI , createCommand } from '@rubriclab/cli'
66import { $ } from 'bun'
77import { z } from 'zod'
88
9+ const templates = readdirSync ( path . join ( import . meta. dir , 'templates' ) )
10+
911const initCommand = createCommand ( {
1012 args : z . object ( {
11- name : z . string ( ) . default ( 'myApp' ) . describe ( 'Name of the new app directory' )
13+ name : z . string ( ) . default ( 'my-app' ) . describe ( 'Name of the new app directory' ) ,
14+ template : z . enum ( templates ) . default ( 'react' ) . describe ( 'Template to use for the new app' )
1215 } ) ,
1316 description : 'Inits an app based on Rubric patterns' ,
14- handler : async ( { name } ) => {
17+ handler : async ( { name, template } ) => {
1518 const targetDir = path . join ( process . cwd ( ) , name )
16- const templateDir = path . join ( import . meta. dir , 'templates' , 'chat' )
19+ const templateDir = path . join ( import . meta. dir , 'templates' , template )
1720
1821 if ( existsSync ( targetDir ) ) {
1922 console . error ( `Error: Directory "${ name } " already exists` )
Original file line number Diff line number Diff line change 3232 "simple-git-hooks" : {
3333 "post-commit" : " bun x @rubriclab/package post-commit"
3434 },
35- "version" : " 1.6.33 "
35+ "version" : " 1.6.34 "
3636}
You can’t perform that action at this time.
0 commit comments