Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typescript support to issue-tracker #122

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e3bfb66
add typescript support to issue-tracker
renanmav Nov 12, 2019
ec59071
revert prettier config
renanmav Nov 13, 2019
02ae738
replace non-null assertions for optional chaining on Root
renanmav Nov 13, 2019
a8424c6
throw if router doesnt exists on Link and remove unnecessary chaining…
renanmav Nov 13, 2019
f694d38
move RouteComponentProps to RouteRenderer
renanmav Nov 13, 2019
9abf9fb
avoid braceless
renanmav Nov 13, 2019
32c099d
update comment about @ts-ignore on RelayEnvironment.ts
renanmav Nov 13, 2019
bdb47e0
make Resource more precise
renanmav Nov 13, 2019
97007ce
revert IssueListItem to IssuesListItem
renanmav Nov 13, 2019
e2098e2
revert README changes
renanmav Nov 13, 2019
2c6a186
revert more README changes
renanmav Nov 13, 2019
d8411c5
revert e to event on IssueActions
renanmav Nov 13, 2019
0285f0f
force rename of GitHub
renanmav Nov 14, 2019
dd2786c
return Suspense with null fallback inside SuspenseList
renanmav Nov 14, 2019
4988da4
rename fragment IssueListItem to IssuesListItem
renanmav Nov 15, 2019
927e2eb
make result either T of obj with default
renanmav Nov 15, 2019
f6547ee
revert disable button on IssueActions
renanmav Nov 15, 2019
706cd71
revert the arrow function on Root
renanmav Nov 15, 2019
ab0b7ea
revert concat on RouteRenderer
renanmav Nov 15, 2019
58e89a3
make prepare a mandatory function
renanmav Nov 15, 2019
263a82e
use FetchFunction instead of typing function args
renanmav Nov 15, 2019
6807f0c
throw this.load() func on read() JSResource
renanmav Nov 15, 2019
da5ec35
remove optional chaining
renanmav Nov 15, 2019
a0d4660
throw if there isnt a router on RouteRenderer
renanmav Nov 18, 2019
d621941
remove unnecessary assertions on router
renanmav Nov 18, 2019
871bdca
add type guardian on JSResource
renanmav Nov 18, 2019
6836fbd
make RouteConfig entry general
renanmav Nov 19, 2019
af5b394
revert changes on README
renanmav Nov 19, 2019
7ddec0c
revert changes on README
renanmav Nov 19, 2019
01baff6
use React.FC
renanmav Nov 19, 2019
79e1a5e
add macro config to avoid false positive errors on yarn start
renanmav Nov 19, 2019
aa5def7
make all react components as React.FC
renanmav Nov 20, 2019
7cd9538
Merge branch 'master' into feat/issue-tracker-ts
renanmav Nov 20, 2019
cc1c367
Update README.md
renanmav Nov 20, 2019
5ba1807
Update .prettierrc
renanmav Nov 20, 2019
71ce2bf
remove unnecessary children prop
renanmav Nov 20, 2019
3d8ba57
Merge branch 'feat/issue-tracker-ts' of github.com:renanmav/relay-exa…
renanmav Nov 20, 2019
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
1 change: 1 addition & 0 deletions issue-tracker/.babel-plugin-macrosrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
relay: ~
27 changes: 22 additions & 5 deletions issue-tracker/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": "react-app",
"plugins": [
"prettier"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint/eslint-plugin"],
"rules": {
"prettier/prettier": "error"
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}
}
1 change: 1 addition & 0 deletions issue-tracker/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode
2 changes: 1 addition & 1 deletion issue-tracker/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
}
2 changes: 1 addition & 1 deletion issue-tracker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This app is meant for experimentation; we recommend cloning and running locally,
# yarn users:
yarn

3. Get your GitHub authentication token in order to let the app query GitHub's public GraphQL API:
4. Get your GitHub authentication token in order to let the app query GitHub's public GraphQL API:
a. Open https://github.com/settings/tokens.
b. Ensure that at least the `repo` scope is selected.
c. Generate the token
Expand Down
74 changes: 46 additions & 28 deletions issue-tracker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,55 @@
"name": "issue-tracker",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "yarn run relay; concurrently --kill-others --names \"react-scripts,relay\" \"react-scripts start\" \"yarn run relay --watch\"",
"build": "yarn run relay && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint --fix --ext .js,.ts,.tsx",
"update-schema": "yarn get-graphql-schema -h \"Authorization=bearer $REACT_APP_GITHUB_AUTH_TOKEN\" https://api.github.com/graphql > schema/schema.graphql",
"relay": "yarn run relay-compiler --schema schema/schema.graphql --src ./src/ $@ --language typescript"
},
"dependencies": {
"history": "^4.10.1",
"husky": "^3.0.9",
"lint-staged": "^9.4.2",
"react": "^0.0.0-experimental-f6b8d31a7",
"react-dom": "^0.0.0-experimental-f6b8d31a7",
"react": "0.0.0-experimental-38dd17ab9",
"react-dom": "0.0.0-experimental-38dd17ab9",
"react-markdown": "^4.2.2",
"react-relay": "0.0.0-experimental-a1a40b68",
"react-router": "^5.1.2",
"react-router-config": "^5.1.1",
"react-scripts": "3.2.0",
"relay-runtime": "^7.0.0"
"relay-runtime": "7.0.0"
},
"scripts": {
"start": "yarn run relay; concurrently --kill-others --names \"react-scripts,relay\" \"react-scripts start\" \"yarn run relay --watch\"",
"build": "yarn run relay && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"update-schema": "get-graphql-schema -h \"Authorization=bearer $REACT_APP_GITHUB_AUTH_TOKEN\" https://api.github.com/graphql > schema/schema.graphql",
"relay": "yarn run relay-compiler --schema schema/schema.graphql --src ./src/ $@"
},
"eslintConfig": {
"extends": "react-app"
"devDependencies": {
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@types/history": "^4.7.3",
"@types/jest": "24.0.21",
"@types/node": "12.12.5",
"@types/react": "16.9.11",
"@types/react-dom": "16.9.3",
"@types/react-relay": "^7.0.0",
"@types/react-router-config": "^5.0.1",
"@types/relay-runtime": "^6.0.9",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.6.1",
"babel-plugin-relay": "7.0.0",
"concurrently": "^5.0.0",
"eslint": "^6.6.0",
"eslint-config-react-app": "^5.0.2",
"eslint-plugin-flowtype": "^4.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.2.0",
"get-graphql-schema": "^2.1.2",
"graphql": "^14.5.8",
"husky": "^3.0.9",
"lint-staged": "^9.4.2",
"prettier": "^1.19.1",
"react-scripts": "3.2.0",
"relay-compiler": "7.0.0",
"relay-compiler-language-typescript": "^10.1.0",
"typescript": "^3.7.2"
},
"browserslist": {
"production": [
Expand All @@ -38,24 +64,16 @@
"last 1 safari version"
]
},
"devDependencies": {
"babel-plugin-relay": "^7.0.0",
"concurrently": "^5.0.0",
"eslint-plugin-prettier": "^3.1.1",
"get-graphql-schema": "^2.1.2",
"graphql": "^14.5.8",
"prettier": "^1.18.2",
"relay-compiler": "^7.0.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,json,css,md}": [
"prettier --write",
"src/**/*.{js,ts,jsx,tsx}": [
"yarn prettier --write",
"yarn lint",
"git add"
]
}
}
}
Loading