Skip to content

Add support for a typescript config file. #25

Description

@roybarber

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
			}
		}
	}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions