lucalanca / grunt-angular-architecture-graph

Generate modules dependencies graph in .dot format
MIT License
190 stars 13 forks source link

projectConfig is not defined #24

Closed RonanCodes closed 8 years ago

RonanCodes commented 8 years ago

Any ideas why I am getting this issue?

Running "angular_architecture_graph:diagram" (angular_architecture_graph) task
Warning: An error occurred while processing a template (projectConfig is not defined). Use --force to continue.

Aborted due to warnings.

I have ran:

 brew install graphviz

package.json:

{
  "name": "gmitcatering",
  "version": "1.0.0",
  "description": "GmitCatering: Purchase food with ease",
  "dependencies": {
    "cordova": "^5.3.3",
    "gulp": "^3.5.6",
    "gulp-concat": "^2.2.0",
    "gulp-minify-css": "^0.3.0",
    "gulp-rename": "^1.2.0",
    "gulp-sass": "^2.0.4"
  },
  "devDependencies": {
    "bower": "^1.3.3",
    "grunt": "^1.0.1",
    "grunt-angular-architecture-graph": "^0.2.6",
    "grunt-graphviz": "^0.1.1",
    "gulp-util": "^2.2.14",
    "shelljs": "^0.3.0"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist@1.0.0",
    "phonegap-plugin-push"
  ],
  "cordovaPlatforms": [
    "android",
    "ios"
  ]
}

Gruntfile.js

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        angular_architecture_graph: {
            diagram: {
                files: {
                    // "PATH/TO/OUTPUT/FILES": ["PATH/TO/YOUR/FILES/*.js"]
                    "architecture": [
                        "<%= projectConfig.app %>/<%= projectConfig.project %>/**/*.js"
                    ]
                }
            }
        }
    });

    // Load the plugin tasks.
    grunt.loadNpmTasks('grunt-angular-architecture-graph');

    // Default task(s).
    grunt.registerTask('default', ['angular_architecture_graph']);

};
matthieudesprez commented 8 years ago

You have to define projectConfig as your application folder path.

Try something like this in your initConfig :

grunt.initConfig({
  projectConfig: {
    app: ['yourAppFolder'],
    project: ['yourSubAppFolder']
  }
});
RonanCodes commented 8 years ago

Thanks :)