Skip to content

fix: generate repository templates against public contracts - #725

Merged
kang-heewon merged 1 commit into
trunkfrom
fix/693-cli-repository-templates
Jun 14, 2026
Merged

fix: generate repository templates against public contracts#725
kang-heewon merged 1 commit into
trunkfrom
fix/693-cli-repository-templates

Conversation

@kang-heewon

Copy link
Copy Markdown
Member

Summary

@croco/cli now generates repository and entity scaffolds that match the public @croco/repository-core contract, so croco make repository, croco make entity, and croco create domain no longer emit nonexistent Entity imports or class inheritance from the Repository interface.

Fixes #693

변경 사항

  • Updated standalone repository and domain repository templates to import type { Repository } and generate concrete implements Repository<..., string> method stubs.
  • Removed the nonexistent Entity import and @Entity() decorator from standalone and domain entity templates.
  • Added regression assertions for generated repository/entity/domain output, including required repository method stubs and rejection of the old invalid contract.
  • Added a generated repository/entity fixture tsc --noEmit check against the repository-core Repository contract.
  • Updated CLI README wording and added a patch changeset for @croco/cli.

Validation

  • pnpm --filter @croco/cli exec vitest run src/tests/makeRepository.spec.ts src/tests/makeEntity.spec.ts src/tests/createDomain.spec.ts - 10 tests passed, including generated fixture tsc --noEmit.
  • pnpm test --filter=@croco/cli - 14 files, 73 tests passed.
  • pnpm typecheck --filter=@croco/cli - passed.
  • pnpm check - passed.
  • pnpm changeset-required:check - passed.
  • git diff --check - passed.
  • Independent adversarial review found no actionable findings.
  • Pre-commit oxlint and oxfmt passed.
  • Pre-push auto-changeset, full test (195 tasks), and full typecheck (194 tasks) passed after rebasing onto current trunk.

Self-review gates

  • Correctness/regression: PASS. Issue [cli] 리포지토리/엔티티 템플릿이 존재하지 않는 repository-core 계약을 생성함 #693 acceptance is covered by makeRepository.spec.ts, makeEntity.spec.ts, and createDomain.spec.ts; generated output no longer references Entity, no longer extends Repository, and the generated repository/entity fixture typechecks against the Repository interface contract.
  • API/security/compatibility/release: PASS. The templates now use existing public Repository types only, no package manifests, dependencies, lockfile, environment assumptions, or secret handling changed, and .changeset/cli-repository-template-contract.md records a patch release.
  • Maintainability/minimality: PASS. The diff is limited to the affected CLI templates, focused regression coverage, README wording, and release metadata; no new runtime abstraction or unrelated cleanup is included.

Residual risk

Low. Generated repositories remain placeholder implementations that return null, [], the input entity, and no-op delete behavior until application code adds real persistence, but they now compile against the current public repository contract.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kang-heewon, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 30 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 21bad990-4bd4-4056-9e7a-4ccb44361c53

📥 Commits

Reviewing files that changed from the base of the PR and between bc5594d and 0d3e5f8.

📒 Files selected for processing (8)
  • .changeset/cli-repository-template-contract.md
  • packages/cli/README.md
  • packages/cli/src/commands/createDomain.ts
  • packages/cli/src/commands/makeEntity.ts
  • packages/cli/src/commands/makeRepository.ts
  • packages/cli/src/tests/createDomain.spec.ts
  • packages/cli/src/tests/makeEntity.spec.ts
  • packages/cli/src/tests/makeRepository.spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/693-cli-repository-templates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

📊 Benchmark Results

❌ Some benchmarks failed

Benchmark p75 Threshold Baseline vs Baseline Status
CrocoApp benchmarks 3.0μs - - - ⚠️
EventBusConfig.start (10 handlers) 1.3μs - 9.0μs -86.0%
EventPublisher.publishNow single event 1.5μs - - - ⚠️
DefaultHandlerResolver.resolve × 10 0.1μs - 0.2μs -59.5%
Container.get singleton (cold) 1.0μs - 0.5μs +90.4%
Container.register × 50 components 11.6μs - 8.0μs +45.2%
Container.validate (50 components) 29.6μs - 25.0μs +18.3%
Container.get singleton (warm) 0.4μs - 0.3μs +40.3%
TelemetryRuntime benchmarks 2.1μs - 2.0μs +4.2%

Updated: 2026-06-14T17:18:19.844Z · Commit: 7f2bbaa

@kang-heewon
kang-heewon merged commit 9f14ead into trunk Jun 14, 2026
7 of 8 checks passed
@kang-heewon
kang-heewon deleted the fix/693-cli-repository-templates branch June 14, 2026 17:23
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.

[cli] 리포지토리/엔티티 템플릿이 존재하지 않는 repository-core 계약을 생성함

1 participant