Skip to content

Commit 0cddbd1

Browse files
authored
Merge pull request #8 from maxholman/qol20241013
QOL updates 2024-10
2 parents f800e88 + e3eaa5d commit 0cddbd1

29 files changed

Lines changed: 47380 additions & 13661 deletions

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@ dist
22
node_modules
33
build
44
tmp
5-
jest.config.js
6-
babel.config.js

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ on:
77
jobs:
88
test:
99
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [20, 22]
1013
steps:
1114
- uses: actions/checkout@v4
1215

1316
- uses: pnpm/action-setup@v4
1417

1518
- uses: actions/setup-node@v4
1619
with:
20+
node-version: ${{ matrix.node-version }}
1721
cache: 'pnpm'
1822
registry-url: 'https://registry.npmjs.org'
1923

Makefile

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,58 @@ deps: node_modules
88

99
.PHONY: clean
1010
clean:
11-
pnpm tsc -b --clean
11+
pnpm exec tsc -b --clean
1212
rm -rf dist
1313
rm -rf __tests__/dist
1414
rm __tests__/fixtures/*/*.ts
1515

1616
.PHONY: test
1717
test: node_modules
18-
pnpm tsc -b
19-
NODE_OPTIONS=--experimental-vm-modules pnpm jest
18+
pnpm exec tsc -b
19+
pnpm exec vitest
2020

2121
node_modules: package.json
2222
pnpm install
2323

2424
dist: node_modules tsconfig.json $(SRCS)
25-
pnpm tsc
25+
pnpm exec tsc
2626

2727
.PHONY: dev
2828
dev:
2929
pnpm tsc -b -w
3030

3131
.PHONY: fixtures
32-
fixtures: dist petstore test1 openai
32+
fixtures: dist
33+
$(MAKE) petstore test1 openai
3334

3435
.PHONY: petstore
3536
petstore: __tests__/fixtures/petstore.json dist
3637
node --enable-source-maps dist/bin/index.js \
3738
-i $< \
3839
-o __tests__/fixtures/petstore
39-
pnpm prettier --write __tests__/fixtures/petstore
40+
pnpm exec prettier --write __tests__/fixtures/petstore
4041

4142
.PHONY: test1
4243
test1: __tests__/fixtures/test1.json dist
4344
node --enable-source-maps dist/bin/index.js \
4445
-i $< \
4546
-o __tests__/fixtures/test1
46-
pnpm prettier --write __tests__/fixtures/test1
47+
pnpm exec prettier --write __tests__/fixtures/test1
4748

48-
.PHONY: openai
49-
openai: __tests__/fixtures/openai.yaml dist
49+
50+
__tests__/fixtures/openai.json: __tests__/fixtures/openai.yaml
5051
mkdir -p $(@D)
51-
pnpm js-yaml $< > $(@D)/openai.json
52+
pnpm exec js-yaml $< > $@
53+
54+
__tests__/fixtures/openai.yaml: __tests__/fixtures/openai.yaml
55+
curl https://raw.githubusercontent.com/openai/openai-openapi/refs/heads/master/openapi.yaml --output $@
56+
57+
.PHONY: openai
58+
openai: __tests__/fixtures/openai.json dist
5259
node --enable-source-maps dist/bin/index.js \
53-
-i $(@D)/openai.json \
60+
-i $< \
5461
-o __tests__/fixtures/openai
55-
pnpm prettier --write __tests__/fixtures/openai
56-
62+
pnpm exec prettier --write __tests__/fixtures/openai
5763

5864
# .PHONY: cloudflare
5965
# cloudflare: __tests__/fixtures/cloudflare/openapi.json dist
@@ -64,5 +70,5 @@ openai: __tests__/fixtures/openai.yaml dist
6470

6571
.PHONY: pretty
6672
pretty: node_modules
67-
pnpm eslint --fix . || true
68-
pnpm prettier --write .
73+
pnpm exec eslint --fix . || true
74+
pnpm exec prettier --write .
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

33
exports[`nullables 1`] = `
4-
"import type { Jsonifiable, Jsonify } from "type-fest";
5-
import type { JsonifiableObject } from "type-fest/source/jsonifiable.js";
6-
7-
export type MySchemaLolOrNullable = "lol" | "kek" | null;
4+
"export type MySchemaLolOrNullable = "lol" | "kek" | null;
85
"
96
`;

__tests__/fixtures/openai.json

Lines changed: 16914 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)