From 4864bbd2cd1021081e391a9f64659ee5180abdfc Mon Sep 17 00:00:00 2001 From: Atul R Date: Sat, 7 Mar 2020 12:59:27 +0100 Subject: [PATCH] Adds packer as default dep and updates readme --- README.md | 32 +++++++++++++++++++++++++++++++- package-lock.json | 30 ++++++++++++++++++++++++++++++ package.json | 4 +++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3928a61..ed0571d 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,41 @@ npm run dev npm start ``` -## Installation & Resources for learning React NodeGUI +## Installation & Resources for learning React NodeGui - [Documentation](https://react.nodegui.org) - all of React NodeGui's documentation. - [NodeGui](https://nodegui.org) - all of NodeGui's documentation. +## Packaging app as a distributable + +In order to distribute your finished app, you can use [@nodegui/packer](https://github.com/nodegui/packer) + +### Step 1: (_**Run this command only once**_) + +```sh +npx nodegui-packer --init MyAppName +``` + +This will produce the deploy directory containing the template. You can modify this to suite your needs. Like add icons, change the name, description and add other native features or dependencies. Make sure you commit this directory. + +### Step 2: (_**Run this command every time you want to build a new distributable**_) + +Next you can run the pack command: + +```sh +npm run build +``` + +This will produce the js bundle along with assets inside the `./dist` directory + +```sh +npx nodegui-packer --pack ./dist +``` + +This will build the distributable using @nodegui/packer based on your template. The output of the command is found under the build directory. You should gitignore the build directory. + +More details about packer can be found here: https://github.com/nodegui/packer + ## License MIT diff --git a/package-lock.json b/package-lock.json index 725c550..c7abe82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1098,6 +1098,36 @@ "prebuild-install": "^5.3.3" } }, + "@nodegui/packer": { + "version": "1.2.0-alpha-7", + "resolved": "https://registry.npmjs.org/@nodegui/packer/-/packer-1.2.0-alpha-7.tgz", + "integrity": "sha512-QSE7XgeQgG36+LBL7xGp82j6M9EvhPr1CGU463dyvmmHSJUMJkyu3B1h9nkkKFfpnbmpM+RUGVLuN60/CnyFVw==", + "dev": true, + "requires": { + "@nodegui/artifact-installer": "^1.0.0", + "commander": "^4.0.1", + "fs-extra": "^8.1.0" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } + } + }, "@nodegui/qode": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@nodegui/qode/-/qode-2.0.4.tgz", diff --git a/package.json b/package.json index 555e574..5330589 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "scripts": { "build": "webpack -p", "dev": "webpack --mode=development", - "start": "qode --inspect ./dist/index.js" + "start": "qode ./dist/index.js", + "debug": "qode --inspect ./dist/index.js" }, "dependencies": { "@nodegui/nodegui": "^0.15.2", @@ -21,6 +22,7 @@ "@babel/preset-env": "^7.8.7", "@babel/preset-react": "^7.8.3", "@babel/preset-typescript": "^7.8.3", + "@nodegui/packer": "^1.2.0-alpha-7", "@types/node": "^12.12.29", "@types/react": "^16.9.23", "@types/webpack-env": "^1.15.1",