rapidkit 0.31.0 → 0.32.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.
- package/README.md +31 -10
- package/data/modules-embeddings.json +38525 -0
- package/dist/{analyze-NVQUHK5V.js → analyze-ZQHLV2YK.js} +1 -1
- package/dist/{autopilot-release-T4N4KHO6.js → autopilot-release-WYDX67HR.js} +1 -1
- package/dist/{chunk-U7XJZHU6.js → chunk-3Q7264EJ.js} +64 -20
- package/dist/chunk-KXTXQODI.js +5 -0
- package/dist/{chunk-CQXWD2ZG.js → chunk-LSFRHYMD.js} +3 -3
- package/dist/chunk-QCZGNOTH.js +2 -0
- package/dist/{create-KZYI3QRI.js → create-6AMYKNEG.js} +73 -63
- package/dist/doctor-SGPUU7UT.js +50 -0
- package/dist/dotnet-webapi-clean-W7SD3U3W.js +357 -0
- package/dist/{gofiber-standard-TFPNBIMS.js → gofiber-standard-NDCBY6OM.js} +6 -6
- package/dist/{gogin-standard-7UJ2OBYL.js → gogin-standard-WUOMIHDR.js} +6 -6
- package/dist/index.d.ts +3 -2
- package/dist/index.js +114 -126
- package/dist/{springboot-standard-H6GYMH3P.js → springboot-standard-WQWB5E24.js} +7 -7
- package/dist/{workspace-YLFC25EZ.js → workspace-EHYCBFXL.js} +1 -1
- package/dist/{workspace-archive-LVP3EMGI.js → workspace-archive-EJIGYKSR.js} +2 -2
- package/dist/workspace-run-OIPQYI6V.js +1 -0
- package/package.json +3 -1
- package/dist/chunk-TYC54P7X.js +0 -4
- package/dist/doctor-DDIR7LBO.js +0 -50
- package/dist/workspace-run-TGNMTL2V.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-7OGOVP5U.js';import {a
|
|
1
|
+
import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-7OGOVP5U.js';import {a as a$2,e,d as d$1,f,c,k as k$2}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {promises}from'fs';import*as k from'fs-extra';import m from'path';import q from'inquirer';import t from'chalk';import O from'ora';import {execa}from'execa';function S(){return c()}async function z(e,o,n,r){let l=d(o,b(),n);r&&(l.metadata||(l.metadata={}),l.metadata.python={version:r}),await b$1(e,l);}async function V(e){await k.outputFile(m.join(e,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
5
|
.rapidkit-workspace/
|
|
6
6
|
|
|
7
|
-
`,"utf-8");}async function U(e,
|
|
7
|
+
`,"utf-8");}async function U(e,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await k.outputFile(m.join(e,"poetry.toml"),`[virtualenvs]
|
|
8
8
|
in-project = true
|
|
9
9
|
`,"utf-8"),await k.outputFile(m.join(e,"pyproject.toml"),`[tool.poetry]
|
|
10
|
-
name = "${
|
|
10
|
+
name = "${n}"
|
|
11
11
|
version = "0.1.0"
|
|
12
12
|
description = "RapidKit workspace"
|
|
13
13
|
authors = []
|
|
@@ -20,7 +20,7 @@ rapidkit-core = "*"
|
|
|
20
20
|
[build-system]
|
|
21
21
|
requires = ["poetry-core"]
|
|
22
22
|
build-backend = "poetry.core.masonry.api"
|
|
23
|
-
`,"utf-8");}function ht(e,n,
|
|
23
|
+
`,"utf-8");}function ht(e,o,n,r){return JSON.stringify({schema_version:"1.0",workspace_name:e,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:o,python_version:n||null}},null,2)}function ft(e,o,n,r,l){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:e},node:{version:n||process.version},go:{version:r||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:l||null,sdk:l||null}}},null,2)}function wt(){return `version: "1.0"
|
|
24
24
|
mode: warn # "warn" or "strict"
|
|
25
25
|
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
26
26
|
# change profile (recommended): npx rapidkit bootstrap --profile polyglot
|
|
@@ -35,14 +35,14 @@ cache:
|
|
|
35
35
|
prune_on_bootstrap: false
|
|
36
36
|
self_heal: true
|
|
37
37
|
verify_integrity: false
|
|
38
|
-
`}async function
|
|
39
|
-
`,"utf-8"),a$1.debug(`Created .python-version with ${
|
|
38
|
+
`}async function kt(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Pt(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=e.trim();return o.length>0?o:void 0}catch{return}}async function Y(e,o,n,r,l){let[p,c]=await Promise.all([kt(),Pt()]);await k.outputFile(m.join(e,".rapidkit","workspace.json"),ht(o,n,r,l),"utf-8"),await k.outputFile(m.join(e,".rapidkit","toolchain.lock"),ft(n,r,process.version,p,c),"utf-8"),await k.outputFile(m.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await k.outputFile(m.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function se(e,o){let{workspaceName:n=m.basename(e),installMethod:r="venv",pythonVersion:l,profile:p,writeMarker:c=true,writeGitignore:u=true,onlyIfMissing:g=true}=o||{},h=[],[a$1,i]=await Promise.all([kt(),Pt()]),y=[{relPath:m.join(".rapidkit","workspace.json"),content:ht(n,r,l,p)},{relPath:m.join(".rapidkit","toolchain.lock"),content:ft(r,l,process.version,a$1,i)},{relPath:m.join(".rapidkit","policies.yml"),content:wt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:vt()}];for(let d of y){let P=m.join(e,d.relPath);g&&await k.pathExists(P)||(await k.outputFile(P,d.content,"utf-8"),h.push(d.relPath));}if(c&&(!!!await a(e)||!g)){let P=d(n,b(),r);l&&(P.metadata||(P.metadata={}),P.metadata.python={version:l}),await b$1(e,P),h.push(".rapidkit-workspace");}if(u){let d=m.join(e,".gitignore");(!g||!await k.pathExists(d))&&(await V(e),h.push(".gitignore"));}return h}var K="3.10",bt=["3.10","3.11","3.12"];async function gt(e){try{let{stdout:o}=await execa(e,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function Mt(e,o){try{await promises.writeFile(m.join(e,".python-version"),`${o}
|
|
39
|
+
`,"utf-8"),a$1.debug(`Created .python-version with ${o}`);}catch(n){a$1.warn(`Failed to create .python-version: ${n}`);}}function F(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$2())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function tt(e,o){F(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=S();try{return await execa(n,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new h;e.stop?.();let{installPipx:r}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new h;e.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");throw new k$1("Install pipx with python -m pip",l instanceof Error?l:new Error(c))}e.succeed("pipx installed"),F();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"pipx not runnable after install");throw new k$1("Verify pipx after install",new Error(`${c}
|
|
40
40
|
|
|
41
|
-
Try reopening your terminal or run: ${
|
|
42
|
-
${
|
|
43
|
-
${i.stderr||""}`);
|
|
41
|
+
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function N(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Tt(e){let o=e.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function mt(e){if(!e)return null;let o=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function lt(e,o){let[n,r]=e.split(".").map(c=>Number(c)),[l,p]=o.split(".").map(c=>Number(c));return n!==l?n-l:r-p}function G(e,o){return lt(e,o)>=0}async function Dt(e$1){let o=new Set,n=e(14,10);for(let i of n)try{let y=await execa(i.command,i.args,{timeout:2500}),d=mt(`${y.stdout||""}
|
|
42
|
+
${y.stderr||""}`);d&&G(d,K)&&o.add(d);}catch{}let r=null;try{let i=await execa(S(),["--version"],{timeout:2500}),y=mt(`${i.stdout||""}
|
|
43
|
+
${i.stderr||""}`);y&&G(y,K)&&(r=y,o.add(y));}catch{}let l=bt.filter(i=>G(i,K)),p=new Set([...l,...o]),c=Array.from(p).sort((i,y)=>lt(y,i)),u=e$1?Tt(e$1):null,g=u&&G(u,K)?u:r||c[0]||K;return p.has(g)||p.add(g),{choices:Array.from(p).sort((i,y)=>lt(y,i)).map(i=>{let y=[];return i===r&&y.push("current system"),i===K&&y.push("minimum supported"),o.has(i)&&i!==r&&y.push("detected"),{name:y.length>0?`${i} (${y.join(", ")})`:i,value:i}}),defaultValue:g}}async function Kt(){F();let e=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=c();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:e,pipx:o}}async function xt(){F();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Nt(e,o){return e==="poetry"&&o.poetry?"poetry":e==="pipx"&&o.pipx?"pipx":e==="venv"?"venv":o.poetry?"poetry":"venv"}async function Ft(e,o){F(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(o)throw new g;let{installPoetry:n}=await q.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new g;let r=await tt(e,o);e.start("Installing Poetry with pipx");try{await N(r,["install","poetry"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(c))try{await N(r,["upgrade","poetry"]);}catch{}else throw new k$1("Install Poetry with pipx",l instanceof Error?l:new Error(c))}e.succeed("Poetry installed"),F();try{await execa("poetry",["--version"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"Poetry not found on PATH");throw new k$1("Verify Poetry after pipx install",new Error(`${c}
|
|
44
44
|
|
|
45
|
-
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function
|
|
45
|
+
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Ot(e){let o=e==="poetry";return `#!/usr/bin/env sh
|
|
46
46
|
set -eu
|
|
47
47
|
|
|
48
48
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
@@ -52,16 +52,16 @@ if [ -x "$VENV_RAPIDKIT" ]; then
|
|
|
52
52
|
exec "$VENV_RAPIDKIT" "$@"
|
|
53
53
|
fi
|
|
54
54
|
|
|
55
|
-
${
|
|
55
|
+
${o?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]; then
|
|
56
56
|
exec poetry run rapidkit "$@"
|
|
57
57
|
fi
|
|
58
58
|
|
|
59
59
|
`:""}echo "RapidKit launcher could not find a local Python CLI." 1>&2
|
|
60
60
|
echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
61
|
-
${
|
|
61
|
+
${o?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
|
|
62
62
|
`:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
63
63
|
exit 1
|
|
64
|
-
`}function
|
|
64
|
+
`}function Vt(e){return `@echo off
|
|
65
65
|
setlocal
|
|
66
66
|
|
|
67
67
|
set "SCRIPT_DIR=%~dp0"
|
|
@@ -80,8 +80,8 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
|
|
|
80
80
|
`:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
81
81
|
echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
82
82
|
exit /b 1
|
|
83
|
-
`}async function
|
|
84
|
-
\u{1F4CC} Configuration notes:`)),
|
|
83
|
+
`}async function It(e,o){await k.outputFile(m.join(e,"rapidkit"),Ot(o),{encoding:"utf-8",mode:493}),await k.outputFile(m.join(e,"rapidkit.cmd"),Vt(o),"utf-8");}async function le(e,o){let{skipGit:n=false,testMode:r=false,demoMode:l=false,dryRun:p=false,yes:c=false,userConfig:u={},installMethod:g,profile:h}=o,a=e||"rapidkit",i$1=m.resolve(process.cwd(),a);if(await k.pathExists(i$1))throw new i(a);if(p){let f=h||(c?"minimal":void 0),R=g||u.defaultInstallMethod||"poetry",b=u.pythonVersion||"3.10";await Lt(i$1,a,l,u,f,R,b);return}if(l){await Gt(i$1,a,n);return}let y=new Set(["python-only","polyglot","enterprise"]),d=h||"";if(!c&&!h){let{selectedProfile:f}=await q.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=f;}else d||(d="minimal");let P=!c&&y.has(d),$=typeof u.pythonVersion=="string"&&u.pythonVersion.trim().length>0?u.pythonVersion.trim():void 0,T=g||u.defaultInstallMethod||"poetry",_=P?await Kt():{poetry:true,pipx:true},L=P?await Dt($):{choices:bt.map(f=>({name:f,value:f})),defaultValue:K},et=Nt(T,_),Ct=[{name:_.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:_.pipx?"\u{1F527} pipx (Global isolated - RapidKit CLI only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],x=P?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:L.choices,default:L.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Ct,default:et}]):await(async()=>{let f=g||u.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:u.pythonVersion||"3.10",installMethod:f}})();if(P&&(console.log(t.gray(`
|
|
84
|
+
\u{1F4CC} Configuration notes:`)),x.pythonVersion==="3.10"?console.log(t.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):x.pythonVersion==="3.11"?console.log(t.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):x.pythonVersion==="3.12"&&console.log(t.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),x.installMethod==="poetry"?console.log(t.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):x.installMethod==="venv"?console.log(t.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(t.gray(" \u2022 pipx: Global isolated, RapidKit CLI only, no local venv")),console.log("")),new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(d)){let f=O("Creating workspace").start();try{await k.ensureDir(i$1),f.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,d),await V(i$1),await U(i$1,a);let R={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
|
|
85
85
|
|
|
86
86
|
RapidKit **${R[d]}** workspace.
|
|
87
87
|
|
|
@@ -96,6 +96,10 @@ npx rapidkit dev
|
|
|
96
96
|
cd my-service
|
|
97
97
|
npx rapidkit init
|
|
98
98
|
npx rapidkit dev
|
|
99
|
+
`:d==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
|
|
100
|
+
cd my-api
|
|
101
|
+
npx rapidkit init
|
|
102
|
+
npx rapidkit dev
|
|
99
103
|
`:d==="node-only"?`npx rapidkit create project nestjs.standard my-app
|
|
100
104
|
cd my-app
|
|
101
105
|
npx rapidkit init
|
|
@@ -104,34 +108,36 @@ npx rapidkit dev
|
|
|
104
108
|
cd <project-name>
|
|
105
109
|
npx rapidkit init
|
|
106
110
|
npx rapidkit dev
|
|
107
|
-
`)+"```\n","utf-8"),!
|
|
111
|
+
`)+"```\n","utf-8"),!n){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-EHYCBFXL.js');await b(i$1,a);}catch{}if(console.log(t.green(`
|
|
108
112
|
\u2728 Workspace created!
|
|
109
113
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
|
|
110
114
|
\u{1F680} Get started:
|
|
111
115
|
`)),console.log(t.white(` cd ${a}`)),d==="go-only"){console.log(t.white(" npx rapidkit create project gofiber.standard my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
112
|
-
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:
|
|
113
|
-
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else d==="java-only"
|
|
114
|
-
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."))
|
|
116
|
+
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
|
|
117
|
+
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(d==="java-only")console.log(t.white(" npx rapidkit create project springboot.standard my-service")),console.log(t.white(" cd my-service")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
118
|
+
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(d==="dotnet-only"){console.log(t.white(" npx rapidkit create project dotnet.webapi.clean my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
119
|
+
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 ASP.NET Core kit runs through the npm package with .NET tooling."));try{let{stdout:b}=await execa("dotnet",["--version"],{timeout:3e3});console.log(t.gray(`\u2699\uFE0F .NET SDK ${b.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(t.yellow(`
|
|
120
|
+
\u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else d==="node-only"?(console.log(t.white(" npx rapidkit create project nestjs.standard my-app")),console.log(t.white(" cd my-app")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
115
121
|
`)),console.log(t.gray("\u{1F4A1} Python engine will be installed automatically on first `create project nestjs.standard`."))):(console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
116
|
-
`)),console.log(t.gray("\u{1F4A1} Bootstrap a specific runtime: rapidkit bootstrap --profile java-only|python-only|node-only|go-only|polyglot|enterprise")));console.log(t.cyan(`
|
|
122
|
+
`)),console.log(t.gray("\u{1F4A1} Bootstrap a specific runtime: rapidkit bootstrap --profile java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")));console.log(t.cyan(`
|
|
117
123
|
\u{1F4DA} More info:`)),console.log(t.gray(" \u2022 Change profile anytime: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 View config: cat "+a+"/.rapidkit-workspace")),console.log(t.gray(" \u2022 Check health: rapidkit doctor")),console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(t.red(`
|
|
118
|
-
\u274C Error:`),R),R}return}{let f=S(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(
|
|
124
|
+
\u274C Error:`),R),R}return}{let f=S(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(P&&!c){console.log(t.yellow(`
|
|
119
125
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
120
126
|
`)),console.log(t.cyan(`You have 3 options:
|
|
121
|
-
`));let{pythonAction:
|
|
127
|
+
`));let{pythonAction:D}=await q.prompt([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${w}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(D==="cancel"&&(console.log(t.cyan(`
|
|
122
128
|
\u{1F4A1} How to install Python:
|
|
123
129
|
`)),console.log(t.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(t.white(" macOS (Homebrew): brew install python@3.10")),console.log(t.white(` Windows: https://python.org/downloads
|
|
124
130
|
`)),console.log(t.gray(` After installing Python, run: npx rapidkit ${a}
|
|
125
|
-
`)),process.exit(1)),
|
|
131
|
+
`)),process.exit(1)),D==="install"){console.log(t.cyan(`
|
|
126
132
|
\u{1F4A1} Install Python on your system:
|
|
127
|
-
`));let
|
|
128
|
-
`)):
|
|
129
|
-
`)):
|
|
133
|
+
`));let j=process.platform;j==="linux"?console.log(t.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
134
|
+
`)):j==="darwin"?console.log(t.white(` brew install python@3.10
|
|
135
|
+
`)):j==="win32"&&(console.log(t.white(` Download: https://python.org/downloads
|
|
130
136
|
`)),console.log(t.white(` Run the installer and check "Add Python to PATH"
|
|
131
137
|
`))),console.log(t.gray(` After installing, run: npx rapidkit ${a}
|
|
132
|
-
`)),process.exit(0);}if(
|
|
138
|
+
`)),process.exit(0);}if(D==="fallback"&&(console.log(t.green(`
|
|
133
139
|
\u2705 Switching to "${w}" profile (no Python required).
|
|
134
|
-
`)),d=w,new Set(["go-only","java-only","node-only","minimal"]).has(w))){let C=O("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
|
|
140
|
+
`)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w))){let C=O("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
|
|
135
141
|
|
|
136
142
|
RapidKit **${B[w]}** workspace (switched from ${d} due to missing Python).
|
|
137
143
|
|
|
@@ -146,6 +152,10 @@ npx rapidkit dev
|
|
|
146
152
|
cd my-service
|
|
147
153
|
npx rapidkit init
|
|
148
154
|
npx rapidkit dev
|
|
155
|
+
`:w==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
|
|
156
|
+
cd my-api
|
|
157
|
+
npx rapidkit init
|
|
158
|
+
npx rapidkit dev
|
|
149
159
|
`:w==="node-only"?`npx rapidkit create project nestjs.standard my-app
|
|
150
160
|
cd my-app
|
|
151
161
|
npx rapidkit init
|
|
@@ -154,7 +164,7 @@ npx rapidkit dev
|
|
|
154
164
|
cd <project-name>
|
|
155
165
|
npx rapidkit init
|
|
156
166
|
npx rapidkit dev
|
|
157
|
-
`)+"```\n","utf-8"),!
|
|
167
|
+
`)+"```\n","utf-8"),!n){C.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w} profile)`],{cwd:i$1}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}try{let{registerWorkspace:$t}=await import('./workspace-EHYCBFXL.js');await $t(i$1,a);}catch{}console.log(t.green(`
|
|
158
168
|
\u2728 Workspace created with fallback profile!
|
|
159
169
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
|
|
160
170
|
\u{1F680} Get started:
|
|
@@ -164,27 +174,27 @@ npx rapidkit dev
|
|
|
164
174
|
`)),console.log("");return}catch(B){throw C.fail("Failed to create workspace"),console.error(t.red(`
|
|
165
175
|
\u274C Error:`),B),B}}}else if(console.log(t.yellow(`
|
|
166
176
|
\u26A0\uFE0F Python not detected. Auto-switching to "${w}" profile (no Python required).
|
|
167
|
-
`)),d=w,new Set(["go-only","java-only","node-only","minimal"]).has(w)){let
|
|
177
|
+
`)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w)){let j=O("Creating workspace").start();try{if(await k.ensureDir(i$1),j.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a),!n){j.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w})`],{cwd:i$1}),j.succeed("Git repository initialized");}catch{j.warn("Could not initialize git repository");}}try{let{registerWorkspace:C}=await import('./workspace-EHYCBFXL.js');await C(i$1,a);}catch{}console.log(t.green(`
|
|
168
178
|
\u2728 Workspace created (auto-fallback profile)!
|
|
169
179
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(w)),console.log(t.cyan("\u{1F4A1} Reason:"),t.gray("Python not detected; switched from "+d)),console.log(t.cyan(`
|
|
170
180
|
\u{1F680} Get started:
|
|
171
181
|
`)),console.log(t.white(` cd ${a}`)),console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
|
|
172
182
|
`)),console.log(t.cyan(`\u{1F4A1} Add Python later:
|
|
173
183
|
`)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: cd ${a} && rapidkit bootstrap --profile ${d}
|
|
174
|
-
`)),console.log("");return}catch(C){throw
|
|
175
|
-
\u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=O("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await
|
|
184
|
+
`)),console.log("");return}catch(C){throw j.fail("Failed to create workspace"),console.error(t.red(`
|
|
185
|
+
\u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=O("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await Rt(x.pythonVersion);if(R)f=await gt(R),f?(a$1.info(` Detected Python ${f}`),I.succeed(`Python ${f} detected`)):I.warn("Could not detect exact Python version");else {let b=S();f=await gt(b),f?I.succeed(`Python ${f} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await xt()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await z(i$1,a,x.installMethod,f||void 0),f&&await Mt(i$1,f),await Y(i$1,a,x.installMethod,f||x.pythonVersion,d||h),await V(i$1),await U(i$1,a),x.installMethod==="poetry")try{await _t(i$1,x.pythonVersion,I,r,u,c);}catch(b){let w=b?.details||b?.message||String(b);if(w.includes("pyenv")||w.includes("exit status 127")||w.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${w}`);try{await ct(i$1,x.pythonVersion,I,r,u),x.installMethod="venv";}catch(D){throw D}}else throw b}else x.installMethod==="venv"?await ct(i$1,x.pythonVersion,I,r,u):await Et(i$1,I,r,u,c);if(await It(i$1,x.installMethod),await jt(i$1,x.installMethod),I.succeed("RapidKit environment ready!"),!o.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-EHYCBFXL.js');await b(i$1,a);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
|
|
176
186
|
\u2728 RapidKit environment created successfully!
|
|
177
|
-
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${d}`)),console.log(t.gray(` \u2022 Python: ${
|
|
187
|
+
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${d}`)),console.log(t.gray(` \u2022 Python: ${x.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${x.installMethod}`)),console.log(t.cyan(`
|
|
178
188
|
\u{1F680} Get started:
|
|
179
|
-
`)),console.log(t.white(` cd ${a}`)),
|
|
180
|
-
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else
|
|
189
|
+
`)),console.log(t.white(` cd ${a}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{F();let{stdout:w}=await execa("poetry",["--version"]),A=w.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[1])>=2?b="source $(poetry env info --path)/bin/activate":b="poetry shell");}catch{}console.log(t.white(` ${b} # Or: poetry run rapidkit`)),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
|
|
190
|
+
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else x.installMethod==="venv"?(console.log(t.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
|
|
181
191
|
\u{1F4E6} Why venv? Standard, zero extra tools, lightweight`))):(console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
|
|
182
192
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(t.cyan(`
|
|
183
|
-
\u{1F4DA} Next steps:`)),console.log(t.gray(" 1. Check README.md for workspace details")),console.log(t.gray(" 2. Create your first project: rapidkit create project")),console.log(t.gray(" 3. See all runtimes: rapidkit list # Shows: fastapi, nestjs, springboot, gofiber, gogin")),console.log(t.cyan(`
|
|
184
|
-
\u{1F4A1} Profile management:`)),console.log(t.gray(" \u2022 Add Python? \u2192 rapidkit bootstrap --profile python-only|polyglot")),console.log(t.gray(" \u2022 Add Node.js? \u2192 rapidkit bootstrap --profile node-only|polyglot")),console.log(t.gray(" \u2022 Add Go? \u2192 rapidkit bootstrap --profile go-only|polyglot")),console.log(t.gray(" \u2022 Full setup? \u2192 rapidkit bootstrap --profile enterprise")),console.log(t.cyan(`
|
|
193
|
+
\u{1F4DA} Next steps:`)),console.log(t.gray(" 1. Check README.md for workspace details")),console.log(t.gray(" 2. Create your first project: rapidkit create project")),console.log(t.gray(" 3. See all runtimes: rapidkit list # Shows: fastapi, nestjs, springboot, gofiber, gogin, dotnet")),console.log(t.cyan(`
|
|
194
|
+
\u{1F4A1} Profile management:`)),console.log(t.gray(" \u2022 Add Python? \u2192 rapidkit bootstrap --profile python-only|polyglot")),console.log(t.gray(" \u2022 Add Node.js? \u2192 rapidkit bootstrap --profile node-only|polyglot")),console.log(t.gray(" \u2022 Add Go? \u2192 rapidkit bootstrap --profile go-only|polyglot")),console.log(t.gray(" \u2022 Add .NET? \u2192 rapidkit bootstrap --profile dotnet-only|polyglot")),console.log(t.gray(" \u2022 Full setup? \u2192 rapidkit bootstrap --profile enterprise")),console.log(t.cyan(`
|
|
185
195
|
\u{1F4D6} Common commands:`)),console.log(t.white(" rapidkit create - Create a new project (interactive)")),console.log(t.white(" rapidkit list - List available kits")),console.log(t.white(" rapidkit modules - List available modules")),console.log(t.white(" rapidkit doctor - Check workspace health")),console.log(t.white(` rapidkit bootstrap --help - Advanced workspace configuration
|
|
186
|
-
`));try{let{stdout:
|
|
187
|
-
\u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function
|
|
196
|
+
`));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(t.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(t.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){I.fail("Failed to create RapidKit environment"),console.error(t.red(`
|
|
197
|
+
\u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function Rt(e$1){let o=[];if(!a$2())try{let{stdout:p}=await execa("pyenv",["which","python"]),c=p.trim();c&&o.push(c);}catch{}let n=Number(e$1.split(".")[1]),r=e(n,10).map(p=>p.command).filter(Boolean);o.push(`python${e$1}`,...r,...d$1());let l=[...new Set(o)];for(let p of l)try{let c=p==="py"?["-3","--version"]:["--version"],u=p==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:g}=await execa(p,c,{timeout:2e3}),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&G(h,e$1))return await execa(p,u,{timeout:2e3}),p}catch{continue}return null}async function _t(e,o,n,r,l$1,p=false){await Ft(n,p),n.start("Finding Python interpreter");let c=await Rt(o);c?(a$1.debug(`Found working Python: ${c}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=m.join(e,"pyproject.toml"),h=(await k.pathExists(u)?await promises.readFile(u,"utf-8"):"").includes("rapidkit-core");if(h)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:e}),n.succeed("Poetry project initialized");let d=await promises.readFile(u,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
|
|
188
198
|
package-mode = false`):d.includes("[project]")&&(d.includes("[build-system]")?d=d.replace("[build-system]",`
|
|
189
199
|
[tool.poetry]
|
|
190
200
|
package-mode = false
|
|
@@ -193,37 +203,37 @@ package-mode = false
|
|
|
193
203
|
|
|
194
204
|
[tool.poetry]
|
|
195
205
|
package-mode = false
|
|
196
|
-
`),await promises.writeFile(
|
|
206
|
+
`),await promises.writeFile(u,d,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let a=c||S(),i=f(m.join(e,".venv"));try{await execa(a,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(y){a$1.debug(`python -m venv failed: ${y}`),n.warn("Could not pre-create virtualenv, Poetry will try"),i=c||S();}try{await execa("poetry",["env","use",i||S()],{cwd:e}),a$1.debug(`Poetry env set to: ${i}`);}catch(y){a$1.debug(`Could not set Poetry env: ${y}`);}if(n.start("Installing RapidKit"),h&&!r){let y=d$2(l$1||{}),d=y?await k.pathExists(y):false,P=d&&y?y:"rapidkit-core";y&&!d&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${y}. Falling back to PyPI.`),n.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let $=false,T=null;for(let _=1;_<=3;_++)try{await execa(i,["-m","pip","install",P,"--quiet"],{cwd:e,timeout:18e4}),$=true;break}catch(L){T=L,a$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(et=>setTimeout(et,2e3)));}if(!$){let _=T?.stderr||T?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
197
207
|
Error: ${_}
|
|
198
208
|
|
|
199
209
|
Possible solutions:
|
|
200
210
|
1. Check your internet connection
|
|
201
211
|
2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
|
|
202
|
-
3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {
|
|
203
|
-
Error: ${
|
|
212
|
+
3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),n.succeed("Poetry environment synced");}catch(y){a$1.debug(`poetry install --no-root failed: ${y}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let y=d$2(l$1||{});if(!y)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,d=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*P}),y=true;break}catch($){d=$,a$1.debug(`Poetry add attempt ${P} failed: ${$}`),P<3&&(n.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(T=>setTimeout(T,2e3)));}if(!y){let P=d?.stderr||d?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
213
|
+
Error: ${P}
|
|
204
214
|
|
|
205
215
|
Possible solutions:
|
|
206
216
|
1. Check your internet connection
|
|
207
217
|
2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
|
|
208
|
-
3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}
|
|
218
|
+
3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await y()&&!r){n.start("Checking optional global pipx installation");let P=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(P,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch($){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${$}`);}}}catch(y){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${y}`);}}async function ct(e,o,n,r,l$1,p=false){n.start(`Checking Python ${o}`);let c=S();try{let{stdout:g}=await execa(c,["--version"]),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&!G(h,o))throw new f$1(o,h);n.succeed(`Python ${h} found`);}catch(g){throw g instanceof f$1?g:new f$1(o)}n.start("Creating virtual environment");try{await execa(c,["-m","venv",".venv"],{cwd:e}),n.succeed("Virtual environment created");}catch(g){if(n.fail("Failed to create virtual environment"),(a=>typeof a=="object"&&a!==null&&"stdout"in a&&typeof a.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let a=g.stdout.match(/apt install (python[\d.]+-venv)/),i=a?a[1]:"python3-venv";throw new k$1("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
209
219
|
|
|
210
220
|
On Debian/Ubuntu systems, install the venv package:
|
|
211
221
|
sudo apt install ${i}
|
|
212
222
|
|
|
213
223
|
Or use Poetry instead (recommended):
|
|
214
|
-
npx rapidkit ${m.basename(e)} --yes`))}throw new k$1("Virtual environment creation",g instanceof Error?g:new Error(String(g)))}
|
|
224
|
+
npx rapidkit ${m.basename(e)} --yes`))}throw new k$1("Virtual environment creation",g instanceof Error?g:new Error(String(g)))}n.start("Installing RapidKit");let u=f(m.join(e,".venv"));if(await execa(u,["-m","pip","install","--upgrade","pip"],{cwd:e}),r){let g=d$2(l$1||{});if(!g)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${g}`),n.text="Installing RapidKit from local path (test mode)",await execa(u,["-m","pip","install","-e",g],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let g=false,h=null;for(let a=1;a<=3;a++)try{await execa(u,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*a}),g=true;break}catch(i){h=i,a$1.debug(`pip install attempt ${a} failed: ${i}`),a<3&&(n.text=`Retrying installation (attempt ${a+1}/3)`,await new Promise(y=>setTimeout(y,2e3)));}if(!g){let a=h?.stderr||h?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${a}`),a.includes("Could not find")||a.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
215
225
|
Error: ${a}
|
|
216
226
|
|
|
217
227
|
Possible solutions:
|
|
218
228
|
1. Check your internet connection
|
|
219
229
|
2. Try installing manually: cd ${m.basename(e)} && ${f(".venv")} -m pip install rapidkit-core
|
|
220
|
-
3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}
|
|
221
|
-
`,"utf-8");return}
|
|
222
|
-
`,"utf-8");}async function
|
|
223
|
-
# Or simply use: poetry run rapidkit <command>`:
|
|
230
|
+
3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await g()&&!r){n.start("Checking optional global pipx installation");let a=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(a,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(i){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(g){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${g}`);}}async function Et(e,o,n,r,l$1=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:c}=await import('./pythonRapidkitExec-4MP62M5R.js'),u=await c();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
231
|
+
`,"utf-8");return}u.reason==="constraint-missing"?o.warn('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):u.reason==="constraint-unsupported"&&o.warn('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),a$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${u.reason}, installed=${u.installedVersion??"unknown"}, expected=${u.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(c){a$1.debug(`Global RapidKit version-aware check failed before pipx install: ${c}`);}let p=await tt(o,l$1);if(o.start("Installing RapidKit globally with pipx"),n){let c=d$2(r||{});if(!c)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${c}`),o.text="Installing RapidKit from local path (test mode)",await N(p,["install","-e",c]);}else {o.text="Installing RapidKit from PyPI";try{await N(p,["install","rapidkit-core"]);}catch(c){try{o.text="RapidKit already installed globally, upgrading to match expected version",await N(p,["upgrade","rapidkit-core"]);}catch(u){throw a$1.debug(`pipx install/upgrade failed: install=${c}, upgrade=${u}`),new l}}}o.succeed("RapidKit installed globally"),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
232
|
+
`,"utf-8");}async function ce(e,o){let{skipGit:n=false,testMode:r=false,userConfig:l={},yes:p=false,installMethod:c,pythonVersion:u="3.10"}=o||{},g=c||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=g==="poetry"&&!await xt()?"venv":g;await z(e,m.basename(e),h),await V(e),await Y(e,m.basename(e),h,u,o?.profile);let a=O("Registering workspace").start();try{h==="poetry"?(await U(e,m.basename(e)),await _t(e,u,a,r,l,p)):h==="venv"?await ct(e,u,a,r,l):await Et(e,a,r,l,p),await It(e,h),await jt(e,h),a.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-EHYCBFXL.js');await i(e,m.basename(e));}catch{}if(!n){a.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}}catch(i){throw a.fail("Failed to register workspace"),i}}async function jt(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
233
|
+
# Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",r=o==="poetry"?`# No activation needed (recommended):
|
|
224
234
|
./rapidkit --help
|
|
225
235
|
# or:
|
|
226
|
-
poetry run rapidkit --help`:
|
|
236
|
+
poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
|
|
227
237
|
./rapidkit --help
|
|
228
238
|
# or direct:
|
|
229
239
|
./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
|
|
@@ -234,7 +244,7 @@ This directory contains a RapidKit development environment.
|
|
|
234
244
|
|
|
235
245
|
## Installation Method
|
|
236
246
|
|
|
237
|
-
**${
|
|
247
|
+
**${o==="poetry"?"Poetry":o==="venv"?"Python venv + pip":"pipx (global)"}**
|
|
238
248
|
|
|
239
249
|
## Getting Started
|
|
240
250
|
|
|
@@ -249,7 +259,7 @@ ${r}
|
|
|
249
259
|
### 1. Activate Environment
|
|
250
260
|
|
|
251
261
|
\`\`\`bash
|
|
252
|
-
${
|
|
262
|
+
${n}
|
|
253
263
|
\`\`\`
|
|
254
264
|
|
|
255
265
|
### 2. Create Your First Project
|
|
@@ -316,8 +326,8 @@ For full documentation, visit: [RapidKit Docs](https://getrapidkit.com) *(or app
|
|
|
316
326
|
## Workspace Structure
|
|
317
327
|
|
|
318
328
|
\`\`\`
|
|
319
|
-
${
|
|
320
|
-
${
|
|
329
|
+
${o==="venv"?".venv/ # Python virtual environment":""}
|
|
330
|
+
${o==="poetry"?"pyproject.toml # Poetry configuration":""}
|
|
321
331
|
my-project/ # Your RapidKit projects go here
|
|
322
332
|
README.md # This file
|
|
323
333
|
\`\`\`
|
|
@@ -330,7 +340,7 @@ If you encounter issues:
|
|
|
330
340
|
2. Check RapidKit installation: \`rapidkit --version\`
|
|
331
341
|
3. Run diagnostics: \`rapidkit doctor\`
|
|
332
342
|
4. Visit RapidKit documentation or GitHub issues
|
|
333
|
-
`;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function
|
|
343
|
+
`;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function Gt(e,o,n){let r=O("Creating demo workspace").start();try{await k.ensureDir(e),r.succeed("Directory created"),r.start("Setting up demo kit generator");let l=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(m.join(e,"package.json"),l,"utf-8"),await promises.writeFile(m.join(e,"generate-demo.js"),`#!/usr/bin/env node
|
|
334
344
|
/**
|
|
335
345
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
336
346
|
*
|
|
@@ -726,7 +736,7 @@ venv/
|
|
|
726
736
|
}
|
|
727
737
|
|
|
728
738
|
main().catch(console.error);
|
|
729
|
-
`,"utf-8");try{await execa("chmod",["+x",m.join(e,"generate-demo.js")]);}catch{}let
|
|
739
|
+
`,"utf-8");try{await execa("chmod",["+x",m.join(e,"generate-demo.js")]);}catch{}let c=`# RapidKit Demo Workspace
|
|
730
740
|
|
|
731
741
|
Welcome to your RapidKit demo workspace! This environment lets you generate FastAPI demo projects using bundled RapidKit templates, without needing to install Python RapidKit.
|
|
732
742
|
|
|
@@ -797,7 +807,7 @@ pipx install rapidkit
|
|
|
797
807
|
## \u{1F6E0}\uFE0F Workspace Structure
|
|
798
808
|
|
|
799
809
|
\`\`\`
|
|
800
|
-
${
|
|
810
|
+
${o}/
|
|
801
811
|
\u251C\u2500\u2500 generate-demo.js # Demo project generator
|
|
802
812
|
\u251C\u2500\u2500 README.md # This file
|
|
803
813
|
\u2514\u2500\u2500 my-api/ # Your generated projects go here
|
|
@@ -813,7 +823,7 @@ ${n}/
|
|
|
813
823
|
---
|
|
814
824
|
|
|
815
825
|
**Generated with RapidKit** | [GitHub](https://github.com/rapidkitlabs/rapidkit-npm)
|
|
816
|
-
`;if(await promises.writeFile(m.join(e,"README.md"),
|
|
826
|
+
`;if(await promises.writeFile(m.join(e,"README.md"),c,"utf-8"),r.succeed("Demo workspace setup complete"),!n){r.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await k.outputFile(m.join(e,".gitignore"),`# Dependencies
|
|
817
827
|
node_modules/
|
|
818
828
|
|
|
819
829
|
# Generated projects
|
|
@@ -829,14 +839,14 @@ __pycache__/
|
|
|
829
839
|
`,"utf-8"),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:e}),r.succeed("Git repository initialized");}catch{r.warn("Could not initialize git repository");}}console.log(t.green(`
|
|
830
840
|
\u2728 Demo workspace created successfully!
|
|
831
841
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(e)),console.log(t.cyan(`\u{1F680} Get started:
|
|
832
|
-
`)),console.log(t.white(` cd ${
|
|
842
|
+
`)),console.log(t.white(` cd ${o}`)),console.log(t.white(" node generate-demo.js my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(),console.log(t.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(t.cyan(" pipx install rapidkit")),console.log();}catch(l){throw r.fail("Failed to create demo workspace"),l}}async function Lt(e,o,n,r,l,p,c){if(console.log(t.cyan(`
|
|
833
843
|
\u{1F50D} Dry-run mode - what would be created:
|
|
834
|
-
`)),console.log(t.white("\u{1F4C2} Workspace path:"),e),console.log(t.white("\u{1F4DB} Name:"),t.cyan(
|
|
844
|
+
`)),console.log(t.white("\u{1F4C2} Workspace path:"),e),console.log(t.white("\u{1F4DB} Name:"),t.cyan(o)),n)console.log(t.white("\u{1F4E6} Type:"),"Demo environment"),console.log(t.white(`
|
|
835
845
|
\u{1F4DD} Files to create:`)),console.log(t.gray(" - package.json")),console.log(t.gray(" - generate-demo.js (project generator)")),console.log(t.gray(" - README.md")),console.log(t.gray(" - .gitignore")),console.log(t.white(`
|
|
836
|
-
\u{1F3AF} Capabilities:`)),console.log(t.gray(" - Generate FastAPI/NestJS demo projects")),console.log(t.gray(" - No Python RapidKit installation required")),console.log(t.gray(" - Bundled templates"));else {let
|
|
846
|
+
\u{1F3AF} Capabilities:`)),console.log(t.gray(" - Generate FastAPI/NestJS demo projects")),console.log(t.gray(" - No Python RapidKit installation required")),console.log(t.gray(" - Bundled templates"));else {let u=l||"minimal",g=p,h=c,i=new Set(["python-only","polyglot","enterprise"]).has(u);console.log(t.white("\u{1F4E6} Profile:"),t.cyan(u)),console.log(t.white("\u{1F4DD} Configuration:")),i?(console.log(t.gray(` - Python version: ${h}`)),console.log(t.gray(` - Install method: ${g}`)),console.log(t.gray(` - Git init: ${r.skipGit?"No":"Yes"}`))):(console.log(t.gray(" - Python-free profile (no Python needed)")),console.log(t.gray(` - Git init: ${r.skipGit?"No":"Yes"}`))),console.log(t.white(`
|
|
837
847
|
\u{1F4CB} Files to create:`)),console.log(t.gray(" - .rapidkit-workspace (workspace marker)")),console.log(t.gray(" - .rapidkit/ (workspace config directory)")),console.log(t.gray(" - README.md")),console.log(t.gray(" - .gitignore")),i&&console.log(t.gray(` - ${g==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(t.white(`
|
|
838
848
|
\u2699\uFE0F Environment setup:`)),i&&console.log(g==="poetry"?t.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):g==="venv"?t.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):t.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(t.white(`
|
|
839
|
-
\u{1F680} Next steps:`)),console.log(t.gray(" 1. cd "+
|
|
840
|
-
\u{1F4A1} Learn more:`)),console.log(t.gray(" \u2022 Change profile later: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|polyglot|enterprise")),console.log(t.gray(" \u2022 Help: npx rapidkit --help"));}console.log(t.white(`
|
|
849
|
+
\u{1F680} Next steps:`)),console.log(t.gray(" 1. cd "+o)),console.log(t.gray(" 2. npx rapidkit create project")),console.log(t.gray(" 3. npx rapidkit init")),console.log(t.gray(" 4. npx rapidkit dev")),console.log(t.white(`
|
|
850
|
+
\u{1F4A1} Learn more:`)),console.log(t.gray(" \u2022 Change profile later: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(t.gray(" \u2022 Help: npx rapidkit --help"));}console.log(t.white(`
|
|
841
851
|
\u2728 To proceed: remove --dry-run flag
|
|
842
|
-
`));}export{
|
|
852
|
+
`));}export{le as createProject,ce as registerWorkspaceAtPath,se as syncWorkspaceFoundationFiles,It as writeWorkspaceLauncher};
|