@stlite/desktop 0.26.0 → 0.27.0
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/README.md +2 -2
- package/bin/dump_artifacts.js +1 -1
- package/build/asset-manifest.json +8 -8
- package/build/index.html +1 -1
- package/build/static/js/{2632.3ed5d578.chunk.js → 2632.13f2d6fb.chunk.js} +1 -1
- package/build/static/js/{3392.d73d4efc.chunk.js → 3392.5f81677b.chunk.js} +1 -1
- package/build/static/js/6391.5417f789.chunk.js +1 -0
- package/build/static/js/{9462.6616e921.chunk.js → 9462.e56f97b3.chunk.js} +1 -1
- package/build/static/js/{9551.e50bee9b.chunk.js → 9551.f4ae413b.chunk.js} +1 -1
- package/build/static/js/main.915cbd3b.js +28 -0
- package/package.json +5 -5
- package/build/pyodide/openssl-1.1.1n.zip +0 -0
- package/build/pyodide/ssl-1.0.0.zip +0 -0
- package/build/static/js/6391.6cdac98a.chunk.js +0 -1
- package/build/static/js/main.91a73418.js +0 -28
- /package/build/static/js/{main.91a73418.js.LICENSE.txt → main.915cbd3b.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stlite/desktop",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "/",
|
|
6
6
|
"main": "./build/electron/main.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"eject": "craco eject",
|
|
20
20
|
"start:electron": "tsc -p electron -w",
|
|
21
21
|
"build:electron": "tsc -p electron",
|
|
22
|
-
"build:pyodide": "curl -L https://github.com/pyodide/pyodide/releases/download/0.22.1/pyodide-0.22.1.tar.bz2 | tar xj -C ./build --files-from=./pyodide-files.txt",
|
|
22
|
+
"build:pyodide": "curl -L https://github.com/pyodide/pyodide/releases/download/0.22.1/pyodide-core-0.22.1.tar.bz2 | tar xj -C ./build --files-from=./pyodide-files.txt",
|
|
23
23
|
"build:bin": "./scripts/build_bin.js && sed -i'' -e '1 s/^#!.*$/#!\\/usr\\/bin\\/env node/' ./bin/*.js",
|
|
24
24
|
"typecheck": "yarn tsc --noEmit -p electron",
|
|
25
25
|
"start": "concurrently \"cross-env BROWSER=none yarn start:web\" \"wait-on http://localhost:3000 && yarn start:electron\" \"wait-on http://localhost:3000 && tsc -p electron && cross-env NODE_ENV=\"development\" electron .\"",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@craco/craco": "^7.0.0",
|
|
60
|
-
"@stlite/common": "^0.
|
|
61
|
-
"@stlite/common-react": "^0.
|
|
62
|
-
"@stlite/kernel": "^0.
|
|
60
|
+
"@stlite/common": "^0.27.0",
|
|
61
|
+
"@stlite/common-react": "^0.27.0",
|
|
62
|
+
"@stlite/kernel": "^0.27.0",
|
|
63
63
|
"@testing-library/react": "^12.1.4",
|
|
64
64
|
"@testing-library/user-event": "^14.0.0",
|
|
65
65
|
"@types/jest": "^27.4.3",
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={56977:e=>{function t(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(r.length<2||2!==o||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",o=0):o=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),a=s,i=0;continue}}else if(2===r.length||1===r.length){r="",o=0,a=s,i=0;continue}t&&(r.length>0?r+="/..":r="..",o=2)}else r.length>0?r+="/"+e.slice(a+1,s):r=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===n&&-1!==i?++i:i=-1}return r}var r={resolve:function(){for(var e,r="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),t(i),0!==i.length&&(r=i+"/"+r,o=47===i.charCodeAt(0))}return r=n(r,!o),o?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&o&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var o=arguments[n];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var a=e.length,i=a-o,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var l=n.length-s,c=i<l?i:l,g=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(47===n.charCodeAt(s+d))return n.slice(s+d+1);if(0===d)return n.slice(s+d)}else i>c&&(47===e.charCodeAt(o+d)?g=d:0===d&&(g=0));break}var u=e.charCodeAt(o+d);if(u!==n.charCodeAt(s+d))break;47===u&&(g=d)}var p="";for(d=o+g+1;d<=a;++d)d!==a&&47!==e.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(s+g):(s+=g,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(n=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?r?"/":".":r&&1===o?"//":e.slice(0,o)},basename:function(e,n){if(void 0!==n&&"string"!==typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,o=0,a=-1,i=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!i){o=r+1;break}}else-1===l&&(i=!1,l=r+1),s>=0&&(c===n.charCodeAt(s)?-1===--s&&(a=r):(s=-1,a=l))}return o===a?a=l:-1===a&&(a=e.length),e.slice(o,a)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!i){o=r+1;break}}else-1===a&&(i=!1,a=r+1);return-1===a?"":e.slice(o,a)},extname:function(e){t(e);for(var n=-1,r=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var l=e.charCodeAt(s);if(47!==l)-1===o&&(a=!1,o=s+1),46===l?-1===n?n=s:1!==i&&(i=1):-1!==n&&(i=-1);else if(!a){r=s+1;break}}return-1===n||-1===o||0===i||1===i&&n===o-1&&n===r+1?"":e.slice(n,o)},format:function(e){if(null===e||"object"!==typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}("/",e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,o=e.charCodeAt(0),a=47===o;a?(n.root="/",r=1):r=0;for(var i=-1,s=0,l=-1,c=!0,g=e.length-1,d=0;g>=r;--g)if(47!==(o=e.charCodeAt(g)))-1===l&&(c=!1,l=g+1),46===o?-1===i?i=g:1!==d&&(d=1):-1!==i&&(d=-1);else if(!c){s=g+1;break}return-1===i||-1===l||0===d||1===d&&i===l-1&&i===s+1?-1!==l&&(n.base=n.name=0===s&&a?e.slice(1,l):e.slice(s,l)):(0===s&&a?(n.name=e.slice(1,i),n.base=e.slice(1,l)):(n.name=e.slice(s,i),n.base=e.slice(s,l)),n.ext=e.slice(i,l)),s>0?n.dir=e.slice(0,s-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;!function(e){function t(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e}function n(e){return Array.isArray(e)}function r(e,o){if(e===o)return!0;if(t(e)||t(o))return!1;var a=n(e),i=n(o);return a===i&&(a&&i?function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;++n)if(!r(e[n],t[n]))return!1;return!0}(e,o):function(e,t){if(e===t)return!0;for(var n in e)if(void 0!==e[n]&&!(n in t))return!1;for(var n in t)if(void 0!==t[n]&&!(n in e))return!1;for(var n in e){var o=e[n],a=t[n];if(void 0!==o||void 0!==a){if(void 0===o||void 0===a)return!1;if(!r(o,a))return!1}}return!0}(e,o))}function o(e){return t(e)?e:n(e)?function(e){for(var t=new Array(e.length),n=0,r=e.length;n<r;++n)t[n]=o(e[n]);return t}(e):function(e){var t={};for(var n in e){var r=e[n];void 0!==r&&(t[n]=o(r))}return t}(e)}e.emptyObject=Object.freeze({}),e.emptyArray=Object.freeze([]),e.isPrimitive=t,e.isArray=n,e.isObject=function(e){return!t(e)&&!n(e)},e.deepEqual=r,e.deepCopy=o}(e||(e={}));!function(){function e(){this._types=[],this._values=[]}e.prototype.types=function(){return this._types.slice()},e.prototype.hasData=function(e){return-1!==this._types.indexOf(e)},e.prototype.getData=function(e){var t=this._types.indexOf(e);return-1!==t?this._values[t]:void 0},e.prototype.setData=function(e,t){this.clearData(e),this._types.push(e),this._values.push(t)},e.prototype.clearData=function(e){var t=this._types.indexOf(e);-1!==t&&(this._types.splice(t,1),this._values.splice(t,1))},e.prototype.clear=function(){this._types.length=0,this._values.length=0}}();var t,r,o=function(){function e(){var e=this;this.promise=new Promise((function(t,n){e._resolve=t,e._reject=n}))}return e.prototype.resolve=function(e){(0,this._resolve)(e)},e.prototype.reject=function(e){(0,this._reject)(e)},e}();function a(e){for(var t=0,n=0,r=e.length;n<r;++n)n%4===0&&(t=4294967295*Math.random()>>>0),e[n]=255&t,t>>>=8}!function(e){e.getRandomValues=function(){var e="undefined"!==typeof window&&(window.crypto||window.msCrypto)||null;return e&&"function"===typeof e.getRandomValues?function(t){return e.getRandomValues(t)}:a}()}(t||(t={})),function(e){e.uuid4=function(e){for(var t=new Uint8Array(16),n=new Array(256),r=0;r<16;++r)n[r]="0"+r.toString(16);for(r=16;r<256;++r)n[r]=r.toString(16);return function(){return e(t),t[6]=64|15&t[6],t[8]=128|63&t[8],n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}(t.getRandomValues)}(r||(r={}));var i=n(56977),s=n.n(i);function l(e,t){const n=s().normalize(t),r=s().dirname(n).split("/"),o=[];for(const i of r){o.push(i);const t=o.join("/");if(e.FS.analyzePath(t).exists){if(e.FS.isDir(t))throw new Error(`"${t}" already exists and is not a directory.`)}else try{e.FS.mkdir(t)}catch(a){throw console.error(`Failed to create a directory "${t}"`),a}}}function c(e,t,n,r){l(e,t),e.FS.writeFile(t,n,r)}function g(e){e.forEach((e=>{let t;try{t=new URL(e)}catch(n){return}if("emfs:"===t.protocol||"file:"===t.protocol)throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${e})`)}))}var d=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(t){a(t)}}function s(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))};let u,p;const f=self,h=new o;function m(e){f.postMessage({type:"event:progress",data:{message:e}})}const y=function(){return d(this,void 0,void 0,(function*(){const{entrypoint:e,files:t,requirements:n,wheels:r,mountedSitePackagesSnapshotFilePath:o,pyodideEntrypointUrl:a}=yield h.promise;if(m("Loading Pyodide."),console.debug("Import the entrypoint script."),importScripts(null!==a&&void 0!==a?a:"https://cdn.jsdelivr.net/pyodide/v0.22.1/full/pyodide.js"),console.debug("Loading Pyodide"),u=yield loadPyodide({stdout:console.log,stderr:console.error}),console.debug("Loaded Pyodide"),m("Mounting files."),Object.keys(t).forEach((e=>{const{data:n,opts:r}=t[e];console.debug(`Write a file "${e}"`),c(u,e,n,r)})),m("Loading the initially required packages."),console.debug("Loading the initially necessary packages"),yield u.loadPackage(["ssl"]),console.debug("Loaded the initially necessary packages"),o)m("Restoring the snapshot."),yield u.runPythonAsync("import tarfile, shutil, site"),yield u.runPythonAsync("\n site_packages_dirs = site.getsitepackages()\n for site_packages in site_packages_dirs:\n shutil.rmtree(site_packages)\n "),console.debug(`Unarchive ${o}`),yield u.runPythonAsync(`\n with tarfile.open("${o}", "r") as tar_gz_file:\n tar_gz_file.extractall("/")\n `),console.debug("Restored the snapshot");else{if(!r)throw new Error("Neither snapshot nor wheel files are provided.");{m("Installing streamlit and its dependencies."),console.debug("Loading tornado, pyarrow, and streamlit"),yield u.loadPackage("micropip");const e=u.pyimport("micropip");yield e.install.callKwargs([r.tornado,r.pyarrow],{keep_going:!0}),yield e.install.callKwargs([r.streamlit],{keep_going:!0}),console.debug("Loaded tornado, pyarrow, and streamlit"),m("Installing the requirements."),console.debug("Installing the requirements:",n),g(n),yield e.install.callKwargs(n,{keep_going:!0}),console.debug("Installed the requirements:",n)}}yield u.runPythonAsync("\n import importlib\n importlib.invalidate_caches()\n "),m("Loading streamlit package."),console.debug("Loading the Streamlit package"),yield u.runPythonAsync("\n import streamlit.runtime\n import streamlit.web\n "),console.debug("Loaded the Streamlit package"),m("Setting up the loggers."),console.debug("Setting the loggers"),yield u.runPythonAsync("\n import logging\n import streamlit.logger\n\n streamlit.logger.get_logger = logging.getLogger\n streamlit.logger.setup_formatter = None\n streamlit.logger.update_formatter = lambda *a, **k: None\n streamlit.logger.set_log_level = lambda *a, **k: None\n ");self.__logCallback__=e=>{e.startsWith("CRITICAL")||e.startsWith("ERROR")?console.error(e):e.startsWith("WARNING")?console.warn(e):e.startsWith("INFO")?console.info(e):e.startsWith("DEBUG")?console.debug(e):console.log(e)},yield u.runPythonAsync('\n from js import __logCallback__\n\n\n class JsHandler(logging.Handler):\n def emit(self, record):\n msg = self.format(record)\n __logCallback__(msg)\n\n\n main_formatter = logging.Formatter("%(levelname)s:%(name)s:%(message)s")\n\n js_handler = JsHandler()\n js_handler.setFormatter(main_formatter)\n\n root_logger = logging.getLogger()\n root_logger.handlers.clear()\n root_logger.addHandler(js_handler)\n root_logger.setLevel(logging.DEBUG)\n\n streamlit_handler = logging.getLogger("streamlit")\n streamlit_handler.setLevel(logging.DEBUG)\n '),console.debug("Set the loggers"),m("Mocking some Streamlit functions for the browser environment."),console.debug("Mocking some Streamlit functions"),yield u.runPythonAsync("\n import streamlit\n import contextlib\n\n @contextlib.contextmanager\n def spinner(*args, **kwargs):\n yield\n\n streamlit.spinner = spinner\n streamlit.runtime.caching.cache_utils.spinner = spinner\n streamlit.runtime.legacy_caching.caching.spinner = spinner\n "),console.debug("Mocked some Streamlit functions"),m("Booting up the Streamlit server."),console.debug("Defining the bootstrap functions"),yield u.runPythonAsync('\n import asyncio\n import os\n import streamlit\n import streamlit.web.bootstrap as bootstrap\n from streamlit.web.server import Server\n\n\n class BadArgumentUsage(Exception):\n pass\n\n\n class BadParameter(Exception):\n pass\n\n\n # Mimic streamlit.web.bootstrap.run() but exclude some code unnecessary for stlite environment\n def run(\n main_script_path,\n command_line,\n args,\n flag_options,\n ) -> None:\n bootstrap._fix_sys_path(main_script_path)\n bootstrap._fix_matplotlib_crash()\n bootstrap._fix_sys_argv(main_script_path, args)\n bootstrap._fix_pydeck_mapbox_api_warning()\n bootstrap._install_pages_watcher(main_script_path)\n\n # Create the server. It won\'t start running yet.\n server = Server(main_script_path, command_line)\n\n # Run the server.\n asyncio.get_event_loop().create_task(server.start())\n\n\n def _get_command_line_as_string():\n return "" # TODO\n\n\n def _main_run(file, args=None, flag_options=None):\n if args is None:\n args = []\n\n if flag_options is None:\n flag_options = {}\n\n command_line = _get_command_line_as_string()\n\n # Set a global flag indicating that we\'re "within" streamlit.\n streamlit._is_running_with_streamlit = True\n\n # check_credentials() # Disable credential check on Pyodide\n\n run(file, command_line, args, flag_options) # Call this customized run function instead of the original bootstrap.run.\n\n\n def main_hello(**kwargs):\n """Runs the Hello World script."""\n from streamlit.hello import Hello\n\n bootstrap.load_config_options(flag_options=kwargs)\n filename = Hello.__file__\n _main_run(filename, flag_options=kwargs)\n\n\n ACCEPTED_FILE_EXTENSIONS = ("py", "py3")\n\n\n def main_run(target, args=None, **kwargs):\n """Run a Python script, piping stderr to Streamlit.\n\n The script can be local or it can be an url. In the latter case, Streamlit\n will download the script to a temporary file and runs this file.\n\n """\n bootstrap.load_config_options(flag_options=kwargs)\n\n _, extension = os.path.splitext(target)\n if extension[1:] not in ACCEPTED_FILE_EXTENSIONS:\n if extension[1:] == "":\n raise BadArgumentUsage(\n "Streamlit requires raw Python (.py) files, but the provided file has no extension.\\nFor more information, please see https://docs.streamlit.io"\n )\n else:\n raise BadArgumentUsage(\n "Streamlit requires raw Python (.py) files, not %s.\\nFor more information, please see https://docs.streamlit.io"\n % extension\n )\n\n # stlite deals with the URL input in the JS layer,\n # so Python code does not take care of it and\n # `target` here can be assumed to be a file path, not a URL.\n\n if not os.path.exists(target):\n raise BadParameter("File does not exist: {}".format(target))\n _main_run(target, args, flag_options=kwargs)\n '),console.debug("Defined the bootstrap functions"),console.debug("Booting up the Streamlit server"),yield u.runPythonAsync('\n command_kwargs = {\n "server.headless": True, # Not to open the browser after launching\n "global.dataFrameSerialization": "legacy", # Not to use PyArrow\n "server.enableXsrfProtection": False, # Disable XSRF protection as it relies on cookies\n "browser.gatherUsageStats": False,\n }\n '),yield u.runPythonAsync(`main_run("${e}", **command_kwargs)`),console.debug("Booted up the Streamlit server"),console.debug("Setting up the HTTP server"),yield u.runPythonAsync("\n from tornado.httpserver import HTTP_SERVER\n "),p=u.globals.get("HTTP_SERVER").copy(),console.debug("Set up the HTTP server"),f.postMessage({type:"event:loaded"})}))}().catch((e=>{throw f.postMessage({type:"event:error",data:{error:e}}),e}));self.onmessage=e=>d(void 0,void 0,void 0,(function*(){const t=e.data;if("initData"===t.type)return void h.resolve(t.data);yield y;const n=e.ports[0];try{switch(t.type){case"websocket:connect":{console.debug("websocket:connect",t.data);const{path:e}=t.data;p.start_websocket(e,((e,t)=>{if(t){const t=e.getBuffer("u8");e.destroy();const n=new Uint8ClampedArray(t.data.buffer,t.data.byteOffset,t.data.byteLength);f.postMessage({type:"websocket:message",data:{payload:new Uint8Array(n)}})}else f.postMessage({type:"websocket:message",data:{payload:e}})})),n.postMessage({type:"reply"});break}case"websocket:send":{console.debug("websocket:send",t.data);const{payload:e}=t.data;p.receive_websocket_from_js(e);break}case"http:request":{console.debug("http:request",t.data);const{request:e}=t.data,r=(e,t,r)=>{const o=t.toJs(),a=r.toJs();console.debug({statusCode:e,headers:o,body:a});const i={type:"http:response",data:{response:{statusCode:e,headers:o,body:a}}};n.postMessage(i)};p.receive_http_from_js(e.method,e.path,e.headers,e.body,r);break}case"file:write":{const{path:e,data:r,opts:o}=t.data;console.debug(`Write a file "${e}"`),c(u,e,r,o),n.postMessage({type:"reply"});break}case"file:rename":{const{oldPath:e,newPath:r}=t.data;console.debug(`Rename "${e}" to ${r}`),function(e,t,n){l(e,n),e.FS.rename(t,n)}(u,e,r),n.postMessage({type:"reply"});break}case"file:unlink":{const{path:e}=t.data;console.debug(`Remove "${e}`),u.FS.unlink(e),n.postMessage({type:"reply"});break}case"install":{const{requirements:e}=t.data,r=u.pyimport("micropip");console.debug("Install the requirements:",e),g(e),yield r.install.callKwargs(e,{keep_going:!0}).then((()=>{if(e.includes("matplotlib"))return u.runPythonAsync("\n bootstrap._fix_matplotlib_crash()\n ")})).then((()=>{console.debug("Successfully installed"),n.postMessage({type:"reply"})}))}}}catch(r){n.postMessage({type:"reply",error:r})}})),f.postMessage({type:"event:start"})})()})();
|