rapidkit 0.12.1 → 0.12.2
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/README.md +6 -7
- package/dist/index.js +59 -49
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
```bash
|
|
20
20
|
npx rapidkit my-api --template fastapi
|
|
21
21
|
cd my-api
|
|
22
|
-
source .rapidkit/activate # Enable rapidkit commands
|
|
23
22
|
rapidkit init # Install dependencies
|
|
24
23
|
rapidkit dev # Start dev server at http://localhost:8000
|
|
25
24
|
```
|
|
@@ -29,7 +28,7 @@ rapidkit dev # Start dev server at http://localhost:8000
|
|
|
29
28
|
```bash
|
|
30
29
|
npx rapidkit my-api --template nestjs
|
|
31
30
|
cd my-api
|
|
32
|
-
|
|
31
|
+
rapidkit init # Install dependencies
|
|
33
32
|
rapidkit dev # Start dev server at http://localhost:8000
|
|
34
33
|
```
|
|
35
34
|
|
|
@@ -85,13 +84,11 @@ npx rapidkit [project-name] [options]
|
|
|
85
84
|
|
|
86
85
|
## Project Commands
|
|
87
86
|
|
|
88
|
-
After creating a project,
|
|
87
|
+
After creating a project, use these commands:
|
|
89
88
|
|
|
90
89
|
```bash
|
|
91
90
|
cd my-api
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
rapidkit init # Install dependencies
|
|
91
|
+
rapidkit init # Install dependencies (auto-activates environment)
|
|
95
92
|
rapidkit dev # Start dev server with hot reload (port 8000)
|
|
96
93
|
rapidkit start # Start production server
|
|
97
94
|
rapidkit build # Build for production
|
|
@@ -196,4 +193,6 @@ MIT
|
|
|
196
193
|
|
|
197
194
|
---
|
|
198
195
|
|
|
199
|
-
**v0.12.
|
|
196
|
+
**v0.12.1** - Simplified CLI: `rapidkit init` now handles environment activation automatically
|
|
197
|
+
|
|
198
|
+
**v0.12.0** - Added NestJS template, workspace mode, and unified CLI
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {Command}from'commander';import
|
|
3
|
-
[${t}/${i}]`),
|
|
4
|
-
\u26A0\uFE0F Update available: ${S} \u2192 ${t}`)),console.log(
|
|
5
|
-
`))):c.debug("You are using the latest version");}catch{c.debug("Could not check for updates");}}function w(){return S}var ie=".rapidkitrc.json";async function U(){let e=l.join(te.homedir(),ie);try{let t=await promises.readFile(e,"utf-8"),i=JSON.parse(t);return c.debug(`Loaded config from ${e}`),i}catch{return c.debug("No user config found, using defaults"),{}}}var v=class extends Error{constructor(i,o,n){super(i);this.code=o;this.details=n;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}};var u=class extends v{constructor(t,i){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",i);}};function O(e){let t=
|
|
2
|
+
import {Command}from'commander';import r from'chalk';import P from'inquirer';import l,{dirname,join}from'path';import {execa}from'execa';import {readFileSync,promises}from'fs';import {fileURLToPath}from'url';import te from'os';import re from'validate-npm-package-name';import*as k from'fs-extra';import N from'ora';var E=class{debugEnabled=false;setDebug(t){this.debugEnabled=t;}debug(t,...i){this.debugEnabled&&console.log(r.gray(`[DEBUG] ${t}`),...i);}info(t,...i){console.log(r.blue(t),...i);}success(t,...i){console.log(r.green(t),...i);}warn(t,...i){console.log(r.yellow(t),...i);}error(t,...i){console.error(r.red(t),...i);}step(t,i,o){console.log(r.cyan(`
|
|
3
|
+
[${t}/${i}]`),r.white(o));}},c=new E;var z="rapidkit",V=fileURLToPath(import.meta.url),q=dirname(V),X=join(q,"..","package.json"),Q=JSON.parse(readFileSync(X,"utf-8")),S=Q.version;async function T(){try{c.debug("Checking for updates...");let{stdout:e}=await execa("npm",["view",z,"version"],{timeout:3e3}),t=e.trim();t&&t!==S?(console.log(r.yellow(`
|
|
4
|
+
\u26A0\uFE0F Update available: ${S} \u2192 ${t}`)),console.log(r.cyan(`Run: npm install -g rapidkit@latest
|
|
5
|
+
`))):c.debug("You are using the latest version");}catch{c.debug("Could not check for updates");}}function w(){return S}var ie=".rapidkitrc.json";async function U(){let e=l.join(te.homedir(),ie);try{let t=await promises.readFile(e,"utf-8"),i=JSON.parse(t);return c.debug(`Loaded config from ${e}`),i}catch{return c.debug("No user config found, using defaults"),{}}}var v=class extends Error{constructor(i,o,n){super(i);this.code=o;this.details=n;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}};var u=class extends v{constructor(t,i){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",i);}};function O(e){let t=re(e);if(!t.validForNewPackages){let o=t.errors||[],n=t.warnings||[],s=[...o,...n];throw new u(e,`NPM validation failed: ${s.join(", ")}`)}if(!/^[a-z][a-z0-9_-]*$/.test(e))throw new u(e,"Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores");if(["test","tests","src","dist","build","lib","python","pip","poetry","node","npm","rapidkit","rapidkit"].includes(e.toLowerCase()))throw new u(e,`"${e}" is a reserved name. Please choose a different name.`);if(e.length<2)throw new u(e,"Name must be at least 2 characters long");if(e.length>214)throw new u(e,"Name must be less than 214 characters");return true}async function F(e,t){let i=N("Creating RapidKit workspace...").start();try{await promises.mkdir(e,{recursive:!0}),await promises.mkdir(l.join(e,".rapidkit"),{recursive:!0});let o={workspace_name:t.name,author:t.author,rapidkit_version:w(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(l.join(e,".rapidkit","config.json"),JSON.stringify(o,null,2));let n=ae();await promises.writeFile(l.join(e,"rapidkit"),n),await promises.chmod(l.join(e,"rapidkit"),493);let s=oe(t.name);if(await promises.writeFile(l.join(e,"README.md"),s),await promises.writeFile(l.join(e,".gitignore"),`# RapidKit workspace
|
|
6
6
|
.env
|
|
7
7
|
.env.*
|
|
8
8
|
!.env.example
|
|
@@ -18,9 +18,9 @@ Thumbs.db
|
|
|
18
18
|
# Logs
|
|
19
19
|
*.log
|
|
20
20
|
`),await ne(e),i.succeed("Workspace created!"),!t.skipGit){let d=N("Initializing git repository...").start();try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),d.succeed("Git repository initialized");}catch{d.warn("Could not initialize git repository");}}console.log(`
|
|
21
|
-
${
|
|
21
|
+
${r.green("\u2728 RapidKit workspace created successfully!")}
|
|
22
22
|
|
|
23
|
-
${
|
|
23
|
+
${r.bold("\u{1F4C2} Workspace structure:")}
|
|
24
24
|
${e}/
|
|
25
25
|
\u251C\u2500\u2500 rapidkit # Local CLI (add to PATH or use ./rapidkit)
|
|
26
26
|
\u251C\u2500\u2500 .rapidkit/ # Workspace configuration
|
|
@@ -28,25 +28,25 @@ ${e}/
|
|
|
28
28
|
\u2502 \u2514\u2500\u2500 templates/ # Project templates
|
|
29
29
|
\u2514\u2500\u2500 README.md
|
|
30
30
|
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
31
|
+
${r.bold("\u{1F680} Get started:")}
|
|
32
|
+
${r.cyan(`cd ${t.name}`)}
|
|
33
|
+
${r.cyan('export PATH="$PWD:$PATH"')} ${r.gray("# Add rapidkit to PATH")}
|
|
34
|
+
${r.cyan("rapidkit create my-api --template fastapi")}
|
|
35
|
+
${r.cyan("cd my-api")}
|
|
36
|
+
${r.cyan("rapidkit dev")}
|
|
37
37
|
|
|
38
|
-
${
|
|
38
|
+
${r.bold("\u{1F4E6} Available templates:")}
|
|
39
39
|
fastapi - FastAPI + Python (default)
|
|
40
40
|
nestjs - NestJS + TypeScript
|
|
41
41
|
|
|
42
|
-
${
|
|
42
|
+
${r.bold("\u{1F4DA} Commands:")}
|
|
43
43
|
rapidkit create <name> Create a new project
|
|
44
44
|
rapidkit create --help Show create options
|
|
45
45
|
rapidkit help Show all commands
|
|
46
46
|
|
|
47
|
-
${
|
|
48
|
-
${
|
|
49
|
-
`);}catch(o){throw i.fail("Failed to create workspace"),o}}function
|
|
47
|
+
${r.gray("Tip: Add workspace to PATH for easier access:")}
|
|
48
|
+
${r.cyan(`echo 'export PATH="${e}:$PATH"' >> ~/.bashrc`)}
|
|
49
|
+
`);}catch(o){throw i.fail("Failed to create workspace"),o}}function ae(){return `#!/usr/bin/env bash
|
|
50
50
|
#
|
|
51
51
|
# RapidKit CLI - Local workspace commands
|
|
52
52
|
# This script provides rapidkit commands within the workspace
|
|
@@ -269,6 +269,12 @@ cmd_project() {
|
|
|
269
269
|
case "$cmd" in
|
|
270
270
|
init)
|
|
271
271
|
echo -e "\${BLUE}\u{1F4E6} Installing dependencies...\${NC}"
|
|
272
|
+
|
|
273
|
+
# Source activate script first to ensure Poetry is available
|
|
274
|
+
if [[ -f ".rapidkit/activate" ]]; then
|
|
275
|
+
source .rapidkit/activate
|
|
276
|
+
fi
|
|
277
|
+
|
|
272
278
|
poetry install
|
|
273
279
|
echo -e "\${GREEN}\u2705 Dependencies installed!\${NC}"
|
|
274
280
|
;;
|
|
@@ -314,6 +320,12 @@ cmd_project() {
|
|
|
314
320
|
case "$cmd" in
|
|
315
321
|
init)
|
|
316
322
|
echo -e "\${BLUE}\u{1F4E6} Installing dependencies...\${NC}"
|
|
323
|
+
|
|
324
|
+
# Source activate script first to ensure environment is ready
|
|
325
|
+
if [[ -f ".rapidkit/activate" ]]; then
|
|
326
|
+
source .rapidkit/activate
|
|
327
|
+
fi
|
|
328
|
+
|
|
317
329
|
$pm install
|
|
318
330
|
echo -e "\${GREEN}\u2705 Dependencies installed!\${NC}"
|
|
319
331
|
;;
|
|
@@ -506,9 +518,9 @@ Thumbs.db
|
|
|
506
518
|
# Coverage
|
|
507
519
|
coverage/
|
|
508
520
|
`;if(await promises.writeFile(l.join(e,".gitignore"),G),n.succeed(`${o} project created!`),!t.skipGit){let y=N("Initializing git repository...").start();try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m",`Initial commit: ${o} project via RapidKit`],{cwd:e}),y.succeed("Git repository initialized");}catch{y.warn("Could not initialize git repository");}}if(!t.skipInstall&&!i){let y=t.package_manager||"npm",D=N(`Installing dependencies with ${y}...`).start();try{await execa(y,["install"],{cwd:e}),D.succeed("Dependencies installed");}catch{D.warn(`Could not install dependencies. Run '${y} install' manually.`);}}let A=l.basename(e);console.log(i?`
|
|
509
|
-
${
|
|
521
|
+
${r.green("\u2728 FastAPI project created successfully!")}
|
|
510
522
|
|
|
511
|
-
${
|
|
523
|
+
${r.bold("\u{1F4C2} Project structure:")}
|
|
512
524
|
${e}/
|
|
513
525
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
514
526
|
\u251C\u2500\u2500 src/
|
|
@@ -520,13 +532,12 @@ ${e}/
|
|
|
520
532
|
\u251C\u2500\u2500 pyproject.toml # Poetry configuration
|
|
521
533
|
\u2514\u2500\u2500 README.md
|
|
522
534
|
|
|
523
|
-
${
|
|
524
|
-
${
|
|
525
|
-
${
|
|
526
|
-
${
|
|
527
|
-
${a.cyan("rapidkit dev")} ${a.gray("# Start dev server")}
|
|
535
|
+
${r.bold("\u{1F680} Get started:")}
|
|
536
|
+
${r.cyan(`cd ${A}`)}
|
|
537
|
+
${r.cyan("rapidkit init")} ${r.gray("# Install dependencies")}
|
|
538
|
+
${r.cyan("rapidkit dev")} ${r.gray("# Start dev server")}
|
|
528
539
|
|
|
529
|
-
${
|
|
540
|
+
${r.bold("\u{1F4DA} Available commands:")}
|
|
530
541
|
rapidkit init # Install dependencies (poetry install)
|
|
531
542
|
rapidkit dev # Start dev server with hot reload
|
|
532
543
|
rapidkit start # Start production server
|
|
@@ -534,11 +545,11 @@ ${a.bold("\u{1F4DA} Available commands:")}
|
|
|
534
545
|
rapidkit lint # Lint code
|
|
535
546
|
rapidkit format # Format code
|
|
536
547
|
|
|
537
|
-
${
|
|
548
|
+
${r.gray("Alternative: use make commands (make dev, make test, ...)")}
|
|
538
549
|
`:`
|
|
539
|
-
${
|
|
550
|
+
${r.green("\u2728 NestJS project created successfully!")}
|
|
540
551
|
|
|
541
|
-
${
|
|
552
|
+
${r.bold("\u{1F4C2} Project structure:")}
|
|
542
553
|
${e}/
|
|
543
554
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
544
555
|
\u251C\u2500\u2500 src/
|
|
@@ -550,14 +561,13 @@ ${e}/
|
|
|
550
561
|
\u251C\u2500\u2500 package.json # Dependencies
|
|
551
562
|
\u2514\u2500\u2500 README.md
|
|
552
563
|
|
|
553
|
-
${
|
|
554
|
-
${
|
|
555
|
-
${
|
|
556
|
-
${
|
|
557
|
-
|
|
558
|
-
${a.cyan("rapidkit dev")} ${a.gray("# Start dev server")}
|
|
564
|
+
${r.bold("\u{1F680} Get started:")}
|
|
565
|
+
${r.cyan(`cd ${A}`)}
|
|
566
|
+
${t.skipInstall?r.cyan("rapidkit init")+r.gray(" # npm install")+`
|
|
567
|
+
`:""}${r.cyan("cp .env.example .env")}
|
|
568
|
+
${r.cyan("rapidkit dev")} ${r.gray("# Start dev server")}
|
|
559
569
|
|
|
560
|
-
${
|
|
570
|
+
${r.bold("\u{1F4DA} Available commands:")}
|
|
561
571
|
rapidkit init # Install dependencies
|
|
562
572
|
rapidkit dev # Start dev server with hot reload
|
|
563
573
|
rapidkit start # Start production server
|
|
@@ -566,30 +576,30 @@ ${a.bold("\u{1F4DA} Available commands:")}
|
|
|
566
576
|
rapidkit lint # Lint code
|
|
567
577
|
rapidkit format # Format code
|
|
568
578
|
|
|
569
|
-
${
|
|
579
|
+
${r.bold("\u{1F310} API endpoints:")}
|
|
570
580
|
http://localhost:8000/health # Health check
|
|
571
581
|
http://localhost:8000/docs # Swagger docs
|
|
572
582
|
http://localhost:8000/examples/notes # Example API
|
|
573
|
-
`);}catch(s){throw n.fail(`Failed to create ${o} project`),s}}async function K(e,t,i){let o=await promises.readdir(e,{withFileTypes:true});for(let n of o){let s=l.join(e,n.name),p=n.name.replace(/\.j2$/,""),d=l.join(t,p);if(n.isDirectory())await promises.mkdir(d,{recursive:true}),await K(s,d,i);else {let g=await promises.readFile(s,"utf-8");n.name.endsWith(".j2")&&(g=se(g,i)),await promises.writeFile(d,g),(p==="rapidkit"||p==="activate"||p.endsWith(".py")&&d.includes(".rapidkit"))&&await promises.chmod(d,493);}}}function se(e,t){let i=e;for(let[o,n]of Object.entries(t)){let s=new RegExp(`\\{\\{\\s*${o}\\s*\\}\\}`,"g");i=i.replace(s,String(n));let p=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\}\\}`,"g");i=i.replace(p,(j,C,_)=>String(n).replace(new RegExp(C,"g"),_));let d=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(d,String(n).toLowerCase());let g=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(g,(j,C,_)=>String(n).replace(new RegExp(C,"g"),_).toLowerCase());}return i}var h=null,
|
|
583
|
+
`);}catch(s){throw n.fail(`Failed to create ${o} project`),s}}async function K(e,t,i){let o=await promises.readdir(e,{withFileTypes:true});for(let n of o){let s=l.join(e,n.name),p=n.name.replace(/\.j2$/,""),d=l.join(t,p);if(n.isDirectory())await promises.mkdir(d,{recursive:true}),await K(s,d,i);else {let g=await promises.readFile(s,"utf-8");n.name.endsWith(".j2")&&(g=se(g,i)),await promises.writeFile(d,g),(p==="rapidkit"||p==="activate"||p.endsWith(".py")&&d.includes(".rapidkit"))&&await promises.chmod(d,493);}}}function se(e,t){let i=e;for(let[o,n]of Object.entries(t)){let s=new RegExp(`\\{\\{\\s*${o}\\s*\\}\\}`,"g");i=i.replace(s,String(n));let p=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\}\\}`,"g");i=i.replace(p,(j,C,_)=>String(n).replace(new RegExp(C,"g"),_));let d=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(d,String(n).toLowerCase());let g=new RegExp(`\\{\\{\\s*${o}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(g,(j,C,_)=>String(n).replace(new RegExp(C,"g"),_).toLowerCase());}return i}var h=null,x=false,I=new Command;I.name("rapidkit").description("Create RapidKit workspaces and projects").version(w());I.argument("[name]","Name of the workspace or project directory").option("-t, --template <template>","Create project with template (fastapi, nestjs) instead of workspace").option("-y, --yes","Skip prompts and use defaults").option("--skip-git","Skip git initialization").option("--skip-install","Skip installing dependencies").option("--debug","Enable debug logging").option("--dry-run","Show what would be created without creating it").option("--no-update-check","Skip checking for updates").action(async(e,t)=>{try{t.debug&&(c.setDebug(!0),c.debug("Debug mode enabled"));let i=await U();c.debug("User config loaded",i),t.updateCheck!==!1&&await T(),console.log(r.blue.bold(`
|
|
574
584
|
\u{1F680} Welcome to RapidKit!
|
|
575
585
|
`)),e||(le(),process.exit(0));try{O(e);}catch(p){throw p instanceof v&&(c.error(`
|
|
576
586
|
\u274C ${p.message}`),p.details&&c.warn(`\u{1F4A1} ${p.details}
|
|
577
587
|
`),process.exit(1)),p}let o=l.resolve(process.cwd(),e);h=o,await k.pathExists(o)&&(c.error(`
|
|
578
|
-
\u274C Directory "${e}" already exists`),console.log(
|
|
588
|
+
\u274C Directory "${e}" already exists`),console.log(r.cyan(`
|
|
579
589
|
\u{1F4A1} Choose a different name or delete the existing directory.
|
|
580
590
|
`)),process.exit(1));let n=!!t.template;if(n){let p=t.template.toLowerCase(),d=["fastapi","nestjs"];d.includes(p)||(c.error(`
|
|
581
|
-
\u274C Invalid template: ${t.template}`),console.log(
|
|
591
|
+
\u274C Invalid template: ${t.template}`),console.log(r.cyan(`
|
|
582
592
|
\u{1F4E6} Available templates: ${d.join(", ")}
|
|
583
|
-
`)),process.exit(1));}if(t.dryRun){console.log(
|
|
593
|
+
`)),process.exit(1));}if(t.dryRun){console.log(r.cyan(`
|
|
584
594
|
\u{1F50D} Dry-run mode - showing what would be created:
|
|
585
|
-
`)),console.log(
|
|
595
|
+
`)),console.log(r.white("\u{1F4C2} Path:"),o),console.log(r.white("\u{1F4E6} Type:"),n?`Project (${t.template})`:"Workspace"),console.log();return}let s;t.yes?(s={author:process.env.USER||"RapidKit User",description:n?`${t.template==="nestjs"?"NestJS":"FastAPI"} application generated with RapidKit`:void 0,package_manager:"npm"},console.log(r.gray(`Using default values (--yes flag)
|
|
586
596
|
`))):n?t.template.toLowerCase()==="fastapi"?s=await P.prompt([{type:"input",name:"author",message:"Author name:",default:process.env.USER||"RapidKit User"},{type:"input",name:"description",message:"Project description:",default:"FastAPI service generated with RapidKit"}]):s=await P.prompt([{type:"input",name:"author",message:"Author name:",default:process.env.USER||"RapidKit User"},{type:"input",name:"description",message:"Project description:",default:"NestJS application generated with RapidKit"},{type:"list",name:"package_manager",message:"Package manager:",choices:["npm","yarn","pnpm"],default:"npm"}]):s=await P.prompt([{type:"input",name:"author",message:"Author name:",default:process.env.USER||"RapidKit User"}]),n?await B(o,{name:e,template:t.template.toLowerCase(),author:s.author,description:s.description,package_manager:s.package_manager,skipGit:t.skipGit,skipInstall:t.skipInstall}):await F(o,{name:e,author:s.author,skipGit:t.skipGit});}catch(i){i instanceof v?(c.error(`
|
|
587
597
|
\u274C ${i.message}`),i.details&&c.warn(`\u{1F4A1} ${i.details}`),c.debug("Error code:",i.code)):(c.error(`
|
|
588
|
-
\u274C An unexpected error occurred:`),console.error(i)),process.exit(1);}finally{h=null;}});function le(){console.log(
|
|
589
|
-
`)),console.log(
|
|
590
|
-
`)),console.log(
|
|
591
|
-
`)),console.log(
|
|
592
|
-
`)),console.log(
|
|
593
|
-
`));}process.on("SIGINT",async()=>{if(!
|
|
594
|
-
|
|
595
|
-
\u26A0\uFE0F Interrupted by user`)),h&&await k.pathExists(h)){console.log(
|
|
598
|
+
\u274C An unexpected error occurred:`),console.error(i)),process.exit(1);}finally{h=null;}});function le(){console.log(r.white(`Usage: npx rapidkit <name> [options]
|
|
599
|
+
`)),console.log(r.bold("Create a workspace (recommended):")),console.log(r.cyan(" npx rapidkit my-workspace")),console.log(r.cyan(" cd my-workspace")),console.log(r.cyan(" rapidkit create my-api --template fastapi")),console.log(r.cyan(" cd my-api")),console.log(r.cyan(` rapidkit dev
|
|
600
|
+
`)),console.log(r.bold("Or create a project directly:")),console.log(r.cyan(" npx rapidkit my-project --template fastapi")),console.log(r.cyan(` npx rapidkit my-project --template nestjs
|
|
601
|
+
`)),console.log(r.bold("Options:")),console.log(r.gray(" -t, --template <template> Create project with template (fastapi, nestjs)")),console.log(r.gray(" -y, --yes Skip prompts and use defaults")),console.log(r.gray(" --skip-git Skip git initialization")),console.log(r.gray(" --skip-install Skip installing dependencies")),console.log(r.gray(" --debug Enable debug logging")),console.log(r.gray(` --dry-run Show what would be created
|
|
602
|
+
`)),console.log(r.bold("Templates:")),console.log(r.gray(" fastapi FastAPI + Python")),console.log(r.gray(` nestjs NestJS + TypeScript
|
|
603
|
+
`));}process.on("SIGINT",async()=>{if(!x){if(x=true,console.log(r.yellow(`
|
|
604
|
+
|
|
605
|
+
\u26A0\uFE0F Interrupted by user`)),h&&await k.pathExists(h)){console.log(r.gray("Cleaning up partial installation..."));try{await k.remove(h),console.log(r.green("\u2713 Cleanup complete"));}catch(e){c.debug("Cleanup failed:",e);}}process.exit(130);}});process.on("SIGTERM",async()=>{if(!x){if(x=true,c.debug("Received SIGTERM"),h&&await k.pathExists(h))try{await k.remove(h);}catch(e){c.debug("Cleanup failed:",e);}process.exit(143);}});I.parse();
|
package/dist/package.json
CHANGED