Individual packages

This commit is contained in:
Max Lynch
2017-02-07 13:29:09 -06:00
parent 9802b7f2e4
commit f13a007a1c
3 changed files with 10 additions and 7 deletions
+5
View File
@@ -1,9 +1,12 @@
#tsc -p tsconfig-core.json
VERSION=$(node -p -e "require('./package.json').version")
PLUGINS="./src/@ionic-native/plugins/*"
PLUGIN_TSCONFIG=`cat ./scripts/build/tsconfig-plugin.json.template`
PLUGIN_PACKAGE_JSON=`cat ./scripts/build/plugin-package.json.template`
BUILD_TMP='.tmp'
BUILD_PLUGINS_DIST='dist/packages-dist/@ionic-native/plugins/'
# Clean the old build dir
rm -rf $BUILD_TMP
@@ -16,6 +19,8 @@ for d in $PLUGINS ; do
PLUGIN_BUILD_DIR="$BUILD_TMP/plugins/$BASE"
mkdir -p "$PLUGIN_BUILD_DIR"
NEW_TSCONFIG="$(echo "$PLUGIN_TSCONFIG" | sed "s/{{PLUGIN}}/$BASE/g")"
NEW_PACKAGE_JSON="$(echo "$PLUGIN_PACKAGE_JSON" | sed "s/{{PLUGIN}}/$BASE/g;s/{{VERSION}}/$VERSION/g")"
echo "$NEW_TSCONFIG" > "$PLUGIN_BUILD_DIR/tsconfig.json"
echo "$NEW_PACKAGE_JSON" > "$BUILD_PLUGINS_DIST/$BASE/package.json"
./node_modules/.bin/tsc -p "$PLUGIN_BUILD_DIR/tsconfig.json"
done
@@ -1,6 +1,6 @@
{
"name": "@ionic-native/PLUGIN",
"version": "VERSION",
"name": "@ionic-native/{{PLUGIN}}",
"version": "{{VERSION}}",
"description": "Ionic Native - Native plugins for ionic apps",
"module": "index.js",
"typings": "index.d.ts",
@@ -1,6 +1,5 @@
import { Plugin, CordovaInstance } from '@ionic-native/core';
import { Observable } from 'rxjs/Observable';
import { InAppBrowserEvent } from './inappbrowser';
declare var cordova: any;
@@ -203,14 +202,13 @@ export class ThemeableBrowser {
* A method that allows you to listen to events happening in the browser.
* Available events are: `ThemeableBrowserError`, `ThemeableBrowserWarning`, `critical`, `loadfail`, `unexpected`, `undefined`
* @param event Event name
* @returns {Observable<InAppBrowserEvent>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
* @returns {Observable<any>} Returns back an observable that will listen to the event on subscribe, and will stop listening to the event on unsubscribe.
*/
on(event: string): Observable<InAppBrowserEvent> {
return new Observable<InAppBrowserEvent>((observer) => {
on(event: string): Observable<any> {
return new Observable<any>((observer) => {
this._objectInstance.addEventListener(event, observer.next.bind(observer));
return () => this._objectInstance.removeEventListener(event, observer.next.bind(observer));
});
}
}