@eui/tools 6.5.0 → 6.5.2

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.
@@ -1 +1 @@
1
- 6.5.0
1
+ 6.5.2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.5.2 (2023-03-02)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * enhanced csdr-app for custom installation of MWP - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([f457624e](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f457624e91b20020bc47704e5a5fd27589026f35))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.5.1 (2023-03-01)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * force resolution of open for nodejs10 v7 mwp build issue - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([036f40ca](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/036f40ca66cb8a67607e1adcc1bcb72f925ec013))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.5.0 (2023-02-24)
2
20
 
3
21
  ##### New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.5.0",
3
+ "version": "6.5.2",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -156,7 +156,8 @@
156
156
  <button
157
157
  class="btn btn-primary"
158
158
  type="button"
159
- :disabled="selectedRemotes.length === 0">
159
+ :disabled="selectedRemotes.length === 0"
160
+ @click="saveConfig()">
160
161
  Save configuration
161
162
  </button>
162
163
 
@@ -202,6 +203,7 @@
202
203
  },
203
204
  created() {
204
205
  this.getRemotes();
206
+ this.getConfig();
205
207
  },
206
208
  methods: {
207
209
  async getRemotes() {
@@ -212,6 +214,18 @@
212
214
  this.remotes = finalRes;
213
215
  this.getRemotesToInstall();
214
216
  },
217
+ async getConfig() {
218
+ const res = await fetch(
219
+ "http://localhost:3000/api/config"
220
+ );
221
+ const finalRes = await res.json();
222
+ if (finalRes.selectedRemotes) {
223
+ this.selectedRemotes = finalRes.selectedRemotes;
224
+ this.deps = finalRes.deps;
225
+ this.packages = finalRes.packages;
226
+ this.remotesToInstall = finalRes.remotesToInstall;
227
+ }
228
+ },
215
229
  async getPackages() {
216
230
  const res = await fetch(
217
231
  "http://localhost:3000/api/remotes/packages",
@@ -237,6 +251,19 @@
237
251
  return !this.selectedRemotes.includes(r);
238
252
  });
239
253
  },
254
+ async saveConfig() {
255
+ console.log('Saving configuration...');
256
+ const res = await fetch(
257
+ "http://localhost:3000/api/config",
258
+ getRequestBody({
259
+ selectedRemotes: this.selectedRemotes,
260
+ deps: this.deps,
261
+ packages: this.packages,
262
+ remotesToInstall: this.remotesToInstall
263
+ })
264
+ );
265
+ const finalRes = await res.json();
266
+ },
240
267
  },
241
268
  });
242
269
  </script>
@@ -60,6 +60,31 @@ router.post('/remotes/stats', function (req, res) {
60
60
  });
61
61
 
62
62
 
63
+ router.get('/config', function (req, res) {
64
+ return Promise.resolve()
65
+ .then(() => {
66
+ return configUtils.global.getCustomConfig();
67
+ })
68
+ .then((customConfig) => {
69
+ res.send(customConfig);
70
+ })
71
+ .catch((e) => {
72
+ console.log(e);
73
+ })
74
+ });
75
+
76
+
77
+
78
+ router.post('/config', function (req, res) {
79
+ return Promise.resolve()
80
+ .then(() => {
81
+ return configUtils.global.generateCustomConfig(req.body);
82
+ })
83
+ .catch((e) => {
84
+ console.log(e);
85
+ })
86
+ });
87
+
63
88
 
64
89
  // Export API routes
65
90
  module.exports = router;
@@ -405,3 +405,17 @@ module.exports.getLocalEuiVersion = () => {
405
405
  return null;
406
406
  }
407
407
  }
408
+
409
+
410
+ module.exports.generateCustomConfig = (customConfig) => {
411
+ const configFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-custom.json');
412
+
413
+ return tools.writeJsonFileSync(configFile, customConfig);
414
+ }
415
+
416
+
417
+ module.exports.getCustomConfig = () => {
418
+ const configFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-custom.json');
419
+
420
+ return tools.getJsonFileContent(configFile) || null;
421
+ }
@@ -12,5 +12,6 @@
12
12
  "node-fetch": "2.6.7",
13
13
  "mocha": "8.4.0",
14
14
  "sass": "1.39.0",
15
- "caniuse-lite" : "1.0.30001450"
15
+ "caniuse-lite" : "1.0.30001450",
16
+ "open": "7.4.2"
16
17
  }