@componentor/quickjs-wasmfs-release-sync 0.31.7 → 0.31.8
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.
|
@@ -10,8 +10,8 @@ var aa="function"==typeof Object.defineProperties?Object.defineProperty:function
|
|
|
10
10
|
function d(a,b){if(b)a:{var c=ca;a=a.split(".");for(var e=0;e<a.length-1;e++){var f=a[e];if(!(f in c))break a;c=c[f]}a=a[a.length-1];e=c[a];b=b(e);b!=e&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function da(a){a=Math.trunc(a)||0;0>a&&(a+=this.length);if(!(0>a||a>=this.length))return this[a]}d("Array.prototype.at",function(a){return a?a:da});function h(a){return a?a:da}d("Int8Array.prototype.at",h);d("Uint8Array.prototype.at",h);d("Uint8ClampedArray.prototype.at",h);
|
|
11
11
|
d("Int16Array.prototype.at",h);d("Uint16Array.prototype.at",h);d("Int32Array.prototype.at",h);d("Uint32Array.prototype.at",h);d("Float32Array.prototype.at",h);d("Float64Array.prototype.at",h);d("String.prototype.at",function(a){return a?a:da});var m=moduleArg,ea,fa,ha=new Promise((a,b)=>{ea=a;fa=b}),ia="object"==typeof window,ja="function"==typeof importScripts;function ka(a){a={log:a||function(){}};for(const b of ka.vc)b(a);return m.quickJSEmscriptenExtensions=a}ka.vc=[];
|
|
12
12
|
m.quickjsEmscriptenInit=ka;ka.vc.push(a=>{a.getWasmMemory=function(){return p}});m.preRun=m.preRun||[];
|
|
13
|
-
m.preRun.push(
|
|
14
|
-
a);0===g||void 0===g?(b.push(a),console.log("[WasmFS preRun] Mounted OPFS",e,"at",a)):console.warn("[WasmFS preRun] Failed to mount",e,"error code:",g)}catch(k){console.warn("[WasmFS preRun] Error mounting",e,":",k.message)}}}0<b.length&&(console.log("[WasmFS preRun] Successfully mounted:",b),m._opfsMounted=!0,m._opfsMountedPaths=b)}catch(k){console.error("[WasmFS preRun] OPFS initialization failed:",k)}
|
|
13
|
+
m.preRun.push(function(){"undefined"!==typeof navigator&&navigator.storage&&navigator.storage.getDirectory?"function"!==typeof m.wasmfsOPFSGetOrCreateDir?console.log("[WasmFS] wasmfsOPFSGetOrCreateDir not available"):(m.addRunDependency("opfs-mount"),async function(){try{var a=await navigator.storage.getDirectory(),b=[],c;for await(c of a.entries()){var e=c[0],f=c[1];if("directory"===f.kind){a="/"+e;try{try{m.FS.stat(a);console.log("[WasmFS preRun] Skipping existing:",a);continue}catch(k){}var g=
|
|
14
|
+
await m.wasmfsOPFSGetOrCreateDir(f,a);0===g||void 0===g?(b.push(a),console.log("[WasmFS preRun] Mounted OPFS",e,"at",a)):console.warn("[WasmFS preRun] Failed to mount",e,"error code:",g)}catch(k){console.warn("[WasmFS preRun] Error mounting",e,":",k.message)}}}0<b.length&&(console.log("[WasmFS preRun] Successfully mounted:",b),m._opfsMounted=!0,m._opfsMountedPaths=b)}catch(k){console.error("[WasmFS preRun] OPFS initialization failed:",k)}finally{m.removeRunDependency("opfs-mount")}}()):console.log("[WasmFS] OPFS not available (not in browser or no storage API)")});
|
|
15
15
|
m.mountOPFS=async function(a="/opfs",b=null){async function c(f,g){if("function"===typeof m.wasmfsOPFSGetOrCreateDir)try{return await m.wasmfsOPFSGetOrCreateDir(f,g),!0}catch(k){try{const l=m.FS.stat(g);if(l&&"undefined"!==typeof l.mode)return console.log("[WasmFS] Mount point already exists at",g),!0}catch(l){}throw k;}else if(m.FS&&m.FS.filesystems&&m.FS.filesystems.Ac){try{m.mkdir(g)}catch(k){if("EEXIST"!==k.code&&20!==k.qc)throw k;}m.FS.mount(m.FS.filesystems.Ac,{root:f},g);return!0}return!1}
|
|
16
16
|
if(!navigator.storage||!navigator.storage.getDirectory)throw Error("OPFS is not supported in this browser");var e=await navigator.storage.getDirectory();if("/"===a&&(null===b||"/"===b||""===b)){a=[];for await(const [f,g]of e.entries())if("directory"===g.kind){b="/"+f;try{try{m.FS.stat(b);console.log("[WasmFS] Skipping existing directory:",b);continue}catch(k){}await c(g,b);a.push(b);console.log("[WasmFS] Mounted OPFS",f,"at",b)}catch(k){console.warn("[WasmFS] Failed to mount",f,":",k.message)}}console.log("[WasmFS] OPFS mounted directories:",
|
|
17
17
|
a);return 0<a.length?"/":null}if(b&&"/"!==b&&""!==b){const f=b.split("/").filter(Boolean);for(const g of f)e=await e.getDirectoryHandle(g,{create:!0})}if(!await c(e,a))throw Error("WasmFS OPFS backend not available. Ensure -lopfs.js is in build flags.");console.log("[WasmFS] OPFS mounted at",a,b?"(OPFS path: "+b+")":"");return a};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@componentor/quickjs-wasmfs-release-sync",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.31.
|
|
4
|
+
"version": "0.31.8",
|
|
5
5
|
"description": "QuickJS variant with WasmFS and OPFS support for native filesystem access in browsers without JS boundary crossing.",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@componentor/quickjs-ffi-types": "0.31.
|
|
46
|
+
"@componentor/quickjs-ffi-types": "0.31.8"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@jitl/tsconfig": "0.31.
|
|
49
|
+
"@jitl/tsconfig": "0.31.8"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "pnpm run build:c && pnpm run build:ts",
|