diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fd097f6..0f9c824a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ After cloning the repo, run: # Commonly used NPM scripts ```bash -$ # watch and auto re-build samples/app/nativescript-vue.js +$ # watch and auto re-build dist/index.js $ npm run dev ``` @@ -39,6 +39,8 @@ To test the sample applications provided in the repository, you need to `npm run Next, open up a new terminal window and run `npm run samples`. This will bring up a list of all the available sample applications which you can choose from with your arrow keys. Pressing enter/return will select that sample, and prompt you to choose the platform you'd like to run the sample on. After selecting the platform the application should start on your emulator, and the output will be in your terminal. +If you want to test the sample apps with HMR activated, please run `npm run samples -- --hmr` instead. Actually, we can pass any arguments to the `tns debug platform` command placing them after the `--` separator. + # Project Structure - `build`: Directory for the custom tooling for managing and building the project @@ -57,7 +59,7 @@ Next, open up a new terminal window and run `npm run samples`. This will bring u There is [currently] a bug in devDependencies husky 0.15 beta that aborts `npm install` if `.git/hooks` is missing. -https://github.com/typicode/husky/issues/195 +https://github.com/typicode/husky/issues/195 ``` > husky@0.15.0-rc.3 postinstall /.../nativescript-vue/node_modules/husky diff --git a/build/sample-runner.js b/build/sample-runner.js index 43f599e9..2814dfb9 100644 --- a/build/sample-runner.js +++ b/build/sample-runner.js @@ -6,6 +6,7 @@ const samplePackage = require('../samples/app/package.json') const originalMain = samplePackage.main let tns +let args = process.argv.slice(2) const files = fs .readdirSync(path.resolve(__dirname, '../samples/app')) @@ -40,11 +41,11 @@ inquirer }) function runPlatform(platform) { - tns = spawn('tns', ['debug', platform], { + tns = spawn('tns', ['debug', platform, '--syncAllFiles', '--bundle'].concat(args), { cwd: path.resolve(__dirname, '../samples') }) - tns.on('error', err => console.log(err)) + tns.on('error', err => console.error(err)) tns.stdout.on('data', data => process.stdout.write(platform + ': ' +data)) } diff --git a/package.json b/package.json index 72df0ba2..79f6b64e 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,7 @@ "test": "jest", "tdd": "jest --watch", "samples": "node build/sample-runner.js", - "dev": "rollup -c build/config.js -w --o samples/app/nativescript-vue.js --environment TARGET:nativescript-vue", - "dev:dist": "rollup -c build/config.js -w --o dist/index.js --environment TARGET:nativescript-vue", + "dev": "rollup -c build/config.js -w --o dist/index.js --environment TARGET:nativescript-vue", "build": "node build/build.js", "build:docs": "cd docs && npm run build", "prettier": "prettier --no-semi --single-quote --write \"{{platform,__test__}/**/*.js,samples/app/*.js}\"", diff --git a/samples/app/127.js b/samples/app/127.js index 253fecae..07ca8735 100644 --- a/samples/app/127.js +++ b/samples/app/127.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/171.js b/samples/app/171.js index 78cdb7bc..bdb77b69 100644 --- a/samples/app/171.js +++ b/samples/app/171.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.silent = false diff --git a/samples/app/217.js b/samples/app/217.js index f055388e..b5c79cbe 100644 --- a/samples/app/217.js +++ b/samples/app/217.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/220.js b/samples/app/220.js index 282d07d3..1d7bb09b 100644 --- a/samples/app/220.js +++ b/samples/app/220.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/229.js b/samples/app/229.js index cb8d94c9..cfad5b7e 100644 --- a/samples/app/229.js +++ b/samples/app/229.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.silent = false diff --git a/samples/app/231.js b/samples/app/231.js index 5036fd2a..8ed462fe 100644 --- a/samples/app/231.js +++ b/samples/app/231.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.silent = false diff --git a/samples/app/240.js b/samples/app/240.js index fc92b67f..12e835fa 100644 --- a/samples/app/240.js +++ b/samples/app/240.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/272.js b/samples/app/272.js index c2c1523a..12b45161 100644 --- a/samples/app/272.js +++ b/samples/app/272.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/339.js b/samples/app/339.js index bda795cd..5efddc74 100644 --- a/samples/app/339.js +++ b/samples/app/339.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false diff --git a/samples/app/344.js b/samples/app/344.js index 2e03f346..a798120a 100644 --- a/samples/app/344.js +++ b/samples/app/344.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') const VueDevtools = require('nativescript-vue-devtools') Vue.use(VueDevtools) Vue.config.debug = true diff --git a/samples/app/445.js b/samples/app/445.js index 2b34cc2a..5605ccc3 100644 --- a/samples/app/445.js +++ b/samples/app/445.js @@ -1,4 +1,4 @@ -const Vue = require('./nativescript-vue') +const Vue = require('nativescript-vue') Vue.config.debug = true Vue.config.silent = false @@ -14,7 +14,7 @@ new Vue({ template: ` - +