sayedihashimi / dotnet-waffle

3 stars 0 forks source link

Add cwd automatically as a source #1

Open sayedihashimi opened 8 years ago

sayedihashimi commented 8 years ago

From https://github.com/OmniSharp/OmniSharp/issues/11#issuecomment-200043024

it'd be nice if the cwd or git root are auto included as sources so projects can ship local templates in checkouts without poluting the overal available templates.

dmccaffery commented 8 years ago

This is just a thought, but you might want to specify this path in the project.json in the tooling: {} section, or otherwise use a convention based approach, such as scanning ./waffle or ./templates or something of that sort.

The reason that I am suggesting this is that you will need to be very careful with doing deep hierarchy scans of the cwd given all of the package managers out there and the different conventions they use for caching local. For instance, you would want to ignore packages, node_modules, jspm_packages, bower_components, and i'm sure i'm missing five or six of them. I wouldn't want to try to keep up to date with that sort of thing if it can be helped (if it were me).

:)

sayedihashimi commented 8 years ago

This is just a thought, but you might want to specify this path in the project.json in the tooling: {} section

I'm trying to make sure that whatever we create here is not strongly tied to any particular framework or set of tools. I'd like to be able to reuse these components for a variety of projects and items. Including multi-project templates.

The reason that I am suggesting this is that you will need to be very careful with doing deep hierarchy scans of the cwd given all of the package managers out there and the different conventions they use for caching local. For instance, you would want to ignore packages, node_modules, jspm_packages, bower_components, and i'm sure i'm missing five or six of them. I wouldn't want to try to keep up to date with that sort of thing if it can be helped (if it were me).

Great point, I didn't think of that issue. I'd like to avoid any new directories or particular structure, just to make things as simple as possible. Creating templates has been too hard for too long. How about when scanning a directory only check X sub-directories, where X is something like 10 by default?

dmccaffery commented 8 years ago

Hmm... All of this makes total sense. I agree that avoiding integration with a specific project model / framework would be ridiculously awesome and flexible.

I can't think of an instance where someone would bury a template deeper than 10 levels down, so I think that works. Its also something that can easily be documented and understood as a limitation without increasing the burden of organizing / sourcing template locations. :+1: