Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": false
},
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"root": true,
"files": {
"ignore": ["**/dist/**", "**/package.json"]
"includes": ["**", "!**/dist", "!**/package.json"]
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"formatter": {
"indentStyle": "space",
Expand All @@ -20,7 +26,7 @@
"useArrowFunction": "off"
},
"suspicious": {
"noConsoleLog": "error",
"noConsole": "error",
"noExplicitAny": "off"
},
"style": {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/contributors.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"update-contributors": "node scripts/update-contributors.js"
},
"devDependencies": {
"@shikijs/vitepress-twoslash": "^3.3.0",
"@shikijs/vitepress-twoslash": "^3.12.2",
"openapi-metadata": "workspace:*",
"vite": "^7.1.1",
"vite": "catalog:",
"vitepress": "^1.6.4"
}
}
12 changes: 7 additions & 5 deletions docs/scripts/update-contributors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from "node:fs";
import fs from "node:fs/promises";
import { URL } from "node:url";

const MAINTAINERS = {
Expand Down Expand Up @@ -199,7 +199,7 @@ const ONE_WEEK = 1000 * 60 * 60 * 24;

const CONTRIBUTORS_JSON = new URL("../data/contributors.json", import.meta.url);

const data = JSON.parse(fs.readFileSync(CONTRIBUTORS_JSON, "utf8"));
const data = JSON.parse(await fs.readFile(CONTRIBUTORS_JSON, "utf8"));

class UserFetchError extends Error {
/**
Expand Down Expand Up @@ -252,7 +252,7 @@ async function main() {
// skip profiles that have been updated within the past week
const { lastFetch } = data[group]?.find((u) => u.username === username) ?? { lastFetch: 0 };
if (Date.now() - lastFetch < ONE_WEEK) {
// biome-ignore lint/suspicious/noConsoleLog: this is a script
// biome-ignore lint/suspicious/noConsole: this is a script
console.log(`[${i}/${CONTRIBUTORS.size}] (Skipped ${username})`);
continue;
}
Expand All @@ -267,11 +267,13 @@ async function main() {
lastFetch: new Date().getTime(),
};
upsert(data[group], userData);
// biome-ignore lint/suspicious/noConsoleLog: this is a script
// biome-ignore lint/suspicious/noConsole: this is a script
console.log(`[${i}/${CONTRIBUTORS.size}] Updated for ${username}`);
fs.writeFileSync(new URL("../data/contributors.json", import.meta.url), JSON.stringify(data)); // update file while fetching (sync happens safely in between fetches)
await fs.writeFile(new URL("../data/contributors.json", import.meta.url), JSON.stringify(data)); // update file while fetching (sync happens safely in between fetches)
await new Promise((resolve) => setTimeout(resolve, 1_000)); // GitHub 403s with too many rapid requests.
} catch (err) {
if (err instanceof UserFetchError && err.notFound) {
// biome-ignore lint/suspicious/noConsole: this is a script
console.warn(`[${i}/${total}] (Skipped ${username}, not found)`);
continue;
}
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Drew Powers",
"email": "[email protected]"
},
"packageManager": "pnpm@10.14.0",
"packageManager": "pnpm@10.16.1",
"scripts": {
"build": "turbo run build",
"lint": "turbo run lint",
Expand All @@ -20,17 +20,17 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@biomejs/biome": "^1.9.4",
"@biomejs/biome": "^2.2.4",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@playwright/test": "^1.54.2",
"@changesets/cli": "^2.29.7",
"@playwright/test": "^1.55.0",
"@size-limit/preset-small-lib": "^11.2.0",
"@types/node": "^22.17.1",
"@types/node": "^22.18.3",
"prettier": "^3.6.2",
"size-limit": "^11.2.0",
"turbo": "^2.5.5",
"typescript": "^5.9.2",
"unbuild": "^3.6.0",
"turbo": "^2.5.6",
"typescript": "catalog:",
"unbuild": "^3.6.1",
"vitest": "^3.2.4"
},
"size-limit": [
Expand Down
8 changes: 4 additions & 4 deletions packages/openapi-fetch/biome.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"extends": ["../../biome.json"],
"root": false,
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"extends": "//",
"files": {
"include": ["./src/", "./test/"],
"ignore": ["./test/**/schemas/**", "./test/bench/*.min.js"]
"includes": ["src/**", "test/**", "!**/examples/**", "!test/**/schemas/**", "!test/bench/**/*.min.js"]
},
"linter": {
"rules": {
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi-fetch/examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"dev": "next dev"
},
"dependencies": {
"next": "^15.3.1",
"next": "^15.5.3",
"openapi-fetch": "workspace:^",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.20",
"@types/react": "^18.3.24",
"@types/react-dom": "^18.3.7",
"openapi-typescript": "workspace:^",
"typescript": "^5.9.2"
"typescript": "catalog:"
}
}
14 changes: 7 additions & 7 deletions packages/openapi-fetch/examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^6.0.1",
"@sveltejs/kit": "^2.22.2",
"@sveltejs/vite-plugin-svelte": "^5.1.0",
"@sveltejs/adapter-auto": "^6.1.0",
"@sveltejs/kit": "^2.39.1",
"@sveltejs/vite-plugin-svelte": "^5.1.1",
"openapi-fetch": "workspace:^",
"openapi-typescript": "workspace:^",
"svelte": "^5.34.9",
"svelte-check": "^4.2.2",
"typescript": "^5.9.2",
"vite": "^7.1.1"
"svelte": "^5.38.10",
"svelte-check": "^4.3.1",
"typescript": "catalog:",
"vite": "catalog:"
},
"pnpm": {
"onlyBuiltDependencies": [
Expand Down
12 changes: 6 additions & 6 deletions packages/openapi-fetch/examples/vue-3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
},
"dependencies": {
"openapi-fetch": "workspace:^",
"vue": "^3.5.13"
"vue": "^3.5.21"
},
"devDependencies": {
"@tsconfig/node20": "^20.1.5",
"@vitejs/plugin-vue": "^5.2.3",
"@tsconfig/node20": "^20.1.6",
"@vitejs/plugin-vue": "^5.2.4",
"@vue/tsconfig": "^0.5.1",
"openapi-typescript": "workspace:^",
"typescript": "^5.9.2",
"vite": "^7.1.1",
"vue-tsc": "^2.2.10"
"typescript": "catalog:",
"vite": "catalog:",
"vue-tsc": "^2.2.12"
}
}
10 changes: 5 additions & 5 deletions packages/openapi-fetch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@
"openapi-typescript-helpers": "workspace:^"
},
"devDependencies": {
"axios": "^1.11.0",
"execa": "^9.6.0",
"axios": "^1.12.2",
"execa": "catalog:",
"express": "^5.1.0",
"feature-fetch": "^0.0.43",
"node-forge": "^1.3.1",
"openapi-typescript": "workspace:^",
"openapi-typescript-codegen": "^0.29.0",
"openapi-typescript-fetch": "^2.2.1",
"superagent": "^10.2.3",
"typescript": "^5.9.2",
"undici": "^7.13.0",
"vite": "^7.1.1"
"typescript": "catalog:",
"undici": "^7.16.0",
"vite": "catalog:"
}
}
4 changes: 0 additions & 4 deletions packages/openapi-fetch/test-results/.last-run.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/bench/index.bench.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
import { Fetcher } from "openapi-typescript-fetch";
import { createApiFetchClient } from "feature-fetch";
import { Fetcher } from "openapi-typescript-fetch";
import superagent from "superagent";
import { afterAll, bench, describe, vi } from "vitest";
import createClient, { createPathBasedClient } from "../../dist/index.mjs";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import express from "express";
import { expect, test } from "vitest";
import * as crypto from "node:crypto";
import * as https from "node:https";
import express from "express";
import * as forge from "node-forge";
import { Agent } from "undici";
import { expect, test } from "vitest";
import createClient from "../../src/index.js";
import * as forge from "node-forge";
import * as crypto from "node:crypto";

const pki = forge.pki;

Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/common/create-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test } from "vitest";
import { createObservedClient } from "../helpers.js";
import type { FetchOptions, HeadersOptions } from "../../src/index.js";
import { createObservedClient } from "../helpers.js";
import type { paths } from "./schemas/common.js";

describe("createClient options", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/common/params.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertType, describe, expect, test } from "vitest";
import { createObservedClient } from "../helpers.js";
import type { QuerySerializerOptions } from "../../src/index.js";
import { createObservedClient } from "../helpers.js";
import type { components, paths } from "./schemas/common.js";

type Resource = components["schemas"]["Resource"];
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/common/request.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { createObservedClient, headersToObj } from "../helpers.js";
import createClient, { type BodySerializer, type FetchOptions } from "../../src/index.js";
import { createObservedClient, headersToObj } from "../helpers.js";
import type { components, paths } from "./schemas/common.js";

type Resource = components["schemas"]["Resource"];
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/common/response.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertType, describe, expect, expectTypeOf, test } from "vitest";
import { createObservedClient } from "../helpers.js";
import type { MethodResponse } from "../../src/index.js";
import { createObservedClient } from "../helpers.js";
import type { components, paths } from "./schemas/common.js";

type Resource = components["schemas"]["Resource"];
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/http-methods/delete.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, test, assertType } from "vitest";
import { assertType, describe, expect, test } from "vitest";
import { createObservedClient } from "../helpers.js";
import type { paths } from "./schemas/delete.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/openapi-fetch/test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assertType, describe, test } from "vitest";
import type { ErrorResponse, GetResponseContent, OkStatus, SuccessResponse } from "openapi-typescript-helpers";
import { assertType, describe, test } from "vitest";

describe("types", () => {
describe("GetResponseContent", () => {
Expand Down
7 changes: 4 additions & 3 deletions packages/openapi-metadata/biome.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"extends": ["../../biome.json"],
"root": false,
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
"extends": "//",
"files": {
"ignore": ["./example/", "./coverage/"]
"includes": ["**", "!dist", "!example/", "!coverage/"]
},
"linter": {
"rules": {
Expand Down
10 changes: 5 additions & 5 deletions packages/openapi-metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@
"dependencies": {
"deepmerge": "^4.3.1",
"openapi-types": "^12.1.3",
"type-fest": "^4.40.1"
"type-fest": "^4.41.0"
},
"peerDependencies": {
"reflect-metadata": "^0.2.2"
},
"devDependencies": {
"@types/node": "^22.15.3",
"@vitest/coverage-v8": "^3.1.3",
"@types/node": "^22.18.3",
"@vitest/coverage-v8": "^3.2.4",
"reflect-metadata": "^0.2.2",
"typescript": "^5.9.2",
"unplugin-swc": "^1.5.2"
"typescript": "catalog:",
"unplugin-swc": "^1.5.7"
}
}
4 changes: 2 additions & 2 deletions packages/openapi-metadata/src/decorators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export { ApiProperty, ApiPropertyOptional } from "./api-property.js";
export { ApiQuery } from "./api-query.js";
export { ApiResponse } from "./api-response.js";
export {
ApiSecurity,
ApiBasicAuth,
ApiOauth2,
ApiBearerAuth,
ApiCookieAuth,
ApiOauth2,
ApiSecurity,
} from "./api-security.js";
export { ApiTags } from "./api-tags.js";
6 changes: 3 additions & 3 deletions packages/openapi-metadata/src/generators/document.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import deepmerge from "deepmerge";
import type { OpenAPIV3 } from "openapi-types";
import type { OpenAPIDocument, TypeLoaderFn } from "../index.js";
import type { Logger } from "../types.js";
import type { SetOptional } from "type-fest";
import { Context } from "../context.js";
import type { OpenAPIDocument, TypeLoaderFn } from "../index.js";
import type { Logger } from "../types.js";
import { generatePaths } from "./paths.js";
import deepmerge from "deepmerge";

export type GenerateDocumentOptions = {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { OpenAPIV3 } from "openapi-types";
import type { Context } from "../context.js";
import type { OperationBodyMetadata } from "../metadata/operation-body.js";
import { loadType } from "../loaders/type.js";
import type { OperationBodyMetadata } from "../metadata/operation-body.js";

export async function generateOperationBody(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { OpenAPIV3 } from "openapi-types";
import type { Context } from "../context.js";
import type { OperationParameterMetadata } from "../metadata/operation-parameter.js";
import { loadType } from "../loaders/type.js";
import type { OperationParameterMetadata } from "../metadata/operation-parameter.js";

export async function generateOperationParameters(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { OpenAPIV3 } from "openapi-types";
import type { Context } from "../context.js";
import type { OperationResponseMetadata } from "../metadata/operation-response.js";
import { loadType } from "../loaders/type.js";
import type { OperationResponseMetadata } from "../metadata/operation-response.js";

export async function generateOperationResponse(
context: Context,
Expand Down
6 changes: 3 additions & 3 deletions packages/openapi-metadata/src/generators/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { OpenAPIV3 } from "openapi-types";
import type { Context } from "../context.js";
import type { OperationMetadata } from "../metadata/operation.js";
import { OperationBodyMetadataStorage } from "../metadata/operation-body.js";
import { generateOperationBody } from "./operation-body.js";
import { OperationParameterMetadataStorage } from "../metadata/operation-parameter.js";
import { generateOperationParameters } from "./operation-parameters.js";
import { OperationResponseMetadataStorage } from "../metadata/operation-response.js";
import { generateOperationResponse } from "./operation-response.js";
import { OperationSecurityMetadataStorage } from "../metadata/operation-security.js";
import { generateOperationBody } from "./operation-body.js";
import { generateOperationParameters } from "./operation-parameters.js";
import { generateOperationResponse } from "./operation-response.js";

export async function generateOperation(
context: Context,
Expand Down
Loading
Loading