classical.coffee | |
---|---|
Not classical in the musical sense - classical in the class sense. This convention strongly adheres to one component per file (where, ideally, each is a prototype or class). It expects that each source file defines a component named with | |
An ExampleGiven this project hierarchy:
The exported module hierarchy will be as follows (assuming that lib/ is autorequired): | Default = require './default'
class Classical extends Default
fileToProperty: (fileName, parentPath) ->
@camelCaps @stripFileExtension fileName
modifyExports: (exports, module) ->
unless module.sandbox[module.id]
throw new TypeError "Expected #{module.filename} to define #{module.id}"
module.sandbox[module.id]
module.exports = Classical
|