@stlite/desktop 0.17.0 → 0.18.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.
@@ -24,16 +24,20 @@ async function copyBuildDirectory(options) {
24
24
  console.warn(`sourceDir == destDir (${sourceDir}). Are you in the development environment? Skip copying the directory.`);
25
25
  return;
26
26
  }
27
- if (!options.override) {
27
+ if (options.keepOld) {
28
28
  try {
29
29
  await promises_1.default.access(options.copyTo);
30
- console.info(`${options.copyTo} already exists. Skip copying.`);
30
+ console.info(`${options.copyTo} already exists. Use it and skip copying.`);
31
31
  return;
32
32
  }
33
- catch { }
33
+ catch {
34
+ // If the destination directory does not exist
35
+ throw new Error(`${options.copyTo} does not exist even though the \`keepOld\` option is specified`);
36
+ }
34
37
  }
35
38
  console.log(`Copy ${sourceDir} to ${options.copyTo}`);
36
- fs_extra_1.default.copy(sourceDir, options.copyTo);
39
+ await promises_1.default.rm(options.copyTo, { recursive: true, force: true });
40
+ await fs_extra_1.default.copy(sourceDir, options.copyTo);
37
41
  }
38
42
  async function installLocalWheel(pyodide, localPath) {
39
43
  console.log(`Install the local wheel ${localPath}`);
@@ -149,11 +153,11 @@ function verifyRequirements(requirements) {
149
153
  alias: "l",
150
154
  default: false,
151
155
  })
152
- .options("force", {
156
+ .options("keepOldBuild", {
153
157
  type: "boolean",
154
158
  default: false,
155
- alias: "f",
156
- describe: "Forcefully copy the directory even if the destination directory already exists.",
159
+ alias: "k",
160
+ describe: "Keep the existing build directory contents except appHomeDir.",
157
161
  })
158
162
  .parseAsync()
159
163
  .then(async (args) => {
@@ -169,7 +173,7 @@ function verifyRequirements(requirements) {
169
173
  requirements = requirements.concat(await readRequirements(requirementTxtFilePath));
170
174
  }
171
175
  verifyRequirements(requirements);
172
- await copyBuildDirectory({ copyTo: destDir, override: args.force });
176
+ await copyBuildDirectory({ copyTo: destDir, keepOld: args.keepOldBuild });
173
177
  await createSitePackagesSnapshot({
174
178
  useLocalKernelWheels: args.localKernelWheels,
175
179
  requirements: requirements,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stlite/desktop",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "/",
6
6
  "main": "./build/electron/main.js",
@@ -25,7 +25,7 @@
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 .\"",
26
26
  "build:app": "yarn build:web && yarn build:electron && yarn build:pyodide",
27
27
  "build": "yarn build:app && yarn build:bin",
28
- "serve": "NODE_ENV=\"production\" electron .",
28
+ "serve": "cross-env NODE_ENV=production electron .",
29
29
  "pack": "electron-builder --dir",
30
30
  "dist": "electron-builder",
31
31
  "fix:eslint": "eslint --fix '{src,electron,bin}/**/*.{ts,tsx}'",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@craco/craco": "^6.1.2",
52
- "@stlite/kernel": "^0.17.0",
52
+ "@stlite/kernel": "^0.18.0",
53
53
  "@testing-library/react": "^11.2.7",
54
54
  "@testing-library/user-event": "^13.1.9",
55
55
  "@types/jest": "^26.0.19",