Grunt plugin to convert doctrine xml annotations into backbone models and collections. useful in conjunction with doctrine apigility. Includes option to scaffold a complete BBB crud application.
This plugin requires Grunt.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-doctrine --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-doctrine');
In your project's Gruntfile, add a section named doctrine
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
doctrine: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Type: String
Default value: 'app'
The application name that will be written to the package.json file
Type: String
Default value: '/'
The destination folder where the code will be generated.
Type: String
Default value: 'null'
The api endpoint for example http://example.com/v1/
Type: Object
Default value: '{}'
Options for the backbone modules to use. Options will be described later in this module.
Type: Boolean
Default value: 'false'
Use Backbone.Relational
Type: Boolean
Default value: 'false'
Use Backbone.Fetch cache plugin to cache resources?
Type: Boolean
Default value: 'false'
Declare defaults in Backbone models.
Type: Boolean
Default value: 'false'
Enables pushState for Backbone.History
In this example, We create a complete module application
grunt.initConfig({
doctrine: {
options: {
appName: 'app',
root: 'tmp',
endpoint: 'http://example.com/v1/'
},
src: ['test/fixtures/**/*.xml']
},
})
in this example, we create a bbb modular application
grunt.initConfig({
doctrine: {
options: {
appName: 'app',
root: 'tmp',
endpoint: 'http://example.com/v1/'
},
src: ['test/fixtures/**/*.xml']
},
})
Actually contributing is not permitted.
(Nothing yet)
Copyright (c) 2014 mattimatti. Licensed under the MIT license.