{ "id": "134646", "key": "ALOY-1199", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-08-13T02:07:22.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "compile", "compiler" ], "versions": [ { "id": "20117", "name": "Alloy 1.11.0", "archived": false, "released": true } ], "issuelinks": [], "assignee": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updated": "2020-11-17T22:14:36.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "12329", "name": "Runtime", "description": "Generic bucket for uncategorized runtime issues" } ], "description": "Action:\r\nA config.json file with the following contents is added to the project:\r\n{code}\r\n{\r\n \"global\": {\r\n \"theme\":\"default\",\r\n \"dir\": {\r\n \"template\": \"/\"\r\n }\r\n },\r\n \"env:development\": {},\r\n \"env:test\": {},\r\n \"env:production\": {},\r\n \"os:ios\": {\r\n \"theme\":\"ios\"\r\n },\r\n \"os:android\": {\r\n \"theme\":\"android\"\r\n },\r\n \"os:mobileweb\":{\r\n \"theme\":\"mobileweb\"\r\n },\r\n \"dependencies\": {}\r\n}\r\n{code}\r\n\r\nExpected result:\r\nShould result in alloy looking for templates in the root directory of the system. \r\n\r\nActual result:\r\nAn error is thrown of \"Arguments to path.join must be strings\" in the alloy compile due to the rest of the dir paths not being set in the config.json file. allow uses _.defaults and this does a \"shallow\" style clone rather then deep.\r\n\r\nlo-dash has a fix for this already (well... provided a workaround, the community has made modules from this workaround) ... sadly underscore has not yet fixed this as far as I can tell. Creating a workaround for underscore should not be difficult though\r\n\r\nExample use case:\r\nWanting to override the alloy templates for a project, and so wanting to change the template directory for the project to a custom one", "attachment": [], "flagged": false, "summary": "Deep merge config.json", "creator": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mattapperson", "key": "mattapperson", "displayName": "me@gmail.com", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "335909", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Original Reporter: me@mattapperson.com", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-12-10T23:57:50.000+0000", "updated": "2014-12-10T23:57:50.000+0000" }, { "id": "343434", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Another use case is to have platform-specific widget-dependencies:\r\n\r\n{code}\r\n{\r\n \"global\": {\r\n \"dependencies\": {\r\n \"foo\": \"1.0\"\r\n }\r\n },\r\n \"os:ios\": {\r\n \"dependencies\": {\r\n \"bar\": \"1.0\"\r\n }\r\n }\r\n}\r\n{code}\r\n\r\nRight now the result is:\r\n\r\n{code}\r\nmodule.exports = {\r\n \"dependencies\": {\r\n \"bar\": \"1.0\"\r\n }\r\n};\r\n{code}\r\n\r\nWhere with deep merge you'd get:\r\n\r\n{code}\r\nmodule.exports = {\r\n \"dependencies\": {\r\n \"foo\": \"1.0\",\r\n \"bar\": \"1.0\"\r\n }\r\n};\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-02-14T14:10:58.000+0000", "updated": "2015-02-14T14:10:58.000+0000" }, { "id": "343435", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "A sub-task should be created to document the added support for platform/environment specific widget-dependencies.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-02-14T14:11:42.000+0000", "updated": "2015-02-14T14:11:42.000+0000" }, { "id": "358189", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "Why is this actually being generated form a json file? It would be much more convenient to just use a config.js file with some exports for each of the platforms/deployment-types. Then we can also use variables and the likes.\r\n\r\nThis, together with a deep-merge functionality will make this a much better setup!", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2015-07-23T07:20:51.000+0000", "updated": "2015-07-23T07:20:51.000+0000" }, { "id": "359797", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~uzbbert] that's actually a good idea and also what we do for Arrow. Can you create a new JIRA ticket requesting this and link it to this one?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-08-13T11:04:20.000+0000", "updated": "2015-08-13T11:04:20.000+0000" }, { "id": "401350", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "bump\r\ncan this priority be increased?\r\n\r\nIf we could change this file to a `config.js` I could actually use my own implementation, which is using Lodash's `_.merge()` or `_.extend()` which can deep merge the config files.\r\n\r\nSadly underscore doesnt have deep merge at the moment", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2016-11-17T11:30:08.000+0000", "updated": "2016-11-17T11:30:08.000+0000" }, { "id": "428819", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "can this priority be increased? Also please consider TIMOB-24162 ", "updateAuthor": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "created": "2017-10-09T13:15:45.000+0000", "updated": "2017-10-09T13:15:45.000+0000" }, { "id": "457622", "author": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "body": "In my case it is multiple themes. config.json files from different themes are not truly merged so you can't inherit common configs from global config.json so have to copy over full file per theme. I think its related to this ticket.", "updateAuthor": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "created": "2020-11-17T16:31:36.000+0000", "updated": "2020-11-17T16:31:36.000+0000" }, { "id": "457623", "author": { "name": "creative_jira_user", "key": "uzbbert", "displayName": "Creative", "active": false, "timeZone": "Europe/Amsterdam" }, "body": "---", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-11-17T16:34:46.000+0000", "updated": "2020-11-17T22:14:36.000+0000" }, { "id": "457624", "author": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "body": "There are no limitations if you could write native modules or use Hyperloop. Thanks for the suggestion though :)", "updateAuthor": { "name": "appsol", "key": "appsol", "displayName": "Muhammad Qasim", "active": true, "timeZone": "Asia/Karachi" }, "created": "2020-11-17T17:40:54.000+0000", "updated": "2020-11-17T17:40:54.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }