Skip to content

Commit cd974c6

Browse files
committed
Fix dep
1 parent 3937ae2 commit cd974c6

29 files changed

+3849
-2290
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"version": "pnpm run build && changeset version && pnpm i"
2020
},
2121
"devDependencies": {
22+
"@arethetypeswrong/cli": "^0.18.1",
2223
"@biomejs/biome": "^1.9.4",
2324
"@changesets/changelog-github": "^0.5.1",
2425
"@changesets/cli": "^2.29.2",

packages/openapi-fetch/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.turbo
2+
*.config.*
23
examples
34
test
45
test-results
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { defineBuildConfig } from "unbuild";
22

33
export default defineBuildConfig({
4-
entries: ["./src/index.ts"],
4+
entries: ["./src/index.js"],
55
declaration: "compatible",
66
clean: true,
77
sourcemap: true,
88
rollup: {
9+
// Ship CommonJS-compatible bundle
910
emitCJS: true,
1011
},
1112
});

packages/openapi-fetch/examples/vue-3/tsconfig.node.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"composite": true,
1212
"noEmit": true,
1313
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
14-
1514
"module": "ESNext",
1615
"moduleResolution": "Bundler",
1716
"types": ["node"]

packages/openapi-fetch/package.json

+4-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@
88
},
99
"license": "MIT",
1010
"type": "module",
11-
"main": "./dist/index.js",
12-
"module": "./dist/index.js",
13-
"types": "./dist/index.d.ts",
11+
"main": "./dist/index.mjs",
1412
"exports": {
1513
".": {
16-
"import": {
17-
"types": "./dist/index.d.ts",
18-
"default": "./dist/index.js"
19-
},
20-
"require": {
21-
"types": "./dist/cjs/index.d.cts",
22-
"default": "./dist/cjs/index.cjs"
23-
}
14+
"import": "./dist/index.mjs",
15+
"require": "./dist/index.cjs",
16+
"default": "./dist/index.mjs"
2417
},
2518
"./*": "./*"
2619
},

packages/openapi-fetch/test/bench/index.bench.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Fetcher } from "openapi-typescript-fetch";
33
import { createApiFetchClient } from "feature-fetch";
44
import superagent from "superagent";
55
import { afterAll, bench, describe, vi } from "vitest";
6-
import createClient, { createPathBasedClient } from "../../dist/index.js";
6+
import createClient, { createPathBasedClient } from "../../dist/index.mjs";
77
import * as openapiTSCodegen from "./openapi-typescript-codegen.min.js";
88

99
const BASE_URL = "https://api.test.local";

packages/openapi-fetch/test/examples/schemas/github.d.ts

+1,751-603
Large diffs are not rendered by default.

packages/openapi-fetch/test/examples/schemas/stripe.d.ts

+2,033-1,621
Large diffs are not rendered by default.

packages/openapi-metadata/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.turbo
2+
*.config.*
23
test
34
tsconfig*.json
45
vitest.config.ts

packages/openapi-react-query/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.turbo
2+
*.config.*
23
test
34
vitest.config.ts
45
tsconfig*.json

packages/openapi-react-query/build.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default defineBuildConfig({
66
clean: true,
77
sourcemap: true,
88
rollup: {
9+
// Ship CommonJS-compatible bundle
910
emitCJS: true,
1011
},
1112
});

packages/openapi-react-query/package.json

+4-11
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,12 @@
88
},
99
"license": "MIT",
1010
"type": "module",
11-
"main": "./dist/index.js",
12-
"module": "./dist/index.js",
13-
"types": "./dist/index.d.ts",
11+
"main": "./dist/index.mjs",
1412
"exports": {
1513
".": {
16-
"import": {
17-
"types": "./dist/index.d.ts",
18-
"default": "./dist/index.js"
19-
},
20-
"require": {
21-
"types": "./dist/index.d.ts",
22-
"default": "./dist/index.cjs"
23-
}
14+
"import": "./dist/index.mjs",
15+
"require": "./dist/index.cjs",
16+
"default": "./dist/index.mjs"
2417
},
2518
"./*": "./*"
2619
},
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.turbo
2+
*.config.*
23
biome.json
4+
src
35
tsconfig*.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineBuildConfig } from "unbuild";
2+
3+
export default defineBuildConfig({
4+
entries: ["./src/index.ts"],
5+
declaration: "compatible",
6+
clean: true,
7+
sourcemap: true,
8+
rollup: {
9+
// Ship CommonJS-compatible bundle
10+
emitCJS: true,
11+
// Don’t bundle .js files together to more closely match old exports (can remove in next major)
12+
output: { preserveModules: true },
13+
},
14+
});

packages/openapi-typescript-helpers/index.cjs

-4
This file was deleted.

packages/openapi-typescript-helpers/index.js

-4
This file was deleted.

packages/openapi-typescript-helpers/package.json

+9-20
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,15 @@
88
},
99
"license": "MIT",
1010
"type": "module",
11-
"main": "./index.js",
12-
"types": "./index.d.ts",
11+
"main": "./dist/index.mjs",
1312
"exports": {
1413
".": {
15-
"import": {
16-
"types": "./index.d.ts",
17-
"default": "./index.js"
18-
},
19-
"require": {
20-
"types": "./index.d.cts",
21-
"default": "./index.cjs"
22-
}
14+
"import": "./dist/index.mjs",
15+
"require": "./dist/index.cjs",
16+
"default": "./dist/index.mjs"
2317
},
2418
"./*": "./*"
2519
},
26-
"files": [
27-
"index.js",
28-
"index.cjs",
29-
"index.d.ts",
30-
"index.d.cts"
31-
],
3220
"homepage": "https://openapi-ts.dev",
3321
"repository": {
3422
"type": "git",
@@ -39,10 +27,11 @@
3927
"url": "https://github.com/openapi-ts/openapi-typescript/issues"
4028
},
4129
"scripts": {
42-
"build": "cp index.d.ts index.d.cts",
43-
"format": "biome format . --write",
44-
"lint": "biome check .",
45-
"test": "tsc --noEmit"
30+
"build": "unbuild",
31+
"format": "biome format src --write",
32+
"lint": "pnpm run lint:js && pnpm run lint:ts",
33+
"lint:js": "biome check src",
34+
"lint:ts": "tsc --noEmit"
4635
},
4736
"devDependencies": {
4837
"typescript": "^5.8.3"

packages/openapi-typescript-helpers/index.d.ts renamed to packages/openapi-typescript-helpers/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export type SuccessResponse<
122122
Media extends MediaType = MediaType,
123123
> = GetResponseContent<T, Media, OkStatus>;
124124

125-
type GetResponseContent<
125+
export type GetResponseContent<
126126
T extends Record<string | number, any>,
127127
Media extends MediaType = MediaType,
128128
ResponseCode extends keyof T = keyof T,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"rootDir": ".",
54
"skipLibCheck": false
65
},
7-
"include": ["."]
6+
"include": ["src"]
87
}

packages/openapi-typescript/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.turbo
2+
*.config.*
23
examples/
34
scripts/
45
test/

packages/openapi-typescript/bin/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import fs from "node:fs";
55
import path from "node:path";
66
import { performance } from "node:perf_hooks";
77
import parser from "yargs-parser";
8-
import openapiTS, { COMMENT_HEADER, astToString, c, error, formatTime, warn } from "../dist/index.js";
8+
import openapiTS, { COMMENT_HEADER, astToString, c, error, formatTime, warn } from "../dist/index.mjs";
99

1010
const HELP = `Usage
1111
$ openapi-typescript [input] [options]

packages/openapi-typescript/build.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export default defineBuildConfig({
66
clean: true,
77
sourcemap: true,
88
rollup: {
9+
// Ship CommonJS-compatible bundle
910
emitCJS: true,
11+
// Don’t bundle .js files together to more closely match old exports (can remove in next major)
12+
output: { preserveModules: true },
1013
},
1114
});

packages/openapi-typescript/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"main": "./dist/index.mjs",
1515
"exports": {
1616
".": {
17+
"import": "./dist/index.mjs",
1718
"require": "./dist/index.cjs",
1819
"default": "./dist/index.mjs"
1920
},
21+
"./*.js": "./*.mjs",
2022
"./*": "./*"
2123
},
2224
"homepage": "https://openapi-ts.dev",

packages/swr-openapi/.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.turbo
2+
*.config.*
3+
biome.json
4+
tsconfig*.json

packages/swr-openapi/build.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default defineBuildConfig({
66
clean: true,
77
sourcemap: true,
88
rollup: {
9+
// Ship CommonJS-compatible bundle
910
emitCJS: true,
1011
},
1112
});

packages/swr-openapi/package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
},
99
"license": "MIT",
1010
"type": "module",
11-
"main": "dist/index.js",
11+
"main": "./dist/index.mjs",
1212
"exports": {
13-
"import": "./dist/index.js",
14-
"types": "./dist/index.d.ts"
13+
".": {
14+
"import": "./dist/index.mjs",
15+
"require": "./dist/index.cjs",
16+
"default": "./dist/index.mjs"
17+
},
18+
"./package.json": "./package.json"
1519
},
1620
"sideEffects": false,
1721
"repository": {
@@ -72,7 +76,6 @@
7276
"type-fest": "^4.40.1"
7377
},
7478
"devDependencies": {
75-
"@arethetypeswrong/cli": "^0.18.0",
7679
"@types/lodash": "^4.17.16",
7780
"@types/react": "^18.3.20",
7881
"husky": "^9.1.7",

packages/swr-openapi/tsconfig.build.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "dist",
5-
"rootDir": "src",
65
"noEmit": false
76
},
87
"include": ["src"],

packages/swr-openapi/tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"module": "NodeNext",
2121
"moduleResolution": "nodenext",
2222
// "outDir": "dist",
23-
// "rootDir": "src",
2423
"sourceMap": true,
2524

2625
/* AND if you're building for a library: */

pnpm-lock.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)