Skip to content

Commit

Permalink
feat: [#165057751] Transpile typescript with babel (pagopa#2151)
Browse files Browse the repository at this point in the history
* [#173888442] update react-native-webview

* [#173917003] upgrade redux saga to 1.1.3

* fix all typescript errors

* fix delay

* fix lint

* fix lint

* fix saga test

* [#165057751] Migrate Typescript transpile to babel

Co-authored-by: Matteo Boschi <mbmaken@gmail.com>
  • Loading branch information
fabriziofff and Undermaken authored Aug 14, 2020
1 parent 0f90b26 commit 43c24af
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 39 deletions.
7 changes: 6 additions & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module.exports = {
transformer: {
babelTransformerPath: require.resolve('react-native-typescript-transformer')
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false
}
})
}
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
"plist": "^3.0.1",
"postinstall-postinstall": "^1.0.0",
"prettier": "1.14.2",
"react-native-typescript-transformer": "^1.2.12",
"react-test-renderer": "16.13.1",
"redux-saga-test-plan": "4.0.0-rc.3",
"rn-nodeify": "^10.0.1",
Expand Down
2 changes: 1 addition & 1 deletion ts/__mocks__/react-native-keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* A mocked version of the Keychain
*/

type KeychainDB = {
export type KeychainDB = {
[key: string]: {
username: string;
password: string;
Expand Down
3 changes: 1 addition & 2 deletions ts/components/InstabugChatsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import variables from "../theme/variables";
import ButtonDefaultOpacity from "./ButtonDefaultOpacity";
import CustomBadge from "./ui/CustomBadge";
import IconFont from "./ui/IconFont";
import reportType = BugReporting.reportType;

interface OwnProps {
color?: string;
Expand Down Expand Up @@ -79,7 +78,7 @@ class InstabugChatsComponent extends React.PureComponent<Props, State> {
// Register to the instabug dismiss event. (https://docs.instabug.com/docs/react-native-bug-reporting-event-handlers#section-after-dismissing-instabug)
// This event is fired when chat or bug screen is dismissed
BugReporting.onSDKDismissedHandler(
(dismiss: dismissType, _: reportType): void => {
(dismiss: dismissType, _: BugReporting.reportType): void => {
// Due an Instabug library bug, we can't use the report parameter because it always has "bug" as value.
// We need to differentiate the type of report then use instabugReportType
if (this.state.instabugReportType.isSome()) {
Expand Down
2 changes: 1 addition & 1 deletion ts/theme/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const fontWeights = {

type FontFamily = keyof typeof fonts;
export type FontWeight = keyof typeof fontWeights;
const enum FontStyle {
enum FontStyle {
"normal" = "normal",
"italic" = "italic"
}
Expand Down
2 changes: 1 addition & 1 deletion ts/utils/keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const PIN_KEY = "PIN";
export async function setGenericPasswordWithDefaultAccessibleOption(
username: string,
password: string,
options?: Options
options?: Keychain.Options
) {
return Keychain.setGenericPassword(username, password, {
...options,
Expand Down
13 changes: 6 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "es2015",
"module": "es2015",
"target": "esnext",
"module": "commonjs",
"lib": ["es6", "dom"],
"jsx": "react",
"noEmit": true,
"moduleResolution": "node",
Expand All @@ -16,14 +17,12 @@
"noUnusedParameters": true,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"skipLibCheck": true
"skipLibCheck": true,
"isolatedModules": true
},
"lib": [
"dom"
],
"exclude": [
"android",
"ios",
"node_modules"
]
}
}
27 changes: 2 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3095,7 +3095,7 @@ chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -3965,7 +3965,7 @@ deepmerge@^3.2.0:
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.3.0.tgz#d3c47fd6f3a93d517b14426b0628a17b0125f5f7"
integrity sha512-GRQOafGHwMHpjPx9iCvTgpu9NojZ49q794EEL94JVEw6VaeA8XTUyBKvAkOOjBX9oJNiV6G3P+T+tihFjo2TqA==

deepmerge@^4.0.0, deepmerge@^4.2.2:
deepmerge@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
Expand Down Expand Up @@ -4819,11 +4819,6 @@ find-cache-dir@^2.0.0:
make-dir "^2.0.0"
pkg-dir "^3.0.0"

find-root@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==

find-up@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
Expand Down Expand Up @@ -6690,11 +6685,6 @@ jetifier@^1.6.2:
resolved "https://registry.yarnpkg.com/jetifier/-/jetifier-1.6.6.tgz#fec8bff76121444c12dc38d2dad6767c421dab68"
integrity sha512-JNAkmPeB/GS2tCRqUzRPsTOHpGDah7xP18vGJfIjZC+W2sxEHbxgJxetIjIqhjQ3yYbYNEELkM/spKLtwoOSUQ==

jju@^1.3.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a"
integrity sha1-o6vicYryQaKykE+EpiWXDzia4yo=

"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
Expand Down Expand Up @@ -9375,19 +9365,6 @@ react-native-touch-id@^4.4.1:
resolved "https://registry.yarnpkg.com/react-native-touch-id/-/react-native-touch-id-4.4.1.tgz#8b1bb2d04c30bac36bb9696d2d723e719c4a8b08"
integrity sha512-1jTl8fC+0fxvqegy/XXTyo6vMvPhjzkoDdaqoYZx0OH8AT250NuXnNPyKktvigIcys3+2acciqOeaCall7lrvg==

react-native-typescript-transformer@^1.2.12:
version "1.2.13"
resolved "https://registry.yarnpkg.com/react-native-typescript-transformer/-/react-native-typescript-transformer-1.2.13.tgz#be92a3d110dbb2cf2f4aebe60a935be124cfb7ed"
integrity sha512-uLL6U9BirM+gKRZNKqJQW+m1onh+goiwDqG4+9XSy5dUhjmkjCkbx8j2eahie9hFcHJdnknJ6wRAEF5/7mGWmw==
dependencies:
babel-traverse "^6.26.0"
chalk "^2.4.0"
deepmerge "^4.0.0"
find-root "^1.1.0"
jju "^1.3.0"
semver "^5.4.1"
source-map "^0.5.6"

react-native-vector-icons@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-7.0.0.tgz#5b92ed363c867645daad48c559e1f99efcfbb813"
Expand Down

0 comments on commit 43c24af

Please sign in to comment.