docs: Add CLAUDE.md and mark safeServerCall with warning#509
docs: Add CLAUDE.md and mark safeServerCall with warning#509theodorklauritzen wants to merge 2 commits intomainfrom
Conversation
- Add comprehensive CLAUDE.md file for Claude Code integration - Mark safeServerCall function with @warning as it should only be used internally by the service operation system Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Jeg har fått et nytt leketøy jeg måtte teste hehe. Nå håper jeg refactoring blir en lek. Men jeg er faktisk fasinert over hvor greit den oppsummerte prosjektet vårt. Det er faktisk mega nyttig som et overblikk over hvordan vi koder. |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for Claude Code instances and marks an internal function with a warning annotation to prevent direct usage.
Changes:
- Added CLAUDE.md with development setup, architecture patterns, and project structure documentation
- Added
@warningJSDoc tag tosafeServerCallfunction indicating it's for internal use only
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CLAUDE.md | New comprehensive guide covering development commands, ServiceOperation architecture pattern, project structure, path aliases, and important coding conventions |
| src/services/actionError.ts | Added @warning JSDoc tag to safeServerCall function to indicate it should not be called directly |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Change function name from defineServiceOperation to defineOperation - Add required authorizer parameter to match actual API Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Paulijuz
left a comment
There was a problem hiding this comment.
Nice. Now we can just have a Claude subscription instead of taking on new people next year.
| - **ServiceOperation**: Core abstraction defined in `src/services/serviceOperation.ts`. All business logic is wrapped in ServiceOperations. | ||
| - **Server Actions**: Client-callable functions created by wrapping ServiceOperations with `makeAction()` from `src/services/serverAction.ts`. | ||
| - **Authorization**: Custom authorization system with Authorizer classes (see `src/auth/authorizer/`). Each ServiceOperation specifies its required permissions. | ||
| - **Transaction Management**: ServiceOperations can open database transactions via the `opensTransaction` option. |
There was a problem hiding this comment.
This is wrong. opensTransaction indicates that the service is going to open a transaction. This does not open a transaction automatically. Such an argument is needed as nesting transactions is not possible, thus to make the typing and internal validation work a service need to know it can be called from within another transaction. If you have a better name suggestion go ahead.
There was a problem hiding this comment.
It looks like the doc string for define Operation disappeared at some point... 😞
There was a problem hiding this comment.
It looks like the doc string for define Operation disappeared at some point... 😞
Summary
safeServerCallfunction with@warningJSDoc tag to indicate it should only be used internally by the service operation systemDetails
CLAUDE.md
The new CLAUDE.md file includes:
safeServerCall Warning
Updated the JSDoc comment for
safeServerCallto include a warning that it should not be called directly, as the service operation system handles this internally.Test plan
@warningJSDoc tag displays correctly in IDE tooltips🤖 Generated with Claude Code