open-index/open-npm huggingface dataset:
npm package: @semantic-ui/esbuild-callback
Description: ESBuild plugin that executes a callback when a build completes
Author: Jack Lukic
Latest version: 0.17.0

# ESBuild Callback Plugin

A flexible esbuild plugin that executes callback functions at different stages of the build process. Supports all esbuild plugin hooks: `onResolve`, `onLoad`, `onStart`, and `onEnd`. Useful with `watch: true` and `write: false` to perform additional actions when files change.

## Installation

```bash
npm install @semantic-ui/esbuild-callback
```

## Usage

### Using Multiple Callbacks

```js
import { build } from 'esbuild';
import { callback } from '@semantic-ui/esbuild-callback';
import fs from 'fs/promises';

build({
  entryPoints: ['src/index.js'],
  outdir: 'dist',
  bundle: true,
  watch: true,
  plugins: [
    callback({
      
      onLoad: async (args) => {
        // Transform the data...
        // Return the transformed content
      },
      
      // Called when the build starts
      onStart: () => {
        console.log(`Build ${isInitial ? 'started' : 'restarted'}`);
      },
      
      // Called when the build ends
      onEnd: (result, { isInitial }) => {
        console.log(`Build ${isInitial ? 'completed' : 'updated'}`);
        
        if (result.errors.length > 0) {
          console.error('Build had errors:', result.errors);
        }
      }
    })
  ]
});
```

## Callback Hooks

The plugin supports all esbuild plugin hooks:

- `onResolve`: Called when esbuild is resolving import paths
- `onLoad`: Called when esbuild is loading a file
- `onStart`: Called when a build starts
- `onEnd`: Called when a build ends

Each callback receives context including `isInitial` indicating if this is the first build.

## License

MIT
npm package: @semantic-ui/esbuild-log
Description: Simple logging plugin for esbuild
Author: Jack Lukic
Latest version: 0.17.0

# @semantic-next/esbuild-log

A simple logging plugin for esbuild that provides colorized console output.

## Installation

```bash
npm install @semantic-next/esbuild-log
```

## Usage

```javascript
import { build } from 'esbuild';
import { log } from '@semantic-next/esbuild-log';

build({
  entryPoints: ['src/index.js'],
  outdir: 'dist',
  bundle: true,
  plugins: [
    log({
      header: 'Build:',
      text: 'Completed successfully'
    })
  ]
});
```

You can also use a simple string for quick logging:

```javascript
import { build } from 'esbuild';
import log from '@semantic-next/esbuild-log';

build({
  // ...
  plugins: [
    log('Build successful')
  ]
});
```

## Configuration

The plugin accepts an options object with the following properties:

| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `header` | string | undefined | The header text to display |
| `text` | string | undefined | The main message text |
| `includeTime` | boolean | true | Whether to include the current time |
| `isRebuild` | boolean | false | Whether this is a rebuild notification |
| `colors` | object | See below | Colors for different parts of the log |

Default colors:
```javascript
{
  header: 'red',
  text: 'blue',
  rebuild: 'grey',
  time: 'grey'
}
```

## License

MIT
npm package: @semantic-versioning/release
Description: This library was generated with [Nx](https://nx.dev).
Latest version: 0.0.0-development

# release

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build release` to build the library.

## Running unit tests

Run `nx test release` to execute the unit tests via [Jest](https://jestjs.io).