Skip to content

Feat/compt 79 readme changeset publish v0.1.0#10

Merged
saadmoumou merged 2 commits intodevelopfrom
feat/COMPT-79-readme-changeset-publish-v0.1.0
Apr 10, 2026
Merged

Feat/compt 79 readme changeset publish v0.1.0#10
saadmoumou merged 2 commits intodevelopfrom
feat/COMPT-79-readme-changeset-publish-v0.1.0

Conversation

@saadmoumou
Copy link
Copy Markdown
Contributor

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?

- package.json: 0.0.0 -> 0.1.0
- README: full documentation (decorators, dynamic API, concurrency guard,
  error handling, async config, cron helpers, API reference)
- .changeset/scheduler-kit-v0-1-0.md: minor bump for initial feature release
… gate

- sonar.exclusions: exclude spec files from source analysis
- sonar.tests + sonar.test.inclusions: declare spec files as test code
- fixes 31.9% coverage on new code and 4.8% duplication failures
Copilot AI review requested due to automatic review settings April 10, 2026 09:15
@saadmoumou saadmoumou requested a review from a team as a code owner April 10, 2026 09:15
@saadmoumou saadmoumou merged commit 9886b67 into develop Apr 10, 2026
3 checks passed
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

Prepares @ciscode/scheduler-kit for an initial v0.1.0 release by adding Sonar configuration, updating package documentation, and introducing a changeset entry.

Changes:

  • Added sonar-project.properties to define sources/tests and coverage report location.
  • Replaced the template README with package-specific docs and usage examples.
  • Bumped package.json version to 0.1.0 and added a .changeset entry describing the release.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
sonar-project.properties Adds SonarCloud/SonarQube project configuration (sources/tests/coverage).
README.md Rewrites documentation for @ciscode/scheduler-kit features, setup, and API reference.
package.json Updates package version to 0.1.0.
.changeset/scheduler-kit-v0-1-0.md Adds release notes for the initial feature release.

Comment thread README.md
## Features

## 📦 Installation
- **Declarative scheduling** — `@Cron`, `@Interval`, `@Timeout` class decorators
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

README lists @Cron, @Interval, and @Timeout as class decorators, but the package exports them as method decorators (they return MethodDecorator). Please update the wording to avoid misleading usage.

Suggested change
- **Declarative scheduling**`@Cron`, `@Interval`, `@Timeout` class decorators
- **Declarative scheduling**`@Cron`, `@Interval`, `@Timeout` method decorators

Copilot uses AI. Check for mistakes.
Comment thread README.md
- **Concurrency guard** — overlapping executions are skipped automatically
- **Error isolation** — job errors are caught and reported; the scheduler keeps running
- **Job introspection** — `status()` / `listStatus()` expose `isRunning`, `lastRun`, `nextRun`
- **Cron helpers** — `CronExpression` enum and `cron()` fluent builder
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The README says the cron helper is cron() (callable), but the actual export is a cron constant object (used like cron.every(5).minutes()). Please update this bullet to cron (no parentheses) to match the public API.

Suggested change
- **Cron helpers**`CronExpression` enum and `cron()` fluent builder
- **Cron helpers**`CronExpression` enum and `cron` fluent builder

Copilot uses AI. Check for mistakes.
- Automatic concurrency guard — overlapping executions are silently skipped
- Per-job error isolation — handler errors are caught and reported; the scheduler continues running
- `CronExpression` enum of named cron constants
- `cron()` fluent builder with `at()`, `on()`, and `everyMinutes()` helpers
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The changeset describes a cron() builder with at(), on(), and everyMinutes() helpers, but the current public API exports cron (const) with every(n).minutes()/hours(), dailyAt(), weekdaysAt(), weekendsAt(), weeklyOn(), and monthlyOn(). Please correct this entry so the release notes match the shipped API.

Suggested change
- `cron()` fluent builder with `at()`, `on()`, and `everyMinutes()` helpers
- `cron` scheduling helpers with `every(n).minutes()/hours()`, `dailyAt()`, `weekdaysAt()`, `weekendsAt()`, `weeklyOn()`, and `monthlyOn()`

Copilot uses AI. Check for mistakes.

- `SchedulerModule` with `register()` and `registerAsync()` for synchronous and factory-based configuration
- `SchedulerService` with dynamic `schedule()`, `unschedule()`, `reschedule()`, `list()`, `status()`, and `listStatus()` API
- `@Cron`, `@Interval`, and `@Timeout` method decorators for declarative job definitions
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Before publishing v0.1.0, ensure the runtime dependency on the cron package is declared for consumers (it’s imported by SchedulerService, but currently appears only under devDependencies). Otherwise installs of @ciscode/scheduler-kit may fail at runtime with Cannot find module 'cron'.

Suggested change
- `@Cron`, `@Interval`, and `@Timeout` method decorators for declarative job definitions
- `@Cron`, `@Interval`, and `@Timeout` method decorators for declarative job definitions
- Declared `cron` as a runtime dependency required by `SchedulerService` and `@Cron` to prevent consumer runtime resolution errors

Copilot uses AI. Check for mistakes.
Zaiidmo added a commit that referenced this pull request Apr 10, 2026
* ops: updated sonar variable

* Feat/compt 75 typed job definitions ischeduler interface (#3)

* feat(COMPT-75): define typed scheduled job contracts and IScheduler port

- Add ScheduledJob type: name, handler, and one of cron | interval | timeout
- Add IScheduler interface: schedule, unschedule, reschedule, list
- Add ScheduledJobStatus type: name, cron, lastRun, nextRun, isRunning
- Add DuplicateJobError thrown when registering a duplicate job name
- Enforce cron/interval/timeout mutual exclusivity via discriminated union
- Add CronExpression named constants for human-readable schedules
- Add cron fluent builder: dailyAt, weeklyOn, monthlyOn, every().minutes()
- Update tsconfig.build.json: CommonJS output, Task 1 files only
- Update package.json: name @ciscode/scheduler-kit, version 0.0.0

* test(COMPT-75): add unit tests for CronExpression and cron builder

* feat(COMPT-75): add ScheduledJobStatus type and status/listStatus methods

- Add ScheduledJobStatus type: name, cron, lastRun, nextRun, isRunning
- Add status(name) and listStatus() to IScheduler interface and SchedulerService
- Track lastRun timestamp after each execution
- Store cronJob reference for nextRun via cronJob.nextDate()
- Export ScheduledJobStatus from public API
- Fix lint: no-misused-promises, no-floating-promises, prettier formatting

* style(COMPT-75): format all files with prettier

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 76 nestjs scheduler module and service (#4)

* feat(COMPT-76): NestJS SchedulerModule and SchedulerService integration

- SchedulerModule.register() and registerAsync() dynamic module factories
- SchedulerService: schedule(), reschedule(), unschedule(), list(), status(), listStatus()
- @Cron, @interval, @timeout decorators with optional job name
- MetadataScanner auto-discovers decorated provider methods on onModuleInit
- DuplicateJobError guard against double registration
- IScheduler interface and ScheduledJobStatus type
- CronExpression constants and cron fluent builder
- Full unit test coverage across module, service and decorators

* test(COMPT-76): add unit tests for CronExpression and cron builder

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 77 dynamic scheduling error handling (#5)

* chore(COMPT-77): scope index.ts and tsconfig.build.json to COMPT-77 files only

* test(COMPT-77): add tests for status, listStatus, cron jobs and default onJobError

* chore(COMPT-77): restore index.ts and tsconfig.build.json to develop baseline

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* test(COMPT-78): full coverage with Jest fake timers for all schedulin… (#7)

* test(COMPT-78): full coverage with Jest fake timers for all scheduling behaviors

- jest.useFakeTimers() for all time-based tests — no real waiting
- @interval: fires every N ms, stops after unschedule, does not fire before interval
- @timeout: fires exactly once, removes itself from registry, does not fire early
- schedule(): job added and fires on tick
- unschedule(): timer cleared, handler not called after removal
- reschedule(): new schedule applied atomically, old timer cancelled
- Job error: caught via onJobError, scheduler continues — other jobs unaffected
- Concurrent guard: second execution skipped when first still running (isRunning lock)
- status() / listStatus(): reflect isRunning and lastRun correctly
- @Cron: registered and unscheduled without throwing
- Default onJobError: delegates to Logger.error
- Coverage: 98.63% statements, 98.11% branches, 95.34% functions (threshold 85%)

* fix(COMPT-78): resolve SonarCloud S1186 and S4524 issues

- cron-builder.ts: parseInt -> Number.parseInt (Sonar S4524 x3)
- scheduler.decorators.spec.ts: add comments to empty stub methods (Sonar S1186 x6)
- scheduler.module.spec.ts: add comments to empty stub methods and class (Sonar S1186 x6)

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* release(COMPT-79): bump version to 0.1.0, rewrite README, add changeset (#8)

- package.json: 0.0.0 -> 0.1.0
- README: full documentation (decorators, dynamic API, concurrency guard,
  error handling, async config, cron helpers, API reference)
- .changeset/scheduler-kit-v0-1-0.md: minor bump for initial feature release

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 79 readme changeset publish v0.1.0 (#10)

* release(COMPT-79): bump version to 0.1.0, rewrite README, add changeset

- package.json: 0.0.0 -> 0.1.0
- README: full documentation (decorators, dynamic API, concurrency guard,
  error handling, async config, cron helpers, API reference)
- .changeset/scheduler-kit-v0-1-0.md: minor bump for initial feature release

* fix(COMPT-79): add sonar-project.properties to fix SonarCloud quality gate

- sonar.exclusions: exclude spec files from source analysis
- sonar.tests + sonar.test.inclusions: declare spec files as test code
- fixes 31.9% coverage on new code and 4.8% duplication failures

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

---------

Co-authored-by: Zaiidmo <zaiidmoumnii@gmail.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>
Zaiidmo added a commit that referenced this pull request Apr 10, 2026
* ops: updated sonar variable

* Feat/compt 75 typed job definitions ischeduler interface (#3)

* feat(COMPT-75): define typed scheduled job contracts and IScheduler port

- Add ScheduledJob type: name, handler, and one of cron | interval | timeout
- Add IScheduler interface: schedule, unschedule, reschedule, list
- Add ScheduledJobStatus type: name, cron, lastRun, nextRun, isRunning
- Add DuplicateJobError thrown when registering a duplicate job name
- Enforce cron/interval/timeout mutual exclusivity via discriminated union
- Add CronExpression named constants for human-readable schedules
- Add cron fluent builder: dailyAt, weeklyOn, monthlyOn, every().minutes()
- Update tsconfig.build.json: CommonJS output, Task 1 files only
- Update package.json: name @ciscode/scheduler-kit, version 0.0.0

* test(COMPT-75): add unit tests for CronExpression and cron builder

* feat(COMPT-75): add ScheduledJobStatus type and status/listStatus methods

- Add ScheduledJobStatus type: name, cron, lastRun, nextRun, isRunning
- Add status(name) and listStatus() to IScheduler interface and SchedulerService
- Track lastRun timestamp after each execution
- Store cronJob reference for nextRun via cronJob.nextDate()
- Export ScheduledJobStatus from public API
- Fix lint: no-misused-promises, no-floating-promises, prettier formatting

* style(COMPT-75): format all files with prettier

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 76 nestjs scheduler module and service (#4)

* feat(COMPT-76): NestJS SchedulerModule and SchedulerService integration

- SchedulerModule.register() and registerAsync() dynamic module factories
- SchedulerService: schedule(), reschedule(), unschedule(), list(), status(), listStatus()
- @Cron, @interval, @timeout decorators with optional job name
- MetadataScanner auto-discovers decorated provider methods on onModuleInit
- DuplicateJobError guard against double registration
- IScheduler interface and ScheduledJobStatus type
- CronExpression constants and cron fluent builder
- Full unit test coverage across module, service and decorators

* test(COMPT-76): add unit tests for CronExpression and cron builder

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 77 dynamic scheduling error handling (#5)

* chore(COMPT-77): scope index.ts and tsconfig.build.json to COMPT-77 files only

* test(COMPT-77): add tests for status, listStatus, cron jobs and default onJobError

* chore(COMPT-77): restore index.ts and tsconfig.build.json to develop baseline

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* test(COMPT-78): full coverage with Jest fake timers for all schedulin… (#7)

* test(COMPT-78): full coverage with Jest fake timers for all scheduling behaviors

- jest.useFakeTimers() for all time-based tests — no real waiting
- @interval: fires every N ms, stops after unschedule, does not fire before interval
- @timeout: fires exactly once, removes itself from registry, does not fire early
- schedule(): job added and fires on tick
- unschedule(): timer cleared, handler not called after removal
- reschedule(): new schedule applied atomically, old timer cancelled
- Job error: caught via onJobError, scheduler continues — other jobs unaffected
- Concurrent guard: second execution skipped when first still running (isRunning lock)
- status() / listStatus(): reflect isRunning and lastRun correctly
- @Cron: registered and unscheduled without throwing
- Default onJobError: delegates to Logger.error
- Coverage: 98.63% statements, 98.11% branches, 95.34% functions (threshold 85%)

* fix(COMPT-78): resolve SonarCloud S1186 and S4524 issues

- cron-builder.ts: parseInt -> Number.parseInt (Sonar S4524 x3)
- scheduler.decorators.spec.ts: add comments to empty stub methods (Sonar S1186 x6)
- scheduler.module.spec.ts: add comments to empty stub methods and class (Sonar S1186 x6)

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* release(COMPT-79): bump version to 0.1.0, rewrite README, add changeset (#8)

- package.json: 0.0.0 -> 0.1.0
- README: full documentation (decorators, dynamic API, concurrency guard,
  error handling, async config, cron helpers, API reference)
- .changeset/scheduler-kit-v0-1-0.md: minor bump for initial feature release

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* Feat/compt 79 readme changeset publish v0.1.0 (#10)

* release(COMPT-79): bump version to 0.1.0, rewrite README, add changeset

- package.json: 0.0.0 -> 0.1.0
- README: full documentation (decorators, dynamic API, concurrency guard,
  error handling, async config, cron helpers, API reference)
- .changeset/scheduler-kit-v0-1-0.md: minor bump for initial feature release

* fix(COMPT-79): add sonar-project.properties to fix SonarCloud quality gate

- sonar.exclusions: exclude spec files from source analysis
- sonar.tests + sonar.test.inclusions: declare spec files as test code
- fixes 31.9% coverage on new code and 4.8% duplication failures

---------

Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>

* patch lock file deps

* chore(tsconfig): silence TS6 deprecation warnings

---------

Co-authored-by: saadmoumou <s.moumou@ciscod.com>
Co-authored-by: saad moumou <saad.moumou.coder@gmail.com>
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