@lightweightform/kotlin-cli
Version:
LF Kotlin CLI Plugin
50 lines • 2.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/*
* @license
* Copyright Lightweightform. All Rights Reserved.
*
* Use of this source code is governed by an Apache2.0-style license that can be
* found at https://www.apache.org/licenses/LICENSE-2.0
*/
var fs_1 = require("fs");
var handlebars_1 = require("handlebars");
var compileHandleBar = function (path, context) {
return handlebars_1.default.compile(fs_1.default.readFileSync(path).toString())(context);
};
var TemplateManager = /** @class */ (function () {
function TemplateManager() {
}
TemplateManager.loadPomParent = function (context) {
console.log(__dirname + "/templates/maven/pom-parent.handlebars");
return compileHandleBar(__dirname + "/templates/maven/pom-parent.handlebars", context);
};
TemplateManager.loadCommonPom = function (context) {
return compileHandleBar(__dirname + "/templates/maven/pom-common.handlebars", context);
};
TemplateManager.loadCommonJvmPom = function (context) {
return compileHandleBar(__dirname + "/templates/maven/pom-common-jvm.handlebars", context);
};
TemplateManager.loadCommonJsPom = function (context) {
return compileHandleBar(__dirname + "/templates/maven/pom-common-js.handlebars", context);
};
TemplateManager.loadCommonJsNpm = function (context) {
return compileHandleBar(__dirname + "/templates/npm/common-js-package-json.handlebars", context);
};
TemplateManager.loadRecordSchema = function (context) {
return compileHandleBar(__dirname + "/templates/schema/record.schema.handlebars", context);
};
TemplateManager.loadRecordStorage = function (context) {
return compileHandleBar(__dirname + "/templates/storage/record.storage.handlebars", context);
};
TemplateManager.loadReadMe = function (context) {
return compileHandleBar(__dirname + "/templates/readme-" + (context.template ||
'common') + "-md.handlebars", context);
};
TemplateManager.loadValidationMessages = function (context) {
return compileHandleBar(__dirname + "/templates/validator/validation.messages.handlebars", context);
};
return TemplateManager;
}());
exports.default = TemplateManager;
//# sourceMappingURL=template.manager.js.map