From 4b7ecb4d8fdc5ab15c7383b7cd522228b28ec5c0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 23 Feb 2026 01:26:11 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20generate/types=20=E9=85=8D=E4=B8=8B?= =?UTF-8?q?=E3=81=B8=E5=9E=8B=E7=94=9F=E6=88=90=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=81=A8=E3=83=86=E3=82=B9=E3=83=88=E3=82=92=E7=A7=BB?= =?UTF-8?q?=E8=A8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ryusei Sugita --- .../gen-types => generate/types/__tests__}/command.test.ts | 4 ++-- .../gen-types => generate/types/__tests__}/config.test.ts | 2 +- .../types/__tests__}/management-api.test.ts | 4 ++-- .../types/__tests__}/type-generator.test.ts | 4 ++-- src/commands/{gen-types => generate/types}/command.ts | 0 src/commands/{gen-types => generate/types}/config.ts | 0 src/commands/{gen-types => generate/types}/constants.ts | 0 src/commands/{gen-types => generate/types}/index.ts | 0 src/commands/{gen-types => generate/types}/management-api.ts | 0 src/commands/{gen-types => generate/types}/shared.ts | 0 src/commands/{gen-types => generate/types}/type-generator.ts | 0 src/commands/{gen-types => generate/types}/types.ts | 0 src/index.ts | 2 +- 13 files changed, 8 insertions(+), 8 deletions(-) rename src/commands/{__tests__/gen-types => generate/types/__tests__}/command.test.ts (98%) rename src/commands/{__tests__/gen-types => generate/types/__tests__}/config.test.ts (98%) rename src/commands/{__tests__/gen-types => generate/types/__tests__}/management-api.test.ts (97%) rename src/commands/{__tests__/gen-types => generate/types/__tests__}/type-generator.test.ts (94%) rename src/commands/{gen-types => generate/types}/command.ts (100%) rename src/commands/{gen-types => generate/types}/config.ts (100%) rename src/commands/{gen-types => generate/types}/constants.ts (100%) rename src/commands/{gen-types => generate/types}/index.ts (100%) rename src/commands/{gen-types => generate/types}/management-api.ts (100%) rename src/commands/{gen-types => generate/types}/shared.ts (100%) rename src/commands/{gen-types => generate/types}/type-generator.ts (100%) rename src/commands/{gen-types => generate/types}/types.ts (100%) diff --git a/src/commands/__tests__/gen-types/command.test.ts b/src/commands/generate/types/__tests__/command.test.ts similarity index 98% rename from src/commands/__tests__/gen-types/command.test.ts rename to src/commands/generate/types/__tests__/command.test.ts index a960675..b88d799 100644 --- a/src/commands/__tests__/gen-types/command.test.ts +++ b/src/commands/generate/types/__tests__/command.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it } from 'bun:test'; -import { createGenTypesCommand } from '../../gen-types/command.js'; +import { createGenTypesCommand } from '../command.js'; import type { ApiListItem, GenerationTarget, GenTypesOptions, ManagementApiSchema, ManagementClientConfig, -} from '../../gen-types/types.js'; +} from '../types.js'; const FIXTURE_CONFIG: ManagementClientConfig = { serviceDomain: 'test-service', diff --git a/src/commands/__tests__/gen-types/config.test.ts b/src/commands/generate/types/__tests__/config.test.ts similarity index 98% rename from src/commands/__tests__/gen-types/config.test.ts rename to src/commands/generate/types/__tests__/config.test.ts index a647cca..04dab3e 100644 --- a/src/commands/__tests__/gen-types/config.test.ts +++ b/src/commands/generate/types/__tests__/config.test.ts @@ -1,6 +1,6 @@ import path from 'node:path'; import { afterEach, describe, expect, it } from 'bun:test'; -import { resolveConfig, resolveOutputFilePath, resolveSingleEndpoint } from '../../gen-types/config.js'; +import { resolveConfig, resolveOutputFilePath, resolveSingleEndpoint } from '../config.js'; const ORIGINAL_ENV = { serviceDomain: process.env.MICROCMS_SERVICE_DOMAIN, diff --git a/src/commands/__tests__/gen-types/management-api.test.ts b/src/commands/generate/types/__tests__/management-api.test.ts similarity index 97% rename from src/commands/__tests__/gen-types/management-api.test.ts rename to src/commands/generate/types/__tests__/management-api.test.ts index b7bd29a..338c2ae 100644 --- a/src/commands/__tests__/gen-types/management-api.test.ts +++ b/src/commands/generate/types/__tests__/management-api.test.ts @@ -1,6 +1,6 @@ import { afterEach, describe, expect, it } from 'bun:test'; -import { fetchApiList, fetchApiSchema } from '../../gen-types/management-api.js'; -import type { ManagementClientConfig } from '../../gen-types/types.js'; +import { fetchApiList, fetchApiSchema } from '../management-api.js'; +import type { ManagementClientConfig } from '../types.js'; const FIXTURE_CONFIG: ManagementClientConfig = { serviceDomain: 'sample', diff --git a/src/commands/__tests__/gen-types/type-generator.test.ts b/src/commands/generate/types/__tests__/type-generator.test.ts similarity index 94% rename from src/commands/__tests__/gen-types/type-generator.test.ts rename to src/commands/generate/types/__tests__/type-generator.test.ts index d968e14..f737a68 100644 --- a/src/commands/__tests__/gen-types/type-generator.test.ts +++ b/src/commands/generate/types/__tests__/type-generator.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'bun:test'; -import { renderDefinitionsFile } from '../../gen-types/type-generator.js'; -import type { GenerationTarget, ManagementApiSchema } from '../../gen-types/types.js'; +import { renderDefinitionsFile } from '../type-generator.js'; +import type { GenerationTarget, ManagementApiSchema } from '../types.js'; function createSchema(overrides: Partial = {}): ManagementApiSchema { return { diff --git a/src/commands/gen-types/command.ts b/src/commands/generate/types/command.ts similarity index 100% rename from src/commands/gen-types/command.ts rename to src/commands/generate/types/command.ts diff --git a/src/commands/gen-types/config.ts b/src/commands/generate/types/config.ts similarity index 100% rename from src/commands/gen-types/config.ts rename to src/commands/generate/types/config.ts diff --git a/src/commands/gen-types/constants.ts b/src/commands/generate/types/constants.ts similarity index 100% rename from src/commands/gen-types/constants.ts rename to src/commands/generate/types/constants.ts diff --git a/src/commands/gen-types/index.ts b/src/commands/generate/types/index.ts similarity index 100% rename from src/commands/gen-types/index.ts rename to src/commands/generate/types/index.ts diff --git a/src/commands/gen-types/management-api.ts b/src/commands/generate/types/management-api.ts similarity index 100% rename from src/commands/gen-types/management-api.ts rename to src/commands/generate/types/management-api.ts diff --git a/src/commands/gen-types/shared.ts b/src/commands/generate/types/shared.ts similarity index 100% rename from src/commands/gen-types/shared.ts rename to src/commands/generate/types/shared.ts diff --git a/src/commands/gen-types/type-generator.ts b/src/commands/generate/types/type-generator.ts similarity index 100% rename from src/commands/gen-types/type-generator.ts rename to src/commands/generate/types/type-generator.ts diff --git a/src/commands/gen-types/types.ts b/src/commands/generate/types/types.ts similarity index 100% rename from src/commands/gen-types/types.ts rename to src/commands/generate/types/types.ts diff --git a/src/index.ts b/src/index.ts index 99879ee..262bb8e 100755 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ dotenv.config({ path: path.join(envDir, '.env.local') }); process.env.__MICROCMS_CLI_ENV_DIR = envDir; import { Command } from 'commander'; -import { genTypesCommand } from './commands/gen-types/index.js'; +import { genTypesCommand } from './commands/generate/types/index.js'; const program = new Command();