hookdeck-vercel icon indicating copy to clipboard operation
hookdeck-vercel copied to clipboard

Add support for a typescript config file.

Open roybarber opened this issue 11 months ago • 0 comments

On build the 'hookdeck-vercel deploy' looks for the hookdeck.config.js which is a commonJS module.

Would it be possible to add support for typescript configs for projects where commonJS is not configured, more specifically for linting.

Example:

const { RetryStrategy, DestinationRateLimitPeriod } = require('@hookdeck/sdk/api')
/** @type {import("@hookdeck/vercel").HookdeckConfig} */
const hookdeckConfig = {
	vercel_url: process.env.BASE_URL || process.env.VERCEL_URL,
	match: {
		'/api/webhook': {
			retry: {
				strategy: RetryStrategy.Linear,
				count: 5,
				interval: 1 * 60 * 1000 // in milliseconds
			}
		}
	}
}
module.exports = hookdeckConfig

to

import { RetryStrategy, DestinationRateLimitPeriod } from '@hookdeck/sdk/api'
import type { HookdeckConfig } from '@hookdeck/vercel'

export const config: HookdeckConfig = {
	vercel_url: process.env.BASE_URL || process.env.VERCEL_URL,
	match: {
		'/api/webhook': {
			retry: {
				strategy: RetryStrategy.Linear,
				count: 5,
				interval: 1 * 60 * 1000 // in milliseconds
			}
		}
	}
}

roybarber avatar Jan 12 '25 19:01 roybarber