@eui/tools 4.16.6 → 4.17.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.
Files changed (38) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +23 -0
  3. package/global.test.js +0 -2
  4. package/package.json +1 -2
  5. package/sandbox.js +9 -1
  6. package/scripts/csdr/cli/package.js +55 -7
  7. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/module.ts +12 -9
  8. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/app/routing.module.ts +4 -2
  9. package/scripts/csdr/cli/skeletons/package/frontend-remote/src/config/global.ts +2 -4
  10. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/package.json_TO_REPLACE +1 -1
  11. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +16 -12
  12. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +4 -2
  13. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/config/global.ts +2 -2
  14. package/scripts/csdr/config/angular.js +0 -23
  15. package/scripts/csdr/config/global.js +10 -6
  16. package/scripts/csdr/config/packages.js +6 -0
  17. package/scripts/csdr/config/sync.js +6 -3
  18. package/scripts/csdr/install/build-package.js +11 -3
  19. package/scripts/csdr/install/common.js +2 -0
  20. package/scripts/csdr/install/composite-utils.js +2 -0
  21. package/scripts/csdr/install/local-dev.js +2 -0
  22. package/scripts/csdr/install/remote.js +13 -9
  23. package/scripts/csdr/metadata/app.js +44 -4
  24. package/scripts/csdr/metadata/common.js +0 -48
  25. package/scripts/csdr/release/app/release-app.js +0 -13
  26. package/scripts/csdr/release/package/common.js +7 -0
  27. package/scripts/csdr/release/package/release-package.js +4 -1
  28. package/scripts/csdr/release/package/remote.js +2 -17
  29. package/scripts/csdr/version/package.js +1 -1
  30. package/scripts/utils/build/package/angular.js +4 -30
  31. package/scripts/utils/git-utils.js +13 -5
  32. package/scripts/utils/index.js +0 -2
  33. package/scripts/utils/pre-build/elements.js +7 -3
  34. package/scripts/utils/pre-build/injection/externals.js +59 -2
  35. package/scripts/utils/pre-build/projects.js +0 -7
  36. package/scripts/utils/pre-build/translations/elements.js +0 -6
  37. package/scripts/utils/confluence-utils.js +0 -126
  38. package/scripts/utils/pre-build/translations/common.js +0 -0
@@ -1 +1 @@
1
- 4.16.6
1
+ 4.17.0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## 4.17.0 (2021-11-19)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * remove confluence-api dep ([ac6aa1ed](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ac6aa1eda7b0458c8dfc022d62fe302f3930ffdb))
7
+ * remove major bump on breaking change commit message - added hostAppName on remote cli skeleton creation - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([1e509b05](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/1e509b05d1a63bdc053df4c0502f497b8c45bea1))
8
+ * update assets metadata to handle remotes array ([228328cd](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/228328cd6d973843b2bd9b64475dd3a94e67fb0e))
9
+ * adapted remote cli script for package injection ([935f691d](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/935f691db992cdace1bcb5b9779eacfda7ed83f9))
10
+ * adapted remote v7 skeleton ([6c94f676](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/6c94f67694b38455cd5abf5619843dc739deaf14))
11
+ ##### New Features
12
+
13
+ * **other:**
14
+ * element injection - refactoring - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([d0ddf7d3](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/d0ddf7d37273f06285ef8646b8d738196f10e8cc))
15
+ ##### Bug Fixes
16
+
17
+ * **other:**
18
+ * tests ([367395e6](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/367395e6e2b8248af402b1bbdf151c9b95fc817c))
19
+ * eui10 remote package skeleton ([68998b13](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/68998b138cc7e79895891508e4105dc3eccedfe1))
20
+ * CSDR CLI for remote creation - EUI-4107 [EUI-4107](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4107) ([746ed2ae](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/746ed2aea943a96123a553714ea15d683c9b8a6c))
21
+
22
+ * * *
23
+ * * *
1
24
  ## 4.16.6 (2021-11-08)
2
25
 
3
26
  ##### Chores
package/global.test.js CHANGED
@@ -3,7 +3,6 @@ describe('eUI tools - test imports', () => {
3
3
 
4
4
  // utils
5
5
  const changelogUtils = require('./scripts/utils/changelog-utils');
6
- // const confluenceUtils = require('./scripts/utils/confluence-utils');
7
6
  const gitUtils = require('./scripts/utils/git-utils');
8
7
  const mavenUtils = require('./scripts/utils/maven-utils');
9
8
  const pipelineUtils = require('./scripts/utils/pipeline-utils');
@@ -32,7 +31,6 @@ describe('eUI tools - test imports', () => {
32
31
 
33
32
  // utils -pre-build - translations
34
33
  const prebuildTranslationUtils = require('./scripts/utils/pre-build/translations/translation-utils');
35
- const prebuildTranslationsCommon = require('./scripts/utils/pre-build/translations/common');
36
34
  const prebuildTranslationsElements = require('./scripts/utils/pre-build/translations/elements');
37
35
  const prebuildTranslationsProjects = require('./scripts/utils/pre-build/translations/projects');
38
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "4.16.6",
3
+ "version": "4.17.0",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -21,7 +21,6 @@
21
21
  "eol": "0.9.1",
22
22
  "rimraf": "3.0.2",
23
23
  "ncp": "2.0.0",
24
- "confluence-api": "1.4.0",
25
24
  "moment": "2.29.1",
26
25
  "moment-timezone": "0.5.33",
27
26
  "npm-run-all": "4.1.5",
package/sandbox.js CHANGED
@@ -589,9 +589,17 @@ const notificationUtils = require('./scripts/utils/notification/notification-uti
589
589
 
590
590
  // })
591
591
 
592
+ // return Promise.resolve()
593
+ // .then(() => {
594
+ // const a = configUtils.packages.getCsdrRemotePackages()
595
+ // .map((p) => {
596
+ // return { name: p.name, npmPkg: p.npmPkg }
597
+ // });
598
+ // console.log(tools.sortArray(a, 'name'));
599
+ // })
592
600
  return Promise.resolve()
593
601
  .then(() => {
594
- initUtils.processLocalEuiVersions();
602
+ return metadataUtils.app.storeMetadataAssetsStandAlone();
595
603
  })
596
604
 
597
605
  // return Promise.resolve()
@@ -35,6 +35,8 @@ const defaultConfig = {
35
35
  EUI10: 'eui10'
36
36
  },
37
37
  isRouteModule: true,
38
+ isCsdrRepo: true,
39
+ externalRepoName: null,
38
40
  pkgGroupId: 'eu.europa.ec.cc'
39
41
  };
40
42
 
@@ -99,7 +101,7 @@ const prompt = () => {
99
101
  return true;
100
102
  }
101
103
  }
102
- },
104
+ },
103
105
  {
104
106
  name: 'pkgScope',
105
107
  type: 'input',
@@ -123,7 +125,24 @@ const prompt = () => {
123
125
  answers.pkgFrontendType !== defaultConfig.pkgFrontendType.REMOTE
124
126
  );
125
127
  }
126
- }
128
+ },
129
+ {
130
+ name: 'isCsdrRepo',
131
+ type: 'confirm',
132
+ message: 'Is the repository within CSDR git project ?',
133
+ default: defaultConfig.isCsdrRepo
134
+ },
135
+ {
136
+ name: 'externalRepoName',
137
+ type: 'input',
138
+ message: 'Enter the project CITnet project name where the repository is located :',
139
+ default: defaultConfig.externalRepoName,
140
+ when: function (answers) {
141
+ return (
142
+ answers.isCsdrRepo === false
143
+ );
144
+ }
145
+ },
127
146
  ]);
128
147
  })
129
148
 
@@ -134,26 +153,40 @@ const prompt = () => {
134
153
 
135
154
 
136
155
 
137
- const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule) => {
156
+ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule, isCsdrRepo, externalRepoName) => {
138
157
  tools.logTitle('Generating package');
139
158
 
140
159
  let fullName = scope.substr(1) + '-' + name;
160
+ let npmPkgName, repoName;
161
+
141
162
  if (frontendType === defaultConfig.pkgFrontendType.DEFAULT) {
142
163
  fullName += '-ui';
164
+ npmPkgName = `${scope}/${name}`;
165
+
143
166
  } else if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
144
167
  if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
145
168
  fullName += '-eui10-remote-el-ui';
169
+ npmPkgName = `${scope}/${name}-eui10-remote-el`;
170
+
146
171
  } else {
147
172
  fullName += '-remote-el-ui';
173
+ npmPkgName = `${scope}/${name}-remote-el`;
148
174
  }
149
175
  }
150
176
 
177
+ if (isCsdrRepo) {
178
+ repoName = `${fullName}.git`;
179
+
180
+ } else {
181
+ repoName = `${externalRepoName}/${fullName}.git`;
182
+ }
183
+
151
184
  const targetPath = path.join(TARGET_ROOT_PATH, fullName);
152
185
 
153
186
  const pkg = {
154
187
  name: fullName,
155
- npmPkgScope: scope,
156
- npmPkgName: name
188
+ repoName: repoName,
189
+ npmPkgName: npmPkgName
157
190
  };
158
191
 
159
192
  return Promise.resolve()
@@ -207,6 +240,9 @@ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule
207
240
  .then(() => {
208
241
  return tools.replaceInPath(targetPath, '@module.scope@', scope);
209
242
  })
243
+ .then(() => {
244
+ return tools.replaceInPath(targetPath, '@module.scope-name@', `${scope.substr(1)}-${name}`);
245
+ })
210
246
  .then(() => {
211
247
  return tools.replaceInPath(targetPath, '@module.scope.string@', scope.substr(1));
212
248
  })
@@ -338,10 +374,22 @@ module.exports.generate = () => {
338
374
  console.log(answers);
339
375
 
340
376
  if (answers.pkgType === defaultConfig.pkgType.FRONTEND) {
341
- return buildFrontend(answers.pkgName, answers.pkgScope, answers.pkgFrontendType, answers.pkgFrontendVersion, answers.isRouteModule);
377
+ return buildFrontend(
378
+ answers.pkgName,
379
+ answers.pkgScope,
380
+ answers.pkgFrontendType,
381
+ answers.pkgFrontendVersion,
382
+ answers.isRouteModule,
383
+ answers.isCsdrRepo,
384
+ answers.externalRepoName,
385
+ );
342
386
 
343
387
  } else if (answers.pkgType === defaultConfig.pkgType.BACKEND) {
344
- return buildBackend(answers.pkgName, answers.pkgScope, answers.pkgGroupId);
388
+ return buildBackend(
389
+ answers.pkgName,
390
+ answers.pkgScope,
391
+ answers.pkgGroupId,
392
+ );
345
393
  }
346
394
  })
347
395
 
@@ -35,7 +35,8 @@ import {
35
35
  UxService,
36
36
  } from '@eui/core';
37
37
  import { LanguageInterceptor, PushNotificationsService, BreadcrumbsService } from '@csdr/core';
38
- import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
38
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
39
+ // import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
39
40
 
40
41
  import { TOKEN, reducerProvider, metaReducers } from './reducers/index';
41
42
  import { CustomSerializer } from './reducers/custom-route-serializer';
@@ -108,12 +109,13 @@ export function openidConnectInterceptorFactory(config) {
108
109
  deps: [CONFIG_TOKEN],
109
110
  multi: true,
110
111
  },
111
- {
112
- provide: HTTP_INTERCEPTORS,
113
- useClass: ZipkinHttpInterceptor,
114
- deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
115
- multi: true,
116
- },
112
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
113
+ // {
114
+ // provide: HTTP_INTERCEPTORS,
115
+ // useClass: ZipkinHttpInterceptor,
116
+ // deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
117
+ // multi: true,
118
+ // },
117
119
  { provide: CONFIG_TOKEN, useFactory: () => window['PROVIDERS']['CONFIG_TOKEN'], deps: [] },
118
120
  {
119
121
  provide: UxService,
@@ -142,8 +144,9 @@ export function openidConnectInterceptorFactory(config) {
142
144
  },
143
145
  { provide: BreadcrumbsService, useFactory: () => window['PROVIDERS']['BreadcrumbsService'], deps: [] },
144
146
  { provide: ELEMENT_ROUTER_TOKEN, useFactory: () => window['PROVIDERS']['ELEMENT_ROUTER_TOKEN'], deps: [] },
145
- { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
146
- { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
147
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
148
+ // { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
149
+ // { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
147
150
  ],
148
151
  })
149
152
  export class AppModule {
@@ -5,14 +5,16 @@ import { filter, distinctUntilChanged } from 'rxjs/operators';
5
5
 
6
6
  import { CCRoute, ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
7
7
 
8
- // import { routes } from '@cc/task-manager'; // TODO import from package
8
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
9
+ // import { routes } from '@cc/task-manager';
9
10
  import { appConfig } from '../config/index';
10
11
  import { ModuleComponent } from './module.component';
11
12
 
12
13
  const prefixedRoutes: Routes = [
13
14
  {
14
15
  path: appConfig.global.baseUrl,
15
- // children: routes, // TODO import from package
16
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
17
+ // children: routes,
16
18
  },
17
19
  { path: '**', component: ModuleComponent },
18
20
  ];
@@ -1,10 +1,8 @@
1
1
  export const GLOBAL = {
2
2
  /* URL that needs to be used in the appRouting of the MWP */
3
3
  baseUrl: '@module.name@',
4
- /* the path/s where translation resources will be loaded */
5
- i18nResources: ['elements/@module.full.name@/bundles/assets/i18n-compiled'],
6
4
  /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
7
- elementName: '@module.scope@-@module.name@-v7',
5
+ elementName: '@module.scope-name@-v7',
8
6
  /* in case you are using NgRx give it a unique name (mostly for debugging) */
9
- storeName: '@module.scope@ @module.name@',
7
+ storeName: '@module.scope-name@'
10
8
  };
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "@module.scope@/@module.name@-remote-el",
2
+ "name": "@module.scope@/@module.name@-eui10-remote-el",
3
3
  "version": "1.0.0",
4
4
  "files": [
5
5
  "bundles"
@@ -13,7 +13,6 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools';
13
13
 
14
14
  import { TranslateModule } from '@ngx-translate/core';
15
15
 
16
- // CSDR CORE - Babel defs & core reducers
17
16
  import {
18
17
  CachePreventionInterceptor,
19
18
  CONFIG_TOKEN,
@@ -30,7 +29,8 @@ import {
30
29
  UxAppShellService,
31
30
  } from '@eui/core';
32
31
  import { PushNotificationsService } from '@csdr/core';
33
- import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
32
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
33
+ // import { TRACE_LOCAL_SERVICE_NAME, ZipkinHttpInterceptor, ZipkinTraceManager } from '@csdr/zipkin-tracing';
34
34
 
35
35
  import { TOKEN, reducerProvider, metaReducers } from './reducers/index';
36
36
  import { CustomSerializer } from './reducers/custom-route-serializer';
@@ -38,7 +38,8 @@ import { CustomSerializer } from './reducers/custom-route-serializer';
38
38
  import { environment } from '../environments/environment';
39
39
  import { appConfig } from '../config';
40
40
 
41
- // import { TaskMgrCommonModule } from '@cc/task-manager'; // TODO adapt to central package import
41
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
42
+ // import { TaskMgrCommonModule } from '@cc/task-manager';
42
43
  import {
43
44
  ELEMENT_ROUTER_TOKEN,
44
45
  PushNotificationMapping,
@@ -68,7 +69,8 @@ export function openidConnectInterceptorFactory(config) {
68
69
 
69
70
  CoreModule.forRoot(),
70
71
 
71
- // TaskMgrCommonModule, // TODO adapt to central package import
72
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
73
+ // TaskMgrCommonModule,
72
74
  RoutingModule,
73
75
  ],
74
76
  declarations: [
@@ -110,12 +112,13 @@ export function openidConnectInterceptorFactory(config) {
110
112
  deps: [CONFIG_TOKEN],
111
113
  multi: true,
112
114
  },
113
- {
114
- provide: HTTP_INTERCEPTORS,
115
- useClass: ZipkinHttpInterceptor,
116
- deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
117
- multi: true,
118
- },
115
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
116
+ // {
117
+ // provide: HTTP_INTERCEPTORS,
118
+ // useClass: ZipkinHttpInterceptor,
119
+ // deps: [TRACE_LOCAL_SERVICE_NAME, ZipkinTraceManager],
120
+ // multi: true,
121
+ // },
119
122
 
120
123
  // used in the el-mappers
121
124
  { provide: USER_SERVICE_HOST_TOKEN, useFactory: () => window['PROVIDERS']['UserService'] },
@@ -145,8 +148,9 @@ export function openidConnectInterceptorFactory(config) {
145
148
  deps: [CONFIG_TOKEN, HttpClient, PLATFORM_ID, Router, StoreService, I18nService, UX_SERVICE_HOST_TOKEN],
146
149
  },
147
150
  { provide: ELEMENT_ROUTER_TOKEN, useFactory: () => window['PROVIDERS']['ELEMENT_ROUTER_TOKEN'], deps: [] },
148
- { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
149
- { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
151
+ // TODO[REMOTE-SETUP] uncomment if zipkin is used
152
+ // { provide: TRACE_LOCAL_SERVICE_NAME, useFactory: () => window['PROVIDERS']['TRACE_LOCAL_SERVICE_NAME'], deps: [] },
153
+ // { provide: ZipkinTraceManager, useFactory: () => window['PROVIDERS']['ZipkinTraceManager'], deps: [] },
150
154
  ],
151
155
  })
152
156
  export class AppModule {
@@ -5,14 +5,16 @@ import { filter, distinctUntilChanged } from 'rxjs/operators';
5
5
 
6
6
  import { CCRoute, ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
7
7
 
8
- // import { routes } from '@cc/task-manager'; // TODO adapt to central package import
8
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
9
+ // import { routes } from '@cc/task-manager';
9
10
  import { appConfig } from '../config/index';
10
11
  import { ModuleComponent } from './module.component';
11
12
 
12
13
  const prefixedRoutes: Routes = [
13
14
  {
14
15
  path: appConfig.global.baseUrl,
15
- // children: routes, // TODO adapt to central package routes
16
+ // TODO[REMOTE-SETUP] adapt to wrapped package import
17
+ // children: routes,
16
18
  },
17
19
  { path: '**', component: ModuleComponent },
18
20
  ];
@@ -24,8 +24,8 @@ export const GLOBAL: GlobalConfig = {
24
24
  /* URL that needs to be used in the appRouting of the MWP */
25
25
  baseUrl: '@module.name@-v10',
26
26
  /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
27
- elementName: '@module.scope@-@module.name@-v10',
27
+ elementName: '@module.scope-name@-v10',
28
28
  /* in case you are using NgRx give it a unique name (mostly for debugging) */
29
- storeName: '@module.scope@ @module.name@',
29
+ storeName: '@module.scope-name@',
30
30
  i18n: i18nConfig,
31
31
  };
@@ -775,30 +775,7 @@ module.exports.registerAngularPackageSubEntry = (subEntryName, subEntryPath) =>
775
775
  }
776
776
 
777
777
 
778
- module.exports.generateTsConfigLibProd = (pkg) => {
779
- var pathBase = path.join('packages', pkg.name);
780
- if (pkg.child) {
781
- pathBase = path.join('packages', pkg.parentPkg, 'packages', pkg.folder);
782
- }
783
-
784
- const filePath = path.join(process.cwd(), pathBase, 'tsconfig.lib.prod.json');
785
- tools.logInfo(`Generating ${filePath}`);
786
- if (!tools.isFileExists(filePath)) {
787
- tools.writeJsonFileSync(filePath, tsConfigProdDef);
788
- tools.logSuccess();
789
778
 
790
- } else {
791
- tools.logSuccess('OK - file already exists');
792
- // const fileContent = tools.getJsonFileContent(filePath);
793
- // console.log(fileContent);
794
- // if (JSON.stringify(fileContent) !== JSON.stringify(tsConfigProdDef)) {
795
- // tools.writeJsonFileSync(filePath, tsConfigProdDef);
796
- // tools.logSuccess('OK - file exists and updated');
797
- // } else {
798
- // tools.logSuccess('OK - file already exists and unchanged');
799
- // }
800
- }
801
- }
802
779
 
803
780
 
804
781
  module.exports.registerAngularProjectDef = (project, build = false) => {
@@ -444,10 +444,10 @@ module.exports.registerCsdrPackage = (pkg, isRemote) => {
444
444
 
445
445
  const csdrConfigPackage = {
446
446
  "name": "@module.full.name@",
447
- "npmPkg": "@module.scope@/@module.name@",
447
+ "npmPkg": "@module.npmPkg.name@",
448
448
  "deps": [
449
449
  ],
450
- "repository": "@module.full.name@.git",
450
+ "repository": "@module.repo.name@",
451
451
  "teams": [
452
452
  "all-frontend"
453
453
  ]
@@ -455,12 +455,13 @@ module.exports.registerCsdrPackage = (pkg, isRemote) => {
455
455
 
456
456
  const csdrConfigRemotePackage = {
457
457
  "name": "@module.full.name@",
458
- "npmPkg": "@module.scope@/@module.name@-remote-el",
458
+ "npmPkg": "@module.npmPkg.name@",
459
459
  "deps": [
460
460
  ],
461
- "repository": "@module.full.name@.git",
461
+ "repository": "@module.repo.name@",
462
462
  "element": true,
463
463
  "remote": true,
464
+ "hostAppName": "my-workplace",
464
465
  "teams": [
465
466
  "all-frontend"
466
467
  ],
@@ -475,14 +476,17 @@ module.exports.registerCsdrPackage = (pkg, isRemote) => {
475
476
 
476
477
  // inserting package in root config
477
478
  let packageDef;
479
+
478
480
  if (isRemote) {
479
481
  packageDef = JSON.stringify(csdrConfigRemotePackage);
482
+
480
483
  } else {
481
484
  packageDef = JSON.stringify(csdrConfigPackage);
482
485
  }
486
+
483
487
  let replaceModule = tools.replaceAll(packageDef, '@module.full.name@', pkg.name);
484
- replaceModule = tools.replaceAll(replaceModule, '@module.scope@', pkg.npmPkgScope);
485
- replaceModule = tools.replaceAll(replaceModule, '@module.name@', pkg.npmPkgName);
488
+ replaceModule = tools.replaceAll(replaceModule, '@module.repo.name@', pkg.repoName);
489
+ replaceModule = tools.replaceAll(replaceModule, '@module.npmPkg.name@', pkg.npmPkgName);
486
490
 
487
491
  let file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
488
492
  let jsonFile = require(file);
@@ -202,6 +202,12 @@ module.exports.getRemotePackages = () => {
202
202
  })
203
203
  }
204
204
 
205
+ module.exports.getCsdrRemotePackages = () => {
206
+ return this.getCsdrPackagesFull().filter(pkg => {
207
+ return pkg.remote;
208
+ })
209
+ }
210
+
205
211
  module.exports.getBuildablePackagesWithDeps = () => {
206
212
  return this.getDepGraph().overallOrder().filter(pkg => {
207
213
  if (!pkg.build) {
@@ -13,6 +13,12 @@ const innerPackages = require('./packages');
13
13
  const innerProjects = require('./projects');
14
14
 
15
15
 
16
+ // -------------------------------------------------------------------------------------
17
+ // Updates the .csdr/.euirc.json, storing locally installed projects and packages names
18
+ // --
19
+ // Called by "sync" - csdr/sync/sync-utils
20
+ // -------------------------------------------------------------------------------------
21
+
16
22
  module.exports.run = () => {
17
23
  tools.logInfo('Synching packages and local config');
18
24
 
@@ -52,7 +58,4 @@ module.exports.run = () => {
52
58
  };
53
59
 
54
60
  tools.writeJsonFileSync(path.join(process.cwd(), '.csdr', '.euirc.json'), config);
55
-
56
- // update extra config files
57
-
58
61
  }
@@ -9,7 +9,6 @@ const tools = require('../../utils/tools');
9
9
  const configUtils = require('../config/config-utils');
10
10
  const compositeUtils = require('./composite-utils');
11
11
  const metadataUtils = require('../metadata/metadata-utils');
12
- const notificationUtils = require('../../utils/notification/notification-utils');
13
12
 
14
13
  // INNER MODULES
15
14
  const innerCommon = require('./common');
@@ -17,7 +16,7 @@ const innerRemote = require('./remote');
17
16
 
18
17
 
19
18
  module.exports.install = (prj, pkg, isMaster) => {
20
- let compositeDeps, localPkgDeps, localPkgCompositeDeps, pkgCompositeDeps;
19
+ let compositeDeps, localPkgDeps, localPkgCompositeDeps;
21
20
 
22
21
  return Promise.resolve()
23
22
  .then(() => {
@@ -86,9 +85,18 @@ module.exports.install = (prj, pkg, isMaster) => {
86
85
  }
87
86
  })
88
87
 
88
+ .catch((e) => {
89
+ throw e;
90
+ })
91
+ }
92
+
93
+
94
+
95
+ module.exports.installRemote = (pkg, isMaster, envTarget) => {
96
+ return Promise.resolve()
89
97
  // checking remotes
90
98
  .then(() => {
91
- return innerRemote.installDeps(null, isMaster);
99
+ return innerRemote.installDeps(pkg, isMaster, envTarget);
92
100
  })
93
101
 
94
102
  // returning metadata dependencies
@@ -12,6 +12,8 @@ const metadataUtils = require('../metadata/metadata-utils');
12
12
  // FETCH ARGS
13
13
  const { dryRun, skipInstall, registry, npm } = tools.getArgs();
14
14
 
15
+
16
+
15
17
  const installDeps = (deps) => {
16
18
 
17
19
  return Promise.resolve()
@@ -11,6 +11,8 @@ const metadataUtils = require('../metadata/metadata-utils');
11
11
  // inner modules
12
12
  const innerCommon = require('./common');
13
13
 
14
+
15
+
14
16
  const getDeps = (prj, envTarget = 'DEV', compositeType = 'DEFAULT') => {
15
17
 
16
18
  tools.logTitle(`Fetching composite dependencies for ${envTarget} - composite type : ${compositeType}`);
@@ -17,6 +17,8 @@ const innerRemote = require('./remote');
17
17
  const { dryRun, skipInstall } = tools.getArgs();
18
18
 
19
19
 
20
+
21
+
20
22
  module.exports.install = (pkg) => {
21
23
  let packagesDeps, packagesCompositeDeps, projectsDeps, projectsFixedDeps, finalDeps;
22
24
 
@@ -15,15 +15,15 @@ const innerCommon = require('./common');
15
15
  const { dryRun } = tools.getArgs();
16
16
 
17
17
 
18
- module.exports.installDeps = (pkg, isMaster) => {
18
+ module.exports.installDeps = (pkg, isMaster, envTarget) => {
19
19
  tools.logTitle('Remote dependencies installation');
20
20
 
21
21
  return Promise.resolve()
22
22
  .then(() => {
23
23
  if (pkg) {
24
- return pkgInstall(pkg, isMaster);
24
+ return pkgInstall(pkg, isMaster, envTarget);
25
25
  } else {
26
- return allPkgInstall(isMaster);
26
+ return allPkgInstall(isMaster, envTarget);
27
27
  }
28
28
  })
29
29
 
@@ -33,7 +33,7 @@ module.exports.installDeps = (pkg, isMaster) => {
33
33
  }
34
34
 
35
35
 
36
- const allPkgInstall = (isMaster) => {
36
+ const allPkgInstall = (isMaster, envTarget) => {
37
37
  return Promise.resolve()
38
38
 
39
39
  // getting packages to be remotely installed
@@ -52,7 +52,7 @@ const allPkgInstall = (isMaster) => {
52
52
  .then((packages) => Promise.resolve().then(() => {
53
53
  return packages.reduce((promise, pkg) => {
54
54
  return promise.then(() => (
55
- pkgInstall(pkg, isMaster)
55
+ pkgInstall(pkg, isMaster, envTarget)
56
56
  ));
57
57
  }, Promise.resolve());
58
58
  }))
@@ -64,7 +64,7 @@ const allPkgInstall = (isMaster) => {
64
64
 
65
65
 
66
66
 
67
- const pkgInstall = (pkg, isMaster) => {
67
+ const pkgInstall = (pkg, isMaster, envTarget) => {
68
68
  tools.logTitle(`Processing installation for : ${pkg.name}`);
69
69
 
70
70
  var outputDeps;
@@ -72,7 +72,7 @@ const pkgInstall = (pkg, isMaster) => {
72
72
  return Promise.resolve()
73
73
  .then(() => {
74
74
  // fetching deps from dependencies base and composite if any
75
- return getDeps(pkg, isMaster);
75
+ return getDeps(pkg, isMaster, envTarget);
76
76
  })
77
77
 
78
78
  .then((deps) => {
@@ -127,10 +127,10 @@ const pkgInstall = (pkg, isMaster) => {
127
127
  }
128
128
 
129
129
 
130
- const getDeps = (pkg, isMaster) => {
130
+ const getDeps = (pkg, isMaster, envTarget = null) => {
131
131
  return Promise.resolve()
132
132
  .then(() => {
133
- if (isMaster) {
133
+ if (isMaster || envTarget !== null) {
134
134
  return metadataUtils.package.getPackagesDeps('packagesLatestTag');
135
135
  } else {
136
136
  return metadataUtils.package.getPackagesDeps('packages');
@@ -152,6 +152,10 @@ const getDeps = (pkg, isMaster) => {
152
152
  depsComposite = tools.getJsonFileContent(depsCompositeJsonFile);
153
153
  }
154
154
 
155
+ if (envTarget) {
156
+ // TODO - handle dependencies composite per environment => one bamboo plan for each envs to be defined
157
+ }
158
+
155
159
  return innerCommon.getRemappedDeps(depsMetadata, { ...depsBase, ...depsComposite});
156
160
  })
157
161