@atlassian/wrm-troubleshooting 0.0.0-snapshot.0
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.
- package/CHANGELOG.md +191 -0
- package/CODE_OF_CONDUCT.md +73 -0
- package/LICENSE +13 -0
- package/README.md +99 -0
- package/bin/cli.js +5 -0
- package/dist/analytics/analytics.js +74 -0
- package/dist/analytics/analytics.js.map +1 -0
- package/dist/analytics/events.js +27 -0
- package/dist/analytics/events.js.map +1 -0
- package/dist/applicationUrls.js +39 -0
- package/dist/applicationUrls.js.map +1 -0
- package/dist/atlassianPluginXml.js +69 -0
- package/dist/atlassianPluginXml.js.map +1 -0
- package/dist/checkForUpdate.js +58 -0
- package/dist/checkForUpdate.js.map +1 -0
- package/dist/cli.js +76 -0
- package/dist/cli.js.map +1 -0
- package/dist/cliUtils.js +21 -0
- package/dist/cliUtils.js.map +1 -0
- package/dist/globWithOptions.js +18 -0
- package/dist/globWithOptions.js.map +1 -0
- package/dist/maven/MavenError.js +14 -0
- package/dist/maven/MavenError.js.map +1 -0
- package/dist/paths.js +12 -0
- package/dist/paths.js.map +1 -0
- package/dist/pom.js +147 -0
- package/dist/pom.js.map +1 -0
- package/dist/steps/getEffectivePomConfig.js +94 -0
- package/dist/steps/getEffectivePomConfig.js.map +1 -0
- package/dist/steps/getEffectiveWebpackConfig.js +35 -0
- package/dist/steps/getEffectiveWebpackConfig.js.map +1 -0
- package/dist/steps/getWrmWebpackPlugin.js +22 -0
- package/dist/steps/getWrmWebpackPlugin.js.map +1 -0
- package/dist/steps/index.js +27 -0
- package/dist/steps/index.js.map +1 -0
- package/dist/steps/locatePomFile.js +30 -0
- package/dist/steps/locatePomFile.js.map +1 -0
- package/dist/steps/locateWebpackConfigFile.js +32 -0
- package/dist/steps/locateWebpackConfigFile.js.map +1 -0
- package/dist/steps/types.js +48 -0
- package/dist/steps/types.js.map +1 -0
- package/dist/steps/validateOptions.js +21 -0
- package/dist/steps/validateOptions.js.map +1 -0
- package/dist/steps/verifyPomConfigIsValid.js +22 -0
- package/dist/steps/verifyPomConfigIsValid.js.map +1 -0
- package/dist/steps/verifyWebpackBundle.js +26 -0
- package/dist/steps/verifyWebpackBundle.js.map +1 -0
- package/dist/steps/verifyWrmPluginHasValidConfig.js +28 -0
- package/dist/steps/verifyWrmPluginHasValidConfig.js.map +1 -0
- package/dist/steps/verifyWrmPluginScanFolders.js +15 -0
- package/dist/steps/verifyWrmPluginScanFolders.js.map +1 -0
- package/dist/steps/verifyWrmRuntime.js +139 -0
- package/dist/steps/verifyWrmRuntime.js.map +1 -0
- package/dist/troubleshooting.js +219 -0
- package/dist/troubleshooting.js.map +1 -0
- package/dist/troubleshootingOptions.js +12 -0
- package/dist/troubleshootingOptions.js.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/webpack/webpack.js +149 -0
- package/dist/webpack/webpack.js.map +1 -0
- package/dist/webpack/webpackCli.js +167 -0
- package/dist/webpack/webpackCli.js.map +1 -0
- package/dist/webpack/webpackCliV3.js +33 -0
- package/dist/webpack/webpackCliV3.js.map +1 -0
- package/dist/webpack/webpackCliV4.js +33 -0
- package/dist/webpack/webpackCliV4.js.map +1 -0
- package/dist/webpack/webpackError.js +14 -0
- package/dist/webpack/webpackError.js.map +1 -0
- package/dist/webpackPlugin/WebpackRetrieveConfigPlugin.js +61 -0
- package/dist/webpackPlugin/WebpackRetrieveConfigPlugin.js.map +1 -0
- package/dist/webpackPlugin/webpack.config.js +10 -0
- package/dist/webpackPlugin/webpack.config.js.map +1 -0
- package/dist/webpackWrmPlugin.js +62 -0
- package/dist/webpackWrmPlugin.js.map +1 -0
- package/dist/wrm/fetchWithTimeout.js +23 -0
- package/dist/wrm/fetchWithTimeout.js.map +1 -0
- package/dist/wrm/wrmRestApi.js +93 -0
- package/dist/wrm/wrmRestApi.js.map +1 -0
- package/dist/wrm/wrmTypes.js +3 -0
- package/dist/wrm/wrmTypes.js.map +1 -0
- package/dist/xmlParser.js +42 -0
- package/dist/xmlParser.js.map +1 -0
- package/dist/yargsHelper.js +22 -0
- package/dist/yargsHelper.js.map +1 -0
- package/package.json +97 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## 0.0.0-snapshot.0 (2024-12-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### [0.6.3](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.3..@atlassian/wrm-troubleshooting@0.6.2) (2024-06-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **soy-loader:** [SPFE-1067](https://ecosystem.atlassian.net/browse/SPFE-1067) - ensure soy-loader accepts webpack 4 as a peer dependency and add system-level tests for working with all supported webpack versions ([3d8fe4e](https://bitbucket.org/atlassianlabs/fe-server/commits/3d8fe4e97c7af231c32dacf860b4fa54e08053fa))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### [0.6.2](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.2..@atlassian/wrm-troubleshooting@0.6.1) (2024-05-28)
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
### [0.6.1](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.6.1..@atlassian/wrm-troubleshooting@0.6.0) (2024-05-13)
|
|
28
|
+
|
|
29
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
30
|
+
|
|
31
|
+
## 0.6.0 (2024-04-05)
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
- **webresource-webpack-plugin:** introduce association generation for resource files. Automatically pick up the associated package name from Webpack context path ([a129ce4](https://bitbucket.org/atlassianlabs/fe-server/commits/a129ce413b5d7876017028ec09a7cd70dd9386da))
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- [SPFE-894](https://ecosystem.atlassian.net/browse/SPFE-894) refactor code and fix some ESLint Sonar rules ([4b995c2](https://bitbucket.org/atlassianlabs/fe-server/commits/4b995c2f531c12b7d7c9010fc19b0a1efa842358))
|
|
40
|
+
|
|
41
|
+
### [0.5.11](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.11..@atlassian/wrm-troubleshooting@0.5.10) (2023-02-07)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
44
|
+
|
|
45
|
+
### [0.5.10](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.10..@atlassian/wrm-troubleshooting@0.5.9) (2022-08-09)
|
|
46
|
+
|
|
47
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
48
|
+
|
|
49
|
+
### [0.5.9](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.9..@atlassian/wrm-troubleshooting@0.5.8) (2022-06-06)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
52
|
+
|
|
53
|
+
### 0.5.8 (2022-02-10)
|
|
54
|
+
|
|
55
|
+
### Bug Fixes
|
|
56
|
+
|
|
57
|
+
- [SPFE-894](https://ecosystem.atlassian.net/browse/SPFE-894) refactor code and fix some ESLint Sonar rules ([4b995c2](https://bitbucket.org/atlassianlabs/fe-server/commits/4b995c2f531c12b7d7c9010fc19b0a1efa842358))
|
|
58
|
+
|
|
59
|
+
### [0.5.7](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.7..@atlassian/wrm-troubleshooting@0.5.6) (2021-11-17)
|
|
60
|
+
|
|
61
|
+
### Bug Fixes
|
|
62
|
+
|
|
63
|
+
- [SPFE-759](https://ecosystem.atlassian.net/browse/SPFE-759) Check if one of the "mvn" or "atlas-mvn" commands is available ([2b09a6a](https://bitbucket.org/atlassianlabs/fe-server/commits/2b09a6a99480178c1e224a9ae68b313aae6d59b3))
|
|
64
|
+
|
|
65
|
+
### 0.5.6 (2021-11-17)
|
|
66
|
+
|
|
67
|
+
### Bug Fixes
|
|
68
|
+
|
|
69
|
+
- [SPFE-759](https://ecosystem.atlassian.net/browse/SPFE-759) Fix compatibility issues with Windows OS ([2a09d0d](https://bitbucket.org/atlassianlabs/fe-server/commits/2a09d0d1c8bc353c7717cbcf9190828773a8350b))
|
|
70
|
+
- [SPFE-760](https://ecosystem.atlassian.net/browse/SPFE-760) Fix checking webpack-cli version in CLI >= 4.9 ([5fac5a0](https://bitbucket.org/atlassianlabs/fe-server/commits/5fac5a0e9e1b45a30a17c0dac52952a7e1df7b1c))
|
|
71
|
+
- **ci:** [SPFE-760](https://ecosystem.atlassian.net/browse/SPFE-760) Run integration tests with webpack 4 and 5 ([65a8b17](https://bitbucket.org/atlassianlabs/fe-server/commits/65a8b179561218d0fcdc37d0cc286e1af08f0e0e))
|
|
72
|
+
- **deps:** update dependency @amplitude/node to v1.9.1 ([57dae59](https://bitbucket.org/atlassianlabs/fe-server/commits/57dae59bc2f5f119cc790f017205b4530ae593af))
|
|
73
|
+
- Update webpack depndency ([00fc73e](https://bitbucket.org/atlassianlabs/fe-server/commits/00fc73e95ad4a2f89ee4fd3561ab3fb60d1b9516))
|
|
74
|
+
|
|
75
|
+
### [0.5.5](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.5..@atlassian/wrm-troubleshooting@0.5.4) (2021-10-14)
|
|
76
|
+
|
|
77
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
78
|
+
|
|
79
|
+
### [0.5.4](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.4..@atlassian/wrm-troubleshooting@0.5.3) (2021-10-08)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
82
|
+
|
|
83
|
+
### [0.5.3](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.3..@atlassian/wrm-troubleshooting@0.5.2) (2021-09-30)
|
|
84
|
+
|
|
85
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
86
|
+
|
|
87
|
+
### [0.5.2](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.2..@atlassian/wrm-troubleshooting@0.5.1) (2021-09-27)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
90
|
+
|
|
91
|
+
### [0.5.1](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.1..@atlassian/wrm-troubleshooting@0.5.0) (2021-09-24)
|
|
92
|
+
|
|
93
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
94
|
+
|
|
95
|
+
## [0.5.0](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.5.0..@atlassian/wrm-troubleshooting@0.4.3) (2021-09-22)
|
|
96
|
+
|
|
97
|
+
- Update internal dependencies
|
|
98
|
+
|
|
99
|
+
### Features
|
|
100
|
+
|
|
101
|
+
- **ts:** Update codebase to TS 4.4 ([36da0d8](https://bitbucket.org/atlassianlabs/fe-server/commits/36da0d885c1e3c49a27f6a86bae1c3b3844a5d90))
|
|
102
|
+
- **wrm-troubleshooting:** [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) add version checker when package is installed globally ([df21c42](https://bitbucket.org/atlassianlabs/fe-server/commits/df21c42b17f006996b9855f1ce442f718ef91c90))
|
|
103
|
+
|
|
104
|
+
### [0.4.3](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.4.3..@atlassian/wrm-troubleshooting@0.4.2) (2021-09-02)
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
- **wrm-troubleshooting:** [SPFE-738](https://ecosystem.atlassian.net/browse/SPFE-738) Update readme and use proper link to an image ([c848737](https://bitbucket.org/atlassianlabs/fe-server/commits/c84873747810e43b160f0cee2e015d17f3233868))
|
|
109
|
+
|
|
110
|
+
### [0.4.2](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.4.2..@atlassian/wrm-troubleshooting@0.4.1) (2021-09-02)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @atlassian/wrm-troubleshooting
|
|
113
|
+
|
|
114
|
+
### [0.4.1](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.4.1..@atlassian/wrm-troubleshooting@0.4.0) (2021-09-02)
|
|
115
|
+
|
|
116
|
+
### Bug Fixes
|
|
117
|
+
|
|
118
|
+
- **wrm-troubleshooting:** add the "prepublishOnly" script to build the package before publishing ([329c66b](https://bitbucket.org/atlassianlabs/fe-server/commits/329c66b55714575c11f5e03f6da668309163a98c))
|
|
119
|
+
|
|
120
|
+
## [0.4.0](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/wrm-troubleshooting@0.4.0..v0.3.3) (2021-09-02)
|
|
121
|
+
|
|
122
|
+
### Features
|
|
123
|
+
|
|
124
|
+
- **wrm-troubleshooting:** [SPFE-738](https://ecosystem.atlassian.net/browse/SPFE-738) Update readme for troubleshooting tool ([361b262](https://bitbucket.org/atlassianlabs/fe-server/commits/361b262ac77932a0e2c8e18779ee0c4a72dcf7b1))
|
|
125
|
+
- **wrm-troubleshooting:** [SPFE-738](https://ecosystem.atlassian.net/browse/SPFE-738) Migrate the repository into monorepo ([3b4d4a3](https://bitbucket.org/atlassianlabs/fe-server/commits/3b4d4a3ac3a38aeabe02c83fe5c1fdf039fb23fe))
|
|
126
|
+
|
|
127
|
+
### [0.3.3](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/branches/compare/v0.3.3..v0.3.2) (2021-08-16)
|
|
128
|
+
|
|
129
|
+
### Bug Fixes
|
|
130
|
+
|
|
131
|
+
- fix settings package version ([cd9c010](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/cd9c010f594b47b7387fca59ca53f429397051be))
|
|
132
|
+
- remove extra console.log ([89b61c0](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/89b61c011cb251a8c20da8c4786de3e7f5d1c3e2))
|
|
133
|
+
|
|
134
|
+
### [0.3.2](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/branches/compare/v0.3.2..v0.3.1) (2021-08-16)
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
- Improve reading the package version ([a53d0ae](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/a53d0ae785b4b03aea297b890fb93b3d70b4024f))
|
|
139
|
+
|
|
140
|
+
### [0.3.1](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/branches/compare/v0.3.1..v0.3.0) (2021-08-16)
|
|
141
|
+
|
|
142
|
+
### Bug Fixes
|
|
143
|
+
|
|
144
|
+
- **deps:** update dependencies ([39d1e5f](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/39d1e5fbed55958f6030205b208cb3d47c60cf88))
|
|
145
|
+
|
|
146
|
+
## [0.3.0](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/branches/compare/v0.3.0..v0.2.0) (2021-08-16)
|
|
147
|
+
|
|
148
|
+
### Features
|
|
149
|
+
|
|
150
|
+
- [SPFE-629](https://ecosystem.atlassian.net/browse/SPFE-629) Collect analytics ([7ffdaac](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/7ffdaac26bfd7b16c15c79c2cd80000ee690ba27))
|
|
151
|
+
|
|
152
|
+
### Bug Fixes
|
|
153
|
+
|
|
154
|
+
- fix the location in `dist` directory ([8f7df7e](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/8f7df7ea54d95813d8b267105bfc274b03483c38))
|
|
155
|
+
|
|
156
|
+
## [0.2.0](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/branches/compare/v0.2.0..v0.1.1) (2021-08-13)
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Add intro text ([52c6918](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/52c6918be9716ee593afaed8a9da818b39bcc462))
|
|
161
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) add missing links to guides ([11e227c](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/11e227cf6077b6d1f93d2cba49a60f497c51d36d))
|
|
162
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Improve checking config files ([1fcea37](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/1fcea371fc90997a51415aa7f36b4170bf0e259a))
|
|
163
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Prettify and improve the output ([d5818e4](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/d5818e4dc8c60bd97a196b1eacaf7f66c1fa13f4))
|
|
164
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Prettify the output ([f6a73da](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/f6a73da748cb6f8ea5a61e1a6268b6bf75b5a59b))
|
|
165
|
+
|
|
166
|
+
### Bug Fixes
|
|
167
|
+
|
|
168
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Fix closing the process after run ([d14e2f7](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/d14e2f7d38ef5d5796ab3ca5b1439cd28bff43b0))
|
|
169
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) Fix resolving relative paths ([536b50e](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/536b50e45253bc23911f5ffa408b18ff74e6891f))
|
|
170
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) fix typo in question ([eba46b1](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/eba46b13a2982d6e89b392c2692957dcef04e099))
|
|
171
|
+
- [SPFE-516](https://ecosystem.atlassian.net/browse/SPFE-516) update message and fix runing tests ([b0c6684](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/b0c66845882126b41b48105f37cd2171603ed660))
|
|
172
|
+
|
|
173
|
+
### 0.1.1 (2021-07-29)
|
|
174
|
+
|
|
175
|
+
### Features
|
|
176
|
+
|
|
177
|
+
- **release:** [SPFE-614](https://ecosystem.atlassian.net/browse/SPFE-614) Run build before publishing ([51136f0](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/51136f08207835bed7f0b163042539b7a217731d))
|
|
178
|
+
|
|
179
|
+
## 0.1.0 (2021-07-29)
|
|
180
|
+
|
|
181
|
+
### Features
|
|
182
|
+
|
|
183
|
+
- [SPFE-611](https://ecosystem.atlassian.net/browse/SPFE-611) Use mvn command directly without calling Atlassian SDK ([3b33d24](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/3b33d240e16d64bf9c90ef941b069964608edfb7))
|
|
184
|
+
- [SPFE-615](https://ecosystem.atlassian.net/browse/SPFE-615) add timeout to external commands ([fb0c1f5](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/fb0c1f5db5edae71671f17b13b41a722c534979c))
|
|
185
|
+
- **tests:** [SPFE-531](https://ecosystem.atlassian.net/browse/SPFE-531) Add happy-path integration test ([148c5c5](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/148c5c5dd627ff8fcc3f4775ceeae8d2cc41f9af))
|
|
186
|
+
- **tests:** [SPFE-531](https://ecosystem.atlassian.net/browse/SPFE-531) Add Jest ([05e1224](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/05e12247e816f1833af63387bec7896ebd529835))
|
|
187
|
+
- **tests:** [SPFE-531](https://ecosystem.atlassian.net/browse/SPFE-531) Add smoke tests for displaying version ([6686101](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/6686101170f6ade7ca161769eb6d5b3ba84e1ff6))
|
|
188
|
+
|
|
189
|
+
### Bug Fixes
|
|
190
|
+
|
|
191
|
+
- **ts:** [SPFE-616](https://ecosystem.atlassian.net/browse/SPFE-616) fix types for empty step result ([9b49dfa](https://bitbucket.org/atlassian/wrm-troubleshooting-tool/commits/9b49dfab0a9bf71f5309b3be37602c089c462e3b))
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
+
orientation.
|
|
11
|
+
|
|
12
|
+
## Our Standards
|
|
13
|
+
|
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
|
15
|
+
include:
|
|
16
|
+
|
|
17
|
+
- Using welcoming and inclusive language
|
|
18
|
+
- Being respectful of differing viewpoints and experiences
|
|
19
|
+
- Gracefully accepting constructive criticism
|
|
20
|
+
- Focusing on what is best for the community
|
|
21
|
+
- Showing empathy towards other community members
|
|
22
|
+
|
|
23
|
+
Examples of unacceptable behavior by participants include:
|
|
24
|
+
|
|
25
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
+
advances
|
|
27
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
+
- Public or private harassment
|
|
29
|
+
- Publishing others' private information, such as a physical or electronic
|
|
30
|
+
address, without explicit permission
|
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
+
professional setting
|
|
33
|
+
|
|
34
|
+
## Our Responsibilities
|
|
35
|
+
|
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
+
response to any instances of unacceptable behavior.
|
|
39
|
+
|
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
+
threatening, offensive, or harmful.
|
|
45
|
+
|
|
46
|
+
## Scope
|
|
47
|
+
|
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
+
when an individual is representing the project or its community. Examples of
|
|
50
|
+
representing a project or community include using an official project e-mail
|
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
|
53
|
+
further defined and clarified by project maintainers.
|
|
54
|
+
|
|
55
|
+
## Enforcement
|
|
56
|
+
|
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported
|
|
58
|
+
by contacting a project maintainer. Complaints will result in a response and be
|
|
59
|
+
reviewed and investigated in a way that is deemed necessary and appropriate to the
|
|
60
|
+
circumstances. Maintainers are obligated to maintain confidentiality with regard to the
|
|
61
|
+
reporter of an incident.
|
|
62
|
+
|
|
63
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
64
|
+
faith may face temporary or permanent repercussions as determined by other
|
|
65
|
+
members of the project's leadership.
|
|
66
|
+
|
|
67
|
+
## Attribution
|
|
68
|
+
|
|
69
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
70
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
|
71
|
+
|
|
72
|
+
[homepage]: http://contributor-covenant.org
|
|
73
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright @ 2019 Atlassian Pty Ltd
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# WRM Troubleshooting tool
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
A tool that can help you with troubleshooting the configuration of `webpack` and Atlassian P2 project.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
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.
|
|
11
|
+
|
|
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
|
+
|
|
14
|
+
To check if your project was configured correctly open a terminal and navigate to the root directory of your project:
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
cd /my-project/location
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Next, run the `npx` command:
|
|
21
|
+
|
|
22
|
+
```shell
|
|
23
|
+
npx @atlassian/wrm-troubleshooting
|
|
24
|
+
|
|
25
|
+
# or run a standalone command if the package is installed globally
|
|
26
|
+
wrm-troubleshooting
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The tool will ask you a few questions and will guide you in case your project configuration is invalid or broken.
|
|
30
|
+
|
|
31
|
+
You can also read the next paragraph to learn how to install the package globally if you prefer that.
|
|
32
|
+
|
|
33
|
+
### Example and demo
|
|
34
|
+
|
|
35
|
+

|
|
36
|
+
|
|
37
|
+
Watch the demo with [asciinema](https://asciinema.org/a/433644)
|
|
38
|
+
|
|
39
|
+
## Custom Babel environments
|
|
40
|
+
|
|
41
|
+
Some projects are using Babel with `@babel/preset-env` preset and can define a custom environment overrides for webpack:
|
|
42
|
+
|
|
43
|
+
### Example of `.babelrc` or `babel.config.js` files
|
|
44
|
+
|
|
45
|
+
```json5
|
|
46
|
+
{
|
|
47
|
+
env: {
|
|
48
|
+
development: {
|
|
49
|
+
presets: [
|
|
50
|
+
// A list of Babel preset
|
|
51
|
+
],
|
|
52
|
+
plugins: [
|
|
53
|
+
// A list of Babel plugins
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
production: {
|
|
58
|
+
plugins: [
|
|
59
|
+
// A list of Babel plugins
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
In this case you need to guide the WRM troubleshooting tool about what environment should be selected to bundle the webpack code.
|
|
67
|
+
To do that, you can execute the `npx @atlassian/wrm-troubleshooting` command with the `BABEL_ENV` variables like so:
|
|
68
|
+
|
|
69
|
+
```shell
|
|
70
|
+
BABEL_ENV=production npx @atlassian/wrm-troubleshooting
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
You don't need to install this package. You can use it with the `npx` command.
|
|
76
|
+
|
|
77
|
+
In case you still would like to install the package, you can install it globally with NPM:
|
|
78
|
+
|
|
79
|
+
```shell
|
|
80
|
+
npm install --global @atlassian/wrm-troubleshooting
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
or by Yarn
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
yarn global add @atlassian/wrm-troubleshooting
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Minimum requirements
|
|
90
|
+
|
|
91
|
+
This plugin is compatible with:
|
|
92
|
+
|
|
93
|
+
- Node 14+
|
|
94
|
+
- `webpack` v4 and `webpack` v5
|
|
95
|
+
- `atlassian-webresource-webpack-plugin` v4 and `atlassian-webresource-webpack-plugin` v5
|
|
96
|
+
|
|
97
|
+
[webpack-wrm-plugin]: https://www.npmjs.com/package/atlassian-webresource-webpack-plugin 'webpack WRM plugin'
|
|
98
|
+
[webpack]: https://webpack.js.org 'webpack'
|
|
99
|
+
[p2-plugin-docs]: https://developer.atlassian.com/server/framework/atlassian-sdk/plugin-framework 'Plugin Framewor'
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,aAAa,CAAC,CAAC;AAE7C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,CAAC;AAEjG,IAAI,UAAkB,CAAC;AAEhB,KAAK,UAAU,UAAU,CAAC,SAAiB,EAAE,mBAA4B,IAAI;IAClF,kDAAkD;IAClD,IAAI,WAAW,EAAE;QACf,OAAO;KACR;IAED,IAAI,CAAC,UAAU,EAAE;QACf,6HAA6H;QAC7H,8DAA8D;QAC9D,yGAAyG;QACzG,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC;YAC1E,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YAE/C,UAAU,GAAG,OAAiB,CAAC;SAChC;QAAC,OAAO,CAAC,EAAE;YACV,oCAAoC;YACpC,UAAU,GAAG,SAAS,CAAC;SACxB;KACF;IAED,IAAI,eAAe,CAAC;IAEpB,IAAI,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAC9B,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;KACvD;IAED,MAAM,MAAM,CAAC,QAAQ,CAAC;QACpB,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,uBAAuB;QAClC,gBAAgB,EAAE,eAAe;QAEjC,0BAA0B;QAC1B,oDAAoD;QACpD,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE,YAAE,CAAC,QAAQ,EAAE;QACvB,OAAO,EAAE,YAAE,CAAC,IAAI,EAAE;QAClB,UAAU,EAAE,YAAE,CAAC,OAAO,EAAE;KACzB,CAAC,CAAC;AACL,CAAC;AAvCD,gCAuCC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC;SACrB;QAED,eAAe,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;KACvC;IAED,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAnBD,0EAmBC;AAED,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C,KAAK,UAAU,uBAAuB,CAAC,OAAe;IACpD,MAAM,GAAG,GAAG,MAAM,IAAA,4BAAgB,EAAC,OAAO,CAAC,CAAC;IAE5C,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,OAAO,GAAI,GAAG,CAAC,OAAO,CAA0B,CAAC,CAAC,CAAC,CAAC;IAE1D,IAAI,CAAC,CAAC,oBAAoB,IAAI,OAAO,CAAC,EAAE;QACtC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAyB,CAAC;IAE9E,OAAO,eAAe,CAAC,GAAG,CAAwB,CAAC,cAAc,EAAE,EAAE;QACnE,MAAM,WAAW,GAA0B;YACzC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;SAC9B,CAAC;QAEF,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,iCAAiC,CAAC,OAAe,EAAE,MAAc;IACrF,MAAM,cAAc,GAAG,IAAA,kCAA4B,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErE,OAAO,wBAAwB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC;AAJD,8EAIC;AAEM,KAAK,UAAU,0BAA0B,CAAC,OAAe,EAAE,MAAc;IAC9E,MAAM,iBAAiB,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"}
|