From 9055154781b8ea9dc51fbaa4aa20a896eabc9507 Mon Sep 17 00:00:00 2001 From: Ibby Date: Thu, 16 Feb 2017 19:47:50 -0500 Subject: [PATCH] chore(): ngc build --- .gitignore | 1 + package.json | 9 ++++----- scripts/build/build.js | 7 ++----- scripts/build/tsconfig-core.json | 5 ++++- scripts/build/tsconfig-plugin.json | 5 ++++- src/@ionic-native/plugins/googlemap/index.ts | 19 ++++++------------- src/@ionic-native/plugins/pay-pal/index.ts | 5 ----- 7 files changed, 21 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index 6afce7729..ac58c285c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ node_modules/ .idea .tmp +aot/ dist/ scripts/ionic-native-bower diff --git a/package.json b/package.json index 88ef2b881..8a597a9f1 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,10 @@ "files": [ "dist" ], - "dependencies": { - "@angular/core": "^2.4.6", - "rxjs": "5.0.0-beta.12" - }, "devDependencies": { + "@angular/compiler": "^2.4.7", + "@angular/compiler-cli": "^2.4.7", + "@angular/core": "^2.4.6", "browserify": "^13.3.0", "canonical-path": "0.0.2", "conventional-changelog-cli": "^1.2.0", @@ -54,7 +53,7 @@ "start": "npm run test:watch", "lint": "gulp lint", "build": "npm run lint && npm run build:core && npm run build:modules", - "build:core": "tsc -p scripts/build/tsconfig-core.json", + "build:core": "ngc -p scripts/build/tsconfig-core.json", "build:utils": "tsc -p scripts/build/tsconfig-utils.json", "build:modules": "node scripts/build/build.js", "shipit": "npm run build && gulp readmes && npm run npmpub", diff --git a/scripts/build/build.js b/scripts/build/build.js index bdc547810..7f195367e 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -97,9 +97,6 @@ const addPluginToQueue = pluginName => { installVariables = JSON.parse(regexVars[1].replace(/'/g, '"')); } - if (packageLocator) console.log(packageLocator); - if (installVariables) console.log(installVariables); - // clone plugin-config.json const pluginConfig = JSON.parse(JSON.stringify(PLUGIN_CONFIG)); @@ -121,12 +118,12 @@ const addPluginToQueue = pluginName => { .then(() => { // compile the plugin - exec(`${ROOT}/node_modules/.bin/tsc -p ${tsConfigPath}`, (err, stdout, stderr) => { + exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => { if (err) { // oops! something went wrong. callback(`\n\nBuilding ${pluginName} failed.`); - console.log(stdout); + console.log(err); return; } diff --git a/scripts/build/tsconfig-core.json b/scripts/build/tsconfig-core.json index 90c0023f6..1ca978269 100644 --- a/scripts/build/tsconfig-core.json +++ b/scripts/build/tsconfig-core.json @@ -16,5 +16,8 @@ }, "files": [ "../../src/@ionic-native/core/index.ts" - ] + ], + "angularCompilerOptions": { + "genDir": "aot" + } } diff --git a/scripts/build/tsconfig-plugin.json b/scripts/build/tsconfig-plugin.json index 4c42e53d7..fe15f7a66 100644 --- a/scripts/build/tsconfig-plugin.json +++ b/scripts/build/tsconfig-plugin.json @@ -19,5 +19,8 @@ }, "files": [ "../../../src/@ionic-native/plugins/{{PLUGIN}}/index.ts" - ] + ], + "angularCompilerOptions": { + "genDir": "aot" + } } diff --git a/src/@ionic-native/plugins/googlemap/index.ts b/src/@ionic-native/plugins/googlemap/index.ts index 8173156e4..772842135 100644 --- a/src/@ionic-native/plugins/googlemap/index.ts +++ b/src/@ionic-native/plugins/googlemap/index.ts @@ -422,8 +422,7 @@ export class GoogleMapsObject { * GoogleMapsMarker * } from '@ionic-native/google-maps'; * - * @Injectable() -export class MapPage { + * export class MapPage { * constructor() {} * * // Load map only after view is initialize @@ -639,7 +638,6 @@ export interface GoogleMapsMarkerIcon { /** * @private */ -@Injectable() export class GoogleMapsMarker { constructor(private _objectInstance: any) { } @@ -915,7 +913,7 @@ export interface GoogleMapsCircleOptions { /** * @private */ -@Injectable() + export class GoogleMapsCircle { constructor(private _objectInstance: any) { } @@ -1056,7 +1054,7 @@ export interface GoogleMapsPolylineOptions { /** * @private */ -@Injectable() + export class GoogleMapsPolyline { constructor(private _objectInstance: any) { } @@ -1196,7 +1194,7 @@ export interface GoogleMapsPolygonOptions { /** * @private */ -@Injectable() + export class GoogleMapsPolygon { constructor(private _objectInstance: any) { } @@ -1339,7 +1337,6 @@ export interface GoogleMapsTileOverlayOptions { /** * @private */ -@Injectable() export class GoogleMapsTileOverlay { constructor(private _objectInstance: any) { } @@ -1469,7 +1466,6 @@ export interface GoogleMapsGroundOverlayOptions { /** * @private */ -@Injectable() export class GoogleMapsGroundOverlay { constructor(private _objectInstance: any) { } @@ -1590,7 +1586,6 @@ export interface GoogleMapsKmlOverlayOptions { /** * @private */ -@Injectable() export class GoogleMapsKmlOverlay { constructor(private _objectInstance: any) { } @@ -1683,7 +1678,6 @@ export class GoogleMapsKmlOverlay { /** * @private */ -@Injectable() export class GoogleMapsLatLngBounds { private _objectInstance: any; @@ -1715,7 +1709,7 @@ export class GoogleMapsLatLngBounds { /** * @private */ -@Injectable() + export class GoogleMapsLatLng { lat: number; @@ -1774,14 +1768,13 @@ export interface GeocoderResult { /** * @private */ -@Injectable() export class Geocoder { /** * Converts position to address and vice versa * @param {GeocoderRequest} request Request object with either an address or a position * @returns {Promise} */ - geocode(request: GeocoderRequest): Promise { + static geocode(request: GeocoderRequest): Promise { return new Promise((resolve, reject) => { if (!plugin || !plugin.google || !plugin.google.maps || !plugin.google.maps.Geocoder) { pluginWarn({ diff --git a/src/@ionic-native/plugins/pay-pal/index.ts b/src/@ionic-native/plugins/pay-pal/index.ts index 9ebc24794..107f24801 100644 --- a/src/@ionic-native/plugins/pay-pal/index.ts +++ b/src/@ionic-native/plugins/pay-pal/index.ts @@ -147,7 +147,6 @@ export interface PayPalEnvironment { /** * @private */ -@Injectable() export class PayPalPayment { constructor(amount: string, currency: string, shortDescription: string, intent: string, details?: PayPalPaymentDetails) { this.amount = amount; @@ -212,7 +211,6 @@ export class PayPalPayment { /** * @private */ -@Injectable() export class PayPalItem { /** * The PayPalItem class defines an optional itemization for a payment. @@ -256,7 +254,6 @@ export class PayPalItem { /** * @private */ -@Injectable() export class PayPalPaymentDetails { /** * The PayPalPaymentDetails class defines optional amount details. @@ -384,7 +381,6 @@ export interface PayPalConfigurationOptions { /** * @private */ -@Injectable() export class PayPalConfiguration implements PayPalConfigurationOptions { /** * You use a PayPalConfiguration object to configure many aspects of how the SDK behaves. @@ -425,7 +421,6 @@ export class PayPalConfiguration implements PayPalConfigurationOptions { /** * @private */ -@Injectable() export class PayPalShippingAddress { /** * See the documentation of the individual properties for more detail.