Skip to content

Commit 6b5d0b7

Browse files
priscilawebdevjuanpicado
authored andcommitted
feat: migrating flow to typescript (conventional-changelog#47)
This PR convert the code base to Typescript, the changes are the following: - migrate code base to Typescript (3.4.x) - enable `eslint` and `@typescript-eslint/eslint-plugin` (warnings still need to be addressed in future pull request - update relevant dependencies for this PR (linting, etc) - enable `bundlezise` (it was disabled for some reason) * refactor: refactoring to typescript * refactor: migrating to typescript * refactor: applied feedbacks * fix: fixed conflicts * refactored: changed registry * refactor: updated registry & removed unnecessary lib * fix: fixed registry ur * fix: fixed page load * refactor: refactored footer wip * refactor: converting to ts..wip * refactor: converting to ts. wip * refactor: converting to ts. wip * refactor: converting to ts * refactor: converting to ts * fix: fixed load errors * refactor: converted files to ts * refactor: removed flow from tests * fix: removed transpiled files * refactor: added ts-ignore * fix: fixed errors * fix: fixed types * fix: fixing jest import -.- * fix: fixing lint errors * fix: fixing lint errors * fix: fixed lint errors * refactor: removed unnecessary tsconfig's config * fix: fixing errors * fix: fixed warning * fix: fixed test * refactor: wip * refactor: wip * refactor: wip * fix: fixing tests: wip * wip * wip * fix: fixed search test * wip * fix: fixing lint errors * fix: re-added stylelint * refactor: updated stylelint script * fix: fixed: 'styles.js' were found. * fix: fixed Search tests * chore: enable eslint eslint needs expecitely to know which file has to lint, by default is JS, in this case we need also ts,tsx files eslint . --ext .js,.ts * chore: vcode eslint settings * chore: restore eslint previous conf * chore: clean jest config * chore: fix eslint warnings * chore: eslint errors cleared chore: clean warnings chore: remove github actions test phases chore: remove dupe rule * chore: update handler name * chore: restore logo from img to url css prop - loading images with css is more performant than using img html tags, switching this might be a breaking change - restore no-empty-source seems the linting do not accept false - update snapshots - remove @material-ui/styles * chore: update stylelint linting * chore: update stylelint linting * chore: fix a mistake on move tabs to a function * chore: eanble bundlezie * chore: use default_executor in circleci * chore: update readme
1 parent 7d17644 commit 6b5d0b7

File tree

358 files changed

+4737
-58438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+4737
-58438
lines changed

.babelrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"presets": [["@verdaccio", { "flow": true }]]
2+
"presets": [
3+
["@verdaccio", { "typescript": true }]
4+
]
35
}

.circleci/config.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ jobs:
7676
key: *repo_key
7777
paths:
7878
- ~/ui-theme
79+
test_bundlesize:
80+
<<: *defaults
81+
<<: *default_executor
82+
steps:
83+
- *restore_repo
84+
- run:
85+
name: Test BundleSize
86+
command: yarn test:size
7987

8088
test_node11:
8189
<<: *defaults
@@ -84,7 +92,7 @@ jobs:
8492
- *restore_repo
8593
- run:
8694
name: Test with Node 11
87-
command: yarn run test
95+
command: yarn test
8896

8997
test_node8:
9098
<<: *defaults
@@ -156,12 +164,16 @@ workflows:
156164
requires:
157165
- prepare
158166
<<: *ignore_non_dev_branches
159-
- coverage:
167+
- test_bundlesize:
160168
requires:
161169
- test_node11
162170
- test_node8
163171
- test_node10
164172
<<: *ignore_non_dev_branches
173+
- coverage:
174+
requires:
175+
- test_bundlesize
176+
<<: *ignore_non_dev_branches
165177
- publish_package:
166178
requires:
167179
- coverage

.eslintignore

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
node_modules
22
coverage/
3-
wiki/
43
static/
5-
flow-typed/
6-
website/
7-
build/
4+
.github/
5+
.circleci/
86
*.md
97
*.lock
108
*.yaml
119
Dockerfile
12-
*.rpi
1310
*.html
1411
*.scss
1512
*.png
16-
*.jpg
17-
test/unit/partials/

.eslintrc

+43-47
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
11
{
2-
"plugins": [
3-
"babel",
4-
"react",
5-
"flowtype",
6-
"jest",
7-
"verdaccio",
8-
"jsx-a11y"
9-
],
102
"extends": [
11-
"eslint:recommended",
12-
"google",
13-
"plugin:flowtype/recommended",
3+
"@verdaccio",
4+
"plugin:react/recommended",
145
"plugin:jest/recommended",
156
"plugin:prettier/recommended",
16-
"plugin:react/recommended",
177
"plugin:verdaccio/recommended",
188
"plugin:jsx-a11y/recommended"
199
],
10+
"plugins": [
11+
"react",
12+
"jest",
13+
"prettier",
14+
"verdaccio",
15+
"jsx-a11y"
16+
],
2017
"settings": {
2118
"react": {
22-
"pragma": "React",
23-
"version": "16.4.2",
24-
"flowVersion": "0.81.0"
19+
"version": "detect"
2520
}
2621
},
27-
"parser": "babel-eslint",
2822
"parserOptions": {
29-
"sourceType": "module",
30-
"ecmaVersion": 7,
3123
"ecmaFeatures": {
32-
"impliedStrict": true,
3324
"jsx": true
3425
}
3526
},
36-
"env": {
37-
"browser": true,
38-
"node": true,
39-
"es6": true,
40-
"jest": true
41-
},
42-
"globals": {
43-
"__APP_VERSION__": true
44-
},
4527
"rules": {
46-
"babel/no-invalid-this": 1,
47-
"prettier/prettier": ["error", null, "@prettier"],
28+
"babel/no-invalid-this": 0,
29+
"no-invalid-this": 0,
30+
"no-console": ["error", { "allow": ["warn", "error"] }],
31+
"prettier/prettier": "error",
32+
"@typescript-eslint/no-var-requires": 0,
33+
"@typescript-eslint/indent": 0,
34+
"@typescript-eslint/explicit-member-accessibility": ["warn",
35+
{
36+
"accessibility": "explicit",
37+
"overrides": {
38+
"constructors": "off"
39+
}
40+
}
41+
],
42+
"@typescript-eslint/explicit-function-return-type": ["warn",
43+
{
44+
"allowExpressions": true,
45+
"allowTypedFunctionExpressions": true
46+
}],
4847
"react/no-deprecated": 1,
4948
"react/jsx-no-target-blank": 1,
5049
"react/destructuring-assignment": ["error", "always"],
@@ -88,8 +87,9 @@
8887
"react/jsx-no-duplicate-props": ["error"],
8988
"react/jsx-no-literals": ["error"],
9089
"react/jsx-no-undef": ["error"],
90+
"react/prop-types": 0,
9191
"react/jsx-one-expression-per-line": ["error", {"allow": "single-child"}],
92-
"react/jsx-curly-brace-presence": ["error", { "props": "always", "children": "ignore" }],
92+
"react/jsx-curly-brace-presence": ["warn", { "props": "ignore", "children": "ignore" }],
9393
"react/jsx-pascal-case": ["error"],
9494
"react/jsx-props-no-multi-spaces": ["error"],
9595
"react/jsx-sort-default-props": ["error"],
@@ -106,23 +106,19 @@
106106
2,
107107
"always"
108108
],
109-
"semi": ["error"],
110-
"comma-dangle": ["error"],
111-
"camelcase": 0,
112-
"no-useless-escape": ["error"],
113-
"no-invalid-this": 0,
114-
"handle-callback-err": ["error"],
115-
"no-fallthrough": ["error"],
116-
"no-new-require": ["error"],
117-
"max-len": ["error", 160],
118-
"require-jsdoc": 0,
119-
"valid-jsdoc": 0,
120-
"prefer-spread": 1,
121-
"prefer-rest-params": 1,
122-
"linebreak-style": 0,
123-
"quote-props":["error", "as-needed"],
124109
"verdaccio/jsx-no-style": ["warn"],
125110
"verdaccio/jsx-spread": ["warn"],
126-
"jest/expect-expect": 0
111+
"jest/expect-expect": 0,
112+
"quote-props":["error", "as-needed"],
113+
"max-len": ["error", 160],
114+
"prefer-spread": 1,
115+
"linebreak-style": 0
116+
},
117+
"globals": {
118+
"__DEBUG__": true
119+
},
120+
"env": {
121+
"browser": true,
122+
"jest/globals": true
127123
}
128124
}

.flowconfig

-25
This file was deleted.

.github/main.workflow

-163
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,3 @@
1-
################################################
2-
# Workflow for a branch push
3-
################################################
4-
workflow "build and test on branch" {
5-
resolves = [
6-
"branch.lint.node.10",
7-
"branch.test.node.10",
8-
"branch.test.node.8",
9-
# "branch.test.node.12"
10-
]
11-
on = "push"
12-
}
13-
14-
# node 10
15-
action "branch.filter" {
16-
uses = "actions/bin/filter@master"
17-
args = "branch"
18-
}
19-
20-
action "branch.install.node.10" {
21-
needs = ["branch.filter"]
22-
uses = "docker://node:10"
23-
args = "yarn install"
24-
}
25-
26-
action "branch.build.node.10" {
27-
uses = "docker://node:10"
28-
needs = ["branch.install.node.10"]
29-
args = "yarn run build"
30-
}
31-
32-
action "branch.lint.node.10" {
33-
uses = "docker://node:10"
34-
needs = ["branch.install.node.10"]
35-
args = "yarn run lint"
36-
}
37-
38-
action "branch.test.node.10" {
39-
uses = "docker://node:10"
40-
needs = ["branch.build.node.10"]
41-
args = "yarn run test"
42-
}
43-
44-
# node 8
45-
action "branch.install.node.8" {
46-
needs = ["branch.filter"]
47-
uses = "docker://node:8"
48-
args = "yarn install"
49-
}
50-
51-
action "branch.build.node.8" {
52-
uses = "docker://node:8"
53-
needs = ["branch.install.node.8"]
54-
args = "yarn run build"
55-
}
56-
57-
action "branch.test.node.8" {
58-
uses = "docker://node:8"
59-
needs = ["branch.build.node.8"]
60-
args = "yarn run test"
61-
}
62-
63-
# @todo node 12
64-
# action "branch.install.node.12" {
65-
# needs = ["branch.filter"]
66-
# uses = "docker://node:12"
67-
# args = "yarn install"
68-
# }
69-
70-
# action "branch.build.node.12" {
71-
# uses = "docker://node:12"
72-
# needs = ["branch.install.node.12"]
73-
# args = "yarn run build"
74-
# }
75-
76-
# action "branch.test.node.12" {
77-
# uses = "docker://node:12"
78-
# needs = ["branch.build.node.12"]
79-
# args = "yarn run test"
80-
# }
81-
82-
################################################
83-
# Workflow for a Pull request
84-
################################################
85-
workflow "build and test on PR" {
86-
resolves = [
87-
"pr.lint.node.10",
88-
"pr.test.node.10",
89-
"pr.test.node.8",
90-
# "pr.test.node.12"
91-
]
92-
on = "pull_request"
93-
}
94-
95-
# node 10
96-
action "pr.filter" {
97-
uses = "actions/bin/filter@master"
98-
args = "action 'opened|synchronize|reopened'"
99-
}
100-
101-
action "pr.install.node.10" {
102-
needs = ["pr.filter"]
103-
uses = "docker://node:10"
104-
args = "yarn install"
105-
}
106-
107-
action "pr.build.node.10" {
108-
uses = "docker://node:10"
109-
needs = ["pr.install.node.10"]
110-
args = "yarn run build"
111-
}
112-
113-
action "pr.lint.node.10" {
114-
uses = "docker://node:10"
115-
needs = ["pr.install.node.10"]
116-
args = "yarn run lint"
117-
}
118-
119-
action "pr.test.node.10" {
120-
uses = "docker://node:10"
121-
needs = ["pr.build.node.10"]
122-
args = "yarn run test"
123-
}
124-
125-
# node 8
126-
action "pr.install.node.8" {
127-
needs = ["pr.filter"]
128-
uses = "docker://node:8"
129-
args = "yarn install"
130-
}
131-
132-
action "pr.build.node.8" {
133-
uses = "docker://node:8"
134-
needs = ["pr.install.node.8"]
135-
args = "yarn run build"
136-
}
137-
138-
action "pr.test.node.8" {
139-
uses = "docker://node:8"
140-
needs = ["pr.build.node.8"]
141-
args = "yarn run test"
142-
}
143-
144-
# @todo node 12
145-
# action "pr.install.node.12" {
146-
# needs = ["pr.filter"]
147-
# uses = "docker://node:12"
148-
# args = "yarn install"
149-
# }
150-
151-
# action "pr.build.node.12" {
152-
# uses = "docker://node:12"
153-
# needs = ["pr.install.node.12"]
154-
# args = "yarn run build"
155-
# }
156-
157-
# action "pr.test.node.12" {
158-
# uses = "docker://node:12"
159-
# needs = ["pr.build.node.12"]
160-
# args = "yarn run test"
161-
# }
162-
163-
1641
################################################
1652
# Workflow for a github release when a tag is
1663
# pushed

0 commit comments

Comments
 (0)