diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2024-02-06 21:03:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-06 21:03:29 +0900 |
| commit | c81b61eb2e4e3a16f0039ebfa9c174ee216ccafb (patch) | |
| tree | 0028f2816557d7b03bf07fab99cb59e460b8ef1e /packages/misskey-js/generator/src/generator.ts | |
| parent | fix(bubble-game): 共有用画像のコメントにnullが入る問題を修... (diff) | |
| download | sharkey-c81b61eb2e4e3a16f0039ebfa9c174ee216ccafb.tar.gz sharkey-c81b61eb2e4e3a16f0039ebfa9c174ee216ccafb.tar.bz2 sharkey-c81b61eb2e4e3a16f0039ebfa9c174ee216ccafb.zip | |
fix(misskey-js): 自動生成物の冒頭からバージョンと日付を削除 (#13185)
Diffstat (limited to 'packages/misskey-js/generator/src/generator.ts')
| -rw-r--r-- | packages/misskey-js/generator/src/generator.ts | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/packages/misskey-js/generator/src/generator.ts b/packages/misskey-js/generator/src/generator.ts index 7e72359167..f091e599a9 100644 --- a/packages/misskey-js/generator/src/generator.ts +++ b/packages/misskey-js/generator/src/generator.ts @@ -4,22 +4,6 @@ import { toPascal } from 'ts-case-convert'; import OpenAPIParser from '@readme/openapi-parser'; import openapiTS from 'openapi-typescript'; -function generateVersionHeaderComment(openApiDocs: OpenAPIV3_1.Document): string { - const contents = { - version: openApiDocs.info.version, - generatedAt: new Date().toISOString(), - }; - - const lines: string[] = []; - lines.push('/*'); - for (const [key, value] of Object.entries(contents)) { - lines.push(` * ${key}: ${value}`); - } - lines.push(' */'); - - return lines.join('\n'); -} - async function generateBaseTypes( openApiDocs: OpenAPIV3_1.Document, openApiJsonPath: string, @@ -36,9 +20,6 @@ async function generateBaseTypes( } lines.push(''); - lines.push(generateVersionHeaderComment(openApiDocs)); - lines.push(''); - const generatedTypes = await openapiTS(openApiJsonPath, { exportType: true }); lines.push(generatedTypes); lines.push(''); @@ -59,8 +40,6 @@ async function generateSchemaEntities( const schemaNames = Object.keys(schemas); const typeAliasLines: string[] = []; - typeAliasLines.push(generateVersionHeaderComment(openApiDocs)); - typeAliasLines.push(''); typeAliasLines.push(`import { components } from '${toImportPath(typeFileName)}';`); typeAliasLines.push( ...schemaNames.map(it => `export type ${it} = components['schemas']['${it}'];`), @@ -119,9 +98,6 @@ async function generateEndpoints( const entitiesOutputLine: string[] = []; - entitiesOutputLine.push(generateVersionHeaderComment(openApiDocs)); - entitiesOutputLine.push(''); - entitiesOutputLine.push(`import { operations } from '${toImportPath(typeFileName)}';`); entitiesOutputLine.push(''); @@ -139,9 +115,6 @@ async function generateEndpoints( const endpointOutputLine: string[] = []; - endpointOutputLine.push(generateVersionHeaderComment(openApiDocs)); - endpointOutputLine.push(''); - endpointOutputLine.push('import type {'); endpointOutputLine.push( ...[emptyRequest, emptyResponse, ...entities].map(it => '\t' + it.generateName() + ','), @@ -187,9 +160,6 @@ async function generateApiClientJSDoc( const endpointOutputLine: string[] = []; - endpointOutputLine.push(generateVersionHeaderComment(openApiDocs)); - endpointOutputLine.push(''); - endpointOutputLine.push(`import type { SwitchCaseResponseType } from '${toImportPath(apiClientFileName)}';`); endpointOutputLine.push(`import type { Endpoints } from '${toImportPath(endpointsFileName)}';`); endpointOutputLine.push(''); |