create-instant-app 0.22.99-experimental.drewh-perms-map.20799723420.1 → 0.22.99-experimental.update-default-app-name.20827861761.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as Te,Option as l}from"commander";import*as F from"@clack/prompts";import{spawn as xe}from"child_process";import{execa as be}from"execa";async function M(){return new Promise(e=>{let t=process.env.SHELL||"/bin/bash",n=xe(t,["-i","-c","which claude"],{stdio:["ignore","pipe","ignore"]}),o="";n.stdout.on("data",i=>{o+=i.toString()}),n.on("close",i=>{if(i===0){let a=o.trim();a.includes("aliased to ")?e(a.split("aliased to ")[1]||null):e(a)}else e(null)})})}var W=async(e,t)=>{let n=await M();if(!n)throw new Error("Claude not found in path");await be(n,[e],{stdio:"inherit",cwd:t})};import{version as _e}from"@instantdb/version";import D from"path";var V=e=>(e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e),ke=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,L=e=>{let n=V(e).split("/"),o=n[n.length-1];if(o==="."){let r=D.resolve(process.cwd());o=D.basename(r)}let i=n.findIndex(r=>r.startsWith("@"));n.findIndex(r=>r.startsWith("@"))!==-1&&(o=n.slice(i).join("/"));let a=n.filter(r=>!r.startsWith("@")).join("/");return[o,a]},C=e=>e.trim(),$=e=>{let t=V(e),n=t.split("/"),o=n.findIndex(a=>a.startsWith("@")),i=n[n.length-1];if(n.findIndex(a=>a.startsWith("@"))!==-1&&(i=n.slice(o).join("/")),!(t==="."||ke.test(i??"")))return"App name must consist of only lowercase alphanumeric characters, '-', and '_'"};import{renderUnwrap as S,UI as u}from"instant-cli/ui";var Ae={base:"next-js-app-dir",appName:"awesome-todos",ruleFiles:null,createRepo:!0,prompt:null},z=async()=>{let e=Ae,t=new Te().name("Create Instant App").description("A CLI for creating web/mobile applications with InstantDB").argument("[dir]","The name of the application, as well as the name of the directory to create").addOption(new l("-b --base <template>","The base template to scaffold from").choices(["next-js-app-dir","vite-vanilla","expo"])).addOption(new l("-g --git","Create a git repo in the new project").default(!0)).addOption(new l("--expo","Use the Expo starter template").default(!1)).addOption(new l("--next","Use the NextJS starter template").default(!1)).addOption(new l("--vanilla","Use the vanilla JS starter template").default(!1)).addOption(new l("--no-git","Don't create a git repo in the new project")).addOption(new l("--cursor","Include a Cursor rules file in the scaffold")).addOption(new l("--claude","Include a CLAUDE.md file in the scaffold")).addOption(new l("--codex","Include an AGENTS.md file in the scaffold")).addOption(new l("--gemini","Include a GEMINI.md file in the scaffold")).addOption(new l("--rules","Include an AGENTS.md file in the scaffold")).addOption(new l("--ai","Create a new InstantDB app based off of a prompt. (requires Claude Code)")).addOption(new l("-a --app <app-id>","Link to an existing InstantDB app by ID (requires login or --token)")).addOption(new l("-t --token <token>","Auth token override (use with --app when not logged in)")).version(_e).parse(process.argv),n=t.args[0]&&C(t.args[0]);if(n){let r=$(n);if(r)throw new Error("Invalid app name: "+r);e.appName=n}let o=t.opts();if(o.ai&&!await M())throw new Error("--ai only works with Claude Code, but we couldn't find it in your machine. Install it first, and run it again : ). Alternatively you can scaffold out a project without --ai");let i=await F.group({appName:async()=>{if(n)return n.trim();let r=await S(new u.TextInput({prompt:"What will your project/folder be called?",placeholder:"awesome-todos",defaultValue:"awesome-todos",validate:s=>$(C(s)),modifyOutput:u.ciaModifier()}));return C(r)},prompt:async()=>o.ai?await S(new u.TextInput({prompt:"What would you like to create?",placeholder:"Create an app that...",modifyOutput:u.modifiers.piped([u.ciaModifier()])})):null,base:async({results:r})=>o.base?o.base:o.vanilla?"vite-vanilla":o.next?"next-js-app-dir":o.expo?"expo":r.prompt?S(new u.Select({promptText:"What framework would you like to use?",options:[{value:"next-js-app-dir",label:"Next.js"},{value:"expo",label:"Expo: React Native"}],defaultValue:"next-js-app-dir",modifyOutput:u.modifiers.piped([u.ciaModifier()])})):S(new u.Select({promptText:"What framework would you like to use?",options:[{value:"next-js-app-dir",label:"Next.js"},{value:"vite-vanilla",label:"Vite: Vanilla TS"},{value:"expo",label:"Expo: React Native"}],defaultValue:"next-js-app-dir",modifyOutput:u.modifiers.piped([u.ciaModifier()])})),ruleFiles:async({results:r})=>r.prompt?"claude":o.cursor?"cursor":o.claude?"claude":o.codex?"codex":o.gemini?"gemini":o.rules?"codex":S(new u.Select({promptText:"Which AI tool would you like to add rule files for?",options:[{value:"cursor",label:"Cursor"},{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"zed",label:"Zed"},{value:"windsurf",label:"Windsurf"},{value:null,label:"None"}],defaultValue:null,modifyOutput:u.ciaModifier()})),createRepo:async()=>o.git!==void 0?o.git:!0},{onCancel(){process.exit(1)}}),a={app:o.app??null,token:o.token??null};return{project:i,appFlags:a}};import he from"path";import we from"fs-extra";import{log as ye,outro as pt}from"@clack/prompts";import{intro as Ie}from"@clack/prompts";import H from"chalk";var Pe=` _ _ _
2
+ import{Command as Te,Option as l}from"commander";import*as F from"@clack/prompts";import{spawn as xe}from"child_process";import{execa as be}from"execa";async function M(){return new Promise(e=>{let t=process.env.SHELL||"/bin/bash",n=xe(t,["-i","-c","which claude"],{stdio:["ignore","pipe","ignore"]}),o="";n.stdout.on("data",i=>{o+=i.toString()}),n.on("close",i=>{if(i===0){let a=o.trim();a.includes("aliased to ")?e(a.split("aliased to ")[1]||null):e(a)}else e(null)})})}var W=async(e,t)=>{let n=await M();if(!n)throw new Error("Claude not found in path");await be(n,[e],{stdio:"inherit",cwd:t})};import{version as _e}from"@instantdb/version";import D from"path";var V=e=>(e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e),ke=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,L=e=>{let n=V(e).split("/"),o=n[n.length-1];if(o==="."){let r=D.resolve(process.cwd());o=D.basename(r)}let i=n.findIndex(r=>r.startsWith("@"));n.findIndex(r=>r.startsWith("@"))!==-1&&(o=n.slice(i).join("/"));let a=n.filter(r=>!r.startsWith("@")).join("/");return[o,a]},C=e=>e.trim(),$=e=>{let t=V(e),n=t.split("/"),o=n.findIndex(a=>a.startsWith("@")),i=n[n.length-1];if(n.findIndex(a=>a.startsWith("@"))!==-1&&(i=n.slice(o).join("/")),!(t==="."||ke.test(i??"")))return"App name must consist of only lowercase alphanumeric characters, '-', and '_'"};import{renderUnwrap as S,UI as u}from"instant-cli/ui";var Ae={base:"next-js-app-dir",appName:"Awesome Todos",ruleFiles:null,createRepo:!0,prompt:null},z=async()=>{let e=Ae,t=new Te().name("Create Instant App").description("A CLI for creating web/mobile applications with InstantDB").argument("[dir]","The name of the application, as well as the name of the directory to create").addOption(new l("-b --base <template>","The base template to scaffold from").choices(["next-js-app-dir","vite-vanilla","expo"])).addOption(new l("-g --git","Create a git repo in the new project").default(!0)).addOption(new l("--expo","Use the Expo starter template").default(!1)).addOption(new l("--next","Use the NextJS starter template").default(!1)).addOption(new l("--vanilla","Use the vanilla JS starter template").default(!1)).addOption(new l("--no-git","Don't create a git repo in the new project")).addOption(new l("--cursor","Include a Cursor rules file in the scaffold")).addOption(new l("--claude","Include a CLAUDE.md file in the scaffold")).addOption(new l("--codex","Include an AGENTS.md file in the scaffold")).addOption(new l("--gemini","Include a GEMINI.md file in the scaffold")).addOption(new l("--rules","Include an AGENTS.md file in the scaffold")).addOption(new l("--ai","Create a new InstantDB app based off of a prompt. (requires Claude Code)")).addOption(new l("-a --app <app-id>","Link to an existing InstantDB app by ID (requires login or --token)")).addOption(new l("-t --token <token>","Auth token override (use with --app when not logged in)")).version(_e).parse(process.argv),n=t.args[0]&&C(t.args[0]);if(n){let r=$(n);if(r)throw new Error("Invalid app name: "+r);e.appName=n}let o=t.opts();if(o.ai&&!await M())throw new Error("--ai only works with Claude Code, but we couldn't find it in your machine. Install it first, and run it again : ). Alternatively you can scaffold out a project without --ai");let i=await F.group({appName:async()=>{if(n)return n.trim();let r=await S(new u.TextInput({prompt:"What will your project/folder be called?",placeholder:"awesome-todos",defaultValue:"awesome-todos",validate:s=>$(C(s)),modifyOutput:u.ciaModifier()}));return C(r)},prompt:async()=>o.ai?await S(new u.TextInput({prompt:"What would you like to create?",placeholder:"Create an app that...",modifyOutput:u.modifiers.piped([u.ciaModifier()])})):null,base:async({results:r})=>o.base?o.base:o.vanilla?"vite-vanilla":o.next?"next-js-app-dir":o.expo?"expo":r.prompt?S(new u.Select({promptText:"What framework would you like to use?",options:[{value:"next-js-app-dir",label:"Next.js"},{value:"expo",label:"Expo: React Native"}],defaultValue:"next-js-app-dir",modifyOutput:u.modifiers.piped([u.ciaModifier()])})):S(new u.Select({promptText:"What framework would you like to use?",options:[{value:"next-js-app-dir",label:"Next.js"},{value:"vite-vanilla",label:"Vite: Vanilla TS"},{value:"expo",label:"Expo: React Native"}],defaultValue:"next-js-app-dir",modifyOutput:u.modifiers.piped([u.ciaModifier()])})),ruleFiles:async({results:r})=>r.prompt?"claude":o.cursor?"cursor":o.claude?"claude":o.codex?"codex":o.gemini?"gemini":o.rules?"codex":S(new u.Select({promptText:"Which AI tool would you like to add rule files for?",options:[{value:"cursor",label:"Cursor"},{value:"claude",label:"Claude"},{value:"codex",label:"Codex"},{value:"gemini",label:"Gemini"},{value:"zed",label:"Zed"},{value:"windsurf",label:"Windsurf"},{value:null,label:"None"}],defaultValue:null,modifyOutput:u.ciaModifier()})),createRepo:async()=>o.git!==void 0?o.git:!0},{onCancel(){process.exit(1)}}),a={app:o.app??null,token:o.token??null};return{project:i,appFlags:a}};import he from"path";import we from"fs-extra";import{log as ye,outro as pt}from"@clack/prompts";import{intro as Ie}from"@clack/prompts";import H from"chalk";var Pe=` _ _ _
3
3
  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 (_) | | | |
4
4
  \u2588 \u2588\u2588\u2588\u2588 _ _ __ ___| |_ __ _ _ _ _| |_
5
5
  \u2588 \u2588\u2588\u2588\u2588 | | '_ \\/ __| __/ _\\\`| '_ \\| __|
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-instant-app",
3
- "version": "0.22.99-experimental.drewh-perms-map.20799723420.1",
3
+ "version": "0.22.99-experimental.update-default-app-name.20827861761.1",
4
4
  "description": "Scaffold a new web/mobile app with InstantDB",
5
5
  "homepage": "https://github.com/instantdb/instant/tree/main/client/packages/create-instant-app",
6
6
  "repository": {
@@ -33,8 +33,8 @@
33
33
  "ora": "6.3.1",
34
34
  "slugify": "^1.6.6",
35
35
  "sort-package-json": "^2.10.0",
36
- "instant-cli": "0.22.99-experimental.drewh-perms-map.20799723420.1",
37
- "@instantdb/version": "0.22.99-experimental.drewh-perms-map.20799723420.1"
36
+ "@instantdb/version": "0.22.99-experimental.update-default-app-name.20827861761.1",
37
+ "instant-cli": "0.22.99-experimental.update-default-app-name.20827861761.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@anthropic-ai/sdk": "^0.60.0",