Skip to content

Documentation: Clarify FEATURE_DIRECTIVE_REGEX format and expected usage in story utils #12

@crazygo

Description

@crazygo

Issue Description

The FEATURE_DIRECTIVE_REGEX in src/drivers/story/utils.ts lacks clear documentation about the expected format and valid usage patterns for feature/slug directives.

Current Implementation

Issue

The regex pattern allows multiple formats but it's unclear what the intended usage should be:

  1. Format Variations:

  2. Capture Groups:

    • Group 1: The actual slug (alphanumeric + underscores/hyphens)
    • Group 2: Optional trailing content (purpose unclear)
  3. Usage Examples: It's not documented what valid formats are expected or how the trailing content should be handled.

Questions to Clarify

  1. Expected Format: Should users use or ?
  2. Trailing Content: What should happen with the second capture group? Is it ignored? Used as description?
  3. Validation: Are there any restrictions on the slug format beyond the regex pattern?
  4. Examples: What are some valid and invalid examples of usage?

Proposed Solution

Add comprehensive documentation to clarify:

  1. Expected Format: Document the standard format for feature/slug directives
  2. Usage Examples: Provide clear examples of valid usage patterns
  3. Validation Rules: Specify what constitutes a valid slug
  4. Behavior: Explain how trailing content is handled

Example documentation to add:

Files to Modify

    • Add JSDoc documentation for the regex pattern

Priority

Low - Documentation improvement that doesn't affect functionality but helps with developer experience and understanding.

Labels

documentation, story-driver, regex, developer-experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions