@stlite/desktop 0.45.1 → 0.45.3

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.
@@ -14,4 +14,4 @@ var K=Object.create;var D=Object.defineProperty;var I=Object.getOwnPropertyDescr
14
14
  print(os.listdir(site_packages))
15
15
  gzf.add(site_packages)
16
16
  `),console.log("Extract the archive file from EMFS");let l=t.FS.readFile(o);console.log(`Save the archive file (${e.saveTo})`),await n.default.writeFile(e.saveTo,l)}async function U(e){console.info("Copy the Streamlit app directory..."),console.log(`Copy ${e.sourceDir} to ${e.copyTo}`),await n.default.rm(e.copyTo,{recursive:!0,force:!0}),await v.default.copy(e.sourceDir,e.copyTo)}async function z(e){let t=await n.default.readFile(e,{encoding:"utf-8"});return(0,S.parseRequirementsTxt)(t)}async function N(e,t){let i=t.join(`
17
- `);await n.default.writeFile(e,i,{encoding:"utf-8"})}function V(e){e.forEach(t=>{let i;try{i=new URL(t)}catch{return}if(i.protocol==="emfs:"||i.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${t})`)})}async function G(e){let t=await F(),a=e.packages.map(s=>t[s]).map(s=>B(s.file_name));console.log("Downloading the used built-in packages..."),await Promise.all(a.map(async s=>{let o=r.default.resolve(e.destDir,"./pyodide",r.default.basename(s));console.log(`Download ${s} to ${o}`);let l=await(0,m.default)(s);if(!l.ok)throw new Error(`Failed to download ${s}: ${l.status} ${l.statusText}`);let c=await l.arrayBuffer();await n.default.writeFile(o,Buffer.from(c))}))}async function Q(e){let a={embed:(require(e.packageJsonPath).stlite?.desktop||{}).embed||!1},s=JSON.stringify(a,null,2);console.log(`Dump the manifest file -> ${e.manifestFilePath}`),console.log(s),await n.default.writeFile(e.manifestFilePath,s,{encoding:"utf-8"})}(0,T.default)((0,j.hideBin)(process.argv)).command("* <appHomeDirSource> [packages..]","Put the user code and data and the snapshot of the required packages into the build artifact.",()=>{},e=>{console.info(e)}).positional("appHomeDirSource",{describe:"The source directory of the user code and data that will be mounted in the Pyodide file system at app runtime",type:"string",demandOption:!0}).positional("packages",{describe:"Package names to install.",type:"string",array:!0}).options("requirement",{describe:"Install from the given requirements file. This option can be used multiple times.",array:!0,type:"string",alias:"r",default:[]}).options("localKernelWheels",{describe:"Use the locally installed kernel wheels",type:"boolean",alias:"l",default:!1}).options("keepOldBuild",{type:"boolean",default:!1,alias:"k",describe:"Keep the existing build directory contents except appHomeDir."}).parseAsync().then(async e=>{let t=process.cwd(),i=r.default.resolve(t,"./build");try{await n.default.access(e.appHomeDirSource)}catch{throw new Error(`${e.appHomeDirSource} does not exist.`)}let a=e.packages;for(let o of e.requirement)a=a.concat(await z(o));V(a);let s=await A({requirements:a,useLocalKernelWheels:e.localKernelWheels});console.log("The built-in packages loaded for the given requirements:"),console.log(s),await C({copyTo:i,keepOld:e.keepOldBuild}),await H({useLocalKernelWheels:e.localKernelWheels,requirements:a,usedBuiltinPackages:s,saveTo:r.default.resolve(i,"./site-packages-snapshot.tar.gz")}),await N(r.default.resolve(i,"./requirements.txt"),s),await U({sourceDir:e.appHomeDirSource,copyTo:r.default.resolve(i,"./streamlit_app")}),await G({packages:s,destDir:i}),await Q({packageJsonPath:r.default.resolve(t,"./package.json"),manifestFilePath:r.default.resolve(i,"./stlite-manifest.json")})});
17
+ `);await n.default.writeFile(e,i,{encoding:"utf-8"})}function V(e){e.forEach(t=>{let i;try{i=new URL(t)}catch{return}if(i.protocol==="emfs:"||i.protocol==="file:")throw new Error(`"emfs:" and "file:" protocols are not allowed for the requirement (${t})`)})}async function G(e){let t=await F(),a=e.packages.map(s=>t[s]).map(s=>B(s.file_name));console.log("Downloading the used built-in packages..."),await Promise.all(a.map(async s=>{let o=r.default.resolve(e.destDir,"./pyodide",r.default.basename(s));console.log(`Download ${s} to ${o}`);let l=await(0,m.default)(s);if(!l.ok)throw new Error(`Failed to download ${s}: ${l.status} ${l.statusText}`);let c=await l.arrayBuffer();await n.default.writeFile(o,Buffer.from(c))}))}async function Q(e){let a={embed:(require(e.packageJsonPath).stlite?.desktop||{}).embed||!1},s=JSON.stringify(a,null,2);console.log(`Dump the manifest file -> ${e.manifestFilePath}`),console.log(s),await n.default.writeFile(e.manifestFilePath,s,{encoding:"utf-8"})}(0,T.default)((0,j.hideBin)(process.argv)).command("* <appHomeDirSource> [packages..]","Put the user code and data and the snapshot of the required packages into the build artifact.",()=>{},e=>{console.info(e)}).positional("appHomeDirSource",{describe:"The source directory of the user code and data that will be mounted in the Pyodide file system at app runtime",type:"string",demandOption:!0}).positional("packages",{describe:"Package names to install.",type:"string",array:!0}).options("requirement",{describe:"Install from the given requirements file. This option can be used multiple times.",array:!0,type:"string",alias:"r",default:[]}).options("localKernelWheels",{describe:"Use the locally installed kernel wheels",type:"boolean",alias:"l",default:!1}).options("keepOldBuild",{type:"boolean",default:!1,alias:"k",describe:"Keep the existing build directory contents except appHomeDir."}).parseAsync().then(async e=>{let t=process.cwd(),i=r.default.resolve(t,"./build");try{await n.default.access(e.appHomeDirSource)}catch{throw new Error(`${e.appHomeDirSource} does not exist.`)}let a=e.packages??[];for(let o of e.requirement)a=a.concat(await z(o));V(a);let s=await A({requirements:a,useLocalKernelWheels:e.localKernelWheels});console.log("The built-in packages loaded for the given requirements:"),console.log(s),await C({copyTo:i,keepOld:e.keepOldBuild}),await H({useLocalKernelWheels:e.localKernelWheels,requirements:a,usedBuiltinPackages:s,saveTo:r.default.resolve(i,"./site-packages-snapshot.tar.gz")}),await N(r.default.resolve(i,"./requirements.txt"),s),await U({sourceDir:e.appHomeDirSource,copyTo:r.default.resolve(i,"./streamlit_app")}),await G({packages:s,destDir:i}),await Q({packageJsonPath:r.default.resolve(t,"./package.json"),manifestFilePath:r.default.resolve(i,"./stlite-manifest.json")})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.45.1",
3
+ "version": "0.45.3",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "/",
6
6
  "main": "./build/electron/main.js",
@@ -54,13 +54,13 @@
54
54
  "fs-extra": "^10.1.0",
55
55
  "node-fetch": "2",
56
56
  "pyodide": "0.24.1",
57
- "yargs": "^17.5.1"
57
+ "yargs": "^17.7.2"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@craco/craco": "^7.0.0",
61
- "@stlite/common": "^0.45.1",
62
- "@stlite/common-react": "^0.45.1",
63
- "@stlite/kernel": "^0.45.1",
61
+ "@stlite/common": "^0.45.3",
62
+ "@stlite/common-react": "^0.45.3",
63
+ "@stlite/kernel": "^0.45.3",
64
64
  "@streamlit/app": "1.30.0",
65
65
  "@testing-library/react": "^12.1.4",
66
66
  "@testing-library/user-event": "^14.0.0",
@@ -68,11 +68,11 @@
68
68
  "@types/node": "^16.18.12",
69
69
  "@types/react": "^17.0.7",
70
70
  "@types/react-dom": "^17.0.5",
71
- "@types/yargs": "^17.0.13",
71
+ "@types/yargs": "^17.0.32",
72
72
  "electron": "28.2.1",
73
73
  "electron-builder": "^24.9.1",
74
74
  "electron-reload": "^2.0.0-alpha.1",
75
- "esbuild": "^0.16.6",
75
+ "esbuild": "^0.20.0",
76
76
  "parquet-wasm": "^0.4.0",
77
77
  "raw-loader": "^4.0.2",
78
78
  "react": "^17.0.2",