dashnex 0.5.61 → 0.5.62
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/cli.js +1 -1
- package/dist/lib/spinner.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as o}from"commander";import e from"chalk";import n from"fs-extra";import s from"path";import{fileURLToPath as a}from"url";import c from"dotenv";import t from"./package.json.js";import{isUserInterrupt as
|
|
2
|
+
import{Command as o}from"commander";import e from"chalk";import n from"fs-extra";import s from"path";import{fileURLToPath as a}from"url";import c from"dotenv";import t from"./package.json.js";import{isUserInterrupt as i,INTERRUPTED_MESSAGE as r}from"./lib/errors.js";const d=new o,{version:l,description:m}=t;async function p(o,a){const c=[];try{const e=function(o,e){const a=s.join(e,"package.json");if(n.existsSync(a))try{if(JSON.parse(n.readFileSync(a,"utf8")).name===o)return e}catch{}return s.join(e,"node_modules",o)}(o,a),t=s.join(e,"dist","commands","index.js");if(n.existsSync(t)){const o=await import(t);let e=[];o.default?e=Array.isArray(o.default)?o.default:[]:o.commands&&(e=Array.isArray(o.commands)?o.commands:[]),e.length>0&&c.push(...e)}}catch(t){if(process.env.DEBUG){const n=t instanceof Error?t.message:String(t);console.log(e.yellow(`Module ${o} has no commands or failed to load: ${n}`))}}return c}function f(o,n,s={}){const a=o.command(n.name).description(n.description);"pull"===n.name&&a.arguments("[folder]"),a.option("--ci","Disable spinner (CI mode)"),n.options&&n.options.forEach(o=>{void 0!==o.defaultValue?"number"==typeof o.defaultValue?a.option(o.flags,o.description,String(o.defaultValue)):a.option(o.flags,o.description,o.defaultValue):a.option(o.flags,o.description)}),n.subcommands&&n.subcommands.forEach(o=>{f(a,o,{...s,...n.options})});const c=n.subcommands&&n.subcommands.length>0;"pull"===n.name?a.action(async(o,a,c)=>{try{const e={...s,...a};o&&(e.folder=o),await n.handler.execute(e)}catch(t){if(i(t))return void console.log(e.yellow(r));console.error(e.red(`❌ Command failed in ${n.name}:`),t),process.exit(1)}}):c?a.action(async()=>{a.outputHelp()}):a.action(async(o,a)=>{try{const e={...s,...o};await n.handler.execute(e)}catch(c){if(i(c))return void console.log(e.yellow(r));console.error(e.red(`❌ Command failed in ${n.name}:`),c),process.exit(1)}})}d.name("dashnex").description(m).version(l).option("--ci","Disable spinner and interactive prompts (CI mode)").arguments("[command]").action(o=>{if(o){d.commands.map(o=>o.name()).includes(o)||(console.error(e.red("Invalid command")),process.exit(1))}!function(o){const e=[];e.push("Usage: dashnex [options] [command]"),e.push(""),e.push(o.description()),e.push(""),e.push("Options:"),o.options.forEach(o=>{const n=o.flags.padEnd(20);e.push(` ${n} ${o.description}`)}),e.push(""),e.push("Commands:"),o.commands.forEach(o=>{const n=` ${o.name().padEnd(20)} ${o.description()}`;e.push(n),o.commands.length>0&&o.commands.forEach(o=>{const n=` ${o.name().padEnd(20)} ${o.description()}`;e.push(n)})}),console.log(e.join("\n"))}(d)}),async function(){c.config({quiet:!0}),process.env.DASHNEX_CLI="1",process.argv.includes("--ci")&&(process.env.DASHNEX_CI="1");let o=process.cwd();const t=s.dirname(a(import.meta.url)),i=s.resolve(t,"..");process.env.DEBUG&&(console.log(`CLI started from directory: ${o}`),console.log(`CLI package directory: ${i}`));const r=await async function(o){try{const e=[],a=/* @__PURE__ */new Set,c=o=>{a.has(o)||(a.add(o),e.push(o))},t=s.join(o,"dashnex.json");if(n.existsSync(t)){const e=s.join(o,"package.json");if(n.existsSync(e)){const o=JSON.parse(n.readFileSync(e,"utf8"));o.name&&c(o.name)}}const i=s.join(o,"package.json");if(!n.existsSync(i))return e;const r=JSON.parse(n.readFileSync(i,"utf8")),d={...r.dependencies,...r.devDependencies,...r.optionalDependencies};for(const[l]of Object.entries(d)){const e=s.join(o,"node_modules",l);n.existsSync(s.join(e,"dashnex.json"))&&c(l)}return e}catch(e){if(process.env.DEBUG){const o=e instanceof Error?e.message:String(e);console.log("⚠ Error reading app package.json:",o)}return[]}}(o),l=i.includes("node_modules");let m=!1;try{const e=s.join(o,"package.json");if(await n.pathExists(e)){const o=JSON.parse(await n.readFile(e,"utf8"));m="@dashnex/cli"in{...o.dependencies,...o.devDependencies,...o.optionalDependencies}}}catch{}!l&&!m||r.includes("@dashnex/cli")||r.push("@dashnex/cli"),process.env.DEBUG&&(console.log(`CLI package directory: ${i}`),console.log(`Is installed package: ${l}`),console.log(`CLI in dependencies: ${m}`),console.log(`Discovered modules: ${r.join(", ")}`));for(const a of r){let c=[];if("@dashnex/cli"===a&&(l||m))try{const o=s.join(i,"dist","commands","index.js");if(process.env.DEBUG&&console.log(`Loading @dashnex/cli commands from: ${o}`),await n.pathExists(o)){const e=await import(o);e.default?c=Array.isArray(e.default)?e.default:[]:e.commands&&(c=Array.isArray(e.commands)?e.commands:[]),process.env.DEBUG&&console.log(`Loaded ${c.length} commands from @dashnex/cli`)}}catch(u){if(process.env.DEBUG){const o=u instanceof Error?u.message:String(u);console.log(e.yellow(`Failed to load @dashnex/cli commands: ${o}`))}}else c=await p(a,o);for(const o of c)f(d,o)}try{const{default:e}=await import(s.join(o,"dist","commands","index.js"));if(e&&Array.isArray(e))for(const o of e)f(d,o)}catch(u){process.env.DEBUG&&console.error(e.yellow("⚠ Failed to discover application commands"))}d.parse(process.argv)}().catch(o=>{i(o)&&(console.log(e.yellow(r)),process.exit(0)),console.error(e.red("❌ CLI failed:"),o),process.exit(1)});
|
package/dist/lib/spinner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],r=(r="")=>{let e=null,s=0,n=r;const
|
|
1
|
+
const t=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],r=(r="")=>{if(process.env.DASHNEX_CI)return{start:()=>{},stop:()=>{},text:()=>{}};let e=null,s=0,n=r;const o=()=>{const r=t[s%t.length];process.stderr.write(`\r[K${r} ${n}`),s++};return{start:t=>{void 0!==t&&(n=t),e||(s=0,o(),e=setInterval(o,80))},stop:()=>{e&&(clearInterval(e),e=null),process.stderr.write("\r[K\n")},text:t=>{n=t,e&&o()}}};export{r as createSpinner};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="@dashnex/cli",a="0.5.
|
|
1
|
+
const e="@dashnex/cli",a="0.5.62",n="Command-line interface for DashNex framework",o={name:e,version:a,description:n};export{o as default,n as description,e as name,a as version};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "dashnex",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.62",
|
|
5
5
|
"description": "Command-line interface for DashNex framework",
|
|
6
6
|
"homepage": "https://dashnex.io",
|
|
7
7
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/adm-zip": "^0.5.7",
|
|
39
39
|
"@types/fs-extra": "^11.0.4",
|
|
40
40
|
"@types/inquirer": "^9.0.9",
|
|
41
|
-
"@types/node": "^25.3.
|
|
41
|
+
"@types/node": "^25.3.3",
|
|
42
42
|
"eslint": "^9.39.3",
|
|
43
43
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
44
44
|
"terser": "^5.46.0",
|