Skip to content

Commit

Permalink
fix(angular): Support strict: true (#890)
Browse files Browse the repository at this point in the history
* Set strict to true

* Update yarn.lock to use latest aws-amplify

* Use `Required` to prevent types from being undefined

* Fix implicitAnyIndex error

* Add `.d.ts` for `aws-export`s

* Create khaki-hounds-brush.md

* Update .changeset/khaki-hounds-brush.md

* Use matching aws-sdk versions

* Update yarn.lock
  • Loading branch information
wlee221 committed Dec 1, 2021
1 parent 011938f commit 712edfc
Show file tree
Hide file tree
Showing 23 changed files with 2,304 additions and 2,130 deletions.
6 changes: 6 additions & 0 deletions .changeset/khaki-hounds-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@aws-amplify/ui": patch
"@aws-amplify/ui-angular": patch
---

fix(angular): Add first class support for `strict: true`
2 changes: 1 addition & 1 deletion examples/angular/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class AppComponent {

constructor() {
if (typeof window !== 'undefined') {
window['Amplify'] = Amplify;
(window as any)['Amplify'] = Amplify;
}
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1 change: 1 addition & 0 deletions examples/angular/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"module": "es2020",
"lib": ["es2018", "dom"],
"esModuleInterop": true,
"strict": true,
"paths": {
"@aws-amplify/ui-angular": ["../../packages/angular/dist/ui-angular"],
"@aws-amplify/ui-angular/*": ["../../packages/angular/dist/ui-angular/*"],
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,26 @@
"packages/angular/projects/ui-angular"
],
"resolutions": {
"@aws-sdk/client-location": "3.22.0",
"ansi-regex": "5.0.1",
"trim": "^0.0.3",
"fs-extra": "^10.0.0",
"ws": "^7.4.6",
"jest": "^26.6.3",
"ts-jest": "^26.5.6",
"json-schema": "^0.4.0",
"next": "^11.0.1",
"prismjs": "^1.25.0",
"trim": "^0.0.3",
"ts-jest": "^26.5.6",
"vscode-vue-languageservice": "0.27.26",
"json-schema": "^0.4.0"
"ws": "^7.4.6"
},
"dependencies": {
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"tsup": "^4.14.0"
},
"devDependencies": {
"@changesets/changelog-github": "0.4.1",
"@changesets/cli": "^2.16.0",
"@changesets/changelog-github": "0.4.1",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "2.4.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/src/types/authMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ interface BaseFormContext {
}

export interface SignInContext extends BaseFormContext {
loginMechanisms: AuthContext['config']['loginMechanisms'];
socialProviders: AuthContext['config']['socialProviders'];
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
socialProviders: Required<AuthContext>['config']['socialProviders'];
attributeToVerify?: string;
redirectIntent?: string;
unverifiedAttributes?: Record<string, string>;
Expand Down Expand Up @@ -69,8 +69,8 @@ export type SignUpAttribute =
| SignUpFieldsWithoutDefaults;

export interface SignUpContext extends BaseFormContext {
loginMechanisms: AuthContext['config']['loginMechanisms'];
socialProviders: AuthContext['config']['socialProviders'];
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
socialProviders: Required<AuthContext>['config']['socialProviders'];
unverifiedAttributes?: Record<string, string>;
}

Expand Down

0 comments on commit 712edfc

Please sign in to comment.