create-donotdev 0.0.4 → 0.0.6
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.
- package/dist/index.js +2 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import*as e from"@clack/prompts";import{execSync as
|
|
3
|
-
|
|
4
|
-
sudo npm install -g @donotdev/cli@latest
|
|
5
|
-
npx create-donotdev`,"Manual step needed"),process.exit(1)}let n=process.argv[2]||"";if(n&&!d(n)&&(e.log.error("Invalid project name. Use only letters, numbers, dashes, underscores."),process.exit(1)),!n){const t=await e.text({message:"Project name?",placeholder:"my-app",validate:i=>{const s=i?.trim();if(!s)return"Project name is required";if(!/^[a-zA-Z0-9_-]+$/.test(s))return"Use only letters, numbers, dashes, underscores"}});e.isCancel(t)&&(e.outro("Cancelled."),process.exit(0)),n=t.trim()}e.log.info(`Scaffolding "${n}"...`);try{r("dndev",["init",n],{stdio:"inherit",cwd:process.cwd()})}catch{e.log.error("Scaffolding failed. Check the output above."),process.exit(1)}const c=`${process.cwd()}/${n}`;e.log.step("Installing dependencies...");try{l("bun install",{stdio:"inherit",cwd:c}),e.log.success("Dependencies installed")}catch{e.log.warn(`Dependencies failed to install. Run manually:
|
|
6
|
-
cd ${n} && bun install`)}e.note(`cd ${n}
|
|
2
|
+
import*as e from"@clack/prompts";import{execSync as o}from"node:child_process";import{join as r}from"node:path";const a=/^[a-zA-Z0-9_-]+$/;function d(n){return a.test(n)&&!n.includes("..")}e.intro("DoNotDev \u2014 Create a new project");const s=e.spinner();s.start("Installing @donotdev/cli globally...");try{o("bun install -g @donotdev/cli@latest",{stdio:"pipe"}),s.stop("CLI installed globally (dndev)")}catch{s.stop("Global install skipped"),e.log.warn("Could not install globally. dndev will still work inside your project via bun run.")}let t=process.argv[2]||"";if(t&&!d(t)&&(e.log.error("Invalid project name. Use only letters, numbers, dashes, underscores."),process.exit(1)),!t){const n=await e.text({message:"Project name?",placeholder:"my-app",validate:i=>{const l=i?.trim();if(!l)return"Project name is required";if(!/^[a-zA-Z0-9_-]+$/.test(l))return"Use only letters, numbers, dashes, underscores"}});e.isCancel(n)&&(e.outro("Cancelled."),process.exit(0)),t=n.trim()}e.log.info(`Scaffolding "${t}"...`);try{try{o(`dndev init ${t}`,{stdio:"inherit",cwd:process.cwd()})}catch{o(`bunx @donotdev/cli@latest init ${t}`,{stdio:"inherit",cwd:process.cwd()})}}catch{e.log.error("Scaffolding failed. Check the output above."),process.exit(1)}const c=r(process.cwd(),t);e.log.step("Installing dependencies...");try{o("bun install",{stdio:"inherit",cwd:c}),e.log.success("Dependencies installed")}catch{e.log.warn(`Dependencies failed to install. Run manually:
|
|
3
|
+
cd ${t} && bun install`)}e.note(`cd ${t}
|
|
7
4
|
Open your IDE and tell your AI agent:
|
|
8
5
|
|
|
9
6
|
"Read AI.md and build my app"
|