Skip to content

Commit

Permalink
Angular 9 upgrade copy of pr ncstate-sat#180 using CommonJS
Browse files Browse the repository at this point in the history
  • Loading branch information
femave committed Jun 25, 2020
1 parent fb5ba01 commit efb15a6
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 52 deletions.
12 changes: 10 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"configurations": {
"production": {
"project": "src/lib/ng-package.prod.json"
"project": "src/lib/ng-package.prod.json",
"tsConfig": "src/lib/tsconfig.lib.prod.json"
}
}
},
Expand Down Expand Up @@ -55,6 +56,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/demo",
"index": "src/demo/index.html",
"main": "src/demo/main.ts",
Expand All @@ -71,6 +73,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/demo/environments/environment.ts",
Expand Down Expand Up @@ -138,4 +146,4 @@
}
}
}
}
}
53 changes: 27 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "4.0.0",
"license": "MIT",
"scripts": {
"postinstall": "ngcc",
"clean": "rm -rf dist",
"demo": "ng serve demo",
"build": "ng build popover && ts-node tools/prepare-package.ts",
Expand Down Expand Up @@ -31,28 +32,27 @@
},
"homepage": "https://github.com/ncstate-sat/popover#readme",
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.4",
"@angular-devkit/build-ng-packagr": "~0.800.4",
"@angular/animations": "^8.0.0",
"@angular/cdk": "^8.0.0",
"@angular/cli": "^8.0.0",
"@angular/common": "^8.0.0",
"@angular/compiler": "^8.0.0",
"@angular/compiler-cli": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/forms": "^8.0.0",
"@angular/http": "^7.2.15",
"@angular/language-service": "^8.0.0",
"@angular/material": "^8.0.0",
"@angular/platform-browser": "^8.0.0",
"@angular/platform-browser-dynamic": "^8.0.0",
"@angular/router": "^8.0.0",
"@angular-devkit/build-angular": "~0.900.4",
"@angular-devkit/build-ng-packagr": "~0.900.4",
"@angular/animations": "^9.0.4",
"@angular/cdk": "^9.1.0",
"@angular/cli": "^9.0.4",
"@angular/common": "^9.0.4",
"@angular/compiler": "^9.0.4",
"@angular/compiler-cli": "^9.0.4",
"@angular/core": "^9.0.4",
"@angular/forms": "^9.0.4",
"@angular/language-service": "^9.0.4",
"@angular/material": "^9.1.0",
"@angular/platform-browser": "^9.0.4",
"@angular/platform-browser-dynamic": "^9.0.4",
"@angular/router": "^9.0.4",
"@types/jasmine": "~3.3.13",
"@types/jasminewd2": "~2.0.6",
"@types/node": "~12.0.10",
"angular-cli-ghpages": "^0.5.3",
"@types/node": "^12.11.1",
"angular-cli-ghpages": "^0.6.2",
"chalk": "^2.4.2",
"codelyzer": "~5.1.0",
"codelyzer": "^5.1.2",
"core-js": "^3.1.4",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
Expand All @@ -61,14 +61,15 @@
"karma-coverage-istanbul-reporter": "~2.0.5",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"ng-packagr": "^5.3.0",
"ng-packagr": "^9.0.0",
"protractor": "^5.4.2",
"rxjs": "^6.5.2",
"rxjs": "^6.5.4",
"ts-node": "~8.3.0",
"tsickle": "^0.35.0",
"tslib": "^1.10.0",
"tslint": "~5.18.0",
"typescript": "~3.4.5",
"zone.js": "^0.9.1"
"typescript": "~3.7.5",
"zone.js": "~0.10.2"
},
"dependencies": {
"tslib": "^1.10.0"
}
}
}
4 changes: 2 additions & 2 deletions src/demo/app/anchor-reuse/anchor-reuse.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { SatPopover } from '@ncstate/sat-popover';
`
})
export class AnchorReuseComponent {
@ViewChild('a', { static: false }) aPopover: SatPopover;
@ViewChild('b', { static: false }) bPopover: SatPopover;
@ViewChild('a') aPopover: SatPopover;
@ViewChild('b') bPopover: SatPopover;

activePopover = 'a';
showAnchor = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { filter, takeUntil } from 'rxjs/operators';
})
export class InteractiveCloseDemo implements AfterViewInit, OnDestroy {
@ViewChild(SatPopover, { static: true }) popover: SatPopover;
@ViewChild('optionsPanel', { static: false }) optionsPanel: ElementRef;
@ViewChild('optionsPanel') optionsPanel: ElementRef;

showError = false;
interactiveClose = false;
Expand Down
2 changes: 1 addition & 1 deletion src/demo/app/tooltip/tooltip.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { switchMap, takeUntil, delay } from 'rxjs/operators';
`
})
export class TooltipDemo implements AfterViewInit {
@ViewChild('poDelayed', { static: false }) delayed: SatPopover;
@ViewChild('poDelayed') delayed: SatPopover;

mouseenter = new Subject<void>();
mouseleave = new Subject<void>();
Expand Down
12 changes: 7 additions & 5 deletions src/demo/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/app",
"module": "es2015",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"src/demo/**/*.d.ts"
]
}
}
1 change: 0 additions & 1 deletion src/demo/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"module": "commonjs",
"types": [
"jasmine",
"node"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/popover/popover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class SatPopover implements OnInit {
_anchoringService: SatPopoverAnchoringService;

/** Reference to the element to build a focus trap around. */
@ViewChild('focusTrapElement', { static: false })
@ViewChild('focusTrapElement')
private _focusTrapElement: ElementRef;

/** Reference to the element that was focused before opening. */
Expand Down
18 changes: 9 additions & 9 deletions src/lib/popover/popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,8 @@ class AnchorlessPopoverTestComponent {
`
})
class SimpleDirectiveAnchorPopoverTestComponent {
@ViewChild('anchorEl', { static: false }) anchorElement: ElementRef;
@ViewChild('anchorEl2', { static: false }) alternateAnchorElement: ElementRef;
@ViewChild('anchorEl') anchorElement: ElementRef;
@ViewChild('anchorEl2') alternateAnchorElement: ElementRef;
@ViewChild(SatPopoverAnchor, { static: true }) anchor: SatPopoverAnchor;
@ViewChild(SatPopover, { static: true }) popover: SatPopover;
}
Expand All @@ -1098,8 +1098,8 @@ class SimpleDirectiveAnchorPopoverTestComponent {
`
})
class DirectiveAnchorForPopoverTestComponent {
@ViewChild('anchorEl', { static: false }) anchorElement: ElementRef;
@ViewChild('anchorEl2', { static: false }) alternateAnchorElement: ElementRef;
@ViewChild('anchorEl') anchorElement: ElementRef;
@ViewChild('anchorEl2') alternateAnchorElement: ElementRef;
@ViewChild(SatPopoverAnchor, { static: true }) anchor: SatPopoverAnchor;
@ViewChild(SatPopover, { static: true }) popover: SatPopover;
}
Expand All @@ -1115,7 +1115,7 @@ class DirectiveAnchorForPopoverTestComponent {
`
})
class SimpleHTMLAnchorPopoverTestComponent {
@ViewChild('anchorEl', { static: false }) anchorElement: ElementRef;
@ViewChild('anchorEl') anchorElement: ElementRef;
@ViewChild(SatPopover, { static: true }) popover: SatPopover;
}

Expand Down Expand Up @@ -1179,9 +1179,9 @@ export class FocusPopoverTestComponent {
restoreFocus = true;
autoFocus = true;

@ViewChild('b1', { static: false }) button1: ElementRef;
@ViewChild('b2', { static: false }) button2: ElementRef;
@ViewChild('p', { static: false }) popover: SatPopover;
@ViewChild('b1') button1: ElementRef;
@ViewChild('b2') button2: ElementRef;
@ViewChild('p') popover: SatPopover;
}

/** This component is for testing dynamic positioning behavior. */
Expand Down Expand Up @@ -1262,7 +1262,7 @@ export class ServiceTestComponent {
`
})
export class HoverDirectiveTestComponent {
@ViewChild('anchorEl', { static: false }) anchorEl: ElementRef;
@ViewChild('anchorEl') anchorEl: ElementRef;
@ViewChild(SatPopover, { static: true }) popover: SatPopover;
delay = 0;
}
Expand Down
5 changes: 1 addition & 4 deletions src/lib/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"flatModuleId": "AUTOGENERATED",
"flatModuleOutFile": "AUTOGENERATED"
"strictInjectionParameters": true
},
"exclude": [
"test.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/lib/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"module": "CommonJS",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
Expand Down

0 comments on commit efb15a6

Please sign in to comment.