nw-builder 4.0.0 → 4.0.2

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
@@ -5,38 +5,6 @@
5
5
 
6
6
  Build [NW.js](https://github.com/nwjs/nw.js) applications for Mac, Windows and Linux.
7
7
 
8
- ## Installation
9
-
10
- Install via `npm` or your package manager of choice:
11
-
12
- ```javascript
13
- npm install nw-builder
14
- ```
15
-
16
- ## Usage
17
-
18
- ```javascript
19
- import { nwbuild } from "nw-builder";
20
-
21
- nwbuild({
22
- srcDir: "./nwapp",
23
- cacheDir: "./cache",
24
- version: "0.69.1",
25
- flavour: "sdk",
26
- platform: "linux",
27
- arch: "x64",
28
- outDir: "./build",
29
- // flags with their default values
30
- // these are implicitely defined unless
31
- // you want to change some behaviour
32
- downloadUrl: "https://dl.nwjs.io",
33
- manifestUrl: "https://nwjs.io/versions",
34
- run: false,
35
- noCache: false,
36
- zip: false,
37
- });
38
- ```
39
-
40
8
  ## Contributing
41
9
 
42
10
  1. Pick and install a Node version manager
package/docs/index.md ADDED
@@ -0,0 +1,112 @@
1
+ # Documentation
2
+
3
+ > This assumes you know how to [write an NW.js application](https://nwjs.readthedocs.io/en/latest/For%20Users/Getting%20Started/).
4
+
5
+ ## Install
6
+
7
+ Install `nw-builder` via `npm` or your preferred Node package manager of choice.
8
+
9
+ ```shell
10
+ npm i -D nw-builder
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Run your first application
16
+
17
+ Module usage
18
+
19
+ ```javascript
20
+ import { nwbuild } from "nw-builder";
21
+
22
+ nwbuild({
23
+ srcDir: "./nwapp",
24
+ mode: "run",
25
+ version: "0.70.1",
26
+ flavour: "sdk",
27
+ });
28
+ ```
29
+
30
+ CLI usage
31
+
32
+ ```shell
33
+ nwbuild ./nwapp --mode=run --version=0.70.1 --flavour=sdk
34
+ ```
35
+
36
+ package.json usage
37
+
38
+ `./nwapp/package.json`
39
+
40
+ ```json
41
+ {
42
+ "name": "nwdemo",
43
+ "main": "./index.html",
44
+ "nwbuild": {
45
+ "srcDir": "./nwapp",
46
+ "mode": "run",
47
+ "version": "0.70.1",
48
+ "flavour": "sdk"
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### Build your first application
54
+
55
+ Module usage
56
+
57
+ ```javascript
58
+ import { nwbuild } from "nw-builder";
59
+
60
+ nwbuild({
61
+ srcDir: "./nwapp",
62
+ mode: "run",
63
+ version: "0.70.1",
64
+ flavour: "normal",
65
+ platform: "linux",
66
+ arch: "x64",
67
+ outDir: "./out",
68
+ });
69
+ ```
70
+
71
+ CLI usage
72
+
73
+ ```shell
74
+ nwbuild ./nwapp --mode=build --version=0.70.1 --flavour=normal --platform=linux --arch=x64 --outDir=./out
75
+ ```
76
+
77
+ package.json usage
78
+
79
+ `./nwapp/package.json`
80
+
81
+ ```json
82
+ {
83
+ "name": "nwdemo",
84
+ "main": "./index.html",
85
+ "nwbuild": {
86
+ "srcDir": "./nwapp",
87
+ "mode": "build",
88
+ "version": "0.70.1",
89
+ "flavour": "normal",
90
+ "platform": "linux",
91
+ "arch": "x64",
92
+ "outDir": "./out"
93
+ }
94
+ }
95
+ ```
96
+
97
+ ## API Reference
98
+
99
+ | Name | Type | Default | Description |
100
+ | ----------- | --------- | -------------------------- | ------------------------------------------------------------------------------ | -------------------------------------------------------------------- | ---------------------- |
101
+ | srcDir | `string | string[]` | | Directory to hold NW app files unless or array of file glob patterns |
102
+ | mode | `run | build` | | Run or build application |
103
+ | version | `latest | stable | string` | | NW runtime version |
104
+ | flavour | `sdk | normal` | | NW runtime build flavour. |
105
+ | platform | `linux | osx | win` | | NW supported platforms |
106
+ | arch | `ia32 | x64` | | NW supported architectures |
107
+ | outDir | `string` | | Directory to store build artifacts |
108
+ | cacheDir | `string` | `./cacheDir` | Directory to store NW binaries |
109
+ | downloadUrl | `string` | `https://dl.nwjs.io` | URI to download NW binaries from |
110
+ | manifestUrl | `string` | `https://nwjs.io/versions` | URI to download manifest from |
111
+ | cache | `boolean` | `true` | If `true` the existing cache is used. Otherwise it removes and redownloads it. |
112
+ | zip | `boolean` | `false` | If `true` the `outDir` directory is zipped |