@@ -5,13 +5,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55## Commands
66
77### Development
8+
89- ` pnpm test ` - Run tests using Vitest
910- ` pnpm run build ` - Build the TypeScript project
1011- ` pnpm run clean ` - Clean build artifacts
1112- ` pnpm run eslint ` - Run ESLint linting
1213- ` pnpm run eslint:fix ` - Run ESLint with auto-fix
1314
1415### Package Management
16+
1517- Uses pnpm as package manager (required, enforced by preinstall hook)
1618- ` pnpm install ` - Install dependencies
1719
@@ -22,28 +24,33 @@ This is a TypeScript implementation of PHPDoc parser inspired by PHPStan's phpdo
2224### Core Components
2325
2426** Lexical Analysis (` src/phpdoc-parser/lexer/ ` )**
27+
2528- ` lexer.ts ` - Tokenizes PHPDoc strings using regex patterns
2629- Handles 20+ token types (identifiers, types, operators, brackets, etc.)
2730
2831** Parsing (` src/phpdoc-parser/parser/ ` )**
32+
2933- ` php-doc-parser.ts ` - Main parser that converts tokens to AST nodes
3034- ` type-parser.ts ` - Handles type parsing (generics, unions, intersections)
3135- ` const-expr-parser.ts ` - Parses constant expressions
3236- ` token-iterator.ts ` - Token stream management with savepoint/rollback
3337- ` string-unescaper.ts ` - String literal processing
3438
3539** AST Nodes (` src/phpdoc-parser/ast/ ` )**
40+
3641- Base interfaces: ` node.ts ` , ` base-node.ts `
3742- ** php-doc/** : PHPDoc-specific nodes (tags, text, parameters, etc.)
3843- ** type/** : Type system nodes (unions, intersections, generics, arrays)
3944- ** const-expr/** : Constant expression nodes (strings, numbers, arrays)
4045
4146** Printing (` src/phpdoc-parser/printer/ ` )**
47+
4248- ` printer.ts ` - Converts AST back to formatted PHPDoc
4349- ` differ.ts ` - Format-preserving printing with diff tracking
4450- Supports both clean formatting and original format preservation
4551
4652** Transpilation (` src/phpdoc-parser/transpiler/ ` )**
53+
4754- ` php-doc-to-typescript-type-transpiler.ts ` - Converts PHPDoc types to TypeScript
4855
4956### Key Patterns
@@ -66,4 +73,4 @@ This is a TypeScript implementation of PHPDoc parser inspired by PHPStan's phpdo
6673
6774- ` src/index.ts ` - Main entry point exporting all public APIs
6875- ` tests/ ` - Test files organized by component (lexer, parser, printer, transpiler)
69- - TypeScript build configuration in ` tsconfig.build.json `
76+ - TypeScript build configuration in ` tsconfig.build.json `
0 commit comments