Skip to content

Commit f6f5a06

Browse files
Merge pull request #39 from NativeScript/fix-webpack
Fix webpack
2 parents 8a6503e + c6434fc commit f6f5a06

32 files changed

+81
-363
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ matrix:
66
node_js: "6"
77
jdk: oraclejdk8
88
script: npm run ci.tslint
9+
- stage: "WebPack"
10+
os: osx
11+
env:
12+
- Platform="iOS"
13+
osx_image: xcode8.3
14+
language: node_js
15+
node_js: "6"
16+
jdk: oraclejdk8
17+
script: npm run build && cd ../demo && npm i && npm run build-ios-bundle && cd ../demo-angular && npm i && npm run build-ios-bundle
18+
- language: android
19+
os: linux
20+
env:
21+
- Platform="Android"
22+
jdk: oraclejdk8
23+
before_install: nvm install 6.10.3
24+
script: cd src && npm run build && cd ../demo && npm i && npm run build-android-bundle && cd ../demo-angular && npm i && npm run build-android-bundle
925
- stage: "Build"
1026
env:
1127
- Android="23"

CONTRIBUTING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ Third-party patches are essential for keeping nativescript-facebook plugin great
1010
git clone git@github.com:<your-username>/nativescript-facebook.git
1111

1212
* Make commits of logical units.
13-
* Make sure your commit messages are in the proper format.
13+
* Make sure your commit messages are in the proper format. We strongly recommend to use [semantic commit messages](https://seesparkbox.com/foundry/semantic_commit_messages)
1414
* Add tests for your changes and make them pass. How to run tests you can find in [Testing section](#Testing)
1515
* Push your changes to a topic branch in your fork of the repository.
1616
* Submit a pull request to the **nativescript-facebook** repository.
1717

18-
## <a name='Testing'> Testing </a>
18+
## Testing
1919

2020
There are three main points in order to get nativescript-facebook e2e UI tests running locally on iOS 10 Simulator and Android api 23 Emulator. Before that if you want to take a look at the tests and make some changes find them located in `demo/e2e-tests` folder.
2121

22-
Note, that all commands below assume you have installed npm packages in /src and /demo folders (`$ npm i`) and you are using OS X in order to use both iOS Simulator and Android emulator.
23-
2422
* Install Appium. Test execution depends on [nativescript-dev-appium](https://github.com/NativeScript/nativescript-dev-appium) plugin which is added as dev dependency in `demo` app folder and first command satisfies its requirement to have appium installed.
2523

2624
$ npm install -g appium@1.6.3

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ NativeScript : Facebook SDK ![apple](https://cdn3.iconfinder.com/data/icons/pico
3535
- [Login Response](#login-response)
3636
- [Graph API Example](#graph-api-example)
3737
- [Release notes](#release-notes)
38+
- [FAQ](#faq)
39+
- [Contributing](#contributing)
3840
- [License](#license)
3941

4042
<!-- /TOC -->
@@ -468,5 +470,8 @@ This sample is part of the demo apps and can be observed [here](https://github.c
468470
## FAQ
469471
Check out our FAQ section [here](https://github.com/NativeScript/nativescript-facebook/wiki/FAQ).
470472
473+
## Contributing
474+
Check out our Contribution guide [here](https://github.com/NativeScript/nativescript-facebook/blob/master/CONTRIBUTING.md).
475+
471476
## License
472477
[Apache 2.0](https://github.com/NativeScript/nativescript-facebook/blob/master/LICENSE)

demo-angular/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AppComponent } from "./app.component";
55
import { LoginModule } from "./pages/login/login.module";
66
import { HomeModule } from "./pages/home/home.module";
77
import { NativeScriptFacebookModule } from "nativescript-facebook/angular";
8-
import * as application from 'application';
8+
import * as application from 'tns-core-modules/application';
99
import { routes } from "./app.routing";
1010
import { NavigationService } from "./services/navigation.service";
1111

demo-angular/app/pages/home/home.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component, ChangeDetectorRef } from "@angular/core";
22
import * as Facebook from "nativescript-facebook";
33
import { NavigationService } from "../../services/navigation.service";
44
import { config } from "../../app.config";
5-
let http = require("http");
6-
let appSettings = require("application-settings");
5+
import * as http from "tns-core-modules/http";
6+
import * as appSettings from "tns-core-modules/application-settings";
77

88
@Component({
99
selector: "home",
@@ -20,13 +20,13 @@ export class HomeComponent {
2020
constructor(private ref: ChangeDetectorRef, private navigationService: NavigationService) {
2121
// Get logged in user's info
2222
http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/me?access_token=" + this.accessToken).then((res) => {
23-
this.username = res.name;
24-
this.userId = res.id;
23+
this.username = res["name"];
24+
this.userId = res["id"];
2525

2626
// Get logged in user's avatar
2727
// ref: https://github.com/NativeScript/NativeScript/issues/2176
2828
http.getJSON(config.FACEBOOK_GRAPH_API_URL + "/" + this.userId + "/picture?type=large&redirect=false&access_token=" + this.accessToken).then((res) => {
29-
this.avatarUrl = res.data.url;
29+
this.avatarUrl = res["data"]["url"];
3030
this.ref.detectChanges();
3131
}, function (err) {
3232
alert("Error getting user info: " + err);

demo-angular/app/pages/login/login.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, ChangeDetectorRef } from "@angular/core";
22
import * as Facebook from "nativescript-facebook";
33
import { NavigationService } from "../../services/navigation.service";
4-
let appSettings = require("application-settings");
4+
import * as appSettings from "tns-core-modules/application-settings";
55

66
@Component({
77
selector: "login",

demo-angular/app/vendor-platform.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// At runtime the module gets loaded *before* the rest of the app code, so code
99
// placed here needs to be careful about its dependencies.
1010

11-
require("application");
12-
require("ui/frame");
13-
require("ui/frame/activity");
11+
require("tns-core-modules/application");
12+
require("tns-core-modules/ui/frame");
13+
require("tns-core-modules/ui/frame/activity");
1414

1515
if (global.TNS_WEBPACK) {
1616
global.__requireOverride = function (name, dir) {

demo-angular/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"nativescript": {
55
"id": "org.nativescript.demoangular",
66
"tns-android": {
7-
"version": "3.0.0"
7+
"version": "3.0.1"
88
},
99
"tns-ios": {
1010
"version": "3.0.1"
@@ -29,7 +29,7 @@
2929
},
3030
"devDependencies": {
3131
"@angular/compiler-cli": "~4.0.0",
32-
"@ngtools/webpack": "1.3.0",
32+
"@ngtools/webpack": "~1.4.0",
3333
"babel-traverse": "6.12.0",
3434
"babel-types": "6.11.1",
3535
"babylon": "6.8.4",
@@ -43,17 +43,18 @@
4343
"lazy": "1.0.11",
4444
"nativescript-css-loader": "~0.26.0",
4545
"nativescript-dev-typescript": "^0.4.0",
46-
"nativescript-dev-webpack": "^0.4.0",
46+
"nativescript-dev-webpack": "^0.6.3",
4747
"raw-loader": "~0.5.1",
4848
"resolve-url-loader": "~2.0.2",
49-
"typescript": "~2.2.2",
50-
"webpack": "~2.3.3",
51-
"webpack-sources": "~0.2.3"
49+
"typescript": "~2.3.4",
50+
"webpack": "~2.6.1",
51+
"webpack-sources": "~1.0.1"
5252
},
5353
"scripts": {
5454
"ns-bundle": "ns-bundle",
55-
"start-android-bundle": "npm run ns-bundle --android --start-app",
56-
"start-ios-bundle": "npm run ns-bundle --ios --start-app",
55+
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
56+
"start-android-bundle": "npm run ns-bundle --android --run-app",
57+
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
5758
"build-android-bundle": "npm run ns-bundle --android --build-app",
5859
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
5960
}

demo-angular/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"baseUrl": ".",
1616
"paths": {
1717
"*": [
18-
"./node_modules/tns-core-modules/*",
1918
"./node_modules/*"
2019
]
2120
},

demo-angular/webpack.android.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)