create-donotdev 0.0.2 → 0.0.3

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 +3 -3
  2. package/package.json +2 -3
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import*as e from"@clack/prompts";import{execSync as t}from"node:child_process";e.intro("DoNotDev \u2014 Create a new project");const o=e.spinner();o.start("Installing @donotdev/cli@latest globally...");try{t("npm install -g @donotdev/cli@latest",{stdio:"pipe"}),o.stop("CLI installed globally")}catch{o.stop("Needs elevated permissions"),e.log.warn("Could not install globally (likely needs sudo)."),e.note(`Run these two commands:
2
+ import*as e from"@clack/prompts";import{execSync as l,execFileSync as r}from"node:child_process";const d=/^[a-zA-Z0-9_-]+$/;function i(n){return d.test(n)&&!n.includes("..")}e.intro("DoNotDev \u2014 Create a new project");const s=e.spinner();s.start("Installing @donotdev/cli@latest globally...");try{l("npm install -g @donotdev/cli@latest",{stdio:"pipe"}),s.stop("CLI installed globally")}catch{s.stop("Needs elevated permissions"),e.log.warn("Could not install globally (likely needs sudo)."),e.note(`Run these two commands:
3
3
 
4
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){const l=await e.text({message:"Project name?",placeholder:"my-app",validate:i=>{const a=i?.trim();if(!a)return"Project name is required";if(!/^[a-zA-Z0-9_-]+$/.test(a))return"Use only letters, numbers, dashes, underscores"}});e.isCancel(l)&&(e.outro("Cancelled."),process.exit(0)),n=l.trim()}e.log.info(`Scaffolding "${n}"...`);try{t(`dndev init ${n}`,{stdio:"inherit",cwd:process.cwd()})}catch{e.log.error("Scaffolding failed. Check the output above."),process.exit(1)}const d=`${process.cwd()}/${n}`,s=e.spinner();s.start("Installing dependencies...");try{t("bun install",{stdio:"pipe",cwd:d}),s.stop("Dependencies installed")}catch{s.stop("bun install failed"),e.log.warn(`Dependencies failed to install. Run manually:
6
- cd ${n} && bun install`)}e.note(`cd ${n}
5
+ npx create-donotdev`,"Manual step needed"),process.exit(1)}let t=process.argv[2]||"";if(t&&!i(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:a=>{const o=a?.trim();if(!o)return"Project name is required";if(!/^[a-zA-Z0-9_-]+$/.test(o))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{r("dndev",["init",t],{stdio:"inherit",cwd:process.cwd()})}catch{e.log.error("Scaffolding failed. Check the output above."),process.exit(1)}const c=`${process.cwd()}/${t}`;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 ${t} && bun install`)}e.note(`cd ${t}
7
7
  Open your IDE and tell your AI agent:
8
8
 
9
9
  "Read AI.md and build my app"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-donotdev",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Create a new DoNotDev project",
5
5
  "type": "module",
6
6
  "private": false,
@@ -20,12 +20,11 @@
20
20
  "dist",
21
21
  "README.md"
22
22
  ],
23
- "sideEffects": false,
24
23
  "scripts": {
25
24
  "build": "dn bundle --package create-donotdev",
26
25
  "dev": "tsc --watch",
27
26
  "clean": "rimraf dist tsconfig.tsbuildinfo",
28
- "type-check": "tsc --noEmit"
27
+ "type-check": "bunx tsc --noEmit"
29
28
  },
30
29
  "dependencies": {
31
30
  "@clack/prompts": "^1.0.0"