nw-builder 4.17.6 → 4.17.8
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/package.json +12 -11
- package/src/bld/osx.js +0 -1
- package/src/index.js +7 -4
- package/src/run.js +0 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nw-builder",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.8",
|
|
4
4
|
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NW.js",
|
|
@@ -56,26 +56,27 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "^10.0.1",
|
|
59
|
-
"@vitest/coverage-v8": "^4.
|
|
59
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
60
60
|
"base-volta-off-of-nwjs": "^1.0.5",
|
|
61
|
-
"eslint": "^10.
|
|
62
|
-
"eslint-plugin-jsdoc": "^62.
|
|
63
|
-
"globals": "^17.
|
|
64
|
-
"nw": "^0.
|
|
65
|
-
"selenium-webdriver": "^4.
|
|
61
|
+
"eslint": "^10.2.1",
|
|
62
|
+
"eslint-plugin-jsdoc": "^62.9.0",
|
|
63
|
+
"globals": "^17.5.0",
|
|
64
|
+
"nw": "^0.111.0",
|
|
65
|
+
"selenium-webdriver": "^4.43.0",
|
|
66
66
|
"vitest": "^4.0.14"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@nwutils/getter": "^0.2.
|
|
69
|
+
"@nwutils/getter": "^0.2.4",
|
|
70
|
+
"@nwutils/runner": "^0.2.3",
|
|
70
71
|
"archiver": "^7.0.1",
|
|
71
72
|
"commander": "^14.0.3",
|
|
72
73
|
"glob": "^13.0.6",
|
|
73
|
-
"plist": "^3.1.
|
|
74
|
+
"plist": "^3.1.1",
|
|
74
75
|
"resedit": "^3.0.2",
|
|
75
76
|
"tar": "^7.5.10"
|
|
76
77
|
},
|
|
77
78
|
"volta": {
|
|
78
|
-
"node": "25.2
|
|
79
|
-
"npm": "11.
|
|
79
|
+
"node": "25.8.2",
|
|
80
|
+
"npm": "11.13.0"
|
|
80
81
|
}
|
|
81
82
|
}
|
package/src/bld/osx.js
CHANGED
|
@@ -77,7 +77,6 @@ export default async function setOsxConfig({ app, outDir, releaseInfo }) {
|
|
|
77
77
|
const helperApps = [
|
|
78
78
|
{ name: 'nwjs Helper (Alerts).app', id: 'helper.alert' },
|
|
79
79
|
{ name: 'nwjs Helper (GPU).app', id: 'helper.gpu' },
|
|
80
|
-
{ name: 'nwjs Helper (Plugin).app', id: 'helper.plugin' },
|
|
81
80
|
{ name: 'nwjs Helper (Renderer).app', id: 'helper.renderer' },
|
|
82
81
|
{ name: 'nwjs Helper.app', id: 'helper' },
|
|
83
82
|
];
|
package/src/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import console from 'node:console';
|
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
|
|
6
|
-
import bld from './bld.js';
|
|
7
6
|
import get from '@nwutils/getter';
|
|
8
|
-
import run from '
|
|
7
|
+
import run from '@nwutils/runner';
|
|
8
|
+
|
|
9
|
+
import bld from './bld.js';
|
|
9
10
|
import util from './util.js';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -55,7 +56,7 @@ async function nwbuild(options) {
|
|
|
55
56
|
util.log('debug', 'info', 'Get node manifest...');
|
|
56
57
|
manifest = await util.getNodeManifest({ srcDir: options.srcDir, glob: options.glob });
|
|
57
58
|
if (typeof manifest.json?.nwbuild === 'object') {
|
|
58
|
-
options = manifest.json.nwbuild;
|
|
59
|
+
options = { ...options, ...manifest.json.nwbuild };
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
util.log('info', options.logLevel, 'Parse final options using node manifest');
|
|
@@ -115,6 +116,9 @@ async function nwbuild(options) {
|
|
|
115
116
|
|
|
116
117
|
if (options.mode === 'run') {
|
|
117
118
|
util.log('info', options.logLevel, 'Running NW.js in run mode...');
|
|
119
|
+
if (options.glob) {
|
|
120
|
+
throw new Error('Glob option is not supported when mode is set to run.');
|
|
121
|
+
}
|
|
118
122
|
const nwProcess = await run({
|
|
119
123
|
version: options.version,
|
|
120
124
|
flavor: options.flavor,
|
|
@@ -122,7 +126,6 @@ async function nwbuild(options) {
|
|
|
122
126
|
arch: options.arch,
|
|
123
127
|
srcDir: options.srcDir,
|
|
124
128
|
cacheDir: options.cacheDir,
|
|
125
|
-
glob: options.glob,
|
|
126
129
|
argv: options.argv,
|
|
127
130
|
});
|
|
128
131
|
return nwProcess;
|
package/src/run.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import child_process from 'node:child_process';
|
|
2
|
-
import console from 'node:console';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import process from 'node:process';
|
|
5
|
-
|
|
6
|
-
import util from './util.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {object} RunOptions
|
|
10
|
-
* @property {string | "latest" | "stable" | "lts"} [version = "latest"] Runtime version
|
|
11
|
-
* @property {"normal" | "sdk"} [flavor = "normal"] Build flavor
|
|
12
|
-
* @property {"linux" | "osx" | "win"} [platform] Target platform
|
|
13
|
-
* @property {"ia32" | "x64" | "arm64"} [arch] Target arch
|
|
14
|
-
* @property {string} [srcDir = "./src"] Source directory
|
|
15
|
-
* @property {string} [cacheDir = "./cache"] Cache directory
|
|
16
|
-
* @property {boolean} [glob = false] If true, throw error
|
|
17
|
-
* @property {string[]} [argv = []] CLI arguments
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Run NW.js application.
|
|
22
|
-
* @async
|
|
23
|
-
* @function
|
|
24
|
-
* @param {RunOptions} options Run mode options
|
|
25
|
-
* @returns {Promise<child_process.ChildProcess | null>} - A Node.js process object
|
|
26
|
-
*/
|
|
27
|
-
async function run({
|
|
28
|
-
version = 'latest',
|
|
29
|
-
flavor = 'normal',
|
|
30
|
-
platform = util.PLATFORM_KV[process.platform],
|
|
31
|
-
arch = util.ARCH_KV[process.arch],
|
|
32
|
-
srcDir = './src',
|
|
33
|
-
cacheDir = './cache',
|
|
34
|
-
glob = false,
|
|
35
|
-
argv = [],
|
|
36
|
-
}) {
|
|
37
|
-
/**
|
|
38
|
-
* @type {child_process.ChildProcess | null}
|
|
39
|
-
*/
|
|
40
|
-
let nwProcess = null;
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
if (util.EXE_NAME[platform] === undefined) {
|
|
44
|
-
throw new Error('Unsupported platform.');
|
|
45
|
-
}
|
|
46
|
-
if (glob === true) {
|
|
47
|
-
throw new Error('Globbing is not supported with run mode.');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const nwDir = path.resolve(
|
|
51
|
-
cacheDir,
|
|
52
|
-
`nwjs${flavor === 'sdk' ? '-sdk' : ''}-v${version}-${platform}-${arch}`,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
return new Promise((res, rej) => {
|
|
56
|
-
/* It is assumed that the package.json is located at `${options.srcDir}/package.json` */
|
|
57
|
-
nwProcess = child_process.spawn(
|
|
58
|
-
path.resolve(nwDir, util.EXE_NAME[platform]),
|
|
59
|
-
[...[srcDir], ...argv],
|
|
60
|
-
{ stdio: 'inherit' },
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
nwProcess.on('close', () => {
|
|
64
|
-
res();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
nwProcess.on('error', (error) => {
|
|
68
|
-
console.error(error);
|
|
69
|
-
rej(error);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.error(error);
|
|
74
|
-
}
|
|
75
|
-
return nwProcess;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default run;
|