Skip to content

Commit

Permalink
chore: upgrade ts to 3.8 (#9122)
Browse files Browse the repository at this point in the history
* upgrade ts to 3.8 to use export type syntax

* update prettier to 2.4.2 to avoid conflict with the local version in rn

* fix prettier conflict with nohoist

* fix analytics jest test config by esModuleInterop

* add ts3.7 backward compatibility by typesVersions field

Co-authored-by: Sam Martinez  <samlmar@amazon.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 8, 2021
1 parent fbe1f2e commit d55d797
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 56 deletions.
8 changes: 5 additions & 3 deletions package.json
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",
"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
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
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
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
@@ -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,
GraphQLAuthError,
GraphQLResult,
GRAPHQL_AUTH_MODE,
} from '@aws-amplify/api-graphql';

0 comments on commit d55d797

Please sign in to comment.