Skip to content

Revert "Rev: Import extensions"#3080

Merged
RobinTail merged 1 commit into
masterfrom
revert-3055-rev-extensions
Nov 22, 2025
Merged

Revert "Rev: Import extensions"#3080
RobinTail merged 1 commit into
masterfrom
revert-3055-rev-extensions

Conversation

@RobinTail

@RobinTail RobinTail commented Nov 22, 2025

Copy link
Copy Markdown
Owner

Does not work well for unrun, causes unclear crashes and resolution uncertainty over ramda in #3054

Summary by CodeRabbit

  • Chores
    • Updated module import paths and TypeScript compilation configuration for improved build compatibility.
    • Standardized JSON module import syntax across the codebase.
    • Enhanced internal API infrastructure with extended interface support for advanced use cases.

✏️ Tip: You can customize this high-level summary in your review settings.

@RobinTail RobinTail added the external bug it's a bug, but in a dependency label Nov 22, 2025
@coderabbitai

coderabbitai Bot commented Nov 22, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR systematically updates import paths across the entire codebase to use explicit TypeScript file extensions (.ts), modifies TypeScript compiler options (module from "preserve" to "node20", target from "esnext" to "es2023"), and introduces a new method to the ZTSContext interface.

Changes

Cohort / File(s) Summary
Test Files - Import Path Updates
compat-test/quick-start.spec.ts, esm-test/quick-start.spec.ts, express-zod-api/tests/*.spec.ts, zod-plugin/tests/*.spec.ts
Updated all test import paths to include explicit .ts extensions and specific module entry points (e.g., ../src../src/index.ts, ../src/module../src/module.ts). No changes to test logic or behavior.
Example Application Files
example/config.ts, example/endpoints/*, example/factories.ts, example/generate-client.ts, example/generate-documentation.ts, example/index.ts, example/index.spec.ts, example/routing.ts
Updated import paths to use explicit .ts extensions. Example: ../tools/ports../tools/ports.ts, ../factories../factories.ts. JSON module import syntax updated to use { type: "json" } assertion.
Express-Zod-API Source Files
express-zod-api/src/*.ts
Systematically updated all relative import paths to include explicit .ts extensions across all source files. No functional logic changes except for one public API addition.
Zod Plugin Files
zod-plugin/src/*.ts, zod-plugin/tests/*.ts
Updated import paths to use explicit .ts extensions. Re-export paths in zod-plugin/src/index.ts changed to target explicit files.
Configuration & Tools
tsconfig.json, tools/license.ts, tools/make-tests.ts, migration/index.spec.ts, express-zod-api/vitest.setup.ts
TypeScript compiler options updated: module changed from "preserve" to "node20", target from "esnext" to "es2023". JSON imports updated to use type: "json" syntax. Import paths in tools updated with .ts extensions.
Public API Change
express-zod-api/src/zts-helpers.ts
ZTSContext interface now includes new method: makeAlias: (key: object, produce: () => ts.TypeNode) => ts.TypeNode.

Sequence Diagram(s)

This change is primarily a module resolution refactor affecting how TypeScript imports are resolved. No significant control flow or feature behavior changes occur, so a sequence diagram would not meaningfully illustrate the modifications.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • File scope: ~130+ files affected across tests, source, and configuration
  • Change homogeneity: High repetition (import path updates follow a consistent pattern), reducing per-file review overhead
  • Key attention areas:
    • tsconfig.json changes to compiler options (module, target) may impact build output and runtime behavior; validate compatibility with Node.js 20 and consuming projects
    • express-zod-api/src/zts-helpers.ts: New makeAlias method addition to ZTSContext interface requires verification of callers and implementation details
    • JSON module import syntax changes (type: "json") across multiple files; ensure Node.js/TypeScript versions support this syntax
    • Verify that explicit .ts extensions don't conflict with barrel exports or re-export patterns

Possibly related PRs

  • RobinTail/express-zod-api#3055: Directly inverse of this PR (reverts explicit .ts extensions and tsconfig changes).
  • RobinTail/express-zod-api#2974: Makes identical import-path and tsconfig edits with explicit .ts extensions.
  • RobinTail/express-zod-api#3014: Converts well-known-headers from JSON to TypeScript module, coordinating with this PR's generator and import updates.

Suggested labels

CI/CD, refactoring

Poem

🐰 Extensions bloom where paths were bare,
Each .ts placed with careful care,
Module dance in Node's new way,
Explicit routes light up the day,
From "preserve" to "node20" we go—
Let TypeScript's true intentions show!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main change: reverting a previous commit about import extensions, which is the primary purpose of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-3055-rev-extensions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls-official

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling c85d7de on revert-3055-rev-extensions
into 67da842 on master.

@RobinTail
RobinTail merged commit 6151787 into master Nov 22, 2025
13 checks passed
@RobinTail
RobinTail deleted the revert-3055-rev-extensions branch November 22, 2025 16:02
@RobinTail

Copy link
Copy Markdown
Owner Author

Checked #3054 again — still failing, so it's not caused by extensions at all, but by unrun itself

RobinTail added a commit that referenced this pull request Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external bug it's a bug, but in a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant