open-index/open-npm huggingface dataset:
npm package: @pilaf/cli
Description: Command-line interface for Pilaf testing framework.
Latest version: 1.3.1

# @pilaf/cli

Command-line interface for Pilaf testing framework.

## Installation

```bash
# Install globally
pnpm add -g @pilaf/cli

# Or install locally
pnpm add -D @pilaf/cli
```

## Usage

```bash
# Run all Pilaf tests
pilaf test

# Run specific test file
pilaf test path/to/test.pilaf.test.js

# Run with verbose output
pilaf test --verbose

# Generate HTML report
pilaf report

# Show help
pilaf --help
```

## Configuration

Pilaf looks for a `pilaf.config.js` file in your project root:

```javascript
// pilaf.config.js
module.exports = {
  backend: {
    rcon: {
      host: 'localhost',
      port: 25575,
      password: process.env.RCON_PASSWORD || 'dragon'
    },
    mineflayer: {
      host: 'localhost',
      port: 25565,
      auth: 'offline'
    }
  },
  testMatch: ['**/*.pilaf.test.js', '**/*.story.test.js'],
  testIgnore: ['**/node_modules/**', '**/dist/**'],
  reportDir: 'target/pilaf-reports',
  timeout: 30000,
  retries: 0,
  verbose: false
};
```

## Environment Variables

```bash
# RCON Connection
RCON_HOST=localhost
RCON_PORT=25575
RCON_PASSWORD=your_password

# Minecraft Server
MC_HOST=localhost
MC_PORT=25565

# Authentication
MC_AUTH=offline  # or 'microsoft'
```

## Commands

### `pilaf test [files...]`

Run Pilaf tests.

```bash
# Run all tests
pilaf test

# Run specific file
pilaf test tests/basic-rcon.pilaf.test.js

# Run with pattern
pilaf test tests/**/*.pilaf.test.js

# Verbose mode
pilaf test --verbose
```

### `pilaf report`

Generate HTML report from test results.

```bash
pilaf report
```

Report is saved to `target/pilaf-reports/index.html` by default.

### `pilaf init`

Initialize Pilaf configuration in your project.

```bash
pilaf init
```

Creates `pilaf.config.js` with default settings.

## Examples

Create a test file `my-plugin.test.js`:

```javascript
const { describe, it, expect } = require('@jest/globals');
const { StoryRunner } = require('@pilaf/framework');

describe('My Plugin', () => {
  it('should do something', async () => {
    const runner = new StoryRunner();

    const result = await runner.execute({
      name: 'My Test',
      setup: {
        server: {
          rcon: {
            host: process.env.RCON_HOST,
            port: parseInt(process.env.RCON_PORT),
            password: process.env.RCON_PASSWORD
          }
        }
      },
      steps: [
        {
          name: 'Execute command',
          action: 'execute_command',
          command: 'say Hello!'
        }
      ],
      teardown: { stop_server: false }
    });

    expect(result.success).toBe(true);
  });
});
```

Run the test:

```bash
pilaf test my-plugin.test.js
```

## License

MIT
npm package: @pilaf/reporting
Description: HTML report generation for Pilaf test results.
Latest version: 1.3.1

# @pilaf/reporting

HTML report generation for Pilaf test results.

Generates interactive, browser-based reports from Pilaf test execution data.

## Installation

```bash
pnpm add @pilaf/reporting
```

## Usage

```javascript
const { ReportGenerator } = require('@pilaf/reporting');

const generator = new ReportGenerator({
  templatePath: './path/to/template.html',
  cssPath: './path/to/styles.css'
});

const reportData = {
  suiteName: 'My Plugin Tests',
  stories: [
    {
      name: 'Test Story',
      status: 'passed',
      startTime: Date.now(),
      endTime: Date.now(),
      steps: [
        { name: 'Step 1', action: 'execute_command', response: '...' }
      ],
      consoleLogs: []
    }
  ],
  startTime: Date.now(),
  endTime: Date.now()
};

// Generate HTML report
const outputPath = generator.generate(reportData, './target/report.html');
console.log(`Report saved to: ${outputPath}`);
```

## Report Data Structure

```javascript
{
  suiteName: string,           // Test suite name
  stories: [
    {
      name: string,             // Story name
      status: 'passed' | 'failed',
      file: string,             // Source file path
      startTime: number,        // Timestamp
      endTime: number,
      steps: [
        {
          name: string,         // Step name
          action: string,       // Action type
          response: any,        // Action response
          timestamp: number
        }
      ],
      consoleLogs: [
        {
          timestamp: number,
          message: string
        }
      ]
    }
  ],
  startTime: number,
  endTime: number
}
```

## Custom Templates

You can provide custom HTML templates:

```javascript
const generator = new ReportGenerator({
  templatePath: './my-template.html',
  cssPath: './my-styles.css'
});
```

The template should be a valid HTML file with a Vue.js app that receives the report data as a JavaScript object.

## License

MIT