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

build: upgrade ts to 3.8 to use export type syntax #9122

Merged
merged 11 commits into from
Nov 8, 2021
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
],
"nohoist": [
"**/@types/react-native",
"**/@types/react-native/**"
"**/@types/react-native/**",
"aws-amplify-react-native/prettier",
"aws-amplify-react-native/eslint-plugin-prettier"
]
},
"repository": {
Expand Down Expand Up @@ -71,7 +73,7 @@
"jest-config": "24.8.0",
"json-loader": "^0.5.7",
"lerna": "^3.13.1",
"prettier": "^1.19.0",
"prettier": "^2.4.1",
"pretty-quick": "^1.11.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update pretty-quick along with prettier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested its newer version but from the current version's peerDependencies, it works with prettier >=1.8.0, so I think it might be safer to keep it now.

"rimraf": "^2.6.2",
"rollup": "^0.67.4",
Expand All @@ -85,7 +87,7 @@
"tslint": "^5.7.0",
"tslint-config-airbnb": "^5.8.0",
"typedoc": "^0.16.9",
"typescript": "~3.7.7",
"typescript": "~3.8.3",
"uglifyjs-webpack-plugin": "^0.4.6",
"uuid-validate": "^0.0.3",
"webpack": "^4.32.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"esnext.asynciterable",
"es2017.object"
],
"allowJs": true
"allowJs": true,
"esModuleInterop": true
}
}
},
Expand Down
27 changes: 0 additions & 27 deletions packages/analytics/tsconfig.json

This file was deleted.

12 changes: 12 additions & 0 deletions packages/api/index.v37.d.ts

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

7 changes: 7 additions & 0 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"main": "./lib/index.js",
"module": "./lib-esm/index.js",
"typings": "./lib-esm/index.d.ts",
"typesVersions": {
"<3.8": {
"lib-esm/index.d.ts": [
"index.v37.d.ts"
]
}
},
"react-native": {
"./lib/index": "./lib-esm/index.js"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import { API } from './API';
export { API, APIClass } from './API';
export {
graphqlOperation,
GraphQLResult,
GraphQLAuthError,
GRAPHQL_AUTH_MODE,
} from '@aws-amplify/api-graphql';

export type { GraphQLResult } from '@aws-amplify/api-graphql';
/*
* @deprecated use named import
*/
Expand Down
48 changes: 24 additions & 24 deletions packages/api/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
/**
* This exports from the types directory is a temporary workaround, since Amplify CLI currently
* generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
* This will be removed in future release when CLI and customers moves to recommeneded import styles.
*/
export {
graphqlOperation,
GraphQLAuthError,
GraphQLResult,
GRAPHQL_AUTH_MODE,
} from '@aws-amplify/api-graphql';
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/

/**
* This exports from the types directory is a temporary workaround, since Amplify CLI currently
* generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863
* This will be removed in future release when CLI and customers moves to recommeneded import styles.
*/
export {
graphqlOperation,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this file shows up on the diff, nothing should be changed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is strange but can we update the copyright date :)

GraphQLAuthError,
GraphQLResult,
GRAPHQL_AUTH_MODE,
} from '@aws-amplify/api-graphql';