39010d2b76
* ui: Adds ember-data blueprints for Consul specific HTTP adapter etc These are currently quite Consul specific, but we also overwrite the default model-test blueprint to keep the names consistent (dasherized) for easy test filtering. ``` ember generate [adapter|serializer|model|repository|route] <name> ```
38 lines
894 B
JavaScript
38 lines
894 B
JavaScript
/*eslint node/no-extraneous-require: "off"*/
|
|
'use strict';
|
|
|
|
const path = require('path');
|
|
const isModuleUnificationProject = require('@ember-data/-build-infra/src/utilities/module-unification').isModuleUnificationProject;
|
|
module.exports = {
|
|
description: 'Generates a Consul HTTP ember-data adapter',
|
|
|
|
availableOptions: [{ name: 'base-class', type: String }],
|
|
|
|
root: __dirname,
|
|
|
|
fileMapTokens(options) {
|
|
if (isModuleUnificationProject(this.project)) {
|
|
return {
|
|
__root__() {
|
|
return 'src';
|
|
},
|
|
__path__(options) {
|
|
return path.join('data', 'models', options.dasherizedModuleName);
|
|
},
|
|
__name__() {
|
|
return 'adapter';
|
|
},
|
|
};
|
|
}
|
|
},
|
|
locals(options) {
|
|
// Return custom template variables here.
|
|
return {
|
|
};
|
|
}
|
|
|
|
// afterInstall(options) {
|
|
// // Perform extra work here.
|
|
// }
|
|
};
|