@atlassian/wrm-troubleshooting 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +3 -3
  3. package/package.json +5 -5
  4. package/dist/analytics/analytics.js +0 -74
  5. package/dist/analytics/analytics.js.map +0 -1
  6. package/dist/analytics/events.js +0 -27
  7. package/dist/analytics/events.js.map +0 -1
  8. package/dist/applicationUrls.js +0 -39
  9. package/dist/applicationUrls.js.map +0 -1
  10. package/dist/atlassianPluginXml.js +0 -69
  11. package/dist/atlassianPluginXml.js.map +0 -1
  12. package/dist/checkForUpdate.js +0 -58
  13. package/dist/checkForUpdate.js.map +0 -1
  14. package/dist/cli.js +0 -76
  15. package/dist/cli.js.map +0 -1
  16. package/dist/cliUtils.js +0 -21
  17. package/dist/cliUtils.js.map +0 -1
  18. package/dist/globWithOptions.js +0 -18
  19. package/dist/globWithOptions.js.map +0 -1
  20. package/dist/maven/MavenError.js +0 -14
  21. package/dist/maven/MavenError.js.map +0 -1
  22. package/dist/paths.js +0 -12
  23. package/dist/paths.js.map +0 -1
  24. package/dist/pom.js +0 -147
  25. package/dist/pom.js.map +0 -1
  26. package/dist/steps/getEffectivePomConfig.js +0 -94
  27. package/dist/steps/getEffectivePomConfig.js.map +0 -1
  28. package/dist/steps/getEffectiveWebpackConfig.js +0 -35
  29. package/dist/steps/getEffectiveWebpackConfig.js.map +0 -1
  30. package/dist/steps/getWrmWebpackPlugin.js +0 -22
  31. package/dist/steps/getWrmWebpackPlugin.js.map +0 -1
  32. package/dist/steps/index.js +0 -27
  33. package/dist/steps/index.js.map +0 -1
  34. package/dist/steps/locatePomFile.js +0 -30
  35. package/dist/steps/locatePomFile.js.map +0 -1
  36. package/dist/steps/locateWebpackConfigFile.js +0 -32
  37. package/dist/steps/locateWebpackConfigFile.js.map +0 -1
  38. package/dist/steps/types.js +0 -48
  39. package/dist/steps/types.js.map +0 -1
  40. package/dist/steps/validateOptions.js +0 -21
  41. package/dist/steps/validateOptions.js.map +0 -1
  42. package/dist/steps/verifyPomConfigIsValid.js +0 -22
  43. package/dist/steps/verifyPomConfigIsValid.js.map +0 -1
  44. package/dist/steps/verifyWebpackBundle.js +0 -26
  45. package/dist/steps/verifyWebpackBundle.js.map +0 -1
  46. package/dist/steps/verifyWrmPluginHasValidConfig.js +0 -28
  47. package/dist/steps/verifyWrmPluginHasValidConfig.js.map +0 -1
  48. package/dist/steps/verifyWrmPluginScanFolders.js +0 -15
  49. package/dist/steps/verifyWrmPluginScanFolders.js.map +0 -1
  50. package/dist/steps/verifyWrmRuntime.js +0 -139
  51. package/dist/steps/verifyWrmRuntime.js.map +0 -1
  52. package/dist/troubleshooting.js +0 -219
  53. package/dist/troubleshooting.js.map +0 -1
  54. package/dist/troubleshootingOptions.js +0 -12
  55. package/dist/troubleshootingOptions.js.map +0 -1
  56. package/dist/types.js +0 -3
  57. package/dist/types.js.map +0 -1
  58. package/dist/webpack/webpack.js +0 -149
  59. package/dist/webpack/webpack.js.map +0 -1
  60. package/dist/webpack/webpackCli.js +0 -167
  61. package/dist/webpack/webpackCli.js.map +0 -1
  62. package/dist/webpack/webpackCliV3.js +0 -33
  63. package/dist/webpack/webpackCliV3.js.map +0 -1
  64. package/dist/webpack/webpackCliV4.js +0 -33
  65. package/dist/webpack/webpackCliV4.js.map +0 -1
  66. package/dist/webpack/webpackError.js +0 -14
  67. package/dist/webpack/webpackError.js.map +0 -1
  68. package/dist/webpackPlugin/WebpackRetrieveConfigPlugin.js +0 -61
  69. package/dist/webpackPlugin/WebpackRetrieveConfigPlugin.js.map +0 -1
  70. package/dist/webpackPlugin/webpack.config.js +0 -10
  71. package/dist/webpackPlugin/webpack.config.js.map +0 -1
  72. package/dist/webpackWrmPlugin.js +0 -62
  73. package/dist/webpackWrmPlugin.js.map +0 -1
  74. package/dist/wrm/fetchWithTimeout.js +0 -23
  75. package/dist/wrm/fetchWithTimeout.js.map +0 -1
  76. package/dist/wrm/wrmRestApi.js +0 -93
  77. package/dist/wrm/wrmRestApi.js.map +0 -1
  78. package/dist/wrm/wrmTypes.js +0 -3
  79. package/dist/wrm/wrmTypes.js.map +0 -1
  80. package/dist/xmlParser.js +0 -42
  81. package/dist/xmlParser.js.map +0 -1
  82. package/dist/yargsHelper.js +0 -22
  83. package/dist/yargsHelper.js.map +0 -1
package/dist/pom.js DELETED
@@ -1,147 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getAtlassianPluginKeyFromPom = exports.getAbsoluteScanFoldersConfig = exports.getScanFoldersConfig = exports.getPomXml = exports.askForPomXmlFile = exports.confirmRootPomFile = exports.findRootPomXmlFile = exports.SCAN_FOLDERS_KEY = void 0;
7
- const path = require("path");
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const fs_1 = require("fs");
10
- const inquirer_1 = __importDefault(require("inquirer"));
11
- const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
12
- const lodash_get_1 = __importDefault(require("lodash.get"));
13
- const globWithOptions_1 = require("./globWithOptions");
14
- const paths_1 = require("./paths");
15
- const xmlParser_1 = require("./xmlParser");
16
- inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
17
- const POM_FILE_PATTERN = 'pom.xml';
18
- const POM_FILE_GLOB_PATTERN = `**/${POM_FILE_PATTERN}`;
19
- exports.SCAN_FOLDERS_KEY = 'Atlassian-Scan-Folders';
20
- async function findRootPomXmlFile() {
21
- const [rootPomFile] = await (0, globWithOptions_1.globWithOptions)(POM_FILE_PATTERN);
22
- return rootPomFile;
23
- }
24
- exports.findRootPomXmlFile = findRootPomXmlFile;
25
- async function confirmRootPomFile(pomFile, rootPomFileFound) {
26
- const answers = await inquirer_1.default.prompt({
27
- type: 'confirm',
28
- name: 'confirmRootPomFile',
29
- message: `We have found ${rootPomFileFound ? 'a root ' : ''}pom file at "${chalk_1.default.green((0, paths_1.getRelativePath)(pomFile))}". Is it the file we should be using now?`,
30
- });
31
- if (answers.confirmRootPomFile) {
32
- return pomFile;
33
- }
34
- return undefined;
35
- }
36
- exports.confirmRootPomFile = confirmRootPomFile;
37
- async function askToSelectPomFile(fileLocations) {
38
- const answers = await inquirer_1.default.prompt({
39
- // @ts-expect-error We are using inquirer plugin that is causing TS error
40
- type: 'autocomplete',
41
- name: 'pomLocation',
42
- message: 'Select a pom.xml file you want to use:',
43
- source: (answersSoFar, input) => {
44
- const userInput = input || '';
45
- return fileLocations
46
- .filter((fileLocation) => fileLocation.match(new RegExp(userInput, 'i')))
47
- .map((fileLocation) => ({
48
- name: (0, paths_1.getRelativePath)(fileLocation),
49
- value: fileLocation,
50
- }));
51
- },
52
- });
53
- return answers.pomLocation;
54
- }
55
- async function askForPomFileLocation() {
56
- const hasPomFileAnswers = await inquirer_1.default.prompt({
57
- type: 'confirm',
58
- name: 'hasPomFile',
59
- message: 'Have you correctly set up and configured the Java project?',
60
- });
61
- if (!hasPomFileAnswers.hasPomFile) {
62
- return new Error("The Java project wasn't configured.");
63
- }
64
- const answers = await inquirer_1.default.prompt({
65
- type: 'input',
66
- name: 'pomLocation',
67
- message: 'Please provide a path to a pom config file you want to use:',
68
- async validate(input) {
69
- try {
70
- await fs_1.promises.access(input);
71
- return true;
72
- }
73
- catch (e) {
74
- // eslint-disable-next-line no-empty
75
- }
76
- return 'Cannot find or read the file from provided path. Please correct the file path.';
77
- },
78
- });
79
- return answers.pomLocation;
80
- }
81
- async function askForPomXmlFile(rooPomFileFound) {
82
- if (!rooPomFileFound) {
83
- console.log("We couldn't find a pom.xml file in root directory of your project. ");
84
- }
85
- let pomLocation;
86
- console.log('We are now looking for the pom.xml files in your project...');
87
- const fileLocations = await (0, globWithOptions_1.globWithOptions)(POM_FILE_GLOB_PATTERN);
88
- // We have found some files that are looking like potential pom files
89
- if (fileLocations.length) {
90
- pomLocation = await askToSelectPomFile(fileLocations);
91
- }
92
- else {
93
- console.log("We couldn't locate any files that look like pom.xml files in this project.");
94
- pomLocation = await askForPomFileLocation();
95
- }
96
- return pomLocation;
97
- }
98
- exports.askForPomXmlFile = askForPomXmlFile;
99
- function getPomXml(pomContent) {
100
- const xml = (0, xmlParser_1.parseXmlContent)(pomContent);
101
- if (xml instanceof Error) {
102
- return xml;
103
- }
104
- return xml;
105
- }
106
- exports.getPomXml = getPomXml;
107
- function getScanFoldersConfig(pomXml) {
108
- const pluginsPath = ['project', 'build', 'plugins'];
109
- const InstructionsPath = ['configuration', 'instructions'];
110
- // We are using the above JSON Paths to access the XML nodes from the POM file. The "0" is pointing to the first element in the array.
111
- // This convention is enforced by the structure of the parsed XML file.
112
- const buildPluginsXmlPath = pluginsPath.flatMap((key) => [key, '0']);
113
- const instructionsXmlPath = InstructionsPath.flatMap((key) => [key, '0']);
114
- // Get array of build plugins
115
- const buildPlugins = (0, lodash_get_1.default)(pomXml, buildPluginsXmlPath).plugin;
116
- // Check if the build plugin contains scan folders setting
117
- const scanFoldersValues = buildPlugins
118
- .map((buildPlugin) => {
119
- const instructions = (0, lodash_get_1.default)(buildPlugin, instructionsXmlPath);
120
- return instructions ? instructions[exports.SCAN_FOLDERS_KEY] : undefined;
121
- })
122
- .filter(notEmpty);
123
- // TODO: We are going to assume we have a single value here. yolo.
124
- return Array.isArray(scanFoldersValues) && scanFoldersValues.length ? scanFoldersValues[0] : null;
125
- }
126
- exports.getScanFoldersConfig = getScanFoldersConfig;
127
- function getAbsoluteScanFoldersConfig(pomXml, pomFile) {
128
- const scanFolders = getScanFoldersConfig(pomXml);
129
- const projectDir = path.resolve(path.dirname(pomFile));
130
- // @ts-expect-error We should handle the null value
131
- return path.join(projectDir, 'target', 'classes', scanFolders);
132
- }
133
- exports.getAbsoluteScanFoldersConfig = getAbsoluteScanFoldersConfig;
134
- const getProject = (pomXml) => {
135
- const project = pomXml['project'];
136
- return project[0];
137
- };
138
- const getAtlassianPluginKeyFromPom = (pomXml) => {
139
- // Naively construct the full plugin key
140
- const { artifactId, groupId } = getProject(pomXml);
141
- return `${groupId}.${artifactId}`;
142
- };
143
- exports.getAtlassianPluginKeyFromPom = getAtlassianPluginKeyFromPom;
144
- function notEmpty(value) {
145
- return value !== null && value !== undefined;
146
- }
147
- //# sourceMappingURL=pom.js.map
package/dist/pom.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"pom.js","sourceRoot":"","sources":["../src/pom.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA8B;AAC9B,kDAA0B;AAC1B,2BAAoC;AACpC,wDAAgC;AAChC,gGAAsE;AACtE,4DAA6B;AAE7B,uDAAoD;AACpD,mCAA0C;AAE1C,2CAA8C;AAE9C,kBAAQ,CAAC,cAAc,CAAC,cAAc,EAAE,sCAA0B,CAAC,CAAC;AAEpE,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,EAAE,CAAC;AAE1C,QAAA,gBAAgB,GAAG,wBAAwB,CAAC;AAElD,KAAK,UAAU,kBAAkB;IACtC,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,IAAA,iCAAe,EAAC,gBAAgB,CAAC,CAAC;IAE9D,OAAO,WAAW,CAAC;AACrB,CAAC;AAJD,gDAIC;AAEM,KAAK,UAAU,kBAAkB,CAAC,OAAe,EAAE,gBAAyB;IAKjF,MAAM,OAAO,GAAY,MAAM,kBAAQ,CAAC,MAAM,CAAC;QAC7C,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,iBAAiB,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,eAAK,CAAC,KAAK,CACpF,IAAA,uBAAe,EAAC,OAAO,CAAC,CACzB,2CAA2C;KAC7C,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,kBAAkB,E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,CAAC;IAE1D,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAEK,MAAM,4BAA4B,GAAG,CAAC,MAAc,EAAU,EAAE;IACrE,wCAAwC;IACxC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEnD,OAAO,GAAG,OAAO,IAAI,UAAU,EAAE,CAAC;AACpC,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC;AAEF,SAAS,QAAQ,CAAS,KAAgC;IACxD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.getEffectivePomConfig = void 0;
26
- const execa_1 = __importDefault(require("execa"));
27
- const fs_1 = __importStar(require("fs"));
28
- const lookpath_1 = require("lookpath");
29
- const path = __importStar(require("path"));
30
- const MavenError_1 = require("../maven/MavenError");
31
- const types_1 = require("./types");
32
- const getEffectivePomConfig = async (options, payload) => {
33
- const { pomFile } = payload;
34
- console.log('👀 We will retrieve pom configuration now. This might take some time...');
35
- const pomFileWd = path.dirname(pomFile);
36
- const xmlConfigOutput = path.resolve(pomFileWd, '.temp-pom-config.xml');
37
- // We need to check if at least one of the following commands is available
38
- const mvnCommands = ['atlas-mvn', 'mvn'];
39
- let mvnCommand;
40
- for (const mvnCmd of mvnCommands) {
41
- mvnCommand = await (0, lookpath_1.lookpath)(mvnCmd);
42
- if (mvnCommand) {
43
- break;
44
- }
45
- }
46
- // When we run integration tests locally with Jest we need to use a different maven command than `mvn`.
47
- // For some reason, using `mvn` command will cause this error:
48
- //
49
- // Command failed with exit code 1: mvn help:effective-pom -Doutput=<<file-path>> --quiet
50
- // mkdir: /.mvnvm: Read-only file system
51
- //
52
- // So for the integration tests we are running locally we need to use "atlas-mvn" from the Atlassian SDK.
53
- if (process.env.NODE_ENV === 'test' && !process.env.CI) {
54
- mvnCommand = 'atlas-mvn';
55
- }
56
- if (!mvnCommand) {
57
- return (0, types_1.getFailedResult)(new MavenError_1.MavenError(`We can't run the "atlas-mvn" or "mvn" commands. Please ensure you have installed Atlassian SDK and one of those command can be executed.
58
- Refer to the SDK Installation Guide: https://developer.atlassian.com/server/framework/atlassian-sdk/install-the-atlassian-sdk-on-a-linux-or-mac-system/`, ''));
59
- }
60
- try {
61
- await (0, execa_1.default)(mvnCommand, ['help:effective-pom', `-Doutput=${xmlConfigOutput}`, '--quiet'], {
62
- cwd: pomFileWd,
63
- timeout: options.timeout,
64
- });
65
- }
66
- catch (err) {
67
- const error = err;
68
- if (error.timedOut) {
69
- return (0, types_1.getCommandTimeoutResult)('mvn', options.timeout);
70
- }
71
- const errorMessage = error.stdout || error.message || error.shortMessage;
72
- return (0, types_1.getFailedResult)(new MavenError_1.MavenError('Maven "help:effective-pom" command failed.', errorMessage));
73
- }
74
- // Verify if the effective pom file was created
75
- try {
76
- await fs_1.promises.access(xmlConfigOutput);
77
- }
78
- catch (err) {
79
- const error = err;
80
- const errorMessage = error.message;
81
- const xmlFilename = path.basename(xmlConfigOutput);
82
- return (0, types_1.getFailedResult)(new MavenError_1.MavenError(`Maven "help:effective-pom" command failed. We couldn't create the "${xmlFilename}" file with effective pom configuration.`, errorMessage));
83
- }
84
- const pomConfig = fs_1.default.readFileSync(xmlConfigOutput, {
85
- encoding: 'utf-8',
86
- });
87
- // Remove the temporary file that we don't need anymore
88
- fs_1.default.unlinkSync(xmlConfigOutput);
89
- return (0, types_1.getPassedResult)({
90
- pomConfig,
91
- });
92
- };
93
- exports.getEffectivePomConfig = getEffectivePomConfig;
94
- //# sourceMappingURL=getEffectivePomConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEffectivePomConfig.js","sourceRoot":"","sources":["../../src/steps/getEffectivePomConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,yCAA6C;AAC7C,uCAAoC;AACpC,2CAA6B;AAE7B,oDAAiD;AAEjD,mCAAoF;AAU7E,MAAM,qBAAqB,GAI9B,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IAEvF,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;IAExE,0EAA0E;IAC1E,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACzC,IAAI,UAA8B,CAAC;IAEnC,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;QAChC,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,MAAM,CAAC,CAAC;QAEpC,IAAI,UAAU,EAAE;YACd,MAAM;SACP;KACF;IAED,uGAAuG;IACvG,8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AW,0CAA0C,EAC3H,YAAY,CACb,CACF,CAAC;KACH;IAED,MAAM,SAAS,GAAG,YAAE,CAAC,YAAY,CAAC,eAAe,EAAE;QACjD,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IAEH,uDAAuD;IACvD,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAE/B,OAAO,IAAA,uBAAe,EAA4B;QAChD,SAAS;KACV,CAAC,CAAC;AACL,CAAC,CAAC;AAzFW,QAAA,qBAAqB,yBAyFhC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getEffectiveWebpackConfig = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const inquirer_1 = __importDefault(require("inquirer"));
9
- const webpack_1 = require("../webpack/webpack");
10
- const types_1 = require("./types");
11
- const getEffectiveWebpackConfig = async (options, payload) => {
12
- const { webpackConfigFile } = payload;
13
- if (!options.yes) {
14
- const answer = await inquirer_1.default.prompt({
15
- type: 'confirm',
16
- name: 'confirmRunningWebpack',
17
- message: `We need to run ${chalk_1.default.bold('webpack CLI')} to retrieve the configuration file. Is that fine?`,
18
- });
19
- // Silly boy!
20
- if (!answer.confirmRunningWebpack) {
21
- const error = new Error(`We can't proceed without running the ${chalk_1.default.bold('webpack')}. Please run the troubleshooting command again when you are ready to run webpack.`);
22
- return (0, types_1.getFailedResult)(error);
23
- }
24
- }
25
- const webpackConfigResult = await (0, webpack_1.retrieveEffectiveWebpackConfig)(webpackConfigFile, options.timeout);
26
- if (webpackConfigResult instanceof Error) {
27
- return (0, types_1.getFailedResult)(webpackConfigResult);
28
- }
29
- return (0, types_1.getPassedResult)({
30
- webpackCliInfo: webpackConfigResult.cliInfo,
31
- webpackEffectiveConfig: webpackConfigResult.effectiveConfig,
32
- });
33
- };
34
- exports.getEffectiveWebpackConfig = getEffectiveWebpackConfig;
35
- //# sourceMappingURL=getEffectiveWebpackConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEffectiveWebpackConfig.js","sourceRoot":"","sources":["../../src/steps/getEffectiveWebpackConfig.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wDAAgC;AAGhC,gDAAoE;AAIpE,mCAA2D;AAWpD,MAAM,yBAAyB,GAIlC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;IAEtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;QAKhB,MAAM,MAAM,GAAW,MAAM,kBAAQ,CAAC,MAAM,CAAC;YAC3C,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,kBAAkB,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,oDAAoD;SACzG,CAAC,CAAC;QAEH,aAAa;QACb,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,wCAAwC,eAAK,CAAC,IAAI,CAChD,SAAS,CACV,mFAAmF,CACrF,CAAC;YAEF,OAAO,IAAA,uBAAe,EAAC,KAAK,CAAC,CAAC;SAC/B;KACF;IAED,MAAM,mBAAmB,GAAG,MAAM,IAAA,wCAA8B,EAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAErG,IAAI,mBAAmB,YAAY,KAAK,EAAE;QACxC,OAAO,IAAA,uBAAe,EAAC,mBAAmB,CAAC,CAAC;KAC7C;IAED,OAAO,IAAA,uBAAe,EAAyC;QAC7D,cAAc,EAAE,mBAAmB,CAAC,OAAO;QAC3C,sBAAsB,EAAE,mBAAmB,CAAC,eAAe;KAC5D,CAAC,CAAC;AACL,CAAC,CAAC;AAxCW,QAAA,yBAAyB,6BAwCpC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWrmWebpackPlugin = void 0;
4
- const webpackWrmPlugin_1 = require("../webpackWrmPlugin");
5
- const types_1 = require("./types");
6
- const missingPluginError = new Error(`Provided webpack configuration is not using "${webpackWrmPlugin_1.NPM_PACKAGE_NAME}" webpack plugin.`);
7
- const getWrmWebpackPlugin = async (options, payload) => {
8
- const { webpackEffectiveConfig } = payload;
9
- const { plugins } = webpackEffectiveConfig;
10
- if (!Array.isArray(plugins)) {
11
- return (0, types_1.getFailedResult)(missingPluginError);
12
- }
13
- const wrmWebpackPlugin = plugins.find((plugin) => plugin.pluginName === webpackWrmPlugin_1.WRM_PLUGIN_NAME);
14
- if (!wrmWebpackPlugin) {
15
- return (0, types_1.getFailedResult)(missingPluginError);
16
- }
17
- return (0, types_1.getPassedResult)({
18
- wrmWebpackPlugin: wrmWebpackPlugin,
19
- });
20
- };
21
- exports.getWrmWebpackPlugin = getWrmWebpackPlugin;
22
- //# sourceMappingURL=getWrmWebpackPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getWrmWebpackPlugin.js","sourceRoot":"","sources":["../../src/steps/getWrmWebpackPlugin.ts"],"names":[],"mappings":";;;AAEA,0DAAwE;AAExE,mCAA2D;AAU3D,MAAM,kBAAkB,GAAG,IAAI,KAAK,CAClC,gDAAgD,mCAAgB,mBAAmB,CACpF,CAAC;AAEK,MAAM,mBAAmB,GAG5B,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC;IAE3C,MAAM,EAAE,OAAO,EAAE,GAAG,sBAAsB,CAAC;IAE3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,IAAA,uBAAe,EAAC,kBAAkB,CAAC,CAAC;KAC5C;IAED,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAA8B,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,KAAK,kCAAe,CAAC,CAAC;IAEjH,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO,IAAA,uBAAe,EAAC,kBAAkB,CAAC,CAAC;KAC5C;IAED,OAAO,IAAA,uBAAe,EAAgC;QACpD,gBAAgB,EAAE,gBAAgE;KACnF,CAAC,CAAC;AACL,CAAC,CAAC;AArBW,QAAA,mBAAmB,uBAqB9B"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyWrmPluginScanFolders = exports.verifyWrmPluginHasValidConfig = exports.verifyWebpackBundle = exports.verifyPomConfigIsValid = exports.validateOptions = exports.didPass = exports.didFail = exports.locateWebpackConfigFile = exports.locatePomFile = exports.getWrmWebpackPlugin = exports.getEffectiveWebpackConfig = exports.getEffectivePomConfig = void 0;
4
- var getEffectivePomConfig_1 = require("./getEffectivePomConfig");
5
- Object.defineProperty(exports, "getEffectivePomConfig", { enumerable: true, get: function () { return getEffectivePomConfig_1.getEffectivePomConfig; } });
6
- var getEffectiveWebpackConfig_1 = require("./getEffectiveWebpackConfig");
7
- Object.defineProperty(exports, "getEffectiveWebpackConfig", { enumerable: true, get: function () { return getEffectiveWebpackConfig_1.getEffectiveWebpackConfig; } });
8
- var getWrmWebpackPlugin_1 = require("./getWrmWebpackPlugin");
9
- Object.defineProperty(exports, "getWrmWebpackPlugin", { enumerable: true, get: function () { return getWrmWebpackPlugin_1.getWrmWebpackPlugin; } });
10
- var locatePomFile_1 = require("./locatePomFile");
11
- Object.defineProperty(exports, "locatePomFile", { enumerable: true, get: function () { return locatePomFile_1.locatePomFile; } });
12
- var locateWebpackConfigFile_1 = require("./locateWebpackConfigFile");
13
- Object.defineProperty(exports, "locateWebpackConfigFile", { enumerable: true, get: function () { return locateWebpackConfigFile_1.locateWebpackConfigFile; } });
14
- var types_1 = require("./types");
15
- Object.defineProperty(exports, "didFail", { enumerable: true, get: function () { return types_1.didFail; } });
16
- Object.defineProperty(exports, "didPass", { enumerable: true, get: function () { return types_1.didPass; } });
17
- var validateOptions_1 = require("./validateOptions");
18
- Object.defineProperty(exports, "validateOptions", { enumerable: true, get: function () { return validateOptions_1.validateOptions; } });
19
- var verifyPomConfigIsValid_1 = require("./verifyPomConfigIsValid");
20
- Object.defineProperty(exports, "verifyPomConfigIsValid", { enumerable: true, get: function () { return verifyPomConfigIsValid_1.verifyPomConfigIsValid; } });
21
- var verifyWebpackBundle_1 = require("./verifyWebpackBundle");
22
- Object.defineProperty(exports, "verifyWebpackBundle", { enumerable: true, get: function () { return verifyWebpackBundle_1.verifyWebpackBundle; } });
23
- var verifyWrmPluginHasValidConfig_1 = require("./verifyWrmPluginHasValidConfig");
24
- Object.defineProperty(exports, "verifyWrmPluginHasValidConfig", { enumerable: true, get: function () { return verifyWrmPluginHasValidConfig_1.verifyWrmPluginHasValidConfig; } });
25
- var verifyWrmPluginScanFolders_1 = require("./verifyWrmPluginScanFolders");
26
- Object.defineProperty(exports, "verifyWrmPluginScanFolders", { enumerable: true, get: function () { return verifyWrmPluginScanFolders_1.verifyWrmPluginScanFolders; } });
27
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/steps/index.ts"],"names":[],"mappings":";;;AAAA,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,iCAA2C;AAAlC,gGAAA,OAAO,OAAA;AAAE,gGAAA,OAAO,OAAA;AACzB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iFAAgF;AAAvE,8IAAA,6BAA6B,OAAA;AACtC,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.locatePomFile = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const pom_1 = require("../pom");
9
- const types_1 = require("./types");
10
- const locatePomFile = async (options) => {
11
- let pomFile = options.pom ? path_1.default.resolve(options.pom) : await (0, pom_1.findRootPomXmlFile)();
12
- const rootPomFileFound = options.pom ? false : Boolean(pomFile);
13
- // Skip asking for pom file if we have a root file
14
- if (!options.yes || !pomFile) {
15
- if (pomFile) {
16
- pomFile = await (0, pom_1.confirmRootPomFile)(pomFile, rootPomFileFound);
17
- }
18
- if (!pomFile) {
19
- pomFile = await (0, pom_1.askForPomXmlFile)(rootPomFileFound);
20
- }
21
- }
22
- if (pomFile instanceof Error) {
23
- return (0, types_1.getFailedResult)(pomFile);
24
- }
25
- return (0, types_1.getPassedResult)({
26
- pomFile,
27
- });
28
- };
29
- exports.locatePomFile = locatePomFile;
30
- //# sourceMappingURL=locatePomFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locatePomFile.js","sourceRoot":"","sources":["../../src/steps/locatePomFile.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,gCAAkF;AAElF,mCAA2D;AAMpD,MAAM,aAAa,GAA6C,KAAK,EAAE,OAAO,EAAE,EAAE;IACvF,IAAI,OAAO,GAA+B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,wBAAkB,GAAE,CAAC;IAC/G,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhE,kDAAkD;IAClD,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE;QAC5B,IAAI,OAAO,EAAE;YACX,OAAO,GAAG,MAAM,IAAA,wBAAkB,EAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;SAC/D;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,MAAM,IAAA,sBAAgB,EAAC,gBAAgB,CAAC,CAAC;SACpD;KACF;IAED,IAAI,OAAO,YAAY,KAAK,EAAE;QAC5B,OAAO,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAC;KACjC;IAED,OAAO,IAAA,uBAAe,EAAyB;QAC7C,OAAO;KACR,CAAC,CAAC;AACL,CAAC,CAAC;AAtBW,QAAA,aAAa,iBAsBxB"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.locateWebpackConfigFile = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const webpack_1 = require("../webpack/webpack");
9
- const types_1 = require("./types");
10
- const locateWebpackConfigFile = async (options) => {
11
- let webpackConfigFile = options.webpack
12
- ? path_1.default.resolve(options.webpack)
13
- : await (0, webpack_1.findRootWebpackConfigFile)();
14
- const rootWebpackConfigFileFound = options.webpack ? false : Boolean(webpackConfigFile);
15
- // Skip asking for webpack config file if we have a root file
16
- if (!options.yes || !webpackConfigFile) {
17
- if (webpackConfigFile) {
18
- webpackConfigFile = await (0, webpack_1.confirmRootWebpackConfig)(webpackConfigFile, rootWebpackConfigFileFound);
19
- }
20
- if (!webpackConfigFile) {
21
- webpackConfigFile = await (0, webpack_1.askForWebpackConfig)(rootWebpackConfigFileFound);
22
- }
23
- }
24
- if (webpackConfigFile instanceof Error) {
25
- return (0, types_1.getFailedResult)(webpackConfigFile);
26
- }
27
- return (0, types_1.getPassedResult)({
28
- webpackConfigFile,
29
- });
30
- };
31
- exports.locateWebpackConfigFile = locateWebpackConfigFile;
32
- //# sourceMappingURL=locateWebpackConfigFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locateWebpackConfigFile.js","sourceRoot":"","sources":["../../src/steps/locateWebpackConfigFile.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,gDAA8G;AAE9G,mCAA2D;AAMpD,MAAM,uBAAuB,GAAuD,KAAK,EAAE,OAAO,EAAE,EAAE;IAC3G,IAAI,iBAAiB,GAA+B,OAAO,CAAC,OAAO;QACjE,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,MAAM,IAAA,mCAAyB,GAAE,CAAC;IAEtC,MAAM,0BAA0B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAExF,6DAA6D;IAC7D,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,iBAAiB,EAAE;QACtC,IAAI,iBAAiB,EAAE;YACrB,iBAAiB,GAAG,MAAM,IAAA,kCAAwB,EAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;SACnG;QAED,IAAI,CAAC,iBAAiB,EAAE;YACtB,iBAAiB,GAAG,MAAM,IAAA,6BAAmB,EAAC,0BAA0B,CAAC,CAAC;SAC3E;KACF;IAED,IAAI,iBAAiB,YAAY,KAAK,EAAE;QACtC,OAAO,IAAA,uBAAe,EAAC,iBAAiB,CAAC,CAAC;KAC3C;IAED,OAAO,IAAA,uBAAe,EAAmC;QACvD,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC,CAAC;AAzBW,QAAA,uBAAuB,2BAyBlC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getResultPayload = exports.didFail = exports.didPass = exports.getPassedResult = exports.getRestTimeoutResult = exports.getCommandTimeoutResult = exports.getTimeoutError = exports.getFailedResult = exports.VerificationStatus = void 0;
4
- var VerificationStatus;
5
- (function (VerificationStatus) {
6
- VerificationStatus[VerificationStatus["FAILED"] = 0] = "FAILED";
7
- VerificationStatus[VerificationStatus["PASSED"] = 1] = "PASSED";
8
- })(VerificationStatus = exports.VerificationStatus || (exports.VerificationStatus = {}));
9
- function getFailedResult(error) {
10
- return {
11
- status: VerificationStatus.FAILED,
12
- error,
13
- };
14
- }
15
- exports.getFailedResult = getFailedResult;
16
- function getTimeoutError(subject, timeout) {
17
- const timeoutSeconds = Math.floor(timeout / 1000).toFixed(0);
18
- return new Error(`The ${subject} timed out after ${timeoutSeconds} seconds. Try setting the --timeout option (in seconds) to override this.`);
19
- }
20
- exports.getTimeoutError = getTimeoutError;
21
- function getCommandTimeoutResult(command, timeout) {
22
- return getFailedResult(getTimeoutError(`${command} command`, timeout));
23
- }
24
- exports.getCommandTimeoutResult = getCommandTimeoutResult;
25
- function getRestTimeoutResult(restResource, timeout) {
26
- return getFailedResult(getTimeoutError(`${restResource} REST call`, timeout));
27
- }
28
- exports.getRestTimeoutResult = getRestTimeoutResult;
29
- function getPassedResult(payload) {
30
- return {
31
- status: VerificationStatus.PASSED,
32
- payload,
33
- };
34
- }
35
- exports.getPassedResult = getPassedResult;
36
- function didPass(stepResult) {
37
- return stepResult.status === VerificationStatus.PASSED;
38
- }
39
- exports.didPass = didPass;
40
- function didFail(stepResult) {
41
- return stepResult.status === VerificationStatus.FAILED;
42
- }
43
- exports.didFail = didFail;
44
- function getResultPayload(stepResult) {
45
- return stepResult.payload;
46
- }
47
- exports.getResultPayload = getResultPayload;
48
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/steps/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+DAAM,CAAA;IACN,+DAAM,CAAA;AAC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1,21 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateOptions = void 0;
7
- const valid_url_1 = __importDefault(require("valid-url"));
8
- const types_1 = require("./types");
9
- const validateOptions = async (options) => {
10
- const { applicationUrl } = options;
11
- if (applicationUrl) {
12
- const isValid = Boolean(valid_url_1.default.isWebUri(applicationUrl));
13
- if (!isValid) {
14
- const error = new Error('Provided application URL is not valid.');
15
- return (0, types_1.getFailedResult)(error);
16
- }
17
- }
18
- return (0, types_1.getPassedResult)();
19
- };
20
- exports.validateOptions = validateOptions;
21
- //# sourceMappingURL=validateOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateOptions.js","sourceRoot":"","sources":["../../src/steps/validateOptions.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AAIjC,mCAA2D;AAIpD,MAAM,eAAe,GAAmD,KAAK,EAClF,OAAgD,EAChD,EAAE;IACF,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAEnC,IAAI,cAAc,EAAE;QAClB,MAAM,OAAO,GAAG,OAAO,CAAC,mBAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAE3D,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAElE,OAAO,IAAA,uBAAe,EAAC,KAAK,CAAC,CAAC;SAC/B;KACF;IAED,OAAO,IAAA,uBAAe,GAAE,CAAC;AAC3B,CAAC,CAAC;AAhBW,QAAA,eAAe,mBAgB1B"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.verifyPomConfigIsValid = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const paths_1 = require("../paths");
9
- const pom_1 = require("../pom");
10
- const types_1 = require("./types");
11
- const verifyPomConfigIsValid = async (options, payload) => {
12
- const { pomFile, pomXml } = payload;
13
- const scanFolders = (0, pom_1.getScanFoldersConfig)(pomXml);
14
- if (!scanFolders) {
15
- const error = new Error(`The ${chalk_1.default.green((0, paths_1.getRelativePath)(pomFile))} file is missing the "${chalk_1.default.bold(pom_1.SCAN_FOLDERS_KEY)}" configuration.
16
- 📖 Check the guide on how to configure it:\nhttps://www.npmjs.com/package/atlassian-webresource-webpack-plugin#consuming-the-output-in-your-p2-plugin`);
17
- return (0, types_1.getFailedResult)(error);
18
- }
19
- return (0, types_1.getPassedResult)();
20
- };
21
- exports.verifyPomConfigIsValid = verifyPomConfigIsValid;
22
- //# sourceMappingURL=verifyPomConfigIsValid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyPomConfigIsValid.js","sourceRoot":"","sources":["../../src/steps/verifyPomConfigIsValid.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAA2C;AAC3C,gCAAgE;AAGhE,mCAA2D;AASpD,MAAM,sBAAsB,GAG/B,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEpC,MAAM,WAAW,GAAG,IAAA,0BAAoB,EAAC,MAAM,CAAC,CAAC;IAEjD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,eAAK,CAAC,KAAK,CAAC,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAC,yBAAyB,eAAK,CAAC,IAAI,CACrG,sBAAgB,CACjB;sJACiJ,CAAC,CAAC;QAEpJ,OAAO,IAAA,uBAAe,EAAC,KAAK,CAAC,CAAC;KAC/B;IAED,OAAO,IAAA,uBAAe,GAAE,CAAC;AAC3B,CAAC,CAAC;AAlBW,QAAA,sBAAsB,0BAkBjC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyWebpackBundle = void 0;
4
- const atlassianPluginXml_1 = require("../atlassianPluginXml");
5
- const webpack_1 = require("../webpack/webpack");
6
- const webpackWrmPlugin_1 = require("../webpackWrmPlugin");
7
- const types_1 = require("./types");
8
- const verifyWebpackBundle = async (options, payload) => {
9
- const { webpackConfigFile, webpackCliInfo, pomXml, pomFile } = payload;
10
- // Ensure we don't have any old generated module descriptors
11
- await (0, atlassianPluginXml_1.removeOldModuleDescriptors)(pomFile, pomXml);
12
- const preBundleTimestamp = Date.now();
13
- console.log('👀 We will run webpack bundle now. This might take some time...');
14
- const bundleResult = await (0, webpack_1.bundleWebpack)(webpackCliInfo, webpackConfigFile, options.timeout);
15
- if (bundleResult instanceof Error) {
16
- return (0, types_1.getFailedResult)(bundleResult);
17
- }
18
- // Verify if the XML files were created in the scanFolders dir
19
- const xmlResult = await (0, webpackWrmPlugin_1.verifyGeneratedWebResources)(pomFile, pomXml, preBundleTimestamp);
20
- if (xmlResult instanceof Error) {
21
- return (0, types_1.getFailedResult)(xmlResult);
22
- }
23
- return (0, types_1.getPassedResult)();
24
- };
25
- exports.verifyWebpackBundle = verifyWebpackBundle;
26
- //# sourceMappingURL=verifyWebpackBundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyWebpackBundle.js","sourceRoot":"","sources":["../../src/steps/verifyWebpackBundle.ts"],"names":[],"mappings":";;;AAAA,8DAAmE;AAEnE,gDAAmD;AAGnD,0DAAkE;AAElE,mCAA2D;AAepD,MAAM,mBAAmB,GAI5B,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvE,4DAA4D;IAC5D,MAAM,IAAA,+CAA0B,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAElD,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEtC,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;IAC/E,MAAM,YAAY,GAAG,MAAM,IAAA,uBAAa,EAAC,cAAc,EAAE,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7F,IAAI,YAAY,YAAY,KAAK,EAAE;QACjC,OAAO,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC;KACtC;IAED,8DAA8D;IAC9D,MAAM,SAAS,GAAG,MAAM,IAAA,8CAA2B,EAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAEzF,IAAI,SAAS,YAAY,KAAK,EAAE;QAC9B,OAAO,IAAA,uBAAe,EAAC,SAAS,CAAC,CAAC;KACnC;IAED,OAAO,IAAA,uBAAe,GAAE,CAAC;AAC3B,CAAC,CAAC;AA3BW,QAAA,mBAAmB,uBA2B9B"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.verifyWrmPluginHasValidConfig = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
- const paths_1 = require("../paths");
9
- const pom_1 = require("../pom");
10
- const webpackWrmPlugin_1 = require("../webpackWrmPlugin");
11
- const types_1 = require("./types");
12
- const verifyWrmPluginHasValidConfig = async (options, payload) => {
13
- const { pomConfig, pomFile, wrmWebpackPlugin } = payload;
14
- const pomXml = (0, pom_1.getPomXml)(pomConfig);
15
- if (pomXml instanceof Error) {
16
- const error = new Error(`😔 We can't parse the XML from "${chalk_1.default.green((0, paths_1.getRelativePath)(pomFile))}" pom file. Bummer`);
17
- return (0, types_1.getFailedResult)(error);
18
- }
19
- const result = await (0, webpackWrmPlugin_1.checkWrmPluginHasValidConfig)(pomXml, wrmWebpackPlugin);
20
- if (result instanceof Error) {
21
- return (0, types_1.getFailedResult)(result);
22
- }
23
- return (0, types_1.getPassedResult)({
24
- pomXml,
25
- });
26
- };
27
- exports.verifyWrmPluginHasValidConfig = verifyWrmPluginHasValidConfig;
28
- //# sourceMappingURL=verifyWrmPluginHasValidConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyWrmPluginHasValidConfig.js","sourceRoot":"","sources":["../../src/steps/verifyWrmPluginHasValidConfig.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,oCAA2C;AAC3C,gCAAmC;AAGnC,0DAAmE;AAEnE,mCAA2D;AAapD,MAAM,6BAA6B,GAGtC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAEzD,MAAM,MAAM,GAAG,IAAA,eAAS,EAAC,SAAS,CAAC,CAAC;IAEpC,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,mCAAmC,eAAK,CAAC,KAAK,CAAC,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAC,oBAAoB,CAC7F,CAAC;QAEF,OAAO,IAAA,uBAAe,EAAC,KAAK,CAAC,CAAC;KAC/B;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,+CAA4B,EAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAE5E,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,CAAC;KAChC;IAED,OAAO,IAAA,uBAAe,EAAC;QACrB,MAAM;KACP,CAAC,CAAC;AACL,CAAC,CAAC;AAzBW,QAAA,6BAA6B,iCAyBxC"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyWrmPluginScanFolders = void 0;
4
- const webpackWrmPlugin_1 = require("../webpackWrmPlugin");
5
- const types_1 = require("./types");
6
- const verifyWrmPluginScanFolders = async (options, payload) => {
7
- const { pomFile, pomXml, wrmWebpackPlugin } = payload;
8
- const result = await (0, webpackWrmPlugin_1.checkWrmScanFoldersIsValid)(pomXml, pomFile, wrmWebpackPlugin);
9
- if (result instanceof Error) {
10
- return (0, types_1.getFailedResult)(result);
11
- }
12
- return (0, types_1.getPassedResult)();
13
- };
14
- exports.verifyWrmPluginScanFolders = verifyWrmPluginScanFolders;
15
- //# sourceMappingURL=verifyWrmPluginScanFolders.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verifyWrmPluginScanFolders.js","sourceRoot":"","sources":["../../src/steps/verifyWrmPluginScanFolders.ts"],"names":[],"mappings":";;;AAEA,0DAAiE;AAEjE,mCAA2D;AAWpD,MAAM,0BAA0B,GAGnC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC7B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAM,IAAA,6CAA0B,EAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAEnF,IAAI,MAAM,YAAY,KAAK,EAAE;QAC3B,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,CAAC;KAChC;IAED,OAAO,IAAA,uBAAe,GAAE,CAAC;AAC3B,CAAC,CAAC;AAbW,QAAA,0BAA0B,8BAarC"}