From d572f5e29b509badceef47531ae03f578a22ba2d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 30 Mar 2026 20:16:20 +0000 Subject: [PATCH] chore: remove all deprecated code, backward-compat aliases, and legacy shims - Remove Sqitch aliases (writeSqitchFiles, writeSqitchPlan, SqitchRow) - Remove PgTextClientContext typo alias - Remove LegacyGraphileOptions interface and graphile field from GetConnectionsInput - Remove CustomInflectorPlugin/CustomInflectorPreset backward-compat re-exports - Remove deprecated NodeTypeRegistryPreset section from README - Remove deprecated --template-path CLI option handling - Delete codegen/core/query-builder.ts backward-compat re-export shim - Remove IntrospectionSchema backward-compat alias from codegen/core/types.ts - Move naming helper exports to canonical location in generators/index.ts - Remove legacy graphile options from playwright-test server setup - Clean up backward-compat comments throughout codebase - Remove DEPRECATED block from constructive-preset.ts --- .../src/plugins/detect-extension.ts | 1 - .../src/codecs/tsvector-codec.ts | 2 +- .../src/plugins/custom-inflector.ts | 4 -- .../graphile-settings/src/plugins/index.ts | 2 - .../src/presets/constructive-preset.ts | 4 -- graphile/graphile-test/src/context.ts | 6 +-- graphile/graphile-test/src/index.ts | 1 - graphile/graphile-test/src/types.ts | 47 +------------------ graphile/node-type-registry/README.md | 10 ---- graphql/codegen/src/core/index.ts | 2 +- graphql/codegen/src/core/query-builder.ts | 7 --- graphql/codegen/src/core/types.ts | 9 ---- .../playwright-test/src/get-connections.ts | 1 - graphql/query/src/generators/index.ts | 4 +- graphql/query/src/generators/select.ts | 2 - graphql/query/src/index.ts | 1 - graphql/server/src/server.ts | 2 +- packages/cli/test-utils/index.ts | 2 +- pgpm/cli/src/commands/init/workspace.ts | 3 +- pgpm/cli/src/index.ts | 1 - pgpm/cli/test-utils/index.ts | 2 +- pgpm/core/src/files/plan/parser.ts | 3 +- pgpm/core/src/files/plan/writer.ts | 5 -- pgpm/core/src/files/sql/writer.ts | 5 -- pgpm/core/src/files/types/index.ts | 5 -- pgpm/core/src/migrate/utils/transaction.ts | 2 +- pgpm/types/src/pgpm.ts | 4 -- 27 files changed, 16 insertions(+), 121 deletions(-) delete mode 100644 graphql/codegen/src/core/query-builder.ts diff --git a/graphile/graphile-postgis/src/plugins/detect-extension.ts b/graphile/graphile-postgis/src/plugins/detect-extension.ts index 4175363a0..e4a8ffa70 100644 --- a/graphile/graphile-postgis/src/plugins/detect-extension.ts +++ b/graphile/graphile-postgis/src/plugins/detect-extension.ts @@ -4,7 +4,6 @@ import type { PgCodec } from '@dataplan/pg'; import type { GraphileConfig } from 'graphile-config'; import type { PostgisExtensionInfo } from '../types'; -// Re-export for backward compat — other plugins import from here export type { PostgisExtensionInfo } from '../types'; /** diff --git a/graphile/graphile-search/src/codecs/tsvector-codec.ts b/graphile/graphile-search/src/codecs/tsvector-codec.ts index a9918db77..ea74718d1 100644 --- a/graphile/graphile-search/src/codecs/tsvector-codec.ts +++ b/graphile/graphile-search/src/codecs/tsvector-codec.ts @@ -8,7 +8,7 @@ * HIDE_BY_DEFAULT). This plugin: * * 1. Creates codecs for tsvector/tsquery via gather.hooks.pgCodecs_findPgCodec - * (kept for backward compatibility with older versions; rc.8+ handles this + * (rc.8+ handles this * natively so the hook returns early when event.pgCodec is already set) * 2. Registers a custom "FullText" scalar type for tsvector columns * 3. Maps tsvector codec to the FullText scalar (isolating filter operators) diff --git a/graphile/graphile-settings/src/plugins/custom-inflector.ts b/graphile/graphile-settings/src/plugins/custom-inflector.ts index 2bb1c21ea..9d9b299c9 100644 --- a/graphile/graphile-settings/src/plugins/custom-inflector.ts +++ b/graphile/graphile-settings/src/plugins/custom-inflector.ts @@ -478,7 +478,3 @@ export const InflektPlugin: GraphileConfig.Plugin = { export const InflektPreset: GraphileConfig.Preset = { plugins: [InflektPlugin], }; - -// Re-export for backwards compatibility -export const CustomInflectorPlugin = InflektPlugin; -export const CustomInflectorPreset = InflektPreset; diff --git a/graphile/graphile-settings/src/plugins/index.ts b/graphile/graphile-settings/src/plugins/index.ts index d0163a382..f086b9af3 100644 --- a/graphile/graphile-settings/src/plugins/index.ts +++ b/graphile/graphile-settings/src/plugins/index.ts @@ -11,8 +11,6 @@ export { MinimalPreset } from './minimal-preset'; export { InflektPlugin, InflektPreset, - CustomInflectorPlugin, - CustomInflectorPreset, } from './custom-inflector'; // Conflict detector for multi-schema setups diff --git a/graphile/graphile-settings/src/presets/constructive-preset.ts b/graphile/graphile-settings/src/presets/constructive-preset.ts index 5c7cd87d3..f88882ec9 100644 --- a/graphile/graphile-settings/src/presets/constructive-preset.ts +++ b/graphile/graphile-settings/src/presets/constructive-preset.ts @@ -45,10 +45,6 @@ import { constructiveUploadFieldDefinitions } from '../upload-resolver'; * - pg_trgm fuzzy matching (similarTo/wordSimilarTo on text columns, similarity score fields, * orderBy similarity — zero config, typo-tolerant) * - * DEPRECATED: - * - The `condition` argument has been removed. All filtering lives under `filter`. - * PgConditionArgumentPlugin and PgConditionCustomFieldsPlugin are disabled. - * * RELATION FILTERS: * - Enabled via connectionFilterRelations: true * - Forward: filter child by parent (e.g. allOrders(filter: { clientByClientId: { name: { startsWith: "Acme" } } })) diff --git a/graphile/graphile-test/src/context.ts b/graphile/graphile-test/src/context.ts index be26f3c32..f2fb9ab6f 100644 --- a/graphile/graphile-test/src/context.ts +++ b/graphile/graphile-test/src/context.ts @@ -87,7 +87,7 @@ interface V4Result { * - They may have `locations: undefined` instead of omitting the field * - They don't always include locations even when nodes are available * - * This normalizes errors to match v4 format for backward compatibility. + * This normalizes errors to match v4 format. * * @param error - The GraphQL error to format * @param document - The original document (used to derive locations from path) @@ -153,7 +153,7 @@ function formatErrorToV4(error: GraphQLError, document?: DocumentNode): V4Format /** * Normalize an ExecutionResult to match v4 PostGraphile output format. - * This ensures backward compatibility with existing tests and consumers. + * This ensures existing tests and consumers work correctly. * * @param result - The execution result from grafast * @param document - The original document (used to derive locations from path) @@ -333,7 +333,7 @@ export const runGraphQLInContext = async ({ } } - // Normalize the result to match v4 PostGraphile format for backward compatibility + // Normalize the result to match v4 PostGraphile format return normalizeResult(result, document); }; diff --git a/graphile/graphile-test/src/index.ts b/graphile/graphile-test/src/index.ts index 6107bdb7c..34de46eb0 100644 --- a/graphile/graphile-test/src/index.ts +++ b/graphile/graphile-test/src/index.ts @@ -19,7 +19,6 @@ export type { GraphQLQueryUnwrappedFnObj, GraphQLResponse, GraphQLTestContext, - LegacyGraphileOptions, Variables, } from './types'; export { seed, snapshot } from 'pgsql-test'; diff --git a/graphile/graphile-test/src/types.ts b/graphile/graphile-test/src/types.ts index 4e43a36b8..8a2c68c81 100644 --- a/graphile/graphile-test/src/types.ts +++ b/graphile/graphile-test/src/types.ts @@ -25,62 +25,19 @@ export interface GraphQLTestContext { ) => Promise; } -/** - * Legacy v4-style GraphQL options for backward compatibility. - * - * @deprecated Use `preset` instead for v5 configuration. - */ -export interface LegacyGraphileOptions { - /** - * V4-style plugins to append. - * These plugins use the builder.hook() API which is NOT compatible with v5. - * For v5, convert these to proper v5 plugins and use the `preset` option instead. - * - * @deprecated Use preset.plugins for v5 plugins - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - appendPlugins?: any[]; - /** - * V4-style graphile build options. - * - * @deprecated Use preset.schema for v5 schema options - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - graphileBuildOptions?: Record; - /** - * V4-style PostGraphile options override. - * - * @deprecated Use preset for v5 configuration - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - overrideSettings?: Record; -} - /** * Input for GraphQL test connections. - * - * Supports both v5 preset-based configuration (recommended) and - * legacy v4-style configuration (deprecated, for backward compatibility). */ + export interface GetConnectionsInput { useRoot?: boolean; schemas: string[]; authRole?: string; /** - * V5 preset configuration (recommended). + * V5 preset configuration. * Can include extends, plugins, schema options, etc. */ preset?: GraphileConfig.Preset; - /** - * Legacy v4-style graphile options for backward compatibility. - * - * NOTE: v4-style plugins (using builder.hook()) are NOT compatible with v5. - * If you use appendPlugins with v4 plugins, they will be ignored. - * Convert your plugins to v5 format and use the `preset` option instead. - * - * @deprecated Use preset for v5 configuration - */ - graphile?: LegacyGraphileOptions; } export interface GraphQLResponse { diff --git a/graphile/node-type-registry/README.md b/graphile/node-type-registry/README.md index a057bba84..cc975fa23 100644 --- a/graphile/node-type-registry/README.md +++ b/graphile/node-type-registry/README.md @@ -73,13 +73,3 @@ Generate SQL seed scripts for `node_type_registry` table: ```bash cd graphile/node-type-registry && pnpm generate:seed --pgpm ../../constructive-db/packages/metaschema ``` - -## Preset (deprecated) - -> **Note:** The `NodeTypeRegistryPreset` is no longer the recommended approach. -> Use the generated TypeScript types instead (see above). The preset remains -> available for backward compatibility but will be removed in a future version. - -```typescript -import { NodeTypeRegistryPreset } from 'node-type-registry/preset'; -``` diff --git a/graphql/codegen/src/core/index.ts b/graphql/codegen/src/core/index.ts index 3cae1c15c..98d5a2c90 100644 --- a/graphql/codegen/src/core/index.ts +++ b/graphql/codegen/src/core/index.ts @@ -17,7 +17,7 @@ export * from './ast'; export * from './custom-ast'; // Query builder -export { MetaObject, QueryBuilder } from './query-builder'; +export { MetaObject, QueryBuilder } from '@constructive-io/graphql-query'; // Meta object utilities export { convertFromMetaSchema, validateMetaObject } from './meta-object'; diff --git a/graphql/codegen/src/core/query-builder.ts b/graphql/codegen/src/core/query-builder.ts deleted file mode 100644 index 3650e5303..000000000 --- a/graphql/codegen/src/core/query-builder.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Re-export QueryBuilder from @constructive-io/graphql-query. - * - * The QueryBuilder class and MetaObject namespace now live in graphql-query. - * Re-exported here for backward compatibility. - */ -export { QueryBuilder, MetaObject } from '@constructive-io/graphql-query'; diff --git a/graphql/codegen/src/core/types.ts b/graphql/codegen/src/core/types.ts index 0d6c6a9b1..99bb4d492 100644 --- a/graphql/codegen/src/core/types.ts +++ b/graphql/codegen/src/core/types.ts @@ -1,9 +1,5 @@ /** * Re-export core types from @constructive-io/graphql-query. - * - * This file used to contain the canonical type definitions. They now live in - * the `graphql-query` package and are re-exported here for backward - * compatibility so existing codegen consumers continue to work unchanged. */ // Re-export everything from the canonical source @@ -34,8 +30,3 @@ export { isGraphQLVariables, type StrictRecord, } from '@constructive-io/graphql-query'; - -// Backward-compatible alias: codegen historically used `IntrospectionSchema` -// while graphql-query renamed it to `QueryIntrospectionSchema` to avoid -// collision with the standard GraphQL IntrospectionSchema type. -export { type QueryIntrospectionSchema as IntrospectionSchema } from '@constructive-io/graphql-query'; diff --git a/graphql/playwright-test/src/get-connections.ts b/graphql/playwright-test/src/get-connections.ts index c689b4b5e..68eff4364 100644 --- a/graphql/playwright-test/src/get-connections.ts +++ b/graphql/playwright-test/src/get-connections.ts @@ -57,7 +57,6 @@ const createConnectionsWithServerBase = async ( defaultDatabaseId: 'test-database', ...(input.authRole && { anonRole: input.authRole, roleName: input.authRole }) }, - ...(input.graphile && { graphile: input.graphile as any }) }); // Start the HTTP server diff --git a/graphql/query/src/generators/index.ts b/graphql/query/src/generators/index.ts index 5083c27a1..94d2a372a 100644 --- a/graphql/query/src/generators/index.ts +++ b/graphql/query/src/generators/index.ts @@ -12,8 +12,6 @@ export { cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, - toCamelCasePlural, - toOrderByTypeName, } from './select'; // Mutation generators (CREATE, UPDATE, DELETE) @@ -34,6 +32,7 @@ export { // Naming helpers (server-aware inflection) export { normalizeInflectionValue, + toCamelCasePlural, toCamelCaseSingular, toCreateMutationName, toUpdateMutationName, @@ -42,6 +41,7 @@ export { toUpdateInputTypeName, toDeleteInputTypeName, toFilterTypeName, + toOrderByTypeName, toPatchFieldName, toOrderByEnumValue, } from './naming-helpers'; diff --git a/graphql/query/src/generators/select.ts b/graphql/query/src/generators/select.ts index b80b09d49..fe9c28c6f 100644 --- a/graphql/query/src/generators/select.ts +++ b/graphql/query/src/generators/select.ts @@ -41,8 +41,6 @@ import { toUpdateMutationName, } from './naming-helpers'; -// Re-export naming helpers for backwards compatibility -export { toCamelCasePlural, toOrderByTypeName } from './naming-helpers'; /** * Convert Table to MetaObject format for QueryBuilder diff --git a/graphql/query/src/index.ts b/graphql/query/src/index.ts index 11cc63605..ad0e5f2f2 100644 --- a/graphql/query/src/index.ts +++ b/graphql/query/src/index.ts @@ -27,7 +27,6 @@ export * from './types'; // Meta object utilities (convert, validate) export * as MetaObject from './meta-object'; -// Also export meta-object functions directly for codegen backward compatibility export { convertFromMetaSchema } from './meta-object/convert'; export { validateMetaObject, type ValidationResult } from './meta-object/validate'; diff --git a/graphql/server/src/server.ts b/graphql/server/src/server.ts index 1ae4759db..7aa57c4b2 100644 --- a/graphql/server/src/server.ts +++ b/graphql/server/src/server.ts @@ -54,7 +54,7 @@ const log = new Logger('server'); * server: { port: 4000 } * }); * - * // Using PgpmOptions (backward compatible) + * // Using PgpmOptions * GraphQLServer(pgpmOptions); * ``` */ diff --git a/packages/cli/test-utils/index.ts b/packages/cli/test-utils/index.ts index 713855b20..02039f9b5 100644 --- a/packages/cli/test-utils/index.ts +++ b/packages/cli/test-utils/index.ts @@ -1,6 +1,6 @@ export * from './fixtures'; -// Re-export test utilities from @inquirerer/test for backwards compatibility +// Re-export test utilities from @inquirerer/test export { KEY_SEQUENCES, setupTests, diff --git a/pgpm/cli/src/commands/init/workspace.ts b/pgpm/cli/src/commands/init/workspace.ts index e1a638328..5bcfa945d 100644 --- a/pgpm/cli/src/commands/init/workspace.ts +++ b/pgpm/cli/src/commands/init/workspace.ts @@ -32,8 +32,7 @@ export default async function runWorkspaceSetup( const templateRepo = (argv.repo as string) ?? DEFAULT_TEMPLATE_REPO; // Don't set default template - let scaffoldTemplate use metadata-driven resolution - // Support both --template (new) and --template-path (deprecated) for backward compatibility - const template = (argv.template || argv.templatePath) as string | undefined; + const template = (argv.template) as string | undefined; // Register workspace.dirname resolver so boilerplate templates can use it via defaultFrom/setFrom // This provides the intended workspace directory name before the folder is created diff --git a/pgpm/cli/src/index.ts b/pgpm/cli/src/index.ts index 4c51dbfb9..3871486ce 100644 --- a/pgpm/cli/src/index.ts +++ b/pgpm/cli/src/index.ts @@ -36,7 +36,6 @@ export const options: Partial = { v: 'version', h: 'help', 'from-branch': 'fromBranch', - // Support both --template and --template-path (deprecated) for backward compatibility 'template-path': 'template', t: 'template', // -w for --create-workspace flag diff --git a/pgpm/cli/test-utils/index.ts b/pgpm/cli/test-utils/index.ts index dc3059e2d..690f99bbd 100644 --- a/pgpm/cli/test-utils/index.ts +++ b/pgpm/cli/test-utils/index.ts @@ -3,7 +3,7 @@ export * from './fixtures'; export * from './init-argv'; export * from './TestDatabase'; -// Re-export test utilities from @inquirerer/test for backwards compatibility +// Re-export test utilities from @inquirerer/test export { KEY_SEQUENCES, setupTests, diff --git a/pgpm/core/src/files/plan/parser.ts b/pgpm/core/src/files/plan/parser.ts index eb1d43f12..773b71f4f 100644 --- a/pgpm/core/src/files/plan/parser.ts +++ b/pgpm/core/src/files/plan/parser.ts @@ -311,7 +311,8 @@ export function resolveReference( } /** - * Simple plan file parser without validation (for backwards compatibility) + * Simple plan file parser without validation. + * Returns a PlanFile (without tags) for callers that don't need tag data. */ export function parsePlanFileSimple(planPath: string): PlanFile { const result = parsePlanFile(planPath); diff --git a/pgpm/core/src/files/plan/writer.ts b/pgpm/core/src/files/plan/writer.ts index 61d8d8d70..0f2ce31e6 100644 --- a/pgpm/core/src/files/plan/writer.ts +++ b/pgpm/core/src/files/plan/writer.ts @@ -153,8 +153,3 @@ export function generateTagLineContent(tag: Tag): string { return line; } - -/** - * @deprecated Use writePgpmPlan instead. This alias is kept for backwards compatibility. - */ -export const writeSqitchPlan = writePgpmPlan; diff --git a/pgpm/core/src/files/sql/writer.ts b/pgpm/core/src/files/sql/writer.ts index 7310fdb61..bd28fb83a 100644 --- a/pgpm/core/src/files/sql/writer.ts +++ b/pgpm/core/src/files/sql/writer.ts @@ -130,8 +130,3 @@ ${useTx ? 'COMMIT;' : ''} `; fs.writeFileSync(actualFile, content); }; - -/** - * @deprecated Use writePgpmFiles instead. This alias is kept for backwards compatibility. - */ -export const writeSqitchFiles = writePgpmFiles; diff --git a/pgpm/core/src/files/types/index.ts b/pgpm/core/src/files/types/index.ts index 28c3894a9..9846443b7 100644 --- a/pgpm/core/src/files/types/index.ts +++ b/pgpm/core/src/files/types/index.ts @@ -58,8 +58,3 @@ export interface PgpmRow { deps?: string[]; name?: string; } - -/** - * @deprecated Use PgpmRow instead. This alias is kept for backwards compatibility. - */ -export type SqitchRow = PgpmRow; diff --git a/pgpm/core/src/migrate/utils/transaction.ts b/pgpm/core/src/migrate/utils/transaction.ts index c19bf634f..4a8361c45 100644 --- a/pgpm/core/src/migrate/utils/transaction.ts +++ b/pgpm/core/src/migrate/utils/transaction.ts @@ -4,7 +4,7 @@ import { Pool, PoolClient } from 'pg'; import { formatQueryHistory, truncateErrorOutput } from './errors'; -// Re-export error formatting functions for backward compatibility +// Re-export error formatting functions export { formatQueryHistory, truncateErrorOutput } from './errors'; const log = new Logger('migrate:transaction'); diff --git a/pgpm/types/src/pgpm.ts b/pgpm/types/src/pgpm.ts index 617e45335..e46025e0e 100644 --- a/pgpm/types/src/pgpm.ts +++ b/pgpm/types/src/pgpm.ts @@ -49,10 +49,6 @@ export interface PgTestClientContext { [key: string]: string | null | undefined; } -/** -* @deprecated Use PgTestClientContext instead (typo fix) -*/ -export type PgTextClientContext = PgTestClientContext; /** * Role mapping configuration for database security