Open
Conversation
…ckages - Replace git tag --list strategy with package.json-driven tag validation in all 16 publish workflows; use git rev-parse to verify the exact tag exists rather than guessing the latest repo-wide tag - Update error guidance to reflect feat/** → develop → master flow - Standardize dependabot to npm-only, grouped, monthly cadence across all 16 packages; remove github-actions ecosystem updates - Add missing dependabot.yml to AuthKit-UI, ChartKit-UI, HealthKit, HooksKit, paymentkit, StorageKit
* feat(COMPT-55): add ICacheStore port and Redis/InMemory adapters * feat(COMPT-56): add CacheModule, CacheService, and DI tokens * style: fix Prettier formatting across all files * style: fix Prettier formatting after develop merge * fix(lint): fix import order and replace any types with proper NestJS types
* feat(COMPT-55): add ICacheStore port and Redis/InMemory adapters * feat(COMPT-56): add CacheModule, CacheService, and DI tokens * style: fix Prettier formatting across all files * style: fix Prettier formatting after develop merge * fix(lint): fix import order and replace any types with proper NestJS types * feat(COMPT-57): add @Cacheable and @CacheEvict decorators with key interpolation
* feat(COMPT-55): add ICacheStore port and Redis/InMemory adapters * feat(COMPT-56): add CacheModule, CacheService, and DI tokens * style: fix Prettier formatting across all files * style: fix Prettier formatting after develop merge * fix(lint): fix import order and replace any types with proper NestJS types * feat(COMPT-57): add @Cacheable and @CacheEvict decorators with key interpolation * test(COMPT-58): add full test suite with 95%+ coverage across all adapters, service, and decorators * fix(lint): fix import/order and no-require-imports violations in spec files
…#5) * docs(COMPT-59): add README, update peer deps, create v0.1.0 changeset * style: fix Prettier formatting across all files
…clean up index exports (#6)
There was a problem hiding this comment.
Pull request overview
This PR converts the template project into @ciscode/cachekit: a NestJS caching module with pluggable cache-store adapters (memory + Redis), an injectable CacheService, and method decorators for cache-aside + eviction.
Changes:
- Added CacheKit core API:
CacheModule(sync/async registration),CacheService,ICacheStore, and Redis/InMemory adapters. - Added
@Cacheable/@CacheEvictdecorators plus supporting utilities and comprehensive unit tests. - Updated project tooling/docs: path aliases, Jest config/coverage thresholds, workflows, README, and changeset.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds new TS path aliases (@ports, @adapters) for new module structure. |
| src/utils/resolve-cache-key.util.ts | Implements {n} template interpolation for decorator key generation. |
| src/utils/resolve-cache-key.util.spec.ts | Unit tests for cache key template interpolation rules. |
| src/utils/cache-service-ref.ts | Adds singleton ref so decorators can access CacheService at runtime. |
| src/utils/cache-service-ref.spec.ts | Tests singleton set/get behavior and failure mode before init. |
| src/services/cache.service.ts | Implements the primary consumer API: get/set/delete/clear/has/wrap. |
| src/services/cache.service.spec.ts | Tests CacheService behavior, TTL resolution, wrap semantics. |
| src/ports/cache-store.port.ts | Introduces ICacheStore interface to decouple store implementation. |
| src/constants.ts | Adds DI tokens (CACHE_STORE, CACHE_MODULE_OPTIONS). |
| src/cache-kit.module.ts | Implements dynamic module registration and store wiring. |
| src/cache-kit.module.spec.ts | Tests module registration paths and onModuleInit() behavior. |
| src/decorators/cacheable.decorator.ts | Adds cache-aside method decorator with envelope strategy. |
| src/decorators/cacheable.decorator.spec.ts | Tests cache hit/miss behavior, TTL forwarding, null caching. |
| src/decorators/cache-evict.decorator.ts | Adds post-success cache eviction decorator. |
| src/decorators/cache-evict.decorator.spec.ts | Tests eviction behavior and error path. |
| src/adapters/in-memory-cache-store.adapter.ts | Implements Map-backed adapter with lazy TTL expiry. |
| src/adapters/in-memory-cache-store.adapter.spec.ts | Tests adapter contract, TTL expiry, parse failure behavior. |
| src/adapters/redis-cache-store.adapter.ts | Implements ioredis-backed adapter with keyPrefix and SCAN-based clear. |
| src/adapters/redis-cache-store.adapter.spec.ts | Tests Redis adapter behaviors via ioredis-mock. |
| src/index.ts | Re-exports module/service/decorators/tokens/ports/adapters as public API. |
| README.md | Documents installation, configuration, CacheService API, and decorators. |
| package.json | Updates peers/dev deps (adds ioredis-mock, makes ioredis optional peer). |
| package-lock.json | Lockfile updated (but currently inconsistent with package.json; see comments). |
| jest.config.ts | Enables forceExit and increases global coverage thresholds to 85%. |
| .github/workflows/release-check.yml | Updates CI checks, enables Sonar scan, adds commit status reporting. |
| .github/workflows/publish.yml | Changes publish trigger to master push, adds provenance publish step. |
| .github/workflows/pr-validation.yml | Updates Node version used in PR validation. |
| .github/dependabot.yml | Adds Dependabot config for npm updates. |
| .github/CODEOWNERS | Adds CODEOWNERS rule for repo. |
| .changeset/compt-59-v0-1-0.md | Adds changeset describing initial CacheKit public release. |
Comments suppressed due to low confidence (2)
.github/workflows/publish.yml:88
- This workflow publishes twice (
npm publish --provenanceand then a secondnpm publish). The second publish will fail because the version was already published, causing the job to fail. Keep a single publish step (with the desired flags) and remove the duplicate.
- name: Publish to NPM
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
README.md:296
- The README still contains leftover template sections after the License (e.g. “Define DTOs”,
ExampleKitModule, and examples that depend onclass-validator). This is now inaccurate for@ciscode/cachekitand contradicts the updated package setup (no runtime deps on class-validator). Remove or rewrite this tail content so the README reflects only CacheKit usage.
## 📄 License
MIT © [CisCode](https://github.com/CISCODE-MA)
### 3. Define DTOs
```typescript
// src/dto/create-example.dto.ts
import { IsString, IsNotEmpty } from "class-validator";
export class CreateExampleDto {
@IsString()
@IsNotEmpty()
name: string;
}
4. Export Public API
// src/index.ts
export { ExampleKitModule } from "./example-kit.module";
export { ExampleService } from "./services/example.service";
export { CreateExampleDto } from "./dto/create-example.dto";</details>
|
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
Why
Checklist
npm run lintpassesnpm run typecheckpassesnpm testpassesnpm run buildpassesnpx changeset) if this affects consumersNotes