Skip to content

Commit 1e15b24

Browse files
jsumnersgurgundayBram-dc
authored
Merge next into main (#102)
* Update for v5 (#86) * update * pre-commit * fix * fix * downgrade fastify-tscong * Revert "downgrade fastify-tscong" This reverts commit 23fb288. * remove glob * Update for v5 (#86) (#100) * feat: fastify 5 with separated type-providers * update fastify dep --------- Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day> Co-authored-by: Bram-dc <bramdelcanho@gmail.com> Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day> --------- Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day> Co-authored-by: Gürgün Dayıoğlu <hey@gurgun.day> Co-authored-by: Bram-dc <bramdelcanho@gmail.com>
1 parent b20e536 commit 1e15b24

File tree

4 files changed

+27
-112
lines changed

4 files changed

+27
-112
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -16,96 +16,8 @@ on:
1616
- '*.md'
1717

1818
jobs:
19-
lint:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v4
23-
24-
- name: Use Node.js
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: lts/*
28-
- name: Install
29-
run: |
30-
npm install
31-
- name: Install PeerDeps
32-
run: |
33-
npm i fastify json-schema-to-ts
34-
35-
- name: Run lint
36-
run: |
37-
npm run lint
3819
test:
39-
name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
40-
runs-on: ${{ matrix.os }}
41-
strategy:
42-
matrix:
43-
node-version: [14, 16, 18, 20]
44-
os: [macos-latest, ubuntu-latest, windows-latest]
45-
46-
steps:
47-
- uses: actions/checkout@v4
48-
49-
- name: Use Node.js
50-
uses: actions/setup-node@v4
51-
with:
52-
node-version: ${{ matrix.node-version }}
53-
54-
- name: Install
55-
run: |
56-
npm install
57-
58-
- name: Install PeerDeps
59-
run: |
60-
npm i fastify json-schema-to-ts
61-
62-
- name: Run Transpile
63-
run: |
64-
npm run build
65-
66-
types:
67-
name: Types
68-
runs-on: 'ubuntu-latest'
69-
70-
steps:
71-
- uses: actions/checkout@v4
72-
73-
- name: Use Node.js
74-
uses: actions/setup-node@v4
75-
with:
76-
node-version: lts/*
77-
78-
- name: Install
79-
run: |
80-
npm install
81-
82-
- name: Install PeerDeps
83-
run: |
84-
npm i fastify json-schema-to-ts
85-
86-
- name: Transpile
87-
run: |
88-
npm run build
89-
90-
- name: Test types
91-
run: |
92-
npm run typescript
93-
94-
automerge:
95-
name: Automerge Dependabot PRs
96-
if: >
97-
github.event_name == 'pull_request' &&
98-
github.event.pull_request.user.login == 'dependabot[bot]'
99-
needs:
100-
- lint
101-
- test
102-
- types
103-
permissions:
104-
pull-requests: write
105-
contents: write
106-
runs-on: ubuntu-latest
107-
steps:
108-
- uses: fastify/github-action-merge-dependabot@v3
109-
with:
110-
github-token: ${{ secrets.GITHUB_TOKEN }}
111-
target: major
20+
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.2.1
21+
with:
22+
lint: true
23+
license-check: true

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
import { FromSchema, FromSchemaDefaultOptions, FromSchemaOptions, JSONSchema } from 'json-schema-to-ts'
1212

1313
export interface JsonSchemaToTsProvider<Options extends FromSchemaOptions = FromSchemaDefaultOptions> extends FastifyTypeProvider {
14-
output: this['input'] extends JSONSchema ? FromSchema<this['input'], Options> : unknown;
14+
validator: this['schema'] extends JSONSchema ? FromSchema<this['schema'], Options> : unknown;
15+
serializer: this['schema'] extends JSONSchema ? FromSchema<this['schema'], Options> : unknown;
1516
}
1617

1718
/**

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"build": "rimraf ./dist && mkdir dist && tsc --outDir dist",
9-
"test": "npm run build && npm run typescript",
8+
"build": "rimraf dist && mkdir dist && tsc --outDir dist",
9+
"test": "npm run build && npm run test:typescript",
10+
"test:typescript": "tsc --strict --noEmit && tsd",
1011
"lint": "eslint \"**/*.ts\"",
1112
"lint:fix": "eslint \"**/*.ts\" --fix",
12-
"typescript": "tsc --strict --noEmit types/*.ts && tsd",
1313
"prepublishOnly": "npm run build"
1414
},
1515
"repository": {
@@ -26,25 +26,24 @@
2626
"url": "https://github.com/fastify/fastify-type-provider-json-schema-to-ts/issues"
2727
},
2828
"homepage": "https://github.com/fastify/fastify-type-provider-json-schema-to-ts#readme",
29-
"peerDependencies": {
30-
"fastify": "^4.25.2",
31-
"json-schema-to-ts": "^3.0.0"
32-
},
3329
"tsd": {
3430
"directory": "types"
3531
},
3632
"devDependencies": {
37-
"@types/node": "^20.1.0",
38-
"@typescript-eslint/eslint-plugin": "^7.3.1",
39-
"@typescript-eslint/parser": "^7.3.1",
40-
"eslint": "^8.21.0",
41-
"eslint-config-standard": "^17.0.0",
42-
"eslint-plugin-import": "^2.26.0",
43-
"eslint-plugin-n": "^16.1.0",
44-
"eslint-plugin-promise": "^6.0.0",
45-
"fastify-tsconfig": "^1.0.1",
46-
"rimraf": "^5.0.5",
33+
"@fastify/pre-commit": "^2.1.0",
34+
"@types/node": "^20.14.2",
35+
"@typescript-eslint/eslint-plugin": "^7.13.0",
36+
"@typescript-eslint/parser": "^7.13.0",
37+
"eslint": "^8.57.0",
38+
"eslint-config-standard": "^17.1.0",
39+
"eslint-plugin-import": "^2.29.1",
40+
"eslint-plugin-n": "^16.6.2",
41+
"eslint-plugin-promise": "^6.2.0",
42+
"fastify": "^5.0.0-alpha.3",
43+
"fastify-tsconfig": "^2.0.0",
44+
"json-schema-to-ts": "^3.1.0",
45+
"rimraf": "^5.0.7",
4746
"tsd": "^0.31.0",
48-
"typescript": "^5.0.2"
47+
"typescript": "^5.4.5"
4948
}
5049
}

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "fastify-tsconfig",
3-
"exclude": ["./node_modules", "types/**/*.test-d.ts"]
3+
"compilerOptions": {
4+
"declaration": true
5+
},
6+
"exclude": ["node_modules/", "types/**/*.test-d.ts"]
47
}

0 commit comments

Comments
 (0)