Skip to content
Merged
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- **Package rename**: Changed package name from `@cawpea/coderef` to `docs-coderef` (removed scope)
- **CLI command**: Changed from `coderef` to `docs-coderef`
- **Config file**: Renamed from `.coderefrc.json` to `.docs-coderefrc.json`
- **package.json field**: Changed from `"coderef"` to `"docs-coderef"`
- **Environment variables**: Changed from `CODEREF_*` to `DOCS_CODEREF_*`
- **Repository**: Renamed from `cawpea/coderef` to `cawpea/docs-coderef`

### Added

- Initial project setup
- Basic directory structure
- Configuration files (package.json, tsconfig.json, jest.config.js)

[unreleased]: https://github.com/cawpea/coderef/compare/v0.1.0...HEAD
[unreleased]: https://github.com/cawpea/docs-coderef/compare/v0.1.0...HEAD
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

`@cawpea/coderef` is a tool for validating and auto-fixing code references in markdown documentation. It ensures code snippets in documentation stay synchronized with actual source code through CODE_REF comments and AST-based symbol searching.
`docs-coderef` is a tool for validating and auto-fixing code references in markdown documentation. It ensures code snippets in documentation stay synchronized with actual source code through CODE_REF comments and AST-based symbol searching.

## Quick Reference

Expand Down
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# @cawpea/coderef
# docs-coderef

> Validate and fix code references in markdown documentation

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Status**: 🚧 Under Development
Validate and fix code references in markdown documentation

## Overview

`@cawpea/coderef` is a tool to validate and automatically fix code references in markdown documentation. It ensures that code snippets in your documentation stay in sync with your actual source code.
`docs-coderef` is a tool to validate and automatically fix code references in markdown documentation. It ensures that code snippets in your documentation stay in sync with your actual source code.

## Features

Expand All @@ -22,7 +18,7 @@
## Installation

```bash
npm install --save-dev @cawpea/coderef
npm install --save-dev docs-coderef
```

## Quick Start
Expand All @@ -31,19 +27,19 @@ npm install --save-dev @cawpea/coderef

```bash
# Validate all CODE_REF references
npx coderef validate
npx docs-coderef validate

# Fix errors interactively
npx coderef fix
npx docs-coderef fix

# Auto-fix without prompts
npx coderef fix --auto
npx docs-coderef fix --auto
```

### Programmatic Usage

```typescript
import { validate, fix } from '@cawpea/coderef';
import { validate, fix } from 'docs-coderef';

// Validate
const result = await validate({
Expand Down Expand Up @@ -110,7 +106,7 @@ export function generateToken(userId: string): string {
Call this function with a user ID to generate a valid token.
````

When you run `npx coderef validate`, it will verify that the `generateToken` function exists in `src/auth/jwt.ts` and extract its implementation automatically.
When you run `npx docs-coderef validate`, it will verify that the `generateToken` function exists in `src/auth/jwt.ts` and extract its implementation automatically.

### Example 2: Keeping Configuration Examples Up-to-Date

Expand All @@ -133,7 +129,7 @@ export const config = {
These values are loaded at application startup.
````

If the `config` object in your source code changes, running `npx coderef fix --auto` will automatically update the documentation to reflect the current implementation.
If the `config` object in your source code changes, running `npx docs-coderef fix --auto` will automatically update the documentation to reflect the current implementation.

### Example 3: Documenting Specific Code Sections

Expand Down Expand Up @@ -165,7 +161,7 @@ For more examples and usage patterns, see [docs/user-guide/](docs/user-guide/).

## Configuration

Create `.coderefrc.json` in your project root:
Create `.docs-coderefrc.json` in your project root:

```json
{
Expand All @@ -175,10 +171,6 @@ Create `.coderefrc.json` in your project root:
}
```

## Development

This package is currently under active development. More documentation will be added soon.

## License

MIT © cawpea
4 changes: 2 additions & 2 deletions bin/coderef.js → bin/docs-coderef.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env node

/**
* CLI entry point for @cawpea/coderef
* CLI entry point for docs-coderef
*/

const { program } = require('commander');
const packageJson = require('../package.json');

program
.name('coderef')
.name('docs-coderef')
.description('Validate and fix code references in markdown documentation')
.version(packageJson.version);

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation Index

Welcome to the @cawpea/coderef documentation. This guide is organized into three main sections:
Welcome to the docs-coderef documentation. This guide is organized into three main sections:

## For Users

Expand Down
2 changes: 1 addition & 1 deletion docs/development/documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation Guidelines

This guide explains how to write and maintain documentation for the @cawpea/coderef project.
This guide explains how to write and maintain documentation for the docs-coderef project.

## Documentation Structure

Expand Down
22 changes: 11 additions & 11 deletions docs/development/release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Process

This document describes the release process for `@cawpea/coderef`.
This document describes the release process for `docs-coderef`.

## Overview

Expand Down Expand Up @@ -82,7 +82,7 @@ You can manually trigger a release from the GitHub UI when needed.
#### Steps

1. **Open GitHub Repository Page**
- https://github.com/cawpea/coderef
- https://github.com/cawpea/docs-coderef

2. **Navigate to Actions Tab**
- Click the "Actions" tab at the top
Expand Down Expand Up @@ -144,7 +144,7 @@ See [Git Conventions](./git-conventions.md) for more details.
When a release succeeds, the following are automatically created:

1. **npm Package**
- https://www.npmjs.com/package/@cawpea/coderef
- https://www.npmjs.com/package/docs-coderef
- New version is published

2. **Git Tag**
Expand All @@ -169,23 +169,23 @@ After a release, verify the following:

### 1. Check GitHub Actions

- Visit https://github.com/cawpea/coderef/actions
- Visit https://github.com/cawpea/docs-coderef/actions
- Verify Release workflow completed successfully
- Ensure all steps have green checkmarks

### 2. Check npm Package

```bash
# Check latest version
npm view @cawpea/coderef version
npm view docs-coderef version

# Test package installation
npm install @cawpea/coderef@latest
npm install docs-coderef@latest
```

### 3. Check GitHub Release

- Visit https://github.com/cawpea/coderef/releases
- Visit https://github.com/cawpea/docs-coderef/releases
- Verify new release was created
- Verify release notes are correctly generated

Expand Down Expand Up @@ -237,7 +237,7 @@ git describe --tags --abbrev=0

2. **Package Name Conflict**
- Verify package with same name doesn't already exist on npm
- For scoped packages (`@cawpea/coderef`), verify `publishConfig.access: "public"` is set
- For scoped packages (e.g., `@company/package-name`), verify `publishConfig.access: "public"` is set

3. **Network Error**
- May be a temporary error
Expand Down Expand Up @@ -280,16 +280,16 @@ Procedures for rolling back a release when issues occur.

```bash
# Unpublish package version (within 72 hours)
npm unpublish @cawpea/coderef@X.Y.Z
npm unpublish docs-coderef@X.Y.Z

# Or deprecate package (after 72 hours)
npm deprecate @cawpea/coderef@X.Y.Z "This version has critical issues. Please use vX.Y.Z-1 instead."
npm deprecate docs-coderef@X.Y.Z "This version has critical issues. Please use vX.Y.Z-1 instead."
```

### Delete GitHub Release

1. **Delete from GitHub UI**
- Visit https://github.com/cawpea/coderef/releases
- Visit https://github.com/cawpea/docs-coderef/releases
- Open the relevant release
- Click "Delete" button

Expand Down
24 changes: 12 additions & 12 deletions docs/user-guide/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Validate all CODE_REF references in your documentation:

```bash
npx coderef validate
npx docs-coderef validate
```

### Validate Specific Files or Directories
Expand All @@ -16,21 +16,21 @@ You can specify files or directories to validate:

```bash
# Validate a specific file
npx coderef validate docs/README.md
npx docs-coderef validate docs/README.md

# Validate a specific directory
npx coderef validate docs/backend/
npx docs-coderef validate docs/backend/

# Validate multiple files/directories
npx coderef validate docs/README.md docs/api/
npx docs-coderef validate docs/README.md docs/api/
```

### Options

- `--verbose`, `-v`: Display detailed output including reference counts per file

```bash
npx coderef validate --verbose
npx docs-coderef validate --verbose
```

## Fix Command
Expand All @@ -40,7 +40,7 @@ npx coderef validate --verbose
Fix errors interactively with colored diffs:

```bash
npx coderef fix
npx docs-coderef fix
```

This will prompt you for each error with options to apply the fix or skip.
Expand All @@ -50,25 +50,25 @@ This will prompt you for each error with options to apply the fix or skip.
- `--auto`: Automatically apply all fixes without prompting for confirmation

```bash
npx coderef fix --auto
npx docs-coderef fix --auto
```

- `--dry-run`: Simulate fixes without making actual changes (useful for testing)

```bash
npx coderef fix --dry-run
npx docs-coderef fix --dry-run
```

- `--backup`: Create backup files before applying fixes (default: no backup)

```bash
npx coderef fix --backup
npx docs-coderef fix --backup
```

- `--verbose`, `-v`: Display detailed output during the fix process

```bash
npx coderef fix --verbose
npx docs-coderef fix --verbose
```

### Combining Options
Expand All @@ -77,10 +77,10 @@ You can combine multiple options:

```bash
# Auto-fix with backup
npx coderef fix --auto --backup
npx docs-coderef fix --auto --backup

# Dry run with verbose output
npx coderef fix --dry-run --verbose
npx docs-coderef fix --dry-run --verbose
```

## Exit Codes
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/code-ref-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,13 @@ Always use paths relative to your project root.
After adding CODE_REF comments, run validation:

```bash
npx coderef validate
npx docs-coderef validate
```

If there are mismatches, fix them interactively:

```bash
npx coderef fix
npx docs-coderef fix
```

For implementation details, see [CODE_REF Syntax Implementation](../architecture/code-ref-syntax.md).
Loading
Loading