Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3293] Alloy: Project Configuration File should be deep-merged

GitHub Issuen/a
TypeImprovement
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2014-12-18T15:52:50.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsalloy, config.json
ReporterFokke Zandbergen
AssigneeRadamantis Torres-Lechuga
Created2014-12-18T10:01:10.000+0000
Updated2016-03-08T07:57:42.000+0000

Description

Currently, the merge between different targets (by environment, deploy-type etc) within the same config.json as well as the merge of the app-level config.json and the one of the selected theme is shallow. I'd like the merge to be deep.

Use case

*app/config.json*
{
  "global": {
    "colors": {
      "dark": "red"
      "light": "white"
    }
  },
  "os:ios": {
    "colors": {
      "dark": "blue"
    }
  }
}
*app/themes/mine/config.json*
{
  "os:ios": {
    "colors": {
      "dark": "green"
    }
  }
}

Current result

*Resources/iphone/alloy/CFG.js*
module.exports = {
  "colors": {
    "dark": "green"
  }
};

Desired result

*Resources/iphone/alloy/CFG.js*
module.exports = {
  "colors": {
    "light": "white",
    "dark": "green"
  }
};

Comments

  1. Tim Poulsen 2014-12-18

    Duplicates ALOY-1199
  2. Fokke Zandbergen 2014-12-18

    Had to read ALOY-1199 3 times before I saw it, but indeed... Duplicate, but very much wanted.

JSON Source