rapidkit 0.34.0 → 0.36.0
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 +137 -706
- package/contracts/backend-import-stack-parity.snapshot.json +36 -36
- package/contracts/infra-stack.v1.json +190 -47
- package/contracts/module-layout.v1.json +12 -3
- package/contracts/module-support.v1.json +20 -0
- package/contracts/runtime-command-surface.v1.json +139 -22
- package/contracts/workspace-intelligence/workspace-context.v1.json +59 -0
- package/contracts/workspace-intelligence/workspace-impact.v1.json +84 -0
- package/contracts/workspace-intelligence/workspace-model-diff.v1.json +105 -0
- package/contracts/workspace-intelligence/workspace-model-snapshot.v1.json +36 -0
- package/contracts/workspace-intelligence/workspace-model.v1.json +50 -0
- package/contracts/workspace-intelligence/workspace-verify.v1.json +111 -0
- package/dist/analyze-HXO6R656.js +1 -0
- package/dist/autopilot-release-FMQ5KND5.js +1 -0
- package/dist/chunk-45KNNNAB.js +2 -0
- package/dist/chunk-7ZSURMR2.js +4 -0
- package/dist/chunk-A5FBGRJA.js +1 -0
- package/dist/{chunk-3TBSWOTY.js → chunk-DC44JPI3.js} +13 -13
- package/dist/chunk-HHJAANUC.js +1 -0
- package/dist/{chunk-2PGMJSO5.js → chunk-HUQ5WRUF.js} +86 -86
- package/dist/chunk-KIB4KHBF.js +3 -0
- package/dist/chunk-KMUWWZRT.js +1 -0
- package/dist/chunk-MCLLP6MW.js +2 -0
- package/dist/chunk-OCGZNSOE.js +1 -0
- package/dist/chunk-TC2PSHT6.js +50 -0
- package/dist/chunk-UY4LZEXK.js +7 -0
- package/dist/chunk-UZW5QFRW.js +5 -0
- package/dist/chunk-VPNHGQIV.js +1 -0
- package/dist/chunk-Y2ZPG7KN.js +9 -0
- package/dist/chunk-YBS2HGO3.js +2 -0
- package/dist/chunk-YJ24EV3P.js +1 -0
- package/dist/create-7R4CGABE.js +1 -0
- package/dist/{doctor-3SBEO7XU.js → doctor-DG3TBPZN.js} +1 -1
- package/dist/imported-projects-registry-ZOCHFWMK.js +1 -0
- package/dist/index.d.ts +29 -2
- package/dist/index.js +135 -129
- package/dist/module-layout-NZ43RSC5.js +1 -0
- package/dist/pipeline-23AEXNF2.js +5 -0
- package/dist/{workspace-AG2MQFTY.js → workspace-ZDL5IQU4.js} +1 -1
- package/dist/workspace-context-YFQQROOZ.js +2 -0
- package/dist/{workspace-contract-Z5VYUF3T.js → workspace-contract-A6QP7FPA.js} +1 -1
- package/dist/workspace-foundation-QVWALXMP.js +1 -0
- package/dist/workspace-intelligence-VLA2RILM.js +1 -0
- package/dist/workspace-model-OO4WOBJS.js +1 -0
- package/dist/workspace-run-NIKH2IKF.js +1 -0
- package/dist/workspace-verify-XEXRCET7.js +1 -0
- package/package.json +14 -4
- package/dist/analyze-SVYRQNLO.js +0 -1
- package/dist/autopilot-release-LBKCP73F.js +0 -1
- package/dist/chunk-4E6ZGX6V.js +0 -1
- package/dist/chunk-ILY6QARY.js +0 -9
- package/dist/chunk-JIECGCLV.js +0 -4
- package/dist/chunk-KXTXQODI.js +0 -5
- package/dist/chunk-QCZGNOTH.js +0 -2
- package/dist/chunk-QUNCXYYK.js +0 -1
- package/dist/chunk-RGXFDBYB.js +0 -7
- package/dist/chunk-SAIWD6VM.js +0 -3
- package/dist/chunk-Y3UKTEZO.js +0 -2
- package/dist/chunk-YV7IQDBM.js +0 -50
- package/dist/create-BO2I3ESU.js +0 -1
- package/dist/module-layout-J56LHEGH.js +0 -1
- package/dist/pipeline-VUQ6AXKF.js +0 -5
- package/dist/workspace-foundation-G74V6K4U.js +0 -1
- package/dist/workspace-run-EDM3SUPA.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {i,d as d$2,l,k as
|
|
1
|
+
import {i,d as d$2,l,k,f as f$1,g as g$1,h}from'./chunk-IATULVMR.js';import {a,d,b as b$2}from'./chunk-RV6HBTFC.js';import {b as b$1}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {a as a$2,e,d as d$1,f,c,k as k$1}from'./chunk-Z5LKRG57.js';import {promises}from'fs';import*as b from'fs-extra';import g from'path';import q from'inquirer';import t from'chalk';import F from'ora';import {execa}from'execa';function A(){return c()}async function H(e,o,n,a){let s=d(o,b$1(),n);a&&(s.metadata||(s.metadata={}),s.metadata.python={version:a}),await b$2(e,s);}async function L(e){await b.outputFile(g.join(e,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
5
|
.rapidkit-workspace/
|
|
6
6
|
|
|
7
|
-
`,"utf-8");}async function
|
|
7
|
+
`,"utf-8");}async function U(e,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await b.outputFile(g.join(e,"poetry.toml"),`[virtualenvs]
|
|
8
8
|
in-project = true
|
|
9
|
-
`,"utf-8"),await
|
|
9
|
+
`,"utf-8"),await b.outputFile(g.join(e,"pyproject.toml"),`[tool.poetry]
|
|
10
10
|
name = "${n}"
|
|
11
11
|
version = "0.1.0"
|
|
12
12
|
description = "RapidKit workspace"
|
|
@@ -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,o,n,
|
|
23
|
+
`,"utf-8");}function ht(e,o,n,a,s){return JSON.stringify({schema_version:"1.0",workspace_name:e,rapidkit_version:b$1(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:a||"minimal",...s?.profileRequested?{profile_requested:s.profileRequested}:{},...s?.bootstrapNote?{bootstrap_note:s.bootstrapNote}:{},engine:{install_method:o,python_version:n||null}},null,2)}function ft(e,o,n,a,s){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:a||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:s||null,sdk:s||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 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
|
|
39
|
-
`,"utf-8"),a$1.debug(`Created .python-version with ${o}`);}catch(n){a$1.warn(`Failed to create .python-version: ${n}`);}}function
|
|
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 z(e,o,n,a,s,d){let[c,p]=await Promise.all([kt(),Pt()]);await b.outputFile(g.join(e,".rapidkit","workspace.json"),ht(o,n,a,s,d),"utf-8"),await b.outputFile(g.join(e,".rapidkit","toolchain.lock"),ft(n,a,process.version,c,p),"utf-8"),await b.outputFile(g.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await b.outputFile(g.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function de(e,o){let{workspaceName:n=g.basename(e),installMethod:a$1="venv",pythonVersion:s,profile:d$1,writeMarker:c=true,writeGitignore:p=true,onlyIfMissing:u=true}=o||{},h=[],[m,r]=await Promise.all([kt(),Pt()]),i=[{relPath:g.join(".rapidkit","workspace.json"),content:ht(n,a$1,s,d$1)},{relPath:g.join(".rapidkit","toolchain.lock"),content:ft(a$1,s,process.version,m,r)},{relPath:g.join(".rapidkit","policies.yml"),content:wt()},{relPath:g.join(".rapidkit","cache-config.yml"),content:vt()}];for(let f of i){let y=g.join(e,f.relPath);u&&await b.pathExists(y)||(await b.outputFile(y,f.content,"utf-8"),h.push(f.relPath));}if(c&&(!!!await a(e)||!u)){let y=d(n,b$1(),a$1);s&&(y.metadata||(y.metadata={}),y.metadata.python={version:s}),await b$2(e,y),h.push(".rapidkit-workspace");}if(p){let f=g.join(e,".gitignore");(!u||!await b.pathExists(f))&&(await L(e),h.push(".gitignore"));}return h}var bt=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),Tt={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function Kt(e){let o=e,n=new Set;for(;!bt.has(o);){if(n.has(o))return "minimal";n.add(o);let a=Tt[o];if(!a)return "minimal";o=a;}return o}var T="3.10",xt=["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 Nt(e,o){try{await promises.writeFile(g.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 N(){let n=[...(process.env.PATH||"").split(g.delimiter).filter(Boolean)];for(let a of k$1())n.includes(a)||n.unshift(a);process.env.PATH=n.join(g.delimiter);}async function tt(e,o){N(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=A();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:a}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!a)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(s){let d=s,c=String(d?.stderr||d?.shortMessage||d?.message||"");throw new k("Install pipx with python -m pip",s instanceof Error?s:new Error(c))}e.succeed("pipx installed"),N();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(s){let d=s,c=String(d?.stderr||d?.shortMessage||d?.message||"pipx not runnable after install");throw new k("Verify pipx after install",new Error(`${c}
|
|
40
40
|
|
|
41
|
-
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function
|
|
42
|
-
${
|
|
43
|
-
${
|
|
41
|
+
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function K(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Ot(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,a]=e.split(".").map(c=>Number(c)),[s,d]=o.split(".").map(c=>Number(c));return n!==s?n-s:a-d}function V(e,o){return lt(e,o)>=0}async function Ft(e$1){let o=new Set,n=e(14,10);for(let r of n)try{let i=await execa(r.command,r.args,{timeout:2500}),f=mt(`${i.stdout||""}
|
|
42
|
+
${i.stderr||""}`);f&&V(f,T)&&o.add(f);}catch{}let a=null;try{let r=await execa(A(),["--version"],{timeout:2500}),i=mt(`${r.stdout||""}
|
|
43
|
+
${r.stderr||""}`);i&&V(i,T)&&(a=i,o.add(i));}catch{}let s=xt.filter(r=>V(r,T)),d=new Set([...s,...o]),c=Array.from(d).sort((r,i)=>lt(i,r)),p=e$1?Ot(e$1):null,u=p&&V(p,T)?p:a||c[0]||T;return d.has(u)||d.add(u),{choices:Array.from(d).sort((r,i)=>lt(i,r)).map(r=>{let i=[];return r===a&&i.push("current system"),r===T&&i.push("minimum supported"),o.has(r)&&r!==a&&i.push("detected"),{name:i.length>0?`${r} (${i.join(", ")})`:r,value:r}}),defaultValue:u}}async function Lt(){N();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 Rt(){N();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Vt(e,o){return e==="poetry"&&o.poetry?"poetry":e==="pipx"&&o.pipx?"pipx":e==="venv"?"venv":o.poetry?"poetry":"venv"}async function Gt(e,o){N(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(o)throw new g$1;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$1;let a=await tt(e,o);e.start("Installing Poetry with pipx");try{await K(a,["install","poetry"]);}catch(s){let d=s,c=String(d?.stderr||d?.shortMessage||d?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(c))try{await K(a,["upgrade","poetry"]);}catch{}else throw new k("Install Poetry with pipx",s instanceof Error?s:new Error(c))}e.succeed("Poetry installed"),N();try{await execa("poetry",["--version"]);}catch(s){let d=s,c=String(d?.stderr||d?.shortMessage||d?.message||"Poetry not found on PATH");throw new k("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 Wt(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)
|
|
@@ -74,7 +74,7 @@ echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
|
74
74
|
${o?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
|
|
75
75
|
`:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
76
76
|
exit 1
|
|
77
|
-
`}function
|
|
77
|
+
`}function Ht(e){return `@echo off
|
|
78
78
|
setlocal
|
|
79
79
|
|
|
80
80
|
set "SCRIPT_DIR=%~dp0"
|
|
@@ -111,27 +111,27 @@ echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
|
111
111
|
echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
112
112
|
echo Tip: for npm-owned workspace commands, run npx --yes --package rapidkit rapidkit %* from a shell where npm is on PATH. 1>&2
|
|
113
113
|
exit /b 1
|
|
114
|
-
`}async function It(e,o){await
|
|
115
|
-
\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(""))
|
|
114
|
+
`}async function It(e,o){await b.outputFile(g.join(e,"rapidkit"),Wt(o),{encoding:"utf-8",mode:493}),await b.outputFile(g.join(e,"rapidkit.cmd"),Ht(o),"utf-8");}async function pe(e,o){let{skipGit:n=false,testMode:a=false,demoMode:s=false,dryRun:d=false,yes:c=false,userConfig:p={},installMethod:u,profile:h,parentDirectory:m}=o,r=e||"rapidkit",i$1=m?g.resolve(m,r):g.resolve(process.cwd(),r);if(await b.pathExists(i$1))throw new i(r);if(d){let w=h||(c?"minimal":void 0),I=u||p.defaultInstallMethod||"poetry",v=p.pythonVersion||"3.10";await zt(i$1,r,s,p,w,I,v);return}if(s){await Ut(i$1,r,n);return}let f=new Set(["python-only","polyglot","enterprise"]),y=h||"";if(!c&&!h){let{selectedProfile:w}=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}]);y=w;}else y||(y="minimal");let E=!c&&f.has(y),D=typeof p.pythonVersion=="string"&&p.pythonVersion.trim().length>0?p.pythonVersion.trim():void 0,C=u||p.defaultInstallMethod||"poetry",O=E?await Lt():{poetry:true,pipx:true},Y=E?await Ft(D):{choices:xt.map(w=>({name:w,value:w})),defaultValue:T},$t=Vt(C,O),At=[{name:O.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:O.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=E?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:Y.choices,default:Y.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:At,default:$t}]):await(async()=>{let w=u||p.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:p.pythonVersion||"3.10",installMethod:w}})();E&&(console.log(t.gray(`
|
|
115
|
+
\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(""));let et=bt;if(et.has(y)){let w=F("Creating workspace").start();try{await b.ensureDir(i$1),w.succeed("Directory created"),await H(i$1,r,"venv",void 0),await z(i$1,r,"venv",void 0,y),await L(i$1),await U(i$1,r);let I={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await b.outputFile(g.join(i$1,"README.md"),`# ${r}
|
|
116
116
|
|
|
117
|
-
RapidKit **${
|
|
117
|
+
RapidKit **${I[y]}** workspace.
|
|
118
118
|
|
|
119
119
|
## Quick start
|
|
120
120
|
|
|
121
121
|
\`\`\`bash
|
|
122
|
-
`+(
|
|
122
|
+
`+(y==="go-only"?`npx rapidkit create project gofiber.standard my-api
|
|
123
123
|
cd my-api
|
|
124
124
|
npx rapidkit init
|
|
125
125
|
npx rapidkit dev
|
|
126
|
-
`:
|
|
126
|
+
`:y==="java-only"?`npx rapidkit create project springboot.standard my-service
|
|
127
127
|
cd my-service
|
|
128
128
|
npx rapidkit init
|
|
129
129
|
npx rapidkit dev
|
|
130
|
-
`:
|
|
130
|
+
`:y==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
|
|
131
131
|
cd my-api
|
|
132
132
|
npx rapidkit init
|
|
133
133
|
npx rapidkit dev
|
|
134
|
-
`:
|
|
134
|
+
`:y==="node-only"?`npx rapidkit create project nestjs.standard my-app
|
|
135
135
|
cd my-app
|
|
136
136
|
npx rapidkit init
|
|
137
137
|
npx rapidkit dev
|
|
@@ -139,55 +139,55 @@ npx rapidkit dev
|
|
|
139
139
|
cd <project-name>
|
|
140
140
|
npx rapidkit init
|
|
141
141
|
npx rapidkit dev
|
|
142
|
-
`)+"```\n","utf-8"),!n){
|
|
142
|
+
`)+"```\n","utf-8"),!n){w.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}),w.succeed("Git repository initialized");}catch{w.warn("Could not initialize git repository");}}try{let{registerWorkspace:v}=await import('./workspace-ZDL5IQU4.js');await v(i$1,r);}catch{}if(console.log(t.green(`
|
|
143
143
|
\u2728 Workspace created!
|
|
144
144
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
|
|
145
145
|
\u{1F680} Get started:
|
|
146
|
-
`)),console.log(t.white(` cd ${
|
|
147
|
-
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:
|
|
148
|
-
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(
|
|
149
|
-
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(
|
|
150
|
-
`)),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:
|
|
151
|
-
\u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else
|
|
146
|
+
`)),console.log(t.white(` cd ${r}`)),y==="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
|
|
147
|
+
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:v}=await execa("go",["version"],{timeout:3e3}),k=v.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=k?k[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${S} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
|
|
148
|
+
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(y==="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
|
|
149
|
+
`)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(y==="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
|
|
150
|
+
`)),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:v}=await execa("dotnet",["--version"],{timeout:3e3});console.log(t.gray(`\u2699\uFE0F .NET SDK ${v.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(t.yellow(`
|
|
151
|
+
\u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else y==="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
|
|
152
152
|
`)),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
|
|
153
153
|
`)),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(`
|
|
154
|
-
\u{1F4DA} More info:`)),console.log(t.gray(" \u2022 Change profile anytime: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 View config: cat "+
|
|
155
|
-
\u274C Error:`),
|
|
154
|
+
\u{1F4DA} More info:`)),console.log(t.gray(" \u2022 Change profile anytime: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 View config: cat "+r+"/.rapidkit-workspace")),console.log(t.gray(" \u2022 Check health: rapidkit doctor")),console.log("");}catch(I){throw w.fail("Failed to create workspace"),console.error(t.red(`
|
|
155
|
+
\u274C Error:`),I),I}return}{let w=A(),I=false;try{await execa(w,["--version"],{timeout:5e3}),I=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),I=true;}catch{I=false;}}if(!I){let v=y,k=Kt(y);if(E&&!c){console.log(t.yellow(`
|
|
156
156
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
157
157
|
`)),console.log(t.cyan(`You have 3 options:
|
|
158
|
-
`));let{pythonAction
|
|
158
|
+
`));let{pythonAction:$}=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 "${k}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if($==="cancel"&&(console.log(t.cyan(`
|
|
159
159
|
\u{1F4A1} How to install Python:
|
|
160
160
|
`)),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
|
|
161
|
-
`)),console.log(t.gray(` After installing Python, run: npx rapidkit ${
|
|
162
|
-
`)),process.exit(1))
|
|
161
|
+
`)),console.log(t.gray(` After installing Python, run: npx rapidkit ${r}
|
|
162
|
+
`)),process.exit(1)),$==="install"){console.log(t.cyan(`
|
|
163
163
|
\u{1F4A1} Install Python on your system:
|
|
164
|
-
`));let
|
|
165
|
-
`)):
|
|
166
|
-
`)):
|
|
164
|
+
`));let _=process.platform;_==="linux"?console.log(t.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
165
|
+
`)):_==="darwin"?console.log(t.white(` brew install python@3.10
|
|
166
|
+
`)):_==="win32"&&(console.log(t.white(` Download: https://python.org/downloads
|
|
167
167
|
`)),console.log(t.white(` Run the installer and check "Add Python to PATH"
|
|
168
|
-
`))),console.log(t.gray(` After installing, run: npx rapidkit ${
|
|
169
|
-
`)),process.exit(0);}if(
|
|
170
|
-
\u2705 Switching to "${
|
|
171
|
-
`)),
|
|
168
|
+
`))),console.log(t.gray(` After installing, run: npx rapidkit ${r}
|
|
169
|
+
`)),process.exit(0);}if($==="fallback"&&(console.log(t.green(`
|
|
170
|
+
\u2705 Switching to "${k}" profile (no Python required).
|
|
171
|
+
`)),y=k,et.has(k))){let _=F("Creating workspace").start();try{await b.ensureDir(i$1),_.succeed("Directory created"),await H(i$1,r,"venv",void 0),await z(i$1,r,"venv",void 0,k,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await L(i$1),await U(i$1,r);let B={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await b.outputFile(g.join(i$1,"README.md"),`# ${r}
|
|
172
172
|
|
|
173
|
-
RapidKit **${B[
|
|
173
|
+
RapidKit **${B[k]}** workspace (switched from ${v} due to missing Python).
|
|
174
174
|
|
|
175
175
|
## Quick start
|
|
176
176
|
|
|
177
177
|
\`\`\`bash
|
|
178
|
-
`+(
|
|
178
|
+
`+(k==="go-only"?`npx rapidkit create project gofiber.standard my-api
|
|
179
179
|
cd my-api
|
|
180
180
|
npx rapidkit init
|
|
181
181
|
npx rapidkit dev
|
|
182
|
-
`:
|
|
182
|
+
`:k==="java-only"?`npx rapidkit create project springboot.standard my-service
|
|
183
183
|
cd my-service
|
|
184
184
|
npx rapidkit init
|
|
185
185
|
npx rapidkit dev
|
|
186
|
-
`:
|
|
186
|
+
`:k==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
|
|
187
187
|
cd my-api
|
|
188
188
|
npx rapidkit init
|
|
189
189
|
npx rapidkit dev
|
|
190
|
-
`:
|
|
190
|
+
`:k==="node-only"?`npx rapidkit create project nestjs.standard my-app
|
|
191
191
|
cd my-app
|
|
192
192
|
npx rapidkit init
|
|
193
193
|
npx rapidkit dev
|
|
@@ -195,73 +195,73 @@ npx rapidkit dev
|
|
|
195
195
|
cd <project-name>
|
|
196
196
|
npx rapidkit init
|
|
197
197
|
npx rapidkit dev
|
|
198
|
-
`)+"```\n","utf-8"),!n){
|
|
198
|
+
`)+"```\n","utf-8"),!n){_.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 (${k} profile)`],{cwd:i$1}),_.succeed("Git repository initialized");}catch{_.warn("Could not initialize git repository");}}try{let{registerWorkspace:St}=await import('./workspace-ZDL5IQU4.js');await St(i$1,r);}catch{}console.log(t.green(`
|
|
199
199
|
\u2728 Workspace created with fallback profile!
|
|
200
200
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
|
|
201
201
|
\u{1F680} Get started:
|
|
202
|
-
`)),console.log(t.white(` cd ${
|
|
202
|
+
`)),console.log(t.white(` cd ${r}`)),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
|
|
203
203
|
`)),console.log(t.cyan(`\u{1F4A1} To use Python later:
|
|
204
|
-
`)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: rapidkit bootstrap --profile ${
|
|
205
|
-
`)),console.log("");return}catch(B){throw
|
|
204
|
+
`)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: rapidkit bootstrap --profile ${v}
|
|
205
|
+
`)),console.log("");return}catch(B){throw _.fail("Failed to create workspace"),console.error(t.red(`
|
|
206
206
|
\u274C Error:`),B),B}}}else if(console.log(t.yellow(`
|
|
207
|
-
\u26A0\uFE0F Python not detected. Auto-switching to "${
|
|
208
|
-
`)),
|
|
207
|
+
\u26A0\uFE0F Python not detected. Auto-switching to "${k}" profile (no Python required).
|
|
208
|
+
`)),y=k,et.has(k)){let $=F("Creating workspace").start();try{if(await b.ensureDir(i$1),$.succeed("Directory created"),await H(i$1,r,"venv",void 0),await z(i$1,r,"venv",void 0,k,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await L(i$1),await U(i$1,r),!n){$.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 (${k})`],{cwd:i$1}),$.succeed("Git repository initialized");}catch{$.warn("Could not initialize git repository");}}try{let{registerWorkspace:_}=await import('./workspace-ZDL5IQU4.js');await _(i$1,r);}catch{}console.log(t.green(`
|
|
209
209
|
\u2728 Workspace created (auto-fallback profile)!
|
|
210
|
-
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(
|
|
210
|
+
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(k)),console.log(t.cyan("\u{1F4A1} Reason:"),t.gray(`Python not detected; switched from ${v}`)),console.log(t.cyan(`
|
|
211
211
|
\u{1F680} Get started:
|
|
212
|
-
`)),console.log(t.white(` cd ${
|
|
212
|
+
`)),console.log(t.white(` cd ${r}`)),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
|
|
213
213
|
`)),console.log(t.cyan(`\u{1F4A1} Add Python later:
|
|
214
|
-
`)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: cd ${
|
|
215
|
-
`)),console.log("");return}catch(
|
|
216
|
-
\u274C Error:`),
|
|
214
|
+
`)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: cd ${r} && rapidkit bootstrap --profile ${v}
|
|
215
|
+
`)),console.log("");return}catch(_){throw $.fail("Failed to create workspace"),console.error(t.red(`
|
|
216
|
+
\u274C Error:`),_),_}}}}a$1.step(1,3,"Setting up RapidKit environment");let R=F("Creating directory").start();try{await b.ensureDir(i$1),R.succeed("Directory created"),R.start("Detecting Python version");let w=null,I=await _t(x.pythonVersion);if(I)w=await gt(I),w?(a$1.info(` Detected Python ${w}`),R.succeed(`Python ${w} detected`)):R.warn("Could not detect exact Python version");else {let v=A();w=await gt(v),w?R.succeed(`Python ${w} detected`):R.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await Rt()&&(R.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await H(i$1,r,x.installMethod,w||void 0),w&&await Nt(i$1,w),await z(i$1,r,x.installMethod,w||x.pythonVersion,y||h),await L(i$1),await U(i$1,r),x.installMethod==="poetry")try{await Et(i$1,x.pythonVersion,R,a,p,c);}catch(v){let k=v?.details||v?.message||String(v);if(k.includes("pyenv")||k.includes("exit status 127")||k.includes("returned non-zero exit status 127")){R.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${k}`);try{await ct(i$1,x.pythonVersion,R,a,p),x.installMethod="venv";}catch($){throw $}}else throw v}else x.installMethod==="venv"?await ct(i$1,x.pythonVersion,R,a,p):await jt(i$1,R,a,p,c);if(await It(i$1,x.installMethod),await Ct(i$1,x.installMethod),R.succeed("RapidKit environment ready!"),!o.skipGit){R.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}),R.succeed("Git repository initialized");}catch{R.warn("Could not initialize git repository");}}try{let{registerWorkspace:v}=await import('./workspace-ZDL5IQU4.js');await v(i$1,r);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
|
|
217
217
|
\u2728 RapidKit environment created successfully!
|
|
218
|
-
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${
|
|
218
|
+
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${y}`)),console.log(t.gray(` \u2022 Python: ${x.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${x.installMethod}`)),console.log(t.cyan(`
|
|
219
219
|
\u{1F680} Get started:
|
|
220
|
-
`)),console.log(t.white(` cd ${
|
|
220
|
+
`)),console.log(t.white(` cd ${r}`)),x.installMethod==="poetry"){let v="source $(poetry env info --path)/bin/activate";try{N();let{stdout:k}=await execa("poetry",["--version"]),S=k.match(/Poetry.*?(\d+)\.(\d+)/);S&&(parseInt(S[1])>=2?v="source $(poetry env info --path)/bin/activate":v="poetry shell");}catch{}console.log(t.white(` ${v} # 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(`
|
|
221
221
|
\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(`
|
|
222
222
|
\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(`
|
|
223
223
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(t.cyan(`
|
|
224
224
|
\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(`
|
|
225
225
|
\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(`
|
|
226
226
|
\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
|
|
227
|
-
`));try{let{stdout:
|
|
228
|
-
\u274C Error:`),
|
|
229
|
-
package-mode = false`):
|
|
227
|
+
`));try{let{stdout:v}=await execa("go",["version"],{timeout:3e3}),k=v.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=k?k[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${S} 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(w){R.fail("Failed to create RapidKit environment"),console.error(t.red(`
|
|
228
|
+
\u274C Error:`),w);try{await b.remove(i$1);}catch{}throw w}}async function _t(e$1){let o=[];if(!a$2())try{let{stdout:d}=await execa("pyenv",["which","python"]),c=d.trim();c&&o.push(c);}catch{}let n=Number(e$1.split(".")[1]),a=e(n,10).map(d=>d.command).filter(Boolean);o.push(`python${e$1}`,...a,...d$1());let s=[...new Set(o)];for(let d of s)try{let c=d==="py"?["-3","--version"]:["--version"],p=d==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:u}=await execa(d,c,{timeout:2e3}),h=u.match(/Python (\d+\.\d+)/)?.[1];if(h&&V(h,e$1))return await execa(d,p,{timeout:2e3}),d}catch{continue}return null}async function Et(e,o,n,a,s,d=false){await Gt(n,d),n.start("Finding Python interpreter");let c=await _t(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 p=g.join(e,"pyproject.toml"),h=(await b.pathExists(p)?await promises.readFile(p,"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 f=await promises.readFile(p,"utf-8");f.includes("[tool.poetry]")?f=f.replace("[tool.poetry]",`[tool.poetry]
|
|
229
|
+
package-mode = false`):f.includes("[project]")&&(f.includes("[build-system]")?f=f.replace("[build-system]",`
|
|
230
230
|
[tool.poetry]
|
|
231
231
|
package-mode = false
|
|
232
232
|
|
|
233
|
-
[build-system]`):
|
|
233
|
+
[build-system]`):f+=`
|
|
234
234
|
|
|
235
235
|
[tool.poetry]
|
|
236
236
|
package-mode = false
|
|
237
|
-
`),await promises.writeFile(
|
|
238
|
-
Error: ${
|
|
237
|
+
`),await promises.writeFile(p,f,"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 m=c||A(),r=f(g.join(e,".venv"));try{await execa(m,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(i){a$1.debug(`python -m venv failed: ${i}`),n.warn("Could not pre-create virtualenv, Poetry will try"),r=c||A();}try{await execa("poetry",["env","use",r||A()],{cwd:e}),a$1.debug(`Poetry env set to: ${r}`);}catch(i){a$1.debug(`Could not set Poetry env: ${i}`);}if(n.start("Installing RapidKit"),h&&!a){let i=d$2(s||{}),f=i?await b.pathExists(i):false,y=f&&i?i:"rapidkit-core";i&&!f&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${i}. Falling back to PyPI.`),n.text=f?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,D=null;for(let C=1;C<=3;C++)try{await execa(r,["-m","pip","install",y,"--quiet"],{cwd:e,timeout:18e4}),E=true;break}catch(O){D=O,a$1.debug(`pip install rapidkit-core attempt ${C} failed: ${O}`),C<3&&(n.text=`Retrying installation (attempt ${C+1}/3)`,await new Promise(Y=>setTimeout(Y,2e3)));}if(!E){let C=D?.stderr||D?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${C}`),C.includes("Could not find")||C.includes("No matching distribution")?new l:new k("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
238
|
+
Error: ${C}
|
|
239
239
|
|
|
240
240
|
Possible solutions:
|
|
241
241
|
1. Check your internet connection
|
|
242
|
-
2. Try installing manually: cd ${
|
|
243
|
-
3. Use venv method instead: npx rapidkit ${
|
|
244
|
-
Error: ${
|
|
242
|
+
2. Try installing manually: cd ${g.basename(e)} && poetry add rapidkit-core
|
|
243
|
+
3. Use venv method instead: npx rapidkit ${g.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(i){a$1.debug(`poetry install --no-root failed: ${i}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),a){let i=d$2(s||{});if(!i)throw new k("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${i}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",i],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let i=false,f=null;for(let y=1;y<=3;y++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*y}),i=true;break}catch(E){f=E,a$1.debug(`Poetry add attempt ${y} failed: ${E}`),y<3&&(n.text=`Retrying installation (attempt ${y+1}/3)`,await new Promise(D=>setTimeout(D,2e3)));}if(!i){let y=f?.stderr||f?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${y}`),y.includes("Could not find")||y.includes("No matching distribution")?new l:new k("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
244
|
+
Error: ${y}
|
|
245
245
|
|
|
246
246
|
Possible solutions:
|
|
247
247
|
1. Check your internet connection
|
|
248
|
-
2. Try installing manually: cd ${
|
|
249
|
-
3. Use venv method instead: npx rapidkit ${
|
|
248
|
+
2. Try installing manually: cd ${g.basename(e)} && poetry add rapidkit-core
|
|
249
|
+
3. Use venv method instead: npx rapidkit ${g.basename(e)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:i}=await import('./pythonRapidkitExec-MNWRC4F2.js');if(!await i()&&!a){n.start("Checking optional global pipx installation");let y=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await K(y,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(E){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${E}`);}}}catch(i){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${i}`);}}async function ct(e,o,n,a,s,d=false){n.start(`Checking Python ${o}`);let c=A();try{let{stdout:u}=await execa(c,["--version"]),h=u.match(/Python (\d+\.\d+)/)?.[1];if(h&&!V(h,o))throw new f$1(o,h);n.succeed(`Python ${h} found`);}catch(u){throw u instanceof f$1?u:new f$1(o)}n.start("Creating virtual environment");try{await execa(c,["-m","venv",".venv"],{cwd:e}),n.succeed("Virtual environment created");}catch(u){if(n.fail("Failed to create virtual environment"),(m=>typeof m=="object"&&m!==null&&"stdout"in m&&typeof m.stdout=="string")(u)&&u.stdout.includes("ensurepip is not")){let m=u.stdout.match(/apt install (python[\d.]+-venv)/),r=m?m[1]:"python3-venv";throw new k("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
250
250
|
|
|
251
251
|
On Debian/Ubuntu systems, install the venv package:
|
|
252
|
-
sudo apt install ${
|
|
252
|
+
sudo apt install ${r}
|
|
253
253
|
|
|
254
254
|
Or use Poetry instead (recommended):
|
|
255
|
-
npx rapidkit ${
|
|
256
|
-
Error: ${
|
|
255
|
+
npx rapidkit ${g.basename(e)} --yes`))}throw new k("Virtual environment creation",u instanceof Error?u:new Error(String(u)))}n.start("Installing RapidKit");let p=f(g.join(e,".venv"));if(await execa(p,["-m","pip","install","--upgrade","pip"],{cwd:e}),a){let u=d$2(s||{});if(!u)throw new k("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${u}`),n.text="Installing RapidKit from local path (test mode)",await execa(p,["-m","pip","install","-e",u],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let u=false,h=null;for(let m=1;m<=3;m++)try{await execa(p,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*m}),u=true;break}catch(r){h=r,a$1.debug(`pip install attempt ${m} failed: ${r}`),m<3&&(n.text=`Retrying installation (attempt ${m+1}/3)`,await new Promise(i=>setTimeout(i,2e3)));}if(!u){let m=h?.stderr||h?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${m}`),m.includes("Could not find")||m.includes("No matching distribution")?new l:new k("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
256
|
+
Error: ${m}
|
|
257
257
|
|
|
258
258
|
Possible solutions:
|
|
259
259
|
1. Check your internet connection
|
|
260
|
-
2. Try installing manually: cd ${
|
|
261
|
-
3. Use Poetry instead: npx rapidkit ${
|
|
262
|
-
`,"utf-8");return}
|
|
263
|
-
`,"utf-8");}async function
|
|
264
|
-
# Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",
|
|
260
|
+
2. Try installing manually: cd ${g.basename(e)} && ${f(".venv")} -m pip install rapidkit-core
|
|
261
|
+
3. Use Poetry instead: npx rapidkit ${g.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:u}=await import('./pythonRapidkitExec-MNWRC4F2.js');if(!await u()&&!a){n.start("Checking optional global pipx installation");let m=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await K(m,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(r){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${r}`);}}}catch(u){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${u}`);}}async function jt(e,o,n,a,s=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:c}=await import('./pythonRapidkitExec-MNWRC4F2.js'),p=await c();if(p.isCompatible){o.succeed(`RapidKit ${p.installedVersion??""} already compatible globally; skipping pipx installation`),await b.outputFile(g.join(e,".rapidkit-global"),`RapidKit already available globally (version ${p.installedVersion??"unknown"}) and satisfies expected constraint ${p.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
262
|
+
`,"utf-8");return}p.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.'):p.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=${p.reason}, installed=${p.installedVersion??"unknown"}, expected=${p.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(c){a$1.debug(`Global RapidKit version-aware check failed before pipx install: ${c}`);}let d=await tt(o,s);if(o.start("Installing RapidKit globally with pipx"),n){let c=d$2(a||{});if(!c)throw new k("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 K(d,["install","-e",c]);}else {o.text="Installing RapidKit from PyPI";try{await K(d,["install","rapidkit-core"]);}catch(c){try{o.text="RapidKit already installed globally, upgrading to match expected version",await K(d,["upgrade","rapidkit-core"]);}catch(p){throw a$1.debug(`pipx install/upgrade failed: install=${c}, upgrade=${p}`),new l}}}o.succeed("RapidKit installed globally"),await b.outputFile(g.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
263
|
+
`,"utf-8");}async function ue(e,o){let{skipGit:n=false,testMode:a=false,userConfig:s={},yes:d=false,installMethod:c,pythonVersion:p="3.10"}=o||{},u=c||s.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=u==="poetry"&&!await Rt()?"venv":u;await H(e,g.basename(e),h),await L(e),await z(e,g.basename(e),h,p,o?.profile);let m=F("Registering workspace").start();try{h==="poetry"?(await U(e,g.basename(e)),await Et(e,p,m,a,s,d)):h==="venv"?await ct(e,p,m,a,s):await jt(e,m,a,s,d),await It(e,h),await Ct(e,h),m.succeed("Workspace registered");try{let{registerWorkspace:r}=await import('./workspace-ZDL5IQU4.js');await r(e,g.basename(e));}catch{}if(!n){m.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}),m.succeed("Git repository initialized");}catch{m.warn("Could not initialize git repository");}}}catch(r){throw m.fail("Failed to register workspace"),r}}async function Ct(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
264
|
+
# Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",a=o==="poetry"?`# No activation needed (recommended):
|
|
265
265
|
./rapidkit --help
|
|
266
266
|
# or:
|
|
267
267
|
poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
|
|
@@ -269,7 +269,7 @@ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
|
|
|
269
269
|
# or direct:
|
|
270
270
|
./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
|
|
271
271
|
./rapidkit --help
|
|
272
|
-
# (pipx installs may require Poetry/venv to be present in this folder)`,
|
|
272
|
+
# (pipx installs may require Poetry/venv to be present in this folder)`,s=a$2()?"python --version (or: py -3 --version)":"python3 --version (or: python --version)",d=`# RapidKit Workspace
|
|
273
273
|
|
|
274
274
|
This directory contains a RapidKit development environment.
|
|
275
275
|
|
|
@@ -284,7 +284,7 @@ This directory contains a RapidKit development environment.
|
|
|
284
284
|
This workspace includes a local launcher script so you can run the Python Core CLI without activating the environment:
|
|
285
285
|
|
|
286
286
|
\`\`\`bash
|
|
287
|
-
${
|
|
287
|
+
${a}
|
|
288
288
|
\`\`\`
|
|
289
289
|
|
|
290
290
|
### 1. Activate Environment
|
|
@@ -367,11 +367,11 @@ README.md # This file
|
|
|
367
367
|
|
|
368
368
|
If you encounter issues:
|
|
369
369
|
|
|
370
|
-
1. Ensure Python 3.10+ is installed: \`${
|
|
370
|
+
1. Ensure Python 3.10+ is installed: \`${s}\`
|
|
371
371
|
2. Check RapidKit installation: \`rapidkit --version\`
|
|
372
372
|
3. Run diagnostics: \`rapidkit doctor\`
|
|
373
373
|
4. Visit RapidKit documentation or GitHub issues
|
|
374
|
-
`;await promises.writeFile(
|
|
374
|
+
`;await promises.writeFile(g.join(e,"README.md"),d,"utf-8");}async function Ut(e,o,n){let a=F("Creating demo workspace").start();try{await b.ensureDir(e),a.succeed("Directory created"),a.start("Setting up demo kit generator");let s=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(g.join(e,"package.json"),s,"utf-8"),await promises.writeFile(g.join(e,"generate-demo.js"),`#!/usr/bin/env node
|
|
375
375
|
/**
|
|
376
376
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
377
377
|
*
|
|
@@ -767,7 +767,7 @@ venv/
|
|
|
767
767
|
}
|
|
768
768
|
|
|
769
769
|
main().catch(console.error);
|
|
770
|
-
`,"utf-8");try{await execa("chmod",["+x",
|
|
770
|
+
`,"utf-8");try{await execa("chmod",["+x",g.join(e,"generate-demo.js")]);}catch{}let c=`# RapidKit Demo Workspace
|
|
771
771
|
|
|
772
772
|
Welcome to your RapidKit demo workspace! This environment lets you generate FastAPI demo projects using bundled RapidKit templates, without needing to install Python RapidKit.
|
|
773
773
|
|
|
@@ -854,7 +854,7 @@ ${o}/
|
|
|
854
854
|
---
|
|
855
855
|
|
|
856
856
|
**Generated with RapidKit** | [GitHub](https://github.com/rapidkitlabs/rapidkit-npm)
|
|
857
|
-
`;if(await promises.writeFile(
|
|
857
|
+
`;if(await promises.writeFile(g.join(e,"README.md"),c,"utf-8"),a.succeed("Demo workspace setup complete"),!n){a.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await b.outputFile(g.join(e,".gitignore"),`# Dependencies
|
|
858
858
|
node_modules/
|
|
859
859
|
|
|
860
860
|
# Generated projects
|
|
@@ -867,17 +867,17 @@ __pycache__/
|
|
|
867
867
|
*.pyc
|
|
868
868
|
.venv/
|
|
869
869
|
.env
|
|
870
|
-
`,"utf-8"),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:e}),
|
|
870
|
+
`,"utf-8"),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:e}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}console.log(t.green(`
|
|
871
871
|
\u2728 Demo workspace created successfully!
|
|
872
872
|
`)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(e)),console.log(t.cyan(`\u{1F680} Get started:
|
|
873
|
-
`)),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(
|
|
873
|
+
`)),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(s){throw a.fail("Failed to create demo workspace"),s}}async function zt(e,o,n,a,s,d,c){if(console.log(t.cyan(`
|
|
874
874
|
\u{1F50D} Dry-run mode - what would be created:
|
|
875
875
|
`)),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(`
|
|
876
876
|
\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(`
|
|
877
|
-
\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
|
|
878
|
-
\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")),
|
|
879
|
-
\u2699\uFE0F Environment setup:`)),
|
|
877
|
+
\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 p=s||"minimal",u=d,h=c,r=new Set(["python-only","polyglot","enterprise"]).has(p);console.log(t.white("\u{1F4E6} Profile:"),t.cyan(p)),console.log(t.white("\u{1F4DD} Configuration:")),r?(console.log(t.gray(` - Python version: ${h}`)),console.log(t.gray(` - Install method: ${u}`)),console.log(t.gray(` - Git init: ${a.skipGit?"No":"Yes"}`))):(console.log(t.gray(" - Python-free profile (no Python needed)")),console.log(t.gray(` - Git init: ${a.skipGit?"No":"Yes"}`))),console.log(t.white(`
|
|
878
|
+
\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")),r&&console.log(t.gray(` - ${u==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(t.white(`
|
|
879
|
+
\u2699\uFE0F Environment setup:`)),r&&console.log(u==="poetry"?t.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):u==="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(`
|
|
880
880
|
\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(`
|
|
881
881
|
\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(`
|
|
882
882
|
\u2728 To proceed: remove --dry-run flag
|
|
883
|
-
`));}export{
|
|
883
|
+
`));}export{ht as a,de as b,bt as c,Kt as d,It as e,pe as f,ue as g};
|