Skip to content

Commit 185b96f

Browse files
committed
Merge pull request #266 from NativeScript/simplify-dev-workflow
chore: Simplify dev workflow
2 parents 19cbe4b + 1712143 commit 185b96f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+113
-254
lines changed

Diff for: .gitignore

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
nativescript-angular*.tgz
21
bin/dist
32
node_modules
43
tags
5-
src/nativescript-angular/**/*.js
6-
!src/nativescript-angular/postinstall.js
7-
!src/nativescript-angular/hooks/**/*.js
8-
.baseDir.ts
4+
**/*.js.map
5+
6+
/hooks
7+
8+
nativescript-angular/**/*.d.ts
9+
!nativescript-angular/global.d.ts
10+
nativescript-angular/**/*.js
11+
!nativescript-angular/postinstall.js
12+
!nativescript-angular/hooks/**/*.js
13+
!nativescript-angular/gulpfile.js
14+
915
.tscache
1016
.nvm
1117
.vscode
@@ -19,7 +25,6 @@ tests/lib
1925
tests/node_modules
2026

2127
ng-sample/app/**/*.js
22-
ng-sample/app/nativescript-angular
2328
ng-sample/app/global.d.ts
2429
ng-sample/platforms
2530
ng-sample/lib

Diff for: .travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ install:
2525
- npm install -g nativescript --ignore-scripts
2626
- tns usage-reporting disable
2727
- tns error-reporting disable
28+
- cd nativescript-angular
29+
- npm install
30+
- cd ../tests
31+
- npm install
32+
- npm install ../nativescript-angular
2833

2934
before_script:
3035
- echo no | android create avd --force -n test -t android-19 -b armeabi-v7a
3136
- emulator -avd test -no-audio -no-window &
3237
- android-wait-for-emulator
3338

3439
script:
35-
- npm install
36-
- cd ./tests
37-
- npm install
3840
- tns platform add android
3941
- tns test android --emulator --justlaunch

Diff for: DEVELOPERS.md

-46
This file was deleted.

Diff for: README.md

+29-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Integrating NativeScript with Angular 2.
44

55
# Running locally
66

7-
# Prerequisites
7+
## Prerequisites
88

99
Install your native toolchain and NativeScript as described in the docs:
1010

@@ -14,31 +14,26 @@ https://docs.nativescript.org/setup/quick-setup
1414
## Install dependencies
1515

1616
```
17-
$ npm install -g grunt-cli gulp
17+
$ npm install -g gulp
1818
```
1919

2020
Then install the needed NPM packages:
2121

2222
```
23+
$ cd nativescript-angular
2324
$ npm install
2425
```
2526

26-
## Compile and prepare NativeScript and Angular
27-
28-
```
29-
$ grunt
30-
```
31-
32-
## Initialize the test NativeScript app (ng-sample)
27+
## Run the sample application (ng-sample)
3328

29+
Intall NPM packages (use the local copy of `nativescript-angular`):
3430
```
3531
$ cd ng-sample
3632
$ npm install
33+
$ npm install ../nativescript-angular
3734
```
3835

39-
The latter installs the `angular2` and `tns-core-modules` packages that you just built by running `grunt prepare` step in the project root.
40-
41-
## Run the ng-sample app
36+
Start the app:
4237

4338
```
4439
$ tns run android
@@ -61,19 +56,37 @@ $ env WEBPACK_BUILD=1 tns run android
6156

6257
# Running the tests
6358

59+
Intall NPM packages (use the local copy of `nativescript-angular`):
6460
```
6561
$ cd tests
6662
$ npm install
63+
$ npm install ../nativescript-angular
64+
```
65+
66+
Start test run:
67+
68+
```
6769
$ tns test ios --emulator
70+
$ tns test android --emulator
6871
```
6972

7073
# Developer workflow:
7174

72-
1. Make changes to `src/nativescript-angular`, and rebuild with `grunt build`. If succesful, you should get a npm package in the project root.
73-
2. Navigate to the ng-sample subdir: `$ cd ng-sample`. Make some changes to the app or `../src/nativescript-angular`.
74-
3. Run with `$ tns run android` or `$ tns run ios`
75+
## Setup:
76+
Use `npm link` to link `nativescript-angular` in `tests` and `ng-sample` progects:
77+
78+
```
79+
cd nativescript-angular
80+
npm link
81+
cd ../ng-sample
82+
npm link nativescript-angular
83+
cd ../tests
84+
npm link nativescript-angular
85+
```
7586

76-
Note that you should never change files in `ng-sample/src/nativescript-angular/` as they are overwritten with the reference sources in `src/nativescript-angular` on every `grunt app` run.
87+
## Work
88+
1. Make changes to the `test`, `ng-sample` projects or in `nativescript-angular` folder.
89+
2. Run the `tests` or `ng-sample` using as shown above.
7790

7891
# Watch the video explaining Angular 2 and NativeScript
7992
[NativeScript session on AngularConnect conference](https://www.youtube.com/watch?v=4SbiiyRSIwo)

Diff for: gruntfile.js

-139
This file was deleted.

Diff for: nativescript-angular/.npmignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.tgz
2+
3+
*.ts
4+
!*.d.ts
5+
6+
*.js.map
7+
8+
tsconfig.json
9+
global.d.ts
10+
.npmignore
11+
gulpfile.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: nativescript-angular/global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" />

Diff for: nativescript-angular/gulpfile.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var gulp = require('gulp');
2+
var del = require('del');
3+
var glob = require('glob');
4+
5+
gulp.task('clean-defs', function() {
6+
var files = [...glob.sync("*.ts"), ...glob.sync("!(node_modules)/*.ts")]
7+
.map(function(file) {
8+
return file.replace(/.ts$/, '.d.ts');
9+
});
10+
11+
return del(files).then(paths => {
12+
console.log('Definition files cleaned:')
13+
console.log(paths.join('\n'));
14+
});
15+
});
File renamed without changes.

0 commit comments

Comments
 (0)