nw-builder 3.5.4 → 3.6.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/{CHANGELOG.md → .github/CHANGELOG.md} +26 -4
- package/.github/ISSUE_REQUEST_TEMPLATE.md +16 -0
- package/{LICENSE → .github/LICENSE} +0 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +5 -0
- package/.github/workflows/cd.yml +24 -0
- package/.github/workflows/ci.yml +27 -0
- package/README.md +94 -96
- package/bin/nwbuild +19 -22
- package/demo.js +22 -0
- package/example/icons/README.md +7 -0
- package/example/icons/icon.icns +0 -0
- package/example/icons/icon.ico +0 -0
- package/example/nwapp/Credits.html +9 -0
- package/example/nwapp/README.md +7 -0
- package/example/nwapp/images/README.md +7 -0
- package/example/nwapp/images/kitten.jpg +0 -0
- package/example/nwapp/index.html +22 -0
- package/example/nwapp/package.json +23 -0
- package/example/package.json +7 -0
- package/lib/index.js +17 -7
- package/lib/platformOverrides.js +122 -0
- package/package.json +65 -61
- package/test/downloader.js +87 -0
- package/test/expected/README.md +7 -0
- package/test/expected/merged +1 -0
- package/test/expected/oneOveriddenRestNot/README.md +7 -0
- package/test/expected/oneOveriddenRestNot/osx32.json +9 -0
- package/test/expected/oneOveriddenRestNot/osx64.json +9 -0
- package/test/expected/osx-plist/1.plist +47 -0
- package/test/expected/osx-plist/2.plist +40 -0
- package/test/expected/osx-plist/README.md +7 -0
- package/test/expected/platformOverrides/README.md +7 -0
- package/test/expected/platformOverrides/linux32.json +13 -0
- package/test/expected/platformOverrides/linux64.json +9 -0
- package/test/expected/platformOverrides/osx32.json +12 -0
- package/test/expected/platformOverrides/osx64.json +12 -0
- package/test/expected/platformOverrides/win32.json +12 -0
- package/test/expected/platformOverrides/win64.json +12 -0
- package/test/fixtures/README.md +7 -0
- package/test/fixtures/invalid.json +3 -0
- package/test/fixtures/manifest/README.md +7 -0
- package/test/fixtures/manifest/versions.json +23 -0
- package/test/fixtures/nwapp/README.md +7 -0
- package/test/fixtures/nwapp/images/imagefile.img +1 -0
- package/test/fixtures/nwapp/index.html +10 -0
- package/test/fixtures/nwapp/javascript/bower_packages/simple/package.json +1 -0
- package/test/fixtures/nwapp/javascript/jsfile.js +1 -0
- package/test/fixtures/nwapp/package.json +5 -0
- package/test/fixtures/oneOveriddenRestNot/README.md +7 -0
- package/test/fixtures/oneOveriddenRestNot/package.json +16 -0
- package/test/fixtures/osx-plist/Info.plist +93 -0
- package/test/fixtures/osx-plist/README.md +7 -0
- package/test/fixtures/platformOverrides/README.md +7 -0
- package/test/fixtures/platformOverrides/package.json +52 -0
- package/test/fixtures/test-strip.zip +0 -0
- package/test/fixtures/test.tar.gz +0 -0
- package/test/fixtures/test.zip +0 -0
- package/test/fixtures/testVersions.html +17 -0
- package/test/nwBuilder.js +237 -0
- package/test/utils.js +232 -0
- package/test/versions.js +330 -0
- package/bin/README.md +0 -7
- package/lib/README.md +0 -7
|
@@ -5,13 +5,36 @@ All notable changes to this project will be documented in this file and in the [
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [3.6.0] - 2022-05-18
|
|
11
|
+
### Added
|
|
12
|
+
- GitHub Actions for CICD [#552](https://github.com/nwjs-community/nw-builder/pull/552)
|
|
13
|
+
- Support multiple locales on OSX [#389](https://github.com/nwjs-community/nw-builder/pull/389)
|
|
14
|
+
- Pull request and issue template [#553](https://github.com/nwjs-community/nw-builder/pull/553)
|
|
15
|
+
### Changed
|
|
16
|
+
- Dependencies [#550](https://github.com/nwjs-community/nw-builder/pull/550)
|
|
17
|
+
- Documentation [#540](https://github.com/nwjs-community/nw-builder/pull/540) [#553](https://github.com/nwjs-community/nw-builder/pull/553) [#555](https://github.com/nwjs-community/nw-builder/pull/555)
|
|
18
|
+
- Improve run mode by detecting current platform to prevent downloading additional binaries
|
|
19
|
+
### Removed
|
|
20
|
+
- Travis
|
|
21
|
+
- AppVeyor
|
|
22
|
+
- JSHint
|
|
23
|
+
- EditorConfig
|
|
24
|
+
|
|
25
|
+
## [3.5.7]
|
|
26
|
+
|
|
27
|
+
### Security
|
|
28
|
+
|
|
29
|
+
- Source platform overrides module into the project instead of it being an extenal dependency. This helped us get rid of a vulnerable lodash version. See https://github.com/nwjs-community/nw-builder/issues/500
|
|
30
|
+
|
|
8
31
|
## [3.5.1] - 2017-10-19
|
|
9
32
|
|
|
10
|
-
|
|
33
|
+
### Added
|
|
11
34
|
|
|
12
35
|
- Add option.winVersionString for accurate process name. See https://github.com/nwjs-community/nw-builder/pull/459.
|
|
13
36
|
|
|
14
|
-
|
|
37
|
+
### Fixed
|
|
15
38
|
|
|
16
39
|
- Small platform overrides fix. See https://github.com/nwjs-community/nw-builder/pull/477/files.
|
|
17
40
|
|
|
@@ -47,7 +70,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
47
70
|
## Old format
|
|
48
71
|
|
|
49
72
|
- 2017-05-22 `3.2.3` Fix for caching when a version is specified (thanks @piwonesien for the help).
|
|
50
|
-
- 2017-05-20 `3.2.2` Fix: when using the `nwbuild` in run mode, the `-p` option was ignored and the current platform was always used.
|
|
73
|
+
- 2017-05-20 `3.2.2` Fix: when using the `nwbuild` in run mode, the `-p` option was ignored and the current platform was always used.
|
|
51
74
|
- 2017-05-16 `3.2.1` Fix: NW.js 0.22.0+ apps didn't open.
|
|
52
75
|
- 2017-02-12 `3.2.0` Defaults to HTTPS now, added `manifestUrl` option, and bumped some dependencies.
|
|
53
76
|
- 2016-10-09 `3.1.2` Fix for passing array as files option when running app (plus some security fixes).
|
|
@@ -80,4 +103,3 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
80
103
|
- 2014-07-31 `0.0.4` fixed compatibility with nodewebkit 0.10.0
|
|
81
104
|
- 2014-04-20 Added run option, bug fixes
|
|
82
105
|
- 2014-04-13 Preview Release
|
|
83
|
-
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: cd
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v3
|
|
12
|
+
- uses: pnpm/action-setup@v2.2.1
|
|
13
|
+
with:
|
|
14
|
+
version: 7.1.0
|
|
15
|
+
run_install: true
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-node@v2
|
|
18
|
+
with:
|
|
19
|
+
node-version: '16'
|
|
20
|
+
|
|
21
|
+
- run: pnpm install
|
|
22
|
+
- uses: JS-DevTools/npm-publish@v1
|
|
23
|
+
with:
|
|
24
|
+
token: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
node: [14, 16]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: pnpm/action-setup@v2.2.1
|
|
16
|
+
with:
|
|
17
|
+
version: 7.1.0
|
|
18
|
+
run_install: true
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node }}
|
|
23
|
+
|
|
24
|
+
- run: pnpm install
|
|
25
|
+
- run: pnpm format
|
|
26
|
+
# - run: pnpm lint
|
|
27
|
+
- run: pnpm test
|
package/README.md
CHANGED
|
@@ -1,52 +1,66 @@
|
|
|
1
|
-
# nw-builder
|
|
1
|
+
# nw-builder
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/nw-builder)
|
|
4
|
+
[](https://github.com/nwjs-community/nw-builder/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/nwjs-community/nw-builder/actions/workflows/cd.yml)
|
|
6
|
+
[](https://gitter.im/nwjs/nw-builder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and Linux.
|
|
6
9
|
|
|
10
|
+
## Installation
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
Using npm:
|
|
13
|
+
```javascript
|
|
14
|
+
npm install nw-builder
|
|
15
|
+
```
|
|
9
16
|
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
17
|
+
Using yarn:
|
|
18
|
+
```javascript
|
|
19
|
+
yarn add nw-builder
|
|
13
20
|
```
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
|
|
22
|
+
Using pnpm:
|
|
23
|
+
```javascript
|
|
24
|
+
pnpm add nw-builder
|
|
18
25
|
```
|
|
19
26
|
|
|
20
|
-
##### Grunt and Gulp Plugins
|
|
21
|
-
Yes, there is also a [Grunt Plugin](https://github.com/nwjs/grunt-nw-builder). For Gulp, just use the module :)
|
|
22
27
|
|
|
28
|
+
## Usage
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
### CLI
|
|
25
31
|
|
|
26
32
|
```shell
|
|
27
|
-
Usage:
|
|
33
|
+
Usage:
|
|
34
|
+
nwbuild [options] [path] [-- <args>]
|
|
28
35
|
|
|
29
36
|
Options:
|
|
30
|
-
-p, --platforms Platforms to build, comma-sperated, can be:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
37
|
+
-p, --platforms Platforms to build, comma-sperated, can be:
|
|
38
|
+
win32, win64, osx32, osx64, linux32, linux64 or
|
|
39
|
+
win, osx, linux [default: <Current OS>]
|
|
40
|
+
-v, --version The nw version, eg. 0.64.1 [default: "latest"]
|
|
41
|
+
-r, --run Runs NW.js for the current platform [default: false]
|
|
42
|
+
-o, --buildDir The build folder [default: "./build"]
|
|
43
|
+
-f, --forceDownload Force download of NW.js [default: false]
|
|
35
44
|
--cacheDir The cache folder
|
|
36
|
-
--quiet Disables logging
|
|
45
|
+
--quiet Disables logging [default: false]
|
|
46
|
+
-- <args> Pass custom arguments to the NW.js instance
|
|
47
|
+
(-r, --run mode only)
|
|
48
|
+
```
|
|
37
49
|
|
|
50
|
+
To run NW.js in dev mode:
|
|
51
|
+
```
|
|
52
|
+
nwbuild -r path/to/app -- <args>
|
|
38
53
|
```
|
|
39
|
-
#### Run NW.js
|
|
40
|
-
During development you can run NW.js with `nwbuild -r path/to/your/younwapp/`
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
### Module
|
|
43
56
|
|
|
44
57
|
```js
|
|
45
58
|
var NwBuilder = require('nw-builder');
|
|
46
59
|
var nw = new NwBuilder({
|
|
47
60
|
files: './path/to/nwfiles/**/**', // use the glob format
|
|
48
|
-
platforms: ['osx64', 'win32', 'win64'],
|
|
49
|
-
version: '
|
|
61
|
+
platforms: ['osx64', 'win32', 'win64', 'linux32', 'linux64'],
|
|
62
|
+
version: 'latest',
|
|
63
|
+
argv: ['<nwjs_arg>', ... ] // see nwjs docs for possible <nwjs_arg> values
|
|
50
64
|
});
|
|
51
65
|
|
|
52
66
|
// Log stuff you want
|
|
@@ -59,8 +73,7 @@ nw.build().then(function () {
|
|
|
59
73
|
});
|
|
60
74
|
```
|
|
61
75
|
|
|
62
|
-
|
|
63
|
-
|
|
76
|
+
To run NW.js in dev mode:
|
|
64
77
|
```js
|
|
65
78
|
nw.run().then(function () {
|
|
66
79
|
console.log('all done!');
|
|
@@ -69,41 +82,37 @@ nw.run().then(function () {
|
|
|
69
82
|
});
|
|
70
83
|
```
|
|
71
84
|
|
|
72
|
-
|
|
85
|
+
## API Reference
|
|
73
86
|
|
|
74
|
-
|
|
75
|
-
nw.build(function(err) {
|
|
76
|
-
if(err) return console.error(err);
|
|
77
|
-
console.log('all done!');
|
|
78
|
-
});
|
|
79
|
-
```
|
|
87
|
+
> Stay up to date via the [Changelog](https://github.com/nwjs-community/nw-builder/blob/master/.github/CHANGELOG.md).
|
|
80
88
|
|
|
81
89
|
### Options
|
|
82
90
|
|
|
83
91
|
#### options.files *Required*
|
|
84
|
-
Type: `String`
|
|
85
|
-
Default value: `null`
|
|
92
|
+
Type: `String`
|
|
93
|
+
Default value: `null`
|
|
86
94
|
|
|
87
95
|
The path to your node webkit app. It supports [simple-glob](https://github.com/jedmao/simple-glob) so you can do stuff like `['foo/*.js', '!foo/bar.js', 'foo/bar.js']`.
|
|
88
96
|
|
|
89
97
|
|
|
90
98
|
#### options.version
|
|
91
|
-
Type: `String`
|
|
92
|
-
Default value: `'latest'`
|
|
99
|
+
Type: `String`
|
|
100
|
+
Default value: `'latest'`
|
|
93
101
|
|
|
94
|
-
The version of NW.js you want to use. Per default it looks up the latest version. [Here is a list](https://github.com/nwjs/nw.js/
|
|
102
|
+
The version of NW.js you want to use. Per default it looks up the latest version. [Here is a list](https://github.com/nwjs/nw.js/tags) of all available releases.
|
|
95
103
|
|
|
96
104
|
#### options.flavor
|
|
97
|
-
Type: `String`
|
|
98
|
-
Default value: `'sdk'`
|
|
105
|
+
Type: `String`
|
|
106
|
+
Default value: `'sdk'`
|
|
99
107
|
|
|
100
108
|
The flavor of NW.js you want to use. Per default it will be `sdk`. [Here is a list](https://github.com/nwjs/nw.js/wiki/Build-Flavors) of all flavor available.
|
|
101
109
|
|
|
102
110
|
The value `sdk` is most used for development whereas `normal` for production.
|
|
103
111
|
|
|
104
112
|
#### options.platforms
|
|
105
|
-
Type
|
|
106
|
-
|
|
113
|
+
Type `(CLI)`: `String` (comma separated values)
|
|
114
|
+
Type `(API)`: `Array` of `String`
|
|
115
|
+
Default value: [`<current OS>`]
|
|
107
116
|
|
|
108
117
|
The platforms you want to build. Can be `['win32', 'win64', 'osx32', 'osx64', 'linux32', 'linux64']`
|
|
109
118
|
|
|
@@ -112,32 +121,32 @@ The values `['win', 'osx', 'linux']` can also be used and will build both the 32
|
|
|
112
121
|
Be aware that the osx32 version can only be built with legacy version of nwjs. Since > 0.12.0, only 64 bits for osx works.
|
|
113
122
|
|
|
114
123
|
#### options.appName
|
|
115
|
-
Type: `String`
|
|
116
|
-
Default value: `false`
|
|
124
|
+
Type: `String`
|
|
125
|
+
Default value: `false`
|
|
117
126
|
|
|
118
127
|
The Name of your NW.js app. If this value is set to null, it will autodetect the `name` from your projects package.json. This will be used to generate a plist file for mac.
|
|
119
128
|
|
|
120
129
|
#### options.appVersion
|
|
121
|
-
Type: `String`
|
|
122
|
-
Default value: `false`
|
|
130
|
+
Type: `String`
|
|
131
|
+
Default value: `false`
|
|
123
132
|
|
|
124
133
|
The version of your NW.js app. If this value is set to null, it will autodetect the `version` form your projects package.json. This will be used to generate a plist file for mac.
|
|
125
134
|
|
|
126
135
|
#### options.buildDir
|
|
127
|
-
Type: `String`
|
|
128
|
-
Default value: `./build`
|
|
136
|
+
Type: `String`
|
|
137
|
+
Default value: `./build`
|
|
129
138
|
|
|
130
139
|
This is where the releases are saved.
|
|
131
140
|
|
|
132
141
|
#### options.cacheDir
|
|
133
|
-
Type: `String`
|
|
134
|
-
Default value: `./cache`
|
|
142
|
+
Type: `String`
|
|
143
|
+
Default value: `./cache`
|
|
135
144
|
|
|
136
|
-
This is where the cached NW.js downloads are
|
|
145
|
+
This is where the cached NW.js downloads are.
|
|
137
146
|
|
|
138
147
|
#### options.buildType
|
|
139
148
|
Type: `String` or `function`
|
|
140
|
-
Default value: `default`
|
|
149
|
+
Default value: `default`
|
|
141
150
|
|
|
142
151
|
How you want to save your build.
|
|
143
152
|
|
|
@@ -147,40 +156,47 @@ How you want to save your build.
|
|
|
147
156
|
* A function with options as scope (e.g `function () {return this.appVersion;}` )
|
|
148
157
|
|
|
149
158
|
#### options.forceDownload
|
|
150
|
-
Type: `Boolean`
|
|
151
|
-
Default value: `false`
|
|
159
|
+
Type: `Boolean`
|
|
160
|
+
Default value: `false`
|
|
161
|
+
|
|
162
|
+
This will delete everything in your `build_dir` directory, including the cached downloaded prebuilt binaries.
|
|
152
163
|
|
|
153
|
-
|
|
164
|
+
#### options.argv
|
|
165
|
+
Type `(CLI)`: `String` (comma separated values)
|
|
166
|
+
Type `(API)`: `Array` of `String`
|
|
167
|
+
Default Value: []
|
|
168
|
+
|
|
169
|
+
Pass Command Line Options when you run an NW.js instance. Ignored in case of build.
|
|
154
170
|
|
|
155
171
|
#### options.macCredits
|
|
156
|
-
Type: `String`
|
|
157
|
-
Default value: `false`
|
|
172
|
+
Type: `String`
|
|
173
|
+
Default value: `false`
|
|
158
174
|
|
|
159
175
|
MAC ONLY: The path to your credits.html file. If your don't provide your own it will use the one provided by NW.js
|
|
160
176
|
|
|
161
177
|
#### options.macIcns
|
|
162
|
-
Type: `String`
|
|
163
|
-
Default value: `false`
|
|
178
|
+
Type: `String`
|
|
179
|
+
Default value: `false`
|
|
164
180
|
|
|
165
181
|
MAC ONLY: The path to your ICNS icon file. If your don't provide your own it will use the one provided by NW.js
|
|
166
182
|
|
|
167
183
|
#### options.zip
|
|
168
|
-
Type: `Boolean`
|
|
169
|
-
Default value: `null`
|
|
184
|
+
Type: `Boolean`
|
|
185
|
+
Default value: `null`
|
|
170
186
|
|
|
171
187
|
WINDOW ONLY: Instead of zipping the application and merging it into the executable the application content is placed next to the application (which speed up the startup time for large apps). The default behaviour is platform specific. For `windows` and `linux`, the application is zipped and merged into the executable. For `mac`, the application is not zipped.
|
|
172
188
|
|
|
173
189
|
#### options.zipOptions
|
|
174
|
-
Type: `Object`
|
|
175
|
-
Default value: `null`
|
|
190
|
+
Type: `Object`
|
|
191
|
+
Default value: `null`
|
|
176
192
|
|
|
177
193
|
Allows to configure the underling zip library parameters, like store or compression ratio.
|
|
178
194
|
|
|
179
195
|
See [archiver](http://archiverjs.com/docs/global.html#ZipOptions) documentation for detailed description of properties.
|
|
180
196
|
|
|
181
197
|
#### options.macPlist
|
|
182
|
-
Type: `String` or `Object`
|
|
183
|
-
Default value: `false`
|
|
198
|
+
Type: `String` or `Object`
|
|
199
|
+
Default value: `false`
|
|
184
200
|
|
|
185
201
|
MAC ONLY: Pass a string containing the path to your own plist file. If a string isn't passed, a plist file will be generated from your package.json. Pass an object to overwrite or add properties to the generated plist file.
|
|
186
202
|
|
|
@@ -203,14 +219,14 @@ winVersionString: {
|
|
|
203
219
|
```
|
|
204
220
|
|
|
205
221
|
#### options.winIco
|
|
206
|
-
Type: `String`
|
|
207
|
-
Default value: `null`
|
|
222
|
+
Type: `String`
|
|
223
|
+
Default value: `null`
|
|
208
224
|
|
|
209
225
|
WINDOWS ONLY: The path to your ICO icon file. If your don't provide your own it will use the one provided by NW.js. If you are building on MAC or LINUX you must have [Wine](https://www.winehq.org/) installed to use this option.
|
|
210
226
|
|
|
211
227
|
#### options.macZip (DEPRECATED)
|
|
212
|
-
Type: `Boolean`
|
|
213
|
-
Default value: `null`
|
|
228
|
+
Type: `Boolean`
|
|
229
|
+
Default value: `null`
|
|
214
230
|
|
|
215
231
|
MAC ONLY: Use a `app.nw` folder instead of `ZIP` file, this significantly improves the startup speed of applications on `mac`, since no decompressing is needed. Builds on other platforms will still use `ZIP` files. The default behaviour of node-webkit-builder is to not use `ZIP` files on the `mac` platform. In case of the `mac` platform the option `macZip` can override the option `zip`.
|
|
216
232
|
|
|
@@ -298,35 +314,17 @@ To get around it, run `ulimit -n 1024` (or add it to your `~/.bash_profile`). Fo
|
|
|
298
314
|
|
|
299
315
|
## Team
|
|
300
316
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
- Adam Lynch ([@adam-lynch](https://github.com/adam-lynch))
|
|
304
|
-
- Rémy Boulanouar ([@DblK](https://github.com/DblK))
|
|
305
|
-
- You? :smile:. We're open to contributions (to the code, documentation, or anything else) and or additional maintainers.
|
|
306
|
-
|
|
307
|
-
**Past**
|
|
308
|
-
|
|
309
|
-
- Steffen Müller ([@steffenmllr](https://github.com/steffenmllr)) (Creator)
|
|
310
|
-
- Gabe Paez ([@gabepaez](https://github.com/gabepaez))
|
|
311
|
-
- Andy Trevorah ([@trevorah](https://github.com/trevorah))
|
|
317
|
+
This project was created by [Steffen Müller](https://github.com/steffenmllr) and has been maintained by [Gabe Paez](https://github.com/gabepaez), [Andy Trevorah](https://github.com/trevorah), [Adam Lynch](https://github.com/adam-lynch) and [Rémy Boulanouar](https://github.com/DblK) in the past. This project is currently maintained by [Ayushman Chhabra](https://github.com/ayushmxn).
|
|
312
318
|
|
|
313
319
|
## Contributing
|
|
314
320
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
- Whenever possible, open an issue before submitting a pull request.
|
|
322
|
+
- PRs should have short descriptive titles. For example:
|
|
323
|
+
- fix(docs): fix typo in `options.platform` description
|
|
324
|
+
- feat(platform): add support for mac m1
|
|
325
|
+
- Ideally, a PR should reference a related issue
|
|
326
|
+
- ~Ensure there are tests that cover your changes~
|
|
320
327
|
|
|
321
328
|
## License
|
|
322
329
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
[npm-url]: https://www.npmjs.com/package/nw-builder
|
|
326
|
-
[npm-image]: https://img.shields.io/npm/v/nw-builder.svg?style=flat
|
|
327
|
-
|
|
328
|
-
[travis-url]: https://travis-ci.org/nwjs/nw-builder
|
|
329
|
-
[travis-image]: https://img.shields.io/travis/nwjs/nw-builder/master.svg?style=flat
|
|
330
|
-
|
|
331
|
-
[depstat-url]: https://david-dm.org/nwjs/nw-builder
|
|
332
|
-
[depstat-image]: https://david-dm.org/nwjs/nw-builder.svg?style=flat
|
|
330
|
+
MIT
|
package/bin/nwbuild
CHANGED
|
@@ -5,15 +5,18 @@ var NwBuilder = require('./../lib');
|
|
|
5
5
|
var path = require('path');
|
|
6
6
|
var detectCurrentPlatform = require('../lib/detectCurrentPlatform.js');
|
|
7
7
|
|
|
8
|
+
var currentPlatform = detectCurrentPlatform();
|
|
9
|
+
|
|
8
10
|
var argv = optimist
|
|
9
|
-
.usage('Usage
|
|
11
|
+
.usage('Usage:\n nwbuild [options] [path] [-- <args>]')
|
|
10
12
|
|
|
11
13
|
.alias('p', 'platforms')
|
|
12
|
-
.
|
|
14
|
+
.default('p', currentPlatform)
|
|
15
|
+
.describe('p', 'Platforms to build, comma-sperated, can be: \n win32, win64, osx32, osx64, linux32, linux64 or \nwin, osx, linux')
|
|
13
16
|
|
|
14
17
|
.alias('v', 'version')
|
|
15
18
|
.default('v', 'latest')
|
|
16
|
-
.describe('v', 'The
|
|
19
|
+
.describe('v', 'The NW.js version, eg. 0.8.4')
|
|
17
20
|
|
|
18
21
|
.alias('r', 'run')
|
|
19
22
|
.default('r', false)
|
|
@@ -38,6 +41,10 @@ var argv = optimist
|
|
|
38
41
|
.describe('quiet', 'Disables logging')
|
|
39
42
|
.boolean('quiet')
|
|
40
43
|
|
|
44
|
+
.describe(' <args>', 'Pass custom arguments to the NW.js instance \n(-r, --run mode only)')
|
|
45
|
+
|
|
46
|
+
.wrap(100)
|
|
47
|
+
|
|
41
48
|
.argv;
|
|
42
49
|
|
|
43
50
|
// Howto Help
|
|
@@ -57,31 +64,21 @@ var options = {
|
|
|
57
64
|
appName: argv.name,
|
|
58
65
|
files: path.resolve(process.cwd(), files) + '/**/*',
|
|
59
66
|
flavor: argv.flavor || 'sdk',
|
|
60
|
-
platforms: argv.platforms ? argv.platforms.split(',') :
|
|
67
|
+
platforms: argv.platforms ? argv.platforms.split(',') : [currentPlatform],
|
|
68
|
+
currentPlatform: currentPlatform,
|
|
61
69
|
version: argv.version,
|
|
62
70
|
macIcns: argv.macIcns || false,
|
|
63
71
|
winIco: argv.winIco || false,
|
|
64
72
|
cacheDir: argv.cacheDir ? path.resolve(process.cwd(), argv.cacheDir) : path.resolve(__dirname, '..', 'cache'),
|
|
65
73
|
buildDir: path.resolve(process.cwd(), argv.buildDir),
|
|
66
|
-
forceDownload: argv.forceDownload
|
|
74
|
+
forceDownload: argv.forceDownload,
|
|
75
|
+
// get all argv arguments after --
|
|
76
|
+
argv: process.argv.slice(process.argv.findIndex(function firstDash(el) {
|
|
77
|
+
return el === '--'
|
|
78
|
+
}) + 1)
|
|
67
79
|
};
|
|
68
80
|
|
|
69
|
-
//
|
|
70
|
-
if(argv.r) {
|
|
71
|
-
var currentPlatform = detectCurrentPlatform();
|
|
72
|
-
if(!options.platforms){
|
|
73
|
-
options.platforms = [ currentPlatform ];
|
|
74
|
-
}
|
|
75
|
-
options.currentPlatform = currentPlatform;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Set default target platforms here
|
|
79
|
-
// Remove osx32 from default, nwjs didn't support osx32 yet
|
|
80
|
-
if (!options.platforms) {
|
|
81
|
-
options.platforms = ['osx64', 'win32', 'win64']
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Build App
|
|
81
|
+
// Initialize Builder
|
|
85
82
|
var nw = new NwBuilder(options);
|
|
86
83
|
|
|
87
84
|
// Logging
|
|
@@ -89,7 +86,7 @@ if(!(argv.quiet || argv.quite)) {
|
|
|
89
86
|
nw.on('log', console.log);
|
|
90
87
|
}
|
|
91
88
|
|
|
92
|
-
// Build or
|
|
89
|
+
// Build or Run the app
|
|
93
90
|
var np = (argv.r ? nw.run() : nw.build());
|
|
94
91
|
np.then(function() {
|
|
95
92
|
process.exit(0);
|
package/demo.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const NwBuilder = require('./lib');
|
|
2
|
+
const detectCurrentPlatform = require('./lib/detectCurrentPlatform');
|
|
3
|
+
|
|
4
|
+
const nw = new NwBuilder({
|
|
5
|
+
version: '0.64.1',
|
|
6
|
+
files: './example/nwapp/**',
|
|
7
|
+
macIcns: './icons/icon.icns',
|
|
8
|
+
macPlist: {mac_bundle_id: 'myPkg'},
|
|
9
|
+
platforms: [
|
|
10
|
+
detectCurrentPlatform(),
|
|
11
|
+
// 'linux64',
|
|
12
|
+
// 'osx64',
|
|
13
|
+
// 'win64',
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
nw.on('log', (msg) => console.log('nw-builder', msg));
|
|
19
|
+
|
|
20
|
+
nw.run()
|
|
21
|
+
.then(() => process.exit(0))
|
|
22
|
+
.catch((error) => console.log(error))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Hello World from nw-builder!</title>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<h1>Hello World!</h1>
|
|
8
|
+
We are using node.js <script>document.write(process.version)</script>
|
|
9
|
+
|
|
10
|
+
<h2>Here is a required node_module</h2>
|
|
11
|
+
<ul>
|
|
12
|
+
<script>
|
|
13
|
+
for (var counter=0; counter<xs.length; counter++) {
|
|
14
|
+
document.write("<li>" + counter + "</li>");
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
</ul>
|
|
18
|
+
|
|
19
|
+
<h2>And here is a cute kitten:</h2>
|
|
20
|
+
<img src="images/kitten.jpg">
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "index.html",
|
|
3
|
+
"name": "nw-demo",
|
|
4
|
+
"description": "demo app of NW.js",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"keywords": [ "demo", "NW.js" ],
|
|
7
|
+
"window": {
|
|
8
|
+
"title": "NW.js demo",
|
|
9
|
+
"icon": "link.png",
|
|
10
|
+
"toolbar": false,
|
|
11
|
+
"frame": true,
|
|
12
|
+
"width": 800,
|
|
13
|
+
"height": 500,
|
|
14
|
+
"position": "center",
|
|
15
|
+
"min_width": 400,
|
|
16
|
+
"min_height": 200,
|
|
17
|
+
"max_width": 800,
|
|
18
|
+
"max_height": 600
|
|
19
|
+
},
|
|
20
|
+
"webkit": {
|
|
21
|
+
"plugin": true
|
|
22
|
+
}
|
|
23
|
+
}
|