Skip to content

Commit a3fc7a2

Browse files
authored
feat: update all dependencies (#62)
For security reasons, update devDependencies. All snapshot have changed because graphql was bumped to v15 but it's just a matter of order Also move all CI to github action
1 parent d27b148 commit a3fc7a2

File tree

11 files changed

+2167
-3332
lines changed

11 files changed

+2167
-3332
lines changed

.circleci/config.yml

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

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v2
16+
- name: setup-node
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '14.x'
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
- uses: actions/cache@v2
24+
with:
25+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
26+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-yarn-
29+
- name: install
30+
run: yarn install
31+
- name: build
32+
run: yarn build

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 15
12+
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v2
16+
- name: setup-node
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: '14.x'
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
- uses: actions/cache@v2
24+
with:
25+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
26+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-yarn-
29+
- name: install
30+
run: yarn install
31+
- name: build
32+
run: yarn build
33+
- name: release
34+
run: yarn release
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/lint.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@ jobs:
88
timeout-minutes: 15
99

1010
steps:
11-
- uses: actions/checkout@v1
12-
- uses: docker://borales/yarn:latest
11+
- name: checkout
12+
uses: actions/checkout@v2
13+
- name: setup-node
14+
uses: actions/setup-node@v1
1315
with:
14-
args: 'install'
15-
- name: lint
16-
uses: docker://borales/yarn:latest
16+
node-version: '14.x'
17+
- name: Get yarn cache directory path
18+
id: yarn-cache-dir-path
19+
run: echo "::set-output name=dir::$(yarn cache dir)"
20+
- uses: actions/cache@v2
1721
with:
18-
args: 'lint'
22+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
23+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
24+
restore-keys: |
25+
${{ runner.os }}-yarn-
26+
- name: install
27+
run: yarn install
28+
- name: lint
29+
run: yarn lint

.github/workflows/test.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
11
name: test
22

3-
on: [push]
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
47

58
jobs:
69
test:
710
runs-on: ubuntu-latest
811
timeout-minutes: 15
912

1013
steps:
11-
- uses: actions/checkout@v1
12-
- uses: docker://borales/yarn:latest
14+
- name: checkout
15+
uses: actions/checkout@v2
16+
- name: setup-node
17+
uses: actions/setup-node@v1
1318
with:
14-
args: 'install'
15-
- name: test
16-
uses: docker://borales/yarn:latest
19+
node-version: '14.x'
20+
- name: Get yarn cache directory path
21+
id: yarn-cache-dir-path
22+
run: echo "::set-output name=dir::$(yarn cache dir)"
23+
- uses: actions/cache@v2
1724
with:
18-
args: 'test'
25+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
26+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-yarn-
29+
- name: install
30+
run: yarn install
31+
- name: test
32+
run: yarn test

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

package.json

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,27 @@
3333
"graphql": "^14.6.0 || ^15.0.0"
3434
},
3535
"devDependencies": {
36-
"@auto-it/conventional-commits": "^9.57.0",
36+
"@auto-it/conventional-commits": "^10.32.1",
3737
"@graphql-codegen/testing": "^1.17.7",
38-
"@types/faker": "^4.1.11",
39-
"@types/jest": "^25.1.5",
40-
"@typescript-eslint/eslint-plugin": "^2.26.0",
41-
"@typescript-eslint/parser": "^2.26.0",
38+
"@types/faker": "^5.5.9",
39+
"@types/jest": "^27.0.2",
40+
"@typescript-eslint/eslint-plugin": "^5.1.0",
41+
"@typescript-eslint/parser": "^5.1.0",
4242
"auto": "^10.32.1",
43-
"eslint": "6.8.0",
44-
"eslint-config-landr": "0.2.1",
45-
"eslint-config-prettier": "^6.10.1",
46-
"eslint-plugin-import": "^2.20.2",
47-
"eslint-plugin-jest": "^23.8.2",
48-
"eslint-plugin-prettier": "^3.1.2",
49-
"graphql": "^14.0.0",
50-
"husky": "^4.3.0",
51-
"jest": "^25.2.7",
52-
"lint-staged": "^10.4.0",
53-
"prettier": "^2.1.2",
54-
"prettier-config-landr": "^0.0.7",
55-
"ts-jest": "^25.4.0",
56-
"typescript": "^3.8.3"
43+
"eslint": "8.0.1",
44+
"eslint-config-landr": "0.7.0",
45+
"eslint-config-prettier": "^8.3.0",
46+
"eslint-plugin-import": "^2.25.2",
47+
"eslint-plugin-jest": "^25.2.2",
48+
"eslint-plugin-prettier": "^4.0.0",
49+
"graphql": "^15.6.1",
50+
"husky": "^7.0.0",
51+
"jest": "^27.3.1",
52+
"lint-staged": "^11.2.3",
53+
"prettier": "^2.4.1",
54+
"prettier-config-landr": "^0.2.0",
55+
"ts-jest": "^27.0.7",
56+
"typescript": "^4.4.4"
5757
},
5858
"sideEffects": false,
5959
"scripts": {
@@ -63,7 +63,8 @@
6363
"prettify": "prettier --config ./.prettierrc.js --write",
6464
"auto:version": "yarn version --`auto version` --message 'Bump version to: %s [skip ci]'",
6565
"auto:publish": "yarn publish && git push --follow-tags --set-upstream origin $CIRCLE_BRANCH",
66-
"release": "auto changelog && yarn auto:version && yarn auto:publish && auto release"
66+
"release": "auto changelog && yarn auto:version && yarn auto:publish && auto release",
67+
"prepare": "husky install"
6768
},
6869
"lint-staged": {
6970
"*.{js,ts,tsx}": [
@@ -73,11 +74,6 @@
7374
"prettier --write"
7475
]
7576
},
76-
"husky": {
77-
"hooks": {
78-
"pre-commit": "lint-staged"
79-
}
80-
},
8177
"files": [
8278
"dist/**/*",
8379
"LICENSE",

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,10 @@ export const plugin: PluginFunction<TypescriptMocksPluginConfig> = (schema, docu
498498
});
499499
// List of function that will generate the mock.
500500
// We generate it after having visited because we need to distinct types from enums
501-
const mockFns = definitions.map(({ mockFn }: any) => mockFn).filter((mockFn: Function) => !!mockFn);
501+
const mockFns = definitions
502+
.map(({ mockFn }: { mockFn: () => string }) => mockFn)
503+
.filter((mockFn: () => string) => !!mockFn);
502504

503-
return `${typesFileImport}${mockFns.map((mockFn: Function) => mockFn()).join('\n')}
505+
return `${typesFileImport}${mockFns.map((mockFn: () => string) => mockFn()).join('\n')}
504506
`;
505507
};

0 commit comments

Comments
 (0)