krakenjs/shortstop

Providing opt-in default implementations for common protocols

jeffharrell opened this issue · 4 comments

Shortstop is a generic implementation at the moment, but why didn't we provide default implementations for some of the more basic types which could be opted into.

Happy to PR it, I just wanted to get everyone's opinions first since we haven't chatted about it.

Do you have examples of basic types you're thinking of? I would be on board with providing them separately from shortstop (in another module), but even things like resolving paths are tricky and require context, such as the base resolve directory that may be different for different implementations.

New module name: "Left-Field" ⚾

One i can think of is requiring a module. Right now the tryRequire implementation, to require a module, is copied and pasted in many places.
Instead we could put the tryRequire here and provide

{       
    "i18n": {
        "use" : "module:makara",
        "fallback": "en-US",
        "contentPath": "path:./locales"
    }
}

to do this automatically for us. This is just a sample for usage in config.. I am not saying we need to specify module makara in the config..hihi