@arkstack/console 0.1.9 → 0.1.11
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/app.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{isAbsolute as t,join as n}from"node:path";import{CliApp as r}from"resora";import{existsSync as i}from"node:fs";const a=(e,r)=>{let i=e?.localStubsDir;return i?t(i)?i:n(process.cwd(),i):r?.stubsDir};var o=class extends r{core;options;constructor(e,t){super(),this.core=e,this.options=t}makeController=(t,r)=>{let o=t.endsWith(`Controller`)?t.replace(/controller/i,``):t,s=e.resolve(process.cwd(),`src`,`app/http/controllers`)
|
|
1
|
+
import e,{isAbsolute as t,join as n}from"node:path";import{CliApp as r}from"resora";import{existsSync as i}from"node:fs";const a=(e,r)=>{let i=e?.localStubsDir;return i?t(i)?i:n(process.cwd(),i):r?.stubsDir};var o=class extends r{core;options;constructor(e,t){super(),this.core=e,this.options=t}makeController=(t,r)=>{let o=t.endsWith(`Controller`)?t.replace(/controller/i,``):t,s=o.endsWith(`Controller`)?o:`${o}Controller`,c=n(e.resolve(process.cwd(),`src`,`app/http/controllers`),`${s}.${r?.ext??`ts`}`),l=a(this.config,this.options);l||(console.error(`Error: stubsDir is not configured. Set stubsDir in resora.config.js.`),process.exit(1));let u=n(l,r.model?this.config.stubs.model:r.api?this.config.stubs.api:this.config.stubs.controller);return i(u)||(console.error(`Error: Stub file ${u} not found.`),process.exit(1)),s=s.split(`/`).pop(),this.generateFile(u,c,{ControllerName:s,Model:r.model?.pascalCase(),ModelName:r.model?.camelCase(),Name:s.replace(/controller/i,``)},r),c};normalizePath=e=>e.replace(process.cwd(),``)};export{o as ArkstackConsoleApp,a as resolveStubsDir};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{ArkstackConsoleApp as e}from"./app.js";import{fileURLToPath as t,pathToFileURL as n}from"node:url";import{join as r}from"node:path";import{MakeResource as i}from"resora";import{realpathSync as a}from"node:fs";import{Command as o,Kernel as s}from"@h3ravel/musket";import{spawn as c}from"node:child_process";import{resolve as l}from"path";import{writeFile as u}from"fs/promises";import{CliApp as d,MakeFactoryCommand as f,MakeMigrationCommand as p,MakeModelCommand as m,MakeSeederCommand as h,MigrateCommand as g,ModelsSyncCommand as _,SeedCommand as v}from"arkormx";import y from"chalk";import{loadPrototypes as b}from"@arkstack/common";var x=class extends o{signature=`build`;description=`Build the application for production`;async handle(){await new Promise((e,t)=>{let n=c(process.platform===`win32`?`pnpm.cmd`:`pnpm`,[`exec`,`tsdown`],{cwd:process.cwd(),stdio:`inherit`,env:Object.assign({},process.env,{NODE_ENV:`production`})});n.on(`error`,e=>{t(e)}),n.on(`exit`,n=>{if(n===0||n===null){e();return}t(Error(`tsdown exited with code ${n}`))})})}},S=class extends o{signature=`dev`;description=`Run the development server`;async handle(){await new Promise((e,t)=>{let n=c(process.platform===`win32`?`pnpm.cmd`:`pnpm`,[`exec`,`tsdown`,`--log-level`,`silent`],{cwd:process.cwd(),stdio:`inherit`});n.on(`error`,e=>{t(e)}),n.on(`exit`,n=>{if(n===0||n===null){e();return}t(Error(`tsdown exited with code ${n}`))})})}},C=class extends o{signature=`make:command
|
|
3
3
|
{name : name of the command to create}
|
|
4
|
-
`;description=`Creates a new console command class.`;async handle(){let e=String(this.argument(`name`)).replace(/\s+/g,``).replace(/\.js$/,``).trim();if(!e)return void this.error(`Command name is required`);let t=this.stub(e),n=l(process.cwd(),`src`,`app/console/commands/${e}.js`);await u(n,t,{flag:`wx`}),this.success(`Command ${e} created successfully at ${n}`)}stub(e){let t=`app:${e.toLowerCase()}`,n=`Description for ${t} command`;return[`import { Command } from '@h3ravel/musket'`,``,`export class ${e} extends Command {`,` signature = '${t}'`,``,` description = '${n}'`,``,` async handle () {`,` // Command logic goes here`,` }`,`}`].join(`
|
|
4
|
+
`;description=`Creates a new console command class.`;async handle(){let e=String(this.argument(`name`)).replace(/\s+/g,``).replace(/\.js$/,``).trim();if(!e)return void this.error(`Command name is required`);let t=this.stub(e),n=l(process.cwd(),`src`,`app/console/commands/${e}.js`);await u(n,t,{flag:`wx`}),this.success(`Command ${e} created successfully at ${n}`)}stub(e){e=e.endsWith(`Command`)?e:`${e}Command`,e=e.split(`/`).pop().split(`.`).shift();let t=`app:${e.toLowerCase()}`,n=`Description for ${t} command`;return[`import { Command } from '@h3ravel/musket'`,``,`export class ${e} extends Command {`,` signature = '${t}'`,``,` description = '${n}'`,``,` async handle () {`,` // Command logic goes here`,` }`,`}`].join(`
|
|
5
5
|
`)}},w=class extends o{signature=`make:controller
|
|
6
6
|
{name : name of the controller to create}
|
|
7
7
|
{--api : make an API controller}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/console",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Console package for Arkstack providing console-specific implementations of core Arkstack features such as routing, middleware, and database integration.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@h3ravel/musket": "^0.10.1",
|
|
50
50
|
"chalk": "^5.6.2",
|
|
51
51
|
"resora": "^0.2.6",
|
|
52
|
-
"@arkstack/common": "^0.1.
|
|
53
|
-
"@arkstack/contract": "^0.1.
|
|
52
|
+
"@arkstack/common": "^0.1.11",
|
|
53
|
+
"@arkstack/contract": "^0.1.11"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsdown",
|