From 14d8b3e17ade3f440da328372d31ecb1b85b3a68 Mon Sep 17 00:00:00 2001 From: Maximiliano Korp Date: Wed, 17 Aug 2016 22:01:15 -0700 Subject: [PATCH] fix up electron and nw.js docs --- guides/install/electron/README.md | 26 ++++++++------------------ guides/install/nw.js/README.md | 24 ++++++++---------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/guides/install/electron/README.md b/guides/install/electron/README.md index 794c4084a..99e67084a 100644 --- a/guides/install/electron/README.md +++ b/guides/install/electron/README.md @@ -12,24 +12,14 @@ description: How to install NodeGit with Electron Install for Electron ---------------------- -For an application that is built using [Electron](https://github.com/atom/Electron) you'll need to have the `engines.electron` set to the version of Electron that you are targeting in your root `package.json` file. +Please see the official electron docs [here](https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md) -For example if you have an Electron app that's targeting version 0.20.7 your package.json file would look something like: - -```json -{ - "name": "elec-app", - "displayName": "My Electron app", - "version": "0.0.1", - "description": "", - "main": "main.js", - "author": "", - "engines": { - "electron": "0.20.7" - } -} +For a slightly simpler version of the first method, use an `.npmrc` file. For example if you have an Electron app that's targeting version 1.2.8 your .npmrc file would look something like: +``` +runtime = electron +target = 1.2.8 +target_arch = x64 +disturl = https://atom.io/download/atom-shell ``` -And when doing an `npm install` or `apm install` inside of your Electron's root folder it will compile NodeGit targeting that version of Electron during the install. - -*NOTE: there are no pre-built binaries for Electron, you must rebuild NodeGit. Visit our [building guides](../from-source) for help* +*NOTE: We try to provide prebuilt binaries for electron, but we don't always have them available for every version. If prebuilts are not available and you have trouble with local compilation, visit our [building guides](../from-source) for help* diff --git a/guides/install/nw.js/README.md b/guides/install/nw.js/README.md index 5eb978b3a..05b020b42 100644 --- a/guides/install/nw.js/README.md +++ b/guides/install/nw.js/README.md @@ -12,22 +12,14 @@ description: How to install NodeGit with NW.js Install for nwjs ---------------- -For an application that is built using [NW.js](https://github.com/nwjs/nw.js) you'll need to have the `engines['nw.js']` set to the version of NW.js that you are targeting in your root `package.json` file. +Please see the official nw.js docs [here](http://docs.nwjs.io/en/latest/For%20Users/Advanced/Use%20Native%20Node%20Modules/#node-pre-gyp) -For example if you have an NS.js app that's targeting version 0.12.0 your package.json file would look something like - -```json -{ - "name": "nw-app", - "displayName": "My NW.js app", - "version": "0.0.1", - "description": "", - "engines": { - "nw.js": "0.12.0" - } -} +For a slightly simpler version of the third method, use an `.npmrc` file. For example if you have an NW.js app that's targeting version 0.13.0, your `.npmrc` file would look something like: +``` +runtime = node-webkit +target = 0.13.0 +target_arch = x64 +disturl = http://node-webkit.s3.amazonaws.com ``` -And when doing an `npm install` inside of your NW.js app's root folder it will compile NodeGit targeting that version of NW.js during the install. - -*NOTE: there are no pre-built binaries for NW.js, you must rebuild NodeGit. Visit our [building guides](../from-source) for help* +*NOTE: NW.js support is not thoroughly tested. Additionally, there are no pre-built binaries for NW.js, you must compile NodeGit. Visit our [building guides](../from-source) for help*