@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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [0.6.6](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.6..@atlassian/wrm-troubleshooting@0.6.5) (2025-05-29)
7
+
8
+ **Note:** Version bump only for package @atlassian/wrm-troubleshooting
9
+
10
+
11
+
12
+
13
+
14
+ ### [0.6.5](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.5..@atlassian/wrm-troubleshooting@0.6.4) (2025-04-17)
15
+
16
+ **Note:** Version bump only for package @atlassian/wrm-troubleshooting
17
+
18
+
19
+
20
+
21
+
6
22
  ### [0.6.4](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.4..@atlassian/wrm-troubleshooting@0.6.3) (2024-11-19)
7
23
 
8
24
 
package/README.md CHANGED
@@ -7,7 +7,7 @@ A tool that can help you with troubleshooting the configuration of `webpack` and
7
7
 
8
8
  ## Usage
9
9
 
10
- The troubleshooting tool was designed to check and verify the configuration of the [Atlassian P2 plugin][p2-plugin-docs], a modern front-end setup configured with [webpack][webpack] and [`atlassian-webresource-webpack-plugin`][webpack-wrm-plugin] plugin.
10
+ The troubleshooting tool was designed to check and verify the configuration of the [Atlassian P2 plugin][p2-plugin-docs], a modern front-end setup configured with [webpack][webpack] and [`@atlassian/webresource-webpack-plugin`][webpack-wrm-plugin] plugin.
11
11
 
12
12
  Additionally, the troubleshooting tool can verify if the webpack bundled JS code can be accessed with Atlassian Web-Resource Manager (WRM) inside the Atlassian product runtime.
13
13
 
@@ -92,8 +92,8 @@ This plugin is compatible with:
92
92
 
93
93
  - Node 14+
94
94
  - `webpack` v4 and `webpack` v5
95
- - `atlassian-webresource-webpack-plugin` v4 and `atlassian-webresource-webpack-plugin` v5
95
+ - `atlassian-webresource-webpack-plugin` v4, v5, v6 and `@atlassian-webresource-webpack-plugin` v7+
96
96
 
97
- [webpack-wrm-plugin]: https://www.npmjs.com/package/atlassian-webresource-webpack-plugin 'webpack WRM plugin'
97
+ [webpack-wrm-plugin]: https://www.npmjs.com/package/@atlassian/webresource-webpack-plugin 'webpack WRM plugin'
98
98
  [webpack]: https://webpack.js.org 'webpack'
99
99
  [p2-plugin-docs]: https://developer.atlassian.com/server/framework/atlassian-sdk/plugin-framework 'Plugin Framewor'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlassian/wrm-troubleshooting",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "author": "Atlassian Pty Ltd.",
5
5
  "description": "A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.",
6
6
  "keywords": [
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public",
46
- "registry": "https://registry.npmjs.org/",
47
- "@atlassian:registry": "https://registry.npmjs.org/"
46
+ "registry": "https://packages.atlassian.com/api/npm/npm-public/",
47
+ "@atlassian:registry": "https://packages.atlassian.com/api/npm/npm-public/"
48
48
  },
49
49
  "dependencies": {
50
50
  "@amplitude/node": "1.9.1",
@@ -67,6 +67,7 @@
67
67
  "yargs": "17.2.1"
68
68
  },
69
69
  "devDependencies": {
70
+ "@atlassian/webresource-webpack-plugin": "^7.0.2",
70
71
  "@types/concat-stream": "1.6.1",
71
72
  "@types/glob": "7.2.0",
72
73
  "@types/inquirer": "8.1.3",
@@ -80,7 +81,6 @@
80
81
  "@types/valid-url": "1.0.3",
81
82
  "@types/webpack": "5.28.0",
82
83
  "@types/yargs": "17.0.4",
83
- "atlassian-webresource-webpack-plugin": "^7.0.0",
84
84
  "concat-stream": "2.0.0",
85
85
  "get-port": "5.1.1",
86
86
  "jest": "27.4.3",
@@ -93,5 +93,5 @@
93
93
  "engines": {
94
94
  "node": ">=12.0.0"
95
95
  },
96
- "gitHead": "00aa31671f9d3b4acdc81b2755736e9661fbe5e0"
96
+ "gitHead": "622a7f318cc99f3760df5c1c90a5598b202526fd"
97
97
  }
@@ -1,74 +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.trackEvent = void 0;
26
- const Amplitude = __importStar(require("@amplitude/node"));
27
- const fs_1 = require("fs");
28
- const os_1 = __importDefault(require("os"));
29
- const path_1 = __importDefault(require("path"));
30
- // Unique ID for WRM Troubleshooting Tool
31
- const AMP_CLIENT_ID = '490d4e87c5c2b9c250de24d48ce09303';
32
- // TODO: Fix me and detect local mode when we are running tool without installing it from NPM
33
- const IS_DEV_MODE = process.env.NODE_ENV === 'test';
34
- // Configure Amplitude
35
- const client = Amplitude.init(AMP_CLIENT_ID);
36
- const isObject = (value) => Object.prototype.toString.call(value) === '[object Object]';
37
- let pkgVersion;
38
- async function trackEvent(eventName, customProperties = null) {
39
- // Don't send the analytics from within a dev mode
40
- if (IS_DEV_MODE) {
41
- return;
42
- }
43
- if (!pkgVersion) {
44
- // We need to read the package.json file manually. We can't import the package.json file using ESM syntax since if we do that
45
- // TSC would copy the package.json file into "dist" directory.
46
- // Having a copy of package.json file under "dist" directory would mess-up with the package distribution.
47
- try {
48
- const pkg = await fs_1.promises.readFile(path_1.default.join(__dirname, '../../package.json'));
49
- const { version } = JSON.parse(pkg.toString());
50
- pkgVersion = version;
51
- }
52
- catch (e) {
53
- // eslint-disable-next-line no-empty
54
- pkgVersion = 'unknown';
55
- }
56
- }
57
- let eventProperties;
58
- if (isObject(customProperties)) {
59
- eventProperties = Object.assign({}, customProperties);
60
- }
61
- await client.logEvent({
62
- event_type: eventName,
63
- device_id: 'required-but-not-used',
64
- event_properties: eventProperties,
65
- // Non-required properties
66
- // https://developers.amplitude.com/docs/http-api-v2
67
- app_version: pkgVersion,
68
- platform: os_1.default.platform(),
69
- os_name: os_1.default.type(),
70
- os_version: os_1.default.release(),
71
- });
72
- }
73
- exports.trackEvent = trackEvent;
74
- //# sourceMappingURL=analytics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/analytics/analytics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA6C;AAC7C,2BAAoC;AACpC,4CAAoB;AACpB,gDAAwB;AAExB,yCAAyC;AACzC,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAEzD,6FAA6F;AAC7F,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC;AAEpD,sBAAsB;AACtB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC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- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trackVerificationStepEvent = exports.TROUBLESHOOTING_COMMAND_PASSED = exports.TROUBLESHOOTING_COMMAND_RUN = void 0;
4
- const steps_1 = require("../steps");
5
- const analytics_1 = require("./analytics");
6
- exports.TROUBLESHOOTING_COMMAND_RUN = 'TROUBLESHOOTING_COMMAND_RUN';
7
- exports.TROUBLESHOOTING_COMMAND_PASSED = 'TROUBLESHOOTING_COMMAND_PASSED';
8
- const VERIFICATION_STEP = 'VERIFICATION_STEP';
9
- async function trackVerificationStepEvent(stepName, validationResult) {
10
- const eventData = {
11
- stepName,
12
- };
13
- if ((0, steps_1.didFail)(validationResult)) {
14
- Object.assign(eventData, {
15
- stepResult: 'FAILED',
16
- stepError: validationResult.error,
17
- });
18
- }
19
- else {
20
- Object.assign(eventData, {
21
- stepResult: 'PASSED',
22
- });
23
- }
24
- await (0, analytics_1.trackEvent)(VERIFICATION_STEP, eventData);
25
- }
26
- exports.trackVerificationStepEvent = trackVerificationStepEvent;
27
- //# sourceMappingURL=events.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AAEnC,2CAAyC;AAE5B,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AAC5D,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAE/E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAEvC,KAAK,UAAU,0BAA0B,CAC9C,QAAgB,EAChB,gBAAsE;IAEtE,MAAM,SAAS,GAAG;QAChB,QAAQ;KACT,CAAC;IAEF,IAAI,IAAA,eAAO,EAAC,gBAAgB,CAAC,EAAE;QAC7B,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;YACvB,UAAU,EAAE,QAAQ;YACpB,SAAS,EAAE,gBAAgB,CAAC,KAAK;SAClC,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;YACvB,UAAU,EAAE,QAAQ;SACrB,CAAC,CAAC;KACJ;IAED,MAAM,IAAA,sBAAU,EAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;AACjD,CAAC;AApBD,gEAoBC"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applicationUrls = void 0;
4
- // https://developer.atlassian.com/server/framework/atlassian-sdk/working-with-the-sdk/#supported-atlassian-applications-and-default-ports
5
- exports.applicationUrls = [
6
- {
7
- product: 'Bamboo',
8
- defaultUrl: 'http://localhost:6990/bamboo',
9
- },
10
- {
11
- product: 'Bitbucket',
12
- defaultUrl: 'http://localhost:7990/bitbucket',
13
- },
14
- {
15
- product: 'Confluence',
16
- defaultUrl: 'http://localhost:1990/confluence',
17
- },
18
- {
19
- product: 'Crowd',
20
- defaultUrl: 'http://localhost:4990/crowd',
21
- },
22
- {
23
- product: 'Crucible',
24
- defaultUrl: 'http://localhost:3990/fecru',
25
- },
26
- {
27
- product: 'FishEye',
28
- defaultUrl: 'http://localhost:3990/fecru',
29
- },
30
- {
31
- product: 'Jira',
32
- defaultUrl: 'http://localhost:2990/jira',
33
- },
34
- {
35
- product: 'RefApp',
36
- defaultUrl: 'http://localhost:5990/refapp',
37
- },
38
- ];
39
- //# sourceMappingURL=applicationUrls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applicationUrls.js","sourceRoot":"","sources":["../src/applicationUrls.ts"],"names":[],"mappings":";;;AAAA,2IAA2I;AAC9H,QAAA,eAAe,GAAuD;IACjF;QACE,OAAO,EAAE,QAAQ;QACjB,UAAU,EAAE,8BAA8B;KAC3C;IACD;QACE,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,iCAAiC;KAC9C;IACD;QACE,OAAO,EAAE,YAAY;QACrB,UAAU,EAAE,kCAAkC;KAC/C;IACD;QACE,OAAO,EAAE,OAAO;QAChB,UAAU,EAAE,6BAA6B;KAC1C;IACD;QACE,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,6BAA6B;KAC1C;IACD;QACE,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,6BAA6B;KAC1C;IACD;QACE,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,4BAA4B;KACzC;IACD;QACE,OAAO,EAAE,QAAQ;QACjB,UAAU,EAAE,8BAA8B;KAC3C;CACO,CAAC"}
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFullWebResourceKey = exports.removeOldModuleDescriptors = exports.getGeneratedModuleDescriptorPaths = exports.getPluginWebResourceDefinitions = void 0;
4
- const fs_1 = require("fs");
5
- const globWithOptions_1 = require("./globWithOptions");
6
- const pom_1 = require("./pom");
7
- const xmlParser_1 = require("./xmlParser");
8
- async function getPluginWebResourceDefinitions(pomFile, pomXml) {
9
- const generatedXmlPaths = await getGeneratedModuleDescriptorPaths(pomFile, pomXml);
10
- const wrmWebResources = [];
11
- for (const xmlFile of generatedXmlPaths) {
12
- const webResources = await getWebResourcesFromFile(xmlFile);
13
- if (webResources instanceof Error) {
14
- return webResources;
15
- }
16
- wrmWebResources.push(...webResources);
17
- }
18
- return wrmWebResources.sort((a, b) => a.key.localeCompare(b.key));
19
- }
20
- exports.getPluginWebResourceDefinitions = getPluginWebResourceDefinitions;
21
- const WEB_RESOURCE_XML_KEY = 'web-resource';
22
- async function getWebResourcesFromFile(xmlFile) {
23
- const xml = await (0, xmlParser_1.parseXmlFromFile)(xmlFile);
24
- if (xml instanceof Error) {
25
- return xml;
26
- }
27
- const rootKey = Object.keys(xml)[0];
28
- const project = xml[rootKey][0];
29
- if (!(WEB_RESOURCE_XML_KEY in project)) {
30
- return [];
31
- }
32
- const webResourcesXml = project[WEB_RESOURCE_XML_KEY];
33
- return webResourcesXml.map((webResourceXml) => {
34
- const webResource = {
35
- key: webResourceXml.attrs.key,
36
- };
37
- return webResource;
38
- });
39
- }
40
- async function getGeneratedModuleDescriptorPaths(pomFile, pomXml) {
41
- const pomScanFolders = (0, pom_1.getAbsoluteScanFoldersConfig)(pomXml, pomFile);
42
- return getXmlFilesFromDirectory(pomScanFolders);
43
- }
44
- exports.getGeneratedModuleDescriptorPaths = getGeneratedModuleDescriptorPaths;
45
- async function removeOldModuleDescriptors(pomFile, pomXml) {
46
- const generatedXmlPaths = await getGeneratedModuleDescriptorPaths(pomFile, pomXml);
47
- // Delete files in parallel
48
- await Promise.all(generatedXmlPaths.map((filePath) => silentlyDeleteFile(filePath)));
49
- }
50
- exports.removeOldModuleDescriptors = removeOldModuleDescriptors;
51
- async function silentlyDeleteFile(filePath) {
52
- try {
53
- await fs_1.promises.unlink(filePath);
54
- }
55
- catch (e) {
56
- // gracefully skip the error
57
- }
58
- }
59
- async function getXmlFilesFromDirectory(directory) {
60
- return await (0, globWithOptions_1.globWithOptions)('**/*.xml', {
61
- cwd: directory,
62
- ignore: [], // Remove default ignored directories so we can scan within "target" directory
63
- });
64
- }
65
- function getFullWebResourceKey(pluginKey, webResourceKey) {
66
- return `${pluginKey}:${webResourceKey}`;
67
- }
68
- exports.getFullWebResourceKey = getFullWebResourceKey;
69
- //# sourceMappingURL=atlassianPluginXml.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atlassianPluginXml.js","sourceRoot":"","sources":["../src/atlassianPluginXml.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AAEpC,uDAAoD;AACpD,+BAAqD;AAErD,2CAA+C;AAMxC,KAAK,UAAU,+BAA+B,CACnD,OAAe,EACf,MAAc;IAEd,MAAM,iBAAiB,GAAG,MAAM,iCAAiC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAEnF,MAAM,eAAe,GAA4B,EAAE,CAAC;IAEpD,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE;QACvC,MAAM,YAAY,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,YAAY,YAAY,KAAK,EAAE;YACjC,OAAO,YAAY,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iB,GAAG,MAAM,iCAAiC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAEnF,2BAA2B;IAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,CAAgB,CAAC,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACtG,CAAC;AALD,gEAKC;AAED,KAAK,UAAU,kBAAkB,CAAC,QAAgB;IAChD,IAAI;QACF,MAAM,aAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;KAC3B;IAAC,OAAO,CAAC,EAAE;QACV,4BAA4B;KAC7B;AACH,CAAC;AAED,KAAK,UAAU,wBAAwB,CAAC,SAAiB;IACvD,OAAO,MAAM,IAAA,iCAAe,EAAC,UAAU,EAAE;QACvC,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,EAAE,EAAE,8EAA8E;KAC3F,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,qBAAqB,CAAC,SAAiB,EAAE,cAAsB;IAC7E,OAAO,GAAG,SAAS,IAAI,cAAc,EAAE,CAAC;AAC1C,CAAC;AAFD,sDAEC"}
@@ -1,58 +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.checkForUpdate = void 0;
26
- const fs = __importStar(require("fs"));
27
- const path = __importStar(require("path"));
28
- const update_notifier_1 = __importDefault(require("update-notifier"));
29
- function checkForUpdate() {
30
- if (process.env.NODE_ENV === 'test') {
31
- return;
32
- }
33
- let packageVersion = null;
34
- let packageName = null;
35
- try {
36
- const pkg = fs.readFileSync(path.join(__dirname, '../package.json'));
37
- const { name, version } = JSON.parse(pkg.toString());
38
- packageVersion = version;
39
- packageName = name;
40
- }
41
- catch (e) {
42
- console.log(e);
43
- // eslint-disable-next-line no-empty
44
- }
45
- if (!packageName || !packageVersion) {
46
- return;
47
- }
48
- const notifier = (0, update_notifier_1.default)({
49
- packageName,
50
- packageVersion,
51
- updateCheckInterval: 0,
52
- });
53
- notifier.notify({
54
- defer: true,
55
- });
56
- }
57
- exports.checkForUpdate = checkForUpdate;
58
- //# sourceMappingURL=checkForUpdate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkForUpdate.js","sourceRoot":"","sources":["../src/checkForUpdate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,sEAA6C;AAE7C,SAAgB,cAAc;IAC5B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;QACnC,OAAO;KACR;IAED,IAAI,cAAc,GAAkB,IAAI,CAAC;IACzC,IAAI,WAAW,GAAkB,IAAI,CAAC;IAEtC,IAAI;QACF,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;QACrE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAY,CAAC;QAEhE,cAAc,GAAG,OAAO,CAAC;QACzB,WAAW,GAAG,IAAI,CAAC;KACpB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACf,oCAAoC;KACrC;IAED,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,EAAE;QACnC,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,IAAA,yBAAc,EAAC;QAC9B,WAAW;QACX,cAAc;QACd,mBAAmB,EAAE,CAAC;KACvB,CAAC,CAAC;IACH,QAAQ,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;AACL,CAAC;AA/BD,wCA+BC"}
package/dist/cli.js DELETED
@@ -1,76 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- /* eslint-disable node/shebang */
8
- const yargs_1 = __importDefault(require("yargs"));
9
- const checkForUpdate_1 = require("./checkForUpdate");
10
- const troubleshooting_1 = require("./troubleshooting");
11
- const troubleshootingOptions_1 = require("./troubleshootingOptions");
12
- const yargsHelper_1 = require("./yargsHelper");
13
- // Check for a new version
14
- (0, checkForUpdate_1.checkForUpdate)();
15
- yargs_1.default
16
- .command({
17
- command: '$0 [options]',
18
- // @ts-expect-error Yargs throws type errors here
19
- desc: 'Run troubleshooting for webpack WRM plugin.',
20
- builder: (yargs) => yargs
21
- .option('webpack', {
22
- describe: 'The path to webpack configuration file\ne.g. ./webpack.config.js',
23
- type: 'string',
24
- alias: 'w',
25
- })
26
- .option('pom', {
27
- describe: 'The path to pom.xml file\ne.g. ./pom.xml',
28
- type: 'string',
29
- alias: 'p',
30
- })
31
- .option('applicationUrl', {
32
- describe: 'Full application URL we will use to verify WRM runtime\ne.g. http://localhost:2990/jira',
33
- type: 'string',
34
- alias: 'u',
35
- })
36
- .option('resourceKey', {
37
- describe: 'A web-resource key we will use to verify WRM runtime\ne.g. name-of-my-web-resource-key',
38
- type: 'string',
39
- alias: 'r',
40
- })
41
- .option('noWrm', {
42
- describe: 'Skip running in-app WRM check',
43
- type: 'boolean',
44
- alias: 'nw',
45
- default: false,
46
- })
47
- .option('yes', {
48
- describe: 'Skip confirmation and run troubleshooting immediately',
49
- type: 'boolean',
50
- alias: 'y',
51
- default: false,
52
- })
53
- .option('verbose', {
54
- describe: 'Display verbose output',
55
- type: 'boolean',
56
- alias: 'v',
57
- default: false,
58
- })
59
- .option('timeout', {
60
- describe: 'A timeout in seconds for executing external commands.',
61
- type: 'number',
62
- alias: 't',
63
- default: troubleshootingOptions_1.DEFAULT_TIMEOUT,
64
- // Convert the seconds to milliseconds
65
- coerce(seconds) {
66
- if (!seconds || Number.isNaN(seconds) || seconds < 1) {
67
- seconds = troubleshootingOptions_1.DEFAULT_TIMEOUT;
68
- }
69
- return seconds * 1000;
70
- },
71
- }),
72
- handler: (0, yargsHelper_1.getAsyncHandler)(troubleshooting_1.troubleshootingCommand),
73
- })
74
- .strict()
75
- .help().argv; // for --help and -h to work
76
- //# sourceMappingURL=cli.js.map
package/dist/cli.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AACA,iCAAiC;AACjC,kDAA0B;AAE1B,qDAAkD;AAElD,uDAA2D;AAC3D,qEAA2D;AAC3D,+CAAgD;AAEhD,0BAA0B;AAC1B,IAAA,+BAAc,GAAE,CAAC;AAEjB,eAAK;KACF,OAAO,CAAyB;IAC/B,OAAO,EAAE,cAAc;IACvB,iDAAiD;IACjD,IAAI,EAAE,6CAA6C;IACnD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,kEAAkE;QAC5E,IAAI,EAAE,QAAQ;QACd,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IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,4BAA4B"}
package/dist/cliUtils.js DELETED
@@ -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.cliLink = void 0;
7
- const cli_truncate_1 = __importDefault(require("cli-truncate"));
8
- const terminal_link_1 = __importDefault(require("terminal-link"));
9
- // Decrease the output size by 10% to avoid spanning the url link across full terminal width.
10
- // We do that because a) the URLs can be quite long b) we indent the URLs when we display them in the terminal.
11
- const maxColumns = process.stdout.columns - Math.floor(process.stdout.columns / 10);
12
- function cliLink(url, label = url) {
13
- const shortLabel = (0, cli_truncate_1.default)(label, maxColumns, { position: 'middle' });
14
- return (0, terminal_link_1.default)(shortLabel, url, {
15
- fallback(text, url) {
16
- return url;
17
- },
18
- });
19
- }
20
- exports.cliLink = cliLink;
21
- //# sourceMappingURL=cliUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cliUtils.js","sourceRoot":"","sources":["../src/cliUtils.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,kEAAyC;AAEzC,6FAA6F;AAC7F,+GAA+G;AAC/G,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;AAEpF,SAAgB,OAAO,CAAC,GAAW,EAAE,QAAgB,GAAG;IACtD,MAAM,UAAU,GAAG,IAAA,sBAAW,EAAC,KAAK,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE1E,OAAO,IAAA,uBAAY,EAAC,UAAU,EAAE,GAAG,EAAE;QACnC,QAAQ,CAAC,IAAI,EAAE,GAAG;YAChB,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AARD,0BAQC"}
@@ -1,18 +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.globWithOptions = void 0;
7
- const glob_promise_1 = __importDefault(require("glob-promise"));
8
- const DEFAULT_IGNORED = ['**/node_modules/**', '**/target/**', '**/dist/**'];
9
- async function globWithOptions(pattern, options = {}) {
10
- return (0, glob_promise_1.default)(pattern, {
11
- nodir: true,
12
- ignore: DEFAULT_IGNORED,
13
- absolute: true,
14
- ...options,
15
- });
16
- }
17
- exports.globWithOptions = globWithOptions;
18
- //# sourceMappingURL=globWithOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"globWithOptions.js","sourceRoot":"","sources":["../src/globWithOptions.ts"],"names":[],"mappings":";;;;;;AACA,gEAAgC;AAEhC,MAAM,eAAe,GAAG,CAAC,oBAAoB,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;AAEtE,KAAK,UAAU,eAAe,CAAC,OAAe,EAAE,UAAoB,EAAE;IAC3E,OAAO,IAAA,sBAAI,EAAC,OAAO,EAAE;QACnB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,eAAe;QACvB,QAAQ,EAAE,IAAI;QACd,GAAG,OAAO;KACX,CAAC,CAAC;AACL,CAAC;AAPD,0CAOC"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MavenError = void 0;
4
- class MavenError extends Error {
5
- constructor(message, mavenOutput) {
6
- super(message);
7
- this.mavenOutput = mavenOutput;
8
- }
9
- getMavenOutput() {
10
- return this.mavenOutput;
11
- }
12
- }
13
- exports.MavenError = MavenError;
14
- //# sourceMappingURL=MavenError.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MavenError.js","sourceRoot":"","sources":["../../src/maven/MavenError.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAW,SAAQ,KAAK;IAGnC,YAAY,OAAe,EAAE,WAAmB;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAZD,gCAYC"}
package/dist/paths.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isSubDirectory = exports.getRelativePath = void 0;
4
- const path = require("path");
5
- const getRelativePath = (location) => path.relative(process.cwd(), location);
6
- exports.getRelativePath = getRelativePath;
7
- const isSubDirectory = (parent, child) => {
8
- const relative = path.relative(parent, child);
9
- return Boolean(relative && !relative.startsWith('..') && !path.isAbsolute(relative));
10
- };
11
- exports.isSubDirectory = isSubDirectory;
12
- //# sourceMappingURL=paths.js.map
package/dist/paths.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":";;;AAAA,6BAA8B;AAEvB,MAAM,eAAe,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;AAAvF,QAAA,eAAe,mBAAwE;AAE7F,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,KAAa,EAAW,EAAE;IACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE9C,OAAO,OAAO,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACvF,CAAC,CAAC;AAJW,QAAA,cAAc,kBAIzB"}