workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Chore: refactor api/unstable_dev()'s types

Open rozenmd opened this issue 2 years ago • 0 comments

At the moment, unstable_dev takes an object of options, with the following type:

interface DevOptions {
	env?: string;
	ip?: string;
	port?: number;
	localProtocol?: "http" | "https";
	assets?: string;
	site?: string;
	siteInclude?: string[];
	siteExclude?: string[];
	nodeCompat?: boolean;
	experimentalEnableLocalPersistence?: boolean;
	_: (string | number)[]; //yargs wants this
	$0: string; //yargs wants this
}

Ideally, consumers of unstable_dev shouldn't have to know about yargs, so we should resolve whatever typescript problem that requires us to add _ and $0 into that interface.

Also, we should review whether we want to add or remove options from this list for the initial "stable" release of dev.

rozenmd avatar Jul 06 '22 16:07 rozenmd