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.
- package/dist/chunk-Q7ULIFQA.js +5 -0
- package/dist/chunk-VM2TOHNX.js +2 -0
- package/dist/chunk-ZAZJEYYT.js +11 -0
- package/dist/create-27NVMJAR.js +776 -0
- package/dist/demo-kit-63CFMCPD.js +141 -0
- package/dist/doctor-P57TTWEP.js +38 -0
- package/dist/gofiber-standard-NQHMZTFK.js +1572 -0
- package/dist/gogin-standard-2G2C3VQL.js +1656 -0
- package/dist/index.js +167 -3568
- package/dist/package.json +1 -1
- package/dist/{workspace-KRZ3DWL4.js → workspace-VXNLNKCM.js} +5 -5
- package/package.json +1 -1
- package/dist/chunk-EDH5S5JF.js +0 -6
- package/dist/chunk-KAV65WZO.js +0 -786
- package/dist/create-PIVSRLDS.js +0 -1
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {j}from'./chunk-Z5LKRG57.js';import {b as b$1}from'./chunk-Q7ULIFQA.js';import {promises}from'fs';import d from'path';import r from'chalk';import w from'ora';import {execa}from'execa';function f(e){let t=d.resolve(e);return process.platform==="win32"?t.toLowerCase():t}function S(e){let t=f(e.path),i=Array.isArray(e.projects)?e.projects:[],a=[],o=new Set;for(let s of i){if(!s||typeof s.name!="string"||typeof s.path!="string")continue;let n=f(s.path);o.has(n)||(o.add(n),a.push({name:s.name,path:n}));}return {name:e.name,path:t,mode:e.mode,projects:a}}function v(e){let t=[],i=new Set;for(let a of e.workspaces||[]){if(!a||typeof a.name!="string"||typeof a.path!="string")continue;let o=S(a);i.has(o.path)||(i.add(o.path),t.push(o));}return {workspaces:t}}async function N(e,t){try{let i=f(e),a=j(),o=d.join(a,"workspaces.json");await promises.mkdir(a,{recursive:true});let s={workspaces:[]};try{let p=await promises.readFile(o,"utf8"),m=JSON.parse(p);m&&Array.isArray(m.workspaces)&&(s=v(m));}catch{}s.workspaces.some(p=>p.path===i)||(s.workspaces.push({name:t,path:i,mode:"full",projects:[]}),await promises.writeFile(o,JSON.stringify(s,null,2)));}catch{console.warn(r.gray("Note: Could not register workspace in shared registry"));}}async function J(e,t=false){try{let i=f(e),a=j(),o=d.join(a,"workspaces.json"),s={workspaces:[]};try{let c=await promises.readFile(o,"utf8"),g=JSON.parse(c);g&&Array.isArray(g.workspaces)&&(s=v(g));}catch{t||console.log("\u26A0\uFE0F Workspace registry not found");return}let n=s.workspaces.find(c=>c.path===i);if(!n){t||console.log("\u26A0\uFE0F Workspace not registered in registry");return}Array.isArray(n.projects)||(n.projects=[]);let p=await promises.readdir(e,{withFileTypes:true}),m=0,h=0;for(let c of p)if(c.isDirectory()&&!c.name.startsWith(".")){let g=f(d.join(e,c.name)),R=d.join(g,".rapidkit","context.json"),j=d.join(g,".rapidkit","project.json");try{let k=false;try{await promises.access(R),k=true;}catch{await promises.access(j),k=true;}k&&(n.projects.some(_=>_.path===g||_.name===c.name)?h++:(n.projects.push({name:c.name,path:g}),m++,t||console.log(`\u2714 Added: ${c.name}`)));}catch{}}m>0?(await promises.writeFile(o,JSON.stringify(s,null,2)),t||console.log(`
|
|
2
2
|
\u2705 Synced ${m} project(s) to registry`)):t||console.log(`
|
|
3
|
-
\u2705 All projects already registered (${h} found)`);}catch(i){t||console.error("\u274C Failed to sync projects:",i.message);}}async function K(e,t,i){try{let a=f(e),o=f(i),s=j(),n=d.join(s,"workspaces.json"),p={workspaces:[]};try{let c=await promises.readFile(n,"utf8"),g=JSON.parse(c);g&&Array.isArray(g.workspaces)&&(p=v(g));}catch{return}let m=p.workspaces.find(c=>c.path===a);if(!m)return;Array.isArray(m.projects)||(m.projects=[]),m.projects.some(c=>c.path===o||c.name===t)||(m.projects.push({name:t,path:o}),await promises.writeFile(n,JSON.stringify(p,null,2)));}catch{}}async function G(e,t){let i=w("Creating RapidKit workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(d.join(e,".rapidkit"),{recursive:true});let a={workspace_name:t.name,author:t.author,rapidkit_version:
|
|
3
|
+
\u2705 All projects already registered (${h} found)`);}catch(i){t||console.error("\u274C Failed to sync projects:",i.message);}}async function K(e,t,i){try{let a=f(e),o=f(i),s=j(),n=d.join(s,"workspaces.json"),p={workspaces:[]};try{let c=await promises.readFile(n,"utf8"),g=JSON.parse(c);g&&Array.isArray(g.workspaces)&&(p=v(g));}catch{return}let m=p.workspaces.find(c=>c.path===a);if(!m)return;Array.isArray(m.projects)||(m.projects=[]),m.projects.some(c=>c.path===o||c.name===t)||(m.projects.push({name:t,path:o}),await promises.writeFile(n,JSON.stringify(p,null,2)));}catch{}}async function G(e,t){let i=w("Creating RapidKit workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(d.join(e,".rapidkit"),{recursive:true});let a={workspace_name:t.name,author:t.author,rapidkit_version:b$1(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(d.join(e,".rapidkit","config.json"),JSON.stringify(a,null,2));let o=E();await promises.writeFile(d.join(e,"rapidkit"),o),await promises.chmod(d.join(e,"rapidkit"),493);let s=L();await promises.writeFile(d.join(e,"rapidkit.cmd"),s);let n=b(t.name);if(await promises.writeFile(d.join(e,"README.md"),n),await promises.writeFile(d.join(e,".gitignore"),`# RapidKit workspace
|
|
4
4
|
.env
|
|
5
5
|
.env.*
|
|
6
6
|
!.env.example
|
|
@@ -15,7 +15,7 @@ Thumbs.db
|
|
|
15
15
|
|
|
16
16
|
# Logs
|
|
17
17
|
*.log
|
|
18
|
-
`),await promises.writeFile(d.join(e,".rapidkit-workspace"),JSON.stringify({signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:
|
|
18
|
+
`),await promises.writeFile(d.join(e,".rapidkit-workspace"),JSON.stringify({signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:b$1(),createdAt:new Date().toISOString(),name:t.name},null,2)),await I(e),i.succeed("Workspace created!"),!t.skipGit){let m=w("Initializing git repository...").start();try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),m.succeed("Git repository initialized");}catch{m.warn("Could not initialize git repository");}}await N(e,t.name),console.log(`
|
|
19
19
|
${r.green("\u2728 RapidKit workspace created successfully!")}
|
|
20
20
|
|
|
21
21
|
${r.bold("\u{1F4C2} Workspace structure:")}
|
|
@@ -382,7 +382,7 @@ main() {
|
|
|
382
382
|
print_help
|
|
383
383
|
;;
|
|
384
384
|
version|-v|--version)
|
|
385
|
-
echo "RapidKit CLI (npm workspace) v${
|
|
385
|
+
echo "RapidKit CLI (npm workspace) v${b$1()}"
|
|
386
386
|
;;
|
|
387
387
|
*)
|
|
388
388
|
echo -e "\${RED}\u274C Unknown command: $cmd\${NC}"
|
|
@@ -462,7 +462,7 @@ npx rapidkit dev # Start dev server
|
|
|
462
462
|
|
|
463
463
|
- [RapidKit Documentation](https://rapidkit.dev)
|
|
464
464
|
- [GitHub Repository](https://github.com/Baziar/rapidkit)
|
|
465
|
-
`}async function I(e){let{fileURLToPath:t}=await import('url'),i=t(import.meta.url),a=d.dirname(i),o=d.resolve(a,".."),s=d.join(o,"templates","kits"),n=d.join(e,".rapidkit","templates"),{default:p}=await import('fs-extra');await p.copy(s,n);let m=d.join(o,"templates","generator.js"),h=d.join(e,".rapidkit","generator.js");await p.copy(m,h);}async function Y(e,t){let i=t.template==="fastapi",a=i?"FastAPI":"NestJS",o=w(`Creating ${a} project...`).start();try{let{fileURLToPath:s}=await import('url'),n=s(import.meta.url),p=d.dirname(n),m=d.resolve(p,".."),h=i?"fastapi-standard":"nestjs-standard",c
|
|
465
|
+
`}async function I(e){let{fileURLToPath:t}=await import('url'),i=t(import.meta.url),a=d.dirname(i),o=d.resolve(a,".."),s=d.join(o,"templates","kits"),n=d.join(e,".rapidkit","templates"),{default:p}=await import('fs-extra');await p.copy(s,n);let m=d.join(o,"templates","generator.js"),h=d.join(e,".rapidkit","generator.js");await p.copy(m,h);}async function Y(e,t){let i=t.template==="fastapi",a=i?"FastAPI":"NestJS",o=w(`Creating ${a} project...`).start();try{let{fileURLToPath:s}=await import('url'),n=s(import.meta.url),p=d.dirname(n),m=d.resolve(p,".."),h=i?"fastapi-standard":"nestjs-standard",c=d.join(m,"templates","kits",h);await promises.mkdir(e,{recursive:true});let g={project_name:i?t.name.replace(/-/g,"_").toLowerCase():t.name.replace(/_/g,"-").toLowerCase(),author:t.author,description:t.description||`${a} application generated with RapidKit`,app_version:"0.1.0",license:"MIT",package_manager:t.package_manager||"npm",created_at:new Date().toISOString(),rapidkit_version:b$1()};await x(c,e,g);let R=i?`# Python
|
|
466
466
|
__pycache__/
|
|
467
467
|
*.py[cod]
|
|
468
468
|
*$py.class
|
package/package.json
CHANGED
package/dist/chunk-EDH5S5JF.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import o from'chalk';import {execa}from'execa';import {createRequire}from'module';import {promises}from'fs';import p from'path';import b from'os';var d=class{debugEnabled=false;setDebug(r){this.debugEnabled=r;}debug(r,...e){this.debugEnabled&&console.log(o.gray(`[DEBUG] ${r}`),...e);}info(r,...e){console.log(o.blue(r),...e);}success(r,...e){console.log(o.green(r),...e);}warn(r,...e){console.log(o.yellow(r),...e);}error(r,...e){console.error(o.red(r),...e);}step(r,e,n){console.log(o.cyan(`
|
|
2
|
-
[${r}/${e}]`),o.white(n));}},l=new d;var E="rapidkit",U=createRequire(import.meta.url),_=U("../package.json"),i=_?.version??"0.0.0";function k(t){let e=t.trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return null;let n=e[4]?e[4].split(".").map(a=>a.match(/^\d+$/)?Number(a):a):[];return {major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),prerelease:n}}function w(t,r){let e=k(t),n=k(r);if(!e||!n)return 0;if(e.major!==n.major)return e.major>n.major?1:-1;if(e.minor!==n.minor)return e.minor>n.minor?1:-1;if(e.patch!==n.patch)return e.patch>n.patch?1:-1;if(e.prerelease.length===0&&n.prerelease.length===0)return 0;if(e.prerelease.length===0)return 1;if(n.prerelease.length===0)return -1;let a=Math.max(e.prerelease.length,n.prerelease.length);for(let u=0;u<a;u+=1){let s=e.prerelease[u],c=n.prerelease[u];if(s===void 0)return -1;if(c===void 0)return 1;if(s===c)continue;let h=typeof s=="number",f=typeof c=="number";return h&&f?s>c?1:-1:h?-1:f||String(s)>String(c)?1:-1}return 0}var R=14400*1e3;function y(){let t=process.env.RAPIDKIT_CACHE_DIR?.trim()||(process.env.VITEST_WORKER_ID?p.join(b.homedir(),".rapidkit","cache",`vitest-${process.env.VITEST_WORKER_ID}`):p.join(b.homedir(),".rapidkit","cache"));return p.join(t,"update-check.json")}async function j(){try{let t=await promises.readFile(y(),"utf-8"),r=JSON.parse(t);return typeof r.latestVersion=="string"&&typeof r.checkedAt=="number"&&r.currentVersion===i&&Date.now()-r.checkedAt<R?r:null}catch{return null}}async function N(t){try{let r=y();await promises.mkdir(p.dirname(r),{recursive:true}),await promises.writeFile(r,JSON.stringify({latestVersion:t,checkedAt:Date.now(),currentVersion:i}),"utf-8");}catch{}}async function M(){try{l.debug("Checking for updates...");let t=await j();if(t){let n=Math.round((Date.now()-t.checkedAt)/6e4);l.debug(`Update check: cache hit (${n}m old)`),w(t.latestVersion,i)>0&&(console.log(o.yellow(`
|
|
3
|
-
\u26A0\uFE0F Update available: ${i} \u2192 ${t.latestVersion}`)),console.log(o.cyan(`Run: npm install -g rapidkit@latest
|
|
4
|
-
`)));return}let{stdout:r}=await execa("npm",["view",E,"version"],{timeout:3e3}),e=r.trim();await N(e),e&&w(e,i)>0?(console.log(o.yellow(`
|
|
5
|
-
\u26A0\uFE0F Update available: ${i} \u2192 ${e}`)),console.log(o.cyan(`Run: npm install -g rapidkit@latest
|
|
6
|
-
`))):l.debug("You are using the latest version");}catch{l.debug("Could not check for updates");}}function J(){return i}export{l as a,M as b,J as c};
|