Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(upgrade): updated all dependencies #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/images/primary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM markadams/chromium-xvfb-js:latest

ENV YARN_VERSION 0.22.0
ENV YARN_VERSION 1.7.0

RUN set -ex \
&& for key in \
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
working_directory: /ngerrors

docker:
- image: ultimateangular/ngerrors-primary:latest
- image: anymaniax/ngerrors-primary

steps:
- checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { FormBuilder, FormGroup, FormArray, Validators, AbstractControl } from '

import { StockValidators } from './stock-inventory.validators';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/forkJoin';
import 'rxjs/add/operator/map';
import { Observable, forkJoin } from 'rxjs';
import { map } from 'rxjs/operators';

import { StockInventoryService } from '../../services/stock-inventory.service';

Expand Down Expand Up @@ -39,7 +38,7 @@ import { Product, Item } from '../../models/product.interface';
</div>

<div class="stock-inventory__buttons">
<button
<button
type="submit"
[disabled]="form.invalid">
Order stock
Expand Down Expand Up @@ -82,8 +81,7 @@ export class StockInventoryComponent implements OnInit {
const cart = this.stockService.getCartItems();
const products = this.stockService.getProducts();

Observable
.forkJoin(cart, products)
forkJoin(cart, products)
.subscribe(([cart, products]: [Item[], Product[]]) => {

const myMap = products
Expand All @@ -103,8 +101,9 @@ export class StockInventoryComponent implements OnInit {

validateBranch(control: AbstractControl) {
return this.stockService
.checkBranchId(control.value)
.map((response: boolean) => response ? null : { unknownBranch: true });
.checkBranchId(control.value).pipe(
map((response: boolean) => response ? null : { unknownBranch: true })
)
}

calculateTotal(value: Item[]) {
Expand Down
10 changes: 5 additions & 5 deletions example/app/stock-inventory/services/stock-inventory.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Injectable } from '@angular/core';
import { Http, Response, URLSearchParams } from '@angular/http';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import { Observable } from 'rxjs';
import { of } from 'rxjs';

import { Product, Item } from '../models/product.interface';

Expand All @@ -13,14 +13,14 @@ export class StockInventoryService {
) {}

getCartItems(): Observable<Item[]> {
return Observable.of([
return of([
{ "product_id": 1, "quantity": 10 },
{ "product_id": 3, "quantity": 50 }
]);
}

getProducts(): Observable<Product[]> {
return Observable.of([
return of([
{ "id": 1, "price": 2800, "name": "MacBook Pro" },
{ "id": 2, "price": 50, "name": "USB-C Adaptor" },
{ "id": 3, "price": 400, "name": "iPod" },
Expand All @@ -30,6 +30,6 @@ export class StockInventoryService {
}

checkBranchId(id: string): Observable<boolean> {
return Observable.of(true);
return of(true);
}
}
74 changes: 37 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,47 @@
"test:watch": "karma start"
},
"devDependencies": {
"@angular/compiler": "4.1.0",
"@angular/compiler-cli": "4.1.0",
"@types/jasmine": "2.5.46",
"@types/karma": "0.13.34",
"@types/node": "^7.0.12",
"@angular/compiler": "6.0.3",
"@angular/compiler-cli": "6.0.3",
"@types/jasmine": "2.8.7",
"@types/karma": "1.7.3",
"@types/node": "^10.1.2",
"angular2-template-loader": "0.6.2",
"awesome-typescript-loader": "3.1.2",
"file-loader": "0.11.1",
"html-loader": "0.4.5",
"jasmine-core": "2.5.2",
"karma": "1.5.0",
"karma-chrome-launcher": "2.0.0",
"karma-jasmine": "1.1.0",
"awesome-typescript-loader": "5.0.0",
"file-loader": "1.1.11",
"html-loader": "0.5.5",
"jasmine-core": "3.1.0",
"karma": "2.0.2",
"karma-chrome-launcher": "2.2.0",
"karma-jasmine": "1.1.2",
"karma-sourcemap-loader": "0.3.7",
"karma-spec-reporter": "0.0.28",
"karma-webpack": "2.0.2",
"node-sass": "4.5.2",
"nodemon": "1.11.0",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "3.0.0",
"node-sass": "4.9.0",
"nodemon": "1.17.5",
"raw-loader": "0.5.1",
"rimraf": "2.6.1",
"rollup": "0.41.6",
"rxjs": "5.3.0",
"sass-loader": "6.0.3",
"typescript": "2.3.1",
"webpack": "2.4.1",
"webpack-dev-server": "2.4.5",
"zone.js": "0.8.9"
"rimraf": "2.6.2",
"rollup": "0.59.2",
"sass-loader": "7.0.1",
"typescript": "2.7.2",
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "4.8.3",
"webpack-cli": "^2.1.4",
"webpack-dev-server": "3.1.4"
},
"dependencies": {
"@angular/animations": "4.1.0",
"@angular/common": "4.1.0",
"@angular/core": "4.1.0",
"@angular/forms": "4.1.0",
"@angular/http": "4.1.0",
"@angular/platform-browser": "4.1.0",
"@angular/platform-browser-dynamic": "4.1.0",
"@angular/router": "4.1.0",
"core-js": "2.4.1",
"reflect-metadata": "0.1.10",
"rxjs": "5.3.0",
"tslib": "1.6.1",
"zone.js": "0.8.9"
"@angular/animations": "6.0.3",
"@angular/common": "6.0.3",
"@angular/core": "6.0.3",
"@angular/forms": "6.0.3",
"@angular/http": "6.0.3",
"@angular/platform-browser": "6.0.3",
"@angular/platform-browser-dynamic": "6.0.3",
"@angular/router": "6.0.3",
"core-js": "2.5.6",
"reflect-metadata": "0.1.12",
"rxjs": "6.2.0",
"tslib": "1.9.1",
"zone.js": "0.8.26"
}
}
29 changes: 14 additions & 15 deletions src/ngxerror.directive.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Directive, Input, OnInit, OnDestroy, DoCheck, Inject, HostBinding, forwardRef } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/observable/combineLatest';
import { Observable, Subject, Subscription, combineLatest } from 'rxjs';

import { distinctUntilChanged, filter, map } from 'rxjs/operators';



import { NgxErrorsDirective } from './ngxerrors.directive';

Expand Down Expand Up @@ -47,17 +45,18 @@ export class NgxErrorDirective implements OnInit, OnDestroy, DoCheck {
ngOnInit() {

this._states = new Subject<string[]>();
this.states = this._states.asObservable().distinctUntilChanged();
this.states = this._states.asObservable().pipe(distinctUntilChanged());

const errors = this.ngxErrors.subject
.filter(Boolean)
.filter(obj => !!~this.errorNames.indexOf(obj.errorName));
const errors = this.ngxErrors.subject.pipe(
filter(Boolean),
filter(obj => !!~this.errorNames.indexOf(obj.errorName))
);

const states = this.states
.map(states => this.rules.every(rule => !!~states.indexOf(rule)));
const states = this.states.pipe(
map(states => this.rules.every(rule => !!~states.indexOf(rule)))
)

this.subscription = Observable.combineLatest(states, errors)
.subscribe(([states, errors]) => {
this.subscription = combineLatest(states, errors).subscribe(([states, errors]) => {
this.hidden = !(states && errors.control.hasError(errors.errorName));
});

Expand Down
2 changes: 1 addition & 1 deletion src/ngxerrors.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, Input, OnChanges, OnDestroy, AfterViewInit } from '@angular/core';
import { FormGroupDirective, AbstractControl } from '@angular/forms';

import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { BehaviorSubject } from 'rxjs';

import { ErrorDetails, ErrorOptions } from './ngxerrors';

Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"type": "git"
},
"peerDependencies": {
"@angular/forms": "^2.3.1 || ^5.0.0"
"@angular/forms": "^6.0.3"
}
}
70 changes: 41 additions & 29 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const path = require('path');
const webpack = require('webpack');
const typescript = require('typescript');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');

const plugins = [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: (module) => module.context && /node_modules/.test(module.context)
})
];

Expand All @@ -19,36 +15,20 @@ if (process.env.NODE_ENV === 'production') {
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
beautify: false,
mangle: {
screw_ie8: true
},
compress: {
unused: true,
dead_code: true,
drop_debugger: true,
conditionals: true,
evaluate: true,
drop_console: true,
sequences: true,
booleans: true,
screw_ie8: true,
warnings: false
},
comments: false
})
);
} else {
plugins.push(
new webpack.NamedModulesPlugin(),
new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.resolve(__dirname, './notfound'))
new webpack.ContextReplacementPlugin(
/@angular(\\|\/)core(\\|\/)fesm5/,
path.resolve(__dirname, './notfound')
)
);
}

module.exports = {
mode: 'production',
cache: true,
context: __dirname,
devServer: {
Expand All @@ -74,7 +54,7 @@ module.exports = {
},
output: {
filename: '[name].js',
chunkFilename: '[name]-chunk.js',
chunkFilename: '[name].js',
publicPath: '/build/',
path: path.resolve(__dirname, 'example/build')
},
Expand Down Expand Up @@ -102,11 +82,43 @@ module.exports = {
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'file-loader'
},
}
]
},
resolve: {
extensions: ['.ts', '.js']
},
stats: {
colors: false,
hash: true,
timings: true,
assets: true,
chunks: true,
chunkModules: true,
modules: true,
children: true
},
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
uglifyOptions: {
compress: {
inline: false
}
}
})
],
splitChunks: {
cacheGroups: {
vendor: {
chunks: 'all',
name: 'vendor',
test: /[\\/]node_modules[\\/]/,
enforce: true
}
}
}
},
plugins
};
Loading