Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1138

Error creating a new Widget from Studio if config.json is not present

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.5.0, Alloy 1.4.1
    • Fix Version/s: Alloy 1.6.0, Alloy 1.7.0
    • Labels:
    • Environment:

      TiSDK 3.4.0.v20140913174915 & 3.3.1.GA
      Appcelerator Studio 3.4.0.201409131030 & 3.3.0.201407111535
      CLI 3.4.0-rc3 & 3.3.0.GA
      Alloy 1.5.0-rc2 & Alloy 1.4.1.GA
      Xcode6 GM

    • Story Points:
      3
    • Sprint:
      2014 Sprint 20 Alloy

      Description

      Problem description

      If no config.json file is present, creating a new Widget returns an error.

      Steps

      1. Create a new Alloy project
      2. Delete config.json file in the root project folder
      3. From Appcelerator Studio, left click and create a new Widget

      Result: a problem occurred creating a new widget.
      Widget folder is created but config.json file is not found and an error is thrown.

      fs.js:427
        return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                       ^
      Error: ENOENT, no such file or directory '/usr/local/lib/node_modules/alloy/Alloy/template/config.json'
          at Object.fs.openSync (fs.js:427:18)
          at Object.fs.readFileSync (fs.js:284:15)
          at module.exports (/usr/local/lib/node_modules/alloy/Alloy/commands/generate/targets/widget.js:50:19)
          at generate (/usr/local/lib/node_modules/alloy/Alloy/commands/generate/index.js:37:34)
          at Object.<anonymous> (/usr/local/lib/node_modules/alloy/Alloy/alloy.js:100:46)
          at Module._compile (module.js:456:26)
          at Object.Module._extensions..js (module.js:474:10)
          at Module.load (module.js:356:32)
          at Function.Module._load (module.js:312:12)
          at Module.require (module.js:364:17)
          at require (module.js:380:17)
          at Object.<anonymous> (/usr/local/lib/node_modules/alloy/bin/alloy:3:1)
          at Module._compile (module.js:456:26)
          at Object.Module._extensions..js (module.js:474:10)
          at Module.load (module.js:356:32)
          at Function.Module._load (module.js:312:12)
          at Function.Module.runMain (module.js:497:10)
          at startup (node.js:119:16)
          at node.js:901:3
      

      Ideal result would probably be to automatically create a default config.json file and add in there the informations regarding the new created Widget.

      If config.json file is removed, then, in order to create a new Widget, the user has to re-create manually a new config.json file just including : {{ {} }}

      Note

      Not a regression.

        Attachments

          Activity

            People

            • Assignee:
              skypanther Tim Poulsen
              Reporter:
              fcasali Federico Casali
              Reviewer:
              Feon Sua Xin Miao
              Tester:
              Federico Casali
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration