hookdeck-vercel
hookdeck-vercel copied to clipboard
Add support for a typescript config file.
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
}
}
}
}