Skip to content

Commit 46bc687

Browse files
authored
Merge pull request #4 from block65/feat/v5
feat!: v5, publish raw TypeScript, target node 24
2 parents 1c7f624 + 23ebec6 commit 46bc687

33 files changed

+959
-3797
lines changed

.eslintignore

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

.github/workflows/deploy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ on:
88
jobs:
99
publish-npm:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
attestations: write
1115
steps:
1216
- uses: actions/checkout@v4
1317

1418
- uses: pnpm/action-setup@v4
1519

1620
- uses: actions/setup-node@v4
1721
with:
22+
node-version: 24
1823
registry-url: https://registry.npmjs.org/
1924
cache: 'pnpm'
20-
node-version-file: .node-version
2125

2226
- run: make
2327

24-
- run: pnpm publish --access=public --no-git-checks
25-
env:
26-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
28+
- run: pnpm publish --access=public --no-git-checks --provenance

.github/workflows/pr.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
version: [24]
12+
os: [ubuntu-latest]
13+
14+
runs-on: ${{ matrix.os }}
15+
1016
steps:
1117
- uses: actions/checkout@v4
1218

1319
- uses: pnpm/action-setup@v4
1420

1521
- uses: actions/setup-node@v4
1622
with:
17-
registry-url: https://registry.npmjs.org/
23+
node-version: ${{ matrix.version }}
1824
cache: 'pnpm'
19-
node-version-file: .node-version
2025

2126
- run: make test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules
22
dist
33
coverage
44
tmp
5+
.vscode
6+
tsconfig.tsbuildinfo

Makefile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11

22
SRCS = $(wildcard lib/**)
33

4-
all: dist
5-
6-
.PHONY: clean
7-
clean: node_modules
8-
pnpm exec tsc -b --clean
4+
all: node_modules
5+
pnpm exec tsc
96

107
.PHONY: test
118
test: node_modules
@@ -14,15 +11,3 @@ test: node_modules
1411

1512
node_modules: package.json
1613
pnpm install
17-
18-
dist: node_modules tsconfig.json $(SRCS)
19-
pnpm exec tsc
20-
21-
.PHONY: dist-watch
22-
dist-watch: node_modules
23-
pnpm exec tsc -w --preserveWatchOutput
24-
25-
.PHONY: pretty
26-
pretty: node_modules
27-
pnpm exec eslint --fix . || true
28-
pnpm exec prettier --write .

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
SecurityScheme,
1818
Server,
1919
Tag,
20-
HttpMethods,
2120
} from '@block65/openapi-constructs';
2221

2322
const api = new Api({
@@ -135,7 +134,7 @@ new Path(api, {
135134
path: '/users',
136135
tags: new Set([userTag]),
137136
})
138-
.addOperation(HttpMethods.GET, {
137+
.addOperation("GET", {
139138
operationId: 'listUsersCommand',
140139
responses: {
141140
200: new Response(api, 'ListUsersResponse', {
@@ -147,7 +146,7 @@ new Path(api, {
147146
}),
148147
},
149148
})
150-
.addOperation(HttpMethods.POST, {
149+
.addOperation("POST", {
151150
operationId: 'createUserCommand',
152151
requestBody: {
153152
content: {
@@ -170,7 +169,7 @@ new Path(api, {
170169
path: '/users/{userId}',
171170
parameters: [userIdParameter],
172171
})
173-
.addOperation(HttpMethods.GET, {
172+
.addOperation("GET", {
174173
operationId: 'getUserByIdCommand',
175174
responses: {
176175
200: new Response(api, 'GetUserById', {
@@ -182,15 +181,15 @@ new Path(api, {
182181
}),
183182
},
184183
})
185-
.addOperation(HttpMethods.DELETE, {
184+
.addOperation("DELETE", {
186185
operationId: 'deleteUserByIdCommand',
187186
security: userDeleteScopeReq,
188187
})
189-
.addOperation(HttpMethods.HEAD, {
188+
.addOperation("HEAD", {
190189
operationId: 'checkUserIdAvailableCommand',
191190
security: noSecurityRequirement,
192191
})
193-
.addOperation(HttpMethods.POST, {
192+
.addOperation("POST", {
194193
operationId: 'updateUserCommand',
195194
requestBody: {
196195
content: {

__tests__/__snapshots__/json-schema.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports[`Example > JSON Schema snapshot 1`] = `
1515
},
1616
},
1717
"required": [
18-
"name",
18+
"postcode",
1919
],
2020
"type": "object",
2121
},
@@ -123,7 +123,7 @@ exports[`Note Taking > JSON Schema snapshot 1`] = `
123123
},
124124
},
125125
"required": [
126-
"name",
126+
"postcode",
127127
],
128128
"type": "object",
129129
},

__tests__/__snapshots__/openapi-schema.test.ts.snap

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exports[`Example > OpenAPI 1`] = `
2525
},
2626
},
2727
"required": [
28-
"name",
28+
"postcode",
2929
],
3030
"type": "object",
3131
},
@@ -303,7 +303,7 @@ exports[`Example > Swagger Parser validate 1`] = `
303303
},
304304
},
305305
"required": [
306-
"name",
306+
"postcode",
307307
],
308308
"type": "object",
309309
},
@@ -321,7 +321,7 @@ exports[`Example > Swagger Parser validate 1`] = `
321321
},
322322
},
323323
"required": [
324-
"name",
324+
"postcode",
325325
],
326326
"type": "object",
327327
},
@@ -367,7 +367,7 @@ exports[`Example > Swagger Parser validate 1`] = `
367367
},
368368
},
369369
"required": [
370-
"name",
370+
"postcode",
371371
],
372372
"type": "object",
373373
},
@@ -393,7 +393,7 @@ exports[`Example > Swagger Parser validate 1`] = `
393393
},
394394
},
395395
"required": [
396-
"name",
396+
"postcode",
397397
],
398398
"type": "object",
399399
},
@@ -436,7 +436,7 @@ exports[`Example > Swagger Parser validate 1`] = `
436436
},
437437
},
438438
"required": [
439-
"name",
439+
"postcode",
440440
],
441441
"type": "object",
442442
},
@@ -504,7 +504,7 @@ exports[`Example > Swagger Parser validate 1`] = `
504504
},
505505
},
506506
"required": [
507-
"name",
507+
"postcode",
508508
],
509509
"type": "object",
510510
},
@@ -563,7 +563,7 @@ exports[`Example > Swagger Parser validate 1`] = `
563563
},
564564
},
565565
"required": [
566-
"name",
566+
"postcode",
567567
],
568568
"type": "object",
569569
},
@@ -615,7 +615,7 @@ exports[`Example > Swagger Parser validate 1`] = `
615615
},
616616
},
617617
"required": [
618-
"name",
618+
"postcode",
619619
],
620620
"type": "object",
621621
},
@@ -692,7 +692,7 @@ exports[`Example > Swagger Parser validate 1`] = `
692692
},
693693
},
694694
"required": [
695-
"name",
695+
"postcode",
696696
],
697697
"type": "object",
698698
},
@@ -764,7 +764,7 @@ exports[`Example > Swagger Parser validate 1`] = `
764764
},
765765
},
766766
"required": [
767-
"name",
767+
"postcode",
768768
],
769769
"type": "object",
770770
},
@@ -799,7 +799,7 @@ exports[`Example > Swagger Parser validate 1`] = `
799799
},
800800
},
801801
"required": [
802-
"name",
802+
"postcode",
803803
],
804804
"type": "object",
805805
},
@@ -904,7 +904,7 @@ exports[`Note Taking > OpenAPI 1`] = `
904904
},
905905
},
906906
"required": [
907-
"name",
907+
"postcode",
908908
],
909909
"type": "object",
910910
},
@@ -1397,7 +1397,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
13971397
},
13981398
},
13991399
"required": [
1400-
"name",
1400+
"postcode",
14011401
],
14021402
"type": "object",
14031403
},
@@ -1439,7 +1439,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
14391439
},
14401440
},
14411441
"required": [
1442-
"name",
1442+
"postcode",
14431443
],
14441444
"type": "object",
14451445
},
@@ -1555,7 +1555,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
15551555
},
15561556
},
15571557
"required": [
1558-
"name",
1558+
"postcode",
15591559
],
15601560
"type": "object",
15611561
},
@@ -1581,7 +1581,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
15811581
},
15821582
},
15831583
"required": [
1584-
"name",
1584+
"postcode",
15851585
],
15861586
"type": "object",
15871587
},
@@ -1619,7 +1619,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
16191619
},
16201620
},
16211621
"required": [
1622-
"name",
1622+
"postcode",
16231623
],
16241624
"type": "object",
16251625
},
@@ -1682,7 +1682,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
16821682
},
16831683
},
16841684
"required": [
1685-
"name",
1685+
"postcode",
16861686
],
16871687
"type": "object",
16881688
},
@@ -1736,7 +1736,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
17361736
},
17371737
},
17381738
"required": [
1739-
"name",
1739+
"postcode",
17401740
],
17411741
"type": "object",
17421742
},
@@ -1783,7 +1783,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
17831783
},
17841784
},
17851785
"required": [
1786-
"name",
1786+
"postcode",
17871787
],
17881788
"type": "object",
17891789
},
@@ -1851,7 +1851,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
18511851
},
18521852
},
18531853
"required": [
1854-
"name",
1854+
"postcode",
18551855
],
18561856
"type": "object",
18571857
},
@@ -1930,7 +1930,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
19301930
},
19311931
},
19321932
"required": [
1933-
"name",
1933+
"postcode",
19341934
],
19351935
"type": "object",
19361936
},
@@ -1965,7 +1965,7 @@ exports[`Note Taking > Swagger Parser validate 1`] = `
19651965
},
19661966
},
19671967
"required": [
1968-
"name",
1968+
"postcode",
19691969
],
19701970
"type": "object",
19711971
},

0 commit comments

Comments
 (0)