@nimbella/postman-api
Version:
Postman Collection to Nimbella Project: Take your APIs seamlessly into Serverless world with this API
40 lines (39 loc) • 1.53 kB
JavaScript
;
/*
* Copyright (c) 2019 - present Nimbella Corp.
*
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const fs_1 = require("fs");
const path_1 = require("path");
const handlebars_1 = require("handlebars");
const base_gen_1 = tslib_1.__importDefault(require("./base-gen"));
class PhpGenerator extends base_gen_1.default {
constructor() {
super('php');
this.composerStub = fs_1.readFileSync(path_1.join(this.tmplPath, 'composer.hbs'));
this.tmplComposer = handlebars_1.compile(this.composerStub.toString());
}
getSupportingItems(collection) {
return [
{
location: '.gitignore',
content: this.tmplGitignore(collection),
},
{
location: 'composer.json',
content: this.tmplComposer(this),
},
];
}
}
exports.default = PhpGenerator;