nw-builder 4.13.14 → 4.13.16
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 +2 -2
- package/package.json +12 -12
- package/src/bld.js +5 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/util.js +8 -8
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and L
|
|
|
30
30
|
npm i -D nw-builder
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Every NW.js release includes a modified Node.js binary at a specific version. It is recommended to [install](https://nodejs.org/en/download/package-manager) exactly that version on the host system. Not doing so may download ABI incompatible Node modules. Consult the NW.js [versions manifest](https://nwjs.io/versions) for what Node.js version to install. It is recommended to use a Node version manager (such as [volta](https://volta.sh), n, nvm, or nvm-windows) to be able to easily install and switch between Node versions.
|
|
33
|
+
Every NW.js release includes a modified Node.js binary at a specific version. It is recommended to [install](https://nodejs.org/en/download/package-manager) exactly that version on the host system. Not doing so may download ABI incompatible Node modules. Consult the NW.js [versions manifest](https://nwjs.io/versions.json) for what Node.js version to install. It is recommended to use a Node version manager (such as [volta](https://volta.sh), n, nvm, or nvm-windows) to be able to easily install and switch between Node versions.
|
|
34
34
|
|
|
35
35
|
## Usage
|
|
36
36
|
|
|
@@ -215,7 +215,7 @@ Options
|
|
|
215
215
|
| platform | `"linux" \| "osx" \| "win"` | | Host platform |
|
|
216
216
|
| arch | `"ia32" \| "x64" \| "arm64"` | | Host architecture |
|
|
217
217
|
| 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`) |
|
|
218
|
-
| 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 |
|
|
218
|
+
| manifestUrl | `"https://nwjs.io/versions.json" \| "https://raw.githubusercontent.com/nwutils/nw-builder/main/src/util/osx.arm.versions.json"` | `"https://nwjs.io/versions.json"` | Versions manifest |
|
|
219
219
|
| cacheDir | `string` | `"./cache"` | Directory to cache NW binaries |
|
|
220
220
|
| cache | `boolean` | `true`| If true the existing cache is used. Otherwise it removes and redownloads it. |
|
|
221
221
|
| ffmpeg | `boolean` | `false`| If true the chromium ffmpeg is replaced by community version with proprietary codecs. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nw-builder",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.16",
|
|
4
4
|
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NW.js",
|
|
@@ -55,21 +55,21 @@
|
|
|
55
55
|
"demo:cli": "nwbuild --mode=get --flavor=sdk --glob=false --cacheDir=./node_modules/nw --logLevel=debug './tests/fixtures/app'"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@eslint/js": "^9.
|
|
59
|
-
"@vitest/coverage-v8": "^3.
|
|
58
|
+
"@eslint/js": "^9.30.1",
|
|
59
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
60
60
|
"base-volta-off-of-nwjs": "^1.0.5",
|
|
61
|
-
"eslint": "^9.
|
|
62
|
-
"eslint-plugin-jsdoc": "^
|
|
63
|
-
"globals": "^16.
|
|
64
|
-
"nw": "^0.
|
|
65
|
-
"selenium-webdriver": "^4.
|
|
61
|
+
"eslint": "^9.30.1",
|
|
62
|
+
"eslint-plugin-jsdoc": "^51.3.4",
|
|
63
|
+
"globals": "^16.3.0",
|
|
64
|
+
"nw": "^0.101.2",
|
|
65
|
+
"selenium-webdriver": "^4.34.0",
|
|
66
66
|
"vitest": "^3.0.7"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"archiver": "^7.0.1",
|
|
70
|
-
"axios": "^1.
|
|
71
|
-
"commander": "^
|
|
72
|
-
"glob": "^11.0.
|
|
70
|
+
"axios": "^1.10.0",
|
|
71
|
+
"commander": "^14.0.0",
|
|
72
|
+
"glob": "^11.0.3",
|
|
73
73
|
"node-gyp": "^11.2.0",
|
|
74
74
|
"plist": "^3.1.0",
|
|
75
75
|
"resedit": "^2.0.3",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"yauzl-promise": "^4.0.0"
|
|
79
79
|
},
|
|
80
80
|
"volta": {
|
|
81
|
-
"node": "
|
|
81
|
+
"node": "24.3.0",
|
|
82
82
|
"npm": "11.2.0"
|
|
83
83
|
}
|
|
84
84
|
}
|
package/src/bld.js
CHANGED
|
@@ -89,7 +89,7 @@ import setOsxConfig from './bld/osx.js';
|
|
|
89
89
|
* @property {"normal" | "sdk"} [flavor = "normal"] Build flavor
|
|
90
90
|
* @property {"linux" | "osx" | "win"} [platform] Target platform
|
|
91
91
|
* @property {"ia32" | "x64" | "arm64"} [arch] Target arch
|
|
92
|
-
* @property {string} [manifestUrl = "https://nwjs.io/versions"] Manifest URL
|
|
92
|
+
* @property {string} [manifestUrl = "https://nwjs.io/versions.json"] Manifest URL
|
|
93
93
|
* @property {string} [srcDir = "./src"] Source directory
|
|
94
94
|
* @property {string} [cacheDir = "./cache"] Cache directory
|
|
95
95
|
* @property {string} [outDir = "./out"] Out directory
|
|
@@ -172,7 +172,7 @@ async function bld({
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
const nodeVersion = releaseInfo.components.node;
|
|
175
|
+
// const nodeVersion = releaseInfo.components.node;
|
|
176
176
|
|
|
177
177
|
if (
|
|
178
178
|
managedManifest === true ||
|
|
@@ -192,7 +192,7 @@ async function bld({
|
|
|
192
192
|
|
|
193
193
|
if (nativeAddon === 'gyp') {
|
|
194
194
|
throw new Error('Rebuilding Node addons functionality is broken and has been disabled. This functionality may be removed in the future.');
|
|
195
|
-
buildNativeAddon({ cacheDir, version, platform, arch, outDir, nodeVersion });
|
|
195
|
+
// buildNativeAddon({ cacheDir, version, platform, arch, outDir, nodeVersion });
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
if (zip !== false) {
|
|
@@ -354,6 +354,7 @@ const setWinConfig = async ({ app, outDir }) => {
|
|
|
354
354
|
await fs.promises.writeFile(outDirAppExe, outBuffer);
|
|
355
355
|
};
|
|
356
356
|
|
|
357
|
+
/*
|
|
357
358
|
const buildNativeAddon = ({ cacheDir, version, platform, arch, outDir, nodeVersion }) => {
|
|
358
359
|
let nodePath = path.resolve(cacheDir, `node-v${version}-${platform}-${arch}`);
|
|
359
360
|
const cwd = path.resolve(
|
|
@@ -365,6 +366,7 @@ const buildNativeAddon = ({ cacheDir, version, platform, arch, outDir, nodeVersi
|
|
|
365
366
|
|
|
366
367
|
child_process.execFileSync('node-gyp', ['rebuild', `--target=${nodeVersion}`, `--nodedir=${nodePath}`], { cwd });
|
|
367
368
|
};
|
|
369
|
+
*/
|
|
368
370
|
|
|
369
371
|
const compress = async ({
|
|
370
372
|
zip,
|
package/src/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface Options<P extends SupportedPlatform = SupportedPlatform> {
|
|
|
24
24
|
/** URI to download NW binaries from */
|
|
25
25
|
downloadUrl?: "https://dl.nwjs.io" | string,
|
|
26
26
|
/** URI to download manifest */
|
|
27
|
-
manifestUrl?: "https://nwjs.io/versions" | string,
|
|
27
|
+
manifestUrl?: "https://nwjs.io/versions.json" | string,
|
|
28
28
|
/** Refer to Linux/Windows/Osx specific options */
|
|
29
29
|
app: AppOptions<P>,
|
|
30
30
|
/** If true the existing cache is used. Otherwise it removes and redownloads it. */
|
package/src/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import util from './util.js';
|
|
|
16
16
|
* @property {"linux" | "osx" | "win"} platform Host platform
|
|
17
17
|
* @property {"ia32" | "x64" | "arm64"} arch Host architecture
|
|
18
18
|
* @property {"https://dl.nwjs.io" | string} [downloadUrl="https://dl.nwjs.io"] Download server
|
|
19
|
-
* @property {"https://nwjs.io/versions" | string} [manifestUrl="https://nwjs.io/versions"] Versions manifest
|
|
19
|
+
* @property {"https://nwjs.io/versions.json" | string} [manifestUrl="https://nwjs.io/versions.json"] Versions manifest
|
|
20
20
|
* @property {"./cache" | string} [cacheDir="./cache"] Directory to cache NW binaries
|
|
21
21
|
* @property {"./" | string} [srcDir="./"] File paths to application code
|
|
22
22
|
* @property {"./out" | string} [outDir="./out"] Directory to store build artifacts
|
package/src/util.js
CHANGED
|
@@ -10,10 +10,10 @@ import semver from 'semver';
|
|
|
10
10
|
/**
|
|
11
11
|
* Get manifest (array of NW release metadata) from URL.
|
|
12
12
|
* @param {string} manifestUrl Url to manifest
|
|
13
|
-
* @returns {Promise<
|
|
13
|
+
* @returns {Promise<string>} - Manifest object
|
|
14
14
|
*/
|
|
15
15
|
function getManifest(manifestUrl) {
|
|
16
|
-
let chunks =
|
|
16
|
+
let chunks = '';
|
|
17
17
|
|
|
18
18
|
return new Promise((resolve) => {
|
|
19
19
|
const req = https.get(manifestUrl, (response) => {
|
|
@@ -23,7 +23,7 @@ function getManifest(manifestUrl) {
|
|
|
23
23
|
|
|
24
24
|
response.on('error', (e) => {
|
|
25
25
|
console.error(e);
|
|
26
|
-
resolve(
|
|
26
|
+
resolve('');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
response.on('end', () => {
|
|
@@ -32,7 +32,7 @@ function getManifest(manifestUrl) {
|
|
|
32
32
|
});
|
|
33
33
|
req.on('error', (e) => {
|
|
34
34
|
console.error(e);
|
|
35
|
-
resolve(
|
|
35
|
+
resolve('');
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -63,11 +63,11 @@ async function getReleaseInfo(
|
|
|
63
63
|
|
|
64
64
|
try {
|
|
65
65
|
const data = await getManifest(manifestUrl);
|
|
66
|
-
if (data
|
|
67
|
-
await fs.promises.writeFile(manifestPath, data
|
|
66
|
+
if (data.length) {
|
|
67
|
+
await fs.promises.writeFile(manifestPath, data);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
const manifest = JSON.parse(await fs.promises.readFile(manifestPath));
|
|
71
71
|
if (version === 'latest' || version === 'stable' || version === 'lts') {
|
|
72
72
|
// Remove leading "v" from version string
|
|
73
73
|
version = manifest[version].slice(1);
|
|
@@ -206,7 +206,7 @@ export const parse = async (options, pkg) => {
|
|
|
206
206
|
options.platform = options.platform ?? PLATFORM_KV[process.platform];
|
|
207
207
|
options.arch = options.arch ?? ARCH_KV[process.arch];
|
|
208
208
|
options.downloadUrl = options.downloadUrl ?? 'https://dl.nwjs.io';
|
|
209
|
-
options.manifestUrl = options.manifestUrl ?? 'https://nwjs.io/versions';
|
|
209
|
+
options.manifestUrl = options.manifestUrl ?? 'https://nwjs.io/versions.json';
|
|
210
210
|
options.cacheDir = options.cacheDir ?? './cache';
|
|
211
211
|
options.cache = str2Bool(options.cache ?? true);
|
|
212
212
|
options.ffmpeg = str2Bool(options.ffmpeg ?? false);
|