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 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
- - Support downloading from mirrors
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
- ## Alternatives
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 update nw-builder@latest
27
+ npm install nw-builder -D
36
28
  ```
37
29
 
38
30
  With yarn:
39
31
 
40
32
  ```shell
41
- yarn upgrade nw-builder@latest
33
+ yarn add nw-builder -D
42
34
  ```
43
35
 
44
36
  With pnpm:
45
37
 
46
38
  ```shell
47
- pnpm update nw-builder@latest
48
- ```
49
-
50
- ### Update options
51
-
52
- Let's take an example of v3 code and migrate it to v4.
53
-
54
- ```javascript
55
- const NwBuilder = require("nw-builder");
56
-
57
- const nw = new NwBuilder({
58
- files: ["./nwapp/**/*", "./other/**/*.js"],
59
- version: "latest",
60
- flavor: "normal",
61
- platforms: ["win32", "win64", "osx32", "osx64", "linux32", "linux64"],
62
- cacheDir: "./cache",
63
- buildDir: "./build",
64
- buildType: "versioned",
65
- forceDownload: true,
66
- appName: "nwdemo",
67
- appVersion: "0.1.0",
68
- argv: "--nw-stderr-logging",
69
- macCredits: "./nwapp/credits.html",
70
- macIcns: "./nwapp/mac.icns",
71
- macPlist: { ... },
72
- winVersionString: { ... },
73
- winIco: "./nwapp/win.ico",
74
- zip: true,
75
- macZip: false,
76
- mergeZip: false,
77
- });
78
-
79
- nw.build();
80
- ```
81
-
82
- Update the import path
83
-
84
- ```diff
85
- -const NwBuilder = require("nw-builder");
86
- +const nwbuild = require("nw-builder");
87
- ```
88
-
89
- Replace the `NwBuilder` initialization with a function
90
-
91
- ```diff
92
- -const nw = new NwBuilder({
93
- +await nwbuild({
94
- ```
95
-
96
- The `files` property has been renamed to `srcDir`.
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
- The `forceDownload` option has been changed to `cache`.
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
- The final code should look like this.
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.4.2",
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
- "./src"
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
- "ci:fmt": "prettier --check \"./**/*.{css,html,js,json,md,yml}\"",
44
- "ci:lnt": "eslint --config=.github/eslint.config.cjs .github src test",
45
- "fmt": "prettier --write \"./**/*.{css,html,js,json,md,yml}\"",
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
- "concurrently": "^8.2.1",
55
- "eslint": "^8.51.0",
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
- "jsdoc-to-markdown": "^8.0.0",
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.0",
70
- "winston": "^3.11.0",
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@9.8.1",
67
+ "packageManager": "npm@10.2.4",
74
68
  "engines": {
75
- "node": "^16.20.1 || ^18.18.2 || >= 20.8.1"
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
  }
@@ -0,0 +1,4 @@
1
+ 68c68
2
+ < 'v8_host_byteorder': '<!(python -c "import sys; print sys.byteorder")',
3
+ ---
4
+ > 'v8_host_byteorder': '<!(python3 -c "import sys; print(sys.byteorder)")',