RamblingCookieMonster / PSDepend

PowerShell Dependency Handler
MIT License
285 stars 76 forks source link

Extend simple syntax with a namespace of sorts #41

Closed RamblingCookieMonster closed 6 years ago

RamblingCookieMonster commented 7 years ago

Currently, one can write dependencies in a simple syntax (key = ), and a more flexible syntax (key = hashtable).

The way we determine dependency type in the simple syntax is full of janky logic.

While we need to keep this for backwards compatibility and to keep things simple where needed, we might also improve on it without adding too much complexity by adding namespacing of some sort.

Hypothetical examples:

#<DependencyType>::<Name> = <Version>
Npm::Gitbook-Cli = '0.1.0'
PSGalleryNuget::PSNeo4j = 'latest'

Not sure if this makes sense, or if it would overcomplicate things too much?

Cheers!

michaeltlombardi commented 7 years ago

I really like the namespacing option here, vastly simplifies a lot of dependency declaractions - maybe include with a warning about deprecating the existing logic, and actually deprecate in the next major version?

RamblingCookieMonster commented 7 years ago

Hiyo! Yeah, it will be confusing with all three types, particularly if intermixed. I do like the simple interpreted syntax for quick and dirty dependencies though. Maybe revisit if we start to see confusion / ugly dependency files?

Other than that, any concerns over this implementation? Not too much to it, just hijacking the first if to look for :: in the key, and updated supporting stuff here and there (docs/tests).

Cheers!

michaeltlombardi commented 7 years ago

I have no complaints, looks simple enough! I prefer this over more regex madness. 😄

I don't think there's going to be too much confusion and pain over adding this in the meantime, I am trying to think of dependency files that could get gross - mine are probably among the worst, needing chocolatey, PowerShell modules, and node modules for my documentarian module.

RamblingCookieMonster commented 6 years ago

this is in place - if you think it would be worth deprecating somewhere down the line, feel free to open a PR!