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

feat: Angular 13 support (+rxjs 7) #632

Merged
merged 1 commit into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
537 changes: 537 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/casl-ability/package.json
Expand Up @@ -54,7 +54,7 @@
"license": "MIT",
"devDependencies": {
"@casl/dx": "workspace:^1.0.0",
"@types/jest": "^26.0.22",
"@types/jest": "^27.4.7",
"@types/node": "^14.0.5",
"chai": "^4.1.0",
"chai-spies": "^1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/casl-ability/src/RuleIndex.ts
Expand Up @@ -19,8 +19,8 @@ export interface RuleIndexOptions<A extends Abilities, C> extends Partial<RuleOp
anySubjectType?: string;
}

declare const $abilities: unique symbol;
declare const $conditions: unique symbol;
export declare const $abilities: unique symbol;
export declare const $conditions: unique symbol;
interface WithGenerics {
[$abilities]: any
[$conditions]: any
Expand Down
4 changes: 4 additions & 0 deletions packages/casl-angular/jest.config.js
Expand Up @@ -2,7 +2,11 @@ const config = require('@casl/dx/config/jest.config');

module.exports = {
...config,
transform: {
'^.+\\.(ts|js|mjs|html|svg)$': 'jest-preset-angular',
},
testEnvironment: "jsdom",
preset: 'jest-preset-angular',
setupFilesAfterEnv: [
'@abraham/reflection',
'zone.js/dist/zone',
Expand Down
25 changes: 14 additions & 11 deletions packages/casl-angular/package.json
Expand Up @@ -46,25 +46,28 @@
"author": "Sergii Stotskyi <sergiy.stotskiy@gmail.com>",
"license": "MIT",
"peerDependencies": {
"@angular/core": "^12.0.0",
"@angular/core": "^13.0.0",
"@casl/ability": "^3.0.0 || ^4.0.0 || ^5.1.0",
"rxjs": "^6.5.3",
"rxjs": "^7.5.5",
"tslib": "^2.0.0"
},
"devDependencies": {
"@abraham/reflection": "^0.8.0",
"@angular/common": "^12.0.0",
"@angular/compiler": "^12.0.0",
"@angular/compiler-cli": "^12.0.0",
"@angular/core": "^12.0.0",
"@angular/platform-browser": "^12.0.0",
"@angular/platform-browser-dynamic": "^12.0.0",
"@angular/common": "^13.0.0",
"@angular/compiler": "^13.0.0",
"@angular/compiler-cli": "^13.0.0",
"@angular/core": "^13.0.0",
"@angular/platform-browser": "^13.0.0",
"@angular/platform-browser-dynamic": "^13.0.0",
"@angular-devkit/build-angular": "^13.0.0",
"jest": "^27.0.0",
"@casl/ability": "^5.1.0",
"@casl/dx": "workspace:^1.0.0",
"@types/jest": "^26.0.22",
"rxjs": "^6.5.3",
"@types/jest": "^27.4.7",
"jest-preset-angular": "^11.0.0",
"rxjs": "^7.5.5",
"tslib": "^2.0.0",
"typescript": "~4.2.3",
"typescript": "~4.4.4",
"zone.js": "~0.11.4"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions packages/casl-angular/tsconfig.json
Expand Up @@ -4,8 +4,8 @@
"inlineSources": true,
"inlineSourceMap": true,
"declaration": false,
"module": "es2015",
"target": "es2015",
"module": "es2020",
"target": "es2017",
"skipLibCheck": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
Expand All @@ -15,7 +15,7 @@
"importHelpers": true,
"noEmitHelpers": true,
"lib": [
"es2018",
"es2019",
"dom"
]
},
Expand Down
8 changes: 8 additions & 0 deletions packages/casl-angular/tsconfig.spec.json
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["jest"]
},
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
}
7 changes: 5 additions & 2 deletions packages/dx/package.json
Expand Up @@ -24,16 +24,19 @@
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4 || ^3 || ^2.3.0 || ^1.7.0",
"jest": "^27.0.0",
"lint-staged": "^11.0.0",
"rollup": "^2.47.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-terser": "^7.0.2",
"semantic-release": "^17.4.2",
"ts-jest": "^27.0.0",
"typescript": "~4.1.0"
"typescript": "~4.4.4"
},
"devDependencies": {
"@types/jest": "^26.0.22"
"@types/jest": "^27.4.7"
}
}