@dashnex/cli 0.5.59 → 0.5.60
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/commands/install.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
package/dist/commands/install.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawn as e}from"child_process";import o from"path";import
|
|
1
|
+
import{spawn as e}from"child_process";import o from"path";import s from"fs-extra";import n from"chalk";import{debug as r,debugError as t}from"../lib/debug.js";import{createSpinner as i}from"../lib/spinner.js";const c=async o=>new Promise(s=>{const n=e(`${o} --version`,{stdio:"ignore",shell:!0});n.on("error",()=>{s(!1)}),n.on("close",e=>{s(0===e)})}),a=async o=>{const s=await(async()=>await c("pnpm")?"pnpm":await c("npm")?"npm":null)();if(!s)throw new Error("Neither pnpm nor npm is available. Please install pnpm (recommended) or npm to continue.");const n=`${s} ${["install","--ignore-scripts"].join(" ")}`;return r(`Using package manager: ${s}`),r(`Executing: ${n} in ${o}`),new Promise((s,r)=>{const i=[],c=[],a=e(n,{stdio:["ignore","pipe","pipe"],cwd:o,shell:!0,env:{...process.env,NPM_CONFIG_LOGLEVEL:"error"}});a.stdout&&a.stdout.on("data",e=>i.push(e)),a.stderr&&a.stderr.on("data",e=>c.push(e)),a.on("error",e=>{t(e),r(e)}),a.on("close",e=>{const o=null===e?0:e;0!==o&&(i.length&&process.stdout.write(Buffer.concat(i)),c.length&&process.stderr.write(Buffer.concat(c))),s(o)})})};class l{async execute(){r("Install flow started");const c=o.join(process.cwd(),"dashnex.json");await s.pathExists(c)||(console.error(n.red("Run this command in a DashNex Web application folder.")),process.exit(1));const l=process.cwd(),p=i();p.start("Installing dependencies...");try{const o=await a(l);0!==o&&(p.stop(),process.exit(o)),p.text("Building module registry...");const s=await(async o=>new Promise((s,n)=>{r(`Running: npx dashnex build --with-config in ${o}`);const i=e("npx dashnex build --with-config",{stdio:"ignore",cwd:o,shell:!0});i.on("error",e=>{t(e),n(e)}),i.on("close",e=>{s(null===e?1:e)})}))(l);p.stop(),0!==s&&(t(new Error(`dashnex build --with-config exited with code ${s}`)),console.error(n.red("Install completed but module registry build failed.")),process.exit(1)),process.exit(0)}catch(d){p.stop(),t(d),d instanceof Error?console.error(n.red(d.message)):console.error(n.red("Failed to run install")),process.exit(1)}}}export{l as InstallCommand,a as runInstallInDir};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="@dashnex/cli",a="0.5.
|
|
1
|
+
const e="@dashnex/cli",a="0.5.60",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