Skip to content

Commit 13ebde2

Browse files
@jotadevelopersergiohgz
authored andcommitted
feat: migrate to typescript BREAKING CHANGE: new compiler might bring issues
1 parent de0a341 commit 13ebde2

File tree

19 files changed

+3540
-3588
lines changed

19 files changed

+3540
-3588
lines changed

plugins/auth-memory/.babelrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"presets": [["env", {
3-
"targets": {
4-
"node": "6"
5-
}
6-
}], "flow"]
7-
}
2+
"presets": [["@verdaccio", {"typescript": true}]]
3+
}
Lines changed: 152 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,168 @@
11
version: 2
2+
3+
aliases:
4+
- &defaults
5+
working_directory: ~/auth-memory-storage
6+
- &node11_executor
7+
docker:
8+
- image: circleci/node:11.10.1
9+
- &node8_executor
10+
docker:
11+
- image: circleci/node:8
12+
- &node10_executor
13+
docker:
14+
- image: circleci/node:10
15+
- &default_executor
16+
<<: *node10_executor
17+
- &repo_key
18+
repo-{{ .Branch }}-{{ .Revision }}
19+
- &coverage_key
20+
coverage-{{ .Branch }}-{{ .Revision }}
21+
- &base_config_key
22+
base-config-{{ .Branch }}-{{ .Revision }}
23+
- &yarn_cache_key
24+
yarn-sha-{{ checksum "yarn.lock" }}
25+
- &restore_repo
26+
restore_cache:
27+
keys:
28+
- *repo_key
29+
- &ignore_non_dev_branches
30+
filters:
31+
tags:
32+
only: /.*/
33+
branches:
34+
ignore:
35+
- /release\/.*/
36+
- &execute_on_release
37+
filters:
38+
tags:
39+
only: /(v)?[0-9]+(\.[0-9]+)*/
40+
branches:
41+
ignore:
42+
- /.*/
43+
244
jobs:
3-
lint:
4-
docker:
5-
- image: circleci/node:9
45+
prepare:
46+
<<: *defaults
47+
<<: *default_executor
648
steps:
49+
- *restore_repo
750
- checkout
8-
- run: yarn install --no-progress
9-
- run: yarn run lint
51+
- restore_cache:
52+
key: *base_config_key
53+
- run:
54+
name: 'Base environment setup'
55+
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
56+
- save_cache:
57+
key: *base_config_key
58+
paths:
59+
- ~/.npmrc
60+
- ~/.gitconfig
61+
- restore_cache:
62+
key: *yarn_cache_key
63+
- run:
64+
name: Install Js dependencies
65+
command: yarn install --no-progress --registry https://registry.verdaccio.org --no-lockfile
66+
- run:
67+
name: Build project
68+
command: yarn run build
69+
- save_cache:
70+
key: *yarn_cache_key
71+
paths:
72+
- ~/.yarn
73+
- ~/.cache/yarn
74+
- node_modules
75+
- save_cache:
76+
key: *repo_key
77+
paths:
78+
- ~/auth-memory-storage
1079

11-
test_6:
12-
docker:
13-
- image: circleci/node:6
80+
test_node11:
81+
<<: *defaults
82+
<<: *node11_executor
1483
steps:
15-
- checkout
16-
- run: yarn install --no-progress
17-
- run: yarn run test
18-
19-
test_8:
20-
docker:
21-
- image: circleci/node:8
84+
- *restore_repo
85+
- run:
86+
name: Test with Node 11
87+
command: yarn run test
88+
89+
test_node8:
90+
<<: *defaults
91+
<<: *node8_executor
2292
steps:
23-
- checkout
24-
- run: yarn install --no-progress
25-
- run: yarn run test
93+
- *restore_repo
94+
- run:
95+
name: Test with Node 8
96+
command: yarn test
2697

27-
test_9:
28-
docker:
29-
- image: circleci/node:9
98+
test_node10:
99+
<<: *defaults
100+
<<: *node10_executor
30101
steps:
31-
- checkout
32-
- run: yarn install --no-progress
33-
- run: yarn run test
34-
- run: yarn run coverage
102+
- *restore_repo
103+
- run:
104+
name: Test with Node 10
105+
command: yarn run test
106+
- save_cache:
107+
key: *coverage_key
108+
paths:
109+
- coverage
110+
111+
coverage:
112+
<<: *defaults
113+
<<: *default_executor
114+
steps:
115+
- *restore_repo
116+
- restore_cache:
117+
key: *coverage_key
118+
- run:
119+
name: Publish coverage
120+
command: yarn coverage:publish
121+
- store_artifacts:
122+
path: coverage/clover.xml
123+
prefix: tests
124+
- store_artifacts:
125+
path: coverage
126+
prefix: coverage
127+
- store_test_results:
128+
path: coverage/clover.xml
129+
130+
publish_package:
131+
<<: *defaults
132+
<<: *default_executor
133+
steps:
134+
- *restore_repo
135+
- restore_cache:
136+
key: *base_config_key
137+
- run:
138+
name: Publish
139+
command: yarn publish
35140

36141
workflows:
37142
version: 2
38-
build_and_test:
143+
workflow:
39144
jobs:
40-
- lint
41-
- test_6:
145+
- prepare:
146+
<<: *ignore_non_dev_branches
147+
- test_node11:
148+
requires:
149+
- prepare
150+
<<: *ignore_non_dev_branches
151+
- test_node8:
152+
requires:
153+
- prepare
154+
<<: *ignore_non_dev_branches
155+
- test_node10:
42156
requires:
43-
- lint
44-
- test_8:
157+
- prepare
158+
<<: *ignore_non_dev_branches
159+
- coverage:
45160
requires:
46-
- lint
47-
- test_9:
161+
- test_node11
162+
- test_node8
163+
- test_node10
164+
<<: *ignore_non_dev_branches
165+
- publish_package:
48166
requires:
49-
- lint
167+
- coverage
168+
<<: *execute_on_release

plugins/auth-memory/.eslintrc

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,8 @@
11
{
2-
"plugins": [
3-
"flowtype",
4-
"jest"
5-
],
62
"extends": [
7-
"eslint:recommended",
8-
"google",
9-
"plugin:flowtype/recommended",
10-
"plugin:jest/recommended",
11-
"plugin:prettier/recommended"
3+
"@verdaccio"
124
],
13-
"parser": "babel-eslint",
14-
"parserOptions": {
15-
"sourceType": "module",
16-
"ecmaVersion": 7,
17-
"ecmaFeatures": {
18-
"impliedStrict": true,
19-
"jsx": true
20-
}
21-
},
22-
"env": {
23-
"browser": true,
24-
"node": true,
25-
"es6": true,
26-
"jest": true
27-
},
28-
"globals": {
29-
"__APP_VERSION__": true
30-
},
315
"rules": {
32-
"prettier/prettier": ["error", null, "@prettier"],
33-
"no-useless-escape": 2,
34-
"handle-callback-err": 2,
35-
"no-fallthrough": 2,
36-
"no-new-require": 2,
37-
"max-len": [2, 160],
38-
"camelcase": 0,
39-
"require-jsdoc": 0,
40-
"valid-jsdoc": 0,
41-
"prefer-spread": 1,
42-
"prefer-rest-params": 1,
43-
"linebreak-style": 0,
44-
"quote-props":["error", "as-needed"]
6+
"@typescript-eslint/no-non-null-assertion": 0
457
}
468
}

plugins/auth-memory/.flowconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

plugins/auth-memory/.npmignore

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
src/
12
tests-report/
2-
.nyc_output
33
.editorconfig
44
.gitignore
55
yarn-error.log
66
yarn.lock
77
.idea/
8-
.flowconfig
9-
flow-typed/
108
.eslintrc
119
.babelrc
1210
test/
@@ -15,10 +13,19 @@ test/
1513
.npmignore
1614
.travis.yml
1715
*.tmp-*
18-
_storage/
1916
circle.yml
2017
travis.yml
2118
*.md
2219
coverage/
2320
jest.config.js
24-
jestEnvironment.js
21+
jestEnvironment.js
22+
tests/
23+
.idea/
24+
.circleci/
25+
tsconfig.json
26+
jest.config.js
27+
.DS_Store
28+
.prettierrc
29+
*.spec.js
30+
.vcode/
31+
.yarnrc

plugins/auth-memory/.prettierrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"useTabs": false,
3-
"printWidth": 160,
3+
"printWidth": 120,
44
"tabWidth": 2,
55
"singleQuote": true,
66
"requirePragma": true,
7-
"bracketSpacing": true,
7+
"bracketSpacing": false,
88
"jsxBracketSameLine": false,
99
"trailingComma": "es5",
1010
"semi": true,
11-
"parser": "flow"
11+
"parser": "typescript"
1212
}

plugins/auth-memory/.yarnrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
save-prefix ""
2-
registry "http://registry.npmjs.org/"
1+
save-prefix ""

plugins/auth-memory/flow-typed/npm/http-errors_v1.x.x.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)