RaveJS / rave

Zero-configuration application bootstrap and development
278 stars 8 forks source link

When bower.json is missing, the default moduleType is ["node"] #57

Closed unscriptable closed 10 years ago

unscriptable commented 10 years ago

If a bower package is missing a bower.json metadata file, rave looks for package.json as an alternate source of metadata. Unfortunately, the default moduleType for package.json is ["node"] which is almost never correct for a bower package. The logic to supply the default moduleType should not depend on the metadata file, it should depend on the package manager.

KidkArolis commented 10 years ago

Shouldn't it be extracted from the main module? That sounds like the best option to me. Why rely on devs specifying moduleType (which is an anti pattern in the first place IMO - package manager should enforce a format and convert between them - anything else will inevitably end up being a mess) On Jul 24, 2014 9:30 PM, "John Hann" notifications@github.com wrote:

If a bower package is missing a bower.json metadata file, rave looks for package.json as an alternate source of metadata. Unfortunately, the default moduleType for package.json is ["node"] which is almost never correct for a bower package. The logic to supply the default moduleType should not depend on the metadata file, it should depend on the package manager.

— Reply to this email directly or view it on GitHub https://github.com/RaveJS/rave/issues/57.

unscriptable commented 10 years ago

While I don't necessarily think that an explicit moduleType is an anti-pattern, I agree with you that the ideal case is to auto-detect.

I'm going to close this issue and open another one that suggests we auto-detect moduleType as the default behavior, rather than default the moduleType metadata property.

OT: you say that a package manager should convert to the correct module type? Is this what npm plans to do to support ES6 modules?