Skip to content

Commit 5ed3c5f

Browse files
authored
Merge pull request #11 from block65/feat/v9
feat!: v9, publish raw TypeScript, target node 24
2 parents 32e5819 + 022454a commit 5ed3c5f

45 files changed

Lines changed: 127412 additions & 28567 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +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
23+
registry-url: https://registry.npmjs.org/
1824
cache: 'pnpm'
19-
registry-url: 'https://registry.npmjs.org'
2025

2126
- run: make
2227

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

.github/workflows/pr.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-latest
109
strategy:
1110
matrix:
12-
node-version: [20, 22]
11+
version: [24]
12+
os: [ubuntu-latest]
13+
14+
runs-on: ${{ matrix.os }}
15+
1316
steps:
1417
- uses: actions/checkout@v4
1518

1619
- uses: pnpm/action-setup@v4
1720

1821
- uses: actions/setup-node@v4
1922
with:
20-
node-version: ${{ matrix.node-version }}
23+
node-version: ${{ matrix.version }}
2124
cache: 'pnpm'
22-
registry-url: 'https://registry.npmjs.org'
2325

2426
- run: make test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
dist
33
coverage
4+
tmp/
5+
.vscode/

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
24

Makefile

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,44 @@
11

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

4-
all: dist
4+
all: typecheck
55

66
.PHONY: deps
77
deps: node_modules
88

9-
.PHONY: clean
10-
clean:
11-
pnpm exec tsc -b --clean
12-
rm -rf dist
13-
rm -rf __tests__/dist
14-
rm __tests__/fixtures/*/*.ts
9+
.PHONY: distclean
10+
distclean:
11+
rm -rf node_modules
12+
13+
.PHONY: typecheck
14+
typecheck: node_modules tsconfig.json $(SRCS)
15+
pnpm exec tsc
1516

1617
.PHONY: test
1718
test: node_modules
18-
pnpm exec tsc -b
19+
pnpm exec tsc
1920
pnpm exec vitest
2021

2122
node_modules: package.json
2223
pnpm install
2324

24-
dist: node_modules tsconfig.json $(SRCS)
25-
pnpm exec tsc
26-
27-
.PHONY: dev
28-
dev:
29-
pnpm tsc -b -w
30-
3125
.PHONY: fixtures
32-
fixtures: dist
33-
$(MAKE) petstore test1 openai
26+
fixtures:
27+
$(MAKE) petstore test1 openai docker
3428

3529
.PHONY: petstore
36-
petstore: __tests__/fixtures/petstore.json dist
37-
node --enable-source-maps dist/bin/index.js \
30+
petstore: __tests__/fixtures/petstore.json
31+
node --enable-source-maps bin/index.ts \
3832
-i $< \
3933
-o __tests__/fixtures/petstore
40-
pnpm exec prettier --write __tests__/fixtures/petstore
34+
pnpm exec biome check --unsafe --write __tests__/fixtures/petstore
4135

4236
.PHONY: test1
43-
test1: __tests__/fixtures/test1.json dist
44-
node --enable-source-maps dist/bin/index.js \
37+
test1: __tests__/fixtures/test1.json
38+
node --enable-source-maps bin/index.ts \
4539
-i $< \
4640
-o __tests__/fixtures/test1
47-
pnpm exec prettier --write __tests__/fixtures/test1
41+
pnpm exec biome check --unsafe --write __tests__/fixtures/test1
4842

4943

5044
__tests__/fixtures/openai.json: __tests__/fixtures/openai.yaml
@@ -55,20 +49,20 @@ __tests__/fixtures/openai.yaml: __tests__/fixtures/openai.yaml
5549
curl https://raw.githubusercontent.com/openai/openai-openapi/refs/heads/master/openapi.yaml --output $@
5650

5751
.PHONY: openai
58-
openai: __tests__/fixtures/openai.json dist
59-
node --enable-source-maps dist/bin/index.js \
52+
openai: __tests__/fixtures/openai.json
53+
node --enable-source-maps bin/index.ts \
6054
-i $< \
6155
-o __tests__/fixtures/openai
62-
pnpm exec prettier --write __tests__/fixtures/openai
56+
pnpm exec biome check --unsafe --write __tests__/fixtures/openai
6357

64-
# .PHONY: cloudflare
65-
# cloudflare: __tests__/fixtures/cloudflare/openapi.json dist
66-
# node --enable-source-maps dist/bin/index.js \
67-
# -i __tests__/fixtures/cloudflare/openapi.json \
68-
# -o __tests__/fixtures/cloudflare
69-
# pnpm prettier --write __tests__/fixtures/cloudflare
58+
.PHONY: docker
59+
docker: __tests__/fixtures/docker.json
60+
node --enable-source-maps bin/index.ts \
61+
-i $< \
62+
-o __tests__/fixtures/docker
63+
pnpm exec biome check --unsafe --write __tests__/fixtures/docker
7064

7165
.PHONY: pretty
7266
pretty: node_modules
7367
pnpm exec eslint --fix . || true
74-
pnpm exec prettier --write .
68+
pnpm exec biome check --unsafe --write .

0 commit comments

Comments
 (0)