Titanium

[ALOY-754] Alloy: Add theme-support for config.json

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2014-04-11T19:09:08.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.4.0, 2014 Sprint 07
ComponentsStyling, Tooling
Labelsqe-testadded
ReporterFokke Zandbergen
AssigneeTim Poulsen
Created2013-07-22T14:36:18.000+0000
Updated2014-04-23T23:37:37.000+0000

Description

Alloy's theming-feature is awesome when it comes to branding white-label apps. However, these white-label apps often also require some contact information and stuff like that to change for each distribution. The most logical place to put these, would be the config.json file. And even for styling, setting some base colors in config.json to use in the TSS is often more efficient then overwriting each color using themed .tss files. The problem however is... config.json does not support themes. How about adding support to put a config.json in your /app/themes/myTheme folder, which then would (deep-)extend the base config.json file?

Comments

  1. Fokke Zandbergen 2013-07-23 As a workaround, you can copy the compiled Resources/alloy/CFG.js to your app/themes/myTheme/assets/alloy/CFG.js and make any changes there. But of course this would require you to sync changes in config.json to the themed CFG.js files.
  2. Fokke Zandbergen 2013-09-29 PR: https://github.com/appcelerator/alloy/pull/246
  3. Tony Lukasavage 2013-09-30 PR needs work, detailed in this comment: https://github.com/appcelerator/alloy/pull/246#issuecomment-25405595
  4. Tim Poulsen 2014-03-10 The PR as it stands now is causing failures with existing apps and test. Specifically, advanced/themes sample app, and tests ALOY-577 and ALOY-629 fail when built using this PR.
       jake app:run dir=advanced/themes
       
       // throws
       [DEBUG] [ERROR] Error processing "config.json"
       [DEBUG] [ERROR] ENOENT, no such file or directory '/Users/tpoulsen/repos/alloy/test/projects/Harness/app/themes/green/config.json'
       [DEBUG] [ERROR] Alloy compiler failed
       
  5. Fokke Zandbergen 2014-03-11 [~skypanther] fixed it in the PR.
  6. Tim Poulsen 2014-03-13 The latest PR passes all tests except ALOY-887 which deliberately includes an unclosed comment. That was fixed in PR 312, which must not be present in your branch.
  7. Fokke Zandbergen 2014-03-13 Are you saying it is OK or needs another fix?
  8. Tim Poulsen 2014-03-13 It should be handled fine when Tony merges your PR. I think it's OK as-is.

JSON Source