Skip to content

Commit 1860fc7

Browse files
authored
Merge pull request #1 from maxholman/oai31
OpenAPI 3.1 output
2 parents 7e2cf0f + 29f9266 commit 1860fc7

35 files changed

+8062
-5847
lines changed

.eslintrc.cjs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
/** @type {import('eslint').Linter.Config} */
12
module.exports = {
23
root: true,
3-
extends: ['@block65/eslint-config', '@block65/eslint-config/javascript'],
4+
extends: [
5+
'@block65/eslint-config/javascript',
6+
'@block65/eslint-config/typescript',
7+
],
48
parserOptions: {
5-
project: true,
9+
project: ['./tsconfig.json'],
610
},
11+
12+
overrides: [
13+
{
14+
files: ['**/*.test.ts', '**/*.test.tsx', '**/test/*.ts'],
15+
rules: {
16+
'@typescript-eslint/no-import-type-side-effects': 'error',
17+
'@typescript-eslint/consistent-type-imports': 'off',
18+
'import/no-extraneous-dependencies': 'off',
19+
},
20+
},
21+
22+
{
23+
files: ['*.config.js', '*.config.ts', '*.workspace.ts'],
24+
rules: {
25+
'import/no-extraneous-dependencies': 'off',
26+
},
27+
},
28+
],
729
};

.github/workflows/deploy.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ jobs:
99
publish-npm:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- uses: pnpm/action-setup@v2
14-
with:
15-
version: 7
16-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v4
13+
14+
- uses: pnpm/action-setup@v4
15+
16+
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 20
1918
registry-url: https://registry.npmjs.org/
2019
cache: 'pnpm'
20+
node-version-file: .node-version
21+
2122
- run: make
23+
2224
- run: pnpm publish --access=public --no-git-checks
2325
env:
2426
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/pr.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ jobs:
88
test:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
12-
- uses: pnpm/action-setup@v2
13-
with:
14-
version: 7
15-
- uses: actions/setup-node@v3
11+
- uses: actions/checkout@v4
12+
13+
- uses: pnpm/action-setup@v4
14+
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 20
1817
registry-url: https://registry.npmjs.org/
1918
cache: 'pnpm'
19+
node-version-file: .node-version
20+
2021
- run: make test

Makefile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@ SRCS = $(wildcard lib/**)
33

44
all: dist
55

6-
.PHONY: deps
7-
deps: node_modules
8-
96
.PHONY: clean
10-
clean:
11-
pnpm tsc -b --clean
7+
clean: node_modules
8+
pnpm exec tsc -b --clean
129

1310
.PHONY: test
14-
test:
15-
pnpm tsc
16-
NODE_OPTIONS=--experimental-vm-modules pnpm jest
11+
test: node_modules
12+
pnpm exec tsc
13+
pnpm exec vitest
1714

1815
node_modules: package.json
1916
pnpm install
2017

2118
dist: node_modules tsconfig.json $(SRCS)
22-
pnpm tsc
19+
pnpm exec tsc
2320

2421
.PHONY: dist-watch
25-
dist-watch:
26-
pnpm tsc -w --preserveWatchOutput
22+
dist-watch: node_modules
23+
pnpm exec tsc -w --preserveWatchOutput
2724

2825
.PHONY: pretty
2926
pretty: node_modules
30-
pnpm eslint --fix .
31-
pnpm prettier --write .
27+
pnpm exec eslint --fix . || true
28+
pnpm exec prettier --write .
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`Synth > JSON Schema snapshot 1`] = `
4+
{
5+
"$schema": "http://json-schema.org/draft-07/schema#",
6+
"definitions": {
7+
"Address": {
8+
"additionalProperties": false,
9+
"properties": {
10+
"postcode": {
11+
"format": "int32",
12+
"maximum": 9999,
13+
"minimum": 1000,
14+
"type": "integer",
15+
},
16+
},
17+
"required": [
18+
"name",
19+
],
20+
"type": "object",
21+
},
22+
"Id": {
23+
"type": "string",
24+
},
25+
"UpdateUserRequest": {
26+
"additionalProperties": false,
27+
"minProperties": 1,
28+
"properties": {
29+
"address": {
30+
"$ref": "#/components/schemas/Address",
31+
},
32+
"age": {
33+
"format": "int32",
34+
"minimum": 0,
35+
"type": "integer",
36+
},
37+
},
38+
"type": "object",
39+
},
40+
"User": {
41+
"additionalProperties": false,
42+
"properties": {
43+
"address": {
44+
"$ref": "#/components/schemas/Address",
45+
},
46+
"age": {
47+
"format": "int32",
48+
"minimum": 0,
49+
"type": "integer",
50+
},
51+
"name": {
52+
"type": "string",
53+
},
54+
"userId": {
55+
"$ref": "#/components/schemas/Id",
56+
},
57+
},
58+
"required": [
59+
"name",
60+
],
61+
"type": "object",
62+
},
63+
"Users": {
64+
"items": {
65+
"$ref": "#/components/schemas/User",
66+
},
67+
"type": "array",
68+
"uniqueItems": true,
69+
},
70+
},
71+
}
72+
`;

0 commit comments

Comments
 (0)