@eui/tools 6.2.33 → 6.2.35
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 +19 -0
- package/package.json +1 -1
- package/scripts/csdr/cli/constants.js +43 -0
- package/scripts/csdr/cli/package-build-backend.js +70 -0
- package/scripts/csdr/cli/package-build-frontend.js +300 -0
- package/scripts/csdr/cli/package-prompt.js +123 -0
- package/scripts/csdr/cli/package.js +21 -438
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui15/src/app/eui-components.ts +3 -3
- package/scripts/csdr/cli/skeletons/virtual-remote/15.x/angular-config.json +8 -0
- package/scripts/csdr/cli/skeletons/virtual-remote/15.x/dependencies.json +20 -0
- package/scripts/csdr/config/config-utils.js +1 -0
- package/scripts/csdr/config/global.js +0 -170
- package/scripts/csdr/config/packages.js +3 -3
- package/scripts/csdr/config/register.js +166 -0
- package/scripts/csdr/init/remotes.js +4 -2
- package/scripts/index.js +5 -0
- package/scripts/utils/build/package/element.js +7 -4
- package/scripts/utils/pre-build/injection/routes-replacement.js +22 -2
- package/scripts/csdr/cli/skeletons/package/frontend/assets/i18n/en.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend/assets/i18n/fr.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend/gitignore_TO_REPLACE +0 -46
- package/scripts/csdr/cli/skeletons/package/frontend/karma.conf.js +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/ng-package.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/package.json +0 -4
- package/scripts/csdr/cli/skeletons/package/frontend/src/index.ts +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.html +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.spec.ts.TO_REPLACE +0 -25
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/components/cmp1/cmp1.component.ts +0 -14
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/core/module.service.spec.ts.TO_REPLACE +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/core/module.service.ts +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend/src/lib/module.module.ts +0 -14
- package/scripts/csdr/cli/skeletons/package/frontend/src/test.ts.TO_REPLACE +0 -22
- package/scripts/csdr/cli/skeletons/package/frontend/tsconfig.lib.json +0 -32
- package/scripts/csdr/cli/skeletons/package/frontend/tsconfig.spec.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend/tslint.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend-eui14/dependencies-composite.json +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/angular.json +0 -76
- package/scripts/csdr/cli/skeletons/package/frontend-remote/browserslist +0 -10
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-base.json +0 -2
- package/scripts/csdr/cli/skeletons/package/frontend-remote/dependencies-composite.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/gitignore_TO_REPLACE +0 -64
- package/scripts/csdr/cli/skeletons/package/frontend-remote/karma.conf.js +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/package.json_TO_REPLACE +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.scss +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/dummy.spec.ts +0 -6
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.component.ts +0 -84
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +0 -167
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/reducers/custom-route-serializer.ts +0 -28
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/reducers/index.ts +0 -42
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +0 -54
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/.gitkeep +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/en.json +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/assets/i18n-compiled/fr.json +0 -1
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/index.ts +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/modules.ts +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/environments/environment.prod.ts +0 -3
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/environments/environment.ts +0 -15
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/favicon.ico +0 -0
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/index.html +0 -10
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/main.ts +0 -12
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/polyfills.ts +0 -86
- package/scripts/csdr/cli/skeletons/package/frontend-remote/src/test.ts.TO_REPLACE +0 -20
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.app.json +0 -20
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tsconfig.spec.json +0 -18
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tslint-remote.json +0 -7
- package/scripts/csdr/cli/skeletons/package/frontend-remote/tslint.json +0 -17
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/angular.json +0 -84
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/dependencies-composite.json +0 -8
- package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/src/app/eui-components.ts +0 -9
|
@@ -1,471 +1,54 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// GLOBAL
|
|
4
|
-
const inquirer = require('inquirer');
|
|
5
4
|
const path = require('path');
|
|
6
|
-
const replace = require('replace-in-file');
|
|
7
5
|
|
|
8
6
|
// LOCAL
|
|
9
7
|
const tools = require('../../../scripts/utils/tools');
|
|
10
|
-
const configUtils = require('../config/config-utils');
|
|
11
8
|
|
|
12
9
|
// CONSTANTS
|
|
13
|
-
const
|
|
14
|
-
const SKELETONS_ROOT_PATH = path.join(__dirname, 'skeletons', 'package');
|
|
15
|
-
const FRONTEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend');
|
|
16
|
-
const FRONTEND_SKELETON_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui10');
|
|
17
|
-
const FRONTEND_SKELETON_EUI14_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui14');
|
|
18
|
-
const FRONTEND_SKELETON_EUI15_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui15');
|
|
19
|
-
const FRONTEND_SKELETON_REMOTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote');
|
|
20
|
-
const FRONTEND_SKELETON_REMOTE_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui10');
|
|
21
|
-
const FRONTEND_SKELETON_REMOTE_EUI14_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui14');
|
|
22
|
-
const FRONTEND_SKELETON_REMOTE_EUI15_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui15');
|
|
23
|
-
const FRONTEND_OPTION_ROUTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-option-route');
|
|
24
|
-
const BACKEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'backend');
|
|
10
|
+
const constants = require('./constants');
|
|
25
11
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
FRONTEND: 'frontend',
|
|
31
|
-
BACKEND: 'backend'
|
|
32
|
-
},
|
|
33
|
-
pkgFrontendType: {
|
|
34
|
-
DEFAULT: 'default',
|
|
35
|
-
REMOTE: 'remote'
|
|
36
|
-
},
|
|
37
|
-
pkgFrontendVersion: {
|
|
38
|
-
DEFAULT: 'eui7',
|
|
39
|
-
EUI10: 'eui10',
|
|
40
|
-
EUI14: 'eui14',
|
|
41
|
-
EUI15: 'eui15',
|
|
42
|
-
},
|
|
43
|
-
isRouteModule: true,
|
|
44
|
-
isCsdrRepo: true,
|
|
45
|
-
isEnvTargetRemote: true,
|
|
46
|
-
externalRepoName: null,
|
|
47
|
-
pkgGroupId: 'eu.europa.ec.cc'
|
|
48
|
-
};
|
|
12
|
+
// INNER MODULES
|
|
13
|
+
const prompt = require('./package-prompt');
|
|
14
|
+
const buildBackend = require('./package-build-backend');
|
|
15
|
+
const buildFrontend = require('./package-build-frontend');
|
|
49
16
|
|
|
50
17
|
|
|
51
|
-
const prompt = () => {
|
|
52
|
-
return Promise.resolve()
|
|
53
|
-
.then(() => {
|
|
54
|
-
return inquirer.prompt([
|
|
55
|
-
{
|
|
56
|
-
type: 'list',
|
|
57
|
-
name: 'pkgType',
|
|
58
|
-
message: 'Select a package type :',
|
|
59
|
-
choices: [
|
|
60
|
-
{ name: 'Frontend - Angular library', value: defaultConfig.pkgType.FRONTEND },
|
|
61
|
-
{ name: 'Backend - SpringBoot micro-service', value: defaultConfig.pkgType.BACKEND },
|
|
62
|
-
],
|
|
63
|
-
default: defaultConfig.pkgType.FRONTEND,
|
|
64
|
-
validate: function (value) {
|
|
65
|
-
if (value.length) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'pkgGroupId',
|
|
72
|
-
type: 'input',
|
|
73
|
-
message: 'Enter the Maven groupId :',
|
|
74
|
-
default: defaultConfig.pkgGroupId,
|
|
75
|
-
when: function (answers) {
|
|
76
|
-
return (answers.pkgType === defaultConfig.pkgType.BACKEND);
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: 'list',
|
|
81
|
-
name: 'pkgFrontendType',
|
|
82
|
-
message: 'Select a frontend type :',
|
|
83
|
-
choices: [
|
|
84
|
-
{ name: 'Default Angular library', value: defaultConfig.pkgFrontendType.DEFAULT },
|
|
85
|
-
{ name: 'Remote element micro-frontend', value: defaultConfig.pkgFrontendType.REMOTE },
|
|
86
|
-
],
|
|
87
|
-
default: defaultConfig.pkgFrontendType.DEFAULT,
|
|
88
|
-
when: function (answers) {
|
|
89
|
-
return (answers.pkgType === defaultConfig.pkgType.FRONTEND);
|
|
90
|
-
},
|
|
91
|
-
validate: function (value) {
|
|
92
|
-
if (value.length) {
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
type: 'list',
|
|
99
|
-
name: 'pkgFrontendVersion',
|
|
100
|
-
message: 'Select eUI version target :',
|
|
101
|
-
choices: [
|
|
102
|
-
{ name: 'v7', value: defaultConfig.pkgFrontendVersion.DEFAULT },
|
|
103
|
-
{ name: 'v10', value: defaultConfig.pkgFrontendVersion.EUI10 },
|
|
104
|
-
{ name: 'v14', value: defaultConfig.pkgFrontendVersion.EUI14 },
|
|
105
|
-
{ name: 'v15', value: defaultConfig.pkgFrontendVersion.EUI15 },
|
|
106
|
-
],
|
|
107
|
-
default: defaultConfig.pkgFrontendType.DEFAULT,
|
|
108
|
-
when: function (answers) {
|
|
109
|
-
return (answers.pkgType === defaultConfig.pkgType.FRONTEND);
|
|
110
|
-
},
|
|
111
|
-
validate: function (value) {
|
|
112
|
-
if (value.length) {
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: 'pkgScope',
|
|
119
|
-
type: 'input',
|
|
120
|
-
message: 'Enter the package scope :',
|
|
121
|
-
default: defaultConfig.pkgScope
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: 'pkgName',
|
|
125
|
-
type: 'input',
|
|
126
|
-
message: 'Enter the package name :',
|
|
127
|
-
default: defaultConfig.pkgName
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: 'isRouteModule',
|
|
131
|
-
type: 'confirm',
|
|
132
|
-
message: 'Is this a ROUTE package ?',
|
|
133
|
-
default: defaultConfig.isRouteModule,
|
|
134
|
-
when: function (answers) {
|
|
135
|
-
return (
|
|
136
|
-
answers.pkgType === defaultConfig.pkgType.FRONTEND &&
|
|
137
|
-
answers.pkgFrontendType !== defaultConfig.pkgFrontendType.REMOTE
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: 'isEnvTargetRemote',
|
|
143
|
-
type: 'confirm',
|
|
144
|
-
message: 'Is this an envTarget/à la carte remote ? (root package needs to be created first with same scope/name)',
|
|
145
|
-
default: defaultConfig.isEnvTargetRemote,
|
|
146
|
-
when: function (answers) {
|
|
147
|
-
return (
|
|
148
|
-
answers.pkgType === defaultConfig.pkgType.FRONTEND &&
|
|
149
|
-
answers.pkgFrontendType === defaultConfig.pkgFrontendType.REMOTE &&
|
|
150
|
-
answers.pkgFrontendVersion !== defaultConfig.pkgFrontendVersion.DEFAULT
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: 'isCsdrRepo',
|
|
156
|
-
type: 'confirm',
|
|
157
|
-
message: 'Is the repository within CSDR git project ?',
|
|
158
|
-
default: defaultConfig.isCsdrRepo
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: 'externalRepoName',
|
|
162
|
-
type: 'input',
|
|
163
|
-
message: 'Enter the project CITnet project name where the repository is located :',
|
|
164
|
-
default: defaultConfig.externalRepoName,
|
|
165
|
-
when: function (answers) {
|
|
166
|
-
return (
|
|
167
|
-
answers.isCsdrRepo === false
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
]);
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
.catch((e) => {
|
|
175
|
-
throw e;
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const buildFrontend = (
|
|
182
|
-
name, scope,
|
|
183
|
-
frontendType, frontendVersion,
|
|
184
|
-
isRouteModule, isCsdrRepo, externalRepoName, isEnvTargetRemote,
|
|
185
|
-
) => {
|
|
186
|
-
|
|
187
|
-
tools.logTitle('Generating package');
|
|
188
|
-
|
|
189
|
-
let fullName = scope.substr(1) + '-' + name;
|
|
190
|
-
let npmPkgName, repoName;
|
|
191
|
-
|
|
192
|
-
if (frontendType === defaultConfig.pkgFrontendType.DEFAULT) {
|
|
193
|
-
fullName += '-ui';
|
|
194
|
-
npmPkgName = `${scope}/${name}`;
|
|
195
|
-
|
|
196
|
-
} else if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
|
|
197
|
-
if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
|
|
198
|
-
fullName += '-eui10-remote-el-ui';
|
|
199
|
-
npmPkgName = `${scope}/${name}-eui10-remote-el`;
|
|
200
|
-
|
|
201
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
|
|
202
|
-
fullName += '-eui14-remote-el-ui';
|
|
203
|
-
npmPkgName = `${scope}/${name}-eui14-remote-el`;
|
|
204
18
|
|
|
205
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI15) {
|
|
206
|
-
fullName += '-eui15-remote-el-ui';
|
|
207
|
-
npmPkgName = `${scope}/${name}-eui15-remote-el`;
|
|
208
19
|
|
|
209
|
-
|
|
210
|
-
fullName += '-remote-el-ui';
|
|
211
|
-
npmPkgName = `${scope}/${name}-remote-el`;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// generating default git repo
|
|
216
|
-
if (isCsdrRepo) {
|
|
217
|
-
repoName = `${fullName}.git`;
|
|
218
|
-
} else {
|
|
219
|
-
repoName = `${externalRepoName}/${fullName}.git`;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// generating target paths
|
|
223
|
-
const targetPath = path.join(TARGET_ROOT_PATH, fullName);
|
|
224
|
-
const rootPackagePath = path.join(TARGET_ROOT_PATH, `${scope.substr(1)}-${name}-ui`);
|
|
225
|
-
|
|
226
|
-
if (!frontendVersion === defaultConfig.pkgFrontendVersion.DEFAULT) {
|
|
227
|
-
if (frontendType === defaultConfig.pkgFrontendType.REMOTE && !tools.isDirExists(rootPackagePath)) {
|
|
228
|
-
tools.logError(`${rootPackagePath} NOT FOUND, you must mount the root package ui before creating the remote`);
|
|
229
|
-
throw 'ROOT_PACKAGE_NOT_FOUND';
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const pkg = {
|
|
234
|
-
name: fullName,
|
|
235
|
-
repoName: repoName,
|
|
236
|
-
npmPkgName: npmPkgName
|
|
237
|
-
};
|
|
20
|
+
module.exports.generate = () => {
|
|
238
21
|
|
|
239
22
|
return Promise.resolve()
|
|
240
|
-
|
|
241
|
-
// CLEANING TARGET
|
|
242
|
-
|
|
243
|
-
.then(() => {
|
|
244
|
-
tools.logInfo('Cleaning target');
|
|
245
|
-
return tools.rimraf(targetPath + '/**/*');
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// COPY TO TARGET
|
|
250
|
-
|
|
251
|
-
.then(() => {
|
|
252
|
-
tools.logInfo('Copying skeleton to target');
|
|
253
|
-
if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
|
|
254
|
-
if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
|
|
255
|
-
return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
|
|
256
|
-
|
|
257
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
|
|
258
|
-
tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
|
|
259
|
-
return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI14_PATH, targetPath, true);
|
|
260
|
-
|
|
261
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI15) {
|
|
262
|
-
tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
|
|
263
|
-
return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI15_PATH, targetPath, true);
|
|
264
|
-
|
|
265
|
-
} else {
|
|
266
|
-
return tools.copydir(FRONTEND_SKELETON_REMOTE_PATH, targetPath, true);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
} else {
|
|
270
|
-
if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
|
|
271
|
-
return tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
|
|
272
|
-
|
|
273
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
|
|
274
|
-
tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
|
|
275
|
-
return tools.copydir(FRONTEND_SKELETON_EUI14_PATH, targetPath, true);
|
|
276
|
-
|
|
277
|
-
} else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI15) {
|
|
278
|
-
tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
|
|
279
|
-
return tools.copydir(FRONTEND_SKELETON_EUI15_PATH, targetPath, true);
|
|
280
|
-
|
|
281
|
-
} else {
|
|
282
|
-
return tools.copydir(FRONTEND_SKELETON_PATH, targetPath, true);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
})
|
|
286
|
-
|
|
287
23
|
.then(() => {
|
|
288
|
-
|
|
289
|
-
return tools.copydir(FRONTEND_OPTION_ROUTE_PATH, targetPath, true);
|
|
290
|
-
}
|
|
24
|
+
tools.logTitle('Please answer the following questions : ');
|
|
291
25
|
})
|
|
292
26
|
|
|
293
|
-
|
|
294
|
-
// REPLACING PLACEHOLDERS
|
|
295
|
-
|
|
296
27
|
.then(() => {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
return Promise.resolve()
|
|
300
|
-
.then(() => {
|
|
301
|
-
return tools.replaceInPath(targetPath, '@module.name@', name);
|
|
302
|
-
})
|
|
303
|
-
.then(() => {
|
|
304
|
-
return tools.replaceInPath(targetPath, '@module.full.name@', fullName);
|
|
305
|
-
})
|
|
306
|
-
.then(() => {
|
|
307
|
-
return tools.replaceInPath(targetPath, '@module.scope@', scope);
|
|
308
|
-
})
|
|
309
|
-
.then(() => {
|
|
310
|
-
return tools.replaceInPath(targetPath, '@module.scope-name@', `${scope.substr(1)}-${name}`);
|
|
311
|
-
})
|
|
312
|
-
.then(() => {
|
|
313
|
-
return tools.replaceInPath(targetPath, '@module.scope.string@', scope.substr(1));
|
|
314
|
-
})
|
|
315
|
-
.then(() => {
|
|
316
|
-
return tools.replaceInPath(targetPath, '@module.class.name@', tools.camelCaseString(name, '-', true));
|
|
317
|
-
})
|
|
318
|
-
.catch((e) => {
|
|
319
|
-
throw e;
|
|
320
|
-
})
|
|
28
|
+
return prompt.prompt();
|
|
321
29
|
})
|
|
322
30
|
|
|
31
|
+
.then((answers) => {
|
|
323
32
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
tools.logInfo('Registering package');
|
|
327
|
-
|
|
328
|
-
if (frontendType === 'DEFAULT') {
|
|
329
|
-
return configUtils.angular.registerAngularPackage(pkg);
|
|
330
|
-
}
|
|
331
|
-
})
|
|
332
|
-
.then(() => {
|
|
333
|
-
return configUtils.angular.registerModulePaths(pkg);
|
|
334
|
-
})
|
|
335
|
-
.then(() => {
|
|
336
|
-
return configUtils.global.registerCsdrPackage(pkg, frontendType === defaultConfig.pkgFrontendType.REMOTE, scope, name);
|
|
337
|
-
})
|
|
338
|
-
|
|
33
|
+
// merging with defaults
|
|
34
|
+
answers = { ...constants.DEFAULT_CONFIG, ...answers};
|
|
339
35
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
36
|
+
// forcing config default if v15 virtual remote only generation
|
|
37
|
+
if (
|
|
38
|
+
answers.pkgFrontendVersion === constants.CONFIG_OPTIONS.pkgFrontendVersion.EUI15 &&
|
|
39
|
+
answers.pkgFrontendType === constants.CONFIG_OPTIONS.pkgFrontendType.REMOTE
|
|
40
|
+
) {
|
|
41
|
+
answers.isVirtualRemote = true;
|
|
345
42
|
}
|
|
346
|
-
})
|
|
347
|
-
|
|
348
|
-
.then(() => {
|
|
349
|
-
tools.logInfo('Replace extensions');
|
|
350
|
-
return tools.removeFilesExtension(targetPath, '.TO_REPLACE');
|
|
351
|
-
})
|
|
352
43
|
|
|
353
|
-
.then(() => {
|
|
354
|
-
// envTarget remote type specific
|
|
355
|
-
if (isEnvTargetRemote) {
|
|
356
|
-
tools.logInfo('Moving sources from remote to root package for envTarget remote type');
|
|
357
|
-
tools.move(path.join(targetPath, 'src'), path.join(rootPackagePath, 'assets', 'remote-sources'));
|
|
358
|
-
}
|
|
359
|
-
})
|
|
360
|
-
|
|
361
|
-
.then(() => {
|
|
362
|
-
tools.logSuccess();
|
|
363
|
-
})
|
|
364
|
-
|
|
365
|
-
.catch((e) => {
|
|
366
|
-
throw e;
|
|
367
|
-
})
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const buildBackend = (name, scope, groupId) => {
|
|
374
|
-
tools.logTitle('Generating package');
|
|
375
|
-
|
|
376
|
-
const artifactId = scope.substr(1, scope.length) + '-' + name + '-backend';
|
|
377
|
-
|
|
378
|
-
const targetPath = path.join(TARGET_ROOT_PATH, artifactId);
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return Promise.resolve()
|
|
382
|
-
|
|
383
|
-
// CLEANING TARGET
|
|
384
|
-
|
|
385
|
-
.then(() => {
|
|
386
|
-
tools.logInfo('Cleaning target');
|
|
387
|
-
return tools.rimraf(targetPath + '/**/*');
|
|
388
|
-
})
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
// COPY TO TARGET
|
|
392
|
-
|
|
393
|
-
.then(() => {
|
|
394
|
-
tools.logInfo('Copying skeleton to target');
|
|
395
|
-
return tools.copydir(BACKEND_SKELETON_PATH, targetPath, true);
|
|
396
|
-
})
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
// REPLACING PLACEHOLDERS
|
|
400
|
-
|
|
401
|
-
.then(() => {
|
|
402
|
-
tools.logInfo('Replacing placeholders');
|
|
403
|
-
|
|
404
|
-
return Promise.resolve()
|
|
405
|
-
.then(() => {
|
|
406
|
-
return tools.replaceInPath(targetPath, '@groupId@', groupId);
|
|
407
|
-
})
|
|
408
|
-
.then(() => {
|
|
409
|
-
return tools.replaceInPath(targetPath, '@artifactId@', artifactId);
|
|
410
|
-
})
|
|
411
|
-
.catch((e) => {
|
|
412
|
-
throw e;
|
|
413
|
-
})
|
|
414
|
-
})
|
|
415
|
-
|
|
416
|
-
.then(() => {
|
|
417
|
-
tools.logInfo('Executing post build operations');
|
|
418
|
-
return tools.move(path.join(targetPath, 'gitignore_TO_REPLACE'), path.join(targetPath, '.gitignore'));
|
|
419
|
-
})
|
|
420
|
-
|
|
421
|
-
.then(() => {
|
|
422
|
-
tools.logSuccess();
|
|
423
|
-
})
|
|
424
|
-
|
|
425
|
-
.catch((e) => {
|
|
426
|
-
throw e;
|
|
427
|
-
})
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
module.exports.generate = () => {
|
|
437
|
-
|
|
438
|
-
return Promise.resolve()
|
|
439
|
-
.then(() => {
|
|
440
|
-
tools.logTitle('Please answer the following questions : ');
|
|
441
|
-
})
|
|
442
|
-
|
|
443
|
-
.then(() => {
|
|
444
|
-
return prompt();
|
|
445
|
-
})
|
|
446
|
-
|
|
447
|
-
.then((answers) => {
|
|
448
44
|
tools.logInfo('Provided options :');
|
|
449
45
|
console.log(answers);
|
|
450
46
|
|
|
451
|
-
if (answers.pkgType ===
|
|
452
|
-
return buildFrontend(
|
|
453
|
-
answers.pkgName,
|
|
454
|
-
answers.pkgScope,
|
|
455
|
-
answers.pkgFrontendType,
|
|
456
|
-
answers.pkgFrontendVersion,
|
|
457
|
-
answers.isRouteModule,
|
|
458
|
-
answers.isCsdrRepo,
|
|
459
|
-
answers.externalRepoName,
|
|
460
|
-
answers.isEnvTargetRemote,
|
|
461
|
-
);
|
|
47
|
+
if (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.FRONTEND) {
|
|
48
|
+
return buildFrontend.generate(answers);
|
|
462
49
|
|
|
463
|
-
} else if (answers.pkgType ===
|
|
464
|
-
return buildBackend(
|
|
465
|
-
answers.pkgName,
|
|
466
|
-
answers.pkgScope,
|
|
467
|
-
answers.pkgGroupId,
|
|
468
|
-
);
|
|
50
|
+
} else if (answers.pkgType === constants.CONFIG_OPTIONS.pkgType.BACKEND) {
|
|
51
|
+
return buildBackend.generate(answers);
|
|
469
52
|
}
|
|
470
53
|
})
|
|
471
54
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EuiBlockContentModule } from '@eui/components/eui-block-content';
|
|
2
2
|
import { EuiButtonModule } from '@eui/components/eui-button';
|
|
3
|
-
import { EuiLabelModule } from '@eui/components/
|
|
3
|
+
import { EuiLabelModule } from '@eui/components/eui-label';
|
|
4
4
|
|
|
5
5
|
export const EUI_COMPONENTS_MODULES = [
|
|
6
|
-
|
|
6
|
+
EuiBlockContentModule,
|
|
7
7
|
EuiButtonModule,
|
|
8
8
|
EuiLabelModule,
|
|
9
9
|
];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"styles": [
|
|
3
|
+
"node_modules/@eui/styles/dist/styles/eui.css",
|
|
4
|
+
"node_modules/@eui/styles/dist/styles/eui-extra-utilities.css",
|
|
5
|
+
"node_modules/@eui/styles/dist/styles/eui-legacy-bootstrap.css",
|
|
6
|
+
"node_modules/@eui/styles/dist/styles/eui-legacy-icons-font.css"
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"base": {
|
|
3
|
+
},
|
|
4
|
+
"composite": {
|
|
5
|
+
"@eui/deps-base": "^15.0.0",
|
|
6
|
+
"@module.scope@/@module.name@": "^1.0.0",
|
|
7
|
+
"@csdr/core": "^4.0.0",
|
|
8
|
+
"@csdr/integration": "^3.0.0"
|
|
9
|
+
},
|
|
10
|
+
"INT": {
|
|
11
|
+
},
|
|
12
|
+
"ACC": {
|
|
13
|
+
},
|
|
14
|
+
"DLT": {
|
|
15
|
+
},
|
|
16
|
+
"TRN": {
|
|
17
|
+
},
|
|
18
|
+
"PROD": {
|
|
19
|
+
}
|
|
20
|
+
}
|