Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: use openapi-typescript@7 #68

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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
905 changes: 554 additions & 351 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"deep-equal": "^2.0.5",
"github-enterprise-server-versions": "^2.0.1",
"lodash": "^4.17.21",
"openapi-typescript": "^6.2.1",
"openapi-typescript": "^7.0.0",
"prettier": "^3.0.0",
"semantic-release-plugin-update-version-in-files": "^1.1.0"
},
Expand Down
10,549 changes: 6,635 additions & 3,914 deletions packages/openapi-webhooks-types-ghec/types.d.ts

Large diffs are not rendered by default.

9,035 changes: 5,699 additions & 3,336 deletions packages/openapi-webhooks-types-ghes-3.10/types.d.ts

Large diffs are not rendered by default.

9,225 changes: 5,824 additions & 3,401 deletions packages/openapi-webhooks-types-ghes-3.11/types.d.ts

Large diffs are not rendered by default.

9,263 changes: 5,851 additions & 3,412 deletions packages/openapi-webhooks-types-ghes-3.12/types.d.ts

Large diffs are not rendered by default.

9,300 changes: 5,875 additions & 3,425 deletions packages/openapi-webhooks-types-ghes-3.13/types.d.ts

Large diffs are not rendered by default.

9,538 changes: 6,014 additions & 3,524 deletions packages/openapi-webhooks-types-ghes-3.14/types.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/openapi-webhooks-types-github.ae/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Generated TypeScript definitions based on GitHub's OpenAPI spec for github.ae",
"repository": {
"type": "git",
"url": "https://github.com/octokit/openapi-webhooks.git",
"url": "git+https://github.com/octokit/openapi-webhooks.git",
"directory": "packages/openapi-webhooks-types-github.ae"
},
"publishConfig": {
Expand Down
8,215 changes: 5,197 additions & 3,018 deletions packages/openapi-webhooks-types-github.ae/types.d.ts

Large diffs are not rendered by default.

10,127 changes: 6,380 additions & 3,747 deletions packages/openapi-webhooks-types/types.d.ts

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions scripts/generate-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { readdir, mkdir, rm, writeFile, copyFile } from "node:fs/promises";
import { basename } from "node:path";

import * as prettier from "prettier";
import openapiTS from "openapi-typescript";
import openapiTS, { astToString, COMMENT_HEADER } from "openapi-typescript";
import { pathToFileURL } from "node:url";

/* (!process.env.OCTOKIT_OPENAPI_VERSION) {
throw new Error("OCTOKIT_OPENAPI_VERSION is not set");
Expand Down Expand Up @@ -88,7 +89,13 @@ type Repository = components["schemas"]["full-repository"]
await writeFile(
`packages/${packageName}/types.d.ts`,
await prettier.format(
await openapiTS(`packages/openapi-webhooks/generated/${name}.json`),
COMMENT_HEADER +
astToString(
await openapiTS(
pathToFileURL(`packages/openapi-webhooks/generated/${name}.json`),
{ defaultNonNullable: false },
),
),
{
parser: "typescript",
},
Expand Down