Skip to content

Commit

Permalink
fear(core): add support for Angular v13
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Nov 8, 2021
1 parent 34a5259 commit 3a4c7ee
Show file tree
Hide file tree
Showing 35 changed files with 25,774 additions and 14,036 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@
/dist
/tmp
/out-tsc
/.angular

# dependencies
/node_modules
Expand Down
65 changes: 0 additions & 65 deletions FIREBASE_EXAMPLE.md

This file was deleted.

21 changes: 11 additions & 10 deletions README.md
Expand Up @@ -47,16 +47,17 @@ npm install @ngx-translate/core --save

Choose the version corresponding to your Angular version:

Angular | @ngx-translate/core | @ngx-translate/http-loader
----------- | ------------------- | --------------------------
10/11/12 | 13.x+ | 6.x+
9 | 12.x+ | 5.x+
8 | 12.x+ | 4.x+
7 | 11.x+ | 4.x+
6 | 10.x | 3.x
5 | 8.x to 9.x | 1.x to 2.x
4.3 | 7.x or less | 1.x to 2.x
2 to 4.2.x | 7.x or less | 0.x
Angular | @ngx-translate/core | @ngx-translate/http-loader
------------- | ------------------- | --------------------------
13 (ivy only) | 14.x+ | 7.x+
10/11/12/13 | 13.x+ | 6.x+
9 | 12.x+ | 5.x+
8 | 12.x+ | 4.x+
7 | 11.x+ | 4.x+
6 | 10.x | 3.x
5 | 8.x to 9.x | 1.x to 2.x
4.3 | 7.x or less | 1.x to 2.x
2 to 4.2.x | 7.x or less | 0.x

---

Expand Down
55 changes: 41 additions & 14 deletions angular.json
Expand Up @@ -4,36 +4,63 @@
"newProjectRoot": "projects",
"projects": {
"@ngx-translate/core": {
"projectType": "library",
"root": "projects/ngx-translate/core",
"sourceRoot": "projects/ngx-translate/core/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/ngx-translate/core/tsconfig.lib.json",
"project": "projects/ngx-translate/core/ng-package.json"
}
},
"configurations": {
"production": {
"tsConfig": "projects/ngx-translate/core/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/ngx-translate/core/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ngx-translate/core/test.ts",
"main": "projects/ngx-translate/core/src/test.ts",
"tsConfig": "projects/ngx-translate/core/tsconfig.spec.json",
"karmaConfig": "projects/ngx-translate/core/karma.conf.js"
}
}
}
},
"@ngx-translate/http-loader": {
"projectType": "library",
"root": "projects/ngx-translate/http-loader",
"sourceRoot": "projects/ngx-translate/http-loader/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/ngx-translate/http-loader/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ngx-translate/http-loader/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/ngx-translate/http-loader/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": [
"projects/ngx-translate/core/tsconfig.lib.json",
"projects/ngx-translate/core/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
"main": "projects/ngx-translate/http-loader/src/test.ts",
"tsConfig": "projects/ngx-translate/http-loader/tsconfig.spec.json",
"karmaConfig": "projects/ngx-translate/http-loader/karma.conf.js"
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions jest-global-mocks.ts
@@ -0,0 +1,24 @@
Object.defineProperty(window, 'CSS', { value: null });
Object.defineProperty(document, 'doctype', {
value: '<!DOCTYPE html>',
});
Object.defineProperty(window, 'getComputedStyle', {
value: () => {
return {
display: 'none',
appearance: ['-webkit-appearance'],
};
},
});
/**
* ISSUE: https://github.com/angular/material2/issues/7101
* Workaround for JSDOM missing transform property
*/
Object.defineProperty(document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true,
};
},
});
10 changes: 10 additions & 0 deletions jest.config.js
@@ -0,0 +1,10 @@
require('jest-preset-angular/ngcc-jest-processor');
const { pathsToModuleNameMapper } = require('ts-jest/utils');
const { paths } = require('./tsconfig.json').compilerOptions;

/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
preset: 'jest-preset-angular',
moduleNameMapper: pathsToModuleNameMapper(paths, { prefix: '<rootDir>' }),
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
};

0 comments on commit 3a4c7ee

Please sign in to comment.