Skip to content

Commit

Permalink
chore: bump angular from 10 to 11 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Nov 13, 2020
1 parent dc7dc72 commit ada77aa
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 199 deletions.
4 changes: 2 additions & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
39 changes: 4 additions & 35 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
# http://editorconfig.org

# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{*.html}]
indent_style=space
indent_size=2

[{.babelrc,.stylelintrc,.eslintrc,*.json}]
indent_style=space
indent_size=2
[*.ts]
quote_type = single

[*.md]
insert_final_newline = false
max_line_length = off
trim_trailing_whitespace = false

[{*.ats,*.ts}]
indent_style=space
indent_size=2

[*.js]
indent_style=space
indent_size=2

[*.js.map]
indent_style=space
indent_size=2

[*.less]
indent_style=space
indent_size=2

[{.analysis_options,*.yml,*.yaml}]
indent_style=space
indent_size=2

[tslint.json]
indent_style=space
indent_size=2
28 changes: 5 additions & 23 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
{
"printWidth": 140,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"proseWrap": "preserve",
"trailingComma": "all",
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
},
{
"files": "*.html",
"options": {
"printWidth": 160
}
}
]
}
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all"
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# ngx-tinymce [![NPM version](https://img.shields.io/npm/v/ngx-tinymce.svg)](https://www.npmjs.com/package/ngx-tinymce)
# ngx-tinymce

[![NPM version](https://img.shields.io/npm/v/ngx-tinymce.svg)](https://www.npmjs.com/package/ngx-tinymce)
[![Ci](https://github.com/cipchk/ngx-tinymce/workflows/Ci/badge.svg)](https://github.com/cipchk/ngx-tinymce/actions)

[Tinymce](https://www.tinymce.com/) Components build with [Angular](https://angular.io/).

Expand Down
1 change: 0 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
Expand Down
79 changes: 41 additions & 38 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
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-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
dir: require('path').join(__dirname, 'coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
singleRun: false,
});
};
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageReporter: {
dir: require('path').join(__dirname, '../coverage'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
singleRun: false,
restartOnFileChange: true
});
};
6 changes: 3 additions & 3 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-tinymce",
"version": "10.0.1",
"version": "11.0.0",
"description": "Angular for tinymce",
"keywords": [
"angular-tinymce",
Expand All @@ -19,7 +19,7 @@
},
"homepage": "https://cipchk.github.io/ngx-tinymce/",
"dependencies": {
"@ng-util/lazy": "^10.0.0",
"@ng-util/util": "^10.0.0"
"@ng-util/lazy": "^11.1.0",
"@ng-util/util": "^11.1.0"
}
}
30 changes: 20 additions & 10 deletions lib/src/tinymce.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
import { InputBoolean, InputNumber } from '@ng-util/util';
import { NuLazyService } from '@ng-util/lazy';
import { filter } from 'rxjs/operators';
import { TinymceOptions } from './tinymce.options';
import { DOCUMENT } from '@angular/common';

Expand All @@ -28,10 +27,17 @@ const isSSR = !(typeof document === 'object' && !!document);
selector: 'tinymce',
exportAs: 'tinymce',
template: `
<textarea *ngIf="!inline" [attr.id]="id" [attr.placeholder]="placeholder" class="tinymce-selector"></textarea>
<textarea
*ngIf="!inline"
[attr.id]="id"
[attr.placeholder]="placeholder"
class="tinymce-selector"
></textarea>
<div *ngIf="inline" [attr.id]="id"><ng-content></ng-content></div>
<div class="loading" *ngIf="load">
<ng-container *ngIf="_loading; else _loadingTpl">{{ _loading }}</ng-container>
<ng-container *ngIf="_loading; else _loadingTpl">{{
_loading
}}</ng-container>
</div>
`,
styles: [
Expand All @@ -52,7 +58,8 @@ const isSSR = !(typeof document === 'object' && !!document);
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TinymceComponent implements AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor {
export class TinymceComponent
implements AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor {
private _instance: any;
private value: string;
load = true;
Expand Down Expand Up @@ -182,7 +189,9 @@ export class TinymceComponent implements AfterViewInit, OnChanges, OnDestroy, Co
if (!this._instance) {
return;
}
this.ngZone.runOutsideAngular(() => this._instance.setMode(this._disabled ? 'readonly' : 'design'));
this.ngZone.runOutsideAngular(() =>
this._instance.setMode(this._disabled ? 'readonly' : 'design'),
);
}

ngAfterViewInit(): void {
Expand All @@ -198,10 +207,9 @@ export class TinymceComponent implements AfterViewInit, OnChanges, OnDestroy, Co
const { defConfig } = this;
const baseURL = defConfig && defConfig.baseURL;
const fileName = defConfig && defConfig.fileName;
const url = (baseURL || './assets/tinymce/') + (fileName || 'tinymce.min.js');
this.lazySrv.change
.pipe(filter(ls => ls.length === 1 && ls[0].path === url && ls[0].status === 'ok'))
.subscribe(() => this.initDelay());
const url =
(baseURL || './assets/tinymce/') + (fileName || 'tinymce.min.js');
this.lazySrv.monitor(url).subscribe(() => this.initDelay());
this.lazySrv.load(url);
}

Expand All @@ -220,7 +228,9 @@ export class TinymceComponent implements AfterViewInit, OnChanges, OnDestroy, Co
// value should be NOT NULL
this.value = value || '';
if (this._instance) {
this.ngZone.runOutsideAngular(() => this._instance.setContent(this.value));
this.ngZone.runOutsideAngular(() =>
this._instance.setContent(this.value),
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.base.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"alwaysStrict": true,
"sourceMap": true,
Expand Down
60 changes: 29 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-tinymce",
"version": "10.0.1",
"version": "11.0.0",
"description": "Angular for tinymce",
"keywords": [
"angular-tinymce",
Expand All @@ -20,51 +20,49 @@
"homepage": "https://cipchk.github.io/ngx-tinymce/",
"scripts": {
"analyze": "ng build --prod --stats-json",
"lint": "tslint -p tsconfig.json -c tslint.json 'lib/*/*.ts'",
"lint": "tslint -p tsconfig.app.json -c tslint.json 'lib/*/*.ts'",
"test": "ng test --no-progress --browsers=ChromeHeadlessCI --code-coverage --no-watch",
"build": "node scripts/build.js",
"release:next": "npm run build && cd publish && npm publish --access public --tag next",
"release": "npm run build && cd publish && npm publish --access public"
},
"dependencies": {
"@angular/animations": "~10.0.0",
"@angular/common": "~10.0.0",
"@angular/compiler": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"rxjs": "~6.5.5",
"@angular/animations": "~11.0.0",
"@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0",
"@angular/core": "~11.0.0",
"@angular/forms": "~11.0.0",
"@angular/platform-browser": "~11.0.0",
"@angular/platform-browser-dynamic": "~11.0.0",
"@angular/router": "~11.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.3",
"bootstrap": "^4.4.1",
"@ng-util/lazy": "^10.0.0",
"@ng-util/util": "^10.0.0",
"ngx-highlight-js": "^10.0.0"
"zone.js": "~0.10.2",
"bootstrap": "^4.5.3",
"@ng-util/lazy": "^11.1.0",
"@ng-util/util": "^11.1.0",
"ngx-highlight-js": "^11.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.0",
"@angular/cli": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular-devkit/build-angular": "~0.1100.0",
"@angular/cli": "~11.0.0",
"@angular/compiler-cli": "~11.0.0",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^6.0.0-next.1",
"jasmine-core": "~3.5.0",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma": "~5.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.5",
"tslint-config-prettier": "^1.18.0",
"prettier": "^2.0.5",
"codecov": "^3.5.0",
"ng-packagr": "^10.0.0"
"typescript": "~4.0.2",
"ng-packagr": "^11.0.1",
"prettier": "^2.1.2",
"codecov": "^3.8.1"
}
}
2 changes: 1 addition & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
Expand Down
Loading

0 comments on commit ada77aa

Please sign in to comment.