Skip to content

Commit 2acf12e

Browse files
CodingCloud9527CodingCloud9527
CodingCloud9527
authored and
CodingCloud9527
committed
feat: migrate to Angular 11
1 parent fcb7729 commit 2acf12e

File tree

12 files changed

+1067
-1126
lines changed

12 files changed

+1067
-1126
lines changed

angular.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"optimization": true,
4444
"outputHashing": "all",
4545
"sourceMap": false,
46-
"extractCss": true,
4746
"namedChunks": false,
4847
"aot": true,
4948
"extractLicenses": true,
@@ -127,7 +126,7 @@
127126
"prefix": "lib",
128127
"architect": {
129128
"build": {
130-
"builder": "@angular-devkit/build-ng-packagr:build",
129+
"builder": "@angular-devkit/build-angular:ng-packagr",
131130
"options": {
132131
"tsConfig": "projects/ngx-sortablejs/tsconfig.lib.json",
133132
"project": "projects/ngx-sortablejs/ng-package.json"

package.json

+25-26
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,49 @@
2222
},
2323
"private": true,
2424
"dependencies": {
25-
"@angular/animations": "~10.2.0",
26-
"@angular/common": "~10.2.0",
27-
"@angular/compiler": "~10.2.0",
28-
"@angular/core": "~10.2.0",
29-
"@angular/forms": "~10.2.0",
30-
"@angular/platform-browser": "~10.2.0",
31-
"@angular/platform-browser-dynamic": "~10.2.0",
32-
"@angular/router": "~10.2.0",
25+
"@angular/animations": "~11.0.5",
26+
"@angular/common": "~11.0.5",
27+
"@angular/compiler": "~11.0.5",
28+
"@angular/core": "~11.0.5",
29+
"@angular/forms": "~11.0.5",
30+
"@angular/platform-browser": "~11.0.5",
31+
"@angular/platform-browser-dynamic": "~11.0.5",
32+
"@angular/router": "~11.0.5",
3333
"bootstrap": "^4.4.1",
3434
"ngx-bootstrap": "^4.3.0",
3535
"rxjs": "~6.5.4",
3636
"sortablejs": "^1.10.2",
37-
"tslib": "^2.0.3",
37+
"tslib": "^2.0.0",
3838
"zone.js": "~0.10.3"
3939
},
4040
"devDependencies": {
41-
"@angular-devkit/build-angular": "~0.1002.0",
42-
"@angular-devkit/build-ng-packagr": "~0.1002.0",
43-
"@angular/cli": "~10.2.0",
44-
"@angular/compiler-cli": "~10.2.0",
45-
"@angular/language-service": "~10.2.0",
41+
"@angular-devkit/build-angular": "~0.1100.5",
42+
"@angular/cli": "~11.0.5",
43+
"@angular/compiler-cli": "~11.0.5",
44+
"@angular/language-service": "~11.0.5",
4645
"@semantic-release/changelog": "^3.0.6",
4746
"@semantic-release/git": "^7.0.18",
48-
"@types/jasmine": "^3.3.16",
47+
"@types/jasmine": "~3.6.0",
4948
"@types/jasminewd2": "^2.0.8",
5049
"@types/node": "^8.10.59",
5150
"@types/sortablejs": "^1.10.2",
52-
"codelyzer": "^5.2.1",
51+
"codelyzer": "^6.0.0",
5352
"coveralls": "^3.0.9",
5453
"cpr": "^3.0.1",
55-
"jasmine-core": "~3.4.0",
56-
"jasmine-spec-reporter": "~4.2.1",
57-
"karma": "~4.1.0",
58-
"karma-chrome-launcher": "~2.2.0",
54+
"jasmine-core": "~3.6.0",
55+
"jasmine-spec-reporter": "~5.0.0",
56+
"karma": "~5.1.1",
57+
"karma-chrome-launcher": "~3.1.0",
5958
"karma-coverage-istanbul-reporter": "^2.0.6",
60-
"karma-jasmine": "~2.0.1",
61-
"karma-jasmine-html-reporter": "^1.5.1",
62-
"ng-packagr": "^10.1.2",
59+
"karma-jasmine": "~4.0.0",
60+
"karma-jasmine-html-reporter": "^1.5.0",
61+
"ng-packagr": "^11.0.3",
6362
"ngx-spec": "^2.1.4",
64-
"protractor": "~5.4.0",
63+
"protractor": "~7.0.0",
6564
"semantic-release": "^15.14.0",
6665
"ts-node": "~7.0.0",
6766
"tsickle": "^0.39.1",
68-
"tslint": "~5.15.0",
67+
"tslint": "~6.1.3",
6968
"typescript": "~4.0.3"
7069
}
71-
}
70+
}

projects/ngx-sortablejs/src/lib/sortablejs.directive.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {async, TestBed} from '@angular/core/testing';
2+
import { TestBed, waitForAsync } from '@angular/core/testing';
33
import {SortablejsModule} from './sortablejs.module';
44

55
describe('SortablejsDirective', () => {
@@ -14,7 +14,7 @@ describe('SortablejsDirective', () => {
1414
items = [1, 2, 3, 4, 5];
1515
}
1616

17-
beforeEach(async(() => {
17+
beforeEach(waitForAsync(() => {
1818
TestBed.configureTestingModule({
1919
declarations: [
2020
TestComponent1,

src/app/app.component.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { async, TestBed } from '@angular/core/testing';
1+
import { TestBed, waitForAsync } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
44

55
describe('AppComponent', () => {
6-
beforeEach(async(() => {
6+
beforeEach(waitForAsync(() => {
77
TestBed.configureTestingModule({
88
declarations: [
99
AppComponent,
@@ -14,7 +14,7 @@ describe('AppComponent', () => {
1414
}).compileComponents();
1515
}));
1616

17-
it('should create the app', async(() => {
17+
it('should create the app', waitForAsync(() => {
1818
const fixture = TestBed.createComponent(AppComponent);
1919
const app = fixture.debugElement.componentInstance;
2020
expect(app).toBeTruthy();

src/app/app.module.ts

+12-13
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@ import { TestCasesModule } from './test-cases/test-cases.module';
1919
imports: [
2020
BrowserModule,
2121
RouterModule.forRoot([
22-
{ path: '', pathMatch: 'full', redirectTo: 'sortable-array' },
23-
{
22+
{ path: '', pathMatch: 'full', redirectTo: 'sortable-array' },
23+
{
2424
path: 'sortable-array',
2525
component: SimpleSortableComponent,
26-
},
27-
{
26+
},
27+
{
2828
path: 'sortable-form-array',
2929
component: SortableFormArrayComponent,
30-
},
31-
{
30+
},
31+
{
3232
path: 'custom-options',
3333
component: SortableWithOptionsComponent,
34-
},
35-
{
34+
},
35+
{
3636
path: 'multiple-lists',
3737
component: MultipleListsComponent,
38-
},
39-
40-
{
38+
},
39+
{
4140
path: 'tests/cross-components-multiple-list',
4241
component: CrossComponentsMultipleListsComponent,
43-
},
44-
]),
42+
},
43+
], { relativeLinkResolution: 'legacy' }),
4544

4645
// global settings
4746
SortablejsModule.forRoot({

src/app/examples/multiple-lists/multiple-lists.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { SortablejsModule } from 'ngx-sortablejs';
33
import { MultipleListsComponent } from './multiple-lists.component';
44

55
describe('MultipleListsComponent', () => {
66
let component: MultipleListsComponent;
77
let fixture: ComponentFixture<MultipleListsComponent>;
88

9-
beforeEach(async(() => {
9+
beforeEach(waitForAsync(() => {
1010
TestBed.configureTestingModule({
1111
declarations: [MultipleListsComponent],
1212
imports: [

src/app/examples/simple-sortable/simple-sortable.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { SortablejsModule } from 'ngx-sortablejs';
33
import { SimpleSortableComponent } from './simple-sortable.component';
44

55
describe('SimpleSortableComponent', () => {
66
let component: SimpleSortableComponent;
77
let fixture: ComponentFixture<SimpleSortableComponent>;
88

9-
beforeEach(async(() => {
9+
beforeEach(waitForAsync(() => {
1010
TestBed.configureTestingModule({
1111
declarations: [SimpleSortableComponent],
1212
imports: [

src/app/examples/sortable-form-array/sortable-form-array.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { ReactiveFormsModule } from '@angular/forms';
33
import { SortablejsModule } from 'ngx-sortablejs';
44
import { SortableFormArrayComponent } from './sortable-form-array.component';
@@ -7,7 +7,7 @@ describe('SortableFormArrayComponent', () => {
77
let component: SortableFormArrayComponent;
88
let fixture: ComponentFixture<SortableFormArrayComponent>;
99

10-
beforeEach(async(() => {
10+
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
1212
declarations: [SortableFormArrayComponent],
1313
imports: [

src/app/examples/sortable-with-options/sortable-with-options.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { SortablejsModule } from 'ngx-sortablejs';
33
import { SortableWithOptionsComponent } from './sortable-with-options.component';
44

55
describe('SortableWithOptionsComponent', () => {
66
let component: SortableWithOptionsComponent;
77
let fixture: ComponentFixture<SortableWithOptionsComponent>;
88

9-
beforeEach(async(() => {
9+
beforeEach(waitForAsync(() => {
1010
TestBed.configureTestingModule({
1111
declarations: [SortableWithOptionsComponent],
1212
imports: [

src/app/test-cases/cross-components-multiple-lists/child-component/child-component.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { SortablejsModule } from 'ngx-sortablejs';
33
import { ChildComponentComponent } from './child-component.component';
44

55
describe('ChildComponentComponent', () => {
66
let component: ChildComponentComponent;
77
let fixture: ComponentFixture<ChildComponentComponent>;
88

9-
beforeEach(async(() => {
9+
beforeEach(waitForAsync(() => {
1010
TestBed.configureTestingModule({
1111
declarations: [ChildComponentComponent],
1212
imports: [

src/app/test-cases/cross-components-multiple-lists/cross-components-multiple-lists.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
1+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { SortablejsModule } from 'ngx-sortablejs';
33
import { ChildComponentComponent } from './child-component/child-component.component';
44
import { CrossComponentsMultipleListsComponent } from './cross-components-multiple-lists.component';
@@ -7,7 +7,7 @@ describe('CrossComponentsMultipleListsComponent', () => {
77
let component: CrossComponentsMultipleListsComponent;
88
let fixture: ComponentFixture<CrossComponentsMultipleListsComponent>;
99

10-
beforeEach(async(() => {
10+
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
1212
declarations: [
1313
CrossComponentsMultipleListsComponent,

0 commit comments

Comments
 (0)