Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 10, 2025

This PR adds a new "🚀 Running Example Applications" section to AGENTS.md that provides comprehensive documentation for running all example applications across the repository's crates.

What's Added

The new section includes:

  • Quick Start Guide: Basic pattern for running examples with test file creation

  • Categorized Examples: All 18 examples organized by functionality across 10 crates:

    • Parser Examples (4 examples in oxc_parser)
    • Linter Examples (1 example in oxc_linter)
    • Semantic Analysis Examples (2 examples in oxc_semantic)
    • Code Generation Examples (2 examples in oxc_codegen)
    • Transformer Examples (1 example in oxc_transformer)
    • Minifier Examples (3 examples in oxc_minifier)
    • Formatter Examples (1 example in oxc_formatter)
    • Isolated Declarations Examples (1 example in oxc_isolated_declarations)
    • Regular Expression Examples (2 examples in oxc_regular_expression)
    • Complete Compiler Examples (1 example in oxc)
  • Usage Patterns: Common patterns, file input handling, test file creation examples

  • Development Tips: Using just watch, special requirements, and AI development guidance

Example Usage

The documentation shows AI assistants how to run examples like:

# Basic parsing with AST display
cargo run -p oxc_parser --example parser test.js --ast

# Complete compilation pipeline
cargo run -p oxc --example compiler --features="full" test.ts

# Dead code elimination
cargo run -p oxc_minifier --example dce test.js

This enhancement makes the repository more accessible to AI assistants by providing clear instructions for exercising all the example applications that demonstrate Oxc's capabilities.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@graphite-app
Copy link
Contributor

graphite-app bot commented Aug 10, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Copilot AI changed the title [WIP] Add instructions for running all example applications in all examples directories to AGENTS.md Add comprehensive example applications documentation to AGENTS.md Aug 10, 2025
Copilot AI requested a review from Boshen August 10, 2025 14:39
Copilot finished work on behalf of Boshen August 10, 2025 14:39
@Boshen Boshen marked this pull request as ready for review August 10, 2025 15:34
Copilot AI review requested due to automatic review settings August 10, 2025 15:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for running example applications across the Oxc repository by introducing a new "🚀 Running Example Applications" section to AGENTS.md. The documentation helps AI assistants understand how to exercise and test all available example applications.

  • Adds categorized documentation for 18 examples across 10 crates with usage patterns
  • Provides quick start guide and development workflow tips
  • Includes practical examples of test file creation and command-line usage patterns

# Basic JavaScript/TypeScript parsing with AST display
cargo run -p oxc_parser --example parser [filename] [--ast] [--estree] [--comments]

# TypeScript JSX parsing demonstration
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra trailing whitespace after 'demonstration'. Remove the trailing space.

Suggested change
# TypeScript JSX parsing demonstration
# TypeScript JSX parsing demonstration

Copilot uses AI. Check for mistakes.
# For JavaScript examples
echo "const x = 1; console.log(x);" > test.js

# For TypeScript examples
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra trailing whitespace after 'examples'. Remove the trailing space.

Suggested change
# For TypeScript examples
# For TypeScript examples

Copilot uses AI. Check for mistakes.
@Boshen Boshen merged commit 363c269 into main Aug 10, 2025
4 checks passed
@Boshen Boshen deleted the copilot/fix-2e2f0698-e016-41bb-81ad-a296fe7116ba branch August 10, 2025 15:35
#### Complete Compiler Examples (`oxc`)
```bash
# Full compilation pipeline (parsing, semantic analysis, transformation, codegen)
cargo run -p oxc --example compiler --features="full" [filename]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cargo features flag syntax is incorrect. It should be either --features "full" (with a space, no equals sign) or --features=full (with equals sign, no quotes). The current syntax combines both approaches incorrectly.

# Correct options:
cargo run -p oxc --example compiler --features "full" [filename]
# or
cargo run -p oxc --example compiler --features=full [filename]
Suggested change
cargo run -p oxc --example compiler --features="full" [filename]
cargo run -p oxc --example compiler --features "full" [filename]

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

taearls pushed a commit to taearls/oxc that referenced this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants