Skip to content
Merged
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
68 changes: 9 additions & 59 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [1.0.0](https://github.com/cawpea/coderef/compare/v0.1.0...v1.0.0) (2026-01-01)


### Bug Fixes

* exclude CODE_REF comments in unclosed code blocks from validation ([f1f5287](https://github.com/cawpea/coderef/commit/f1f52879dbed2d8ffaaf29fdba959e401fc81d2a))
* handle variable-length backtick sequences in code blocks ([b5674ad](https://github.com/cawpea/coderef/commit/b5674add6060fbb429190ca97a02526ae16c31f2))


### Features

* remove default .docsignore value from configuration ([67967d3](https://github.com/cawpea/coderef/commit/67967d3adccb5709ea8bfc2e357d8ff685831e12))


### BREAKING CHANGES

* The `ignoreFile` configuration no longer defaults to '.docsignore'.
To continue using .docsignore, explicitly set `ignoreFile: '.docsignore'` in your
configuration file (.coderefrc.json or package.json).

This change makes the ignore file behavior explicit rather than implicit, applying
ignore patterns only when intentionally configured. All documentation examples now
use `.gitignore` instead of `.docsignore` to reflect this generic approach.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

# 1.0.0 (2025-12-31)


### Bug Fixes

* add npm rebuild step to resolve rollup native binary issue in CI ([4ec06ad](https://github.com/cawpea/coderef/commit/4ec06add097033d7aa6aa531e08c8e09c693b599))
* add pull-requests write permission to claude-code-review workflow ([be5b41d](https://github.com/cawpea/coderef/commit/be5b41d41015aa05697099625ad484e441ba2ffe))
* add rollup as explicit devDependency to resolve CI build issue ([01061e5](https://github.com/cawpea/coderef/commit/01061e519ab3f80d884810738e4396d3c47d2f53))
* clear npm cache to resolve rollup native binary issue in CI ([0cd15bd](https://github.com/cawpea/coderef/commit/0cd15bd142aec85303469c8d917955711f4121c6))
* correct collectCoverageFrom pattern order in Jest config ([dbac613](https://github.com/cawpea/coderef/commit/dbac61383fe0e4dbe6d3654c22615b0bab8235b3))
* prevent command injection in git-diff by using spawnSync ([105a9c2](https://github.com/cawpea/coderef/commit/105a9c263a5ade19d138a0d5ec020619b62e824e))
* reinstall rollup to ensure native binaries are installed in CI ([389e7af](https://github.com/cawpea/coderef/commit/389e7afaa7792b0eadf75fa9bef8e1fe0f708360))
* run npm install after npm ci to fix rollup native binary issue ([2816913](https://github.com/cawpea/coderef/commit/2816913af1d10e445b2942ecf1044f39e40f25ff))
* translate remaining japanese character to english in src/utils/fix.ts ([68c57ba](https://github.com/cawpea/coderef/commit/68c57babfdd5ee847af57d29b47ac28168e456cf))
* update project root to use config ([97724b3](https://github.com/cawpea/coderef/commit/97724b3467d61b67917a0c8c4446dd8485482960))


### Features
## [Unreleased]

* add ESLint configuration for scripts directory ([236ad04](https://github.com/cawpea/coderef/commit/236ad042620d3b6ad9af2f2c57469e4e95f52f5d))
* add variable reference support in CODE_REF ([d098259](https://github.com/cawpea/coderef/commit/d098259dcecf185e0743baddd0dccc4b960ea471))
* implement CLI with commander and programmatic API ([3ec29f8](https://github.com/cawpea/coderef/commit/3ec29f8b18f6128e85723df6315a76ed52baacf1))
* implement configuration system ([43bf006](https://github.com/cawpea/coderef/commit/43bf006df05e2fbf31301ed081c9807a5b3c2a60))
* integrate configuration system into fix.ts ([6192ccd](https://github.com/cawpea/coderef/commit/6192ccdeec20c3b783b606c0de779463fad56066))
* integrate configuration system into validate.ts ([b6638ef](https://github.com/cawpea/coderef/commit/b6638ef47b0c9f7019f8271776d01e041cda3969))
* migrate core logic and utils from figma-a11y-reviewer ([19efe8c](https://github.com/cawpea/coderef/commit/19efe8caafc4396054ab4d37ebe79d25a9c21846))
* translate comments and logs to english in src/cli/fix.ts ([f4cd0b8](https://github.com/cawpea/coderef/commit/f4cd0b89f12056a3139dfbe50bc6ff1ec9825e05))
* translate comments and messages to english in src/core/validate.ts and tests ([79f609e](https://github.com/cawpea/coderef/commit/79f609e0bc22eab31bbe38a69d01e1a54e7e099b))
* translate comments and messages to english in src/utils/fix.ts and tests ([7b2dafb](https://github.com/cawpea/coderef/commit/7b2dafb44a5f0cd3c0ae3f94640de7447d432339))
* translate japanese logs and comments to english ([4a20066](https://github.com/cawpea/coderef/commit/4a20066692f73e453cf806ed0d2dc2ed097bf9cd))
### Changed

## [Unreleased]
- **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