Skip to content

Commit

Permalink
Merge next into main (#102)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Jul 2, 2024
1 parent b20e536 commit 1e15b24
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 112 deletions.
96 changes: 4 additions & 92 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,96 +16,8 @@ on:
- '*.md'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install
run: |
npm install
- name: Install PeerDeps
run: |
npm i fastify json-schema-to-ts
- name: Run lint
run: |
npm run lint
test:
name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14, 16, 18, 20]
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install
- name: Install PeerDeps
run: |
npm i fastify json-schema-to-ts
- name: Run Transpile
run: |
npm run build
types:
name: Types
runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install
run: |
npm install
- name: Install PeerDeps
run: |
npm i fastify json-schema-to-ts
- name: Transpile
run: |
npm run build
- name: Test types
run: |
npm run typescript
automerge:
name: Automerge Dependabot PRs
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs:
- lint
- test
- types
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
target: major
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v4.2.1
with:
lint: true
license-check: true
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
import { FromSchema, FromSchemaDefaultOptions, FromSchemaOptions, JSONSchema } from 'json-schema-to-ts'

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

/**
Expand Down
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "rimraf ./dist && mkdir dist && tsc --outDir dist",
"test": "npm run build && npm run typescript",
"build": "rimraf dist && mkdir dist && tsc --outDir dist",
"test": "npm run build && npm run test:typescript",
"test:typescript": "tsc --strict --noEmit && tsd",
"lint": "eslint \"**/*.ts\"",
"lint:fix": "eslint \"**/*.ts\" --fix",
"typescript": "tsc --strict --noEmit types/*.ts && tsd",
"prepublishOnly": "npm run build"
},
"repository": {
Expand All @@ -26,25 +26,24 @@
"url": "https://github.com/fastify/fastify-type-provider-json-schema-to-ts/issues"
},
"homepage": "https://github.com/fastify/fastify-type-provider-json-schema-to-ts#readme",
"peerDependencies": {
"fastify": "^4.25.2",
"json-schema-to-ts": "^3.0.0"
},
"tsd": {
"directory": "types"
},
"devDependencies": {
"@types/node": "^20.1.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"eslint": "^8.21.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-promise": "^6.0.0",
"fastify-tsconfig": "^1.0.1",
"rimraf": "^5.0.5",
"@fastify/pre-commit": "^2.1.0",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.2.0",
"fastify": "^5.0.0-alpha.3",
"fastify-tsconfig": "^2.0.0",
"json-schema-to-ts": "^3.1.0",
"rimraf": "^5.0.7",
"tsd": "^0.31.0",
"typescript": "^5.0.2"
"typescript": "^5.4.5"
}
}
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "fastify-tsconfig",
"exclude": ["./node_modules", "types/**/*.test-d.ts"]
"compilerOptions": {
"declaration": true
},
"exclude": ["node_modules/", "types/**/*.test-d.ts"]
}

0 comments on commit 1e15b24

Please sign in to comment.