Skip to content

Commit 6625c0e

Browse files
authored
Merge pull request #606 from Code-Hex/add/skip-libcheck
fix project config
2 parents dbbcd62 + f60d7fd commit 6625c0e

32 files changed

+1776
-1512
lines changed

.eslintrc.json

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

.github/renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"dependencyDashboard": false,
1010
"onboarding": false,
1111
"prConcurrentLimit": 5
12-
}
12+
}

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-node@v3
1717
with:
1818
node-version: current
19-
cache: 'pnpm'
19+
cache: pnpm
2020
- run: pnpm install --frozen-lockfile
2121
- run: pnpm test
2222
env:
@@ -32,10 +32,9 @@ jobs:
3232
uses: actions/setup-node@v3
3333
with:
3434
node-version: current
35-
cache: 'pnpm'
35+
cache: pnpm
3636
- run: pnpm install --frozen-lockfile
3737
- run: pnpm lint-fix
38-
- run: pnpm prettier
3938
- name: Auto commit fixed code
4039
id: auto-commit-action
4140
uses: stefanzweifel/git-auto-commit-action@v4

.github/workflows/issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'good first issue'
1+
name: good first issue
22
on: [issues]
33

44
jobs:

.prettierignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
node_modules
2-
dist
3-
.npmignore
4-
package-lock.json
5-
.DS_Store
6-
tsconfig.tsbuildinfo
7-
example
8-
vitest.config.ts
1+
**

.prettierrc.json

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

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ generates:
239239
constraint:
240240
minLength: min
241241
# Replace $1 with specified `startsWith` argument value of the constraint directive
242-
startsWith: ["matches", "/^$1/"]
242+
startsWith: [matches, /^$1/]
243243
format:
244244
email: email
245245
```
@@ -249,7 +249,7 @@ Then generates yup validation schema like below.
249249
```ts
250250
export function ExampleInputSchema(): yup.SchemaOf<ExampleInput> {
251251
return yup.object({
252-
email: yup.string().defined().required("Hello, World!").min(50).email(),
252+
email: yup.string().defined().required('Hello, World!').min(50).email(),
253253
message: yup.string().defined().matches(/^Hello/)
254254
})
255255
}
@@ -277,7 +277,7 @@ generates:
277277
constraint:
278278
minLength: min
279279
# Replace $1 with specified `startsWith` argument value of the constraint directive
280-
startsWith: ["regex", "/^$1/", "message"]
280+
startsWith: [regex, /^$1/, message]
281281
format:
282282
email: email
283283
```
@@ -288,7 +288,7 @@ Then generates zod validation schema like below.
288288
export function ExampleInputSchema(): z.ZodSchema<ExampleInput> {
289289
return z.object({
290290
email: z.string().min(50).email(),
291-
message: z.string().regex(/^Hello/, "message")
291+
message: z.string().regex(/^Hello/, 'message')
292292
})
293293
}
294294
```
@@ -310,4 +310,4 @@ generates:
310310
preset: 'client',
311311
plugins:
312312
...
313-
```
313+
```

codegen.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
overwrite: true
2-
schema: './example/test.graphql'
2+
schema: ./example/test.graphql
33
generates:
44
example/types.ts:
55
plugins:
@@ -21,11 +21,11 @@ generates:
2121
constraint:
2222
minLength: min # same as ['min', '$1']
2323
maxLength: max
24-
startsWith: ['matches', '/^$1/']
25-
endsWith: ['matches', '/$1$/']
26-
contains: ['matches', '/$1/']
27-
notContains: ['matches', '/^((?!$1).)*$/']
28-
pattern: ['matches', '/$1/']
24+
startsWith: [matches, /^$1/]
25+
endsWith: [matches, /$1$/]
26+
contains: [matches, /$1/]
27+
notContains: [matches, '/^((?!$1).)*$/']
28+
pattern: [matches, /$1/]
2929
format:
3030
# For example, `@constraint(format: "uri")`. this case $1 will be "uri".
3131
# Therefore the generator generates yup schema `.url()` followed by `uri: 'url'`
@@ -37,8 +37,8 @@ generates:
3737
# you need to add the logic using `yup.addMethod`.
3838
# see: https://github.com/jquense/yup#addmethodschematype-schema-name-string-method--schema-void
3939
ipv4: ipv4
40-
min: ['min', '$1 - 1']
41-
max: ['max', '$1 + 1']
40+
min: [min, $1 - 1]
41+
max: [max, '$1 + 1']
4242
exclusiveMin: min
4343
exclusiveMax: max
4444
scalars:
@@ -61,7 +61,7 @@ generates:
6161
constraint:
6262
minLength: min
6363
# Replace $1 with specified `startsWith` argument value of the constraint directive
64-
startsWith: ['regex', '/^$1/', 'message']
64+
startsWith: [regex, /^$1/, message]
6565
format:
6666
email: email
6767
scalars:
@@ -76,7 +76,7 @@ generates:
7676
constraint:
7777
minLength: min
7878
# Replace $1 with specified `startsWith` argument value of the constraint directive
79-
startsWith: ['pattern', '/^$1/']
79+
startsWith: [pattern, /^$1/]
8080
format:
8181
email: email
8282
scalars:

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
export default antfu({
4+
typescript: true,
5+
// `.eslintignore` is no longer supported in Flat config, use `ignores` instead
6+
ignores: [
7+
'dist/**',
8+
'node_modules/**',
9+
'example/**',
10+
'vitest.config.ts',
11+
'tsconfig.json',
12+
'README.md',
13+
],
14+
}, {
15+
rules: { 'style/semi': 'off' },
16+
})

package.json

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,10 @@
66
"type": "git",
77
"url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema.git"
88
},
9-
"main": "dist/main/index.js",
10-
"typings": "dist/main/index.d.ts",
11-
"module": "dist/module/index.js",
12-
"files": [
13-
"dist/**/*.{js,ts}",
14-
"LICENSE",
15-
"README.md"
16-
],
17-
"scripts": {
18-
"type-check": "tsc --noEmit",
19-
"type-check:yup": "tsc --strict --noEmit example/yup/schemas.ts",
20-
"type-check:zod": "tsc --strict --noEmit example/zod/schemas.ts",
21-
"type-check:myzod": "tsc --strict --noEmit example/myzod/schemas.ts",
22-
"test": "vitest run",
23-
"build": "run-p build:*",
24-
"build:main": "tsc -p tsconfig.main.json",
25-
"build:module": "tsc -p tsconfig.module.json",
26-
"lint": "eslint --ext .ts .",
27-
"lint-fix": "eslint --fix --ext .ts .",
28-
"prettier": "prettier --write --list-different \"**/*.{ts,graphql,yml}\"",
29-
"prettier:check": "prettier --check \"**/*.{ts,graphql,yml}\"",
30-
"generate": "run-p build:* && graphql-codegen",
31-
"prepublish": "run-p build:*"
9+
"author": "codehex",
10+
"license": "MIT",
11+
"bugs": {
12+
"url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"
3213
},
3314
"keywords": [
3415
"gql",
@@ -44,43 +25,64 @@
4425
"types",
4526
"typings"
4627
],
47-
"author": "codehex",
48-
"license": "MIT",
28+
"exports": {
29+
".": {
30+
"types": "./dist/types/index.d.ts",
31+
"import": "./dist/module/index.js",
32+
"require": "./dist/main/index.js"
33+
}
34+
},
35+
"main": "dist/main/index.js",
36+
"typings": "dist/types/index.d.ts",
37+
"module": "dist/module/index.js",
38+
"files": [
39+
"!dist/**/*.tsbuildinfo",
40+
"LICENSE",
41+
"README.md",
42+
"dist/**/*.{js,ts}"
43+
],
44+
"scripts": {
45+
"type-check": "tsc --noEmit",
46+
"type-check:yup": "tsc --strict --skipLibCheck --noEmit example/yup/schemas.ts",
47+
"type-check:zod": "tsc --strict --skipLibCheck --noEmit example/zod/schemas.ts",
48+
"type-check:myzod": "tsc --strict --skipLibCheck --noEmit example/myzod/schemas.ts",
49+
"test": "vitest run",
50+
"build": "run-p build:*",
51+
"build:main": "tsc -p tsconfig.main.json",
52+
"build:module": "tsc -p tsconfig.module.json",
53+
"build:types": "tsc -p tsconfig.types.json",
54+
"lint": "eslint .",
55+
"lint-fix": "eslint . --fix",
56+
"generate": "run-p build:* && graphql-codegen",
57+
"prepublish": "run-p build:*"
58+
},
59+
"peerDependencies": {
60+
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
61+
},
62+
"dependencies": {
63+
"@graphql-codegen/plugin-helpers": "^5.0.0",
64+
"@graphql-codegen/schema-ast": "4.0.2",
65+
"@graphql-codegen/visitor-plugin-common": "^5.0.0",
66+
"@graphql-tools/utils": "^10.0.0",
67+
"graphlib": "^2.1.8",
68+
"graphql": "^16.6.0"
69+
},
4970
"devDependencies": {
71+
"@antfu/eslint-config": "^2.12.2",
5072
"@graphql-codegen/cli": "5.0.2",
5173
"@graphql-codegen/typescript": "^4.0.0",
5274
"@tsconfig/recommended": "1.0.6",
5375
"@types/graphlib": "^2.1.8",
54-
"@types/jest": "29.5.12",
5576
"@types/node": "^20.0.0",
56-
"@typescript-eslint/eslint-plugin": "7.5.0",
57-
"@typescript-eslint/parser": "7.5.0",
5877
"eslint": "9.0.0",
59-
"eslint-plugin-import": "^2.27.5",
60-
"eslint-plugin-simple-import-sort": "^12.0.0",
6178
"jest": "29.7.0",
6279
"myzod": "1.11.0",
6380
"npm-run-all2": "6.1.2",
64-
"prettier": "3.2.5",
6581
"ts-dedent": "^2.2.0",
6682
"ts-jest": "29.1.2",
6783
"typescript": "5.4.4",
6884
"vitest": "^1.0.0",
6985
"yup": "1.4.0",
7086
"zod": "3.22.4"
71-
},
72-
"dependencies": {
73-
"@graphql-codegen/plugin-helpers": "^5.0.0",
74-
"@graphql-codegen/schema-ast": "4.0.2",
75-
"@graphql-codegen/visitor-plugin-common": "^5.0.0",
76-
"@graphql-tools/utils": "^10.0.0",
77-
"graphlib": "^2.1.8",
78-
"graphql": "^16.6.0"
79-
},
80-
"peerDependencies": {
81-
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
82-
},
83-
"bugs": {
84-
"url": "https://github.com/Code-Hex/graphql-codegen-typescript-validation-schema/issues"
8587
}
8688
}

0 commit comments

Comments
 (0)