Skip to content

Conversation

@RobinTail
Copy link
Owner

@RobinTail RobinTail commented Nov 22, 2025

Copy of #3055 , because the issue in #3054 is not caused by it

Summary by CodeRabbit

  • Chores

    • Updated TypeScript configuration for improved module resolution strategy and build compatibility.
  • New Features

    • Added ProprietaryBrand type export for schema handling.
  • Refactor

    • Enhanced type generation interface with new alias method capability.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes explicit .ts file extensions from import statements across the codebase (100+ files) and updates TypeScript compiler configuration to use bundler module resolution. Also adds a new ProprietaryBrand type export and extends the ZTSContext interface with a makeAlias method.

Changes

Cohort / File(s) Summary
TypeScript Configuration
tsconfig.json
Updated module resolution: changed module from "node20" to "preserve", added moduleResolution "bundler", changed target from "es2023" to "esnext".
Core Source Files with Logic Changes
express-zod-api/src/zts-helpers.ts, express-zod-api/src/proprietary-schemas.ts
Added makeAlias method to ZTSContext interface; introduced new ProprietaryBrand type export as union of brand types.
Express-Zod-API Source (Import Normalization)
express-zod-api/src/*.ts
Removed .ts extensions from all local module imports across builtin-logger, common-helpers, config-type, deep-checks, depends-on-method, diagnostics, documentation-helpers, documentation, endpoint, endpoints-factory, errors, graceful-shutdown, index, integration-base, integration, json-schema-helpers, last-resort, logger-helpers, logical-container, middleware, peer-helpers, raw-schema, result-handler, result-helpers, routable, routing-walker, routing, schema-walker, server-helpers, server, sse, testing, zts, and zts.ts.
Express-Zod-API Tests (Import Normalization)
express-zod-api/tests/*.spec.ts, express-zod-api/vitest.setup.ts
Removed .ts extensions from all local and barrel imports across 40+ test files and setup configuration.
Example Application Files
example/*.ts, example/endpoints/*.ts
Removed .ts extensions from imports in config.ts, factories.ts, generate-client.ts, generate-documentation.ts, index.ts, routing.ts, and all endpoint files (create-user, delete-user, list-users, retrieve-user, send-avatar, stream-avatar, time-subscription, update-user).
Example Tests
example/*.spec.ts
Updated imports in index.spec.ts to use extensionless module paths.
Zod-Plugin Source & Tests
zod-plugin/src/*.ts, zod-plugin/tests/*.spec.ts
Removed .ts extensions from imports in augmentation.ts, brand.ts, index.ts, runtime.ts and corresponding test files.
Compat & ESM Tests
compat-test/quick-start.spec.ts, esm-test/quick-start.spec.ts
Updated import paths for givePort from ../tools/ports.ts to ../tools/ports.
Tools & Migration
migration/index.spec.ts, tools/license.ts, tools/make-tests.ts
Removed .ts extensions from imports and removed explicit type: "json" import assertion in JSON imports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • TypeScript configuration changes (tsconfig.json) require verification that module resolution "bundler" mode with target "esnext" is compatible with the build toolchain and doesn't introduce unexpected import resolution behavior
  • API surface changes in zts-helpers.ts (new makeAlias method) and proprietary-schemas.ts (new ProprietaryBrand export) need validation for correctness and intended usage
  • One test file flagged as "High" complexity (express-zod-api/tests/middleware.spec.ts) warrants extra attention
  • High volume of homogeneous changes reduces per-file review burden, but systematic verification that all imports resolve correctly post-refactoring is essential

Possibly related PRs

Suggested labels

refactoring, CI/CD

Poem

🐰 No more .ts to chase,
Extensions removed from their place,
Bundler mode now leads the way,
Imports cleaner every day!
TypeScript hops with lighter feet,

✨ 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-3080-revert-3055-rev-extensions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6151787 and 98b78e3.

📒 Files selected for processing (107)
  • compat-test/quick-start.spec.ts (1 hunks)
  • esm-test/quick-start.spec.ts (1 hunks)
  • example/config.ts (1 hunks)
  • example/endpoints/create-user.ts (1 hunks)
  • example/endpoints/delete-user.ts (1 hunks)
  • example/endpoints/list-users.ts (1 hunks)
  • example/endpoints/retrieve-user.ts (1 hunks)
  • example/endpoints/send-avatar.ts (1 hunks)
  • example/endpoints/stream-avatar.ts (1 hunks)
  • example/endpoints/time-subscription.ts (1 hunks)
  • example/endpoints/update-user.ts (1 hunks)
  • example/factories.ts (1 hunks)
  • example/generate-client.ts (1 hunks)
  • example/generate-documentation.ts (1 hunks)
  • example/index.spec.ts (1 hunks)
  • example/index.ts (1 hunks)
  • example/routing.ts (1 hunks)
  • express-zod-api/src/builtin-logger.ts (1 hunks)
  • express-zod-api/src/common-helpers.ts (1 hunks)
  • express-zod-api/src/config-type.ts (1 hunks)
  • express-zod-api/src/deep-checks.ts (1 hunks)
  • express-zod-api/src/depends-on-method.ts (1 hunks)
  • express-zod-api/src/diagnostics.ts (1 hunks)
  • express-zod-api/src/documentation-helpers.ts (2 hunks)
  • express-zod-api/src/documentation.ts (2 hunks)
  • express-zod-api/src/endpoint.ts (1 hunks)
  • express-zod-api/src/endpoints-factory.ts (1 hunks)
  • express-zod-api/src/errors.ts (1 hunks)
  • express-zod-api/src/graceful-shutdown.ts (1 hunks)
  • express-zod-api/src/index.ts (2 hunks)
  • express-zod-api/src/integration-base.ts (2 hunks)
  • express-zod-api/src/integration.ts (2 hunks)
  • express-zod-api/src/json-schema-helpers.ts (1 hunks)
  • express-zod-api/src/last-resort.ts (1 hunks)
  • express-zod-api/src/logger-helpers.ts (1 hunks)
  • express-zod-api/src/logical-container.ts (1 hunks)
  • express-zod-api/src/middleware.ts (1 hunks)
  • express-zod-api/src/peer-helpers.ts (1 hunks)
  • express-zod-api/src/proprietary-schemas.ts (1 hunks)
  • express-zod-api/src/raw-schema.ts (1 hunks)
  • express-zod-api/src/result-handler.ts (1 hunks)
  • express-zod-api/src/result-helpers.ts (1 hunks)
  • express-zod-api/src/routable.ts (1 hunks)
  • express-zod-api/src/routing-walker.ts (1 hunks)
  • express-zod-api/src/routing.ts (1 hunks)
  • express-zod-api/src/schema-walker.ts (1 hunks)
  • express-zod-api/src/server-helpers.ts (1 hunks)
  • express-zod-api/src/server.ts (2 hunks)
  • express-zod-api/src/sse.ts (1 hunks)
  • express-zod-api/src/testing.ts (1 hunks)
  • express-zod-api/src/zts-helpers.ts (1 hunks)
  • express-zod-api/src/zts.ts (1 hunks)
  • express-zod-api/tests/api-response.spec.ts (1 hunks)
  • express-zod-api/tests/buffer-schema.spec.ts (1 hunks)
  • express-zod-api/tests/builtin-logger.spec.ts (1 hunks)
  • express-zod-api/tests/common-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/config-type.spec.ts (1 hunks)
  • express-zod-api/tests/content-type.spec.ts (1 hunks)
  • express-zod-api/tests/date-in-schema.spec.ts (1 hunks)
  • express-zod-api/tests/date-out-schema.spec.ts (1 hunks)
  • express-zod-api/tests/deep-checks.spec.ts (1 hunks)
  • express-zod-api/tests/depends-on-method.spec.ts (1 hunks)
  • express-zod-api/tests/documentation-helpers.spec.ts (2 hunks)
  • express-zod-api/tests/documentation.spec.ts (1 hunks)
  • express-zod-api/tests/endpoint.spec.ts (1 hunks)
  • express-zod-api/tests/endpoints-factory.spec.ts (1 hunks)
  • express-zod-api/tests/errors.spec.ts (1 hunks)
  • express-zod-api/tests/form-schema.spec.ts (1 hunks)
  • express-zod-api/tests/graceful-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/graceful-shutdown.spec.ts (1 hunks)
  • express-zod-api/tests/index.spec.ts (2 hunks)
  • express-zod-api/tests/integration.spec.ts (1 hunks)
  • express-zod-api/tests/io-schema.spec.ts (1 hunks)
  • express-zod-api/tests/json-schema-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/last-resort.spec.ts (1 hunks)
  • express-zod-api/tests/logger-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/logical-container.spec.ts (1 hunks)
  • express-zod-api/tests/method.spec.ts (1 hunks)
  • express-zod-api/tests/middleware.spec.ts (1 hunks)
  • express-zod-api/tests/peer-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/raw-schema.spec.ts (1 hunks)
  • express-zod-api/tests/result-handler.spec.ts (1 hunks)
  • express-zod-api/tests/result-helpers.spec.ts (1 hunks)
  • express-zod-api/tests/routable.spec.ts (1 hunks)
  • express-zod-api/tests/routing.spec.ts (2 hunks)
  • express-zod-api/tests/serve-static.spec.ts (1 hunks)
  • express-zod-api/tests/server-helpers.spec.ts (2 hunks)
  • express-zod-api/tests/server.spec.ts (2 hunks)
  • express-zod-api/tests/sse.spec.ts (1 hunks)
  • express-zod-api/tests/startup-logo.spec.ts (1 hunks)
  • express-zod-api/tests/system.spec.ts (1 hunks)
  • express-zod-api/tests/testing.spec.ts (1 hunks)
  • express-zod-api/tests/upload-schema.spec.ts (1 hunks)
  • express-zod-api/tests/zts.spec.ts (1 hunks)
  • express-zod-api/vitest.setup.ts (1 hunks)
  • migration/index.spec.ts (2 hunks)
  • tools/license.ts (1 hunks)
  • tools/make-tests.ts (2 hunks)
  • tsconfig.json (1 hunks)
  • zod-plugin/src/augmentation.ts (1 hunks)
  • zod-plugin/src/brand.ts (1 hunks)
  • zod-plugin/src/index.ts (1 hunks)
  • zod-plugin/src/runtime.ts (1 hunks)
  • zod-plugin/tests/brand.spec.ts (1 hunks)
  • zod-plugin/tests/index.spec.ts (1 hunks)
  • zod-plugin/tests/packer.spec.ts (1 hunks)
  • zod-plugin/tests/runtime.spec.ts (1 hunks)
⛔ Files not processed due to max files limit (1)
  • zod-plugin/vitest.setup.ts

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.

@RobinTail RobinTail merged commit cd4f151 into master Nov 22, 2025
12 of 13 checks passed
@RobinTail RobinTail deleted the revert-3080-revert-3055-rev-extensions branch November 22, 2025 18:50
@coveralls-official
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 98b78e3 on revert-3080-revert-3055-rev-extensions
into 6151787 on master.

@RobinTail RobinTail mentioned this pull request Nov 24, 2025
RobinTail added a commit that referenced this pull request Nov 24, 2025
- rm allowing ts extensions in tsconfig due to #3081 
- rm dynamic import with js extension in CJS test (appears rudimental)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Removed an explicit TypeScript compiler option that allowed importing
TypeScript file extensions; no other compiler behavior changed.
* **Tests**
* Simplified test imports by loading dependencies at module
initialization rather than at runtime, improving test clarity and
consistency.

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

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant