sproutcore / build-tools

SproutCore Build Tools
12 stars 7 forks source link

config file syntax proposal #11

Open mauritslamers opened 10 years ago

mauritslamers commented 10 years ago

Currently, there are two separate syntax models used in the config files:

BT.addFramework(BT.Framework.extend({
  path: "path/to/framework"
})

and

var myApp = BT.AppBuilder.create({
  name: "myApp",
  frameworks: ['myAppFw']
});

I think it would be nice to have a single syntax model, which would not exclude the options mentioned above but add to them:

BT.addFramework({
  ref: 'myframework'
  path: 'frameworks/myframework'
});
BT.addTheme({
  ref: 'mytheme',
  path: 'themes/mytheme'
});
BT.addApp({
  name: 'myApp',
  path: 'apps/my_app',
  theme: 'mytheme'
});

Thoughts?

topherfangio commented 10 years ago

Can you discuss the difference between the ref and name parameters? Unless there is a very good reason not to, I would make those the same.

topherfangio commented 10 years ago

Any more thoughts on this, or any discussion we can have that will help move this forward?

mauritslamers commented 10 years ago

The difference is that a ref translates to a path, and a name to an url. As an example: sproutcore:runtime refers to a path frameworks/sproutcore/frameworks/runtime, where the name of an app is used only to decide at what url in the dev-server things are going to be served, as well as the directory name the app will be built at.

The reason is that when an app requires a framework, the ref can be used to search for the framework if a class with this ref doesn't yet exist.