mwaylabs / Espresso

The-M-Projects build tools using node.js.
www.the-m-project.org
Other
84 stars 28 forks source link

Check for invalid view names in any childViews property during the build process #41

Open dominiklaubach opened 12 years ago

dominiklaubach commented 12 years ago

We should add a mechanism to check for invalid view names within the childViews property of any view during the build process. Therefore we will set up a list containing all 'keywords' used within the framework, e.g. 'render', 'renderChildViews' or 'theme'. Espresso then should parse the application's source code, look for properties called 'childViews' and check, whether one of them contains one of the 'keywords'.

Example:

M.PageView.design({
  childViews: 'header render footer',

  header: M.ToolbarView.design({
    value: 'Toolbar'
  }),

  render: M.ScrollView.design({
    // anything....
  }),

  footer: M.ToolbarView.design({
    value: 'Footer'
  })
});

Since the page view in the sample above uses 'render' within the childViews property, this should throw an error during the build process.