@eui/tools 5.3.24 → 5.3.25

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
- 5.3.24
1
+ 5.3.25
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 5.3.25 (2022-06-22)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * avoid removing assets path on app source injection - MWP-7700 [MWP-7700](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-7700) ([63b520d1](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/63b520d107bdfe4dd64f46bd6eb78943db71fc93))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 5.3.24 (2022-06-21)
2
11
 
3
12
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.3.24",
3
+ "version": "5.3.25",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -290,7 +290,7 @@ module.exports.run = () => {
290
290
  if (project.build && project.build.distribution) {
291
291
  return Promise.resolve()
292
292
  .then(() => {
293
- return utils.buildApp.generateProjectDistributionFile(project, (isSnapshot || isSupportSnapshotBranch));
293
+ return utils.buildApp.generateProjectDistributionFile(project, (isSnapshot || isSupportSnapshotBranch), envTarget);
294
294
  })
295
295
  .catch((e) => {
296
296
  throw e;
@@ -270,7 +270,7 @@ module.exports.postBuild = (project) => {
270
270
  }
271
271
 
272
272
 
273
- module.exports.generateProjectDistributionFile = (project, isSnapshot) => {
273
+ module.exports.generateProjectDistributionFile = (project, isSnapshot, envTarget) => {
274
274
  tools.logTitle('Generating distribution file');
275
275
 
276
276
  let projectVersion;
@@ -298,6 +298,36 @@ module.exports.generateProjectDistributionFile = (project, isSnapshot) => {
298
298
  if (isSnapshot && project.build.distribution.bucketNameSnapshot) {
299
299
  bucketName = project.build.distribution.bucketNameSnapshot;
300
300
  }
301
+
302
+ if (envTarget) {
303
+ if (envTarget === 'DEV' && project.build.distribution.bucketNameDev) {
304
+ bucketName = project.build.distribution.bucketNameDev;
305
+ }
306
+
307
+ if (envTarget === 'TST' && project.build.distribution.bucketNameTst) {
308
+ bucketName = project.build.distribution.bucketNameTst;
309
+ }
310
+
311
+ if (envTarget === 'INT' && project.build.distribution.bucketNameInt) {
312
+ bucketName = project.build.distribution.bucketNameInt;
313
+ }
314
+
315
+ if (envTarget === 'ACC' && project.build.distribution.bucketNameAcc) {
316
+ bucketName = project.build.distribution.bucketNameAcc;
317
+ }
318
+
319
+ if (envTarget === 'DLT' && project.build.distribution.bucketNameDlt) {
320
+ bucketName = project.build.distribution.bucketNameDlt;
321
+ }
322
+
323
+ if (envTarget === 'TRN' && project.build.distribution.bucketNameTrn) {
324
+ bucketName = project.build.distribution.bucketNameTrn;
325
+ }
326
+
327
+ if (envTarget === 'PROD' && project.build.distribution.bucketNameProd) {
328
+ bucketName = project.build.distribution.bucketNameProd;
329
+ }
330
+ }
301
331
  }
302
332
 
303
333
  // final output bucket location
@@ -110,8 +110,27 @@ module.exports.injectExternalAppSources = (project, build = false) => {
110
110
  return Promise.resolve()
111
111
  .then(() => {
112
112
  if (!build) {
113
- tools.logInfo(`Removing ${projectSrcPath} content`);
114
- return tools.rimraf(projectSrcPath);
113
+ // removing previously injected content, except assets
114
+ const projectSrcAppPath = path.join(projectSrcPath, 'app');
115
+ const projectSrcConfigPath = path.join(projectSrcPath, 'config');
116
+ const projectSrcEnvironmentsPath = path.join(projectSrcPath, 'environments');
117
+
118
+ return Promise.resolve()
119
+ .then(() => {
120
+ tools.logInfo(`Removing ${projectSrcAppPath} content`);
121
+ return tools.rimraf(projectSrcAppPath);
122
+ })
123
+ .then(() => {
124
+ tools.logInfo(`Removing ${projectSrcConfigPath} content`);
125
+ return tools.rimraf(projectSrcConfigPath);
126
+ })
127
+ .then(() => {
128
+ tools.logInfo(`Removing ${projectSrcEnvironmentsPath} content`);
129
+ return tools.rimraf(projectSrcEnvironmentsPath);
130
+ })
131
+ .catch((e) => {
132
+ throw e;
133
+ })
115
134
  }
116
135
  })
117
136
  .then(() => {