Extract shared connector code into contract-case-connector-js package#1263
Open
TimothyJones wants to merge 3 commits intomainfrom
Open
Extract shared connector code into contract-case-connector-js package#1263TimothyJones wants to merge 3 commits intomainfrom
TimothyJones wants to merge 3 commits intomainfrom
Conversation
Extract shared (non-test-framework-specific) code from contract-case-jest into a new contract-case-connector-js package. Both contract-case-jest and the new contract-case-vitest package now depend on the shared connector, keeping only their framework-specific bindings (describe/it/afterAll wrappers). - New package: @contract-case/contract-case-connector-js Contains: ContractDefiner, ContractVerifier, TriggerGroupMap, DSL (Matchers, Interactions, States), entity types, error classes, and boundary mappers - New package: @contract-case/contract-case-vitest Vitest-specific defineContract/verifyContract using vitest's describe/it and vi.setConfig for timeouts - Updated: @contract-case/contract-case-jest Now re-exports from connector-js, keeping only jest-specific bindings https://claude.ai/code/session_015ncC7UbQNQN3st9e3HEBNA
- Extract user-facing code (DSL, classes, types, errors) to new contract-case-dsl-js package - Keep internal code (boundary mappers, printer, handler) in contract-case-connector-js - Rename contract-case-jest to contract-case-dsl-js-jest - Rename contract-case-vitest to contract-case-dsl-js-vitest - Add vitest test files mirroring the jest test suite (define and verify specs for HTTP client/server, function caller/implementer) - Copy test fixtures (client, server, gRPC) to vitest package - Update vitest.config.ts to include .spec.verify.ts files https://claude.ai/code/session_015ncC7UbQNQN3st9e3HEBNA
- Fix import ordering in dsl-js (external imports before local) - Merge duplicate imports from connector-js in ContractDefiner/ContractVerifier - Merge duplicate imports from index.js in jest verify specs - Fix duplicate imports in jest documentation spec - Add missing gRPC devDependencies to vitest package - Apply prettier formatting fixes https://claude.ai/code/session_015ncC7UbQNQN3st9e3HEBNA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors the ContractCase codebase to extract common JavaScript/TypeScript connector logic into a new shared package (
@contract-case/contract-case-connector-js), reducing duplication and enabling easier support for multiple test frameworks.Key Changes
New Package: Created
@contract-case/contract-case-connector-jscontaining:ContractCaseDefiner,ContractVerifier)New Vitest Support: Added
@contract-case/contract-case-vitestpackage with:defineContract,verifyContract)Jest Package Refactoring: Updated
@contract-case/contract-case-jestto:Import Path Updates: Updated import statements across the codebase to use the new shared package structure and ES module syntax (
.jsextensions)Implementation Details
contract-case-connector-js, reducing maintenance burdendsl,TestEquivalenceMatchers)https://claude.ai/code/session_015ncC7UbQNQN3st9e3HEBNA