Skip to content

Commit

Permalink
chore(build): enable strict mode (#6047)
Browse files Browse the repository at this point in the history
* chore(accordion): enable strict

* feat(alert): enable strict

* feat(buttons): add strict mode

* wip

* wip: collapse

* strict: collapse

* strict: component-loader

* strict: datepicker

* strict: dropdown

* strict: modal

* strict: pagination

* strict: popover

* strict: progressbar and part of positioning

* strict: rating

* strict: sortable

* strict: tabs

* strict: timepicker

* strict: tooltip

* wip strict: typeahead

* strict: utils

* strict: positionong

* strict: lint

* fix: dropdown

* fix tabs

* fix datepicker and positioning

* fix rating

* fix pagination

* fix spec helper types

* wip tooltip

* ng: remove ci job

* tests: fix tooltip tests

* fix tooltip

* fix datepicker

* fix accordion

* wip timepicker

* chore: husky@4

* chore: remove any in tooltip spec

* buttons: fix uncheckable behaviour

* chore: fix lint

* carousel: fix tests and expression has been changed in docs

* chore: fix timepicker tests

* chore: fix typeahead tests

Co-authored-by: Dmitry <daniloff200@gmail.com>
  • Loading branch information
valorkin and daniloff200 committed Apr 5, 2021
1 parent 9c90639 commit 51051bd
Show file tree
Hide file tree
Showing 186 changed files with 2,424 additions and 1,910 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-pull-request.yml
Expand Up @@ -165,7 +165,7 @@ jobs:
# these containers will load balance all found tests among themselves
- name: smoke e2e on firebase
if: ${{ needs.firebase_preview.outputs.output_url }}
run: npx nx run ci-docs-e2e:e2e --runner cloud --record --group smoke --baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ -- --parallel
run: npx nx run ngx-bootstrap-docs-e2e:e2e -c firebase --runner cloud --record --group smoke --baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ -- --parallel

- name: smoke e2e local
if: ${{ !needs.firebase_preview.outputs.output_url }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push-to-dev.yml
Expand Up @@ -162,6 +162,6 @@ jobs:

- name: full e2e
continue-on-error: true
run: npx nx run ci-docs-e2e:e2e --runner cloud --cypressConfig ./apps/ngx-bootstrap-docs-e2e/cypress-full.json --record --group full --baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ -- --parallel
run: npx nx run ngx-bootstrap-docs-e2e:e2e -c firebase --runner cloud --cypressConfig ./apps/ngx-bootstrap-docs-e2e/cypress-full.json --record --group full --baseUrl=${{ needs.firebase_preview.outputs.output_url }}/ngx-bootstrap/ -- --parallel
# because of "record" and "parallel" parameters
# these containers will load balance all found tests among themselves
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -45,3 +45,7 @@ scully.log
/.scully
/.firebase
/gh-pages

/schematics/**/*.js
/schematics/**/*.js.map
/schematics/**/*.d.ts
28 changes: 1 addition & 27 deletions angular.json
Expand Up @@ -142,7 +142,7 @@
"devServerTarget": "ngx-bootstrap-docs:serve"
},
"configurations": {
"firebase": {},
"firebase": { "devServerTarget": "" },
"production": {
"devServerTarget": "ngx-bootstrap-docs:serve:production"
}
Expand All @@ -158,32 +158,6 @@
}
}
},
"ci-docs-e2e": {
"root": "apps/ngx-bootstrap-docs-e2e",
"sourceRoot": "apps/ngx-bootstrap-docs-e2e/src",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "apps/ngx-bootstrap-docs-e2e/cypress.json",
"tsConfig": "apps/ngx-bootstrap-docs-e2e/tsconfig.e2e.json",
"baseUrl": "http://localhost:4200/#/"
},
"configurations": {
"production": {}
}
},
"lint": {
"builder": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/ngx-bootstrap-docs-e2e/**/*.{js,ts}"
]
}
}
}
},
"accordion": {
"projectType": "library",
"root": "src/accordion",
Expand Down
Expand Up @@ -14,6 +14,9 @@ export class DemoCarouselSlideChangedEventComponent {
];

log(event: number) {
this.slideChangeMessage = `Slide has been switched: ${event}`;
// simple hack for expression has been changed error
setTimeout(() => {
this.slideChangeMessage = `Slide has been switched: ${event}`;
});
}
}
1 change: 1 addition & 0 deletions breakin-7.md
@@ -1,6 +1,7 @@
1. Dropped huge mega bundle `ngx-bootstrap`, please import only components you are actually using
2. Dropped forRoot() ?
3. remove deprecated properties
4. remove deprecated datepicker

- ci: use heroku preview instances to test ssr
- nx: split docs into libs
Expand Down
4 changes: 1 addition & 3 deletions nx.json
Expand Up @@ -74,9 +74,6 @@
"ngx-bootstrap-docs-e2e": {
"tags": []
},
"ci-docs-e2e": {
"tags": []
},
"accordion": {
"tags": [
"lib"
Expand Down Expand Up @@ -132,6 +129,7 @@
],
"implicitDependencies": [
"mini-ngrx",
"chronos",
"tooltip"
]
},
Expand Down
145 changes: 141 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -43,7 +43,7 @@
},
"husky": {
"hooks": {
"pre-push": "npm run lint-src"
"pre-push": "npm run lint"
}
},
"private": true,
Expand Down Expand Up @@ -111,7 +111,7 @@
"eslint-plugin-cypress": "2.11.2",
"fs-extra": "9.1.0",
"glob": "7.1.6",
"husky": "5.0.9",
"husky": "4.3.8",
"jest": "26.6.3",
"jest-createspyobj": "2.0.0",
"jest-preset-angular": "8.3.2",
Expand Down
2 changes: 1 addition & 1 deletion schematics/src/utils/index.ts
Expand Up @@ -26,7 +26,7 @@ export function addStyleToTarget(project: ProjectDefinition, targetName: string,
if (!styles) {
targetOptions.styles = [assetPath];
} else {
const existingStyles = styles.map((s) => typeof s === 'string' ? s : s !['input']);
const existingStyles = styles.map((s) => typeof s === 'string' ? s : s['input']);

for (const[, stylePath] of existingStyles.entries()) {
// If the given asset is already specified in the styles, we don't need to do anything.
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers.ts
@@ -1,5 +1,5 @@
import { dispatchMouseEvent } from '@ngneat/spectator';

export function fireEvent(target, action) {
export function fireEvent(target: Node, action: string) {
dispatchMouseEvent(target, action);
}
13 changes: 5 additions & 8 deletions src/accordion/accordion-group.component.ts
Expand Up @@ -24,15 +24,15 @@ export class AccordionPanelComponent implements OnInit, OnDestroy {
/** turn on/off animation */
isAnimated = false;
/** Clickable text in accordion's group header, check `accordion heading` below for using html in header */
@Input() heading: string;
@Input() heading!: string;
/** Provides an ability to use Bootstrap's contextual panel classes
* (`panel-primary`, `panel-success`, `panel-info`, etc...).
* List of all available classes [available here]
* (https://getbootstrap.com/docs/3.3/components/#panels-alternatives)
*/
@Input() panelClass: string;
@Input() panelClass = 'panel-default';
/** if <code>true</code> — disables accordion group */
@Input() isDisabled: boolean;
@Input() isDisabled = false;
/** Emits when the opened state changes */
@Output() isOpenChange: EventEmitter<boolean> = new EventEmitter();

Expand All @@ -50,12 +50,10 @@ export class AccordionPanelComponent implements OnInit, OnDestroy {
this.accordion.closeOtherPanels(this);
}
this._isOpen = value;
Promise.resolve(null).then(() => {
(async () => {
await Promise.resolve();
this.isOpenChange.emit(value);
})
.catch((error: Error) => {
console.log(error);
});
}
}

Expand All @@ -71,7 +69,6 @@ export class AccordionPanelComponent implements OnInit, OnDestroy {
}

ngOnInit(): void {
this.panelClass = this.panelClass || 'panel-default';
this.accordion.addGroup(this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/accordion/accordion.component.ts
Expand Up @@ -18,7 +18,7 @@ export class AccordionComponent {
/** turn on/off animation */
@Input() isAnimated = false;
/** if `true` expanding one item will close all others */
@Input() closeOthers: boolean;
@Input() closeOthers = false;

protected groups: AccordionPanelComponent[] = [];

Expand Down

0 comments on commit 51051bd

Please sign in to comment.