rapidkit 0.25.5 → 0.25.6

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.
@@ -0,0 +1,5 @@
1
+ import {a}from'./chunk-VM2TOHNX.js';import {execa}from'execa';import l from'chalk';import {createRequire}from'module';import {promises}from'fs';import m from'path';import f from'os';var v="rapidkit",w=createRequire(import.meta.url),A=w("../package.json"),i=A?.version??"0.0.0";function g(r){let e=r.trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return null;let t=e[4]?e[4].split(".").map(o=>o.match(/^\d+$/)?Number(o):o):[];return {major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),prerelease:t}}function b(r,n){let e=g(r),t=g(n);if(!e||!t)return 0;if(e.major!==t.major)return e.major>t.major?1:-1;if(e.minor!==t.minor)return e.minor>t.minor?1:-1;if(e.patch!==t.patch)return e.patch>t.patch?1:-1;if(e.prerelease.length===0&&t.prerelease.length===0)return 0;if(e.prerelease.length===0)return 1;if(t.prerelease.length===0)return -1;let o=Math.max(e.prerelease.length,t.prerelease.length);for(let u=0;u<o;u+=1){let a=e.prerelease[u],s=t.prerelease[u];if(a===void 0)return -1;if(s===void 0)return 1;if(a===s)continue;let d=typeof a=="number",h=typeof s=="number";return d&&h?a>s?1:-1:d?-1:h||String(a)>String(s)?1:-1}return 0}var C=14400*1e3;function k(){let r=process.env.RAPIDKIT_CACHE_DIR?.trim()||(process.env.VITEST_WORKER_ID?m.join(f.homedir(),".rapidkit","cache",`vitest-${process.env.VITEST_WORKER_ID}`):m.join(f.homedir(),".rapidkit","cache"));return m.join(r,"update-check.json")}async function _(){try{let r=await promises.readFile(k(),"utf-8"),n=JSON.parse(r);return typeof n.latestVersion=="string"&&typeof n.checkedAt=="number"&&n.currentVersion===i&&Date.now()-n.checkedAt<C?n:null}catch{return null}}async function U(r){try{let n=k();await promises.mkdir(m.dirname(n),{recursive:true}),await promises.writeFile(n,JSON.stringify({latestVersion:r,checkedAt:Date.now(),currentVersion:i}),"utf-8");}catch{}}async function S(){try{a.debug("Checking for updates...");let r=await _();if(r){let t=Math.round((Date.now()-r.checkedAt)/6e4);a.debug(`Update check: cache hit (${t}m old)`),b(r.latestVersion,i)>0&&(console.log(l.yellow(`
2
+ \u26A0\uFE0F Update available: ${i} \u2192 ${r.latestVersion}`)),console.log(l.cyan(`Run: npm install -g rapidkit@latest
3
+ `)));return}let{stdout:n}=await execa("npm",["view",v,"version"],{timeout:3e3}),e=n.trim();await U(e),e&&b(e,i)>0?(console.log(l.yellow(`
4
+ \u26A0\uFE0F Update available: ${i} \u2192 ${e}`)),console.log(l.cyan(`Run: npm install -g rapidkit@latest
5
+ `))):a.debug("You are using the latest version");}catch{a.debug("Could not check for updates");}}function x(){return i}export{S as a,x as b};
@@ -0,0 +1,2 @@
1
+ import o from'chalk';var s=class{debugEnabled=false;setDebug(n){this.debugEnabled=n;}debug(n,...e){this.debugEnabled&&console.log(o.gray(`[DEBUG] ${n}`),...e);}info(n,...e){console.log(o.blue(n),...e);}success(n,...e){console.log(o.green(n),...e);}warn(n,...e){console.log(o.yellow(n),...e);}error(n,...e){console.error(o.red(n),...e);}step(n,e,l){console.log(o.cyan(`
2
+ [${n}/${e}]`),o.white(l));}},i=new s;export{i as a};
@@ -0,0 +1,11 @@
1
+ import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import a from'path';import I from'os';import {pathToFileURL}from'url';var k=".rapidkitrc.json",K=["rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"];async function A(){let e=a.join(I.homedir(),k);try{let t=await promises.readFile(e,"utf-8"),n=JSON.parse(t);return a$1.debug(`Loaded config from ${e}`),n}catch{return a$1.debug("No user config found, using defaults"),{}}}async function O(e=process.cwd()){let t=e,n=a.parse(t).root;for(;t!==n;){for(let s of K){let i=a.join(t,s);try{await promises.access(i),a$1.debug(`Found config file: ${i}`);let c=await import(pathToFileURL(i).href),x=c.default||c;return a$1.debug(`Loaded RapidKit config from ${s}`),x}catch{continue}}t=a.dirname(t);}return a$1.debug("No RapidKit config file found, using defaults"),{}}function N(e,t,n){return {author:n.author||t.workspace?.defaultAuthor||e.author,pythonVersion:n.pythonVersion||t.workspace?.pythonVersion||e.pythonVersion,defaultInstallMethod:n.defaultInstallMethod||t.workspace?.installMethod||e.defaultInstallMethod,defaultKit:n.defaultKit||t.projects?.defaultKit||e.defaultKit,skipGit:n.skipGit??t.projects?.skipGit??e.skipGit,license:n.license||e.license,testRapidKitPath:n.testRapidKitPath||e.testRapidKitPath}}function v(e){return process.env.RAPIDKIT_DEV_PATH||e.testRapidKitPath||void 0}var o=class extends Error{constructor(n,s,i){super(n);this.code=s;this.details=i;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}},p=class extends o{constructor(t,n){let s=n?`Python ${t}+ required, found ${n}`:`Python ${t}+ not found`;super(s,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},d=class extends o{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},f=class extends o{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},u=class extends o{constructor(t){super(`Directory "${t}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},g=class extends o{constructor(t,n){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",n);}},h=class extends o{constructor(t,n){let s=`Installation failed at: ${t}`,i=`${n.message}
2
+
3
+ Troubleshooting:
4
+ - Check your internet connection
5
+ - Verify Python/Poetry installation
6
+ - Try running with --debug flag for more details`;super(s,"INSTALLATION_ERROR",i);}},m=class extends o{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
7
+ 1. Install Python 3.10+ and retry the same command
8
+ 2. Use the core workflow: npx rapidkit create workspace <name>
9
+ 3. Offline fallback (limited): npx rapidkit create project fastapi.standard <name> --output .
10
+
11
+ Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};export{A as a,O as b,N as c,v as d,o as e,p as f,d as g,f as h,u as i,g as j,h as k,m as l};