From a024f82b6ab243536f747ba1d0f096aed110ba84 Mon Sep 17 00:00:00 2001 From: Faizan Hasan Date: Sat, 29 Apr 2017 05:30:01 +0500 Subject: [PATCH 1/6] Dependencies fixes --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index dcb742c..71d0954 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "release": "npm run prepublish && npm publish", "test": "echo \"Error: no test specified\" && exit 1" }, - "dependencies": { + "dependencies": {}, + "devDependencies": { "@angular/common": "4.0.0", "@angular/compiler": "4.0.0", "@angular/compiler-cli": "4.0.0", @@ -26,9 +27,7 @@ "ionicons": "3.0.0", "rxjs": "5.1.1", "sw-toolbox": "3.4.0", - "zone.js": "^0.8.4" - }, - "devDependencies": { + "zone.js": "^0.8.4", "typescript": "~2.2.1" }, "repository": { From 88933263649865318e0ec1468ad5c4ebd8a7beeb Mon Sep 17 00:00:00 2001 From: Faizan Hasan Date: Thu, 8 Jun 2017 01:08:03 +0500 Subject: [PATCH 2/6] Removing unnecessary files --- dist/ionic-audio.scss | 82 ------------------------------------------- dist/package.json | 44 ----------------------- 2 files changed, 126 deletions(-) delete mode 100644 dist/ionic-audio.scss delete mode 100644 dist/package.json diff --git a/dist/ionic-audio.scss b/dist/ionic-audio.scss deleted file mode 100644 index 345c4f5..0000000 --- a/dist/ionic-audio.scss +++ /dev/null @@ -1,82 +0,0 @@ - -audio-track { - - ion-thumbnail { - > img { - top: 0; - position: absolute; - .md & { - @import "node_modules/ionic-angular/components/item/item.md"; - margin-top: ($item-md-padding-right / 2); - } - - .ios & { - @import "node_modules/ionic-angular/components/item/item.ios"; - margin-top: ($item-ios-padding-right / 2); - } - } - audio-track-play { - position: absolute; - top: 0rem; - display: inline-flex; - - .md & { - @import "node_modules/ionic-angular/components/item/item.md"; - min-width: $item-md-thumbnail-size; - min-height: $item-md-thumbnail-size; - margin: ($item-md-padding-right / 2) $item-md-padding-right ($item-md-padding-right / 2) 0; - } - - .ios & { - @import "node_modules/ionic-angular/components/item/item.ios"; - min-width: $item-ios-thumbnail-size; - min-height: $item-ios-thumbnail-size; - margin: ($item-ios-padding-right / 2) $item-ios-padding-right ($item-ios-padding-right / 2) 0; - } - - button { - width: 100% !important; - height: inherit !important; - margin: 0 !important; - - &.light { - background: map-get($colors, dark); - color: map-get($colors, light); - opacity: .8; - } - - &.dark { - color: map-get($colors, dark); - opacity: .6; - } - - ion-icon { - font-size: 2em !important; - } - } - - } - } - - audio-track-progress { - em { - font-size: .8em; - } - } - - - audio-track-progress-bar{ - ion-range { - &.range-ios { - padding: 0; - } - &.range-md { - padding: 0; - } - } - - time { - font-size: .8em; - } - } -} \ No newline at end of file diff --git a/dist/package.json b/dist/package.json deleted file mode 100644 index 8f82106..0000000 --- a/dist/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "ionic-audio", - "version": "3.0.1", - "description": "An audio player for Ionic 3 and Angular 4", - "main": "./index.js", - "typings": "./index.d.ts", - "devDependencies": { - "@angular/common": "4.1.2", - "@angular/compiler": "4.1.2", - "@angular/compiler-cli": "4.1.2", - "@angular/core": "4.1.2", - "@angular/forms": "4.1.2", - "@angular/http": "4.1.2", - "@angular/platform-browser": "4.1.2", - "@angular/platform-browser-dynamic": "4.1.2", - "@ionic-native/core": "3.10.2", - "@ionic-native/splash-screen": "3.10.2", - "@ionic-native/status-bar": "3.10.2", - "@ionic/storage": "2.0.1", - "ionic-angular": "3.3.0", - "ionicons": "3.0.0", - "rxjs": "5.1.1", - "sw-toolbox": "3.6.0", - "zone.js": "0.8.11", - "typescript": "2.3.3" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/arielfaur/ionic-audio.git" - }, - "keywords": [ - "ionic", - "angular", - "audio", - "player", - "typescript" - ], - "author": "Ariel Faur", - "license": "MIT", - "bugs": { - "url": "https://github.com/arielfaur/ionic-audio/issues" - }, - "homepage": "https://github.com/arielfaur/ionic-audio#readme" -} From aa82cc5b0e6c31c8751beecd420b1cfbab9eca92 Mon Sep 17 00:00:00 2001 From: Faizan Hasan Date: Thu, 8 Jun 2017 01:08:26 +0500 Subject: [PATCH 3/6] Updating Package.json file --- package.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f357dec..a124e08 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts": { - "prepublish": "tsc -p ./", - "release": "npm run prepublish && npm publish", + "install": "node_modules/.bin/ngc && copyfiles -u 1 ./src/*.scss ./dist", + "release": "npm run install && npm publish", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { @@ -22,12 +22,13 @@ "@ionic-native/splash-screen": "3.10.2", "@ionic-native/status-bar": "3.10.2", "@ionic/storage": "2.0.1", + "copyfiles": "^1.2.0", "ionic-angular": "3.3.0", "ionicons": "3.0.0", "rxjs": "5.1.1", "sw-toolbox": "3.6.0", - "zone.js": "0.8.11", - "typescript": "2.3.3" + "typescript": "2.3.3", + "zone.js": "0.8.11" }, "repository": { "type": "git", From 1dab560fe392f93fde61e95aa2c94db166838589 Mon Sep 17 00:00:00 2001 From: Faizan Hasan Date: Thu, 8 Jun 2017 01:09:39 +0500 Subject: [PATCH 4/6] Ignoring dist folder in git repo --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d0e2047..484491c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,9 +11,7 @@ log.txt *.sublime-workspace .vscode/ npm-debug.log* -dist/*.js.map -dist/*.d.ts -dist/*.js +dist/ .idea/ .sass-cache/ From 079ca5223c2b7661387edf1d8b0bef5da5e72388 Mon Sep 17 00:00:00 2001 From: Faizan Hasan Date: Thu, 8 Jun 2017 02:48:04 +0500 Subject: [PATCH 5/6] Configuration Added Unwanted folder "src" in npm ignore file Updated Package.json --- .npmignore | 2 ++ package.json | 16 +++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.npmignore b/.npmignore index 280a8b1..fedab5f 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,7 @@ # Node generated files node_modules +src +demo npm-debug.log # OS generated files Thumbs.db diff --git a/package.json b/package.json index a124e08..f31150a 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "ionic-audio", - "version": "3.0.1", + "version": "3.0.2", "description": "An audio player for Ionic 3 and Angular 4", "main": "./dist/index.js", "typings": "./dist/index.d.ts", "scripts": { - "install": "node_modules/.bin/ngc && copyfiles -u 1 ./src/*.scss ./dist", - "release": "npm run install && npm publish", + "build": "node_modules/.bin/ngc && copyfiles -u 1 ./src/*.scss ./dist", + "release": "npm run build && npm publish", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { @@ -18,17 +18,11 @@ "@angular/http": "4.1.2", "@angular/platform-browser": "4.1.2", "@angular/platform-browser-dynamic": "4.1.2", - "@ionic-native/core": "3.10.2", - "@ionic-native/splash-screen": "3.10.2", - "@ionic-native/status-bar": "3.10.2", - "@ionic/storage": "2.0.1", - "copyfiles": "^1.2.0", "ionic-angular": "3.3.0", - "ionicons": "3.0.0", "rxjs": "5.1.1", - "sw-toolbox": "3.6.0", + "zone.js": "0.8.11", "typescript": "2.3.3", - "zone.js": "0.8.11" + "copyfiles": "^1.2.0" }, "repository": { "type": "git", From b9c7f6d1427820da5e6bea305a06efa78d2f6e36 Mon Sep 17 00:00:00 2001 From: Ariel Date: Fri, 9 Jun 2017 17:14:37 -0300 Subject: [PATCH 6/6] fixed module forRoot for optional provider parameter --- demo/src/app/app.module.ts | 8 ++++++-- src/ionic-audio.module.ts | 14 +++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/demo/src/app/app.module.ts b/demo/src/app/app.module.ts index ac6e206..e7173a1 100644 --- a/demo/src/app/app.module.ts +++ b/demo/src/app/app.module.ts @@ -27,7 +27,11 @@ export function myCustomAudioProviderFactory() { } export function providers() { - return [{provide: ErrorHandler, useClass: IonicErrorHandler}, SplashScreen, StatusBar]; + return [ + {provide: ErrorHandler, useClass: IonicErrorHandler}, + SplashScreen, + StatusBar + ]; } export function entryComponents() { return pages; @@ -41,7 +45,7 @@ export function declarations() { imports: [ BrowserModule, IonicModule.forRoot(MyApp), - IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: myCustomAudioProviderFactory }), + IonicAudioModule.forRoot(), // or use custom function above to force a specific provider // { provide: AudioProvider, useFactory: myCustomAudioProviderFactory } ], diff --git a/src/ionic-audio.module.ts b/src/ionic-audio.module.ts index 84e5a9e..fd5502d 100644 --- a/src/ionic-audio.module.ts +++ b/src/ionic-audio.module.ts @@ -6,7 +6,7 @@ import {AudioTrackComponent} from './ionic-audio-track-component'; import {AudioTrackProgressComponent, AudioTrackProgressBarComponent} from './ionic-audio-track-progress-component'; import {AudioTrackPlayComponent} from './ionic-audio-track-play-component'; import {AudioTimePipe} from './ionic-audio-time-pipe'; -import {AudioProvider, CordovaMediaProvider, WebAudioProvider} from './ionic-audio-providers'; +import {AudioProvider, audioProviderFactory} from './ionic-audio-providers'; export function declarations() { return [ @@ -15,7 +15,15 @@ export function declarations() { AudioTrackProgressBarComponent, AudioTrackPlayComponent, AudioTimePipe - ] + ]; +} + +export function providers(audioProvider?: any) { + audioProvider = audioProvider || { provide: AudioProvider, useFactory: audioProviderFactory } + + return [ + audioProvider + ]; } @NgModule({ @@ -33,7 +41,7 @@ export class IonicAudioModule { static forRoot(audioProvider?: any): ModuleWithProviders { return { ngModule: IonicAudioModule, - providers: audioProvider + providers: providers(audioProvider) }; } }