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

angular 12/13 compatible #168

Open
wants to merge 12 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ speed-measure-plugin.json
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
52 changes: 20 additions & 32 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"prefix": "async-storage-plugin",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.lib.json",
"project": "src/ng-package.json"
},
"configurations": {
"production": {
"project": "src/ng-package.prod.json"
}
, "tsConfig": "tsconfig.lib.prod.json"
}
}
},
"test": {
Expand All @@ -29,18 +30,6 @@
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.lib.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
Expand Down Expand Up @@ -68,13 +57,21 @@
],
"styles": [
{
"input": "integration/theme/variables.scss"
"input": "integration/theme/variables.scss",
"inject": true
},
{
"input": "integration/global.scss"
"input": "integration/global.scss",
"inject": true
}
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -87,9 +84,7 @@
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -98,10 +93,15 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -145,18 +145,6 @@
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"integration/tsconfig.app.json",
"integration/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"ionic-cordova-build": {
"builder": "@ionic/angular-toolkit:cordova-build",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion integration/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const routes: Routes = [
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
imports: [RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' })],
exports: [RouterModule]
})
export class AppRoutingModule {}
4 changes: 2 additions & 2 deletions integration/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TestBed, async } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';

import { Platform } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
Expand All @@ -10,7 +10,7 @@ import { AppComponent } from './app.component';
describe('AppComponent', () => {
let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']);
splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']);
platformReadySpy = Promise.resolve();
Expand Down
4 changes: 2 additions & 2 deletions integration/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { StatusBar } from '@ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { NgxsModule } from '@ngxs/store';
import { NgxsAsyncStoragePluginModule } from '@ngxs-labs/async-storage-plugin';
import { NgxsAsyncStoragePluginModule } from '../../src/lib/async-storage.module';
import { StorageService } from './services/storage.service';
import { IonicStorageModule } from '@ionic/storage';
import { IonicStorageModule } from '@ionic/storage-angular';

import { NgxsResetPluginModule } from 'ngxs-reset-plugin';

Expand Down
4 changes: 2 additions & 2 deletions integration/app/home/home.page.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { HomePage } from './home.page';

describe('HomePage', () => {
let component: HomePage;
let fixture: ComponentFixture<HomePage>;

beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [HomePage],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
Expand Down
2 changes: 1 addition & 1 deletion integration/app/services/storage.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Observable, from } from 'rxjs';
import { Storage } from '@ionic/storage';
import { AsyncStorageEngine } from '@ngxs-labs/async-storage-plugin';
import { AsyncStorageEngine } from '../../../src/lib/symbols';

@Injectable({
providedIn: 'root'
Expand Down
2 changes: 1 addition & 1 deletion integration/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ export const environment = {
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
12 changes: 1 addition & 11 deletions integration/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,9 @@
**/
// import 'core-js/es6/array';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';

/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
Expand Down Expand Up @@ -81,7 +71,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
6 changes: 4 additions & 2 deletions integration/test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone-testing';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
Expand All @@ -12,7 +12,9 @@ declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
9 changes: 6 additions & 3 deletions integration/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"outDir": "../out-tsc/app",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"integration/**/*.d.ts"
]
}
Loading