@beeblock/svelar 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli/bin.js +1 -1
  2. package/package.json +1 -1
package/dist/cli/bin.js CHANGED
@@ -5853,4 +5853,4 @@ export class EventServiceProvider extends BaseProvider {
5853
5853
  `);return}let c=r(process.cwd(),".env");if(!n(c)){let p=r(process.cwd(),".env.example");if(n(p)){let f=i(p,"utf-8");f=f.replace(/^APP_KEY=.*$/m,`APP_KEY=${o}`),a(c,f),this.success("Application key set (created .env from .env.example).")}else a(c,`APP_KEY=${o}
5854
5854
  `),this.success("Application key set (created .env).");return}let u=i(c,"utf-8"),d=u.match(/^APP_KEY=(.*)$/m);if(d&&d[1]&&d[1]!=="change-me-to-a-random-string"&&!t.force){this.warn("APP_KEY already set. Use --force to overwrite.");return}if(d){let p=u.replace(/^APP_KEY=.*$/m,`APP_KEY=${o}`);a(c,p)}else a(c,`APP_KEY=${o}
5855
5855
  ${u}`);this.success("Application key set.")}};var ns=class extends h{name="plugin:list";description="List all discovered and enabled plugins";arguments=[];flags=[];async handle(e,t){try{let{PluginRegistry:s}=await Promise.resolve().then(()=>(is(),Sr)),r=s;await r.discover();let n=r.list();if(n.length===0){this.info("No plugins discovered.");return}let i=["Name","Version","Description","Status","Config","Migrations"],a=n.map(o=>[o.name,o.version,o.description||"-",o.enabled?"\u2713 Enabled":" Disabled",o.hasConfig?"\u2713":"-",o.hasMigrations?"\u2713":"-"]);this.newLine(),this.table(i,a),this.newLine(),this.info(`Total: ${n.length} plugin(s)`)}catch(s){this.error(`Failed to list plugins: ${s?.message??String(s)}`)}}};var as=class extends h{name="plugin:publish";description="Publish a plugin's config and migration files";arguments=["name"];flags=[{name:"force",alias:"f",description:"Overwrite existing files",type:"boolean"},{name:"only",alias:"o",description:"Publish only config|migrations|assets",type:"string"}];async handle(e,t){let s=e[0];if(!s){this.error("Please provide a plugin name.");return}try{let{PluginRegistry:r}=await Promise.resolve().then(()=>(is(),Sr)),{PluginPublisher:n}=await Promise.resolve().then(()=>(Er(),dn)),i=r,a=n;await i.discover();let o=i.get(s);if(!o){this.error(`Plugin "${s}" not found.`);return}let c=await this.loadPluginClass(o.packageName);if(!c){this.error(`Failed to load plugin class for "${s}".`);return}let u=new c,d={force:t.force||!1,only:t.only};this.info(`Publishing plugin: ${s}`);let p=await a.publish(u,d);this.newLine(),p.configs.length>0&&(this.success(`${p.configs.length} config file(s) published:`),p.configs.forEach(f=>this.log(` - ${f}`))),p.migrations.length>0&&(this.success(`${p.migrations.length} migration file(s) published:`),p.migrations.forEach(f=>this.log(` - ${f}`))),p.assets.length>0&&(this.success(`${p.assets.length} asset file(s) published:`),p.assets.forEach(f=>this.log(` - ${f}`))),p.configs.length===0&&p.migrations.length===0&&p.assets.length===0&&this.warn("No publishable files found for this plugin."),this.newLine()}catch(r){this.error(`Failed to publish plugin: ${r?.message??String(r)}`)}}async loadPluginClass(e){try{let t=await import(e);return t.default||Object.values(t)[0]}catch{return null}}};var os=class extends h{name="plugin:install";description="Install a plugin from npm";arguments=["package"];flags=[{name:"no-publish",alias:"n",description:"Skip auto-publishing plugin assets",type:"boolean"}];async handle(e,t){let s=e[0];if(!s){this.error("Please provide a package name.");return}try{let{PluginInstaller:r}=await Promise.resolve().then(()=>(mn(),un)),n=r;this.info(`Installing plugin package: ${s}`),this.newLine();let i=await n.install(s,{publish:!t["no-publish"]});this.newLine(),i.success?(this.success(`Plugin installed: ${i.pluginName} (v${i.version})`),i.published&&(i.published.configs.length>0&&this.info(`${i.published.configs.length} config file(s) published`),i.published.migrations.length>0&&this.info(`${i.published.migrations.length} migration file(s) published`),i.published.assets.length>0&&this.info(`${i.published.assets.length} asset file(s) published`)),this.newLine(),this.log("You can now use the plugin in your application by registering it in your app bootstrap code.")):this.error(`Failed to install plugin: ${i.error}`),this.newLine()}catch(r){this.error(`Installation error: ${r?.message??String(r)}`)}}};var pn=$r(process.cwd(),".env");if(wo(pn))for(let l of fn(pn,"utf-8").split(`
5856
- `)){let e=l.trim();if(!e||e.startsWith("#"))continue;let t=e.indexOf("=");if(t===-1)continue;let s=e.slice(0,t).trim(),r=e.slice(t+1).trim();(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),s in process.env||(process.env[s]=r)}var xo=hn(gn(import.meta.url));bo(vo($r(xo,"ts-resolve-hook.mjs")).href,import.meta.url);var Co=hn(gn(import.meta.url)),Po=$r(Co,"..","package.json"),So=JSON.parse(fn(Po,"utf-8")),b=new ze(So.version);b.register(ts);b.register(ss);b.register(Ke);b.register(We);b.register(Je);b.register(Ve);b.register(Qe);b.register(Ge);b.register(Ye);b.register(Xe);b.register(Ze);b.register(et);b.register(dt);b.register(ut);b.register(tt);b.register(st);b.register(rt);b.register(it);b.register(nt);b.register(at);b.register(ot);b.register(lt);b.register(ct);b.register(mt);b.register(pt);b.register(ht);b.register(gt);b.register(ft);b.register(yt);b.register(vt);b.register(xt);b.register(St);b.register(Tt);b.register(Rt);b.register(Et);b.register(es);b.register(ns);b.register(as);b.register(os);async function To(){let{join:l}=await import("path"),{existsSync:e,readdirSync:t}=await import("fs"),{pathToFileURL:s}=await import("url"),r=l(process.cwd(),"src","lib","shared","commands");if(!e(r))return;let n=t(r).filter(i=>(i.endsWith(".ts")||i.endsWith(".js"))&&!i.startsWith("."));for(let i of n)try{let a=l(r,i),c=await import(s(a).href),u=c.default??Object.values(c).find(d=>typeof d=="function"&&d.prototype&&"handle"in d.prototype);u&&typeof u=="function"&&b.add(new u)}catch{}}To().then(()=>b.run());
5856
+ `)){let e=l.trim();if(!e||e.startsWith("#"))continue;let t=e.indexOf("=");if(t===-1)continue;let s=e.slice(0,t).trim(),r=e.slice(t+1).trim();(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),s in process.env||(process.env[s]=r)}var xo=hn(gn(import.meta.url));bo(vo($r(xo,"ts-resolve-hook.mjs")).href,import.meta.url);var Co=hn(gn(import.meta.url)),Po=$r(Co,"..","..","package.json"),So=JSON.parse(fn(Po,"utf-8")),b=new ze(So.version);b.register(ts);b.register(ss);b.register(Ke);b.register(We);b.register(Je);b.register(Ve);b.register(Qe);b.register(Ge);b.register(Ye);b.register(Xe);b.register(Ze);b.register(et);b.register(dt);b.register(ut);b.register(tt);b.register(st);b.register(rt);b.register(it);b.register(nt);b.register(at);b.register(ot);b.register(lt);b.register(ct);b.register(mt);b.register(pt);b.register(ht);b.register(gt);b.register(ft);b.register(yt);b.register(vt);b.register(xt);b.register(St);b.register(Tt);b.register(Rt);b.register(Et);b.register(es);b.register(ns);b.register(as);b.register(os);async function To(){let{join:l}=await import("path"),{existsSync:e,readdirSync:t}=await import("fs"),{pathToFileURL:s}=await import("url"),r=l(process.cwd(),"src","lib","shared","commands");if(!e(r))return;let n=t(r).filter(i=>(i.endsWith(".ts")||i.endsWith(".js"))&&!i.startsWith("."));for(let i of n)try{let a=l(r,i),c=await import(s(a).href),u=c.default??Object.values(c).find(d=>typeof d=="function"&&d.prototype&&"handle"in d.prototype);u&&typeof u=="function"&&b.add(new u)}catch{}}To().then(()=>b.run());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beeblock/svelar",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Laravel-inspired framework on top of SvelteKit 2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",