UNPKG

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.

53 lines (51 loc) 1.83 kB
"use strict"; // src/migrations/0.146.0/index.ts 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 (error) { } } return fileMap; }; module.exports = 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