nw-builder 4.4.2 → 4.5.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.
- package/README.md +59 -190
- package/package.json +34 -22
- package/patches/node_header.patch +4 -0
- package/src/bld.js +481 -0
- package/src/cli.js +4 -2
- package/src/get.js +240 -237
- package/src/index.js +35 -54
- package/src/run.js +35 -29
- package/src/util/parse.js +7 -4
- package/src/util/validate.js +29 -1
- package/src/util.js +72 -29
- package/src/build.js +0 -318
- package/src/log.js +0 -32
- package/src/util/arch.js +0 -9
- package/src/util/cache.js +0 -17
- package/src/util/files.js +0 -22
- package/src/util/platform.js +0 -18
- package/src/util/versionManifest.js +0 -30
package/README.md
CHANGED
|
@@ -12,214 +12,83 @@ For version 3, please go to the [corresponding branch](https://github.com/nwutil
|
|
|
12
12
|
- Get, run or build applications.
|
|
13
13
|
- Integrate [FFmpeg community builds](https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt)
|
|
14
14
|
- Configure executable fields and icons
|
|
15
|
-
-
|
|
15
|
+
- Downloading from mirrors
|
|
16
|
+
- Node Native Addon support
|
|
16
17
|
|
|
17
18
|
Check out the [documentation](https://nwutils.io/nw-builder/) if you wish to give `nw-builder` a try.
|
|
18
19
|
|
|
19
20
|
> Please note that the documentation assumes you know [how to write NW.js applications](https://nwjs.readthedocs.io/en/latest/For%20Users/Getting%20Started/).
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
- [nw-builder-platforms](https://github.com/naviapps/nw-builder-platforms) - Fork of this repo with platform specific build options
|
|
24
|
-
- [nwjs-builder-phoenix](https://github.com/evshiron/nwjs-builder-phoenix) - Previously the most used build tool, however it is no longer maintained
|
|
25
|
-
|
|
26
|
-
## Migration Guide (v3 -> v4)
|
|
27
|
-
|
|
28
|
-
> We are working on making the migration process smoother. If you encounter any issues with the current guide, please open an issue or start a discussion.
|
|
29
|
-
|
|
30
|
-
### Update `nw-builder`
|
|
22
|
+
## Installation
|
|
31
23
|
|
|
32
24
|
With npm:
|
|
33
25
|
|
|
34
26
|
```shell
|
|
35
|
-
npm
|
|
27
|
+
npm install nw-builder -D
|
|
36
28
|
```
|
|
37
29
|
|
|
38
30
|
With yarn:
|
|
39
31
|
|
|
40
32
|
```shell
|
|
41
|
-
yarn
|
|
33
|
+
yarn add nw-builder -D
|
|
42
34
|
```
|
|
43
35
|
|
|
44
36
|
With pnpm:
|
|
45
37
|
|
|
46
38
|
```shell
|
|
47
|
-
pnpm
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```diff
|
|
99
|
-
- files: ["./nwapp/**/*", "./other/**/*.js"],
|
|
100
|
-
+ srcDir: "./nwapp/**/* ./other/**/*.js",
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Add the `mode` option and remove the now redundant `nw.build` function call. The `build` call is made by `nwbuild` internally.
|
|
104
|
-
|
|
105
|
-
```diff
|
|
106
|
-
+ mode: "build",
|
|
107
|
-
|
|
108
|
-
-nw.build();
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
The `platforms` option has been removed and replaced with `platform` and `arch`. Notice that one `nwbuild` function call now creates one build for one platform and one arch only.
|
|
112
|
-
|
|
113
|
-
```diff
|
|
114
|
-
- platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"],
|
|
115
|
-
+ platform: "linux", // "osx" for MacOS "win", for Windows
|
|
116
|
-
+ arch: "x64", // "ia32" for 32 bit or "arm64" for arm based 65 bit architectures
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
The `buildDir` option has been rename to `outDir`.
|
|
120
|
-
|
|
121
|
-
```diff
|
|
122
|
-
- buildDir: "./build",
|
|
123
|
-
+ outDir: "./build",
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The `buildType` option has been removed.
|
|
127
|
-
|
|
128
|
-
```diff
|
|
129
|
-
- buildType: "versioned",
|
|
130
|
-
```
|
|
39
|
+
pnpm add nw-builder -D
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
Here is two way to use nw-build to build your nwjs applications
|
|
45
|
+
|
|
46
|
+
### CLI
|
|
47
|
+
|
|
48
|
+
1. To get nwjs cache
|
|
49
|
+
```bash
|
|
50
|
+
nwbuild --mode=get
|
|
51
|
+
```
|
|
52
|
+
2. To run nwjs application
|
|
53
|
+
```bash
|
|
54
|
+
nwbuild --mode=run
|
|
55
|
+
```
|
|
56
|
+
3. To build nwjs application
|
|
57
|
+
```bash
|
|
58
|
+
nwbuild --mode=build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### JavaScript API
|
|
62
|
+
1. Define an npm script
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "node scripts/build.js"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
2. Create a build script
|
|
71
|
+
```javascript
|
|
72
|
+
// scripts/build.js
|
|
73
|
+
const { nwbuild } = require("nw-builder");
|
|
74
|
+
await nwbuild({
|
|
75
|
+
srcDir: "./nwapp/**/* ./other/**/*.js",
|
|
76
|
+
mode: "build",
|
|
77
|
+
version: "latest",
|
|
78
|
+
flavor: "normal",
|
|
79
|
+
platform: "linux",
|
|
80
|
+
arch: "x64",
|
|
81
|
+
outDir: "./build",
|
|
82
|
+
cache: false,
|
|
83
|
+
app: { ... },
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
3. Run the script
|
|
87
|
+
```bash
|
|
88
|
+
npm run build
|
|
89
|
+
```
|
|
131
90
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```diff
|
|
135
|
-
- forceDownload: true,
|
|
136
|
-
+ cache: false,
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
The `appName` option has been changed to `app.name`.
|
|
140
|
-
|
|
141
|
-
```diff
|
|
142
|
-
- appName: "nwdemo",
|
|
143
|
-
+ app: { name: "nwdemo" },
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
The `appVersion` option has been changed to `app.version`.
|
|
147
|
-
|
|
148
|
-
```diff
|
|
149
|
-
- appVersion: "0.1.0",
|
|
150
|
-
+ app: { version: "0.1.0" },
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
The `macCredit` option has been removed.
|
|
154
|
-
|
|
155
|
-
```diff
|
|
156
|
-
- macCredits: "./nwapp/credits.html",
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
The `macIcns` option has been replaced with `icon`.
|
|
160
|
-
|
|
161
|
-
```diff
|
|
162
|
-
- macIcns: "./nwapp/mac.icns",
|
|
163
|
-
+ icon: "./nwapp/mac.icns",
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
The `macPlist` option has been replaced by `app.*` options. Consult the [documentation](https://nwutils.io/nw-builder/mode-build.html#osxrc-object) for valid properties.
|
|
167
|
-
|
|
168
|
-
```diff
|
|
169
|
-
- macPlist: { ... },
|
|
170
|
-
+ app: { ... },
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
The `winVersionString` option has been replaced with `app`. Consult the [documentation](https://nwutils.io/nw-builder/mode-build.html#winrc-object) for valid properties.
|
|
174
|
-
|
|
175
|
-
```diff
|
|
176
|
-
- winVersionString: {
|
|
177
|
-
- 'CompanyName': 'Some Company',
|
|
178
|
-
- 'FileDescription': 'Process Name',
|
|
179
|
-
- 'ProductName': 'Some Product',
|
|
180
|
-
- 'LegalCopyright': 'Copyright 2017',
|
|
181
|
-
- }
|
|
182
|
-
+ app: {
|
|
183
|
-
+ company: "Some Company",
|
|
184
|
-
+ fileDescription: "Process Name",
|
|
185
|
-
+ productName: "Some Product",
|
|
186
|
-
+ legalCopyright: "Copyright (c) 2023",
|
|
187
|
-
+ }
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
The `winIco` option has been replaced by `app.icon`.
|
|
191
|
-
|
|
192
|
-
```diff
|
|
193
|
-
- winIco: "./nwapp/win.ico",
|
|
194
|
-
+ app: { icon: "./nwapp/win.ico" },
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
The `macZip` option has been removed.
|
|
198
|
-
|
|
199
|
-
```diff
|
|
200
|
-
- macZip: false,
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
The `mergeZip` option has been removed.
|
|
204
|
-
|
|
205
|
-
```diff
|
|
206
|
-
- mergeZip: false,
|
|
207
|
-
```
|
|
91
|
+
## Alternatives
|
|
208
92
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
```javascript
|
|
212
|
-
const { nwbuild } = require("nw-builder");
|
|
213
|
-
|
|
214
|
-
await nwbuild({
|
|
215
|
-
srcDir: "./nwapp/**/* ./other/**/*.js",
|
|
216
|
-
mode: "build",
|
|
217
|
-
version: "latest",
|
|
218
|
-
flavor: "normal",
|
|
219
|
-
platform: "linux",
|
|
220
|
-
arch: "x64",
|
|
221
|
-
outDir: "./build",
|
|
222
|
-
cache: false,
|
|
223
|
-
app: { ... },
|
|
224
|
-
});
|
|
225
|
-
```
|
|
93
|
+
- [nw-builder-platforms](https://github.com/naviapps/nw-builder-platforms) - Fork of this repo with platform specific build options
|
|
94
|
+
- [nwjs-builder-phoenix](https://github.com/evshiron/nwjs-builder-phoenix) - Previously the most used build tool, however it is no longer maintained
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nw-builder",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NW.js",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"types": "./src/index.d.ts",
|
|
33
33
|
"type": "module",
|
|
34
34
|
"files": [
|
|
35
|
-
"
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"patches",
|
|
37
|
+
"src"
|
|
36
38
|
],
|
|
37
39
|
"homepage": "https://github.com/nwutils/nw-builder",
|
|
38
40
|
"repository": {
|
|
@@ -40,38 +42,48 @@
|
|
|
40
42
|
"url": "https://github.com/nwutils/nw-builder.git"
|
|
41
43
|
},
|
|
42
44
|
"scripts": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"lnt": "eslint --config=.github/eslint.config.cjs --fix src test",
|
|
47
|
-
"doc:dev": "concurrently --kill-others \"node .github/fswatch.config.js\" \"vitepress dev doc\"",
|
|
48
|
-
"doc:bld": "node .github/jsdoc.config.cjs && vitepress build doc",
|
|
49
|
-
"test:unit": "node --test test/unit/index.js",
|
|
50
|
-
"test:e2e": "node --test test/e2e/index.js",
|
|
45
|
+
"lint": "eslint src/get.js",
|
|
46
|
+
"docs": "jsdoc -d docs ./src/get.js ./src/run.js ./src/bld.js",
|
|
47
|
+
"test": "node test/index.js",
|
|
51
48
|
"demo": "cd test/fixture && node demo.js"
|
|
52
49
|
},
|
|
53
50
|
"devDependencies": {
|
|
54
|
-
"
|
|
55
|
-
"eslint": "^
|
|
56
|
-
"eslint-config-tjw-jsdoc": "^1.0.4",
|
|
57
|
-
"gh-pages": "^6.0.0",
|
|
51
|
+
"eslint": "^8.56.0",
|
|
52
|
+
"eslint-plugin-jsdoc": "^46.9.1",
|
|
58
53
|
"jsdoc": "^4.0.2",
|
|
59
|
-
"
|
|
60
|
-
"prettier": "^3.0.3",
|
|
61
|
-
"selenium-webdriver": "^4.14.0",
|
|
62
|
-
"vitepress": "^1.0.0-rc.21"
|
|
54
|
+
"selenium-webdriver": "^4.16.0"
|
|
63
55
|
},
|
|
64
56
|
"dependencies": {
|
|
65
57
|
"cli-progress": "^3.12.0",
|
|
66
58
|
"compressing": "^1.10.0",
|
|
67
59
|
"glob": "^10.3.10",
|
|
60
|
+
"node-gyp": "^10.0.1",
|
|
68
61
|
"plist": "^3.1.0",
|
|
69
|
-
"rcedit": "^4.0.
|
|
70
|
-
"
|
|
62
|
+
"rcedit": "^4.0.1",
|
|
63
|
+
"tar": "^6.2.0",
|
|
64
|
+
"unzipper": "^0.10.14",
|
|
71
65
|
"yargs": "^17.7.2"
|
|
72
66
|
},
|
|
73
|
-
"packageManager": "npm@
|
|
67
|
+
"packageManager": "npm@10.2.4",
|
|
74
68
|
"engines": {
|
|
75
|
-
"node": "
|
|
69
|
+
"node": ">=14"
|
|
70
|
+
},
|
|
71
|
+
"eslintConfig": {
|
|
72
|
+
"parserOptions": {
|
|
73
|
+
"ecmaVersion": 2023,
|
|
74
|
+
"sourceType": "module"
|
|
75
|
+
},
|
|
76
|
+
"env": {
|
|
77
|
+
"es6": true,
|
|
78
|
+
"node": true
|
|
79
|
+
},
|
|
80
|
+
"extends": [
|
|
81
|
+
"eslint:recommended",
|
|
82
|
+
"plugin:jsdoc/recommended"
|
|
83
|
+
],
|
|
84
|
+
"rules": {
|
|
85
|
+
"jsdoc/tag-lines": "off",
|
|
86
|
+
"jsdoc/check-property-names": "off"
|
|
87
|
+
}
|
|
76
88
|
}
|
|
77
89
|
}
|