rapidkit 0.16.0 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +197 -162
- package/dist/package.json +2 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
[${
|
|
4
|
-
\u26A0\uFE0F Update available: ${
|
|
5
|
-
`))):
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import v from'path';import {fileURLToPath}from'url';import m from'chalk';import {execa}from'execa';import {createRequire}from'module';import*as B from'os';import B__default from'os';import*as E from'fs-extra';import N,{promises}from'fs';import mt from'ora';import {Command,Option}from'commander';import Wt from'inquirer';import {spawn}from'child_process';import Te from'validate-npm-package-name';import li from'nunjucks';import mi from'crypto';var Re=Object.defineProperty;var et=(t,e)=>()=>(t&&(e=t(t=0)),e);var _t=(t,e)=>{for(var i in e)Re(t,i,{get:e[i],enumerable:true});};var $=et(()=>{});var Ct,g,ct=et(()=>{$();Ct=class{debugEnabled=false;setDebug(e){this.debugEnabled=e;}debug(e,...i){this.debugEnabled&&console.log(m.gray(`[DEBUG] ${e}`),...i);}info(e,...i){console.log(m.blue(e),...i);}success(e,...i){console.log(m.green(e),...i);}warn(e,...i){console.log(m.yellow(e),...i);}error(e,...i){console.error(m.red(e),...i);}step(e,i,r){console.log(m.cyan(`
|
|
3
|
+
[${e}/${i}]`),m.white(r));}},g=new Ct;});async function Yt(){try{g.debug("Checking for updates...");let{stdout:t}=await execa("npm",["view",Ce,"version"],{timeout:3e3}),e=t.trim();e&&e!==Et?(console.log(m.yellow(`
|
|
4
|
+
\u26A0\uFE0F Update available: ${Et} \u2192 ${e}`)),console.log(m.cyan(`Run: npm install -g rapidkit@latest
|
|
5
|
+
`))):g.debug("You are using the latest version");}catch{g.debug("Could not check for updates");}}function M(){return Et}var Ce,Ee,Ie,Et,pt=et(()=>{$();ct();Ce="rapidkit",Ee=createRequire(import.meta.url),Ie=Ee("../package.json"),Et=Ie?.version??"0.0.0";});var Ot={};_t(Ot,{__test__:()=>He,checkRapidkitCoreAvailable:()=>oe,getCachedCoreTopLevelCommands:()=>Tt,getCoreTopLevelCommands:()=>Be,resolveRapidkitPython:()=>nt,runCoreRapidkit:()=>V,runCoreRapidkitCapture:()=>Dt});function Nt(t){return t instanceof ot?t.code==="PYTHON_NOT_FOUND"?"RapidKit (npm) could not find Python (python3/python) on your PATH.\nInstall Python 3.10+ and ensure `python3` is available, then retry.\nTip: if you are inside a RapidKit project, use the local ./rapidkit launcher.":`RapidKit (npm) bridge error: ${t.message}`:`RapidKit (npm) failed to run the Python core engine: ${t instanceof Error?t.message:String(t)}`}function Ve(){let t=process.env.RAPIDKIT_CORE_PYTHON_PACKAGE;return t&&t.trim()?t.trim():"rapidkit-core"}function te(){let t=process.env.XDG_CACHE_HOME;return t&&t.trim()?t:v.join(B__default.homedir(),".cache")}function It(){return v.join(te(),"rapidkit","npm-bridge","venv")}function Xt(t){return process.platform==="win32"?v.join(t,"Scripts","python.exe"):v.join(t,"bin","python")}function Qt(t){return process.platform==="win32"?v.join(t,"Scripts","rapidkit.exe"):v.join(t,"bin","rapidkit")}function ee(){return v.join(te(),"rapidkit","npm-bridge","core-commands.json")}async function ie(t){let e=!!process.env.RAPIDKIT_DEBUG,i=r=>{e&&process.stderr.write(`[DEBUG] tryRapidkit(${t}): ${r}
|
|
6
|
+
`);};try{i("probing interpreter-specific rapidkit script");let n=((await execa(t,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"],{reject:!1,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(i(`script path: ${n}`),n)try{if(await E.pathExists(n)){i(`found script at ${n}; invoking --version --json`);let o=await execa(n,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(i(`script exitCode=${o.exitCode}`),o.exitCode===0){let a=(o.stdout??"").toString().trim();try{let s=JSON.parse(a),c=!!s&&typeof s=="object"&&s!==null&&"version"in s;if(i(`script JSON parse ok=${c}`),c)return !0}catch{i("script output not valid JSON");}}}}catch(o){i(`interpreter-specific script probe failed: ${String(o)}`);}}catch(r){i(`interpreter-specific script probe error: ${String(r)}`);}try{i('probing importlib.find_spec("rapidkit")');let r=await execa(t,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"],{reject:!1,stdio:"pipe",timeout:2e3});if(i(`import probe exitCode=${r.exitCode} stdout=${(r.stdout??"").toString().trim()}`),r.exitCode===0&&(r.stdout??"").toString().trim()==="1")return !0}catch(r){i(`import probe error: ${String(r)}`);}try{i("probing python -m rapidkit");let r=await execa(t,["-m","rapidkit","--version","--json"],{reject:!1,stdio:"pipe",timeout:8e3});if(i(`-m probe exitCode=${r.exitCode}`),r.exitCode===0)return !0}catch(r){i(`-m probe error: ${String(r)}`);}try{i("probing PATH for rapidkit executables");let r=(process.env.PATH??"").split(v.delimiter).filter(Boolean);for(let n of r){let o=v.join(n,process.platform==="win32"?"rapidkit.exe":"rapidkit");try{if(await E.pathExists(o)){i(`found candidate on PATH: ${o}; invoking --version --json`);let a=await execa(o,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(i(`candidate exitCode=${a.exitCode}`),a.exitCode===0){let s=(a.stdout??"").toString().trim();try{let c=JSON.parse(s);if(c&&typeof c=="object"&&c!==null&&"version"in c)return !0}catch{i("candidate output not valid JSON, skipping");}}}}catch(a){i(`error probing candidate ${o}: ${String(a)}`);}}return i("no valid rapidkit found on PATH"),!1}catch(r){return i(`PATH probe error: ${String(r)}`),false}}async function St(t){let e=(t??"").toString().trim();if(!e)return false;try{let i=JSON.parse(e);return !!i&&typeof i=="object"&&i!==null&&"version"in i}catch{return false}}async function We(t){let e=process.platform==="win32",i=e?v.join(".venv","Scripts","rapidkit.exe"):v.join(".venv","bin","rapidkit"),r=e?v.join(".venv","Scripts","python.exe"):v.join(".venv","bin","python"),n=t;for(let o=0;o<25;o+=1){let a=v.join(n,i);if(await E.pathExists(a)){let d=await execa(a,["--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:n});if(d.exitCode===0&&await St(d.stdout))return {cmd:a,baseArgs:[]}}let s=v.join(n,r);if(await E.pathExists(s)){let d=await execa(s,["-m","rapidkit","--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:n});if(d.exitCode===0&&await St(d.stdout))return {cmd:s,baseArgs:["-m","rapidkit"]}}let c=v.dirname(n);if(c===n)break;n=c;}return null}async function Le(t){try{let e=v.join(t,".python-version");if(await E.pathExists(e)){let r=(await E.readFile(e,"utf-8")).trim();if(r)return r}}catch{}try{let e=v.join(t,".rapidkit-workspace");if(await E.pathExists(e)){let i=await E.readFile(e,"utf-8"),r=JSON.parse(i);if(r.pythonVersion)return r.pythonVersion}}catch{}return null}async function re(t){if(t&&t.trim())try{let o=await We(t);if(o){let a=v.dirname(o.cmd).includes(".venv")?v.dirname(v.dirname(v.dirname(o.cmd))):v.dirname(o.cmd),s=await Le(a);return s&&(process.env.PYENV_VERSION=s),o}}catch{}let e=await nt();if(e.kind==="venv"){let o=It(),a=Qt(o);return await E.pathExists(a)?{cmd:a,baseArgs:[]}:{cmd:e.pythonPath,baseArgs:["-m","rapidkit"]}}try{if((await execa(e.cmd,["-m","rapidkit","--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3})).exitCode===0)return {cmd:e.cmd,baseArgs:["-m","rapidkit"]}}catch{}try{let a=((await execa(e.cmd,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"],{reject:!1,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(a&&await E.pathExists(a))try{let s=await execa(a,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(s.exitCode===0&&await St(s.stdout))return {cmd:a,baseArgs:[]}}catch{}}catch{}let i=It(),r=await yt(e.cmd),n=Qt(i);return await E.pathExists(n)?{cmd:n,baseArgs:[]}:{cmd:r,baseArgs:["-m","rapidkit"]}}async function At(){for(let t of ["python3","python"])try{return await execa(t,["--version"],{reject:!1,stdio:"pipe",timeout:2e3}),t}catch{}return null}async function oe(){let t=!!process.env.RAPIDKIT_DEBUG,e=i=>{t&&process.stderr.write(`[DEBUG] checkRapidkitCore: ${i}
|
|
7
|
+
`);};for(let i of ["python3","python","python3.10","python3.11","python3.12"])try{e(`Method 1: trying ${i} import`);let r=await execa(i,["-c","import rapidkit_core; print(1)"],{reject:!1,stdio:"pipe",timeout:3e3});if(r.exitCode===0&&r.stdout?.trim()==="1")return e(`\u2713 Found via ${i} import`),!0}catch{continue}for(let i of ["python3","python"])try{e(`Method 2: trying ${i} -m pip show`);let r=await execa(i,["-m","pip","show","rapidkit-core"],{reject:!1,stdio:"pipe",timeout:3e3});if(r.exitCode===0&&r.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found via ${i} -m pip show`),!0}catch{continue}for(let i of ["pip","pip3"])try{e(`Method 3: trying ${i} show`);let r=await execa(i,["show","rapidkit-core"],{reject:!1,stdio:"pipe",timeout:3e3});if(r.exitCode===0&&r.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found via ${i} show`),!0}catch{continue}try{e("Method 4: checking pyenv versions");let i=await execa("pyenv",["versions","--bare"],{reject:!1,stdio:"pipe",timeout:3e3});if(i.exitCode===0&&i.stdout){let r=i.stdout.split(`
|
|
8
|
+
`).filter(n=>n.trim());e(`Found pyenv versions: ${r.join(", ")}`);for(let n of r){let o=process.env.PYENV_ROOT||v.join(B__default.homedir(),".pyenv"),a=v.join(o,"versions",n.trim(),"bin","pip");try{let s=await execa(a,["show","rapidkit-core"],{reject:!1,stdio:"pipe",timeout:3e3});if(s.exitCode===0&&s.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found in pyenv ${n}`),!0}catch{try{let s=await execa("bash",["-c",`PYENV_VERSION=${n.trim()} pyenv exec pip show rapidkit-core`],{reject:!1,stdio:"pipe",timeout:3e3});if(s.exitCode===0&&s.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found in pyenv ${n} via PYENV_VERSION`),!0}catch{continue}}}}}catch{e("pyenv not available");}for(let i of ["python3","python"])try{e(`Method 5: checking ${i} user site`);let r=await execa(i,["-m","site","--user-site"],{reject:!1,stdio:"pipe",timeout:3e3});if(r.exitCode===0&&r.stdout){let n=r.stdout.trim(),o=v.join(n,"rapidkit_core");if(await E.pathExists(o))return e("\u2713 Found in user site-packages"),!0}}catch{continue}try{e("Method 6: checking pipx");let i=await execa("pipx",["list"],{reject:!1,stdio:"pipe",timeout:3e3});if(i.exitCode===0&&i.stdout?.includes("rapidkit-core"))return e("\u2713 Found via pipx"),!0}catch{e("pipx not available");}try{if(e("Method 7: checking poetry"),(await execa("poetry",["show","rapidkit-core"],{reject:!1,stdio:"pipe",timeout:3e3})).exitCode===0)return e("\u2713 Found via poetry"),!0}catch{e("poetry check failed");}try{e("Method 8: checking conda");let i=await execa("conda",["list","rapidkit-core"],{reject:!1,stdio:"pipe",timeout:3e3});if(i.exitCode===0&&i.stdout?.includes("rapidkit-core"))return e("\u2713 Found via conda"),!0}catch{e("conda not available");}return e("\u2717 Not found in any environment"),false}async function yt(t){let e=It(),i=Xt(e);if(await E.pathExists(i))try{let o=await execa(i,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"],{reject:!1,stdio:"pipe",timeout:2e3});if(o.exitCode===0&&(o.stdout??"").toString().trim()==="1")return i;await E.remove(e);}catch{await E.remove(e);}let r={...process.env,PIP_DISABLE_PIP_VERSION_CHECK:"1",PIP_NO_PYTHON_VERSION_WARNING:"1"},n=async(o,a)=>{let s=await execa(o,a,{reject:false,stdio:["ignore","pipe","inherit"],env:r});if(s.exitCode===0)return;let c=(s.stdout??"").toString(),d=(s.stderr??"").toString(),p=[c,d].filter(Boolean).join(`
|
|
9
|
+
`),l=p?`${o} ${a.join(" ")}
|
|
10
|
+
${p}`:`${o} ${a.join(" ")}`;throw new Error(l)};try{await E.ensureDir(v.dirname(e)),await n(t,["-m","venv",e]);let o=Xt(e);if((await execa(o,["-m","pip","--version"],{reject:!1,stdio:"pipe",timeout:2e3})).exitCode!==0&&(await execa(o,["-m","ensurepip","--default-pip"],{reject:!1,stdio:["ignore","pipe","inherit"],env:r})).exitCode!==0)throw new Error(`Failed to install pip in virtual environment.
|
|
11
|
+
Your Python installation may be missing the ensurepip module.
|
|
12
|
+
On Debian/Ubuntu, install: sudo apt install python3-venv python3-pip`);return process.env.RAPIDKIT_BRIDGE_UPGRADE_PIP==="1"&&await n(o,["-m","pip","install","-U","pip"]),await n(o,["-m","pip","install","-U",Ve()]),o}catch(o){throw new ot("BRIDGE_VENV_BOOTSTRAP_FAILED",Nt(o))}}async function nt(){if(process.env.RAPIDKIT_BRIDGE_FORCE_VENV==="1"){let i=await At();if(!i)throw new ot("PYTHON_NOT_FOUND","No Python interpreter found (python3/python).");return {kind:"venv",pythonPath:await yt(i)}}for(let i of ["python3","python"])if(await ie(i))return {kind:"system",cmd:i};let t=await At();if(!t)throw new ot("PYTHON_NOT_FOUND","No Python interpreter found (python3/python).");return {kind:"venv",pythonPath:await yt(t)}}async function V(t,e){try{let i=await re(e?.cwd),r=i.cmd,n=[...i.baseArgs,...t],o=await execa(r,n,{cwd:e?.cwd,env:{...process.env,...e?.env},reject:!1,stdio:"inherit"});return typeof o.exitCode=="number"?o.exitCode:1}catch(i){return process.stderr.write(`${Nt(i)}
|
|
13
|
+
`),1}}async function Dt(t,e){try{let i=await re(e?.cwd),r=i.cmd,n=[...i.baseArgs,...t],o=await execa(r,n,{cwd:e?.cwd,env:{...process.env,...e?.env},reject:!1,stdio:"pipe"});return {exitCode:typeof o.exitCode=="number"?o.exitCode:1,stdout:(o.stdout??"").toString(),stderr:(o.stderr??"").toString()}}catch(i){return {exitCode:1,stdout:"",stderr:`${Nt(i)}
|
|
14
|
+
`}}}function ne(t){let e=new Set,i=t.split(`
|
|
15
|
+
`),r=false;for(let n of i){let o=n.replace(/\r$/,"");if(!r){/^\s*Commands:\s*$/i.test(o)&&(r=true);let c=o.match(/^\s*rapidkit\s+([a-z0-9_-]+)\b/i);if(c){let d=c[1].trim();d&&!d.startsWith("-")&&e.add(d);}continue}if(!o.trim())break;if(/^\s*(Options|Arguments|Usage|Commands)\s*:/i.test(o))continue;let a=o.match(/^\s*([a-z0-9][a-z0-9_-]*)\b/i);if(!a)continue;let s=a[1].trim();s&&!s.startsWith("-")&&e.add(s);}return e}async function ae(){let t=ee();if(!await E.pathExists(t))return null;try{let e=await E.readJson(t);if(e&&e.schema_version===1&&Array.isArray(e.commands))return e}catch{}return null}async function Ge(t){let e=ee();await E.ensureDir(v.dirname(e)),await E.writeJson(e,t,{spaces:2});}async function Ue(){let t=await Dt(["version","--json"],{cwd:process.cwd()});if(t.exitCode===0)try{let i=JSON.parse(t.stdout)?.version;return typeof i=="string"?i:void 0}catch{return}}async function Be(){let e=Date.now(),i=await ae(),r=await Ue(),n=!!i?.commands?.length;if(n&&e-i.fetched_at<864e5&&(!r||!i.rapidkit_version||i.rapidkit_version===r))return new Set(i.commands);let o=await Dt(["--help"],{cwd:process.cwd()});if(o.exitCode!==0)return n&&i?.commands?new Set(i.commands):new Set;let a=ne(o.stdout);if(a.size===0)return new Set;let s=Array.from(a).sort();return await Ge({schema_version:1,fetched_at:e,rapidkit_version:r,commands:s}),a}async function Tt(){let e=Date.now(),i=await ae();return !i||e-i.fetched_at>=864e5||!i.commands?.length?null:new Set(i.commands)}var ot,He,wt=et(()=>{$();ot=class extends Error{code;constructor(e,i){super(i),this.code=e;}};He={pickSystemPython:At,ensureBridgeVenv:yt,parseCoreCommandsFromHelp:ne,tryRapidkit:ie,checkRapidkitCoreAvailable:oe};});var pe={};_t(pe,{createNpmWorkspaceMarker:()=>Kt,isValidWorkspaceMarker:()=>ze,readWorkspaceMarker:()=>Ft,updateWorkspaceMetadata:()=>Ye,writeWorkspaceMarker:()=>vt});async function Ft(t){let e=v.join(t,".rapidkit-workspace");try{if(await E.pathExists(e))return await E.readJson(e)}catch{return null}return null}async function vt(t,e){let i=v.join(t,".rapidkit-workspace"),r=await Ft(t);r?.metadata&&(e.metadata={...r.metadata,...e.metadata}),await E.outputFile(i,JSON.stringify(e,null,2)+`
|
|
16
|
+
`,"utf-8");}async function Ye(t,e){let i=await Ft(t);return i?(i.metadata={...i.metadata,...e,vscode:e.vscode?{...i.metadata?.vscode,...e.vscode}:i.metadata?.vscode,npm:e.npm?{...i.metadata?.npm,...e.npm}:i.metadata?.npm,python:e.python?{...i.metadata?.python,...e.python}:i.metadata?.python},await vt(t,i),true):false}function Kt(t,e,i){return {signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:e,createdAt:new Date().toISOString(),name:t,metadata:{npm:{packageVersion:e,installMethod:i,lastUsedAt:new Date().toISOString()}}}}function ze(t){if(!t||typeof t!="object")return false;let e=t;return e.signature==="RAPIDKIT_WORKSPACE"&&typeof e.createdBy=="string"&&typeof e.version=="string"&&typeof e.createdAt=="string"&&typeof e.name=="string"}var Mt=et(()=>{$();});var H={};_t(H,{createProject:()=>ii,createWorkspace:()=>Qe,listWorkspaces:()=>oi,registerProjectInWorkspace:()=>Xe,registerWorkspace:()=>de,syncWorkspaceProjects:()=>qe});async function de(t,e){try{let i=process.env.XDG_CONFIG_HOME||process.env.APPDATA||v.join(B__default.homedir(),".config"),r=process.platform==="win32"?v.join(i,"rapidkit"):v.join(B__default.homedir(),".rapidkit"),n=v.join(r,"workspaces.json");await promises.mkdir(r,{recursive:!0});let o={workspaces:[]};try{let s=await promises.readFile(n,"utf8"),c=JSON.parse(s);c&&Array.isArray(c.workspaces)&&(o=c);}catch{}o.workspaces.some(s=>s.path===t)||(o.workspaces.push({name:e,path:t,mode:"full",projects:[]}),await promises.writeFile(n,JSON.stringify(o,null,2)));}catch{console.warn(m.gray("Note: Could not register workspace in shared registry"));}}async function qe(t,e=false){try{let i=process.env.XDG_CONFIG_HOME||process.env.APPDATA||v.join(B__default.homedir(),".config"),r=process.platform==="win32"?v.join(i,"rapidkit"):v.join(B__default.homedir(),".rapidkit"),n=v.join(r,"workspaces.json"),o={workspaces:[]};try{let p=await promises.readFile(n,"utf8"),l=JSON.parse(p);l&&Array.isArray(l.workspaces)&&(o=l);}catch{e||console.log("\u26A0\uFE0F Workspace registry not found");return}let a=o.workspaces.find(p=>p.path===t);if(!a){e||console.log("\u26A0\uFE0F Workspace not registered in registry");return}Array.isArray(a.projects)||(a.projects=[]);let s=await promises.readdir(t,{withFileTypes:!0}),c=0,d=0;for(let p of s)if(p.isDirectory()&&!p.name.startsWith(".")){let l=v.join(t,p.name),u=v.join(l,".rapidkit","context.json"),k=v.join(l,".rapidkit","project.json");try{let f=!1;try{await promises.access(u),f=!0;}catch{await promises.access(k),f=!0;}f&&(a.projects.some(I=>I.path===l||I.name===p.name)?d++:(a.projects.push({name:p.name,path:l}),c++,e||console.log(`\u2714 Added: ${p.name}`)));}catch{}}c>0?(await promises.writeFile(n,JSON.stringify(o,null,2)),e||console.log(`
|
|
17
|
+
\u2705 Synced ${c} project(s) to registry`)):e||console.log(`
|
|
18
|
+
\u2705 All projects already registered (${d} found)`);}catch(i){e||console.error("\u274C Failed to sync projects:",i.message);}}async function Xe(t,e,i){try{let r=process.env.XDG_CONFIG_HOME||process.env.APPDATA||v.join(B__default.homedir(),".config"),n=process.platform==="win32"?v.join(r,"rapidkit"):v.join(B__default.homedir(),".rapidkit"),o=v.join(n,"workspaces.json");console.log(`[REGISTRY DEBUG] Registry file: ${o}`);let a={workspaces:[]};try{let d=await promises.readFile(o,"utf8"),p=JSON.parse(d);p&&Array.isArray(p.workspaces)&&(a=p),console.log(`[REGISTRY DEBUG] Registry loaded, ${a.workspaces.length} workspaces`);}catch{console.log("[REGISTRY DEBUG] Registry doesn't exist, returning");return}let s=a.workspaces.find(d=>d.path===t);if(!s){console.log("[REGISTRY DEBUG] Workspace not found in registry, returning");return}console.log(`[REGISTRY DEBUG] Workspace found: ${s.name}`),Array.isArray(s.projects)||(s.projects=[]),s.projects.some(d=>d.path===i||d.name===e)?console.log("[REGISTRY DEBUG] Project already exists in registry"):(console.log("[REGISTRY DEBUG] Adding project to registry"),s.projects.push({name:e,path:i}),await promises.writeFile(o,JSON.stringify(a,null,2)),console.log("[REGISTRY DEBUG] Registry updated successfully"));}catch(r){console.log(`[REGISTRY DEBUG] Error: ${r}`);}}async function Qe(t,e){let i=mt("Creating RapidKit workspace...").start();try{await promises.mkdir(t,{recursive:!0}),await promises.mkdir(v.join(t,".rapidkit"),{recursive:!0});let r={workspace_name:e.name,author:e.author,rapidkit_version:M(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(v.join(t,".rapidkit","config.json"),JSON.stringify(r,null,2));let n=Ze();await promises.writeFile(v.join(t,"rapidkit"),n),await promises.chmod(v.join(t,"rapidkit"),493);let o=ti(e.name);if(await promises.writeFile(v.join(t,"README.md"),o),await promises.writeFile(v.join(t,".gitignore"),`# RapidKit workspace
|
|
8
19
|
.env
|
|
9
20
|
.env.*
|
|
10
21
|
!.env.example
|
|
@@ -19,37 +30,37 @@ Thumbs.db
|
|
|
19
30
|
|
|
20
31
|
# Logs
|
|
21
32
|
*.log
|
|
22
|
-
`),await promises.writeFile(
|
|
23
|
-
${
|
|
33
|
+
`),await promises.writeFile(v.join(t,".rapidkit-workspace"),JSON.stringify({signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:M(),createdAt:new Date().toISOString(),name:e.name},null,2)),await ei(t),i.succeed("Workspace created!"),!e.skipGit){let s=mt("Initializing git repository...").start();try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:t}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}await de(t,e.name),console.log(`
|
|
34
|
+
${m.green("\u2728 RapidKit workspace created successfully!")}
|
|
24
35
|
|
|
25
|
-
${
|
|
26
|
-
${
|
|
36
|
+
${m.bold("\u{1F4C2} Workspace structure:")}
|
|
37
|
+
${t}/
|
|
27
38
|
\u251C\u2500\u2500 rapidkit # Local CLI wrapper
|
|
28
39
|
\u251C\u2500\u2500 .rapidkit/ # Workspace configuration
|
|
29
40
|
\u2502 \u251C\u2500\u2500 config.json # Workspace settings
|
|
30
41
|
\u2502 \u2514\u2500\u2500 templates/ # Project templates
|
|
31
42
|
\u2514\u2500\u2500 README.md
|
|
32
43
|
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
${
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
${
|
|
44
|
+
${m.bold("\u{1F680} Get started:")}
|
|
45
|
+
${m.cyan(`cd ${e.name}`)}
|
|
46
|
+
${m.cyan("npx rapidkit my-api --template fastapi")}
|
|
47
|
+
${m.cyan("cd my-api")}
|
|
48
|
+
${m.cyan("npx rapidkit init")}
|
|
49
|
+
${m.cyan("npx rapidkit dev")}
|
|
39
50
|
|
|
40
|
-
${
|
|
51
|
+
${m.bold("\u{1F4E6} Available templates:")}
|
|
41
52
|
fastapi - FastAPI + Python (default)
|
|
42
53
|
nestjs - NestJS + TypeScript
|
|
43
54
|
|
|
44
|
-
${
|
|
55
|
+
${m.bold("\u{1F4DA} Commands:")}
|
|
45
56
|
npx rapidkit <name> --template <type> Create a new project
|
|
46
57
|
npx rapidkit init Install dependencies
|
|
47
58
|
npx rapidkit dev Start dev server
|
|
48
59
|
npx rapidkit help Show all commands
|
|
49
60
|
|
|
50
|
-
${
|
|
51
|
-
${
|
|
52
|
-
`);}catch(r){throw i.fail("Failed to create workspace"),r}}function
|
|
61
|
+
${m.gray("Alternative: ./rapidkit dev, make dev")}
|
|
62
|
+
${m.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
63
|
+
`);}catch(r){throw i.fail("Failed to create workspace"),r}}function Ze(){return `#!/usr/bin/env bash
|
|
53
64
|
#
|
|
54
65
|
# RapidKit CLI - Local workspace commands
|
|
55
66
|
# This script provides rapidkit commands within the workspace
|
|
@@ -385,7 +396,7 @@ main() {
|
|
|
385
396
|
print_help
|
|
386
397
|
;;
|
|
387
398
|
version|-v|--version)
|
|
388
|
-
echo "RapidKit CLI (npm workspace) v${
|
|
399
|
+
echo "RapidKit CLI (npm workspace) v${M()}"
|
|
389
400
|
;;
|
|
390
401
|
*)
|
|
391
402
|
echo -e "\${RED}\u274C Unknown command: $cmd\${NC}"
|
|
@@ -397,7 +408,7 @@ main() {
|
|
|
397
408
|
}
|
|
398
409
|
|
|
399
410
|
main "$@"
|
|
400
|
-
`}function
|
|
411
|
+
`}function ti(t){return `# ${t}
|
|
401
412
|
|
|
402
413
|
RapidKit workspace for building API projects.
|
|
403
414
|
|
|
@@ -445,7 +456,7 @@ npx rapidkit dev # Start dev server
|
|
|
445
456
|
|
|
446
457
|
- [RapidKit Documentation](https://rapidkit.dev)
|
|
447
458
|
- [GitHub Repository](https://github.com/Baziar/rapidkit)
|
|
448
|
-
`}async function
|
|
459
|
+
`}async function ei(t){let{fileURLToPath:e}=await import('url'),i=e(import.meta.url),r=v.dirname(i),n=v.resolve(r,".."),o=v.join(n,"templates","kits"),a=v.join(t,".rapidkit","templates"),{default:s}=await import('fs-extra');await s.copy(o,a);let c=v.join(n,"templates","generator.js"),d=v.join(t,".rapidkit","generator.js");await s.copy(c,d);}async function ii(t,e){let i=e.template==="fastapi",r=i?"FastAPI":"NestJS",n=mt(`Creating ${r} project...`).start();try{let{fileURLToPath:o}=await import('url'),a=o(import.meta.url),s=v.dirname(a),c=v.resolve(s,".."),d=i?"fastapi-standard":"nestjs-standard",p=v.join(c,"templates","kits",d);await promises.mkdir(t,{recursive:!0});let l={project_name:i?e.name.replace(/-/g,"_").toLowerCase():e.name.replace(/_/g,"-").toLowerCase(),author:e.author,description:e.description||`${r} application generated with RapidKit`,app_version:"0.1.0",license:"MIT",package_manager:e.package_manager||"npm",created_at:new Date().toISOString(),rapidkit_version:M()};await le(p,t,l);let u=i?`# Python
|
|
449
460
|
__pycache__/
|
|
450
461
|
*.py[cod]
|
|
451
462
|
*$py.class
|
|
@@ -513,11 +524,11 @@ Thumbs.db
|
|
|
513
524
|
|
|
514
525
|
# Coverage
|
|
515
526
|
coverage/
|
|
516
|
-
`;if(await promises.writeFile(
|
|
517
|
-
${
|
|
527
|
+
`;if(await promises.writeFile(v.join(t,".gitignore"),u),n.succeed(`${r} project created!`),!e.skipGit){let f=mt("Initializing git repository...").start();try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m",`Initial commit: ${r} project via RapidKit`],{cwd:t}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}if(!e.skipInstall&&!i){let f=e.package_manager||"npm",w=mt(`Installing dependencies with ${f}...`).start();try{await execa(f,["install"],{cwd:t}),w.succeed("Dependencies installed");}catch{w.warn(`Could not install dependencies. Run '${f} install' manually.`);}}let k=v.basename(t);console.log(i?`
|
|
528
|
+
${m.green("\u2728 FastAPI project created successfully!")}
|
|
518
529
|
|
|
519
|
-
${
|
|
520
|
-
${
|
|
530
|
+
${m.bold("\u{1F4C2} Project structure:")}
|
|
531
|
+
${t}/
|
|
521
532
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
522
533
|
\u251C\u2500\u2500 src/
|
|
523
534
|
\u2502 \u251C\u2500\u2500 main.py # FastAPI application
|
|
@@ -528,12 +539,12 @@ ${e}/
|
|
|
528
539
|
\u251C\u2500\u2500 pyproject.toml # Poetry configuration
|
|
529
540
|
\u2514\u2500\u2500 README.md
|
|
530
541
|
|
|
531
|
-
${
|
|
532
|
-
${
|
|
533
|
-
${
|
|
534
|
-
${
|
|
542
|
+
${m.bold("\u{1F680} Get started:")}
|
|
543
|
+
${m.cyan(`cd ${k}`)}
|
|
544
|
+
${m.cyan("npx rapidkit init")} ${m.gray("# Install dependencies")}
|
|
545
|
+
${m.cyan("npx rapidkit dev")} ${m.gray("# Start dev server")}
|
|
535
546
|
|
|
536
|
-
${
|
|
547
|
+
${m.bold("\u{1F4DA} Available commands:")}
|
|
537
548
|
npx rapidkit init # Install dependencies (poetry install)
|
|
538
549
|
npx rapidkit dev # Start dev server with hot reload
|
|
539
550
|
npx rapidkit start # Start production server
|
|
@@ -541,13 +552,13 @@ ${l.bold("\u{1F4DA} Available commands:")}
|
|
|
541
552
|
npx rapidkit lint # Lint code
|
|
542
553
|
npx rapidkit format # Format code
|
|
543
554
|
|
|
544
|
-
${
|
|
545
|
-
${
|
|
555
|
+
${m.gray("Alternative: make dev, ./rapidkit dev, poetry run dev")}
|
|
556
|
+
${m.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
546
557
|
`:`
|
|
547
|
-
${
|
|
558
|
+
${m.green("\u2728 NestJS project created successfully!")}
|
|
548
559
|
|
|
549
|
-
${
|
|
550
|
-
${
|
|
560
|
+
${m.bold("\u{1F4C2} Project structure:")}
|
|
561
|
+
${t}/
|
|
551
562
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
552
563
|
\u251C\u2500\u2500 src/
|
|
553
564
|
\u2502 \u251C\u2500\u2500 main.ts # Application entry point
|
|
@@ -558,13 +569,13 @@ ${e}/
|
|
|
558
569
|
\u251C\u2500\u2500 package.json # Dependencies
|
|
559
570
|
\u2514\u2500\u2500 README.md
|
|
560
571
|
|
|
561
|
-
${
|
|
562
|
-
${
|
|
563
|
-
${
|
|
564
|
-
`:""}${
|
|
565
|
-
${
|
|
572
|
+
${m.bold("\u{1F680} Get started:")}
|
|
573
|
+
${m.cyan(`cd ${k}`)}
|
|
574
|
+
${e.skipInstall?m.cyan("npx rapidkit init")+m.gray(" # npm install")+`
|
|
575
|
+
`:""}${m.cyan("cp .env.example .env")}
|
|
576
|
+
${m.cyan("npx rapidkit dev")} ${m.gray("# Start dev server")}
|
|
566
577
|
|
|
567
|
-
${
|
|
578
|
+
${m.bold("\u{1F4DA} Available commands:")}
|
|
568
579
|
npx rapidkit init # Install dependencies
|
|
569
580
|
npx rapidkit dev # Start dev server with hot reload
|
|
570
581
|
npx rapidkit start # Start production server
|
|
@@ -573,47 +584,43 @@ ${l.bold("\u{1F4DA} Available commands:")}
|
|
|
573
584
|
npx rapidkit lint # Lint code
|
|
574
585
|
npx rapidkit format # Format code
|
|
575
586
|
|
|
576
|
-
${
|
|
587
|
+
${m.bold("\u{1F310} API endpoints:")}
|
|
577
588
|
http://localhost:8000/health # Health check
|
|
578
589
|
http://localhost:8000/docs # Swagger docs
|
|
579
590
|
http://localhost:8000/examples/notes # Example API
|
|
580
591
|
|
|
581
|
-
${
|
|
582
|
-
`);}catch(o){throw n.fail(`Failed to create ${r} project`),o}}async function
|
|
592
|
+
${m.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
593
|
+
`);}catch(o){throw n.fail(`Failed to create ${r} project`),o}}async function le(t,e,i){let r=await promises.readdir(t,{withFileTypes:true});for(let n of r){let o=v.join(t,n.name),a=n.name.replace(/\.j2$/,""),s=v.join(e,a);if(n.isDirectory())await promises.mkdir(s,{recursive:true}),await le(o,s,i);else {let c=await promises.readFile(o,"utf-8");n.name.endsWith(".j2")&&(c=ri(c,i)),await promises.writeFile(s,c),(a==="rapidkit"||a==="activate"||a.endsWith(".py")&&s.includes(".rapidkit"))&&await promises.chmod(s,493);}}}function ri(t,e){let i=t;for(let[r,n]of Object.entries(e)){let o=new RegExp(`\\{\\{\\s*${r}\\s*\\}\\}`,"g");i=i.replace(o,String(n));let a=new RegExp(`\\{\\{\\s*${r}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\}\\}`,"g");i=i.replace(a,(d,p,l)=>String(n).replace(new RegExp(p,"g"),l));let s=new RegExp(`\\{\\{\\s*${r}\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(s,String(n).toLowerCase());let c=new RegExp(`\\{\\{\\s*${r}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\|\\s*lower\\s*\\}\\}`,"g");i=i.replace(c,(d,p,l)=>String(n).replace(new RegExp(p,"g"),l).toLowerCase());}return i}async function oi(){let t=process.env.XDG_CONFIG_HOME||process.env.APPDATA||v.join(B__default.homedir(),".config"),e=process.platform==="win32"?v.join(t,"rapidkit"):v.join(B__default.homedir(),".rapidkit"),i=v.join(e,"workspaces.json");if(!await promises.stat(i).catch(()=>null)){console.log(m.yellow(`
|
|
583
594
|
\u26A0\uFE0F No workspaces registered yet.
|
|
584
|
-
`)),console.log(
|
|
585
|
-
`));return}try{let r=await promises.readFile(i,"utf8"),n=JSON.parse(r);if(!n.workspaces||n.workspaces.length===0){console.log(
|
|
595
|
+
`)),console.log(m.gray(`Create a workspace with: npx rapidkit <workspace-name>
|
|
596
|
+
`));return}try{let r=await promises.readFile(i,"utf8"),n=JSON.parse(r);if(!n.workspaces||n.workspaces.length===0){console.log(m.yellow(`
|
|
586
597
|
\u26A0\uFE0F No workspaces registered yet.
|
|
587
|
-
`));return}console.log(
|
|
598
|
+
`));return}console.log(m.bold(`
|
|
588
599
|
\u{1F4E6} Registered RapidKit Workspaces:
|
|
589
|
-
`));for(let o of n.workspaces)console.log(
|
|
590
|
-
`));}catch(r){console.error(
|
|
591
|
-
\u274C Failed to read workspace registry`)),console.error(
|
|
600
|
+
`));for(let o of n.workspaces)console.log(m.cyan(` ${o.name}`)),console.log(m.gray(` Path: ${o.path}`)),console.log(m.gray(` Projects: ${o.projects?.length||0}`)),await promises.stat(o.path).catch(()=>null)||console.log(m.red(" \u26A0\uFE0F Path not found")),console.log();console.log(m.gray(`Total: ${n.workspaces.length} workspace(s)
|
|
601
|
+
`));}catch(r){console.error(m.red(`
|
|
602
|
+
\u274C Failed to read workspace registry`)),console.error(m.gray(String(r)));}}var J=et(()=>{$();pt();});$();ct();pt();$();ct();var De=".rapidkitrc.json";async function dt(){let t=v.join(B__default.homedir(),De);try{let e=await promises.readFile(t,"utf-8"),i=JSON.parse(e);return g.debug(`Loaded config from ${t}`),i}catch{return g.debug("No user config found, using defaults"),{}}}function ft(t){return process.env.RAPIDKIT_DEV_PATH||t.testRapidKitPath||void 0}$();$();var F=class extends Error{constructor(i,r,n){super(i);this.code=r;this.details=n;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}},it=class extends F{constructor(e,i){let r=i?`Python ${e}+ required, found ${i}`:`Python ${e}+ not found`;super(r,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},lt=class extends F{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},ut=class extends F{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},ht=class extends F{constructor(e){super(`Directory "${e}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},U=class extends F{constructor(e,i){super(`Invalid project name: "${e}"`,"INVALID_PROJECT_NAME",i);}},A=class extends F{constructor(e,i){let r=`Installation failed at: ${e}`,n=`${i.message}
|
|
592
603
|
|
|
593
604
|
Troubleshooting:
|
|
594
605
|
- Check your internet connection
|
|
595
606
|
- Verify Python/Poetry installation
|
|
596
|
-
- Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",n);}},
|
|
607
|
+
- Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",n);}},rt=class extends F{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
|
|
597
608
|
1. Install Python 3.10+ and retry the same command
|
|
598
609
|
2. Use the core workflow: npx rapidkit create workspace <name>
|
|
599
610
|
3. Offline fallback (limited): npx rapidkit create project fastapi.standard <name> --output .
|
|
600
611
|
|
|
601
|
-
Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function
|
|
602
|
-
`);};try{i("probing interpreter-specific rapidkit script");let n=((await execa(e,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"],{reject:!1,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(i(`script path: ${n}`),n)try{if(await b.pathExists(n)){i(`found script at ${n}; invoking --version --json`);let o=await execa(n,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(i(`script exitCode=${o.exitCode}`),o.exitCode===0){let s=(o.stdout??"").toString().trim();try{let a=JSON.parse(s),c=!!a&&typeof a=="object"&&a!==null&&"version"in a;if(i(`script JSON parse ok=${c}`),c)return !0}catch{i("script output not valid JSON");}}}}catch(o){i(`interpreter-specific script probe failed: ${String(o)}`);}}catch(r){i(`interpreter-specific script probe error: ${String(r)}`);}try{i('probing importlib.find_spec("rapidkit")');let r=await execa(e,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"],{reject:!1,stdio:"pipe",timeout:2e3});if(i(`import probe exitCode=${r.exitCode} stdout=${(r.stdout??"").toString().trim()}`),r.exitCode===0&&(r.stdout??"").toString().trim()==="1")return !0}catch(r){i(`import probe error: ${String(r)}`);}try{i("probing python -m rapidkit");let r=await execa(e,["-m","rapidkit","--version","--json"],{reject:!1,stdio:"pipe",timeout:8e3});if(i(`-m probe exitCode=${r.exitCode}`),r.exitCode===0)return !0}catch(r){i(`-m probe error: ${String(r)}`);}try{i("probing PATH for rapidkit executables");let r=(process.env.PATH??"").split(f.delimiter).filter(Boolean);for(let n of r){let o=f.join(n,process.platform==="win32"?"rapidkit.exe":"rapidkit");try{if(await b.pathExists(o)){i(`found candidate on PATH: ${o}; invoking --version --json`);let s=await execa(o,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(i(`candidate exitCode=${s.exitCode}`),s.exitCode===0){let a=(s.stdout??"").toString().trim();try{let c=JSON.parse(a);if(c&&typeof c=="object"&&c!==null&&"version"in c)return !0}catch{i("candidate output not valid JSON, skipping");}}}}catch(s){i(`error probing candidate ${o}: ${String(s)}`);}}return i("no valid rapidkit found on PATH"),!1}catch(r){return i(`PATH probe error: ${String(r)}`),false}}async function Re(e){let t=(e??"").toString().trim();if(!t)return false;try{let i=JSON.parse(t);return !!i&&typeof i=="object"&&i!==null&&"version"in i}catch{return false}}async function Et(e){let t=process.platform==="win32",i=t?f.join(".venv","Scripts","rapidkit.exe"):f.join(".venv","bin","rapidkit"),r=t?f.join(".venv","Scripts","python.exe"):f.join(".venv","bin","python"),n=e;for(let o=0;o<25;o+=1){let s=f.join(n,i);if(await b.pathExists(s)){let p=await execa(s,["--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:n});if(p.exitCode===0&&await Re(p.stdout))return {cmd:s,baseArgs:[]}}let a=f.join(n,r);if(await b.pathExists(a)){let p=await execa(a,["-m","rapidkit","--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:n});if(p.exitCode===0&&await Re(p.stdout))return {cmd:a,baseArgs:["-m","rapidkit"]}}let c=f.dirname(n);if(c===n)break;n=c;}return null}async function It(e){if(e&&e.trim())try{let o=await Et(e);if(o)return o}catch{}let t=await pe();if(t.kind==="venv"){let o=je(),s=Ke(o);return await b.pathExists(s)?{cmd:s,baseArgs:[]}:{cmd:t.pythonPath,baseArgs:["-m","rapidkit"]}}try{if((await execa(t.cmd,["-m","rapidkit","--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3})).exitCode===0)return {cmd:t.cmd,baseArgs:["-m","rapidkit"]}}catch{}try{let s=((await execa(t.cmd,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"],{reject:!1,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(s&&await b.pathExists(s))try{let a=await execa(s,["--version","--json"],{reject:!1,stdio:"pipe",timeout:4e3});if(a.exitCode===0&&await Re(a.stdout))return {cmd:s,baseArgs:[]}}catch{}}catch{}let i=je(),r=await $e(t.cmd),n=Ke(i);return await b.pathExists(n)?{cmd:n,baseArgs:[]}:{cmd:r,baseArgs:["-m","rapidkit"]}}async function Me(){for(let e of ["python3","python"])try{return await execa(e,["--version"],{reject:!1,stdio:"pipe",timeout:2e3}),e}catch{}return null}async function $e(e){let t=je(),i=Fe(t);if(await b.pathExists(i))try{let o=await execa(i,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"],{reject:!1,stdio:"pipe",timeout:2e3});if(o.exitCode===0&&(o.stdout??"").toString().trim()==="1")return i;await b.remove(t);}catch{await b.remove(t);}let r={...process.env,PIP_DISABLE_PIP_VERSION_CHECK:"1",PIP_NO_PYTHON_VERSION_WARNING:"1"},n=async(o,s)=>{let a=await execa(o,s,{reject:false,stdio:["ignore","pipe","inherit"],env:r});if(a.exitCode===0)return;let c=(a.stdout??"").toString(),p=(a.stderr??"").toString(),d=[c,p].filter(Boolean).join(`
|
|
603
|
-
`),m=d?`${o} ${s.join(" ")}
|
|
604
|
-
${d}`:`${o} ${s.join(" ")}`;throw new Error(m)};try{await b.ensureDir(f.dirname(t)),await n(e,["-m","venv",t]);let o=Fe(t);return process.env.RAPIDKIT_BRIDGE_UPGRADE_PIP==="1"&&await n(o,["-m","pip","install","-U","pip"]),await n(o,["-m","pip","install","-U",bt()]),o}catch(o){throw new Q("BRIDGE_VENV_BOOTSTRAP_FAILED",We(o))}}async function pe(){if(process.env.RAPIDKIT_BRIDGE_FORCE_VENV==="1"){let i=await Me();if(!i)throw new Q("PYTHON_NOT_FOUND","No Python interpreter found (python3/python).");return {kind:"venv",pythonPath:await $e(i)}}for(let i of ["python3","python"])if(await Ct(i))return {kind:"system",cmd:i};let e=await Me();if(!e)throw new Q("PYTHON_NOT_FOUND","No Python interpreter found (python3/python).");return {kind:"venv",pythonPath:await $e(e)}}async function F(e,t){try{let i=await It(t?.cwd),r=i.cmd,n=[...i.baseArgs,...e],o=await execa(r,n,{cwd:t?.cwd,env:{...process.env,...t?.env},reject:!1,stdio:"inherit"});return typeof o.exitCode=="number"?o.exitCode:1}catch(i){return process.stderr.write(`${We(i)}
|
|
605
|
-
`),1}}async function St(){let e=Pt();if(!await b.pathExists(e))return null;try{let t=await b.readJson(e);if(t&&t.schema_version===1&&Array.isArray(t.commands))return t}catch{}return null}async function Ve(){let t=Date.now(),i=await St();return !i||t-i.fetched_at>=864e5||!i.commands?.length?null:new Set(i.commands)}w();var At=["version","project","create","init","dev","start","build","test","lint","format","add","list","info","upgrade","diff","doctor","license","reconcile","rollback","uninstall","checkpoint","optimize","snapshot","frameworks","modules","merge"],Ge=new Set(At);w();oe();ne();w();function _e(){return process.platform==="win32"?"python":"python3"}w();async function Nt(e){let t=f.join(e,".rapidkit-workspace");try{if(await b.pathExists(t))return await b.readJson(t)}catch{return null}return null}async function Be(e,t){let i=f.join(e,".rapidkit-workspace"),r=await Nt(e);r?.metadata&&(t.metadata={...r.metadata,...t.metadata}),await b.outputFile(i,JSON.stringify(t,null,2)+`
|
|
606
|
-
`,"utf-8");}function He(e,t,i){return {signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:t,createdAt:new Date().toISOString(),name:e,metadata:{npm:{packageVersion:t,installMethod:i,lastUsedAt:new Date().toISOString()}}}}async function qe(e,t,i){let r=He(t,O(),i);await Be(e,r);}async function Xe(e){await b.outputFile(f.join(e,".gitignore"),`.venv/
|
|
612
|
+
Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function zt(t){let e=Te(t);if(!e.validForNewPackages){let r=e.errors||[],n=e.warnings||[],o=[...r,...n];throw new U(t,`NPM validation failed: ${o.join(", ")}`)}if(!/^[a-z][a-z0-9_-]*$/.test(t))throw new U(t,"Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores");if(["test","tests","src","dist","build","lib","python","pip","poetry","node","npm","rapidkit","rapidkit"].includes(t.toLowerCase()))throw new U(t,`"${t}" is a reserved name. Please choose a different name.`);if(t.length<2)throw new U(t,"Name must be at least 2 characters long");if(t.length>214)throw new U(t,"Name must be less than 214 characters");return true}$();function Fe(t){return typeof t=="object"&&t!==null}async function Ke(t,e,i,r=8e3){try{let n=await execa(t,e,{cwd:i,timeout:r,reject:!1,stdio:"pipe"});return {ok:n.exitCode===0,exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}}catch(n){return {ok:false,exitCode:void 0,stdout:"",stderr:n instanceof Error?n.message:String(n)}}}async function Me(t,e){let i=["-m","rapidkit",...t],r=["python3","python"];for(let n of r){let o=await Ke(n,i,e?.cwd,e?.timeoutMs);if(!o.ok)continue;let a=(o.stdout??"").trim();try{let s=JSON.parse(a);return Fe(s)?{ok:!0,command:n,exitCode:o.exitCode,stdout:o.stdout,stderr:o.stderr,data:s}:{ok:!1,command:n,exitCode:o.exitCode,stdout:o.stdout,stderr:o.stderr}}catch{return {ok:false,command:n,exitCode:o.exitCode,stdout:o.stdout,stderr:o.stderr}}}return {ok:false}}async function qt(t,e){let i=await Me(["project","detect","--path",t,"--json"],e);return !i.ok||!i.data||i.data.schema_version!==1?{ok:false,command:i.command,exitCode:i.exitCode,stdout:i.stdout,stderr:i.stderr}:i}wt();$();var Je=["version","project","create","init","dev","start","build","test","lint","format","add","list","info","upgrade","diff","doctor","license","reconcile","rollback","uninstall","checkpoint","optimize","snapshot","frameworks","modules","merge"],se=new Set(Je);$();ct();pt();$();function kt(){return process.platform==="win32"?"python":"python3"}Mt();async function ge(t,e,i,r){let n=Kt(e,M(),i);r&&(n.metadata||(n.metadata={}),n.metadata.python={version:r}),await vt(t,n);}async function fe(t){await E.outputFile(v.join(t,".gitignore"),`.venv/
|
|
607
613
|
__pycache__/
|
|
608
614
|
*.pyc
|
|
609
615
|
.env
|
|
610
616
|
.rapidkit-workspace/
|
|
611
617
|
|
|
612
|
-
`,"utf-8");}
|
|
618
|
+
`,"utf-8");}async function ue(t){try{let{stdout:e}=await execa(t,["--version"],{timeout:3e3}),i=e.match(/Python (\d+\.\d+\.\d+)/);if(i)return i[1]}catch{}return null}async function ni(t,e){try{await promises.writeFile(v.join(t,".python-version"),`${e}
|
|
619
|
+
`,"utf-8"),g.debug(`Created .python-version with ${e}`);}catch(i){g.warn(`Failed to create .python-version: ${i}`);}}function gt(){let t=v.join(B.homedir(),".local","bin"),i=(process.env.PATH||"").split(v.delimiter).filter(Boolean);i.includes(t)||(process.env.PATH=[t,...i].join(v.delimiter));}async function xt(t,e){gt(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let i=kt();try{return await execa(i,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:i}}catch{}if(e)throw new ut;let{installPipx:r}=await Wt.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 ut;t.start("Installing pipx (user install)");try{try{await execa(i,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(i,["-m","pip","install","--user","--upgrade","pipx"]);}catch(n){let o=n,a=String(o?.stderr||o?.shortMessage||o?.message||"");throw new A("Install pipx with python -m pip",n instanceof Error?n:new Error(a))}t.succeed("pipx installed"),gt();try{return await execa(i,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:i}}catch(n){let o=n,a=String(o?.stderr||o?.shortMessage||o?.message||"pipx not runnable after install");throw new A("Verify pipx after install",new Error(`${a}
|
|
613
620
|
|
|
614
|
-
Try reopening your terminal or run: python3 -m pipx ensurepath`))}}async function
|
|
621
|
+
Try reopening your terminal or run: python3 -m pipx ensurepath`))}}async function st(t,e){return t.kind==="binary"?execa("pipx",e):execa(t.pythonCmd,["-m","pipx",...e])}async function ai(t,e){gt(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(e)throw new lt;let{installPoetry:i}=await Wt.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!i)throw new lt;let r=await xt(t,e);t.start("Installing Poetry with pipx");try{await st(r,["install","poetry"]);}catch(n){let o=n,a=String(o?.stderr||o?.shortMessage||o?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(a))try{await st(r,["upgrade","poetry"]);}catch{}else throw new A("Install Poetry with pipx",n instanceof Error?n:new Error(a))}t.succeed("Poetry installed"),gt();try{await execa("poetry",["--version"]);}catch(n){let o=n,a=String(o?.stderr||o?.shortMessage||o?.message||"Poetry not found on PATH");throw new A("Verify Poetry after pipx install",new Error(`${a}
|
|
615
622
|
|
|
616
|
-
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function
|
|
623
|
+
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function si(t){let e=t==="poetry";return `#!/usr/bin/env sh
|
|
617
624
|
set -eu
|
|
618
625
|
|
|
619
626
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
@@ -623,16 +630,16 @@ if [ -x "$VENV_RAPIDKIT" ]; then
|
|
|
623
630
|
exec "$VENV_RAPIDKIT" "$@"
|
|
624
631
|
fi
|
|
625
632
|
|
|
626
|
-
${
|
|
633
|
+
${e?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]; then
|
|
627
634
|
exec poetry run rapidkit "$@"
|
|
628
635
|
fi
|
|
629
636
|
|
|
630
637
|
`:""}echo "RapidKit launcher could not find a local Python CLI." 1>&2
|
|
631
638
|
echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
632
|
-
${
|
|
639
|
+
${e?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
|
|
633
640
|
`:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
634
641
|
exit 1
|
|
635
|
-
`}function
|
|
642
|
+
`}function ci(t){return `@echo off
|
|
636
643
|
setlocal
|
|
637
644
|
|
|
638
645
|
set "SCRIPT_DIR=%~dp0"
|
|
@@ -642,7 +649,7 @@ if exist "%SCRIPT_DIR%\\.venv\\Scripts\\rapidkit.exe" (
|
|
|
642
649
|
exit /b %ERRORLEVEL%
|
|
643
650
|
)
|
|
644
651
|
|
|
645
|
-
${
|
|
652
|
+
${t==="poetry"?`where poetry >nul 2>nul
|
|
646
653
|
if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
|
|
647
654
|
poetry run rapidkit %*
|
|
648
655
|
exit /b %ERRORLEVEL%
|
|
@@ -651,28 +658,48 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
|
|
|
651
658
|
`:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
652
659
|
echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
653
660
|
exit /b 1
|
|
654
|
-
`}async function
|
|
661
|
+
`}async function he(t,e){await E.outputFile(v.join(t,"rapidkit"),si(e),{encoding:"utf-8",mode:493}),await E.outputFile(v.join(t,"rapidkit.cmd"),ci(e),"utf-8");}async function ye(t,e){let{skipGit:i=false,testMode:r=false,demoMode:n=false,dryRun:o=false,yes:a=false,userConfig:s={},installMethod:c}=e,d=t||"rapidkit",p=v.resolve(process.cwd(),d);if(await E.pathExists(p))throw new ht(d);if(o){await di(p,d,n,s);return}if(n){await pi(p,d,i);return}let l=a?{pythonVersion:s.pythonVersion||"3.10",installMethod:c||s.defaultInstallMethod||"poetry"}:await Wt.prompt([{type:"list",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:["3.10","3.11","3.12"],default:s.pythonVersion||"3.10"},{type:"list",name:"installMethod",message:"How would you like to install RapidKit?",choices:[{name:"\u{1F3AF} Poetry (Recommended - includes virtual env)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard)",value:"venv"},{name:"\u{1F527} pipx (Global isolated install)",value:"pipx"}],default:s.defaultInstallMethod||"poetry"}]);g.step(1,3,"Setting up RapidKit environment");let u=mt("Creating directory").start();try{await E.ensureDir(p),u.succeed("Directory created"),u.start("Detecting Python version");let k=null,f=await we(l.pythonVersion);if(f)k=await ue(f),k?(g.info(`Detected Python ${k}`),u.succeed(`Python ${k} detected`)):u.warn("Could not detect exact Python version");else {let w=kt();k=await ue(w),k?u.succeed(`Python ${k} detected`):u.warn("Could not detect Python version, proceeding with defaults");}if(await ge(p,d,l.installMethod,k||void 0),k&&await ni(p,k),await fe(p),l.installMethod==="poetry")try{await ke(p,l.pythonVersion,u,r,s,a);}catch(w){let I=w?.details||w?.message||String(w);if(I.includes("pyenv")||I.includes("exit status 127")||I.includes("returned non-zero exit status 127")){u.warn("Poetry encountered Python discovery issues, trying venv method"),g.debug(`Poetry error (attempting venv fallback): ${I}`);try{await Vt(p,l.pythonVersion,u,r,s),l.installMethod="venv";}catch(G){throw G}}else throw w}else l.installMethod==="venv"?await Vt(p,l.pythonVersion,u,r,s):await ve(p,u,r,s,a);if(await he(p,l.installMethod),await xe(p,l.installMethod),u.succeed("RapidKit environment ready!"),!e.skipGit){u.start("Initializing git repository");try{await execa("git",["init"],{cwd:p}),await execa("git",["add","."],{cwd:p}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:p}),u.succeed("Git repository initialized");}catch{u.warn("Could not initialize git repository");}}try{let{registerWorkspace:w}=await Promise.resolve().then(()=>(J(),H));await w(p,d);}catch{console.warn(m.gray("Note: Could not register workspace in shared registry"));}if(console.log(m.green(`
|
|
655
662
|
\u2728 RapidKit environment created successfully!
|
|
656
|
-
`)),console.log(
|
|
657
|
-
`)),console.log(
|
|
658
|
-
\u{1F4A1} For more information, check the README.md file.`)),console.log(
|
|
659
|
-
\u{1F4DA} RapidKit commands:`)),console.log(
|
|
660
|
-
`));}catch(
|
|
661
|
-
\u274C Error:`)
|
|
662
|
-
package-mode = false`)
|
|
663
|
+
`)),console.log(m.cyan("\u{1F4C2} Location:"),m.white(p)),console.log(m.cyan(`\u{1F680} Get started:
|
|
664
|
+
`)),console.log(m.white(` cd ${d}`)),l.installMethod==="poetry"){let w="source $(poetry env info --path)/bin/activate";try{gt();let{stdout:I}=await execa("poetry",["--version"]),W=I.match(/Poetry.*?(\d+)\.(\d+)/);W&&(parseInt(W[1])>=2?w="source $(poetry env info --path)/bin/activate":w="poetry shell");}catch{}console.log(m.white(` ${w} # Or: poetry run rapidkit`)),console.log(m.white(" rapidkit create # Interactive mode")),console.log(m.white(" cd <project-name> && rapidkit init && rapidkit dev"));}else l.installMethod==="venv"?(console.log(m.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(m.white(" rapidkit create # Interactive mode")),console.log(m.white(" cd <project-name> && rapidkit init && rapidkit dev"))):(console.log(m.white(" rapidkit create # Interactive mode")),console.log(m.white(" cd <project-name> && rapidkit init && rapidkit dev")));console.log(m.white(`
|
|
665
|
+
\u{1F4A1} For more information, check the README.md file.`)),console.log(m.cyan(`
|
|
666
|
+
\u{1F4DA} RapidKit commands:`)),console.log(m.white(" rapidkit create - Create a new project (interactive)")),console.log(m.white(" rapidkit dev - Run development server")),console.log(m.white(" rapidkit add module <name> - Add a module (e.g., settings)")),console.log(m.white(" rapidkit list - List available kits")),console.log(m.white(" rapidkit modules - List available modules")),console.log(m.white(` rapidkit --help - Show all commands
|
|
667
|
+
`));}catch(k){u.fail("Failed to create RapidKit environment"),console.error(m.red(`
|
|
668
|
+
\u274C Error:`),k);try{await E.remove(p);}catch{}throw k}}async function we(t){let e=[];try{let{stdout:i}=await execa("pyenv",["root"]),r=i.trim();e.push(v.join(r,"versions",`${t}.*`,"bin","python"));let[n,o]=t.split(".");e.push(v.join(r,"versions",`${n}.${o}.*`,"bin","python"));}catch{}e.push(`python${t}`,`python3.${t.split(".")[1]}`,"python3","python"),e.push(`/usr/bin/python${t}`,"/usr/bin/python3",`/usr/local/bin/python${t}`,"/usr/local/bin/python3");for(let i of e)try{let r=i;if(i.includes("*")){if(r=(await execa("sh",["-c",`ls -d ${i} 2>/dev/null | head -1`])).stdout.trim(),!r)continue;r=v.join(r.split("/").slice(0,-1).join("/"),"../bin/python");}let{stdout:n}=await execa(r,["--version"],{timeout:2e3}),o=n.match(/Python (\d+\.\d+)/)?.[1];if(o&&parseFloat(o)>=parseFloat(t))return await execa(r,["-c","import sys; sys.exit(0)"],{timeout:2e3}),r}catch{continue}return null}async function ke(t,e,i,r,n,o=false){await ai(i,o),i.start("Finding Python interpreter");let a=await we(e);a?(g.debug(`Found working Python: ${a}`),i.succeed("Python found")):i.warn("Could not verify Python path, proceeding with default"),i.start("Initializing Poetry project"),await execa("poetry",["init","--no-interaction","--python",`^${e}`],{cwd:t}),i.succeed("Poetry project initialized");let s=v.join(t,"pyproject.toml"),d=await promises.readFile(s,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
|
|
669
|
+
package-mode = false`):d.includes("[project]")&&(d.includes("[build-system]")?d=d.replace("[build-system]",`
|
|
670
|
+
[tool.poetry]
|
|
671
|
+
package-mode = false
|
|
672
|
+
|
|
673
|
+
[build-system]`):d+=`
|
|
674
|
+
|
|
675
|
+
[tool.poetry]
|
|
676
|
+
package-mode = false
|
|
677
|
+
`),await promises.writeFile(s,d,"utf-8"),i.start("Configuring Poetry");try{if(await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),a)try{await execa("poetry",["env","use",a],{cwd:t}),g.debug(`Poetry configured to use: ${a}`);}catch(p){g.debug(`Could not set Poetry env to ${a}: ${p}`);}i.succeed("Poetry configured");}catch{i.warn("Could not configure Poetry virtualenvs.in-project");}i.start("Creating virtualenv");try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:3e4}),i.succeed("Virtualenv created");}catch(p){g.debug(`Failed to create virtualenv: ${p}`),i.warn("Could not create virtualenv, proceeding with add command");}if(i.start("Installing RapidKit"),r){let p=ft(n||{});if(!p)throw new A("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));g.debug(`Installing from local path: ${p}`),i.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",p],{cwd:t});}else {i.text="Installing RapidKit from PyPI";let p=false,l=null;for(let u=1;u<=3;u++)try{await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*u}),p=!0;break}catch(k){l=k,g.debug(`Poetry add attempt ${u} failed: ${k}`),u<3&&(i.text=`Retrying installation (attempt ${u+1}/3)`,await new Promise(f=>setTimeout(f,2e3)));}if(!p){let u=l?.stderr||l?.message||"Unknown error";throw g.debug(`All Poetry install attempts failed. Last error: ${u}`),u.includes("Could not find")||u.includes("No matching distribution")?new rt:new A("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
678
|
+
Error: ${u}
|
|
679
|
+
|
|
680
|
+
Possible solutions:
|
|
681
|
+
1. Check your internet connection
|
|
682
|
+
2. Try installing manually: cd ${v.basename(t)} && poetry add rapidkit-core
|
|
683
|
+
3. Use venv method instead: npx rapidkit ${v.basename(t)} --install-method=venv`))}}i.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:p}=await Promise.resolve().then(()=>(wt(),Ot));if(!await p()&&!r){i.start("Installing RapidKit globally with pipx for CLI access");let u=await xt(i,o);try{await st(u,["install","rapidkit-core"]),i.succeed("RapidKit installed globally");}catch(k){i.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),g.debug(`pipx install failed: ${k}`);}}}catch(p){g.debug(`Global install check skipped: ${p}`);}}async function Vt(t,e,i,r,n,o=false){i.start(`Checking Python ${e}`);let a=kt();try{let{stdout:c}=await execa(a,["--version"]),d=c.match(/Python (\d+\.\d+)/)?.[1];if(d&&parseFloat(d)<parseFloat(e))throw new it(e,d);i.succeed(`Python ${d} found`);}catch(c){throw c instanceof it?c:new it(e)}i.start("Creating virtual environment");try{await execa(a,["-m","venv",".venv"],{cwd:t}),i.succeed("Virtual environment created");}catch(c){if(i.fail("Failed to create virtual environment"),(p=>typeof p=="object"&&p!==null&&"stdout"in p&&typeof p.stdout=="string")(c)&&c.stdout.includes("ensurepip is not")){let p=c.stdout.match(/apt install (python[\d.]+-venv)/),l=p?p[1]:"python3-venv";throw new A("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
663
684
|
|
|
664
685
|
On Debian/Ubuntu systems, install the venv package:
|
|
665
|
-
sudo apt install ${
|
|
686
|
+
sudo apt install ${l}
|
|
666
687
|
|
|
667
688
|
Or use Poetry instead (recommended):
|
|
668
|
-
npx rapidkit ${
|
|
669
|
-
|
|
689
|
+
npx rapidkit ${v.basename(t)} --yes`))}throw new A("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}i.start("Installing RapidKit");let s=v.join(t,".venv",process.platform==="win32"?"Scripts":"bin",process.platform==="win32"?"python.exe":"python");if(await execa(s,["-m","pip","install","--upgrade","pip"],{cwd:t}),r){let c=ft(n||{});if(!c)throw new A("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));g.debug(`Installing from local path: ${c}`),i.text="Installing RapidKit from local path (test mode)",await execa(s,["-m","pip","install","-e",c],{cwd:t});}else {i.text="Installing RapidKit from PyPI";let c=false,d=null;for(let p=1;p<=3;p++)try{await execa(s,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*p}),c=!0;break}catch(l){d=l,g.debug(`pip install attempt ${p} failed: ${l}`),p<3&&(i.text=`Retrying installation (attempt ${p+1}/3)`,await new Promise(u=>setTimeout(u,2e3)));}if(!c){let p=d?.stderr||d?.message||"Unknown error";throw g.debug(`All pip install attempts failed. Last error: ${p}`),p.includes("Could not find")||p.includes("No matching distribution")?new rt:new A("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
690
|
+
Error: ${p}
|
|
691
|
+
|
|
692
|
+
Possible solutions:
|
|
693
|
+
1. Check your internet connection
|
|
694
|
+
2. Try installing manually: cd ${v.basename(t)} && .venv/bin/python -m pip install rapidkit-core
|
|
695
|
+
3. Use Poetry instead: npx rapidkit ${v.basename(t)} --install-method=poetry`))}}i.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await Promise.resolve().then(()=>(wt(),Ot));if(!await c()&&!r){i.start("Installing RapidKit globally with pipx for CLI access");let p=await xt(i,o);try{await st(p,["install","rapidkit-core"]),i.succeed("RapidKit installed globally");}catch(l){i.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),g.debug(`pipx install failed: ${l}`);}}}catch(c){g.debug(`Global install check skipped: ${c}`);}}async function ve(t,e,i,r,n=false){let o=await xt(e,n);if(e.start("Installing RapidKit globally with pipx"),i){let a=ft(r||{});if(!a)throw new A("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));g.debug(`Installing from local path: ${a}`),e.text="Installing RapidKit from local path (test mode)",await st(o,["install","-e",a]);}else {e.text="Installing RapidKit from PyPI";try{await st(o,["install","rapidkit-core"]);}catch{throw new rt}}e.succeed("RapidKit installed globally"),await E.outputFile(v.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
696
|
+
`,"utf-8");}async function Q(t,e){let{skipGit:i=false,testMode:r=false,userConfig:n={},yes:o=false,installMethod:a,pythonVersion:s="3.10"}=e||{},c=a||n.defaultInstallMethod||"poetry";await ge(t,v.basename(t),c),await fe(t);let d=mt("Registering workspace").start();try{c==="poetry"?await ke(t,s,d,r,n,o):c==="venv"?await Vt(t,s,d,r,n):await ve(t,d,r,n,o),await he(t,c),await xe(t,c),d.succeed("Workspace registered");try{let{registerWorkspace:p}=await Promise.resolve().then(()=>(J(),H));await p(t,v.basename(t));}catch{}if(!i){d.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:t}),d.succeed("Git repository initialized");}catch{d.warn("Could not initialize git repository");}}}catch(p){throw d.fail("Failed to register workspace"),p}}async function xe(t,e){let n=`# RapidKit Workspace
|
|
670
697
|
|
|
671
698
|
This directory contains a RapidKit development environment.
|
|
672
699
|
|
|
673
700
|
## Installation Method
|
|
674
701
|
|
|
675
|
-
**${
|
|
702
|
+
**${e==="poetry"?"Poetry":e==="venv"?"Python venv + pip":"pipx (global)"}**
|
|
676
703
|
|
|
677
704
|
## Getting Started
|
|
678
705
|
|
|
@@ -681,10 +708,10 @@ This directory contains a RapidKit development environment.
|
|
|
681
708
|
This workspace includes a local launcher script so you can run the Python Core CLI without activating the environment:
|
|
682
709
|
|
|
683
710
|
\`\`\`bash
|
|
684
|
-
${
|
|
711
|
+
${e==="poetry"?`# No activation needed (recommended):
|
|
685
712
|
./rapidkit --help
|
|
686
713
|
# or:
|
|
687
|
-
poetry run rapidkit --help`:
|
|
714
|
+
poetry run rapidkit --help`:e==="venv"?`# No activation needed (recommended):
|
|
688
715
|
./rapidkit --help
|
|
689
716
|
# or direct:
|
|
690
717
|
./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
|
|
@@ -695,8 +722,8 @@ poetry run rapidkit --help`:t==="venv"?`# No activation needed (recommended):
|
|
|
695
722
|
### 1. Activate Environment
|
|
696
723
|
|
|
697
724
|
\`\`\`bash
|
|
698
|
-
${
|
|
699
|
-
# Or simply use: poetry run rapidkit <command>`:
|
|
725
|
+
${e==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
726
|
+
# Or simply use: poetry run rapidkit <command>`:e==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)"}
|
|
700
727
|
\`\`\`
|
|
701
728
|
|
|
702
729
|
### 2. Create Your First Project
|
|
@@ -763,8 +790,8 @@ For full documentation, visit: [RapidKit Docs](https://getrapidkit.com) *(or app
|
|
|
763
790
|
## Workspace Structure
|
|
764
791
|
|
|
765
792
|
\`\`\`
|
|
766
|
-
${
|
|
767
|
-
${
|
|
793
|
+
${e==="venv"?".venv/ # Python virtual environment":""}
|
|
794
|
+
${e==="poetry"?"pyproject.toml # Poetry configuration":""}
|
|
768
795
|
my-project/ # Your RapidKit projects go here
|
|
769
796
|
README.md # This file
|
|
770
797
|
\`\`\`
|
|
@@ -777,7 +804,7 @@ If you encounter issues:
|
|
|
777
804
|
2. Check RapidKit installation: \`rapidkit --version\`
|
|
778
805
|
3. Run diagnostics: \`rapidkit doctor\`
|
|
779
806
|
4. Visit RapidKit documentation or GitHub issues
|
|
780
|
-
`;await promises.writeFile(
|
|
807
|
+
`;await promises.writeFile(v.join(t,"README.md"),n,"utf-8");}async function pi(t,e,i){let r=mt("Creating demo workspace").start();try{await E.ensureDir(t),r.succeed("Directory created"),r.start("Setting up demo kit generator");let n=JSON.stringify({name:`${e}-workspace`,version:"1.0.0",private:!0,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(v.join(t,"package.json"),n,"utf-8"),await promises.writeFile(v.join(t,"generate-demo.js"),`#!/usr/bin/env node
|
|
781
808
|
/**
|
|
782
809
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
783
810
|
*
|
|
@@ -1173,7 +1200,7 @@ venv/
|
|
|
1173
1200
|
}
|
|
1174
1201
|
|
|
1175
1202
|
main().catch(console.error);
|
|
1176
|
-
`,"utf-8");try{await execa("chmod",["+x",
|
|
1203
|
+
`,"utf-8");try{await execa("chmod",["+x",v.join(t,"generate-demo.js")]);}catch{}let a=`# RapidKit Demo Workspace
|
|
1177
1204
|
|
|
1178
1205
|
Welcome to your RapidKit demo workspace! This environment lets you generate FastAPI demo projects using bundled RapidKit templates, without needing to install Python RapidKit.
|
|
1179
1206
|
|
|
@@ -1244,7 +1271,7 @@ pipx install rapidkit
|
|
|
1244
1271
|
## \u{1F6E0}\uFE0F Workspace Structure
|
|
1245
1272
|
|
|
1246
1273
|
\`\`\`
|
|
1247
|
-
${
|
|
1274
|
+
${e}/
|
|
1248
1275
|
\u251C\u2500\u2500 generate-demo.js # Demo project generator
|
|
1249
1276
|
\u251C\u2500\u2500 README.md # This file
|
|
1250
1277
|
\u2514\u2500\u2500 my-api/ # Your generated projects go here
|
|
@@ -1260,7 +1287,7 @@ ${t}/
|
|
|
1260
1287
|
---
|
|
1261
1288
|
|
|
1262
1289
|
**Generated with RapidKit** | [GitHub](https://github.com/getrapidkit/rapidkit-npm)
|
|
1263
|
-
`;if(await promises.writeFile(
|
|
1290
|
+
`;if(await promises.writeFile(v.join(t,"README.md"),a,"utf-8"),r.succeed("Demo workspace setup complete"),!i){r.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await E.outputFile(v.join(t,".gitignore"),`# Dependencies
|
|
1264
1291
|
node_modules/
|
|
1265
1292
|
|
|
1266
1293
|
# Generated projects
|
|
@@ -1273,19 +1300,19 @@ __pycache__/
|
|
|
1273
1300
|
*.pyc
|
|
1274
1301
|
.venv/
|
|
1275
1302
|
.env
|
|
1276
|
-
`,"utf-8"),await execa("git",["add","."],{cwd:
|
|
1303
|
+
`,"utf-8"),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t}),r.succeed("Git repository initialized");}catch{r.warn("Could not initialize git repository");}}console.log(m.green(`
|
|
1277
1304
|
\u2728 Demo workspace created successfully!
|
|
1278
|
-
`)),console.log(
|
|
1279
|
-
`)),console.log(
|
|
1305
|
+
`)),console.log(m.cyan("\u{1F4C2} Location:"),m.white(t)),console.log(m.cyan(`\u{1F680} Get started:
|
|
1306
|
+
`)),console.log(m.white(` cd ${e}`)),console.log(m.white(" node generate-demo.js my-api")),console.log(m.white(" cd my-api")),console.log(m.white(" rapidkit init")),console.log(m.white(" rapidkit dev")),console.log(),console.log(m.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(m.cyan(" pipx install rapidkit")),console.log();}catch(n){throw r.fail("Failed to create demo workspace"),n}}async function di(t,e,i,r){console.log(m.cyan(`
|
|
1280
1307
|
\u{1F50D} Dry-run mode - showing what would be created:
|
|
1281
|
-
`)),console.log(
|
|
1282
|
-
\u{1F4DD} Files to create:`)),console.log(
|
|
1283
|
-
\u{1F3AF} Capabilities:`)),console.log(
|
|
1284
|
-
\u2699\uFE0F Configuration:`)),console.log(
|
|
1285
|
-
\u{1F4DD} Files to create:`)),console.log(
|
|
1286
|
-
\u{1F3AF} Next steps after creation:`)),console.log(
|
|
1308
|
+
`)),console.log(m.white("\u{1F4C2} Project path:"),t),console.log(m.white("\u{1F4E6} Project type:"),i?"Demo workspace":"Full RapidKit environment"),i?(console.log(m.white(`
|
|
1309
|
+
\u{1F4DD} Files to create:`)),console.log(m.gray(" - package.json")),console.log(m.gray(" - generate-demo.js (project generator)")),console.log(m.gray(" - README.md")),console.log(m.gray(" - .gitignore")),console.log(m.white(`
|
|
1310
|
+
\u{1F3AF} Capabilities:`)),console.log(m.gray(" - Generate multiple FastAPI demo projects")),console.log(m.gray(" - No Python RapidKit installation required")),console.log(m.gray(" - Bundled templates included"))):(console.log(m.white(`
|
|
1311
|
+
\u2699\uFE0F Configuration:`)),console.log(m.gray(` - Python version: ${r.pythonVersion||"3.10"}`)),console.log(m.gray(` - Install method: ${r.defaultInstallMethod||"poetry"}`)),console.log(m.gray(` - Git initialization: ${r.skipGit?"No":"Yes"}`)),console.log(m.white(`
|
|
1312
|
+
\u{1F4DD} Files to create:`)),console.log(m.gray(" - pyproject.toml (Poetry) or .venv/ (venv)")),console.log(m.gray(" - README.md")),console.log(m.gray(" - .gitignore")),console.log(m.white(`
|
|
1313
|
+
\u{1F3AF} Next steps after creation:`)),console.log(m.gray(" 1. Install RapidKit Python package")),console.log(m.gray(" 2. Create projects with rapidkit CLI")),console.log(m.gray(" 3. Add modules and customize"))),console.log(m.white(`
|
|
1287
1314
|
\u{1F4A1} To proceed with actual creation, run without --dry-run flag
|
|
1288
|
-
`));}
|
|
1315
|
+
`));}$();pt();var gi=fileURLToPath(import.meta.url),fi=v.dirname(gi);function hi(t=32){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=mi.randomBytes(t),r="";for(let n=0;n<t;n++)r+=e[i[n]%e.length];return r}async function je(t,e){let r=(e.template||"fastapi")==="fastapi",n=r?"FastAPI":"NestJS",o=mt(`Generating ${n} project...`).start();try{let a=v.resolve(fi,".."),s=r?"fastapi-standard":"nestjs-standard",c=v.join(a,"templates","kits",s),d=li.configure(c,{autoescape:!1,trimBlocks:!0,lstripBlocks:!0});d.addFilter("generate_secret",function(f,w=32){return hi(w)});let p={project_name:e.project_name,author:e.author||"RapidKit User",description:e.description||(r?"FastAPI service generated with RapidKit":"NestJS application generated with RapidKit"),app_version:e.app_version||"0.1.0",license:e.license||"MIT",package_manager:e.package_manager||"npm",created_at:new Date().toISOString(),rapidkit_version:M()},l;r?l=["src/main.py.j2","src/__init__.py.j2","src/cli.py.j2","src/routing/__init__.py.j2","src/routing/health.py.j2","src/modules/__init__.py.j2","tests/__init__.py.j2","README.md.j2","pyproject.toml.j2","Makefile.j2",".rapidkit/__init__.py.j2",".rapidkit/project.json.j2",".rapidkit/cli.py.j2",".rapidkit/rapidkit.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"]:l=["src/main.ts.j2","src/app.module.ts.j2","src/app.controller.ts.j2","src/app.service.ts.j2","src/config/configuration.ts.j2","src/config/validation.ts.j2","src/config/index.ts.j2","src/modules/index.ts.j2","src/examples/examples.module.ts.j2","src/examples/examples.controller.ts.j2","src/examples/examples.service.ts.j2","src/examples/dto/create-note.dto.ts.j2","test/app.controller.spec.ts.j2","test/examples.controller.spec.ts.j2","test/app.e2e-spec.ts.j2","test/jest-e2e.json.j2","package.json.j2","tsconfig.json.j2","tsconfig.build.json.j2","nest-cli.json.j2","jest.config.ts.j2","eslint.config.cjs.j2",".env.example.j2","docker-compose.yml.j2","Dockerfile.j2","README.md.j2",".rapidkit/project.json.j2",".rapidkit/rapidkit.j2",".rapidkit/rapidkit.cmd.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"];for(let f of l){let w=v.join(c,f);try{await promises.access(w);}catch{continue}let I=await promises.readFile(w,"utf-8"),W=d.renderString(I,p),G=f.replace(/\.j2$/,""),Pt=v.join(t,G);await promises.mkdir(v.dirname(Pt),{recursive:!0}),await promises.writeFile(Pt,W),(G.endsWith(".rapidkit/rapidkit")||G.endsWith(".rapidkit/cli.py")||G.endsWith(".rapidkit/activate")||G==="rapidkit")&&await promises.chmod(Pt,493);}if(r){let f=v.join(c,".rapidkit","context.json"),w=v.join(t,".rapidkit","context.json");try{await promises.mkdir(v.join(t,".rapidkit"),{recursive:!0}),await promises.copyFile(f,w);}catch{await promises.mkdir(v.join(t,".rapidkit"),{recursive:!0});let W=e.engine||"pip";await promises.writeFile(w,JSON.stringify({engine:W,created_by:"rapidkit-npm-fallback"},null,2));}}let u=r?`# Python
|
|
1289
1316
|
__pycache__/
|
|
1290
1317
|
*.py[cod]
|
|
1291
1318
|
*$py.class
|
|
@@ -1353,11 +1380,16 @@ Thumbs.db
|
|
|
1353
1380
|
|
|
1354
1381
|
# Coverage
|
|
1355
1382
|
coverage/
|
|
1356
|
-
`;if(await promises.writeFile(
|
|
1357
|
-
${
|
|
1358
|
-
|
|
1359
|
-
${
|
|
1360
|
-
${
|
|
1383
|
+
`;if(await promises.writeFile(v.join(t,".gitignore"),u),o.succeed(`${n} project generated!`),!e.skipGit){let f=mt("Initializing git repository...").start();try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m",`Initial commit: ${n} project via RapidKit`],{cwd:t}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}if(!r&&!e.skipInstall){let f=e.package_manager||"npm",w=mt(`Installing dependencies with ${f}...`).start();try{await execa(f,f==="yarn"?["install"]:f==="pnpm"?["install"]:["install"],{cwd:t}),w.succeed("Dependencies installed");}catch{w.warn(`Could not install dependencies. Run '${f} install' manually.`);}}let k=v.basename(t);console.log(`
|
|
1384
|
+
${m.yellow("\u26A0\uFE0F Limited offline mode:")} This project was created using basic templates.
|
|
1385
|
+
${m.gray("For full kit features, install Python 3.10+ and rapidkit-core:")}
|
|
1386
|
+
${m.cyan(" sudo apt install python3 python3-pip python3-venv")}
|
|
1387
|
+
${m.cyan(" pip install rapidkit-core")}
|
|
1388
|
+
`),console.log(r?`
|
|
1389
|
+
${m.green("\u2728 FastAPI project created successfully!")}
|
|
1390
|
+
|
|
1391
|
+
${m.bold("\u{1F4C2} Project structure:")}
|
|
1392
|
+
${t}/
|
|
1361
1393
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
1362
1394
|
\u251C\u2500\u2500 src/
|
|
1363
1395
|
\u2502 \u251C\u2500\u2500 main.py # FastAPI application
|
|
@@ -1368,12 +1400,12 @@ ${e}/
|
|
|
1368
1400
|
\u251C\u2500\u2500 pyproject.toml # Poetry configuration
|
|
1369
1401
|
\u2514\u2500\u2500 README.md
|
|
1370
1402
|
|
|
1371
|
-
${
|
|
1372
|
-
${
|
|
1373
|
-
${
|
|
1374
|
-
${
|
|
1403
|
+
${m.bold("\u{1F680} Get started:")}
|
|
1404
|
+
${m.cyan(`cd ${k}`)}
|
|
1405
|
+
${m.cyan("npx rapidkit init")} ${m.gray("# Install dependencies")}
|
|
1406
|
+
${m.cyan("npx rapidkit dev")} ${m.gray("# Start dev server")}
|
|
1375
1407
|
|
|
1376
|
-
${
|
|
1408
|
+
${m.bold("\u{1F4DA} Available commands:")}
|
|
1377
1409
|
npx rapidkit init # Install dependencies (poetry install)
|
|
1378
1410
|
npx rapidkit dev # Start dev server with hot reload
|
|
1379
1411
|
npx rapidkit start # Start production server
|
|
@@ -1381,13 +1413,13 @@ ${l.bold("\u{1F4DA} Available commands:")}
|
|
|
1381
1413
|
npx rapidkit lint # Lint code
|
|
1382
1414
|
npx rapidkit format # Format code
|
|
1383
1415
|
|
|
1384
|
-
${
|
|
1385
|
-
${
|
|
1416
|
+
${m.gray("Alternative: make dev, ./rapidkit dev, poetry run dev")}
|
|
1417
|
+
${m.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
1386
1418
|
`:`
|
|
1387
|
-
${
|
|
1419
|
+
${m.green("\u2728 NestJS project created successfully!")}
|
|
1388
1420
|
|
|
1389
|
-
${
|
|
1390
|
-
${
|
|
1421
|
+
${m.bold("\u{1F4C2} Project structure:")}
|
|
1422
|
+
${t}/
|
|
1391
1423
|
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
1392
1424
|
\u251C\u2500\u2500 src/
|
|
1393
1425
|
\u2502 \u251C\u2500\u2500 main.ts # Application entry point
|
|
@@ -1398,13 +1430,13 @@ ${e}/
|
|
|
1398
1430
|
\u251C\u2500\u2500 package.json # Dependencies
|
|
1399
1431
|
\u2514\u2500\u2500 README.md
|
|
1400
1432
|
|
|
1401
|
-
${
|
|
1402
|
-
${
|
|
1403
|
-
${
|
|
1404
|
-
${
|
|
1405
|
-
${
|
|
1433
|
+
${m.bold("\u{1F680} Get started:")}
|
|
1434
|
+
${m.cyan(`cd ${k}`)}
|
|
1435
|
+
${m.cyan("npx rapidkit init")} ${m.gray("# Install dependencies")}
|
|
1436
|
+
${m.cyan("cp .env.example .env")}
|
|
1437
|
+
${m.cyan("npx rapidkit dev")} ${m.gray("# Start dev server")}
|
|
1406
1438
|
|
|
1407
|
-
${
|
|
1439
|
+
${m.bold("\u{1F4DA} Available commands:")}
|
|
1408
1440
|
npx rapidkit init # Install dependencies
|
|
1409
1441
|
npx rapidkit dev # Start dev server with hot reload
|
|
1410
1442
|
npx rapidkit start # Start production server
|
|
@@ -1413,29 +1445,30 @@ ${l.bold("\u{1F4DA} Available commands:")}
|
|
|
1413
1445
|
npx rapidkit lint # Lint code
|
|
1414
1446
|
npx rapidkit format # Format code
|
|
1415
1447
|
|
|
1416
|
-
${
|
|
1448
|
+
${m.bold("\u{1F310} API endpoints:")}
|
|
1417
1449
|
http://localhost:8000/health # Health check
|
|
1418
1450
|
http://localhost:8000/docs # Swagger docs
|
|
1419
1451
|
http://localhost:8000/examples/notes # Example API
|
|
1420
1452
|
|
|
1421
|
-
${
|
|
1422
|
-
${
|
|
1423
|
-
`);}catch(
|
|
1424
|
-
Reason: ${
|
|
1453
|
+
${m.gray("Alternative: npm run start:dev, ./rapidkit dev")}
|
|
1454
|
+
${m.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
1455
|
+
`);}catch(a){throw o.fail(`Failed to generate ${n} project`),a}}function Ut(t){if(!t||typeof t!="object")return null;let e=t.code;return e==="PYTHON_NOT_FOUND"||e==="BRIDGE_VENV_BOOTSTRAP_FAILED"?e:null}function wi(t){let e=t.trim().toLowerCase();return e?e.startsWith("fastapi")?"fastapi":e.startsWith("nestjs")?"nestjs":null:null}function ki(t,e){let i=t.indexOf(e);if(i>=0&&i+1<t.length)return t[i+1];let r=t.find(n=>n.startsWith(`${e}=`));if(r)return r.slice(e.length+1)}async function Bt(t,e){if(t.includes("--json"))return process.stderr.write("RapidKit (npm) offline fallback does not support --json for `create` commands.\nInstall Python 3.10+ and retry the same command.\n"),1;if(t[0]!=="create")return 1;if(t[1]!=="project")return process.stderr.write(`RapidKit (npm) could not run the Python core engine for \`create\`.
|
|
1456
|
+
Reason: ${e}.
|
|
1425
1457
|
Install Python 3.10+ to use the interactive wizard and full kit catalog.
|
|
1426
|
-
`),1;let n=
|
|
1458
|
+
`),1;let n=t[2],o=t[3];if(!n||!o)return process.stderr.write(`Usage: rapidkit create project <kit> <name> [--output <dir>]
|
|
1427
1459
|
Tip: offline fallback supports only fastapi* and nestjs* kits.
|
|
1428
|
-
`),1;let
|
|
1429
|
-
Reason: ${
|
|
1460
|
+
`),1;let a=wi(n);if(!a)return process.stderr.write(`RapidKit (npm) could not run the Python core engine to create this kit.
|
|
1461
|
+
Reason: ${e}.
|
|
1430
1462
|
Requested kit: ${n}
|
|
1431
1463
|
Offline fallback only supports: fastapi.standard, nestjs.standard (and their shorthands).
|
|
1432
1464
|
Install Python 3.10+ to access all kits.
|
|
1433
|
-
`),1;let
|
|
1434
|
-
`),1;await
|
|
1435
|
-
`),1}}async function
|
|
1436
|
-
`),
|
|
1437
|
-
`),1)}
|
|
1438
|
-
`),1)}
|
|
1465
|
+
`),1;let s=ki(t,"--output")||process.cwd(),c=v.resolve(s,o),d=t.includes("--skip-git")||t.includes("--no-git"),p=t.includes("--skip-install");try{if(await E.ensureDir(v.dirname(c)),await E.pathExists(c))return process.stderr.write(`\u274C Directory "${c}" already exists
|
|
1466
|
+
`),1;let l="pip",u=bt(process.cwd());if(u)try{let{readWorkspaceMarker:k}=await Promise.resolve().then(()=>(Mt(),pe)),f=await k(u);f?.metadata?.npm?.installMethod&&(l=f.metadata.npm.installMethod,console.log(`[DEBUG] Detected workspace engine: ${l}`));}catch(k){console.log("[DEBUG] Failed to read workspace marker:",k);}else console.log("[DEBUG] No workspace found, using default engine: pip");if(await E.ensureDir(c),await je(c,{project_name:o,template:a,skipGit:d,skipInstall:p,engine:l}),u){let{syncWorkspaceProjects:k}=await Promise.resolve().then(()=>(J(),H));await k(u,!0);}return 0}catch(l){return process.stderr.write(`RapidKit (npm) offline fallback failed: ${l?.message??l}
|
|
1467
|
+
`),1}}async function vi(t){let e=new Set(["--yes","-y","--skip-git","--skip-install","--debug","--dry-run","--no-update-check","--create-workspace","--no-workspace"]);try{if(t[0]==="create"&&t[1]==="project"){let i=t.includes("--create-workspace"),r=t.includes("--no-workspace"),n=t.includes("--yes")||t.includes("-y"),o=t.includes("--skip-git")||t.includes("--no-git");if(!!!$t(process.cwd())){if(i)await Q(process.cwd(),{skipGit:o,yes:n,userConfig:await dt()});else if(!r)if(n)await Q(process.cwd(),{skipGit:o,yes:!0,userConfig:await dt()});else {let{createWs:c}=await Wt.prompt([{type:"confirm",name:"createWs",message:"This project will be created outside a RapidKit workspace. Create and register a workspace here?",default:!0}]);c&&await Q(process.cwd(),{skipGit:o,yes:!1,userConfig:await dt()});}}let s=t.filter(c=>{let d=c.split("=")[0];return !e.has(c)&&!e.has(d)});try{await nt();let c=await V(s,{cwd:process.cwd()});if(c===0){let d=bt(process.cwd());if(d){try{let l=t[3];if(l){let u=t.indexOf("--output"),k=u>=0?t[u+1]:".",f=v.resolve(process.cwd(),k,l),w=v.join(d,".python-version"),I=v.join(f,".python-version");if(N.existsSync(w)&&N.existsSync(f)){let W=N.readFileSync(w,"utf-8");N.writeFileSync(I,W.trim()+`
|
|
1468
|
+
`),g.debug(`Synced Python version ${W.trim()} from workspace to ${l}`);}}}catch(l){g.debug("Could not sync Python version from workspace:",l);}let{syncWorkspaceProjects:p}=await Promise.resolve().then(()=>(J(),H));await p(d,!0);}}return c}catch(c){let d=Ut(c);return d?await Bt(s,d):(process.stderr.write(`RapidKit (npm) failed to run the Python core engine: ${c?.message??c}
|
|
1469
|
+
`),1)}}if(t[0]==="create"&&t[1]!=="project")try{await nt();let i=await V(t,{cwd:process.cwd()});if(i===0){let r=bt(process.cwd());if(r){let{syncWorkspaceProjects:n}=await Promise.resolve().then(()=>(J(),H));await n(r,!0);}}return i}catch(i){let r=Ut(i);return r?await Bt(t,r):(process.stderr.write(`RapidKit (npm) failed to run the Python core engine: ${i?.message??i}
|
|
1470
|
+
`),1)}return await nt(),await V(t,{cwd:process.cwd()})}catch(i){let r=Ut(i);return r?await Bt(t,r):(process.stderr.write(`RapidKit (npm) failed to run the Python core engine: ${i?.message??i}
|
|
1471
|
+
`),1)}}var be=["init","dev","start","build","test","lint","format","create","help","--help","-h"];function xi(t){let e=t;for(;;){let i=v.join(e,".rapidkit","context.json");if(N.existsSync(i))return i;let r=v.dirname(e);if(r===e)break;e=r;}return null}function $t(t){let e=t;for(;;){let i=v.join(e,".rapidkit-workspace");if(N.existsSync(i))return i;let r=v.dirname(e);if(r===e)break;e=r;}return null}function bt(t){let e=t;for(;;){let i=v.join(e,".rapidkit-workspace");if(N.existsSync(i))return e;let r=v.dirname(e);if(r===e)break;e=r;}return null}async function ji(){let t=process.cwd(),e=process.argv.slice(2);if(e[0]==="create")return false;try{let c=e[0],d=!c||c==="--help"||c==="-h"||c==="help";if($t(t)&&d){let l=await V(c?["--help"]:[],{cwd:t});process.exit(l);}}catch{}try{let c=e[0],d=c==="shell"&&e[1]==="activate",p=c==="create",l=await qt(t,{cwd:t,timeoutMs:1200});if(l.ok&&l.data?.isRapidkitProject&&l.data.engine==="python"&&!d&&!p){let u=await V(process.argv.slice(2),{cwd:t});process.exit(u);}}catch{}let i=xi(t),r=process.platform==="win32",n=r?[v.join(t,"rapidkit.cmd"),v.join(t,"rapidkit"),v.join(t,".rapidkit","rapidkit.cmd"),v.join(t,".rapidkit","rapidkit")]:[v.join(t,"rapidkit"),v.join(t,".rapidkit","rapidkit")],o=null;for(let c of n)if(await E.pathExists(c)){o=c;break}let a=e[0],s=a==="create";if(o&&a&&be.includes(a)&&!s){g.debug(`Delegating to local CLI: ${o} ${e.join(" ")}`);let c=spawn(o,e,{stdio:"inherit",cwd:t,shell:r});return c.on("close",d=>{process.exit(d??0);}),c.on("error",d=>{g.error(`Failed to run local rapidkit: ${d.message}`),process.exit(1);}),true}if(i&&await E.pathExists(i))try{if((await E.readJson(i)).engine==="pip"){let d=e[0],l=process.platform==="win32"?[v.join(t,"rapidkit.cmd"),v.join(t,"rapidkit"),v.join(t,".rapidkit","rapidkit.cmd"),v.join(t,".rapidkit","rapidkit")]:[v.join(t,"rapidkit"),v.join(t,".rapidkit","rapidkit")],u=null;for(let f of l)if(await E.pathExists(f)){u=f;break}if(u&&d&&be.includes(d)){g.debug(`Delegating to local CLI (early detection): ${u} ${e.join(" ")}`);let f=spawn(u,e,{stdio:"inherit",cwd:t});return f.on("close",w=>process.exit(w??0)),f.on("error",w=>{g.error(`Failed to run local rapidkit: ${w.message}`),process.exit(1);}),!0}if(d==="shell"&&e[1]==="activate"){let f=`# RapidKit: activation snippet - eval "$(rapidkit shell activate)"
|
|
1439
1472
|
VENV='.venv'
|
|
1440
1473
|
if [ -f "$VENV/bin/activate" ]; then
|
|
1441
1474
|
. "$VENV/bin/activate"
|
|
@@ -1444,37 +1477,39 @@ elif [ -f "$VENV/bin/activate.fish" ]; then
|
|
|
1444
1477
|
fi
|
|
1445
1478
|
export RAPIDKIT_PROJECT_ROOT="$(pwd)"
|
|
1446
1479
|
export PATH="$(pwd)/.rapidkit:$(pwd):$PATH"
|
|
1447
|
-
`;console.log(
|
|
1480
|
+
`;console.log(m.green.bold(`
|
|
1448
1481
|
\u2705 Activation snippet \u2014 run the following to activate this project in your current shell:
|
|
1449
|
-
`)),console.log(
|
|
1482
|
+
`)),console.log(f),console.log(m.gray(`
|
|
1450
1483
|
\u{1F4A1} After activation you can run: rapidkit dev
|
|
1451
|
-
`)),process.exit(0);}let
|
|
1484
|
+
`)),process.exit(0);}let k=await V(e,{cwd:t});process.exit(k);}}catch{}return false}var Y=null,Rt=false,tt=new Command;async function bi(t){if(t.length===0)return false;let e=t[0],i=t[1];if(e==="shell"&&i==="activate"||e==="workspace")return false;if(t.includes("--tui"))return true;if(e==="--help"||e==="-h"||e==="help"||e==="--version"||e==="-V"||t.includes("--template")||t.includes("-t"))return false;let r=new Set(["--yes","-y","--skip-git","--skip-install","--debug","--dry-run","--no-update-check","--create-workspace","--no-workspace"]);if(t.some(o=>r.has(o)))return false;let n=await Tt();return n?n.has(e):!!(se.has(e)||t.length>1)}tt.name("rapidkit").description("Create RapidKit workspaces and projects").version(M());tt.addHelpText("beforeAll",`RapidKit
|
|
1452
1485
|
|
|
1453
1486
|
Global CLI
|
|
1454
1487
|
Create RapidKit workspaces and projects
|
|
1455
1488
|
|
|
1456
1489
|
Global Engine Commands
|
|
1457
1490
|
Access engine-level commands when inside a RapidKit workspace or via the core bridge
|
|
1458
|
-
`);
|
|
1491
|
+
`);tt.addHelpText("afterAll",`
|
|
1459
1492
|
Project Commands
|
|
1460
1493
|
rapidkit create
|
|
1461
1494
|
rapidkit init
|
|
1462
1495
|
rapidkit dev
|
|
1463
1496
|
|
|
1464
1497
|
Use "rapidkit help <command>" for more information.
|
|
1465
|
-
`);
|
|
1498
|
+
`);tt.argument("[name]","Name of the workspace or project directory").addOption(new Option("-t, --template <template>","Legacy: create a project with template (fastapi, nestjs) instead of a workspace").hideHelp()).option("-y, --yes","Skip prompts and use defaults").addOption(new Option("--skip-git","Skip git initialization").hideHelp()).addOption(new Option("--skip-install","Legacy: skip installing dependencies (template mode)").hideHelp()).option("--debug","Enable debug logging").addOption(new Option("--dry-run","Show what would be created without creating it").hideHelp()).addOption(new Option("--install-method <method>","Installation method: poetry, venv, or pipx").choices(["poetry","venv","pipx"]).hideHelp()).addOption(new Option("--create-workspace","When creating a project outside a workspace: create and register a workspace in the current directory").hideHelp()).addOption(new Option("--no-workspace","When creating a project outside a workspace: do not create a workspace").hideHelp()).option("--no-update-check","Skip checking for updates").action(async(t,e)=>{try{e.debug&&(g.setDebug(!0),g.debug("Debug mode enabled"));let i=await dt();g.debug("User config loaded",i),e.updateCheck!==!1&&await Yt(),console.log(m.blue.bold(`
|
|
1466
1499
|
\u{1F680} Welcome to RapidKit!
|
|
1467
|
-
`)),
|
|
1468
|
-
\u274C ${o.message}`),o.details&&
|
|
1469
|
-
`),process.exit(1)),o}let r=
|
|
1470
|
-
\u274C Directory "${
|
|
1500
|
+
`)),t||(Ri(),process.exit(0));try{zt(t);}catch(o){throw o instanceof F&&(g.error(`
|
|
1501
|
+
\u274C ${o.message}`),o.details&&g.warn(`\u{1F4A1} ${o.details}
|
|
1502
|
+
`),process.exit(1)),o}let r=v.resolve(process.cwd(),t);Y=r,await E.pathExists(r)&&(g.error(`
|
|
1503
|
+
\u274C Directory "${t}" already exists`),console.log(m.cyan(`
|
|
1471
1504
|
\u{1F4A1} Choose a different name or delete the existing directory.
|
|
1472
|
-
`)),process.exit(1));let n=!!
|
|
1505
|
+
`)),process.exit(1));let n=!!e.template;if(e.dryRun){console.log(m.cyan(`
|
|
1473
1506
|
\u{1F50D} Dry-run mode - showing what would be created:
|
|
1474
|
-
`)),console.log(
|
|
1475
|
-
`)),n){let o=String(
|
|
1476
|
-
|
|
1477
|
-
|
|
1507
|
+
`)),console.log(m.white("\u{1F4C2} Path:"),r),console.log(m.white("\u{1F4E6} Type:"),n?`Project (${e.template})`:"Workspace"),console.log();return}if(!e.yes&&!n?await Wt.prompt([{type:"input",name:"author",message:"Author name:",default:process.env.USER||"RapidKit User"}]):e.yes&&console.log(m.gray(`Using default values (--yes flag)
|
|
1508
|
+
`)),n){let o=String(e.template||"").trim(),a=o.toLowerCase(),s=a==="fastapi"?"fastapi.standard":a==="nestjs"?"nestjs.standard":o;if(!!!$t(process.cwd())){if(e.createWorkspace)await Q(process.cwd(),{skipGit:e.skipGit,yes:e.yes,userConfig:i});else if(!e.noWorkspace)if(e.yes)await Q(process.cwd(),{skipGit:e.skipGit,yes:!0,userConfig:i});else {let{createWs:u}=await Wt.prompt([{type:"confirm",name:"createWs",message:"This project will be created outside a RapidKit workspace. Create and register a workspace here?",default:!0}]);u&&await Q(process.cwd(),{skipGit:e.skipGit,yes:!1,userConfig:i});}}let d=["create","project",s,t,"--output",process.cwd(),"--install-essentials"],p=await V(d,{cwd:process.cwd()});p!==0&&process.exit(p);let l=$t(process.cwd());if(l){let u=v.dirname(l),k=v.join(u,".python-version"),f=v.join(r,".python-version");try{if(await E.pathExists(k)){let w=N.readFileSync(k,"utf-8");N.writeFileSync(f,w.trim()+`
|
|
1509
|
+
`),g.debug(`Synced Python version ${w.trim()} from workspace to project`);}}catch(w){g.debug("Could not sync Python version from workspace:",w);}}if(!e.skipInstall){let u=await V(["init",r],{cwd:process.cwd()});if(u!==0&&process.exit(u),l){let k=v.dirname(l),f=v.join(k,".python-version"),w=v.join(r,".python-version");try{if(await E.pathExists(f)){let I=N.readFileSync(f,"utf-8");N.writeFileSync(w,I.trim()+`
|
|
1510
|
+
`),g.debug(`Re-synced Python version ${I.trim()} after init`);}}catch(I){g.debug("Could not re-sync Python version after init:",I);}}}}else await ye(t,{skipGit:e.skipGit,dryRun:e.dryRun,yes:e.yes,userConfig:i,installMethod:e.installMethod});}catch(i){i instanceof F?(g.error(`
|
|
1511
|
+
\u274C ${i.message}`),i.details&&g.warn(`\u{1F4A1} ${i.details}`),g.debug("Error code:",i.code)):(g.error(`
|
|
1512
|
+
\u274C An unexpected error occurred:`),console.error(i)),process.exit(1);}finally{Y=null;}});tt.command("shell <action>").description("Shell helpers (activate virtualenv in current shell)").action(async t=>{t!=="activate"&&(console.log(m.red(`Unknown shell command: ${t}`)),process.exit(1));let e=process.cwd();function i(a){let s=a;for(;;){let c=v.join(s,".rapidkit","context.json");if(N.existsSync(c))return c;let d=v.dirname(s);if(d===s)break;s=d;}return null}let r=i(e);function n(a){let s=a;for(;;){let c=v.join(s,".venv"),d=v.join(s,".rapidkit","activate");if(N.existsSync(d)||N.existsSync(c))return {venv:c,activateFile:d};let p=v.dirname(s);if(p===s)break;s=p;}return null}let o=n(e);if(!r&&!o&&(console.log(m.red("No RapidKit project found to activate")),process.exit(1)),o){let a=`# RapidKit: activation snippet - eval "$(rapidkit shell activate)"
|
|
1478
1513
|
VENV='.venv'
|
|
1479
1514
|
if [ -f "$VENV/bin/activate" ]; then
|
|
1480
1515
|
. "$VENV/bin/activate"
|
|
@@ -1483,11 +1518,11 @@ elif [ -f "$VENV/bin/activate.fish" ]; then
|
|
|
1483
1518
|
fi
|
|
1484
1519
|
export RAPIDKIT_PROJECT_ROOT="$(pwd)"
|
|
1485
1520
|
export PATH="$(pwd)/.rapidkit:$(pwd):$PATH"
|
|
1486
|
-
`;console.log(
|
|
1521
|
+
`;console.log(m.green.bold(`
|
|
1487
1522
|
\u2705 Activation snippet \u2014 run the following to activate this project in your current shell:
|
|
1488
|
-
`)),console.log(
|
|
1523
|
+
`)),console.log(a),console.log(m.gray(`
|
|
1489
1524
|
\u{1F4A1} After activation you can run: rapidkit dev
|
|
1490
|
-
`)),process.exit(0);}try{(await
|
|
1525
|
+
`)),process.exit(0);}try{(await E.readJson(r)).engine!=="pip"&&(console.log(m.yellow("This project is not a pip-based RapidKit project.")),process.exit(1)),console.log(`# RapidKit: activation snippet - eval "$(rapidkit shell activate)"
|
|
1491
1526
|
VENV='.venv'
|
|
1492
1527
|
if [ -f "$VENV/bin/activate" ]; then
|
|
1493
1528
|
. "$VENV/bin/activate"
|
|
@@ -1496,7 +1531,7 @@ elif [ -f "$VENV/bin/activate.fish" ]; then
|
|
|
1496
1531
|
fi
|
|
1497
1532
|
export RAPIDKIT_PROJECT_ROOT="$(pwd)"
|
|
1498
1533
|
export PATH="$(pwd)/.rapidkit:$(pwd):$PATH"
|
|
1499
|
-
`),process.exit(0);}catch{console.log(
|
|
1534
|
+
`),process.exit(0);}catch{console.log(m.yellow("Could not read project context but found a venv or activation file \u2014 printing activation snippet")),console.log(`# RapidKit: activation snippet - eval "$(rapidkit shell activate)"
|
|
1500
1535
|
VENV='.venv'
|
|
1501
1536
|
if [ -f "$VENV/bin/activate" ]; then
|
|
1502
1537
|
. "$VENV/bin/activate"
|
|
@@ -1505,13 +1540,13 @@ elif [ -f "$VENV/bin/activate.fish" ]; then
|
|
|
1505
1540
|
fi
|
|
1506
1541
|
export RAPIDKIT_PROJECT_ROOT="$(pwd)"
|
|
1507
1542
|
export PATH="$(pwd):$PATH"
|
|
1508
|
-
`),process.exit(0);}});
|
|
1509
|
-
`)),console.log(
|
|
1510
|
-
`)),console.log(
|
|
1511
|
-
`)),console.log(
|
|
1512
|
-
`)),console.log(
|
|
1513
|
-
`));}process.on("SIGINT",async()=>{if(!
|
|
1514
|
-
|
|
1515
|
-
\u26A0\uFE0F Interrupted by user`)),
|
|
1516
|
-
`),
|
|
1517
|
-
`),i){let r=await
|
|
1543
|
+
`),process.exit(0);}});tt.command("workspace <action>").description("Manage RapidKit workspaces (list, sync)").action(async t=>{if(t==="list"){let{listWorkspaces:e}=await Promise.resolve().then(()=>(J(),H));await e();}else if(t==="sync"){let e=bt(process.cwd());e||(console.log(m.red("\u274C Not inside a RapidKit workspace")),console.log(m.gray("\u{1F4A1} Run this command from within a workspace directory")),process.exit(1));let{syncWorkspaceProjects:i}=await Promise.resolve().then(()=>(J(),H));console.log(m.cyan(`\u{1F4C2} Scanning workspace: ${v.basename(e)}`)),await i(e);}else console.log(m.red(`Unknown workspace action: ${t}`)),console.log(m.gray("Available: list, sync")),process.exit(1);});function Ri(){console.log(m.white(`Usage:
|
|
1544
|
+
`)),console.log(m.cyan(" npx rapidkit <workspace-name> [options]")),console.log(m.cyan(` npx rapidkit create <...>
|
|
1545
|
+
`)),console.log(m.bold("Recommended workflow:")),console.log(m.cyan(" npx rapidkit my-workspace")),console.log(m.cyan(" cd my-workspace")),console.log(m.cyan(" npx rapidkit create project fastapi.standard my-api --output .")),console.log(m.cyan(" cd my-api")),console.log(m.cyan(` npx rapidkit init && npx rapidkit dev
|
|
1546
|
+
`)),console.log(m.bold("Options (workspace creation):")),console.log(m.gray(" -y, --yes Skip prompts and use defaults")),console.log(m.gray(" --skip-git Skip git initialization")),console.log(m.gray(" --debug Enable debug logging")),console.log(m.gray(" --dry-run Show what would be created")),console.log(m.gray(" --create-workspace When creating a project outside a workspace: create and register a workspace in the current directory")),console.log(m.gray(" --no-workspace When creating a project outside a workspace: do not create a workspace")),console.log(m.gray(` --no-update-check Skip checking for updates
|
|
1547
|
+
`)),console.log(m.gray(`Tip: set RAPIDKIT_SHOW_LEGACY=1 to show legacy template flags in help.
|
|
1548
|
+
`));}process.on("SIGINT",async()=>{if(!Rt){if(Rt=true,console.log(m.yellow(`
|
|
1549
|
+
|
|
1550
|
+
\u26A0\uFE0F Interrupted by user`)),Y&&await E.pathExists(Y)){console.log(m.gray("Cleaning up partial installation..."));try{await E.remove(Y),console.log(m.green("\u2713 Cleanup complete"));}catch(t){g.debug("Cleanup failed:",t);}}process.exit(130);}});process.on("SIGTERM",async()=>{if(!Rt){if(Rt=true,g.debug("Received SIGTERM"),Y&&await E.pathExists(Y))try{await E.remove(Y);}catch(t){g.debug("Cleanup failed:",t);}process.exit(143);}});ji().then(async t=>{if(!t){let e=process.argv.slice(2);if(process.env.RAPIDKIT_NPM_DEBUG_ARGS==="1"&&process.stderr.write(`[rapidkit-npm] argv=${JSON.stringify(e)}
|
|
1551
|
+
`),e[0]==="create"){let r=await vi(e);process.exit(r);}let i=await bi(e);if(process.env.RAPIDKIT_NPM_DEBUG_ARGS==="1"&&process.stderr.write(`[rapidkit-npm] shouldForwardToCore=${i}
|
|
1552
|
+
`),i){let r=await V(e,{cwd:process.cwd()});process.exit(r);}tt.parse();}});export{vi as handleCreateOrFallback};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapidkit",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create RapidKit projects with a single command - The official CLI for RapidKit framework",
|
|
6
6
|
"keywords": [
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
+
"sync-kits": "bash scripts/sync-kits.sh",
|
|
30
31
|
"build": "tsup",
|
|
31
32
|
"build:watch": "tsup --watch",
|
|
32
33
|
"dev": "tsup --watch",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapidkit",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create RapidKit projects with a single command - The official CLI for RapidKit framework",
|
|
6
6
|
"keywords": [
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"scripts": {
|
|
30
|
+
"sync-kits": "bash scripts/sync-kits.sh",
|
|
30
31
|
"build": "tsup",
|
|
31
32
|
"build:watch": "tsup --watch",
|
|
32
33
|
"dev": "tsup --watch",
|