@greybox/wrangler-config-helper

1.3.0 • Public • Published

@greybox/wrangler-config-helper

Utilities for managing Wrangler configurations and test environments for Cloudflare Workers.

Installation

bun add @greybox/wrangler-config-helper

Features

  • Environment-specific configuration management
  • Test environment setup helpers
  • Automatic cleanup of temporary files
  • TypeScript support

Basic Usage

Configuration Management

import { WranglerConfigHelper } from '@greybox/wrangler-config-helper';

const configHelper = new WranglerConfigHelper('./wrangler.toml');
const configPath = configHelper.prepareEnvironmentConfig('staging');

// Clean up when done
configHelper.cleanup();

Test Setup

import { WranglerTestSetup } from '@greybox/wrangler-config-helper';

const testSetup = new WranglerTestSetup<MyEnv>(
  './wrangler.toml',
  './src/worker.ts',
  { environment: 'test' }
);

// Setup test environment
const abortController = new AbortController();
await testSetup.setup(abortController.signal);

// Clean up
await testSetup.cleanup();

API Documentation

Full API documentation is available in the source code and type definitions.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i @greybox/wrangler-config-helper

Weekly Downloads

5

Version

1.3.0

License

none

Unpacked Size

5.53 kB

Total Files

5

Last publish

Collaborators

  • firtina-greybox
  • firtoz