Skip to content

RFC; Promote coffee-script as peerDependency in scripts #33

@mal

Description

@mal

At present quite a lot of hubot-* plugins list one coffee-script version or another as a dependency. Of those, many are specifing the same version that hubot itself depends on, and thus it should only been needed for testing and should probably be in devDependencies.

Some scripts however require more recent versions of coffee-script for various reasons, by listing it in peerDependencies rather than dependencies we get the benefit of npm detecting conflicting scripts at install time rather than waiting for everything to explode when bin/hubot gets executed.

Given that coffee-script isn't in the script template's _package.json at all (and doesn't need to be) I'm not sure what the best approch here would be (assuming this all makes sense).

One possibility is porting #27 over to allow optionally specifing the coffee-script version at app creation time, at which point we have the generator write it into peerDependencies as part of the generation. The only problem I forsee with this is that it might not be apparent at creation time that a newer version than 1.6.3 might be required. To combat this a sane default for new scripts might be ^1.6.3.

This could potentially lead to some weirdness where a peerDependencies conflict should have arisen but a package erroneously lists the version constraint as ^1.6.3 while in reality requiring a more recent minimum version. My hope is that with some clear documentation it should be a relatively trivial fix (update package.json so next time it will conflict and warn the end user about incompatible scripts at install time).

Hope all that makes some semblance of sense, look forward to hearing your thoughts!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions