@dashnex/cli 0.5.53 → 0.5.55
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/dev.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
package/dist/commands/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawn as e}from"child_process";import
|
|
1
|
+
import{spawn as e}from"child_process";import r from"path";import t from"fs-extra";import n from"chalk";import{debug as o,debugError as s}from"../lib/debug.js";const i=["Using vars defined in \\.env","\\(node:\\d+\\) MaxListenersExceededWarning:","\\(Use `node --trace-warnings","\\[WARNING\\].*You have defined bindings to the following internal Durable Objects","You have defined bindings to the following internal Durable Objects",'\\{"name":".+","class_name":".+"\\}',"These will not work in local development, but they should work in production","If you want to develop these locally, you can define your DO in a separate Worker","For detailed instructions, refer to the Durable Objects section here:","developers.cloudflare.com/workers/wrangler/api#supported-bindings","workerd/server/server\\.c\\+\\+.*warning:.*DurableObjectNamespace"],a=(e,r)=>r.length>0&&r.some(r=>r.test(e)),c=(e,r)=>{let t="";return{write:n=>{const s="string"==typeof n?n:n.toString();t+=s;const i=t.split(/\r?\n/);t=i.pop()??"";for(const t of i){const n=t.trim();n?a(n,r)?o(`Filtered: ${n}`):e.write(t+"\n"):o("Filtered: <empty line>")}},flush:()=>{const n=t.trim();if(n){if(a(n,r))return o(`Filtered: ${n}`),void(t="");e.write(t),t=""}else t=""}}},l=async(n,a={})=>{const l=r.join(n,"dashnex.json"),d=r.join(n,"package.json");if(o(`Checking for dashnex.json at: ${l}`),!(await t.pathExists(l)))throw new Error("This is not a DashNex project.");if(o("dashnex.json found, checking for package.json"),!(await t.pathExists(d)))throw new Error("package.json is missing.");let p;o("package.json found, checking for dev script");try{p=await t.readJson(d)}catch(u){throw s(u),new Error("Failed to read package.json.")}if(!p.scripts||!p.scripts.dev)throw new Error('The "dev" script is missing from package.json. Please add a "dev" script to package.json.');o("dev script found, checking for npm availability");const h=await(async r=>new Promise(t=>{const n=e(`${r} --version`,{stdio:"ignore",shell:!0});n.on("error",()=>{t(!1)}),n.on("close",e=>{t(0===e)})}))("npm");if(o(`npm available: ${h}`),!h)throw new Error("npm is not available. Please install npm to continue.");const f=a.https?["--","--experimental-https"]:[];o(`npm available, executing: npm run dev in ${n}${a.https?" -- --experimental-https":""}`);return(async(r,t=[],n=process.cwd(),o=[])=>{const i=t.length?`${r} ${t.join(" ")}`:r,a=o.length>0;return new Promise((r,t)=>{const l=e(i,{stdio:a?["inherit","pipe","pipe"]:"inherit",cwd:n,shell:!0,env:{...process.env,NODE_ENV:"development"}});if(l.on("error",e=>{s(e),t(e)}),a&&l.stdout&&l.stderr){const e=c(process.stdout,o),t=c(process.stderr,o);l.stdout.on("data",r=>e.write(r)),l.stderr.on("data",e=>t.write(e)),l.on("close",n=>{e.flush(),t.flush(),r(null===n?0:n)})}else l.on("close",e=>{r(null===e?0:e)})})})("npm run dev",f,n,(()=>{const e=[];for(const r of i)try{e.push(new RegExp(r))}catch{o(`Invalid dev output filter pattern ignored: ${r}`)}return e})())};class d{async execute(e={}){o("Dev flow started");try{const r=await l(process.cwd(),e);process.exit(r)}catch(r){if(r instanceof Error&&r.message.startsWith("EXIT:"))throw r;s(r),r instanceof Error?console.error(n.red(r.message)):console.error(n.red("Failed to run npm run dev")),process.exit(1)}}}export{d as DevCommand,l as runDevInDir};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="@dashnex/cli",a="0.5.
|
|
1
|
+
const e="@dashnex/cli",a="0.5.55",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