@php-wasm/cli
Advanced tools
Comparing version 0.7.20 to 0.9.2
@@ -1,4 +0,4 @@ | ||
import{existsSync as v,writeFileSync as f,mkdtempSync as P,rmSync as w,rmdirSync as y}from"fs";import{rootCertificates as E}from"tls";import{LatestSupportedPHPVersion as S,SupportedPHPVersionsList as $}from"@php-wasm/universal";import{NodePHP as g}from"@php-wasm/node";import{spawn as C}from"child_process";const R="modulepreload",k=function(a){return"/"+a},d={},H=function(r,c,p){if(!c||c.length===0)return r();const i=document.getElementsByTagName("link");return Promise.all(c.map(t=>{if(t=k(t),t in d)return;d[t]=!0;const e=t.endsWith(".css"),m=e?'[rel="stylesheet"]':"";if(!!p)for(let n=i.length-1;n>=0;n--){const l=i[n];if(l.href===t&&(!e||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const s=document.createElement("link");if(s.rel=e?"stylesheet":R,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e)return new Promise((n,l)=>{s.addEventListener("load",n),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${t}`)))})})).then(()=>r()).catch(t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t})};let o=process.argv.slice(2);o.length||(o=["--help"]);const u=new URL("ca-bundle.crt",(import.meta||{}).url).pathname;v(u)||f(u,E.join(` | ||
`));o.unshift("-d",`openssl.cafile=${u}`);async function L(){const a=await H(()=>import("./assets/php-e1f9edd4.js"),[]),r=process.env.PHP||S;if(!$.includes(r))throw new Error(`Unsupported PHP version ${r}`);const{TMPDIR:c,...p}=process.env,i=await g.load(r,{emscriptenOptions:{ENV:{...p,TERM:"xterm"}}});i.useHostFilesystem(),i.setSpawnHandler(e=>{const m=`${process.argv[0]} ${process.execArgv.join(" ")} ${process.argv[1]}`,h=e.replace(/^(?:\\ |[^ ])*php\d?(\s|$)/,m+"$1"),s=P("php-wasm-"),n=`${s}/script.sh`;f(n,`#!/bin/sh | ||
${h} < /dev/stdin | ||
`);try{return C(h,[],{shell:!0,stdio:["pipe","pipe","pipe"],timeout:5e3})}finally{w(n),y(s)}}),o.some(e=>e.startsWith("-c"))||o.unshift("-c",a),await i.cli(["php",...o]).catch(e=>{throw e.name==="ExitStatus"&&process.exit(e.status===void 0?1:e.status),e}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}L(); | ||
import{existsSync as v,writeFileSync as f,mkdtempSync as P,rmSync as w,rmdirSync as y}from"fs";import{rootCertificates as E}from"tls";import{LatestSupportedPHPVersion as S,SupportedPHPVersionsList as $,PHP as g}from"@php-wasm/universal";import{spawn as R}from"child_process";import{loadNodeRuntime as C,useHostFilesystem as k}from"@php-wasm/node";const H="modulepreload",L=function(a){return"/"+a},d={},_=function(r,c,p){if(!c||c.length===0)return r();const i=document.getElementsByTagName("link");return Promise.all(c.map(t=>{if(t=L(t),t in d)return;d[t]=!0;const e=t.endsWith(".css"),m=e?'[rel="stylesheet"]':"";if(!!p)for(let n=i.length-1;n>=0;n--){const l=i[n];if(l.href===t&&(!e||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${m}`))return;const s=document.createElement("link");if(s.rel=e?"stylesheet":H,e||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),e)return new Promise((n,l)=>{s.addEventListener("load",n),s.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${t}`)))})})).then(()=>r()).catch(t=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t})};let o=process.argv.slice(2);o.length||(o=["--help"]);const h=new URL("ca-bundle.crt",(import.meta||{}).url).pathname;v(h)||f(h,E.join(` | ||
`));o.unshift("-d",`openssl.cafile=${h}`);async function x(){const a=await _(()=>import("./assets/php-e1f9edd4.js"),[]),r=process.env.PHP||S;if(!$.includes(r))throw new Error(`Unsupported PHP version ${r}`);const{TMPDIR:c,...p}=process.env,i=new g(await C(r,{emscriptenOptions:{ENV:{...p,TERM:"xterm"}}}));k(i),i.setSpawnHandler(e=>{const m=`${process.argv[0]} ${process.execArgv.join(" ")} ${process.argv[1]}`,u=e.replace(/^(?:\\ |[^ ])*php\d?(\s|$)/,m+"$1"),s=P("php-wasm-"),n=`${s}/script.sh`;f(n,`#!/bin/sh | ||
${u} < /dev/stdin | ||
`);try{return R(u,[],{shell:!0,stdio:["pipe","pipe","pipe"],timeout:5e3})}finally{w(n),y(s)}}),o.some(e=>e.startsWith("-c"))||o.unshift("-c",a),await i.cli(["php",...o]).catch(e=>{throw e.name==="ExitStatus"&&process.exit(e.status===void 0?1:e.status),e}).finally(()=>{setTimeout(()=>{process.exit(0)},100)})}x(); |
{ | ||
"name": "@php-wasm/cli", | ||
"version": "0.7.20", | ||
"version": "0.9.2", | ||
"description": "PHP.wasm CLI for node.js", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"bin": "php-wasm.js", | ||
"gitHead": "5915ef756c88da8dcb665f9f0e49ddc0c0b10d50", | ||
"gitHead": "40dca15bf2d5c21c2ee57a878940cb6f7f7851f0", | ||
"dependencies": { | ||
@@ -32,5 +32,5 @@ "comlink": "^4.4.1", | ||
"ws": "8.13.0", | ||
"@php-wasm/universal": "0.7.20", | ||
"@php-wasm/node": "0.7.20" | ||
"@php-wasm/universal": "0.9.2", | ||
"@php-wasm/node": "0.9.2" | ||
} | ||
} |
3475
14
+ Added@php-wasm/universal@0.9.2(transitive)
- Removed@php-wasm/logger@0.7.20(transitive)
- Removed@php-wasm/node@0.7.20(transitive)
- Removed@php-wasm/node-polyfills@0.7.20(transitive)
- Removed@php-wasm/universal@0.7.20(transitive)
- Removed@php-wasm/util@0.7.20(transitive)
- Removed@wp-playground/common@0.7.20(transitive)
- Removedaccepts@1.3.8(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedbody-parser@1.20.2(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.3(transitive)
- Removedcliui@8.0.1(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.6.0(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddunder-proto@1.0.1(transitive)
- Removedee-first@1.1.1(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.1.1(transitive)
- Removedescalade@3.2.0(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedetag@1.8.1(transitive)
- Removedexpress@4.19.2(transitive)
- Removedfinalhandler@1.2.0(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-caller-file@2.0.5(transitive)
- Removedget-intrinsic@1.2.7(transitive)
- Removedget-proto@1.0.1(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.4(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedmath-intrinsics@1.1.0(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmerge-descriptors@1.0.1(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@0.1.7(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedqs@6.11.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedrequire-directory@2.1.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsend@0.18.0(transitive)
- Removedserve-static@1.15.0(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)
- Removedwrap-ansi@7.0.0(transitive)
- Removedy18n@5.0.8(transitive)
- Removedyargs@17.7.2(transitive)
- Removedyargs-parser@21.1.1(transitive)
Updated@php-wasm/node@0.9.2
Updated@php-wasm/universal@0.9.2