Skip to content

Develop#7

Open
y-aithnini wants to merge 11 commits intomasterfrom
develop
Open

Develop#7
y-aithnini wants to merge 11 commits intomasterfrom
develop

Conversation

@y-aithnini
Copy link
Copy Markdown

Summary

  • What does this PR change?

Why

  • Why is this change needed?

Checklist

  • Added/updated tests (if behavior changed)
  • npm run lint passes
  • npm run typecheck passes
  • npm test passes
  • npm run build passes
  • Added a changeset (npx changeset) if this affects consumers

Notes

  • Anything reviewers should pay attention to?

Zaiidmo and others added 10 commits March 12, 2026 10:18
…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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / @CacheEvict decorators 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 --provenance and then a second npm 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 on class-validator). This is now inaccurate for @ciscode/cachekit and 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>

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

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.

3 participants