Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Typescript conversion #29

Merged
merged 13 commits into from
Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["module:metro-react-native-babel-preset", "react-app"]
"presets": ["module:metro-react-native-babel-preset", "react-app", "@babel/preset-typescript"]
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ public/favicon*
**/.#*

# TernJS
*/.tern-port
*/.tern-port
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import com.android.build.OutputFile
*/

project.ext.react = [
entryFile: "index.js"
entryFile: "index.ts"
]

apply from: "../../node_modules/react-native/react.gradle"
Expand Down
344 changes: 174 additions & 170 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,174 +1,178 @@
{
"name": "jellyfinclient",
"productName": "Jellyfin Client",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"android": "react-native run-android",
"android:clean": "cd android && ./gradlew clean",
"android:dev_menu": "adb shell input keyevent KEYCODE_MENU",
"android:emulator": "scripts/android_emulator.js",
"android:kill_server": "scripts/kill_server.sh",
"android:log": "react-native log-android",
"android:release": "cd android && ./gradlew assembleRelease",
"electron": "electron build",
"electron:release": "electron-packager build --all --asar --icon=public/app --overwrite --out=electron",
"icon-gen": "icon-gen -i resources/icon.svg -o public && shx cp public/favicon-228.png public/app.png",
"install": "node scripts/install.js",
"ios": "react-native run-ios",
"ios:release": "react-native bundle --platform=ios",
"preandroid": "scripts/preandroid.sh",
"preelectron": "cross-env-shell ELECTRON=1 PUBLIC_URL=. \"yarn run web:release && shx cp index.electron.js build/index.js && echo {} > build/package.json\"",
"preelectron:release": "yarn run preelectron",
"preweb:release": "yarn run icon-gen",
"release": "yarn run android:release && yarn run electron:release && yarn run ios:release && yarn run web:release && yarn run windows:release",
"test:web": "node scripts/test.js --env=jsdom",
"web": "node scripts/start.js",
"web:release": "node scripts/build.js",
"windows": "react-native run-windows",
"windows:release": "react-native bundle --platform=windows --entry-file index.js --assets-dest windows/jellyfinclient/ReactAssets --bundle-output windows/jellyfinclient/ReactAssets/index.windows.bundle --dev false"
},
"dependencies": {
"electron-store": "^2.0.0",
"electron-store-webpack-wrapper": "^0.0.2",
"formik": "^1.4.2",
"fs-extra": "7.0.0",
"is-electron": "^2.2.0",
"jellyfin-apiclient": "^1.0.0",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-app-polyfill": "^0.1.3",
"react-art": "16.7.0",
"react-dev-utils": "^6.1.1",
"react-dom": "16.7.0",
"react-native": "0.59.9",
"react-native-sensitive-info": "^5.2.7",
"react-native-web_improved": "0.9.9",
"react-native-windows": "0.57.0-rc.4",
"react-redux": "^6.0.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-router-native": "^4.3.0",
"react-router-navigation": "^2.0.0-alpha.10",
"redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-persist-electron-storage": "^2.0.0",
"redux-persist-sensitive-storage": "^1.0.0",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@svgr/webpack": "2.4.1",
"@types/jest": "^23.3.13",
"@types/react": "^16.7.20",
"@types/react-native": "^0.57.29",
"@types/react-redux": "^7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-plugin-react-native-web": "0.9.9",
"babel-plugin-transform-react-remove-prop-types": "0.4.21",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"cross-env": "^5.2.0",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"electron": "^4.0.1",
"electron-packager": "^13.0.1",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"html-webpack-plugin": "4.0.0-alpha.2",
"icon-gen": "2.0.0",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"prettier": "^1.18.2",
"react-test-renderer": "16.6.3",
"rnpm-plugin-windows": "0.2.8",
"sass-loader": "7.1.0",
"shx": "^0.3.2",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"typescript": "^3.2.4",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
},
"jest": {
"preset": "react-native",
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"resolver": "jest-pnp-resolver",
"setupFiles": [
"react-app-polyfill/jsdom"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}"
],
"testEnvironment": "jsdom",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
"name": "jellyfinclient",
"productName": "Jellyfin Client",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"android": "react-native run-android",
"android:clean": "cd android && ./gradlew clean",
"android:dev_menu": "adb shell input keyevent KEYCODE_MENU",
"android:emulator": "scripts/android_emulator.js",
"android:kill_server": "scripts/kill_server.sh",
"android:log": "react-native log-android",
"android:release": "cd android && ./gradlew assembleRelease",
"electron": "electron build",
"electron:release": "electron-packager build --all --asar --icon=public/app --overwrite --out=electron",
"icon-gen": "icon-gen -i resources/icon.svg -o public && shx cp public/favicon-228.png public/app.png",
"install": "node scripts/install.js",
"ios": "react-native run-ios",
"ios:release": "react-native bundle --platform=ios",
"preandroid": "scripts/preandroid.sh",
"preelectron": "cross-env-shell ELECTRON=1 PUBLIC_URL=. \"yarn run web:release && shx cp index.electron.js build/index.js && echo {} > build/package.json\"",
"preelectron:release": "yarn run preelectron",
"preweb:release": "yarn run icon-gen",
"release": "yarn run android:release && yarn run electron:release && yarn run ios:release && yarn run web:release && yarn run windows:release",
"test:web": "node scripts/test.js --env=jsdom",
"web": "node scripts/start.js",
"web:release": "node scripts/build.js",
"windows": "react-native run-windows",
"windows:release": "react-native bundle --platform=windows --entry-file index.js --assets-dest windows/jellyfinclient/ReactAssets --bundle-output windows/jellyfinclient/ReactAssets/index.windows.bundle --dev false"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
"dependencies": {
"electron-store": "^2.0.0",
"electron-store-webpack-wrapper": "^0.0.2",
"formik": "^1.4.2",
"fs-extra": "7.0.0",
"is-electron": "^2.2.0",
"jellyfin-apiclient": "^1.0.0",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-app-polyfill": "^0.1.3",
"react-art": "16.7.0",
"react-dev-utils": "^6.1.1",
"react-dom": "16.7.0",
"react-native": "0.59.9",
"react-native-sensitive-info": "^5.2.7",
"react-native-web_improved": "0.9.9",
"react-native-windows": "0.57.0-rc.4",
"react-redux": "^6.0.0",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-router-native": "^4.3.0",
"react-router-navigation": "^2.0.0-alpha.10",
"redux": "^4.0.1",
"redux-persist": "^5.10.0",
"redux-persist-electron-storage": "^2.0.0",
"redux-persist-sensitive-storage": "^1.0.0",
"redux-thunk": "^2.3.0",
"resolve": "1.8.1"
},
"moduleFileExtensions": [
"web.js",
"js",
"web.ts",
"ts",
"web.tsx",
"tsx",
"json",
"web.jsx",
"jsx",
"node"
]
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"eslintConfig": {
"extends": "react-app"
}
"devDependencies": {
"core-js": "3",
"@babel/core": "^7.2.2",
"@babel/preset-typescript": "^7.6.0",
"@svgr/webpack": "2.4.1",
"@types/jest": "^23.3.13",
"@types/react": "^16.7.20",
"@types/react-native": "^0.57.29",
"@types/react-redux": "^7.0.0",
"@types/react-router": "^5.1.1",
"@types/react-router-dom": "^5.1.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.4",
"babel-plugin-named-asset-import": "^0.2.3",
"babel-plugin-react-native-web": "0.9.9",
"babel-plugin-transform-react-remove-prop-types": "0.4.21",
"babel-preset-react-app": "^6.1.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"cross-env": "^5.2.0",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"electron": "^4.0.1",
"electron-packager": "^13.0.1",
"eslint": "5.6.0",
"eslint-config-react-app": "^3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"html-webpack-plugin": "4.0.0-alpha.2",
"icon-gen": "2.0.0",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"mini-css-extract-plugin": "0.4.3",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.0.6",
"postcss-safe-parser": "4.0.1",
"react-native-typescript-transformer": "^1.2.13",
"react-test-renderer": "16.6.3",
"rnpm-plugin-windows": "0.2.8",
"sass-loader": "7.1.0",
"shx": "^0.3.2",
"style-loader": "0.23.0",
"terser-webpack-plugin": "1.1.0",
"typescript": "^3.6.3",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3"
},
"jest": {
"preset": "react-native",
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"resolver": "jest-pnp-resolver",
"setupFiles": [
"react-app-polyfill/jsdom"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}"
],
"testEnvironment": "jsdom",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"web.js",
"js",
"web.ts",
"ts",
"web.tsx",
"tsx",
"json",
"web.jsx",
"jsx",
"node"
]
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"eslintConfig": {
"extends": "react-app"
}
}
2 changes: 1 addition & 1 deletion src/App.js → src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import EntryScreen from "./screens/EntryScreen";
import NoMatch from "./components/NoMatch";
import ElectronRedirect from "./components/ElectronRedirect";
import jellyfinStore from "./utilities/storage/store";
import { Router, Switch, Route } from "./utilities/routing/index";
import { Router, Switch, Route } from "./utilities/routing";
import { PersistGate } from "redux-persist/integration/react";
import Loading from "./components/Loading";
import HomeComponent from "./components/HomeComponent";
Expand Down
Loading