Просмотр исходного кода

docs(README): add getting started section

evshiron лет назад: 8
Родитель
Сommit
d395e57737
1 измененных файлов с 47 добавлено и 10 удалено
  1. 47 10
      README.md

+ 47 - 10
README.md

@@ -12,35 +12,72 @@ We already has official `nw-builder` and `nwjs-builder`, which was built as an a
 
 Although NW.js has much lesser popularity than Electron, and is really troubled by historic headaches, let's have something modern.
 
-## Installation
+## Features
+
+* Building for Windows, macOS and Linux
+  * Common: `zip`, `7z`
+  * Windows: `nsis`
+  * macOS: TODO
+  * Linux: TODO
+* Configurable executable fields and icons for Windows and macOS
+* Integration for `nwjs-ffmpeg-prebuilt`
+* Exclusion of useless files from `node_modules`
+* TODO Auto Updater inspired by `electron-updater`
+* TODO Rebuilding native modules
+* Ideas appreciated :)
+
+## Getting Started
+
+* Make sure your NW.js project has a valid `package.json` (eg. generated by `npm init`), and have basic fields like `name`, `description` and `version` filled.
+
+* Install `nwjs-builder-phoenix` as a `devDependencies` of your NW.js project as follows:
 
 ```shell
 npm install nwjs-builder-phoenix --save-dev
 ```
 
-By installing it locally, `build` and `run` commands will be available in npm scripts. You can access help information via `./node_modules/.bin/{ build, run } --help`. Do NOT install it globally, as the command names are just too common.
+By installing it locally, `build` and `run` commands will be available in npm scripts. You can access option lists via `./node_modules/.bin/{ build, run } --help`.
+
+DO NOT install it globally, as the command names are just too common.
+
+* Add `build` properties at the root of the `package.json`, for example:
+
+```json
+// package.json
+{
+    "build": {
+        "nwVersion": "0.14.7"
+    }
+}
+```
+
+This will specify the NW.js version we are using. See more in the following Options section.
 
-Add the following to `package.json`, and `npm run build` and `npm run launch` will work.
+* Add some helper npm scripts, for example:
 
 ```json
 // package.json
 {
     "scripts": {
-        "build": "build --win --mac --linux --x86 --x64 --mirror https://dl.nwjs.io/ .",
-        "launch": "run --x86 --mirror https://dl.nwjs.io/ ."
+        "dist": "build --win --mac --linux --x86 --x64 --mirror https://dl.nwjs.io/ .",
+        "start": "run --x86 --mirror https://dl.nwjs.io/ ."
     }
 }
 ```
 
-## Options
+The above code snippet enables `npm run dist` and `npm run start`/`npm start`. The former builds for all major platforms and both x86 and x64 arch, and the latter runs the project with x86 binaries, both with the specified version of NW.js and use specified mirror to accelerate the download.
+
+* Well done.
 
-Passing and managing commandline arguments can be painful. In `nwjs-builder-phoenix`, we configure via the `build` property of the `package.json` in the project. Also you can specify external `builder.json` file (whatever filename) by appending `--config builder.json` to CLI arguments.
+This should be the common use case, read the following Options section and configure things if needed.
 
-See all available [Options](./docs/Options.md).
+See also [project for testing](./assets/project/) and [test cases](./test/) for reference.
+
+## Options
 
-## Examples
+Passing and managing commandline arguments can be painful. In `nwjs-builder-phoenix`, we configure via the `build` property of the `package.json` of your NW.js project.
 
-* [./assets/project/](./assets/project/)
+Also [see all available options here](./docs/Options.md).
 
 ## Differences to `nwjs-builder`