@wp-playground/common 2.0.13 → 2.0.14

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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@php-wasm/util");function l(i=fetch){const e={};return async function(t,r){if(!e[t]){e[t]={responsePromise:i(t,r),async nextResponse(){const s=await e[t].responsePromise,[$,f]=e[t].unlockedBodyStream.tee();return e[t].unlockedBodyStream=$,new Response(f,{status:s.status,statusText:s.statusText,headers:s.headers})}};const n=await e[t].responsePromise;e[t].unlockedBodyStream=n.body}return e[t].nextResponse()}}const p="8.3",a="/tmp/file.zip",u=async(i,e,o,t=!0)=>{if(e instanceof File){const n=e;e=a,await i.writeFile(e,new Uint8Array(await n.arrayBuffer()))}const r=c.phpVars({zipPath:e,extractToPath:o,overwriteFiles:t});await i.run({code:`<?php
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@php-wasm/util");function f(i=fetch){const e={};return async function(t,r){if(!e[t]){e[t]={responsePromise:i(t,r),async nextResponse(){const s=await e[t].responsePromise,[c,$]=e[t].unlockedBodyStream.tee();return e[t].unlockedBodyStream=c,new Response($,{status:s.status,statusText:s.statusText,headers:s.headers})}};const n=await e[t].responsePromise;e[t].unlockedBodyStream=n.body}return e[t].nextResponse()}}const l="8.3",p=async(i,e,o,t=!0)=>{const r=`/tmp/file-${Math.random()}.zip`;if(e instanceof File){const s=e;e=r,await i.writeFile(e,new Uint8Array(await s.arrayBuffer()))}const n=a.phpVars({zipPath:e,extractToPath:o,overwriteFiles:t});await i.run({code:`<?php
2
2
  function unzip($zipPath, $extractTo, $overwriteFiles = true)
3
3
  {
4
4
  if (!is_dir($extractTo)) {
@@ -23,8 +23,8 @@
23
23
  throw new Exception("Could not unzip file: " . $zip->getStatusString());
24
24
  }
25
25
  }
26
- unzip(${r.zipPath}, ${r.extractToPath}, ${r.overwriteFiles});
27
- `}),await i.fileExists(a)&&await i.unlink(a)},d=async(i,e)=>{const o=`/tmp/file${Math.random()}.zip`,t=c.phpVars({directoryPath:e,outputPath:o});await i.run({code:`<?php
26
+ unzip(${n.zipPath}, ${n.extractToPath}, ${n.overwriteFiles});
27
+ `}),await i.fileExists(r)&&await i.unlink(r)},u=async(i,e)=>{const o=`/tmp/file${Math.random()}.zip`,t=a.phpVars({directoryPath:e,outputPath:o});await i.run({code:`<?php
28
28
  function zipDirectory($directoryPath, $outputPath) {
29
29
  $zip = new ZipArchive;
30
30
  $res = $zip->open($outputPath, ZipArchive::CREATE);
@@ -45,5 +45,5 @@
45
45
  chmod($outputPath, 0777);
46
46
  }
47
47
  zipDirectory(${t.directoryPath}, ${t.outputPath});
48
- `});const r=await i.readFileAsBuffer(o);return i.unlink(o),r};exports.RecommendedPHPVersion=p;exports.createMemoizedFetch=l;exports.unzipFile=u;exports.zipDirectory=d;
48
+ `});const r=await i.readFileAsBuffer(o);return i.unlink(o),r};exports.RecommendedPHPVersion=l;exports.createMemoizedFetch=f;exports.unzipFile=p;exports.zipDirectory=u;
49
49
  //# sourceMappingURL=index.cjs.map
package/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../packages/playground/common/src/create-memoized-fetch.ts","../../../../packages/playground/common/src/index.ts"],"sourcesContent":["export interface CacheEntry {\n\tresponsePromise: Promise<Response>;\n\tunlockedBodyStream?: ReadableStream<Uint8Array>;\n\tnextResponse: () => Promise<Response>;\n}\n\n/**\n * Creates a fetch function that memoizes the response stream.\n * Calling it twice will return a response with the same status,\n * headers, and the body stream.\n * Memoization is keyed by URL. Method, headers etc are ignored.\n *\n * @param originalFetch The fetch function to memoize. Defaults to the global fetch.\n */\nexport function createMemoizedFetch(\n\toriginalFetch: (\n\t\tinput: RequestInfo | URL,\n\t\tinit?: RequestInit\n\t) => Promise<Response> = fetch\n) {\n\tconst fetches: Record<string, CacheEntry> = {};\n\n\treturn async function memoizedFetch(url: string, options?: RequestInit) {\n\t\tif (!fetches[url]) {\n\t\t\tfetches[url] = {\n\t\t\t\tresponsePromise: originalFetch(url, options),\n\t\t\t\tasync nextResponse() {\n\t\t\t\t\t// Wait for \"result\" to be set.\n\t\t\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\t\t\tconst [left, right] =\n\t\t\t\t\t\tfetches[url].unlockedBodyStream!.tee();\n\t\t\t\t\tfetches[url].unlockedBodyStream = left;\n\t\t\t\t\treturn new Response(right, {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\t\theaders: response.headers,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\tfetches[url].unlockedBodyStream = response.body!;\n\t\t}\n\n\t\treturn fetches[url].nextResponse();\n\t};\n}\n","/**\n * Avoid adding new code here. @wp-playground/common should remain\n * as lean as possible.\n *\n * This package exists to avoid circular dependencies. Let's not\n * use it as a default place to add code that doesn't seem to fit\n * anywhere else. If there's no good place for your code, perhaps\n * it needs to be restructured? Or maybe there's a need for a new package?\n * Let's always consider these questions before adding new code here.\n */\n\nimport type { UniversalPHP } from '@php-wasm/universal';\nimport { phpVars } from '@php-wasm/util';\n\nexport { createMemoizedFetch } from './create-memoized-fetch';\n\nexport const RecommendedPHPVersion = '8.3';\n\n/**\n * Unzip a zip file inside Playground.\n */\nconst tmpPath = '/tmp/file.zip';\nexport const unzipFile = async (\n\tphp: UniversalPHP,\n\tzipPath: string | File,\n\textractToPath: string,\n\toverwriteFiles = true\n) => {\n\tif (zipPath instanceof File) {\n\t\tconst zipFile = zipPath;\n\t\tzipPath = tmpPath;\n\t\tawait php.writeFile(\n\t\t\tzipPath,\n\t\t\tnew Uint8Array(await zipFile.arrayBuffer())\n\t\t);\n\t}\n\tconst js = phpVars({\n\t\tzipPath,\n\t\textractToPath,\n\t\toverwriteFiles,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n function unzip($zipPath, $extractTo, $overwriteFiles = true)\n {\n if (!is_dir($extractTo)) {\n mkdir($extractTo, 0777, true);\n }\n $zip = new ZipArchive;\n $res = $zip->open($zipPath);\n if ($res === TRUE) {\n\t\t\t\tfor ($i = 0; $i < $zip->numFiles; $i++) {\n\t\t\t\t\t$filename = $zip->getNameIndex($i);\n\t\t\t\t\t$fileinfo = pathinfo($filename);\n\t\t\t\t\t$extractFilePath = rtrim($extractTo, '/') . '/' . $filename;\n\t\t\t\t\t// Check if file exists and $overwriteFiles is false\n\t\t\t\t\tif (!file_exists($extractFilePath) || $overwriteFiles) {\n\t\t\t\t\t\t// Extract file\n\t\t\t\t\t\t$zip->extractTo($extractTo, $filename);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$zip->close();\n\t\t\t\tchmod($extractTo, 0777);\n } else {\n throw new Exception(\"Could not unzip file: \" . $zip->getStatusString());\n }\n }\n unzip(${js.zipPath}, ${js.extractToPath}, ${js.overwriteFiles});\n `,\n\t});\n\tif (await php.fileExists(tmpPath)) {\n\t\tawait php.unlink(tmpPath);\n\t}\n};\n\nexport const zipDirectory = async (\n\tphp: UniversalPHP,\n\tdirectoryPath: string\n) => {\n\tconst outputPath = `/tmp/file${Math.random()}.zip`;\n\tconst js = phpVars({\n\t\tdirectoryPath,\n\t\toutputPath,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n\t\tfunction zipDirectory($directoryPath, $outputPath) {\n\t\t\t$zip = new ZipArchive;\n\t\t\t$res = $zip->open($outputPath, ZipArchive::CREATE);\n\t\t\tif ($res !== TRUE) {\n\t\t\t\tthrow new Exception('Failed to create ZIP');\n\t\t\t}\n\t\t\t$files = new RecursiveIteratorIterator(\n\t\t\t\tnew RecursiveDirectoryIterator($directoryPath)\n\t\t\t);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$file = strval($file);\n\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$zip->addFile($file, substr($file, strlen($directoryPath)));\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\tchmod($outputPath, 0777);\n\t\t}\n\t\tzipDirectory(${js.directoryPath}, ${js.outputPath});\n\t\t`,\n\t});\n\n\tconst fileBuffer = await php.readFileAsBuffer(outputPath);\n\tphp.unlink(outputPath);\n\treturn fileBuffer;\n};\n"],"names":["createMemoizedFetch","originalFetch","fetches","url","options","response","left","right","RecommendedPHPVersion","tmpPath","unzipFile","php","zipPath","extractToPath","overwriteFiles","zipFile","js","phpVars","zipDirectory","directoryPath","outputPath","fileBuffer"],"mappings":"kHAcgB,SAAAA,EACfC,EAGyB,MACxB,CACD,MAAMC,EAAsC,CAAC,EAEtC,OAAA,eAA6BC,EAAaC,EAAuB,CACnE,GAAA,CAACF,EAAQC,CAAG,EAAG,CAClBD,EAAQC,CAAG,EAAI,CACd,gBAAiBF,EAAcE,EAAKC,CAAO,EAC3C,MAAM,cAAe,CAEpB,MAAMC,EAAW,MAAMH,EAAQC,CAAG,EAAE,gBAC9B,CAACG,EAAMC,CAAK,EACjBL,EAAQC,CAAG,EAAE,mBAAoB,IAAI,EAC9B,OAAAD,EAAAC,CAAG,EAAE,mBAAqBG,EAC3B,IAAI,SAASC,EAAO,CAC1B,OAAQF,EAAS,OACjB,WAAYA,EAAS,WACrB,QAASA,EAAS,OAAA,CAClB,CAAA,CAEH,EACA,MAAMA,EAAW,MAAMH,EAAQC,CAAG,EAAE,gBAC5BD,EAAAC,CAAG,EAAE,mBAAqBE,EAAS,IAAA,CAGrC,OAAAH,EAAQC,CAAG,EAAE,aAAa,CAClC,CACD,CC7BO,MAAMK,EAAwB,MAK/BC,EAAU,gBACHC,EAAY,MACxBC,EACAC,EACAC,EACAC,EAAiB,KACb,CACJ,GAAIF,aAAmB,KAAM,CAC5B,MAAMG,EAAUH,EACNA,EAAAH,EACV,MAAME,EAAI,UACTC,EACA,IAAI,WAAW,MAAMG,EAAQ,YAAa,CAAA,CAC3C,CAAA,CAED,MAAMC,EAAKC,EAAAA,QAAQ,CAClB,QAAAL,EACA,cAAAC,EACA,eAAAC,CAAA,CACA,EACD,MAAMH,EAAI,IAAI,CACb,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAyBQK,EAAG,OAAO,KAAKA,EAAG,aAAa,KAAKA,EAAG,cAAc;AAAA,SAAA,CAEnE,EACG,MAAML,EAAI,WAAWF,CAAO,GACzB,MAAAE,EAAI,OAAOF,CAAO,CAE1B,EAEaS,EAAe,MAC3BP,EACAQ,IACI,CACJ,MAAMC,EAAa,YAAY,KAAK,OAAA,CAAQ,OACtCJ,EAAKC,EAAAA,QAAQ,CAClB,cAAAE,EACA,WAAAC,CAAA,CACA,EACD,MAAMT,EAAI,IAAI,CACb,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAoBSK,EAAG,aAAa,KAAKA,EAAG,UAAU;AAAA,GAAA,CAEjD,EAED,MAAMK,EAAa,MAAMV,EAAI,iBAAiBS,CAAU,EACxD,OAAAT,EAAI,OAAOS,CAAU,EACdC,CACR"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../packages/playground/common/src/create-memoized-fetch.ts","../../../../packages/playground/common/src/index.ts"],"sourcesContent":["export interface CacheEntry {\n\tresponsePromise: Promise<Response>;\n\tunlockedBodyStream?: ReadableStream<Uint8Array>;\n\tnextResponse: () => Promise<Response>;\n}\n\n/**\n * Creates a fetch function that memoizes the response stream.\n * Calling it twice will return a response with the same status,\n * headers, and the body stream.\n * Memoization is keyed by URL. Method, headers etc are ignored.\n *\n * @param originalFetch The fetch function to memoize. Defaults to the global fetch.\n */\nexport function createMemoizedFetch(\n\toriginalFetch: (\n\t\tinput: RequestInfo | URL,\n\t\tinit?: RequestInit\n\t) => Promise<Response> = fetch\n) {\n\tconst fetches: Record<string, CacheEntry> = {};\n\n\treturn async function memoizedFetch(url: string, options?: RequestInit) {\n\t\tif (!fetches[url]) {\n\t\t\tfetches[url] = {\n\t\t\t\tresponsePromise: originalFetch(url, options),\n\t\t\t\tasync nextResponse() {\n\t\t\t\t\t// Wait for \"result\" to be set.\n\t\t\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\t\t\tconst [left, right] =\n\t\t\t\t\t\tfetches[url].unlockedBodyStream!.tee();\n\t\t\t\t\tfetches[url].unlockedBodyStream = left;\n\t\t\t\t\treturn new Response(right, {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\t\theaders: response.headers,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\tfetches[url].unlockedBodyStream = response.body!;\n\t\t}\n\n\t\treturn fetches[url].nextResponse();\n\t};\n}\n","/**\n * Avoid adding new code here. @wp-playground/common should remain\n * as lean as possible.\n *\n * This package exists to avoid circular dependencies. Let's not\n * use it as a default place to add code that doesn't seem to fit\n * anywhere else. If there's no good place for your code, perhaps\n * it needs to be restructured? Or maybe there's a need for a new package?\n * Let's always consider these questions before adding new code here.\n */\n\nimport type { UniversalPHP } from '@php-wasm/universal';\nimport { phpVars } from '@php-wasm/util';\n\nexport { createMemoizedFetch } from './create-memoized-fetch';\n\nexport const RecommendedPHPVersion = '8.3';\n\n/**\n * Unzip a zip file inside Playground.\n */\nexport const unzipFile = async (\n\tphp: UniversalPHP,\n\tzipPath: string | File,\n\textractToPath: string,\n\toverwriteFiles = true\n) => {\n\t/**\n\t * Use a random file name to avoid conflicts across concurrent unzipFile()\n\t * calls.\n\t */\n\tconst tmpPath = `/tmp/file-${Math.random()}.zip`;\n\tif (zipPath instanceof File) {\n\t\tconst zipFile = zipPath;\n\t\tzipPath = tmpPath;\n\t\tawait php.writeFile(\n\t\t\tzipPath,\n\t\t\tnew Uint8Array(await zipFile.arrayBuffer())\n\t\t);\n\t}\n\tconst js = phpVars({\n\t\tzipPath,\n\t\textractToPath,\n\t\toverwriteFiles,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n function unzip($zipPath, $extractTo, $overwriteFiles = true)\n {\n if (!is_dir($extractTo)) {\n mkdir($extractTo, 0777, true);\n }\n $zip = new ZipArchive;\n $res = $zip->open($zipPath);\n if ($res === TRUE) {\n\t\t\t\tfor ($i = 0; $i < $zip->numFiles; $i++) {\n\t\t\t\t\t$filename = $zip->getNameIndex($i);\n\t\t\t\t\t$fileinfo = pathinfo($filename);\n\t\t\t\t\t$extractFilePath = rtrim($extractTo, '/') . '/' . $filename;\n\t\t\t\t\t// Check if file exists and $overwriteFiles is false\n\t\t\t\t\tif (!file_exists($extractFilePath) || $overwriteFiles) {\n\t\t\t\t\t\t// Extract file\n\t\t\t\t\t\t$zip->extractTo($extractTo, $filename);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$zip->close();\n\t\t\t\tchmod($extractTo, 0777);\n } else {\n throw new Exception(\"Could not unzip file: \" . $zip->getStatusString());\n }\n }\n unzip(${js.zipPath}, ${js.extractToPath}, ${js.overwriteFiles});\n `,\n\t});\n\tif (await php.fileExists(tmpPath)) {\n\t\tawait php.unlink(tmpPath);\n\t}\n};\n\nexport const zipDirectory = async (\n\tphp: UniversalPHP,\n\tdirectoryPath: string\n) => {\n\tconst outputPath = `/tmp/file${Math.random()}.zip`;\n\tconst js = phpVars({\n\t\tdirectoryPath,\n\t\toutputPath,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n\t\tfunction zipDirectory($directoryPath, $outputPath) {\n\t\t\t$zip = new ZipArchive;\n\t\t\t$res = $zip->open($outputPath, ZipArchive::CREATE);\n\t\t\tif ($res !== TRUE) {\n\t\t\t\tthrow new Exception('Failed to create ZIP');\n\t\t\t}\n\t\t\t$files = new RecursiveIteratorIterator(\n\t\t\t\tnew RecursiveDirectoryIterator($directoryPath)\n\t\t\t);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$file = strval($file);\n\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$zip->addFile($file, substr($file, strlen($directoryPath)));\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\tchmod($outputPath, 0777);\n\t\t}\n\t\tzipDirectory(${js.directoryPath}, ${js.outputPath});\n\t\t`,\n\t});\n\n\tconst fileBuffer = await php.readFileAsBuffer(outputPath);\n\tphp.unlink(outputPath);\n\treturn fileBuffer;\n};\n"],"names":["createMemoizedFetch","originalFetch","fetches","url","options","response","left","right","RecommendedPHPVersion","unzipFile","php","zipPath","extractToPath","overwriteFiles","tmpPath","zipFile","js","phpVars","zipDirectory","directoryPath","outputPath","fileBuffer"],"mappings":"kHAcgB,SAAAA,EACfC,EAGyB,MACxB,CACD,MAAMC,EAAsC,CAAC,EAEtC,OAAA,eAA6BC,EAAaC,EAAuB,CACnE,GAAA,CAACF,EAAQC,CAAG,EAAG,CAClBD,EAAQC,CAAG,EAAI,CACd,gBAAiBF,EAAcE,EAAKC,CAAO,EAC3C,MAAM,cAAe,CAEpB,MAAMC,EAAW,MAAMH,EAAQC,CAAG,EAAE,gBAC9B,CAACG,EAAMC,CAAK,EACjBL,EAAQC,CAAG,EAAE,mBAAoB,IAAI,EAC9B,OAAAD,EAAAC,CAAG,EAAE,mBAAqBG,EAC3B,IAAI,SAASC,EAAO,CAC1B,OAAQF,EAAS,OACjB,WAAYA,EAAS,WACrB,QAASA,EAAS,OAAA,CAClB,CAAA,CAEH,EACA,MAAMA,EAAW,MAAMH,EAAQC,CAAG,EAAE,gBAC5BD,EAAAC,CAAG,EAAE,mBAAqBE,EAAS,IAAA,CAGrC,OAAAH,EAAQC,CAAG,EAAE,aAAa,CAClC,CACD,CC7BO,MAAMK,EAAwB,MAKxBC,EAAY,MACxBC,EACAC,EACAC,EACAC,EAAiB,KACb,CAKJ,MAAMC,EAAU,aAAa,KAAK,OAAA,CAAQ,OAC1C,GAAIH,aAAmB,KAAM,CAC5B,MAAMI,EAAUJ,EACNA,EAAAG,EACV,MAAMJ,EAAI,UACTC,EACA,IAAI,WAAW,MAAMI,EAAQ,YAAa,CAAA,CAC3C,CAAA,CAED,MAAMC,EAAKC,EAAAA,QAAQ,CAClB,QAAAN,EACA,cAAAC,EACA,eAAAC,CAAA,CACA,EACD,MAAMH,EAAI,IAAI,CACb,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAyBQM,EAAG,OAAO,KAAKA,EAAG,aAAa,KAAKA,EAAG,cAAc;AAAA,SAAA,CAEnE,EACG,MAAMN,EAAI,WAAWI,CAAO,GACzB,MAAAJ,EAAI,OAAOI,CAAO,CAE1B,EAEaI,EAAe,MAC3BR,EACAS,IACI,CACJ,MAAMC,EAAa,YAAY,KAAK,OAAA,CAAQ,OACtCJ,EAAKC,EAAAA,QAAQ,CAClB,cAAAE,EACA,WAAAC,CAAA,CACA,EACD,MAAMV,EAAI,IAAI,CACb,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAoBSM,EAAG,aAAa,KAAKA,EAAG,UAAU;AAAA,GAAA,CAEjD,EAED,MAAMK,EAAa,MAAMX,EAAI,iBAAiBU,CAAU,EACxD,OAAAV,EAAI,OAAOU,CAAU,EACdC,CACR"}
package/index.d.ts CHANGED
@@ -11,5 +11,8 @@
11
11
  import type { UniversalPHP } from '@php-wasm/universal';
12
12
  export { createMemoizedFetch } from './create-memoized-fetch';
13
13
  export declare const RecommendedPHPVersion = "8.3";
14
+ /**
15
+ * Unzip a zip file inside Playground.
16
+ */
14
17
  export declare const unzipFile: (php: UniversalPHP, zipPath: string | File, extractToPath: string, overwriteFiles?: boolean) => Promise<void>;
15
18
  export declare const zipDirectory: (php: UniversalPHP, directoryPath: string) => Promise<Uint8Array>;
package/index.js CHANGED
@@ -1,34 +1,35 @@
1
- import { phpVars as c } from "@php-wasm/util";
2
- function l(i = fetch) {
1
+ import { phpVars as a } from "@php-wasm/util";
2
+ function p(i = fetch) {
3
3
  const e = {};
4
4
  return async function(t, r) {
5
5
  if (!e[t]) {
6
6
  e[t] = {
7
7
  responsePromise: i(t, r),
8
8
  async nextResponse() {
9
- const n = await e[t].responsePromise, [$, f] = e[t].unlockedBodyStream.tee();
10
- return e[t].unlockedBodyStream = $, new Response(f, {
11
- status: n.status,
12
- statusText: n.statusText,
13
- headers: n.headers
9
+ const s = await e[t].responsePromise, [c, $] = e[t].unlockedBodyStream.tee();
10
+ return e[t].unlockedBodyStream = c, new Response($, {
11
+ status: s.status,
12
+ statusText: s.statusText,
13
+ headers: s.headers
14
14
  });
15
15
  }
16
16
  };
17
- const s = await e[t].responsePromise;
18
- e[t].unlockedBodyStream = s.body;
17
+ const n = await e[t].responsePromise;
18
+ e[t].unlockedBodyStream = n.body;
19
19
  }
20
20
  return e[t].nextResponse();
21
21
  };
22
22
  }
23
- const u = "8.3", a = "/tmp/file.zip", d = async (i, e, o, t = !0) => {
23
+ const l = "8.3", u = async (i, e, o, t = !0) => {
24
+ const r = `/tmp/file-${Math.random()}.zip`;
24
25
  if (e instanceof File) {
25
26
  const s = e;
26
- e = a, await i.writeFile(
27
+ e = r, await i.writeFile(
27
28
  e,
28
29
  new Uint8Array(await s.arrayBuffer())
29
30
  );
30
31
  }
31
- const r = c({
32
+ const n = a({
32
33
  zipPath: e,
33
34
  extractToPath: o,
34
35
  overwriteFiles: t
@@ -59,11 +60,11 @@ const u = "8.3", a = "/tmp/file.zip", d = async (i, e, o, t = !0) => {
59
60
  throw new Exception("Could not unzip file: " . $zip->getStatusString());
60
61
  }
61
62
  }
62
- unzip(${r.zipPath}, ${r.extractToPath}, ${r.overwriteFiles});
63
+ unzip(${n.zipPath}, ${n.extractToPath}, ${n.overwriteFiles});
63
64
  `
64
- }), await i.fileExists(a) && await i.unlink(a);
65
- }, h = async (i, e) => {
66
- const o = `/tmp/file${Math.random()}.zip`, t = c({
65
+ }), await i.fileExists(r) && await i.unlink(r);
66
+ }, d = async (i, e) => {
67
+ const o = `/tmp/file${Math.random()}.zip`, t = a({
67
68
  directoryPath: e,
68
69
  outputPath: o
69
70
  });
@@ -95,9 +96,9 @@ const u = "8.3", a = "/tmp/file.zip", d = async (i, e, o, t = !0) => {
95
96
  return i.unlink(o), r;
96
97
  };
97
98
  export {
98
- u as RecommendedPHPVersion,
99
- l as createMemoizedFetch,
100
- d as unzipFile,
101
- h as zipDirectory
99
+ l as RecommendedPHPVersion,
100
+ p as createMemoizedFetch,
101
+ u as unzipFile,
102
+ d as zipDirectory
102
103
  };
103
104
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../packages/playground/common/src/create-memoized-fetch.ts","../../../../packages/playground/common/src/index.ts"],"sourcesContent":["export interface CacheEntry {\n\tresponsePromise: Promise<Response>;\n\tunlockedBodyStream?: ReadableStream<Uint8Array>;\n\tnextResponse: () => Promise<Response>;\n}\n\n/**\n * Creates a fetch function that memoizes the response stream.\n * Calling it twice will return a response with the same status,\n * headers, and the body stream.\n * Memoization is keyed by URL. Method, headers etc are ignored.\n *\n * @param originalFetch The fetch function to memoize. Defaults to the global fetch.\n */\nexport function createMemoizedFetch(\n\toriginalFetch: (\n\t\tinput: RequestInfo | URL,\n\t\tinit?: RequestInit\n\t) => Promise<Response> = fetch\n) {\n\tconst fetches: Record<string, CacheEntry> = {};\n\n\treturn async function memoizedFetch(url: string, options?: RequestInit) {\n\t\tif (!fetches[url]) {\n\t\t\tfetches[url] = {\n\t\t\t\tresponsePromise: originalFetch(url, options),\n\t\t\t\tasync nextResponse() {\n\t\t\t\t\t// Wait for \"result\" to be set.\n\t\t\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\t\t\tconst [left, right] =\n\t\t\t\t\t\tfetches[url].unlockedBodyStream!.tee();\n\t\t\t\t\tfetches[url].unlockedBodyStream = left;\n\t\t\t\t\treturn new Response(right, {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\t\theaders: response.headers,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\tfetches[url].unlockedBodyStream = response.body!;\n\t\t}\n\n\t\treturn fetches[url].nextResponse();\n\t};\n}\n","/**\n * Avoid adding new code here. @wp-playground/common should remain\n * as lean as possible.\n *\n * This package exists to avoid circular dependencies. Let's not\n * use it as a default place to add code that doesn't seem to fit\n * anywhere else. If there's no good place for your code, perhaps\n * it needs to be restructured? Or maybe there's a need for a new package?\n * Let's always consider these questions before adding new code here.\n */\n\nimport type { UniversalPHP } from '@php-wasm/universal';\nimport { phpVars } from '@php-wasm/util';\n\nexport { createMemoizedFetch } from './create-memoized-fetch';\n\nexport const RecommendedPHPVersion = '8.3';\n\n/**\n * Unzip a zip file inside Playground.\n */\nconst tmpPath = '/tmp/file.zip';\nexport const unzipFile = async (\n\tphp: UniversalPHP,\n\tzipPath: string | File,\n\textractToPath: string,\n\toverwriteFiles = true\n) => {\n\tif (zipPath instanceof File) {\n\t\tconst zipFile = zipPath;\n\t\tzipPath = tmpPath;\n\t\tawait php.writeFile(\n\t\t\tzipPath,\n\t\t\tnew Uint8Array(await zipFile.arrayBuffer())\n\t\t);\n\t}\n\tconst js = phpVars({\n\t\tzipPath,\n\t\textractToPath,\n\t\toverwriteFiles,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n function unzip($zipPath, $extractTo, $overwriteFiles = true)\n {\n if (!is_dir($extractTo)) {\n mkdir($extractTo, 0777, true);\n }\n $zip = new ZipArchive;\n $res = $zip->open($zipPath);\n if ($res === TRUE) {\n\t\t\t\tfor ($i = 0; $i < $zip->numFiles; $i++) {\n\t\t\t\t\t$filename = $zip->getNameIndex($i);\n\t\t\t\t\t$fileinfo = pathinfo($filename);\n\t\t\t\t\t$extractFilePath = rtrim($extractTo, '/') . '/' . $filename;\n\t\t\t\t\t// Check if file exists and $overwriteFiles is false\n\t\t\t\t\tif (!file_exists($extractFilePath) || $overwriteFiles) {\n\t\t\t\t\t\t// Extract file\n\t\t\t\t\t\t$zip->extractTo($extractTo, $filename);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$zip->close();\n\t\t\t\tchmod($extractTo, 0777);\n } else {\n throw new Exception(\"Could not unzip file: \" . $zip->getStatusString());\n }\n }\n unzip(${js.zipPath}, ${js.extractToPath}, ${js.overwriteFiles});\n `,\n\t});\n\tif (await php.fileExists(tmpPath)) {\n\t\tawait php.unlink(tmpPath);\n\t}\n};\n\nexport const zipDirectory = async (\n\tphp: UniversalPHP,\n\tdirectoryPath: string\n) => {\n\tconst outputPath = `/tmp/file${Math.random()}.zip`;\n\tconst js = phpVars({\n\t\tdirectoryPath,\n\t\toutputPath,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n\t\tfunction zipDirectory($directoryPath, $outputPath) {\n\t\t\t$zip = new ZipArchive;\n\t\t\t$res = $zip->open($outputPath, ZipArchive::CREATE);\n\t\t\tif ($res !== TRUE) {\n\t\t\t\tthrow new Exception('Failed to create ZIP');\n\t\t\t}\n\t\t\t$files = new RecursiveIteratorIterator(\n\t\t\t\tnew RecursiveDirectoryIterator($directoryPath)\n\t\t\t);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$file = strval($file);\n\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$zip->addFile($file, substr($file, strlen($directoryPath)));\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\tchmod($outputPath, 0777);\n\t\t}\n\t\tzipDirectory(${js.directoryPath}, ${js.outputPath});\n\t\t`,\n\t});\n\n\tconst fileBuffer = await php.readFileAsBuffer(outputPath);\n\tphp.unlink(outputPath);\n\treturn fileBuffer;\n};\n"],"names":["createMemoizedFetch","originalFetch","fetches","url","options","response","left","right","RecommendedPHPVersion","tmpPath","unzipFile","php","zipPath","extractToPath","overwriteFiles","zipFile","js","phpVars","zipDirectory","directoryPath","outputPath","fileBuffer"],"mappings":";AAcgB,SAAAA,EACfC,IAGyB,OACxB;AACD,QAAMC,IAAsC,CAAC;AAEtC,SAAA,eAA6BC,GAAaC,GAAuB;AACnE,QAAA,CAACF,EAAQC,CAAG,GAAG;AAClB,MAAAD,EAAQC,CAAG,IAAI;AAAA,QACd,iBAAiBF,EAAcE,GAAKC,CAAO;AAAA,QAC3C,MAAM,eAAe;AAEpB,gBAAMC,IAAW,MAAMH,EAAQC,CAAG,EAAE,iBAC9B,CAACG,GAAMC,CAAK,IACjBL,EAAQC,CAAG,EAAE,mBAAoB,IAAI;AAC9B,iBAAAD,EAAAC,CAAG,EAAE,qBAAqBG,GAC3B,IAAI,SAASC,GAAO;AAAA,YAC1B,QAAQF,EAAS;AAAA,YACjB,YAAYA,EAAS;AAAA,YACrB,SAASA,EAAS;AAAA,UAAA,CAClB;AAAA,QAAA;AAAA,MAEH;AACA,YAAMA,IAAW,MAAMH,EAAQC,CAAG,EAAE;AAC5B,MAAAD,EAAAC,CAAG,EAAE,qBAAqBE,EAAS;AAAA,IAAA;AAGrC,WAAAH,EAAQC,CAAG,EAAE,aAAa;AAAA,EAClC;AACD;AC7BO,MAAMK,IAAwB,OAK/BC,IAAU,iBACHC,IAAY,OACxBC,GACAC,GACAC,GACAC,IAAiB,OACb;AACJ,MAAIF,aAAmB,MAAM;AAC5B,UAAMG,IAAUH;AACN,IAAAA,IAAAH,GACV,MAAME,EAAI;AAAA,MACTC;AAAA,MACA,IAAI,WAAW,MAAMG,EAAQ,YAAa,CAAA;AAAA,IAC3C;AAAA,EAAA;AAED,QAAMC,IAAKC,EAAQ;AAAA,IAClB,SAAAL;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,CACA;AACD,QAAMH,EAAI,IAAI;AAAA,IACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAyBQK,EAAG,OAAO,KAAKA,EAAG,aAAa,KAAKA,EAAG,cAAc;AAAA;AAAA,EAAA,CAEnE,GACG,MAAML,EAAI,WAAWF,CAAO,KACzB,MAAAE,EAAI,OAAOF,CAAO;AAE1B,GAEaS,IAAe,OAC3BP,GACAQ,MACI;AACJ,QAAMC,IAAa,YAAY,KAAK,OAAA,CAAQ,QACtCJ,IAAKC,EAAQ;AAAA,IAClB,eAAAE;AAAA,IACA,YAAAC;AAAA,EAAA,CACA;AACD,QAAMT,EAAI,IAAI;AAAA,IACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAoBSK,EAAG,aAAa,KAAKA,EAAG,UAAU;AAAA;AAAA,EAAA,CAEjD;AAED,QAAMK,IAAa,MAAMV,EAAI,iBAAiBS,CAAU;AACxD,SAAAT,EAAI,OAAOS,CAAU,GACdC;AACR;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../packages/playground/common/src/create-memoized-fetch.ts","../../../../packages/playground/common/src/index.ts"],"sourcesContent":["export interface CacheEntry {\n\tresponsePromise: Promise<Response>;\n\tunlockedBodyStream?: ReadableStream<Uint8Array>;\n\tnextResponse: () => Promise<Response>;\n}\n\n/**\n * Creates a fetch function that memoizes the response stream.\n * Calling it twice will return a response with the same status,\n * headers, and the body stream.\n * Memoization is keyed by URL. Method, headers etc are ignored.\n *\n * @param originalFetch The fetch function to memoize. Defaults to the global fetch.\n */\nexport function createMemoizedFetch(\n\toriginalFetch: (\n\t\tinput: RequestInfo | URL,\n\t\tinit?: RequestInit\n\t) => Promise<Response> = fetch\n) {\n\tconst fetches: Record<string, CacheEntry> = {};\n\n\treturn async function memoizedFetch(url: string, options?: RequestInit) {\n\t\tif (!fetches[url]) {\n\t\t\tfetches[url] = {\n\t\t\t\tresponsePromise: originalFetch(url, options),\n\t\t\t\tasync nextResponse() {\n\t\t\t\t\t// Wait for \"result\" to be set.\n\t\t\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\t\t\tconst [left, right] =\n\t\t\t\t\t\tfetches[url].unlockedBodyStream!.tee();\n\t\t\t\t\tfetches[url].unlockedBodyStream = left;\n\t\t\t\t\treturn new Response(right, {\n\t\t\t\t\t\tstatus: response.status,\n\t\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t\t\theaders: response.headers,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t};\n\t\t\tconst response = await fetches[url].responsePromise;\n\t\t\tfetches[url].unlockedBodyStream = response.body!;\n\t\t}\n\n\t\treturn fetches[url].nextResponse();\n\t};\n}\n","/**\n * Avoid adding new code here. @wp-playground/common should remain\n * as lean as possible.\n *\n * This package exists to avoid circular dependencies. Let's not\n * use it as a default place to add code that doesn't seem to fit\n * anywhere else. If there's no good place for your code, perhaps\n * it needs to be restructured? Or maybe there's a need for a new package?\n * Let's always consider these questions before adding new code here.\n */\n\nimport type { UniversalPHP } from '@php-wasm/universal';\nimport { phpVars } from '@php-wasm/util';\n\nexport { createMemoizedFetch } from './create-memoized-fetch';\n\nexport const RecommendedPHPVersion = '8.3';\n\n/**\n * Unzip a zip file inside Playground.\n */\nexport const unzipFile = async (\n\tphp: UniversalPHP,\n\tzipPath: string | File,\n\textractToPath: string,\n\toverwriteFiles = true\n) => {\n\t/**\n\t * Use a random file name to avoid conflicts across concurrent unzipFile()\n\t * calls.\n\t */\n\tconst tmpPath = `/tmp/file-${Math.random()}.zip`;\n\tif (zipPath instanceof File) {\n\t\tconst zipFile = zipPath;\n\t\tzipPath = tmpPath;\n\t\tawait php.writeFile(\n\t\t\tzipPath,\n\t\t\tnew Uint8Array(await zipFile.arrayBuffer())\n\t\t);\n\t}\n\tconst js = phpVars({\n\t\tzipPath,\n\t\textractToPath,\n\t\toverwriteFiles,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n function unzip($zipPath, $extractTo, $overwriteFiles = true)\n {\n if (!is_dir($extractTo)) {\n mkdir($extractTo, 0777, true);\n }\n $zip = new ZipArchive;\n $res = $zip->open($zipPath);\n if ($res === TRUE) {\n\t\t\t\tfor ($i = 0; $i < $zip->numFiles; $i++) {\n\t\t\t\t\t$filename = $zip->getNameIndex($i);\n\t\t\t\t\t$fileinfo = pathinfo($filename);\n\t\t\t\t\t$extractFilePath = rtrim($extractTo, '/') . '/' . $filename;\n\t\t\t\t\t// Check if file exists and $overwriteFiles is false\n\t\t\t\t\tif (!file_exists($extractFilePath) || $overwriteFiles) {\n\t\t\t\t\t\t// Extract file\n\t\t\t\t\t\t$zip->extractTo($extractTo, $filename);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$zip->close();\n\t\t\t\tchmod($extractTo, 0777);\n } else {\n throw new Exception(\"Could not unzip file: \" . $zip->getStatusString());\n }\n }\n unzip(${js.zipPath}, ${js.extractToPath}, ${js.overwriteFiles});\n `,\n\t});\n\tif (await php.fileExists(tmpPath)) {\n\t\tawait php.unlink(tmpPath);\n\t}\n};\n\nexport const zipDirectory = async (\n\tphp: UniversalPHP,\n\tdirectoryPath: string\n) => {\n\tconst outputPath = `/tmp/file${Math.random()}.zip`;\n\tconst js = phpVars({\n\t\tdirectoryPath,\n\t\toutputPath,\n\t});\n\tawait php.run({\n\t\tcode: `<?php\n\t\tfunction zipDirectory($directoryPath, $outputPath) {\n\t\t\t$zip = new ZipArchive;\n\t\t\t$res = $zip->open($outputPath, ZipArchive::CREATE);\n\t\t\tif ($res !== TRUE) {\n\t\t\t\tthrow new Exception('Failed to create ZIP');\n\t\t\t}\n\t\t\t$files = new RecursiveIteratorIterator(\n\t\t\t\tnew RecursiveDirectoryIterator($directoryPath)\n\t\t\t);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$file = strval($file);\n\t\t\t\tif (is_dir($file)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$zip->addFile($file, substr($file, strlen($directoryPath)));\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\tchmod($outputPath, 0777);\n\t\t}\n\t\tzipDirectory(${js.directoryPath}, ${js.outputPath});\n\t\t`,\n\t});\n\n\tconst fileBuffer = await php.readFileAsBuffer(outputPath);\n\tphp.unlink(outputPath);\n\treturn fileBuffer;\n};\n"],"names":["createMemoizedFetch","originalFetch","fetches","url","options","response","left","right","RecommendedPHPVersion","unzipFile","php","zipPath","extractToPath","overwriteFiles","tmpPath","zipFile","js","phpVars","zipDirectory","directoryPath","outputPath","fileBuffer"],"mappings":";AAcgB,SAAAA,EACfC,IAGyB,OACxB;AACD,QAAMC,IAAsC,CAAC;AAEtC,SAAA,eAA6BC,GAAaC,GAAuB;AACnE,QAAA,CAACF,EAAQC,CAAG,GAAG;AAClB,MAAAD,EAAQC,CAAG,IAAI;AAAA,QACd,iBAAiBF,EAAcE,GAAKC,CAAO;AAAA,QAC3C,MAAM,eAAe;AAEpB,gBAAMC,IAAW,MAAMH,EAAQC,CAAG,EAAE,iBAC9B,CAACG,GAAMC,CAAK,IACjBL,EAAQC,CAAG,EAAE,mBAAoB,IAAI;AAC9B,iBAAAD,EAAAC,CAAG,EAAE,qBAAqBG,GAC3B,IAAI,SAASC,GAAO;AAAA,YAC1B,QAAQF,EAAS;AAAA,YACjB,YAAYA,EAAS;AAAA,YACrB,SAASA,EAAS;AAAA,UAAA,CAClB;AAAA,QAAA;AAAA,MAEH;AACA,YAAMA,IAAW,MAAMH,EAAQC,CAAG,EAAE;AAC5B,MAAAD,EAAAC,CAAG,EAAE,qBAAqBE,EAAS;AAAA,IAAA;AAGrC,WAAAH,EAAQC,CAAG,EAAE,aAAa;AAAA,EAClC;AACD;AC7BO,MAAMK,IAAwB,OAKxBC,IAAY,OACxBC,GACAC,GACAC,GACAC,IAAiB,OACb;AAKJ,QAAMC,IAAU,aAAa,KAAK,OAAA,CAAQ;AAC1C,MAAIH,aAAmB,MAAM;AAC5B,UAAMI,IAAUJ;AACN,IAAAA,IAAAG,GACV,MAAMJ,EAAI;AAAA,MACTC;AAAA,MACA,IAAI,WAAW,MAAMI,EAAQ,YAAa,CAAA;AAAA,IAC3C;AAAA,EAAA;AAED,QAAMC,IAAKC,EAAQ;AAAA,IAClB,SAAAN;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,EAAA,CACA;AACD,QAAMH,EAAI,IAAI;AAAA,IACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAyBQM,EAAG,OAAO,KAAKA,EAAG,aAAa,KAAKA,EAAG,cAAc;AAAA;AAAA,EAAA,CAEnE,GACG,MAAMN,EAAI,WAAWI,CAAO,KACzB,MAAAJ,EAAI,OAAOI,CAAO;AAE1B,GAEaI,IAAe,OAC3BR,GACAS,MACI;AACJ,QAAMC,IAAa,YAAY,KAAK,OAAA,CAAQ,QACtCJ,IAAKC,EAAQ;AAAA,IAClB,eAAAE;AAAA,IACA,YAAAC;AAAA,EAAA,CACA;AACD,QAAMV,EAAI,IAAI;AAAA,IACb,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAoBSM,EAAG,aAAa,KAAKA,EAAG,UAAU;AAAA;AAAA,EAAA,CAEjD;AAED,QAAMK,IAAa,MAAMX,EAAI,iBAAiBU,CAAU;AACxD,SAAAV,EAAI,OAAOU,CAAU,GACdC;AACR;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/common",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "Common exports and utilities for WordPress Playground",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "access": "public",
36
36
  "directory": "../../../dist/packages/playground/common"
37
37
  },
38
- "gitHead": "c9d2979597806e5f14985a0607c9c61e48d54c9b",
38
+ "gitHead": "47972f56affb733e7a3b8734ed29229a00364ced",
39
39
  "dependencies": {
40
40
  "ini": "4.1.2",
41
- "@php-wasm/universal": "2.0.13",
42
- "@php-wasm/util": "2.0.13"
41
+ "@php-wasm/universal": "2.0.14",
42
+ "@php-wasm/util": "2.0.14"
43
43
  },
44
44
  "overrides": {
45
45
  "rollup": "^4.34.6",