Skip to content

Commit

Permalink
feat(🔥): Rewrite in TypeScript (#799)
Browse files Browse the repository at this point in the history
Convert project into typescript
  • Loading branch information
Johan-dutoit committed Sep 19, 2019
1 parent ee0922a commit 7bf0976
Show file tree
Hide file tree
Showing 14 changed files with 831 additions and 737 deletions.
11 changes: 0 additions & 11 deletions .flowconfig

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Expand Up @@ -28,6 +28,6 @@ Added `yourNewMethodName()` that allows ...
* [ ] I have tested this on a device/simulator for each compatible OS
* [ ] I added the documentation in `README.md`
* [ ] I mentioned this change in `CHANGELOG.md`
* [ ] I updated the typings files (`deviceinfo.d.ts`, `deviceinfo.js.flow`)
* [ ] I updated the typings files (`privateTypes.ts`, `types.ts`)
* [ ] I updated the dummy web/test polyfill (`default/index.js`)
* [ ] I added a sample use of the API (`example/App.js`)
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -61,3 +61,6 @@ example.xcworkspace

# Our RN59 example
examplern59

# generated files by bob
lib/
149 changes: 0 additions & 149 deletions deviceinfo.d.ts

This file was deleted.

134 changes: 0 additions & 134 deletions deviceinfo.js.flow

This file was deleted.

42 changes: 32 additions & 10 deletions package.json
Expand Up @@ -2,25 +2,36 @@
"name": "react-native-device-info",
"version": "3.1.4",
"description": "Get device information using react-native",
"main": "deviceinfo.js",
"typings": "./deviceinfo.d.ts",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.js",
"types": "lib/typescript/src/index.d.ts",
"files": [
"/android",
"!/android/build",
"/ios",
"/windows",
"/web",
"src/",
"lib/",
"/*.podspec"
],
"repository": {
"type": "git",
"url": "https://github.com/react-native-community/react-native-device-info"
},
"scripts": {
"analyze": "yarn ts-check && yarn flow-check",
"dev-sync": "cp -r deviceinfo* *podspec windows web android ios example/node_modules/react-native-device-info/",
"flow-check": "npx flow check-contents < deviceinfo.js.flow",
"analyze": "npx tsc --noEmit",
"dev-sync": "cp -r deviceinfo* *podspec windows web android ios src example/node_modules/react-native-device-info/",
"lint": "npx eslint ./ --ignore-pattern example --ignore-pattern node_modules --fix --quiet",
"pretty": "prettier --write deviceinfo.js",
"shipit": "np",
"ts-check": "npx tsc deviceinfo.d.ts --noEmit",
"test": "echo no tests defined",
"precommit": "lint-staged && yarn analyze"
"precommit": "lint-staged && yarn analyze",
"build": "bob build",
"prepare": "yarn build"
},
"lint-staged": {
"*.js": [
"*.ts": [
"yarn lint",
"git add"
]
Expand Down Expand Up @@ -55,10 +66,12 @@
],
"license": "MIT",
"devDependencies": {
"@react-native-community/bob": "^0.7.0",
"@react-native-community/eslint-config": "0.0.5",
"@types/react": "^16.9.2",
"@types/react-native": "^0.60.14",
"eslint": "^6.4.0",
"eslint-plugin-prettier": "^3.1.0",
"flow-bin": "^0.107.0",
"husky": "^3.0.5",
"lint-staged": "^9.2.1",
"np": "^5.1.0",
Expand All @@ -69,5 +82,14 @@
},
"eslintConfig": {
"extends": "@react-native-community"
},
"@react-native-community/bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
"typescript"
]
}
}

0 comments on commit 7bf0976

Please sign in to comment.