@stlite/desktop 0.10.2 → 0.11.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.
Files changed (3) hide show
  1. package/README.md +1 -53
  2. package/package.json +2 -2
  3. package/.env +0 -4
package/README.md CHANGED
@@ -1,53 +1 @@
1
- ## stlite Electron app
2
-
3
- This project has been initialized with Create React App v4.0.3, which version is compatible with the Streamlit frontend.
4
- So the directory structure and configurations are following it.
5
- The React app in `./src` will be used as a frontend app of the Electron app, running in the renderer process.
6
-
7
- Upon it, the source code for the Electron main process has been added at `./electron` that will be built into the same directory as the React app, `./build`.
8
-
9
- This project structure is based on the following references.
10
-
11
- - [Quick Start - Electron](https://www.electronjs.org/docs/latest/tutorial/quick-start)
12
- - [Create React App(typescript)をベースに electron 環境を構築する](https://zenn.dev/niwaringo/articles/af693596ef948e)
13
- - [Electron + React + TypeScript の開発環境構築 (webpack 編)](https://zenn.dev/sprout2000/articles/5d7b350c2e85bc)
14
-
15
- ## Workflow to build the app
16
-
17
- ### Build the base app
18
-
19
- ```sh
20
- yarn build
21
- ```
22
-
23
- This command builds the Electron app including both the main process (from `./electron`) and the renderer process (from `./src` with CRA) into `./build` directory.
24
-
25
- At this point, the built app **does not contain the user code and data for Streamlit like `streamlit_app.py`**.
26
- We will bundle it at the next step.
27
-
28
- ### Inject the user code and data and the installed requirements snapshot
29
-
30
- ```
31
- ./bin/dump_snapshot.ts <app source directory> [--requirements <requirement1> <requirement2> ... <requirementN>]
32
- ```
33
-
34
- This command will do 2 things;
35
-
36
- 1. Copy the `<app source directory>` into `./build`, which will be loaded as a Streamlit app at runtime.
37
- 2. Create a temporary Pyodide environment, install the requirements there, create the snapshot file containing the installed files, and put the file into `./build`.
38
-
39
- The Electron app built in the previous step will load these files and serve the Streamlit app at runtime.
40
-
41
- In other words, we can replace the Streamlit app just by re-running `./bin/dump_snapshot.ts`, without re-building the app here with `yarn build`.
42
-
43
- Now the `./build` is ready to be packaged.
44
- At this point, `yarn serve` can be used to preview the app.
45
-
46
- ### Package the final Electron app
47
-
48
- ```
49
- yarn dist
50
- ```
51
-
52
- Create a distributable package using `electron-builder`.
53
- This set-up is just following [its tutorial](https://www.electron.build/#quick-setup-guide)
1
+ # `@stlite/desktop`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "./",
6
6
  "main": "./build/electron/main.js",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@craco/craco": "^6.1.2",
51
- "@stlite/kernel": "^0.10.2",
51
+ "@stlite/kernel": "^0.11.0",
52
52
  "@testing-library/react": "^11.2.7",
53
53
  "@testing-library/user-event": "^13.1.9",
54
54
  "@types/jest": "^26.0.19",
package/.env DELETED
@@ -1,4 +0,0 @@
1
- # For Content-Security-Policy compatibility.
2
- # Ref: https://drag13.io/posts/react-inline-runtimer-chunk/index.html
3
- INLINE_RUNTIME_CHUNK=false
4
- IMAGE_INLINE_SIZE_LIMIT=0