Skip to content

Commit

Permalink
feat: publish Ivy-only build
Browse files Browse the repository at this point in the history
BREAKING CHANGE: If you application still uses View Engine, it won't be able to use ngx-sweetalert2. Otherwise please note that the library remains compatible with Angular 12 (Ivy-enabled). This change allows to speed up compilation preparation time on Ivy-enabled apps, and is now recommended by the Angular guidelines.
  • Loading branch information
toverux committed Feb 27, 2022
1 parent ab5b2b7 commit 6a80988
Show file tree
Hide file tree
Showing 15 changed files with 3,597 additions and 5,040 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: yarn install

- name: Build library package
run: yarn build:lib
run: yarn build:lib --configuration=production

- name: Copy readme and license files
run: yarn build:copy-files
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/tmp
/out-tsc

# caches
/.angular/cache

# dependencies
/node_modules

Expand Down
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions .tmuxinator.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ npm install sweetalert2 @sweetalert2/ngx-sweetalert2

| Angular version | Latest compatible version range | Required SweetAlert2 version range |
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| Angular 12 | @sweetalert2/ngx-sweetalert2@**^10.0.0** (current) | sweetalert2@**^11.0.0** |
| Angular 12+ | @sweetalert2/ngx-sweetalert2@**^11.0.0** (current) | sweetalert2@**^11.0.0** |
| Angular 9 to 11 | [@sweetalert2/ngx-sweetalert2@**~9.0.0**](https://github.com/sweetalert2/ngx-sweetalert2/tree/v9.0.0#readme) | sweetalert2@**^10.8.0** |
| Angular 8 | [@sweetalert2/ngx-sweetalert2@**~7.3.0**](https://github.com/sweetalert2/ngx-sweetalert2/tree/v7.3.0#readme) (:warning: NOT ~7.4.0, broken AoT metadata) | sweetalert2@**^9.7.0** |
| Angular 7 | [@sweetalert2/ngx-sweetalert2@**^5.1.0**](https://github.com/sweetalert2/ngx-sweetalert2/tree/v5.1.0#readme) | sweetalert2@**^8.5.0** |
Expand Down
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,48 @@
"build:lib": "ng build ngx-sweetalert2",
"build:demo": "ng build ngx-sweetalert2-demo",
"build:copy-files": "cp README.md dist/ngx-sweetalert2 && cp LICENSE.txt dist/ngx-sweetalert2",
"test": "yarn ngcc && run-p test:*",
"test": "run-p test:*",
"test:lib": "ng test ngx-sweetalert2",
"test:demo": "ng test ngx-sweetalert2-demo",
"lint": "run-s lint:*",
"lint:lib": "ng lint ngx-sweetalert2",
"lint:demo": "ng lint ngx-sweetalert2-demo",
"tmux:serve": "tmuxinator local",
"semantic-release": "semantic-release"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.0.5",
"@angular/common": "~12.0.5",
"@angular/compiler": "~12.0.5",
"@angular/core": "~12.0.5",
"@angular/forms": "~12.0.5",
"@angular/platform-browser": "~12.0.5",
"@angular/platform-browser-dynamic": "~12.0.5",
"@angular/router": "~12.0.5",
"rxjs": "~6.6.7",
"@angular/animations": "~13.2.4",
"@angular/common": "~13.2.4",
"@angular/compiler": "~13.2.4",
"@angular/core": "~13.2.4",
"@angular/forms": "~13.2.4",
"@angular/platform-browser": "~13.2.4",
"@angular/platform-browser-dynamic": "~13.2.4",
"@angular/router": "~13.2.4",
"rxjs": "~7.5.4",
"sweetalert2": "^11.3.10",
"tslib": "^2.3.1",
"zone.js": "~0.11.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.0.5",
"@angular/cli": "~12.0.5",
"@angular/compiler-cli": "~12.0.5",
"@angular/language-service": "~12.0.5",
"@angular-devkit/build-angular": "~13.2.5",
"@angular/cli": "~13.2.5",
"@angular/compiler-cli": "~13.2.4",
"@angular/language-service": "~13.2.4",
"@types/jasmine": "^3.10.3",
"@types/jasminewd2": "~2.0.10",
"@types/node": "^15.14.9",
"jasmine-core": "^3.99.0",
"@types/node": "^16",
"jasmine-core": "^4.0.1",
"jasmine-spec-reporter": "^7.0.0",
"karma": "^6.3.15",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.7.0",
"ng-packagr": "^12.2.7",
"ng-packagr": "^13.2.1",
"npm-run-all": "^4.1.5",
"semantic-release": "^17.4.7",
"ts-node": "~10.0.0",
"typescript": "~4.2.0"
"semantic-release": "^19.0.2",
"ts-node": "~10.5.0",
"typescript": "~4.5.5"
}
}
4 changes: 3 additions & 1 deletion projects/ngx-sweetalert2-demo/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@ang
declare const require: any;

//=> First, initialize the Angular testing environment
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
});

//=> Then we find all the tests
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
5 changes: 1 addition & 4 deletions projects/ngx-sweetalert2/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/ngx-sweetalert2",
"lib": {
"entryFile": "src/public-api.ts",
"umdModuleIds": {
"sweetalert2": "Sweetalert2"
}
"entryFile": "src/public-api.ts"
}
}
2 changes: 1 addition & 1 deletion projects/ngx-sweetalert2/src/lib/swal.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class SwalDirective implements OnInit, OnDestroy {
this.swalInstance.swalOptions = this.swalOptions;
}

const swalClosed = new Subject();
const swalClosed = new Subject<void>();

this.swalInstance.confirm.asObservable().pipe(takeUntil(swalClosed)).subscribe(v => this.confirm.emit(v));
this.swalInstance.deny.asObservable().pipe(takeUntil(swalClosed)).subscribe(v => this.deny.emit(v));
Expand Down
3 changes: 0 additions & 3 deletions projects/ngx-sweetalert2/src/lib/sweetalert2.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export function provideDefaultSwal() {
],
exports: [
SwalComponent, SwalPortalDirective, SwalDirective
],
entryComponents: [
SwalComponent, SwalPortalComponent
]
})
export class SweetAlert2Module {
Expand Down
4 changes: 3 additions & 1 deletion projects/ngx-sweetalert2/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@ang
declare const require: any;

//=> First, initialize the Angular testing environment
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
});

//=> Then we find all the tests
const context = require.context('./', true, /\.spec\.ts$/);
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-sweetalert2/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictTemplates": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-sweetalert2/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": false
"compilationMode": "partial"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictTemplates": true,
"strictInjectionParameters": true
}
}
Loading

0 comments on commit 6a80988

Please sign in to comment.