Skip to content

Commit

Permalink
Angular 6 and RxJS 6 support (#73, closes #69)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The library won't work on RxJS 5.x and Angular 4.x is no longer officially supported.
  • Loading branch information
Danier Rivas authored and toverux committed May 19, 2018
1 parent ae80949 commit 1ca5e11
Show file tree
Hide file tree
Showing 11 changed files with 1,612 additions and 1,253 deletions.
47 changes: 0 additions & 47 deletions .angular-cli.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
dist.tgz
113 changes: 113 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ngx-sweetalert2": {
"root": "",
"sourceRoot": "demo",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/app",
"index": "demo/index.html",
"main": "demo/main.ts",
"tsConfig": "demo/tsconfig.app.json",
"polyfills": "demo/polyfills.ts",
"assets": [
"demo/favicon.ico"
],
"styles": [
"demo/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "demo/environments/environment.ts",
"with": "demo/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "ngx-sweetalert2:build"
},
"configurations": {
"production": {
"browserTarget": "ngx-sweetalert2:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ngx-sweetalert2:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "demo/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "demo/polyfills.ts",
"tsConfig": "demo/tsconfig.spec.json",
"scripts": [],
"styles": [
"demo/styles.css"
],
"assets": [
"demo/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"demo/tsconfig.app.json",
"demo/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"ngx-sweetalert2-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application"
}
},
"defaultProject": "ngx-sweetalert2",
"schematics": {
"@schematics/angular:class": {
"spec": false
},
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
2 changes: 1 addition & 1 deletion demo/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"target": "es5",
"types": ["jasmine", "node"]
},
"files": ["test.ts"],
"files": ["test.ts", "polyfills.ts"],
"include": ["**/*.spec.ts", "../**/*.spec.ts", "**/*.d.ts"]
}
5 changes: 3 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module.exports = config => {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly'],
dir: require('path').join(__dirname, 'coverage'),
fixWebpackSourcePaths: true
},
angularCli: {
Expand Down
59 changes: 30 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,42 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.2",
"@angular/common": "^5.2.2",
"@angular/compiler": "^5.2.2",
"@angular/core": "^5.2.2",
"@angular/forms": "^5.2.2",
"@angular/http": "^5.2.2",
"@angular/platform-browser": "^5.2.2",
"@angular/platform-browser-dynamic": "^5.2.2",
"@angular/router": "^5.2.2",
"core-js": "^2.4.1",
"rxjs": "^5.4.2",
"zone.js": "^0.8.14"
"@angular/animations": "^6.0.2",
"@angular/common": "^6.0.2",
"@angular/compiler": "^6.0.2",
"@angular/core": "^6.0.2",
"@angular/forms": "^6.0.2",
"@angular/http": "^6.0.2",
"@angular/platform-browser": "^6.0.2",
"@angular/platform-browser-dynamic": "^6.0.2",
"@angular/router": "^6.0.2",
"core-js": "^2.5.6",
"rxjs": "^6.1.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/cli": "^1.4.9",
"@angular/compiler-cli": "^5.2.2",
"@angular/language-service": "^5.2.2",
"@types/jasmine": "^2.5.53",
"@angular-devkit/build-angular": "~0.6.1",
"@angular/cli": "6.0.3",
"@angular/compiler-cli": "6.0.2",
"@angular/language-service": "6.0.2",
"@types/jasmine": "^2.8.7",
"@types/jasminewd2": "^2.0.2",
"@types/node": "^9.4.0",
"codelyzer": "^4.0.1",
"jasmine-core": "^2.6.2",
"@types/node": "^10.1.1",
"codelyzer": "^4.3.0",
"jasmine-core": "^3.1.0",
"jasmine-spec-reporter": "^4.1.0",
"karma": "^2.0.0",
"karma": "^2.0.2",
"karma-chrome-launcher": "^2.1.1",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "^1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^2.1.0",
"semantic-release": "^12.2.5",
"karma-coverage-istanbul-reporter": "^2.0.0",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^1.1.0",
"ng-packagr": "^2.4.5",
"semantic-release": "^15.4.1",
"sweetalert2": "^7.8.0",
"travis-deploy-once": "^4.3.3",
"ts-node": "^4.1.0",
"tslint": "^5.7.0",
"typescript": "~2.6.0"
"travis-deploy-once": "^5.0.0",
"ts-node": "^6.0.3",
"tslint": "^5.10.0",
"typescript": "2.7.2"
}
}
6 changes: 3 additions & 3 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"author": "Morgan Touverey Quilling <mtouverey@methodinthemadness.eu>",
"license": "MIT",
"peerDependencies": {
"@angular/core": "^4.0.0 || ^5.0.0",
"@angular/common": "^4.0.0 || ^5.0.0",
"rxjs": "^5.0.0",
"@angular/core": "^5.0.0 || ^6.0.0",
"@angular/common": "^5.0.0 || ^6.0.0",
"rxjs": "^6.1.0",
"sweetalert2": "^7.15.1"
},
"ngPackage": {
Expand Down
2 changes: 1 addition & 1 deletion src/swal-partial.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ApplicationRef, ComponentFactoryResolver, ComponentRef, Directive, Host, Injector, Input, OnDestroy, OnInit,
TemplateRef
} from '@angular/core';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';
import { SwalPartialTargets } from './swal-partial-targets';
import { SwalPartialComponent } from './swal-partial.component';
import { SwalComponent } from './swal.component';
Expand Down
2 changes: 1 addition & 1 deletion src/swal.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, HostListener, Input, OnDestroy, OnInit, Output,
ViewContainerRef
} from '@angular/core';
import swal, { SweetAlertOptions, SweetAlertArrayOptions } from 'sweetalert2';
import swal, { SweetAlertArrayOptions, SweetAlertOptions } from 'sweetalert2';
import { SwalComponent } from './swal.component';

/**
Expand Down
21 changes: 16 additions & 5 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "tslint:latest",
"rulesDirectory": ["node_modules/codelyzer"],
"rules": {
"quotemark": ["single"],
"quotemark": [true, "single"],
"trailing-comma": false,
"object-literal-sort-keys": false,
"arrow-parens": false,
Expand All @@ -18,25 +18,36 @@
"@angular/core/testing"
],

"angular-whitespace": [true, "check-interpolation", "check-pipe", "check-semicolon"],
"angular-whitespace": [true, "check-interpolation", "check-semicolon"],
"banana-in-box": true,
"templates-no-negated-async": true,
"directive-selector": [false, "attribute", "swal", "camelCase"],
"component-selector": [false, "element", "swal", "kebab-case"],
"max-inline-declarations": true,
"no-life-cycle-call": true,
"prefer-output-readonly": true,
"no-conflicting-life-cycle-hooks": true,
"enforce-component-selector": false,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"use-view-encapsulation": true,
"no-attribute-parameter-decorator": true,
"no-output-named-after-standard-event": false,
"no-input-rename": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-output-on-prefix": true,
"no-forward-ref": true,
"no-unused-css": true,
"use-life-cycle-interface": true,
"contextual-life-cycle": true,
"trackBy-function": true,
"use-pipe-transform-interface": true,
"pipe-naming": [true, "camelCase", "swal"],
"component-class-suffix": true,
"directive-class-suffix": true,
"import-destructuring-spacing": true
"pipe-impure": true,
"i18n": [false, "check-id", "check-text"],
"template-cyclomatic-complexity": [true, 5],
"template-conditional-complexity": [true, 4]
}
}
Loading

0 comments on commit 1ca5e11

Please sign in to comment.