From e4aaba90b8130329c1039c941c0500555e184fa1 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Fri, 16 Feb 2018 11:56:57 +0200 Subject: [PATCH 1/2] docs: update build instructions in readme and contributing guide --- CONTRIBUTING.md | 10 +++++++--- README.md | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef62f1206b..0a29dfa6bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,10 @@ Before you submit a Pull Request, consider the following guidelines. ```bash git clone git@github.com:NativeScript/nativescript-cli.git ``` +* Install the node dependencies. +```bash + npm install --ignore-scripts +``` * Initialize the submodule. ```bash git submodule init @@ -57,15 +61,15 @@ Before you submit a Pull Request, consider the following guidelines. * Create your patch and include appropriate test cases. * Build your changes locally. ```bash - grunt + ./node_modules/.bin/grunt ``` * Ensure all the tests pass. ```bash - grunt test + ./node_modules/.bin/grunt test ``` * Ensure that your code passes the linter. ```bash - grunt lint + ./node_modules/.bin/grunt lint ``` * Commit your changes and create a descriptive commit message (the commit message is used to generate release notes). ```bash diff --git a/README.md b/README.md index e541561e25..7f75ed291c 100644 --- a/README.md +++ b/README.md @@ -432,8 +432,8 @@ How to Build git clone https://github.com/NativeScript/nativescript-cli cd nativescript-cli git submodule update --init -npm install -grunt +npm install --ignore-scripts +./node_modules/.bin/grunt ``` To use the locally built CLI instead `tns` you can call `PATH_TO_CLI_FOLDER/bin/tns`. For example: From 1774c67b5adc26366d501a1beae1c73ae346fd0b Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Wed, 21 Feb 2018 10:24:25 +0200 Subject: [PATCH 2/2] refactor: add setup npm script --- CONTRIBUTING.md | 12 ++---------- README.md | 4 +--- package.json | 1 + 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a29dfa6bc..45961556c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,17 +42,9 @@ Before you submit a Pull Request, consider the following guidelines. ```bash git clone git@github.com:NativeScript/nativescript-cli.git ``` -* Install the node dependencies. +* Run the setup script. This will initialize the git submodule, install the node dependencies and build with grunt. ```bash - npm install --ignore-scripts -``` -* Initialize the submodule. -```bash - git submodule init -``` -* Fetch data from the submodule. -```bash - git submodule update + npm run setup ``` * Make your changes in a new `git` branch. We use the Gitflow branching model so you will have to branch from our master branch. ```bash diff --git a/README.md b/README.md index 7f75ed291c..bc6df4c4d3 100644 --- a/README.md +++ b/README.md @@ -431,9 +431,7 @@ How to Build ``` git clone https://github.com/NativeScript/nativescript-cli cd nativescript-cli -git submodule update --init -npm install --ignore-scripts -./node_modules/.bin/grunt +npm run setup ``` To use the locally built CLI instead `tns` you can call `PATH_TO_CLI_FOLDER/bin/tns`. For example: diff --git a/package.json b/package.json index b503a07774..25d61a9b50 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "main": "./lib/nativescript-cli-lib.js", "scripts": { + "setup": "git submodule update --init && npm i --ignore-scripts && ./node_modules/.bin/grunt", "test": "node test-scripts/istanbul.js", "postinstall": "node postinstall.js", "preuninstall": "node preuninstall.js",