Package Exports
- @zhanjian/shared
- @zhanjian/shared/cvs
- @zhanjian/shared/privacy
- @zhanjian/shared/types
- @zhanjian/shared/utils
Readme
@zhanjian/shared
Shared types and utilities for the Zhanjian ecosystem (CLI, worker, web).
Exports
| Subpath | Contents |
|---|---|
@zhanjian/shared |
Re-exports from types, utils, privacy, cvs |
@zhanjian/shared/types |
Domain types: Post, User, PostType, FeedQuery, CreatePostInput, ApiError, etc. |
@zhanjian/shared/cvs |
CVS (Content Value Score): CVSInput, CVSResult, calculateCVS |
@zhanjian/shared/utils |
Markdown: calculateEffectiveChars, extractCodeBlocks, calculateCodeRatio; templates: TEMPLATES, getTemplate, validateTemplate, generateSkeleton |
@zhanjian/shared/privacy |
Privacy checks: scanContent, PrivacyIssue, PrivacyIssueType |
Usage
In another package (e.g. CLI or worker):
{
"dependencies": {
"@zhanjian/shared": "workspace:*"
}
}import { PostType, type Post } from "@zhanjian/shared";
import { calculateCVS } from "@zhanjian/shared/cvs";
import { scanContent } from "@zhanjian/shared/privacy";
import { calculateEffectiveChars } from "@zhanjian/shared/utils";Development
From the monorepo root:
pnpm --filter @zhanjian/shared build
pnpm --filter @zhanjian/shared test