@stlite/desktop 0.22.0 → 0.22.2

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 CHANGED
@@ -25,7 +25,7 @@ Convert your [Streamlit](https://streamlit.io/) application into a desktop app w
25
25
  },
26
26
  "devDependencies": {
27
27
  "@stlite/desktop": "^0.21.0",
28
- "electron": "^22.0.0",
28
+ "electron": "22.0.0",
29
29
  "electron-builder": "^23.6.0"
30
30
  }
31
31
  }
@@ -3,14 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.walkRead = void 0;
4
4
  const fsPromises = require("fs/promises");
5
5
  const path = require("path");
6
- async function walkRead(dirPath, relative = true) {
6
+ /**
7
+ * Returns an object whose keys are absolute paths of the files and values are the file contents.
8
+ * Note that the paths are OS-specific, "/" for POSIX and "\" for Windows,
9
+ * so this function is only expected to be called from `walkRead()` that converts the paths to be POSIX.
10
+ */
11
+ async function walkReadAbsPath(dirPath) {
7
12
  const fileContents = {};
8
13
  const childNames = await fsPromises.readdir(dirPath);
9
14
  await Promise.all(childNames.map(async (childName) => {
10
15
  const childPath = path.join(dirPath, childName);
11
16
  const stat = await fsPromises.stat(childPath);
12
17
  if (stat.isDirectory()) {
13
- const childFileContents = await walkRead(childPath, false);
18
+ const childFileContents = await walkReadAbsPath(childPath);
14
19
  Object.assign(fileContents, childFileContents);
15
20
  }
16
21
  else {
@@ -18,13 +23,15 @@ async function walkRead(dirPath, relative = true) {
18
23
  fileContents[childPath] = fileBin;
19
24
  }
20
25
  }));
21
- if (!relative) {
22
- return fileContents;
23
- }
26
+ return fileContents;
27
+ }
28
+ async function walkRead(dirPath) {
29
+ const fileContents = await walkReadAbsPath(dirPath);
24
30
  const relPathFileContents = {};
25
31
  Object.keys(fileContents).forEach((absPath) => {
26
32
  const relPath = path.relative(dirPath, absPath);
27
- relPathFileContents[relPath] = fileContents[absPath];
33
+ const posixRelPath = relPath.split(path.sep).join(path.posix.sep); // Convert the path separators on Windows to POSIX ones.
34
+ relPathFileContents[posixRelPath] = fileContents[absPath];
28
35
  });
29
36
  return relPathFileContents;
30
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "/",
6
6
  "main": "./build/electron/main.js",
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@craco/craco": "^6.1.2",
60
- "@stlite/common": "^0.22.0",
61
- "@stlite/common-react": "^0.22.0",
62
- "@stlite/kernel": "^0.22.0",
60
+ "@stlite/common": "^0.22.2",
61
+ "@stlite/common-react": "^0.22.2",
62
+ "@stlite/kernel": "^0.22.2",
63
63
  "@testing-library/react": "^11.2.7",
64
64
  "@testing-library/user-event": "^13.1.9",
65
65
  "@types/jest": "^26.0.19",
@@ -67,7 +67,7 @@
67
67
  "@types/react": "^17.0.7",
68
68
  "@types/react-dom": "^17.0.5",
69
69
  "@types/yargs": "^17.0.13",
70
- "electron": "^22.0.0",
70
+ "electron": "22.0.0",
71
71
  "electron-builder": "^23.6.0",
72
72
  "electron-reload": "^2.0.0-alpha.1",
73
73
  "esbuild": "^0.16.6",