dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
75 lines (73 loc) • 2.74 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/migrations/0.146.0/index.ts
var index_exports = {};
__export(index_exports, {
default: () => index_default
});
module.exports = __toCommonJS(index_exports);
var import_fs = require("fs");
var import_devkit = require("@dynatrace/devkit");
var import_path = require("path");
var migration = async (fileMap, options) => {
if (!(0, import_fs.existsSync)((0, import_path.normalize)((0, import_path.join)(options.root, "app.config.ts")))) {
return fileMap;
}
if (fileMap["app.config.ts"]) {
fileMap["app.config.cts"] = {
...fileMap["app.config.ts"],
filename: "app.config.cts",
mode: import_devkit.FileMode.created
};
fileMap["app.config.ts"].mode = import_devkit.FileMode.deleted;
}
if (fileMap["tsconfig.eslint.json"]) {
try {
fileMap["tsconfig.eslint.json"].mode = import_devkit.FileMode.updated;
const eslintConfig = JSON.parse(
(0, import_devkit.readFile)(fileMap, "tsconfig.eslint.json")
);
if (eslintConfig.include && !eslintConfig.include.includes("**/*.cts")) {
eslintConfig.include.push("**/*.cts");
fileMap["tsconfig.eslint.json"].content = Buffer.from(
JSON.stringify(eslintConfig, null, 2)
);
}
} catch {
}
}
return fileMap;
};
var index_default = migration;
/**
* @license
* Copyright 2022 Dynatrace LLC
* Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//# sourceMappingURL=index.js.map