@eui/tools 6.4.4 → 6.5.1
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/.version.properties +1 -1
- package/CHANGELOG.md +18 -0
- package/bin/eui-scripts.js +2 -0
- package/bin/scripts/csdr-app.js +12 -0
- package/bin/scripts/csdr-sync.js +1 -1
- package/package.json +6 -2
- package/sandbox.js +12 -7
- package/scripts/app/public/index.html +243 -0
- package/scripts/app/public/stats.html +157 -0
- package/scripts/app/routes/index.js +65 -0
- package/scripts/app/server.js +35 -0
- package/scripts/csdr/config/packages.js +4 -4
- package/scripts/csdr/config/remotes.js +30 -3
- package/scripts/csdr/init/packages.js +28 -0
- package/scripts/csdr/init/resources/nodejs-10.x/resolutions.json +2 -1
- package/scripts/csdr/metadata/stats.js +23 -0
- package/scripts/csdr/sync/sync-utils.js +3 -0
- package/scripts.json +5 -0
package/.version.properties
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.5.1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 6.5.1 (2023-03-01)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
* **other:**
|
|
6
|
+
* 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))
|
|
7
|
+
|
|
8
|
+
* * *
|
|
9
|
+
* * *
|
|
10
|
+
## 6.5.0 (2023-02-24)
|
|
11
|
+
|
|
12
|
+
##### New Features
|
|
13
|
+
|
|
14
|
+
* **other:**
|
|
15
|
+
* csdr apps first iteration - MWP-9204 [MWP-9204](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9204) ([4d9a9fd4](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/4d9a9fd40f135c2a462eb98b32c83aa7972b01da))
|
|
16
|
+
|
|
17
|
+
* * *
|
|
18
|
+
* * *
|
|
1
19
|
## 6.4.4 (2023-02-23)
|
|
2
20
|
|
|
3
21
|
##### Chores
|
package/bin/eui-scripts.js
CHANGED
|
@@ -29,6 +29,7 @@ const scriptIndex = args.findIndex(
|
|
|
29
29
|
x === 'publish-all' ||
|
|
30
30
|
x === 'generate-translations' ||
|
|
31
31
|
x === 'test-package' ||
|
|
32
|
+
x === 'csdr-app' ||
|
|
32
33
|
x === 'csdr-init' ||
|
|
33
34
|
x === 'csdr-upgrade-deps' ||
|
|
34
35
|
x === 'csdr-serve-app' ||
|
|
@@ -72,6 +73,7 @@ switch (script) {
|
|
|
72
73
|
case 'publish-all':
|
|
73
74
|
case 'test-package':
|
|
74
75
|
case 'generate-translations':
|
|
76
|
+
case 'csdr-app':
|
|
75
77
|
case 'csdr-init':
|
|
76
78
|
case 'csdr-upgrade-deps':
|
|
77
79
|
case 'csdr-serve-app':
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const tools = require('../../scripts/utils/tools');
|
|
4
|
+
|
|
5
|
+
Promise.resolve()
|
|
6
|
+
.then(() => {
|
|
7
|
+
return tools.runScript('node ./packages/eui-tools/scripts/app/server.js --prod');
|
|
8
|
+
})
|
|
9
|
+
.catch((e) => {
|
|
10
|
+
console.log(e);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
})
|
package/bin/scripts/csdr-sync.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eui/tools",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.1",
|
|
4
4
|
"tag": "latest",
|
|
5
5
|
"license": "EUPL-1.1",
|
|
6
6
|
"description": "eUI common tools and scripts",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"imagemin": "7.0.1",
|
|
47
47
|
"imagemin-svgo": "9.0.0",
|
|
48
48
|
"concat": "1.0.3",
|
|
49
|
-
"file-saver": "2.0.5"
|
|
49
|
+
"file-saver": "^2.0.5",
|
|
50
|
+
"morgan": "^1.10.0",
|
|
51
|
+
"open": "^8.4.0",
|
|
52
|
+
"body-parser": "^1.20.1",
|
|
53
|
+
"express": "^4.18.2"
|
|
50
54
|
}
|
|
51
55
|
}
|
package/sandbox.js
CHANGED
|
@@ -1201,13 +1201,18 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
|
|
|
1201
1201
|
// console.log(minSec);
|
|
1202
1202
|
// })
|
|
1203
1203
|
|
|
1204
|
-
Promise.resolve()
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1204
|
+
// Promise.resolve()
|
|
1205
|
+
// .then(() => {
|
|
1206
|
+
// const options = configUtils.global.getConfigOptions();
|
|
1207
|
+
// console.log(options);
|
|
1208
1208
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1209
|
+
// const pkg = configUtils.packages.getPackage('mapar-administration-ui');
|
|
1210
|
+
// const config = notificationUtils.config.getPackageConfig(pkg);
|
|
1211
1211
|
|
|
1212
|
-
|
|
1212
|
+
// console.log(config);
|
|
1213
|
+
// })
|
|
1214
|
+
|
|
1215
|
+
Promise.resolve()
|
|
1216
|
+
.then(() => {
|
|
1217
|
+
return initUtils.packages.importScripts();
|
|
1213
1218
|
})
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<script src="https://unpkg.com/vue@2"></script>
|
|
7
|
+
<link
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" />
|
|
10
|
+
<style>
|
|
11
|
+
.full-height-flex {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
height: 100vh;
|
|
15
|
+
}
|
|
16
|
+
.header-flex {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
.body-flex {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
26
|
+
</head>
|
|
27
|
+
|
|
28
|
+
<body>
|
|
29
|
+
<div id="app" class="container-fluid">
|
|
30
|
+
<div class="row">
|
|
31
|
+
<div class="col-4 full-height-flex">
|
|
32
|
+
<h3 class="mt-2 mb-4">
|
|
33
|
+
CSDR custom installation (experimental)
|
|
34
|
+
</h3>
|
|
35
|
+
|
|
36
|
+
<div class="header-flex">
|
|
37
|
+
<h5 class="mb-3">Choose an app / euiVersion</h5>
|
|
38
|
+
<form>
|
|
39
|
+
<div class="row mb-3">
|
|
40
|
+
<label class="col-sm-2 col-form-label"
|
|
41
|
+
>App</label
|
|
42
|
+
>
|
|
43
|
+
<div class="col-sm-10">
|
|
44
|
+
<select disabled class="form-select">
|
|
45
|
+
<option>Open this select menu</option>
|
|
46
|
+
<option selected value="my-workplace">
|
|
47
|
+
MyWorkplace
|
|
48
|
+
</option>
|
|
49
|
+
<!-- <option value="sedia">Sedia</option> -->
|
|
50
|
+
</select>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="row mb-3">
|
|
54
|
+
<label class="col-sm-2 col-form-label"
|
|
55
|
+
>eUI Version</label
|
|
56
|
+
>
|
|
57
|
+
<div class="col-sm-10">
|
|
58
|
+
<select disabled class="form-select">
|
|
59
|
+
<option>Open this select menu</option>
|
|
60
|
+
<option selected value="15.x">
|
|
61
|
+
eUI 15
|
|
62
|
+
</option>
|
|
63
|
+
<!-- <option value="10.x">eUI 10</option> -->
|
|
64
|
+
</select>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</form>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="body-flex">
|
|
70
|
+
<h5 class="mt-2 mb-3">
|
|
71
|
+
Select the remote(s) you want to work with:
|
|
72
|
+
</h5>
|
|
73
|
+
<p class="text-warning fw-bold">
|
|
74
|
+
select at least one remote to work on
|
|
75
|
+
</p>
|
|
76
|
+
<table
|
|
77
|
+
class="table table-striped"
|
|
78
|
+
v-show="remotes.length !== 0">
|
|
79
|
+
<thead>
|
|
80
|
+
<tr>
|
|
81
|
+
<th scope="col"> </th>
|
|
82
|
+
<th scope="col">Remote</th>
|
|
83
|
+
<th scope="col">Participant ?</th>
|
|
84
|
+
<th scope="col">Full skel.?</th>
|
|
85
|
+
</tr>
|
|
86
|
+
</thead>
|
|
87
|
+
<tbody>
|
|
88
|
+
<tr v-for="remote in remotes">
|
|
89
|
+
<td>
|
|
90
|
+
<div
|
|
91
|
+
class="form-check"
|
|
92
|
+
:key="remote.name">
|
|
93
|
+
<input
|
|
94
|
+
class="form-check-input"
|
|
95
|
+
type="checkbox"
|
|
96
|
+
:value="remote.name"
|
|
97
|
+
:id="remote.name"
|
|
98
|
+
v-model="selectedRemotes"
|
|
99
|
+
@change="remoteSelected($event)" />
|
|
100
|
+
</div>
|
|
101
|
+
</td>
|
|
102
|
+
<td>{{ remote.name }}</td>
|
|
103
|
+
<td>
|
|
104
|
+
<div
|
|
105
|
+
:class="{ 'text-primary fw-bold': remote.participant }">
|
|
106
|
+
{{ remote.participant }}
|
|
107
|
+
</div>
|
|
108
|
+
</td>
|
|
109
|
+
<td>
|
|
110
|
+
<div
|
|
111
|
+
:class="{ 'text-success fw-bold': remote.fullSkeletonSources }">
|
|
112
|
+
{{ remote.fullSkeletonSources }}
|
|
113
|
+
</div>
|
|
114
|
+
</td>
|
|
115
|
+
</tr>
|
|
116
|
+
</tbody>
|
|
117
|
+
</table>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div class="col-8">
|
|
122
|
+
<h5 class="mt-5 mb-3">
|
|
123
|
+
Selected remotes :
|
|
124
|
+
<span class="text-primary fw-bold">{{
|
|
125
|
+
selectedRemotes.length
|
|
126
|
+
}}</span>
|
|
127
|
+
</h5>
|
|
128
|
+
{{ selectedRemotes }}
|
|
129
|
+
|
|
130
|
+
<h5 class="mt-5 mb-3">
|
|
131
|
+
Derived dependencies:
|
|
132
|
+
<span class="text-primary fw-bold">{{
|
|
133
|
+
deps.length
|
|
134
|
+
}}</span>
|
|
135
|
+
</h5>
|
|
136
|
+
{{ deps }}
|
|
137
|
+
|
|
138
|
+
<h5 class="mt-5 mb-3">
|
|
139
|
+
Derived UI packages to be locally cloned :
|
|
140
|
+
<span class="text-primary fw-bold">{{
|
|
141
|
+
packages.length
|
|
142
|
+
}}</span>
|
|
143
|
+
</h5>
|
|
144
|
+
{{ packages }}
|
|
145
|
+
|
|
146
|
+
<h5 class="mt-5 mb-3">
|
|
147
|
+
Remotes to install as dependencies :
|
|
148
|
+
<span class="text-primary fw-bold">{{
|
|
149
|
+
remotesToInstall.length
|
|
150
|
+
}}</span>
|
|
151
|
+
</h5>
|
|
152
|
+
{{ remotesToInstall }}
|
|
153
|
+
|
|
154
|
+
<hr />
|
|
155
|
+
|
|
156
|
+
<button
|
|
157
|
+
class="btn btn-primary"
|
|
158
|
+
type="button"
|
|
159
|
+
:disabled="selectedRemotes.length === 0">
|
|
160
|
+
Save configuration
|
|
161
|
+
</button>
|
|
162
|
+
|
|
163
|
+
<div class="alert alert-info mt-2">
|
|
164
|
+
<p>
|
|
165
|
+
Saving the configuration will generate a file called
|
|
166
|
+
<span class="fw-bold"
|
|
167
|
+
>./csdr/.euirc-csdr-custom.json</span
|
|
168
|
+
>
|
|
169
|
+
</p>
|
|
170
|
+
<p>
|
|
171
|
+
Execute after the
|
|
172
|
+
<strong>npm run init -- --custom</strong> from your
|
|
173
|
+
command line to follow progress of installation
|
|
174
|
+
</p>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</body>
|
|
180
|
+
|
|
181
|
+
<script>
|
|
182
|
+
const getRequestBody = (items) => {
|
|
183
|
+
return {
|
|
184
|
+
method: "POST",
|
|
185
|
+
headers: {
|
|
186
|
+
"Content-Type": "application/json",
|
|
187
|
+
},
|
|
188
|
+
body: JSON.stringify(items),
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
new Vue({
|
|
193
|
+
el: "#app",
|
|
194
|
+
data() {
|
|
195
|
+
return {
|
|
196
|
+
remotes: [],
|
|
197
|
+
selectedRemotes: [],
|
|
198
|
+
deps: [],
|
|
199
|
+
packages: [],
|
|
200
|
+
remotesToInstall: [],
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
created() {
|
|
204
|
+
this.getRemotes();
|
|
205
|
+
},
|
|
206
|
+
methods: {
|
|
207
|
+
async getRemotes() {
|
|
208
|
+
const res = await fetch(
|
|
209
|
+
"http://localhost:3000/api/remotes"
|
|
210
|
+
);
|
|
211
|
+
const finalRes = await res.json();
|
|
212
|
+
this.remotes = finalRes;
|
|
213
|
+
this.getRemotesToInstall();
|
|
214
|
+
},
|
|
215
|
+
async getPackages() {
|
|
216
|
+
const res = await fetch(
|
|
217
|
+
"http://localhost:3000/api/remotes/packages",
|
|
218
|
+
getRequestBody(this.selectedRemotes)
|
|
219
|
+
);
|
|
220
|
+
const finalRes = await res.json();
|
|
221
|
+
this.packages = finalRes.packages.filter(
|
|
222
|
+
(p) =>
|
|
223
|
+
p.indexOf("csdr-") < 0 &&
|
|
224
|
+
p.indexOf("cc-shared-ui") < 0 &&
|
|
225
|
+
p.indexOf("mywp-shared-ui") < 0
|
|
226
|
+
);
|
|
227
|
+
this.deps = finalRes.deps;
|
|
228
|
+
this.getRemotesToInstall();
|
|
229
|
+
},
|
|
230
|
+
remoteSelected(event) {
|
|
231
|
+
this.getPackages();
|
|
232
|
+
},
|
|
233
|
+
getRemotesToInstall() {
|
|
234
|
+
this.remotesToInstall = this.remotes
|
|
235
|
+
.map((r) => r.name)
|
|
236
|
+
.filter((r) => {
|
|
237
|
+
return !this.selectedRemotes.includes(r);
|
|
238
|
+
});
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
</script>
|
|
243
|
+
</html>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<script src="https://unpkg.com/vue@2"></script>
|
|
7
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
|
|
8
|
+
<link
|
|
9
|
+
rel="stylesheet"
|
|
10
|
+
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" />
|
|
11
|
+
<style>
|
|
12
|
+
.full-height-flex {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
}
|
|
17
|
+
.body-flex {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<div id="app" class="container-fluid">
|
|
27
|
+
<div class="row">
|
|
28
|
+
<div class="col-4 full-height-flex">
|
|
29
|
+
<h3 class="mt-2 mb-4">CSDR remotes stats</h3>
|
|
30
|
+
<div class="body-flex">
|
|
31
|
+
<h5 class="mt-2 mb-3">Select a remote:</h5>
|
|
32
|
+
<table
|
|
33
|
+
class="table table-striped"
|
|
34
|
+
v-show="remotes.length !== 0">
|
|
35
|
+
<thead>
|
|
36
|
+
<tr>
|
|
37
|
+
<th scope="col"> </th>
|
|
38
|
+
<th scope="col">Remote</th>
|
|
39
|
+
<th scope="col">Participant ?</th>
|
|
40
|
+
<th scope="col">Full skel.?</th>
|
|
41
|
+
</tr>
|
|
42
|
+
</thead>
|
|
43
|
+
<tbody>
|
|
44
|
+
<tr v-for="remote in remotes">
|
|
45
|
+
<td>
|
|
46
|
+
<div
|
|
47
|
+
class="form-radio"
|
|
48
|
+
:key="remote.name">
|
|
49
|
+
<input
|
|
50
|
+
class="form-radio-input"
|
|
51
|
+
type="radio"
|
|
52
|
+
:value="remote.name"
|
|
53
|
+
:id="remote.name"
|
|
54
|
+
v-model="selectedRemotes"
|
|
55
|
+
@change="remoteSelected($event)" />
|
|
56
|
+
</div>
|
|
57
|
+
</td>
|
|
58
|
+
<td>{{ remote.name }}</td>
|
|
59
|
+
<td>
|
|
60
|
+
<div
|
|
61
|
+
:class="{ 'text-primary fw-bold': remote.participant }">
|
|
62
|
+
{{ remote.participant }}
|
|
63
|
+
</div>
|
|
64
|
+
</td>
|
|
65
|
+
<td>
|
|
66
|
+
<div
|
|
67
|
+
:class="{ 'text-success fw-bold': remote.fullSkeletonSources }">
|
|
68
|
+
{{ remote.fullSkeletonSources }}
|
|
69
|
+
</div>
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
</tbody>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="col-8">
|
|
78
|
+
<h5 class="mt-5 mb-3">
|
|
79
|
+
Selected remote : {{ selectedRemotes }}
|
|
80
|
+
</h5>
|
|
81
|
+
<div class="d-none">{{ remoteStats.versions }}</div>
|
|
82
|
+
<div style="height: 250px">
|
|
83
|
+
<canvas id="versions"></canvas>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</body>
|
|
89
|
+
|
|
90
|
+
<script>
|
|
91
|
+
const getRequestBody = (items) => {
|
|
92
|
+
return {
|
|
93
|
+
method: "POST",
|
|
94
|
+
headers: {
|
|
95
|
+
"Content-Type": "application/json",
|
|
96
|
+
},
|
|
97
|
+
body: JSON.stringify(items),
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
new Vue({
|
|
102
|
+
el: "#app",
|
|
103
|
+
data() {
|
|
104
|
+
return {
|
|
105
|
+
remotes: [],
|
|
106
|
+
selectedRemotes: [],
|
|
107
|
+
remoteStats: {},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
created() {
|
|
111
|
+
this.getRemotes();
|
|
112
|
+
},
|
|
113
|
+
methods: {
|
|
114
|
+
async getRemotes() {
|
|
115
|
+
const res = await fetch(
|
|
116
|
+
"http://localhost:3000/api/remotes"
|
|
117
|
+
);
|
|
118
|
+
const finalRes = await res.json();
|
|
119
|
+
this.remotes = finalRes;
|
|
120
|
+
},
|
|
121
|
+
remoteSelected(event) {
|
|
122
|
+
console.log(this.selectedRemotes);
|
|
123
|
+
this.getRemoteStats();
|
|
124
|
+
},
|
|
125
|
+
async getRemoteStats() {
|
|
126
|
+
const res = await fetch(
|
|
127
|
+
"http://localhost:3000/api/remotes/stats",
|
|
128
|
+
getRequestBody({ remote: this.selectedRemotes })
|
|
129
|
+
);
|
|
130
|
+
const finalRes = await res.json();
|
|
131
|
+
this.remoteStats = finalRes;
|
|
132
|
+
this.genVersionsChart();
|
|
133
|
+
},
|
|
134
|
+
genVersionsChart() {
|
|
135
|
+
const ctx = document
|
|
136
|
+
.getElementById("versions")
|
|
137
|
+
.getContext("2d");
|
|
138
|
+
var myChart = new Chart(ctx, {
|
|
139
|
+
type: "line",
|
|
140
|
+
data: {
|
|
141
|
+
labels: this.remoteStats.versions.map(v => `${v.version} - ${v.date}`),
|
|
142
|
+
datasets: [
|
|
143
|
+
{
|
|
144
|
+
data: this.remoteStats.versions.map(v => v.duration),
|
|
145
|
+
label: "Duration",
|
|
146
|
+
borderColor: "#3e95cd",
|
|
147
|
+
backgroundColor: "#7bb6dd",
|
|
148
|
+
fill: false,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
</script>
|
|
157
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const router = require('express').Router();
|
|
4
|
+
|
|
5
|
+
const configUtils = require('../../csdr/config/config-utils');
|
|
6
|
+
const metadataUtils = require('../../csdr/metadata/metadata-utils');
|
|
7
|
+
const tools = require('../../utils/tools');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
router.get('/remotes', function (req, res) {
|
|
11
|
+
return Promise.resolve()
|
|
12
|
+
.then(() => {
|
|
13
|
+
return configUtils.remotes.getCsdrRemotesArray('my-workplace', '15.x');
|
|
14
|
+
})
|
|
15
|
+
.then((fetchedRemotes) => {
|
|
16
|
+
let remotes = tools.sortArray(fetchedRemotes, 'name');
|
|
17
|
+
remotes = remotes.map((r) => {
|
|
18
|
+
let participant = false;
|
|
19
|
+
if (r.fullSkeletonSources) {
|
|
20
|
+
if (r.skeletonConfig.options && r.skeletonConfig.options.participant) {
|
|
21
|
+
participant = true;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...r,
|
|
26
|
+
participant,
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
res.send(remotes);
|
|
30
|
+
})
|
|
31
|
+
.catch((e) => {
|
|
32
|
+
console.log(e);
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
router.post('/remotes/packages', function (req, res) {
|
|
37
|
+
return Promise.resolve()
|
|
38
|
+
.then(() => {
|
|
39
|
+
const remotes = req.body;
|
|
40
|
+
const depsPackages = configUtils.remotes.getRemotesPackages(remotes);
|
|
41
|
+
res.send(depsPackages);
|
|
42
|
+
})
|
|
43
|
+
.catch((e) => {
|
|
44
|
+
console.log(e);
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
router.post('/remotes/stats', function (req, res) {
|
|
50
|
+
return Promise.resolve()
|
|
51
|
+
.then(() => {
|
|
52
|
+
return metadataUtils.stats.getRemoteStats(req.body.remote);
|
|
53
|
+
})
|
|
54
|
+
.then((remoteStats) => {
|
|
55
|
+
res.send(remoteStats);
|
|
56
|
+
})
|
|
57
|
+
.catch((e) => {
|
|
58
|
+
console.log(e);
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
// Export API routes
|
|
65
|
+
module.exports = router;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// GLOBAL
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const bodyParser = require('body-parser');
|
|
4
|
+
const cors = require('cors');
|
|
5
|
+
const logger = require('morgan');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const open = require('open');
|
|
8
|
+
|
|
9
|
+
// LOCAL
|
|
10
|
+
const tools = require('../utils/tools');
|
|
11
|
+
|
|
12
|
+
// SERVER
|
|
13
|
+
const app = express();
|
|
14
|
+
app.set('port', (process.env.PORT || 3000));
|
|
15
|
+
app.use(cors());
|
|
16
|
+
app.use(bodyParser.urlencoded({ extended: true }));
|
|
17
|
+
app.use(bodyParser.json());
|
|
18
|
+
app.use(logger('dev'));
|
|
19
|
+
app.use(express.static(path.join(__dirname, 'public')));
|
|
20
|
+
|
|
21
|
+
// ROUTES DEFS
|
|
22
|
+
app.use('/api', require('./routes'));
|
|
23
|
+
|
|
24
|
+
// STARTING - opening html page if prod flag is passed
|
|
25
|
+
app.listen(app.get('port'), () => {
|
|
26
|
+
const { prod, stats } = tools.getArgs();
|
|
27
|
+
if (prod) {
|
|
28
|
+
if (stats) {
|
|
29
|
+
open('http://localhost:3000/stats.html');
|
|
30
|
+
} else {
|
|
31
|
+
open('http://localhost:3000');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
console.log('We are live on ' + app.get('port'));
|
|
35
|
+
});
|
|
@@ -23,8 +23,8 @@ module.exports.getCsdrPackagesFull = (flattenChildren = true) => {
|
|
|
23
23
|
try {
|
|
24
24
|
outputPackages.push(this.getPackage(p, true));
|
|
25
25
|
} catch (e) {
|
|
26
|
-
tools.logInfo(`Package: ${p} is in local config but not found in global... should be cleaned up`);
|
|
27
|
-
console.log(e);
|
|
26
|
+
// tools.logInfo(`Package: ${p} is in local config but not found in global... should be cleaned up`);
|
|
27
|
+
// console.log(e);
|
|
28
28
|
}
|
|
29
29
|
})
|
|
30
30
|
return outputPackages;
|
|
@@ -39,8 +39,8 @@ const getPackages = module.exports.getPackages = () => {
|
|
|
39
39
|
try {
|
|
40
40
|
outputPackages.push(this.getPackage(p));
|
|
41
41
|
} catch (e) {
|
|
42
|
-
tools.logInfo(`Package: ${p} is in local config but not found in global... should be cleaned up`);
|
|
43
|
-
console.log(e);
|
|
42
|
+
// tools.logInfo(`Package: ${p} is in local config but not found in global... should be cleaned up`);
|
|
43
|
+
// console.log(e);
|
|
44
44
|
}
|
|
45
45
|
})
|
|
46
46
|
return outputPackages;
|
|
@@ -8,12 +8,11 @@ const tools = require('../../utils/tools');
|
|
|
8
8
|
|
|
9
9
|
// INNER
|
|
10
10
|
const innerGlobal = require('./global');
|
|
11
|
-
|
|
11
|
+
const innerPackages = require('./packages');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
module.exports.getRemote = (remoteName) => {
|
|
16
|
-
|
|
17
16
|
// if not provided as param, we fetch them from the command line (local operations)
|
|
18
17
|
if (!remoteName) {
|
|
19
18
|
remoteName = tools.getArgs().root;
|
|
@@ -64,7 +63,7 @@ module.exports.getCsdrRemotes = (hostName, euiVersion) => {
|
|
|
64
63
|
const hostNameFilterFn = (r) => {
|
|
65
64
|
if (r.build) {
|
|
66
65
|
if (!r.build.appTarget || r.build.appTarget === 'MWP_ONLY') {
|
|
67
|
-
if (hostName === 'my-workplace') {
|
|
66
|
+
if (hostName === 'my-workplace' || hostName) {
|
|
68
67
|
return true;
|
|
69
68
|
}
|
|
70
69
|
} else if (r.build.appTarget === 'SEDIA_ONLY') {
|
|
@@ -150,3 +149,31 @@ module.exports.getRemoteByNpmPkg = (npmPkg, fromCsdrConfig) => {
|
|
|
150
149
|
module.exports.isLocalRemote = (npmPkg) => {
|
|
151
150
|
return this.getRemoteByNpmPkg(npmPkg) !== undefined;
|
|
152
151
|
}
|
|
152
|
+
|
|
153
|
+
module.exports.getRemotesPackages = (remotes) => {
|
|
154
|
+
let packages = [], deps = [];
|
|
155
|
+
|
|
156
|
+
remotes.forEach((r) => {
|
|
157
|
+
const remote = this.getRemote(r);
|
|
158
|
+
const npmPkgs = Object.keys(remote.dependencies.composite);
|
|
159
|
+
|
|
160
|
+
deps = [...deps, ...npmPkgs];
|
|
161
|
+
|
|
162
|
+
npmPkgs.forEach((npmPkg) => {
|
|
163
|
+
const pkg = innerPackages.getPackageByNpmPkg(npmPkg, true);
|
|
164
|
+
if (pkg) {
|
|
165
|
+
packages.push(pkg.name);
|
|
166
|
+
}
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
packages = packages.filter((pkg) => {
|
|
171
|
+
return pkg.indexOf('eui') < 0;
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
deps: tools.removeArrayDuplicates(deps),
|
|
176
|
+
packages: tools.removeArrayDuplicates(packages)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
@@ -125,3 +125,31 @@ module.exports.installHostPackage = (projectName) => {
|
|
|
125
125
|
throw e;
|
|
126
126
|
})
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
module.exports.importScripts = () => {
|
|
131
|
+
return Promise.resolve()
|
|
132
|
+
.then(() => {
|
|
133
|
+
tools.logTitle("Init scripts for local packages");
|
|
134
|
+
const packages = configUtils.packages.getPackages();
|
|
135
|
+
|
|
136
|
+
const rootPackageJsonFile = path.join(process.cwd(), 'package.json')
|
|
137
|
+
const rootPackageJson = require(rootPackageJsonFile);
|
|
138
|
+
|
|
139
|
+
packages.forEach((p) => {
|
|
140
|
+
const scriptsFile = path.join(p.paths.root, 'scripts.json');
|
|
141
|
+
if (tools.isFileExists(scriptsFile)) {
|
|
142
|
+
tools.logInfo(`Processing scripts.json file for package: ${p.name}`);
|
|
143
|
+
|
|
144
|
+
const scriptsJson = require(scriptsFile);
|
|
145
|
+
rootPackageJson.scripts = { ...rootPackageJson.scripts, ...scriptsJson };
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
tools.logInfo('Updating root package.json');
|
|
150
|
+
tools.writeJsonFileSync(rootPackageJsonFile, rootPackageJson);
|
|
151
|
+
})
|
|
152
|
+
.catch((e) => {
|
|
153
|
+
throw e;
|
|
154
|
+
})
|
|
155
|
+
}
|
|
@@ -453,3 +453,26 @@ module.exports.getCommitsByUsers = (packages, range = 'ALL') => {
|
|
|
453
453
|
return tools.sortArray(usersArray, 'commits', 'desc');
|
|
454
454
|
})
|
|
455
455
|
}
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
module.exports.getRemoteStats = (remoteName) => {
|
|
459
|
+
const remote = configUtils.remotes.getRemote(remoteName);
|
|
460
|
+
|
|
461
|
+
let versions;
|
|
462
|
+
|
|
463
|
+
return Promise.resolve()
|
|
464
|
+
.then(() => {
|
|
465
|
+
return metadataUtils.packageVersions.getMetadata(remote);
|
|
466
|
+
})
|
|
467
|
+
.then((metadata) => {
|
|
468
|
+
versions = metadata.versions;
|
|
469
|
+
})
|
|
470
|
+
.then(() => {
|
|
471
|
+
return {
|
|
472
|
+
versions
|
|
473
|
+
}
|
|
474
|
+
})
|
|
475
|
+
.catch((e) => {
|
|
476
|
+
throw e;
|
|
477
|
+
})
|
|
478
|
+
}
|
package/scripts.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"csdr:app-dev": "nodemon --ext js --watch ./packages/eui-tools/scripts ./packages/eui-tools/scripts/app/server.js",
|
|
3
|
+
"csdr:app": "node ./packages/eui-tools/scripts/app/server.js --prod",
|
|
4
|
+
"csdr:app-stats": "node ./packages/eui-tools/scripts/app/server.js --prod --stats"
|
|
5
|
+
}
|