nw-builder 4.6.4 → 4.7.1

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
@@ -79,6 +79,8 @@ Node manifest usage:
79
79
 
80
80
  ### Get Mode
81
81
 
82
+ > Deprecation warning: From v4.6.4 onward, run mode is deprecated. This logic will be ported over to nwjs/npm-installer repo and removed in the next major release.
83
+
82
84
  By default you get the normal build of the latest NW.js release for your specific platform and arch. For more information, please refer to the API reference.
83
85
 
84
86
  ```javascript
@@ -191,7 +193,7 @@ Options
191
193
  | flavor | `"normal" \| "sdk"` | `"normal"` | Runtime flavor |
192
194
  | platform | `"linux" \| "osx" \| "win"` | | Host platform |
193
195
  | arch | `"ia32" \| "x64" \| "arm64"` | | Host architecture |
194
- | downloadUrl | `"https://dl.nwjs.io" \| "https://npm.taobao.org/mirrors/nwjs" \| https://npmmirror.com/mirrors/nwjs \| "https://github.com/corwin-of-amber/nw.js/releases/"` | `"https://dl.nwjs.io"` | Download server |
196
+ | downloadUrl | `"https://dl.nwjs.io" \| "https://npm.taobao.org/mirrors/nwjs" \| https://npmmirror.com/mirrors/nwjs \| "https://github.com/corwin-of-amber/nw.js/releases/"` | `"https://dl.nwjs.io"` | Download server. Supports file systems too (for example `file:///home/localghost/nwjs_mirror`) |
195
197
  | manifestUrl | `"https://nwjs.io/versions" \| "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json"` | `"https://nwjs.io/versions"` | Versions manifest |
196
198
  | cacheDir | `string` | `"./cache"` | Directory to cache NW binaries |
197
199
  | srcDir | `string` | `"./"` | File paths to application code |
@@ -287,7 +289,6 @@ nwbuild({
287
289
  ### Bugs
288
290
 
289
291
  - Managed Manifest is broken. If glob is disabled and srcDir has no package.json, build fails.
290
- - MacOS fails to unzip MacOS NW.js binaries consistently
291
292
  - Add back error, info, warn and debug logs
292
293
 
293
294
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.6.4",
3
+ "version": "4.7.1",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
@@ -49,27 +49,25 @@
49
49
  "demo": "cd test/fixture && node demo.js"
50
50
  },
51
51
  "devDependencies": {
52
- "@stylistic/eslint-plugin-js": "^1.5.4",
53
- "eslint": "^8.56.0",
52
+ "@stylistic/eslint-plugin-js": "^1.7.0",
53
+ "eslint": "^8.57.0",
54
54
  "eslint-config-tjw-jsdoc": "^1.0.5",
55
- "eslint-plugin-jsdoc": "^48.0.2",
56
- "eslint-plugin-markdown": "^3.0.1",
55
+ "eslint-plugin-jsdoc": "^48.2.1",
56
+ "eslint-plugin-markdown": "^4.0.1",
57
57
  "jsdoc": "^4.0.2",
58
- "markdownlint": "^0.33.0",
59
- "markdownlint-cli": "^0.38.0",
60
- "selenium-webdriver": "^4.16.0",
61
- "vitest": "^1.2.1"
58
+ "selenium-webdriver": "^4.18.1",
59
+ "vitest": "^1.4.0"
62
60
  },
63
61
  "dependencies": {
64
- "axios": "^1.6.7",
62
+ "axios": "^1.6.8",
65
63
  "cli-progress": "^3.12.0",
66
64
  "compressing": "^1.10.0",
67
65
  "glob": "^10.3.10",
68
66
  "node-gyp": "^10.0.1",
69
67
  "plist": "^3.1.0",
70
68
  "rcedit": "^4.0.1",
71
- "semver": "^7.5.4",
72
- "tar": "^6.2.0",
69
+ "semver": "^7.6.0",
70
+ "tar": "^6.2.1",
73
71
  "yargs": "^17.7.2",
74
72
  "yauzl-promise": "^4.0.0"
75
73
  },
@@ -88,7 +86,7 @@
88
86
  },
89
87
  "extends": [
90
88
  "eslint:recommended",
91
- "plugin:markdown/recommended",
89
+ "plugin:markdown/recommended-legacy",
92
90
  "tjw-jsdoc"
93
91
  ],
94
92
  "plugins": [
package/src/get/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
+ import url from "node:url";
3
4
 
4
5
  import decompress from "./decompress.js";
5
6
  import ffmpeg from "./ffmpeg.js";
@@ -23,6 +24,8 @@ import util from "../util.js";
23
24
 
24
25
  /**
25
26
  * Get binaries.
27
+ *
28
+ * @deprecated since v4.6.4. This logic will be ported over to `nwjs/npm-installer` repo and removed in the next major release (v5.0).
26
29
  *
27
30
  * @async
28
31
  * @function
@@ -31,6 +34,13 @@ import util from "../util.js";
31
34
  */
32
35
  async function get(options) {
33
36
 
37
+ const uri = new url.URL(options.downloadUrl);
38
+
39
+ /* Download server is the cached directory. */
40
+ if (uri.protocol === 'file:') {
41
+ options.cacheDir = path.resolve(decodeURIComponent(options.downloadUrl.slice('file://'.length)));
42
+ }
43
+
34
44
  /**
35
45
  * If `options.cacheDir` exists, then `true`. Otherwise, it is `false`.
36
46
  *