-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Move library to TypeScript (#467)
* ➕ Install typescript dependencies * 📦️ Define `@types/react-native` as an optional peerDependency * Add 🔧 TypeScript configuration file * ♻️ Move `src/index` to TypeScript * ♻️ Move `src/ErrorBoundary/index` to TypeScript * ♻️ Move `src/ErrorBoundary/FallbackComponent` to TypeScript * ♻️ Update `eslint` configuration to TypeScript * ♻️ Move unit tests to TypeScript * ♻️ Replace `flow-bin` with `tsc` * ♻️ Update coverage file extensions * ✨ Add `build` script * 👷 Run `build` in `npm-publish` workflow * 🔧 Add `types` and `react-native` fields to package.json * 🔥 Remove manual declaration file * ✨ Export `ErrorBoundaryProps` and `FallbackComponentProps` * ➖ Remove `@babel/preset-react` dependency
- Loading branch information
1 parent
70a3775
commit c88b6c7
Showing
16 changed files
with
414 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
*.log | ||
coverage | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
env: { | ||
test: { | ||
presets: ['module:metro-react-native-babel-preset'] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ErrorBoundary/FallbackComponent/styles.js → ...ErrorBoundary/FallbackComponent/styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import ErrorBoundary from './ErrorBoundary' | ||
|
||
export type { Props as ErrorBoundaryProps } from './ErrorBoundary' | ||
export type { Props as FallbackComponentProps } from './ErrorBoundary/FallbackComponent' | ||
|
||
export default ErrorBoundary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"compilerOptions": { | ||
"allowUnreachableCode": false, | ||
"allowUnusedLabels": false, | ||
"baseUrl": "./", | ||
"declaration": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"importsNotUsedAsValues": "error", | ||
"jsx": "react-native", | ||
"lib": ["esnext"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noImplicitUseStrict": false, | ||
"noStrictGenericChecks": false, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "lib", | ||
"paths": { | ||
"react-native-error-boundary": ["./src/index"] | ||
}, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "esnext" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"src/__tests__" | ||
] | ||
} |
Oops, something went wrong.
c88b6c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-native-error-boundary – ./
react-native-error-boundary-git-master-carloscuesta.vercel.app
react-native-error-boundary.vercel.app
react-native-error-boundary-carloscuesta.vercel.app
react-native-error-boundary.js.org