UNPKG

@atlassian/wrm-troubleshooting

Version:

A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.

28 lines 1.3 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.verifyWrmPluginHasValidConfig = void 0; const chalk_1 = __importDefault(require("chalk")); const paths_1 = require("../paths"); const pom_1 = require("../pom"); const webpackWrmPlugin_1 = require("../webpackWrmPlugin"); const types_1 = require("./types"); const verifyWrmPluginHasValidConfig = async (options, payload) => { const { pomConfig, pomFile, wrmWebpackPlugin } = payload; const pomXml = (0, pom_1.getPomXml)(pomConfig); if (pomXml instanceof Error) { const error = new Error(`😔 We can't parse the XML from "${chalk_1.default.green((0, paths_1.getRelativePath)(pomFile))}" pom file. Bummer`); return (0, types_1.getFailedResult)(error); } const result = await (0, webpackWrmPlugin_1.checkWrmPluginHasValidConfig)(pomXml, wrmWebpackPlugin); if (result instanceof Error) { return (0, types_1.getFailedResult)(result); } return (0, types_1.getPassedResult)({ pomXml, }); }; exports.verifyWrmPluginHasValidConfig = verifyWrmPluginHasValidConfig; //# sourceMappingURL=verifyWrmPluginHasValidConfig.js.map