Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow turbowatch to load its configuration from a package #51

Open
AlexAegis opened this issue Aug 3, 2023 · 0 comments
Open

Allow turbowatch to load its configuration from a package #51

AlexAegis opened this issue Aug 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@AlexAegis
Copy link

AlexAegis commented Aug 3, 2023

Desired Behavior

turbowatch @myorg/turbowatch-config

It would be nice to just tell turbowatch to expect the default export of a package to be a config, or a function returning a promise of a config, and use that.

Motivation

I managed to make a pretty cool config that I'm gonna take with me with every single project I have.

That means I will have the same file in all of them:

import { turbowatchLocalNodeModules } from '@alexaegis/turbowatch';
import { watch } from 'turbowatch';

void (async () => {
	await watch(
		await turbowatchLocalNodeModules({
			buildDependenciesScript: 'build:dependencies',
			devScript: 'dev_',
		}),
	);
})();

Had to use an IIFE because top level awaits don't work currently with turbowatch

It would nice to not have to copy the same thing everywhere and just have the package installed.

This could be blocked by #16 if I can't import anything from turbowatch, or could be worked around if you export just the type of the configuration. (Currently I have extract it like this Parameters<typeof import('turbowatch').watch>[0])

This is really is just a nice-to-have, especially for me because I already have another project that automatically copies this file everywhere it's used.

@AlexAegis AlexAegis added the enhancement New feature or request label Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant