diff --git a/.travis.yml b/.travis.yml index c6d5a1f24..0ae4eff39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: node_js -node_js: stable +node_js: --lts cache: yarn @@ -11,7 +11,6 @@ before_install: - git config --global user.email 'admin@1stg.me' script: - - set -e - yarn lint - yarn build - yarn run build-storybook @@ -21,7 +20,7 @@ deploy: skip_cleanup: true script: bash deploy.sh on: - branch: release + branch: master - provider: pages email: admin@1stg.me name: JounQin diff --git a/deploy.sh b/deploy.sh index ab226e369..ec6cc5785 100644 --- a/deploy.sh +++ b/deploy.sh @@ -2,13 +2,16 @@ set -e -git remote set-url origin https://user:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git -npm set //registry.npmjs.org/:_authToken $NPM_TOKEN +git remote set-url origin "https://user:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git" +npm set //registry.npmjs.org/:_authToken "$NPM_TOKEN" git fetch origin master:master git checkout master -yarn run standard-version -a -git push --follow-tags origin master -cd dist -npm publish --access=public +PKG_VERSION=$(jq -r '.version' src/package.json) + +git fetch origin v"$PKG_VERSION" || { + yarn run standard-version -a --release-as "$PKG_VERSION" + git push --follow-tags origin master + npm publish dist --access=public +} diff --git a/package.json b/package.json index 6036c45a5..385f8fbbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rxts/ngrx", - "version": "0.3.1", + "version": "0.0.0", "description": "🎉 Angular + RxJS + TypeScript = 🔥", "repository": "git@github.com:rx-ts/ngrx.git", "author": "JounQin ", @@ -85,10 +85,5 @@ "extends": [ "1stg" ] - }, - "standard-version": { - "skip": { - "bump": true - } } } diff --git a/src/directives/async.directive.ts b/src/directives/async.directive.ts index ab529b2ca..56b7c688d 100644 --- a/src/directives/async.directive.ts +++ b/src/directives/async.directive.ts @@ -9,13 +9,7 @@ import { ViewRef, } from '@angular/core' import { Observable, Subject, Subscription, combineLatest } from 'rxjs' -import { - finalize, - retry, - startWith, - takeUntil, - withLatestFrom, -} from 'rxjs/operators' +import { finalize, retry, startWith, takeUntil } from 'rxjs/operators' import { Callback, Nullable } from '../types/public-api' import { ObservableInput } from '../utils/public-api' @@ -47,9 +41,8 @@ export class AsyncDirective @Input('rxAsyncRefetch') private refetch$$ = new Subject() - @ObservableInput() @Input('rxAsyncRetryTimes') - private retryTimes$!: Observable + private retryTimes?: number private destroy$$ = new Subject() private reload$$ = new Subject() @@ -78,11 +71,8 @@ export class AsyncDirective this.refetch$$.pipe(startWith(null)), this.reload$$.pipe(startWith(null)), ]) - .pipe( - takeUntil(this.destroy$$), - withLatestFrom(this.retryTimes$), - ) - .subscribe(([[context, fetcher, params], retryTimes]) => { + .pipe(takeUntil(this.destroy$$)) + .subscribe(([context, fetcher, params]) => { this.disposeSub() Object.assign(this.context, { @@ -93,7 +83,7 @@ export class AsyncDirective this.sub = fetcher .call(context, params) .pipe( - retry(retryTimes), + retry(this.retryTimes), finalize(() => { this.context.loading = false if (this.viewRef) { diff --git a/src/package.json b/src/package.json index 224a4609d..7ac66c208 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@rxts/ngrx", - "version": "0.3.1", + "version": "0.3.2", "description": "🎉 Angular + RxJS + TypeScript = 🔥", "repository": "git@github.com:rx-ts/ngrx.git", "author": "JounQin ",