Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,6 @@ typings/
# TernJS port file
.tern-port

src/schemas/build
# Build directories
src/schemas/build
build/
9 changes: 8 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,11 @@ docs/
test/
.coderabbit.yaml
.gitignore
CONTRIBUTIONS.md
CONTRIBUTIONS.md

# TypeScript source files (use compiled output in build/)
src/
tsconfig.json

# Schema build directory
src/schemas/build/
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doc Detective Common

Shared components for Doc Detective projects.
Shared components for Doc Detective projects. Written in TypeScript with Zod for type-safe schema validation.

## 📦 Installation

Expand All @@ -25,22 +25,41 @@ This package automatically publishes development versions on every commit to the
This package exports the following components:

- `schemas` - JSON schemas for validation
- `validate` - Validation functions
- `validate` - Validation functions using AJV
- `resolvePaths` - Path resolution utilities
- `readFile` - File reading utilities
- `transformToSchemaKey` - Schema key transformation

### TypeScript & Zod Schemas

The package includes Zod schemas for type inference:

```typescript
import {
configV3Schema,
stepV3Schema,
type ConfigV3,
type StepV3
} from 'doc-detective-common';

// Type-safe validation
const config: ConfigV3 = configV3Schema.parse(myConfigObject);
```

## 🧪 Development

```bash
# Install dependencies
npm install

# Build TypeScript and schemas
npm run build

# Run tests
npm test

# Build schemas
npm run build
# Compile TypeScript only
npm run compile
```

## 📄 License
Expand Down
Loading