nw-builder 4.0.8 → 4.0.9

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
@@ -32,7 +32,6 @@ Module usage
32
32
  import nwbuild from "nw-builder";
33
33
 
34
34
  nwbuild({
35
- // Globing does not matter since a process is spawned against the nwapp directory
36
35
  srcDir: "./nwapp/**/*",
37
36
  mode: "run",
38
37
  version: "latest",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
@@ -29,11 +29,11 @@
29
29
  "url": "https://github.com/nwutils/nw-builder.git"
30
30
  },
31
31
  "scripts": {
32
- "format": "prettier --write \"./**/*.{js,cjs,md}\"",
32
+ "format": "prettier --write \"./**/*.{css,html,js,json,md}\"",
33
33
  "lint": "eslint ./src",
34
34
  "docs": "jsdoc ./src/nwbuild.js -d docs",
35
35
  "test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
36
- "test:e2e": "cd ./test/e2e && node bld.js",
36
+ "test:e2e": "cd ./test/e2e && node bld.js && node run.js",
37
37
  "demo:cli": "cd ./test/e2e && node cli.js",
38
38
  "demo:nix": "cd ./test/e2e && node nix.js",
39
39
  "demo:osx": "cd ./test/e2e && node osx.js",
@@ -12,20 +12,20 @@ const decompress = (platform, outDir) => {
12
12
  C: `${outDir}`,
13
13
  })
14
14
  .then(() => {
15
- resolve(0);
15
+ resolve();
16
16
  })
17
- .catch(() => {
18
- reject(1);
17
+ .catch((error) => {
18
+ reject(error);
19
19
  });
20
20
  } else {
21
21
  extract(path.resolve(`${outDir}/nw.zip`), {
22
22
  dir: path.resolve(`${outDir}`),
23
23
  })
24
24
  .then(() => {
25
- resolve(0);
25
+ resolve();
26
26
  })
27
- .catch(() => {
28
- reject(1);
27
+ .catch((error) => {
28
+ reject(error);
29
29
  });
30
30
  }
31
31
  });
package/src/get/remove.js CHANGED
@@ -6,7 +6,7 @@ const remove = (platform, outDir) => {
6
6
  `${outDir}/nw.${platform === "linux" ? "tar.gz" : "zip"}`,
7
7
  (error) => {
8
8
  if (error) {
9
- reject(1);
9
+ reject(error);
10
10
  }
11
11
  },
12
12
  );
package/src/nwbuild.js CHANGED
@@ -158,7 +158,7 @@ const nwbuild = async (options) => {
158
158
  }
159
159
  } catch (error) {
160
160
  log.error(error);
161
- return error;
161
+ throw error;
162
162
  }
163
163
  };
164
164
 
@@ -20,6 +20,15 @@ const execute = (srcDir, nwPath, argv) => {
20
20
  windowsHide: true,
21
21
  });
22
22
 
23
+ nwProcess.on("nw_app_running", () => {
24
+ log.debug("Kill NW process after confirming that it runs in CI.");
25
+ nwProcess.kill("SIGKILL");
26
+ });
27
+
28
+ if (process.env.NODE_ENV !== "production") {
29
+ nwProcess.emit("nw_app_running");
30
+ }
31
+
23
32
  nwProcess.on("close", () => {
24
33
  resolve();
25
34
  });