refactor(adapters.injectionjs,unit): add injection-js dependency injection adapter support#934
Open
refactor(adapters.injectionjs,unit): add injection-js dependency injection adapter support#934
Conversation
Update .gitignore to properly handle TypeScript declaration files, allowing user-created global.d.ts files to be committed when needed for type augmentation configuration.
Change from 'lerna version prerelease' to 'lerna version --conventional-commits --conventional-prerelease' to properly respect breaking changes and conventional commit types when creating prerelease versions. The old command ignored conventional commits and just bumped the patch version, resulting in incorrect versions like 3.0.2-dev.0 instead of 4.0.0-dev.0 when there are breaking changes. This aligns with the fix we made in the e2e workflow and ensures version numbers correctly reflect the semantic changes in commits.
Add JSDoc style guide documenting standards for the Suites project. Includes templates for classes, interfaces, methods, types, and errors with real examples from the codebase and guidelines for consistent documentation across all packages.
Add global.d.ts files and update tsconfig in all e2e test projects to adopt the new explicit type augmentation pattern. Each test project now explicitly declares which doubles adapter to use via triple-slash reference directives.
Add comprehensive type safety tests to verify that module augmentation works correctly for both NestJS and Inversify DI adapters. NestJS tests verify: - IdentifierMetadata is restricted to 'never' - Metadata parameters are not allowed (using @ts-expect-error) - Mocking without metadata works correctly Inversify tests verify: - IdentifierMetadata allows metadata objects - Metadata parameters are accepted for string and symbol tokens - Complex metadata objects are supported - Metadata is optional (backward compatibility) These tests ensure the abstraction/augmentation pattern maintains proper type safety across all test runners (Jest, Vitest, Sinon).
Upgrade ts-mocha from 10.0.0 to 11.1.0 and add explicit ts-node 10.9.2 with proper configuration to improve TypeScript transpilation on Node 22/24. Changes: - Upgrade ts-mocha: 10.0.0 → 11.1.0 - Add ts-node: ^10.9.2 - Configure ts-node in tsconfig.json: - transpileOnly: true (faster) - module: commonjs (explicit CJS) - esModuleInterop: true Note: MODULE_TYPELESS_PACKAGE_JSON warnings may still appear on Node 22/24 when running ts-mocha. This is a known limitation of ts-mocha's module handling with Node's stricter module detection. The warning is harmless - tests execute correctly with a minor performance overhead during module type detection. Users can safely ignore this warning. Alternative: Use Jest or Vitest which handle TypeScript/ESM better. Relates to #811
- Remove @suites/types.doubles dependency from core (not in v3.0.0) - Revert reflect-metadata version constraint in di.inversify - Remove Node >= 20 engine requirement from types.doubles - Remove @suites/types.common dependency from types.doubles These changes were inadvertently included during conflict resolution. Infrastructure changes (workspace: protocol, pnpm scripts) are retained.
pnpm 10.14.0 requires Node >= 18.12, which breaks v3.x Node 16 support. Using pnpm 8.15.9 (last stable 8.x) which supports Node 16.14+. Changes: - Update all workflow files to use pnpm 8.15.9 - Update packageManager field in all package.json files - Regenerate pnpm-lock.yaml with pnpm 8.x
- Use 'pnpm exec manypkg check' instead of 'pnpm manypkg check' - Use lerna's '--ignore' flag instead of pnpm's '--filter' for Node 16 build
…g check - Restore @suites/types.common dependency in types.doubles (required by index.ts) - Remove manypkg validation step (package not available in pnpm 8.x setup) - Regenerate lockfile
Node 16 doesn't support os.availableParallelism() which Jest 29 requires. E2E testing on Node 18+ is sufficient for v3 maintenance.
chore: backport infrastructure improvements from next
Export Mocked<T> and Stub types from @suites/unit to establish the abstraction layer of the abstraction/augmentation pattern. These base types provide graceful fallback when adapter packages are not configured, and serve as the foundation that adapter packages will augment with library-specific implementations.
c6390f6 to
8df7a81
Compare
…injectionjs-adapter
3120956 to
32bec03
Compare
96a04d1 to
4b8854e
Compare
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.
Relates #931