@eui/tools 5.2.10 → 5.3.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.
Files changed (34) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +27 -0
  3. package/bin/scripts/csdr-sync.js +1 -1
  4. package/docs/01-intro.md +78 -0
  5. package/package.json +1 -1
  6. package/sandbox.js +16 -8
  7. package/scripts/csdr/cli/package.js +54 -2
  8. package/scripts/csdr/cli/skeletons/package/frontend-eui10/assets/remote-sources/.gitkeep +0 -0
  9. package/scripts/csdr/cli/skeletons/package/frontend-eui10/dependencies-base.json +2 -0
  10. package/scripts/csdr/cli/skeletons/package/frontend-eui10/dependencies-composite.json +3 -0
  11. package/scripts/csdr/cli/skeletons/package/frontend-eui13/dependencies-composite.json +3 -0
  12. package/scripts/csdr/cli/skeletons/package/frontend-eui14/dependencies-composite.json +3 -0
  13. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/index.ts +2 -0
  14. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/{module.module.ts → module.ts} +2 -2
  15. package/scripts/csdr/cli/skeletons/package/frontend-option-route/src/lib/{module-routing.module.ts → routing.module.ts} +0 -0
  16. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/browserslist +5 -9
  17. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite-ACC.json +4 -0
  18. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite-DLT.json +4 -0
  19. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite-INT.json +4 -0
  20. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite-PROD.json +4 -0
  21. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/dependencies-composite-TRN.json +4 -0
  22. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/gitignore_TO_REPLACE +1 -0
  23. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/module.ts +2 -4
  24. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui10/src/app/routing.module.ts +2 -4
  25. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui13/dependencies-composite.json +6 -0
  26. package/scripts/csdr/cli/skeletons/package/frontend-remote-eui14/dependencies-composite.json +6 -0
  27. package/scripts/csdr/config/global.js +14 -2
  28. package/scripts/csdr/config/projects.js +29 -29
  29. package/scripts/csdr/install/build-app.js +5 -1
  30. package/scripts/csdr/install/projects.js +11 -0
  31. package/scripts/index.js +147 -0
  32. package/scripts/index.test.js +7 -0
  33. package/scripts/utils/build/app/build-app-utils.js +2 -2
  34. package/global.test.js +0 -152
@@ -1 +1 @@
1
- 5.2.10
1
+ 5.3.1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## 5.3.1 (2022-05-31)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * console log wrong declaration - EUI-4106 [EUI-4106](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4106) ([beb3c4f3](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/beb3c4f35325569e42630dcd8e5b483d40254d0f))
7
+
8
+ * * *
9
+ * * *
10
+ ## 5.3.0 (2022-05-31)
11
+
12
+ ##### New Features
13
+
14
+ * **other:**
15
+ * add standalone projects build capability - EUI-5917 [EUI-5917](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-5917) ([05dfe5cb](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/05dfe5cbc8d5079b57d760f2d56945fb2d3490c0))
16
+
17
+ * * *
18
+ * * *
19
+ ## 5.2.11 (2022-05-21)
20
+
21
+ ##### Chores
22
+
23
+ * **other:**
24
+ * added v13 and v14 package skeletons - adapted for envTarget remote skeleton - doc - EUI-4106 [EUI-4106](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-4106) ([5324dd32](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/5324dd32a669368f438f54ddeacaf65958b6ec83))
25
+
26
+ * * *
27
+ * * *
1
28
  ## 5.2.10 (2022-05-19)
2
29
 
3
30
  ##### Chores
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const syncUtils = require('../../scripts/csdr/sync/sync-utils');
3
+ const { syncUtils } = require('../../scripts');
4
4
 
5
5
  Promise.resolve()
6
6
  .then(() => {
@@ -0,0 +1,78 @@
1
+ author: Roels G - DIGIT.B.3
2
+ last reviesion:
3
+
4
+ date | who ? | what ?
5
+ --- | --- | ---
6
+ 2022-05-18 | roelsgr | document creation
7
+ <hr>
8
+ <br><br>
9
+
10
+ # eUI tools - part 1 - Introduction
11
+
12
+ ## History
13
+
14
+ The initial main purpose of eUI tools was to have a comitted pipeline and avoid duplication of code in Bamboo, yes at that time there wasn't any Bamboo specs, which would have facilited the approach, if we wanted to have the pipeline as compiled code... which makes it not so handy for maintenance and "live" testing.
15
+
16
+ But nevertheless, eUI tools was there, at first it was really a bunch of promises scripts triggered by a bin files like npm library allowing obfuscation of pipeline flow : assemble/build/set version/publish.
17
+
18
+ For sure like all things, it started simple and got more complicated, but it's in constant refactoring, basically things become unreadable time for a refactoring ;)
19
+
20
+ ## Challenges ?
21
+
22
+ Probably the most crucial one to tackle : eUI tools should use itself to build itself, sounds like recursive stuffs, but that's one of the main advantage of javascript maybe here.
23
+
24
+ This with the help of the CSDR pipeline for sure, executed through job/stage in gitlab.
25
+
26
+ Why ? because the pipeline when building a package / npm / backend etc... is split in 2 main parts :
27
+ - the "init" phase: initialize / clone / mount the necessary repository(ies) instructed by the build param, basically a "pkg" package name and in CSDR it's always the repository name, easy to spot / easy and a few other arguments like : git "branch", associated "project", and some other deployment parameters.
28
+ - the "release" phase : where the build / test / versioning / metadata entries / publication are done.
29
+
30
+ The fact that the init is decoupled from the release part makes it easy, the init is almost always static from version to version, so once building eUI tools, it initializes itself, clone its last version in the repository that has been pushed and after that symlinks itself on its node_modules installation, making at that time build itself as all the modules called from the release phase are now the ones of the latest commited version cloned during the init phase before.
31
+
32
+ What's the benefits ? allow new stages in the pipeline to be developed and used directly by the eUI tools themselves, this way, if there's a build failure at that level for itself, it's not shipped so it does not have any impact on others using it (basically all CSDR developers / eUI but it's safer there as the ultimate latest version of the package is not pushed constantly : only when eUI new version is released)
33
+
34
+ Another challenge here was to use the exact same build tools / installation scripts / synchronization script both for local development
35
+ and on the CI side. So when commands are executed locally, they are battle tested when it comes to execute them too on the CI.
36
+ This makes it handy for developers building locally their packages first to have the exact same result as they would have when the pipeline is executing to build and publish their code.
37
+
38
+
39
+ ## Why this exists ? bunch of bash script can do the same after all
40
+
41
+ Sure they can, but needs probably need to be a Unix expert to fully understand at first sight what's their purpose, in this agglomerated bunch of cryptic abbreviations and pipes ;)
42
+
43
+ So Javascript as the most stupid and simple language was used for the first early version, quickly became unreadable too because of its verbosity at some point for executing internal functions, promises etc...
44
+
45
+ So let's enter the black box ;)
46
+
47
+
48
+ ## Where to start ?
49
+
50
+ As it's a bin bash execution javascript library, it all starts in the **/bin** folder.
51
+
52
+ Over each bin sub-scripts (launched by eui-script SCRIPT_NAME from any eUI app root package.json).
53
+
54
+ **eui-scripts.js** is the entry point file is the "bin" files defined in the package.json. This is used for scripts execution, and handle command line parameters so :
55
+ ```
56
+ eui-scripts SCRIPT_NAME [params]
57
+ ```
58
+
59
+ Called scripts are located in **/scripts**, and basically their structure is almost always the same, if we take for example the most commonly used one : *sync*
60
+ ```
61
+ const { syncUtils } = require('../../scripts');
62
+
63
+ Promise.resolve()
64
+ .then(() => {
65
+ return syncUtils.sync();
66
+ })
67
+ .catch((e) => {
68
+ console.log(e);
69
+ process.exit(1);
70
+ })
71
+ ```
72
+ Most of the times it contains :
73
+
74
+ - **core** script import: here *syncUtils*,
75
+ - **promise wrapper**, for simplicity of the code (ok more verbose) everything is a promise in the core scripts.
76
+ - **catch** exiting the current process and displaying the exception handled or undhandled when excuting the core script.
77
+
78
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "5.2.10",
3
+ "version": "5.3.1",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
package/sandbox.js CHANGED
@@ -842,22 +842,22 @@ const versionUtils = require('./scripts/csdr/version/version-utils');
842
842
 
843
843
  // METADATA ESTING
844
844
  // --------------------
845
- const pkg = configUtils.packages.getPackage('cc-task-details-eui10-remote-el-ui');
846
- const envTarget = 'INT';
845
+ // const pkg = configUtils.packages.getPackage('cc-task-details-eui10-remote-el-ui');
846
+ // const envTarget = 'INT';
847
847
 
848
- let versionsMetadata, envsMetadata;
848
+ // let versionsMetadata, envsMetadata;
849
849
 
850
- Promise.resolve()
850
+ // Promise.resolve()
851
851
  // .then(() => {
852
852
  // return installUtils.remotes.getDeps(pkg, envTarget, 'regio');
853
853
  // })
854
854
  // .then((deps) => {
855
855
  // console.log(deps);
856
856
  // })
857
- .then(() => {
858
- // return versionUtils.packageRemote.getNewVersion(pkg, envTarget);
859
- return metadataUtils.packageHistory.generateDiffReport(pkg, envTarget);
860
- })
857
+ // .then(() => {
858
+ // // return versionUtils.packageRemote.getNewVersion(pkg, envTarget);
859
+ // return metadataUtils.packageHistory.generateDiffReport(pkg, envTarget);
860
+ // })
861
861
 
862
862
 
863
863
 
@@ -872,3 +872,11 @@ Promise.resolve()
872
872
  // .then((versions) => {
873
873
  // console.log(versions);
874
874
  // })
875
+
876
+
877
+
878
+ Promise.resolve()
879
+ .then(() => {
880
+ const prj = configUtils.projects.getProject('rsp-starter-kit');
881
+ console.log(prj);
882
+ })
@@ -14,8 +14,12 @@ const TARGET_ROOT_PATH = path.join(process.cwd(), 'packages');
14
14
  const SKELETONS_ROOT_PATH = path.join(__dirname, 'skeletons', 'package');
15
15
  const FRONTEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend');
16
16
  const FRONTEND_SKELETON_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui10');
17
+ const FRONTEND_SKELETON_EUI13_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui13');
18
+ const FRONTEND_SKELETON_EUI14_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-eui14');
17
19
  const FRONTEND_SKELETON_REMOTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote');
18
20
  const FRONTEND_SKELETON_REMOTE_EUI10_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui10');
21
+ const FRONTEND_SKELETON_REMOTE_EUI13_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui13');
22
+ const FRONTEND_SKELETON_REMOTE_EUI14_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-remote-eui14');
19
23
  const FRONTEND_OPTION_ROUTE_PATH = path.join(SKELETONS_ROOT_PATH, 'frontend-option-route');
20
24
  const BACKEND_SKELETON_PATH = path.join(SKELETONS_ROOT_PATH, 'backend');
21
25
 
@@ -32,10 +36,13 @@ const defaultConfig = {
32
36
  },
33
37
  pkgFrontendVersion: {
34
38
  DEFAULT: 'eui7',
35
- EUI10: 'eui10'
39
+ EUI10: 'eui10',
40
+ EUI13: 'eui13',
41
+ EUI14: 'eui14',
36
42
  },
37
43
  isRouteModule: true,
38
44
  isCsdrRepo: true,
45
+ isEnvTargetRemote: true,
39
46
  externalRepoName: null,
40
47
  pkgGroupId: 'eu.europa.ec.cc'
41
48
  };
@@ -78,6 +85,9 @@ const prompt = () => {
78
85
  { name: 'Remote element micro-frontend', value: defaultConfig.pkgFrontendType.REMOTE },
79
86
  ],
80
87
  default: defaultConfig.pkgFrontendType.DEFAULT,
88
+ when: function (answers) {
89
+ return (answers.pkgType === defaultConfig.pkgType.FRONTEND);
90
+ },
81
91
  validate: function (value) {
82
92
  if (value.length) {
83
93
  return true;
@@ -91,6 +101,8 @@ const prompt = () => {
91
101
  choices: [
92
102
  { name: 'v7', value: defaultConfig.pkgFrontendVersion.DEFAULT },
93
103
  { name: 'v10', value: defaultConfig.pkgFrontendVersion.EUI10 },
104
+ { name: 'v13', value: defaultConfig.pkgFrontendVersion.EUI13 },
105
+ { name: 'v14', value: defaultConfig.pkgFrontendVersion.EUI14 },
94
106
  ],
95
107
  default: defaultConfig.pkgFrontendType.DEFAULT,
96
108
  when: function (answers) {
@@ -126,6 +138,19 @@ const prompt = () => {
126
138
  );
127
139
  }
128
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
+ },
129
154
  {
130
155
  name: 'isCsdrRepo',
131
156
  type: 'confirm',
@@ -168,6 +193,14 @@ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule
168
193
  fullName += '-eui10-remote-el-ui';
169
194
  npmPkgName = `${scope}/${name}-eui10-remote-el`;
170
195
 
196
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI13) {
197
+ fullName += '-eui13-remote-el-ui';
198
+ npmPkgName = `${scope}/${name}-eui13-remote-el`;
199
+
200
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
201
+ fullName += '-eui14-remote-el-ui';
202
+ npmPkgName = `${scope}/${name}-eui14-remote-el`;
203
+
171
204
  } else {
172
205
  fullName += '-remote-el-ui';
173
206
  npmPkgName = `${scope}/${name}-remote-el`;
@@ -206,12 +239,31 @@ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule
206
239
  if (frontendType === defaultConfig.pkgFrontendType.REMOTE) {
207
240
  if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
208
241
  return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
242
+
243
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI13) {
244
+ tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
245
+ return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI13_PATH, targetPath, true);
246
+
247
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
248
+ tools.copydir(FRONTEND_SKELETON_REMOTE_EUI10_PATH, targetPath, true);
249
+ return tools.copydir(FRONTEND_SKELETON_REMOTE_EUI14_PATH, targetPath, true);
250
+
209
251
  } else {
210
252
  return tools.copydir(FRONTEND_SKELETON_REMOTE_PATH, targetPath, true);
211
253
  }
254
+
212
255
  } else {
213
256
  if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI10) {
214
257
  return tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
258
+
259
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI13) {
260
+ tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
261
+ return tools.copydir(FRONTEND_SKELETON_EUI13_PATH, targetPath, true);
262
+
263
+ } else if (frontendVersion === defaultConfig.pkgFrontendVersion.EUI14) {
264
+ tools.copydir(FRONTEND_SKELETON_EUI10_PATH, targetPath, true);
265
+ return tools.copydir(FRONTEND_SKELETON_EUI14_PATH, targetPath, true);
266
+
215
267
  } else {
216
268
  return tools.copydir(FRONTEND_SKELETON_PATH, targetPath, true);
217
269
  }
@@ -267,7 +319,7 @@ const buildFrontend = (name, scope, frontendType, frontendVersion, isRouteModule
267
319
  return configUtils.angular.registerModulePaths(pkg);
268
320
  })
269
321
  .then(() => {
270
- return configUtils.global.registerCsdrPackage(pkg, frontendType === defaultConfig.pkgFrontendType.REMOTE);
322
+ return configUtils.global.registerCsdrPackage(pkg, frontendType === defaultConfig.pkgFrontendType.REMOTE, scope, name);
271
323
  })
272
324
 
273
325
  .then(() => {
@@ -0,0 +1,3 @@
1
+ {
2
+ "@eui/deps-base": "^10.0.0"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "@eui/deps-base": "^13.0.0"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "@eui/deps-base": "^14.0.0"
3
+ }
@@ -0,0 +1,2 @@
1
+ export * from './lib/module';
2
+ export * from './lib/routing.module';
@@ -1,6 +1,6 @@
1
1
  import { NgModule } from '@angular/core';
2
2
 
3
- import { RoutingModule } from './module-routing.module';
3
+ import { RoutingModule } from './routing.module';
4
4
 
5
5
  import { Cmp1Component } from './components/cmp1/cmp1.component';
6
6
 
@@ -14,4 +14,4 @@ import { Cmp1Component } from './components/cmp1/cmp1.component';
14
14
  exports: [
15
15
  ],
16
16
  })
17
- export class ModuleModule { }
17
+ export class CommonModule { }
@@ -1,10 +1,6 @@
1
- # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2
- # For additional information regarding the format and rule options, please see:
3
- # https://github.com/browserslist/browserslist#queries
4
- # For IE 9-11 support, please uncomment the last line of the file and adjust as needed
5
- > 0.5%
6
- last 2 versions
1
+ last 1 Chrome version
2
+ last 1 Firefox version
3
+ last 2 Edge major versions
4
+ last 2 Safari major versions
5
+ last 2 iOS major versions
7
6
  Firefox ESR
8
- not dead
9
- IE 9-11
10
-
@@ -62,3 +62,4 @@ package-lock.json
62
62
  **/_trash
63
63
 
64
64
  **/test/reports/
65
+ /src
@@ -46,8 +46,7 @@ import { CustomSerializer } from './reducers/custom-route-serializer';
46
46
  import { environment } from '../environments/environment';
47
47
  import { appConfig } from '../config';
48
48
 
49
- // TODO[REMOTE-SETUP] adapt to wrapped package import
50
- // import { TaskMgrCommonModule } from '@cc/task-manager';
49
+ import { Module as RootPackageCommonModule } from '@module.scope@/@module.name@';
51
50
  import {
52
51
  ELEMENT_ROUTER_TOKEN,
53
52
  I18N_SERVICE_HOST_TOKEN,
@@ -87,8 +86,7 @@ export function openidConnectInterceptorFactory(config) {
87
86
  EuiButtonModule,
88
87
  EuiLabelModule,
89
88
 
90
- // TODO[REMOTE-SETUP] adapt to wrapped package import
91
- // TaskMgrCommonModule,
89
+ RootPackageCommonModule,
92
90
  RoutingModule,
93
91
  ],
94
92
  declarations: [
@@ -5,8 +5,7 @@ import { filter, distinctUntilChanged } from 'rxjs/operators';
5
5
 
6
6
  import { CCRoute, ELEMENT_ROUTER_TOKEN, IRouterService } from '@csdr/integration';
7
7
 
8
- // TODO[REMOTE-SETUP] adapt to wrapped package import
9
- // import { routes } from '@cc/task-manager';
8
+ import { routes } from '@module.scope@/@module.name@';
10
9
  import { appConfig } from '../config/index';
11
10
  import { FallbackComponent } from './fallback.component';
12
11
  import { ModuleComponent } from './module.component';
@@ -15,8 +14,7 @@ const prefixedRoutes: Routes = [
15
14
  { path: '', component: ModuleComponent },
16
15
  {
17
16
  path: appConfig.global.baseUrl,
18
- // TODO[REMOTE-SETUP] adapt to wrapped package import
19
- // children: routes,
17
+ children: routes,
20
18
  },
21
19
  { path: '**', component: FallbackComponent },
22
20
  ];
@@ -0,0 +1,6 @@
1
+ {
2
+ "@eui/deps-base": "^13.0.0",
3
+
4
+ "@csdr/core": "^3.0.0",
5
+ "@csdr/integration": "^3.0.0"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "@eui/deps-base": "^14.0.0",
3
+
4
+ "@csdr/core": "^3.0.0",
5
+ "@csdr/integration": "^3.0.0"
6
+ }
@@ -457,7 +457,7 @@ module.exports.registerCsdrProject = (name, isFullSkeleton) => {
457
457
 
458
458
  // Register newly created package
459
459
 
460
- module.exports.registerCsdrPackage = (pkg, isRemote) => {
460
+ module.exports.registerCsdrPackage = (pkg, isRemote, rootPkgScope, rootPkgName) => {
461
461
 
462
462
  const csdrConfigPackage = {
463
463
  "name": "@module.full.name@",
@@ -484,10 +484,20 @@ module.exports.registerCsdrPackage = (pkg, isRemote) => {
484
484
  ],
485
485
  "build": {
486
486
  "compiledTranslations": true,
487
- "translationScopes": "eui,csdr,cc"
487
+ "translationScopes": "eui,csdr,cc,mywp",
488
+ "skipLint": true,
489
+ "skipTest": true,
490
+ "envTargetActive": true
491
+ },
492
+ "release": {
493
+ "team": "cc-ui-rm"
488
494
  },
489
495
  "slack": {
490
496
  "channel": "csdr-timeline-mwp-remotes-cc"
497
+ },
498
+ "externalSources": {
499
+ "npmPkg": "@module.rootPkg.scope@/@module.rootPkg.name@",
500
+ "folder": "assets/remote-sources"
491
501
  }
492
502
  }
493
503
 
@@ -504,6 +514,8 @@ module.exports.registerCsdrPackage = (pkg, isRemote) => {
504
514
  let replaceModule = tools.replaceAll(packageDef, '@module.full.name@', pkg.name);
505
515
  replaceModule = tools.replaceAll(replaceModule, '@module.repo.name@', pkg.repoName);
506
516
  replaceModule = tools.replaceAll(replaceModule, '@module.npmPkg.name@', pkg.npmPkgName);
517
+ replaceModule = tools.replaceAll(replaceModule, '@module.rootPkg.scope@', rootPkgScope);
518
+ replaceModule = tools.replaceAll(replaceModule, '@module.rootPkg.name@', rootPkgName);
507
519
 
508
520
  let file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
509
521
  let jsonFile = require(file);
@@ -35,10 +35,30 @@ const getProjectOptions = (prj) => {
35
35
  return { options: options };
36
36
  }
37
37
 
38
+ const getProjectPaths = (prj) => {
39
+ const rootPath = path.join(process.cwd(), prj.folder);
40
+ let angularPath = rootPath;
41
+ if (prj.build && prj.build.maven) {
42
+ angularPath = path.join(rootPath, 'src/main/angular');
43
+ }
44
+ const elementsPath = path.join(angularPath, 'src', 'assets', 'elements');
38
45
 
39
- const getProjects = module.exports.getProjects = () => {
40
- const projects = innerGlobal.getConfig().projects;
41
- return Object.keys(projects).map(p => this.getProject(p));
46
+ let installPath = process.cwd();
47
+ let nodeModulesPath = path.join(process.cwd(), 'node_modules');
48
+ if (prj.standalone) {
49
+ installPath = path.join(rootPath);
50
+ nodeModulesPath = path.join(rootPath, 'node_modules');
51
+ }
52
+
53
+ const paths = {
54
+ rootPath: rootPath,
55
+ angularPath: angularPath,
56
+ elementsPath: elementsPath,
57
+ installPath: installPath,
58
+ nodeModulesPath: nodeModulesPath,
59
+ };
60
+
61
+ return { paths: paths };
42
62
  }
43
63
 
44
64
 
@@ -66,21 +86,10 @@ module.exports.getProject = (projectName) => {
66
86
 
67
87
  if (prj) {
68
88
  prj.rootName = projectName;
69
- const rootPath = path.join(process.cwd(), prj.folder);
70
- let angularPath = rootPath;
71
- if (prj.build && prj.build.maven) {
72
- angularPath = path.join(rootPath, 'src/main/angular');
73
- }
74
- const elementsPath = path.join(angularPath, 'src', 'assets', 'elements');
75
-
76
- prj.paths = {
77
- rootPath: rootPath,
78
- angularPath: angularPath,
79
- elementsPath: elementsPath
80
- };
81
89
 
82
90
  return {
83
91
  ...prj,
92
+ ...getProjectPaths(prj),
84
93
  ...getProjectMetadataDefs(projectName),
85
94
  ...getProjectOptions(prj)
86
95
  }
@@ -93,30 +102,21 @@ module.exports.getCsdrProject = (projectName) => {
93
102
  const prj = innerGlobal.getCsdrConfig(false).projects[projectName];
94
103
 
95
104
  if (prj) {
96
-
97
105
  prj.rootName = projectName;
98
- const rootPath = path.join(process.cwd(), prj.folder);
99
- let angularPath = rootPath;
100
- if (prj.build && prj.build.maven) {
101
- angularPath = path.join(rootPath, 'src/main/angular');
102
- }
103
- const elementsPath = path.join(angularPath, 'src', 'assets', 'elements');
104
-
105
- prj.paths = {
106
- rootPath: rootPath,
107
- angularPath: angularPath,
108
- elementsPath: elementsPath
109
- };
110
106
 
111
107
  return {
112
108
  ...prj,
109
+ ...getProjectPaths(prj),
113
110
  ...getProjectMetadataDefs(projectName),
114
111
  ...getProjectOptions(prj)
115
112
  }
116
113
  }
117
114
  }
118
115
 
119
-
116
+ const getProjects = module.exports.getProjects = () => {
117
+ const projects = innerGlobal.getConfig().projects;
118
+ return Object.keys(projects).map(p => this.getProject(p));
119
+ }
120
120
 
121
121
  module.exports.getCsdrProjects = () => {
122
122
 
@@ -11,7 +11,11 @@ module.exports.install = (prj, envTarget, compositeType) => {
11
11
  return Promise.resolve()
12
12
  // checking remotes
13
13
  .then(() => {
14
- return innerProjects.installDeps(prj, envTarget, compositeType);
14
+ if (prj.standAlone) {
15
+ return innerProjects.installDepsStandalone(prj);
16
+ } else {
17
+ return innerProjects.installDeps(prj, envTarget, compositeType);
18
+ }
15
19
  })
16
20
 
17
21
  // returning metadata dependencies
@@ -75,3 +75,14 @@ module.exports.installDeps = (prj, envTarget, compositeType) => {
75
75
  throw e;
76
76
  })
77
77
  }
78
+
79
+ module.exports.installDepsStandalone = (prj) => {
80
+ return Promise.resolve()
81
+ .then(() => {
82
+ return innerCommon.executeInstall(prj.paths.installPath);
83
+ })
84
+
85
+ .catch((e) => {
86
+ throw e;
87
+ })
88
+ }
@@ -0,0 +1,147 @@
1
+ 'use strict';
2
+
3
+ // utils
4
+ module.exports.changelogUtils = require('./utils/changelog-utils');
5
+ module.exports.gitUtils = require('./utils/git-utils');
6
+ module.exports.mavenUtils = require('./utils/maven-utils');
7
+ module.exports.pipelineUtils = require('./utils/pipeline-utils');
8
+ module.exports.tools = require('./utils/tools');
9
+
10
+ // utils - a11y
11
+ module.exports.a11yUtils = require('./utils/a11y/app');
12
+
13
+ // utils - build - app
14
+ module.exports.buildAppUtils = require('./utils/build/app/build-app-utils');
15
+
16
+ // utils - build - package
17
+ module.exports.buildPackageAngular = require('./utils/build/package/angular')
18
+ module.exports.buildPackageBuildAll = require('./utils/build/package/build-all')
19
+ module.exports.buildPackageUtils = require('./utils/build/package/build-package-utils');
20
+ module.exports.buildPackageUtils = require('./utils/build/package/build-package-utils')
21
+ module.exports.buildPackageElement = require('./utils/build/package/element')
22
+ module.exports.buildPackageMaven = require('./utils/build/package/maven')
23
+ module.exports.buildPackageNestJs = require('./utils/build/package/nestJs')
24
+ module.exports.buildPackageNodeJs = require('./utils/build/package/nodeJs')
25
+ module.exports.buildPackagePostCssConfig = require('./utils/build/package/postcss.config')
26
+ module.exports.buildPackageStencil = require('./utils/build/package/stencil')
27
+ module.exports.buildPackageStyles = require('./utils/build/package/styles')
28
+
29
+ // utils - clean
30
+ module.exports.cleanAll = require('./utils/clean/clean-all');
31
+ module.exports.cleanUtils = require('./utils/clean/clean-utils');
32
+
33
+ // utils - notification
34
+ module.exports.notificationCommon = require('./utils/notification/common');
35
+ module.exports.notificationConfig = require('./utils/notification/config');
36
+ module.exports.notificationMailUtils = require('./utils/notification/mail-utils');
37
+ module.exports.notificationMailStack = require('./utils/notification/mailstack');
38
+ module.exports.notificationUtils = require('./utils/notification/notification-utils');
39
+ module.exports.notificationPackage = require('./utils/notification/package');
40
+ module.exports.notificationProject = require('./utils/notification/project');
41
+ module.exports.notificationSlackUtils = require('./utils/notification/slack-utils');
42
+
43
+ // utils - pre-build
44
+ module.exports.prebuildUtilsElements = require('./utils/pre-build/elements');
45
+ module.exports.prebuildUtils = require('./utils/pre-build/pre-build-utils');
46
+ module.exports.prebuildUtilsProjects = require('./utils/pre-build/projects');
47
+
48
+ // utils -pre-build - injection
49
+ module.exports.prebuildInjectionUtils = require('./utils/pre-build/injection/injection-utils');
50
+ module.exports.prebuildInjectionConfig = require('./utils/pre-build/injection/config');
51
+ module.exports.prebuildInjectionSkeletons = require('./utils/pre-build/injection/skeletons');
52
+ module.exports.prebuildInjectionExternals = require('./utils/pre-build/injection/externals');
53
+ module.exports.prebuildInjectionRoutesReplacement = require('./utils/pre-build/injection/routes-replacement');
54
+
55
+ // utils -pre-build - translations
56
+ module.exports.prebuildTranslationUtils = require('./utils/pre-build/translations/translation-utils');
57
+ module.exports.prebuildTranslationsElements = require('./utils/pre-build/translations/elements');
58
+ module.exports.prebuildTranslationsProjects = require('./utils/pre-build/translations/projects');
59
+
60
+
61
+ // utils - publish
62
+ module.exports.publishMaven = require('./utils/publish/maven');
63
+ module.exports.publishNpm = require('./utils/publish/npm');
64
+ module.exports.publishAll = require('./utils/publish/publish-all');
65
+ module.exports.publishUtils = require('./utils/publish/publish-utils');
66
+
67
+ // utils - serve - test
68
+ module.exports.serveApp = require('./utils/serve/app');
69
+ module.exports.serveElement = require('./utils/serve/element');
70
+ module.exports.testUtils = require('./utils/test/test-utils');
71
+
72
+ // utils - sonar
73
+ module.exports.sonarUtils = require('./utils/sonar/sonar-utils');
74
+
75
+
76
+ // csdr - audit
77
+ module.exports.auditUtils = require('./csdr/audit/audit-utils');
78
+
79
+ // csdr - cli
80
+ module.exports.cliUtils = require('./csdr/cli/cli-utils');
81
+ module.exports.cliApp = require('./csdr/cli/app');
82
+ module.exports.cliPackage = require('./csdr/cli/package');
83
+
84
+ // csdr - config
85
+ module.exports.configAngular = require('./csdr/config/angular');
86
+ module.exports.configUtils = require('./csdr/config/config-utils');
87
+ module.exports.configGlobal = require('./csdr/config/global');
88
+ module.exports.configInit = require('./csdr/config/init');
89
+ module.exports.configPackages = require('./csdr/config/packages');
90
+ module.exports.configProjects = require('./csdr/config/projects');
91
+ module.exports.configSync = require('./csdr/config/sync');
92
+
93
+ // csdr -init
94
+ module.exports.init = require('./csdr/init/init');
95
+ module.exports.initUtils = require('./csdr/init/init-utils');
96
+ module.exports.initMeta = require('./csdr/init/meta');
97
+ module.exports.initPrompt = require('./csdr/init/prompt');
98
+ module.exports.initRepos = require('./csdr/init/repos');
99
+
100
+ // csdr - install
101
+ module.exports.installBuildApp = require('./csdr/install/build-app');
102
+ module.exports.installBuildPackage = require('./csdr/install/build-package');
103
+ module.exports.installCommon = require('./csdr/install/common');
104
+ module.exports.installCompositeCore = require('./csdr/install/composite-core');
105
+ module.exports.installUtils = require('./csdr/install/install-utils');
106
+ module.exports.installLocalDev = require('./csdr/install/local-dev');
107
+ module.exports.installPackages = require('./csdr/install/packages');
108
+ module.exports.installProjects = require('./csdr/install/projects');
109
+ module.exports.installRemotes = require('./csdr/install/remotes');
110
+
111
+ // csdr - metadata
112
+ module.exports.metadataAppEnvs = require('./csdr/metadata/app-envs');
113
+ module.exports.metadataAppHistory = require('./csdr/metadata/app-history');
114
+ module.exports.metadataAppVersions = require('./csdr/metadata/app-versions');
115
+ module.exports.metadataApp = require('./csdr/metadata/app');
116
+ module.exports.mMetadataCommit = require('./csdr/metadata/commit');
117
+ module.exports.mMetadataCommon = require('./csdr/metadata/common');
118
+ module.exports.mMetadataUtils = require('./csdr/metadata/metadata-utils');
119
+ module.exports.metadataPackageEnvs = require('./csdr/metadata/package-envs');
120
+ module.exports.metadataPackageHistory = require('./csdr/metadata/package-history');
121
+ module.exports.metadataPackageVersions = require('./csdr/metadata/package-versions');
122
+ module.exports.metadataPackage = require('./csdr/metadata/package');
123
+ module.exports.metadataStats = require('./csdr/metadata/stats');
124
+
125
+ // csdr - release
126
+ module.exports.realeaseApp = require('./csdr/release/app/release-app');
127
+ module.exports.releasePackageBackend = require('./csdr/release/package/backend');
128
+ module.exports.releasePackageCommon = require('./csdr/release/package/common');
129
+ module.exports.releasePackage = require('./csdr/release/package/release-package');
130
+ module.exports.releasePackageRemote = require('./csdr/release/package/remote');
131
+ module.exports.releasePackageUi = require('./csdr/release/package/ui');
132
+
133
+ // csdr - sync
134
+ module.exports.syncUtils = require('./csdr/sync/sync-utils');
135
+
136
+ // csdr - template
137
+ module.exports.templateUtils = require('./csdr/templates/template-utils');
138
+
139
+ // csdr - version
140
+ module.exports.versionAppDefault = require('./csdr/version/app-default');
141
+ module.exports.versionAppEnvTarget = require('./csdr/version/app-env-target');
142
+ module.exports.versionApp = require('./csdr/version/app');
143
+ module.exports.versionCommon = require('./csdr/version/common');
144
+ module.exports.versionPackageDefault = require('./csdr/version/package-default');
145
+ module.exports.versionPackageRemote = require('./csdr/version/package-remote');
146
+ module.exports.versionPackage = require('./csdr/version/package');
147
+ module.exports.versionUtils = require('./csdr/version/version-utils');
@@ -0,0 +1,7 @@
1
+ const { expect, assert } = require('chai');
2
+
3
+ describe('eUI tools - global index imports', () => {
4
+ it('should not fail', () => {
5
+ const scripts = require('./index');
6
+ })
7
+ })
@@ -35,10 +35,10 @@ const getProjectInfos = () => {
35
35
 
36
36
  module.exports.angular = (envTarget, isSnapshot, version, configEnvTargetIn) => {
37
37
 
38
- const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
39
-
40
38
  const currentProject = getProjectInfos();
41
39
 
40
+ const ng = path.resolve(currentProject.paths.nodeModulesPath, '@angular', 'cli', 'bin', 'ng');
41
+
42
42
  // checking if configEnvTarget is passed as param, if not take the global script param
43
43
  // as this angular build method can be called in stand-alone (outside of CSDR pipeline flow)
44
44
  if (configEnvTargetIn) {
package/global.test.js DELETED
@@ -1,152 +0,0 @@
1
- const { expect, assert } = require('chai');
2
-
3
- describe('eUI tools - test imports', () => {
4
- it('should not fail', () => {
5
-
6
- // utils
7
- const changelogUtils = require('./scripts/utils/changelog-utils');
8
- const gitUtils = require('./scripts/utils/git-utils');
9
- const mavenUtils = require('./scripts/utils/maven-utils');
10
- const pipelineUtils = require('./scripts/utils/pipeline-utils');
11
- const tools = require('./scripts/utils/tools');
12
-
13
- // utils - a11y
14
- const a11yUtils = require('./scripts/utils/a11y/app');
15
-
16
- // utils - build - app
17
- const buildAppUtils = require('./scripts/utils/build/app/build-app-utils');
18
-
19
- // utils - build - package
20
- const csdrBuildPackageAngular = require('./scripts/utils/build/package/angular')
21
- const csdrBuildPackageBuildAll = require('./scripts/utils/build/package/build-all')
22
- const buildPackageUtils = require('./scripts/utils/build/package/build-package-utils');
23
- const csdrBuildPackageUtils = require('./scripts/utils/build/package/build-package-utils')
24
- const csdrBuildPackageElement = require('./scripts/utils/build/package/element')
25
- const csdrBuildPackageMaven = require('./scripts/utils/build/package/maven')
26
- const csdrBuildPackageNestJs = require('./scripts/utils/build/package/nestJs')
27
- const csdrBuildPackageNodeJs = require('./scripts/utils/build/package/nodeJs')
28
- const csdrBuildPackagePostCssConfig = require('./scripts/utils/build/package/postcss.config')
29
- const csdrBuildPackageStencil = require('./scripts/utils/build/package/stencil')
30
- const csdrBuildPackageStyles = require('./scripts/utils/build/package/styles')
31
-
32
- // utils - clean
33
- const cleanAll = require('./scripts/utils/clean/clean-all');
34
- const cleanUtils = require('./scripts/utils/clean/clean-utils');
35
-
36
- // utils - notification
37
- const notificationCommon = require('./scripts/utils/notification/common');
38
- const notificationUtils = require('./scripts/utils/notification/notification-utils');
39
- const notificationSlackUtils = require('./scripts/utils/notification/slack-utils');
40
- const notificationMailUtils = require('./scripts/utils/notification/mail-utils');
41
- const notificationConfig = require('./scripts/utils/notification/mail-utils');
42
- const notificationMailStack = require('./scripts/utils/notification/mailstack');
43
- const notificationPackage = require('./scripts/utils/notification/package');
44
- const notificationProject = require('./scripts/utils/notification/project');
45
-
46
- // utils - pre-build
47
- const prebuildUtils = require('./scripts/utils/pre-build/pre-build-utils');
48
- const prebuildUtilsElements = require('./scripts/utils/pre-build/elements');
49
- const prebuildUtilsProjects = require('./scripts/utils/pre-build/projects');
50
-
51
- // utils -pre-build - injection
52
- const prebuildInjectionUtils = require('./scripts/utils/pre-build/injection/injection-utils');
53
- const prebuildInjectionConfig = require('./scripts/utils/pre-build/injection/config');
54
- const prebuildInjectionSkeletons = require('./scripts/utils/pre-build/injection/skeletons');
55
- const prebuildInjectionExternals = require('./scripts/utils/pre-build/injection/externals');
56
- const prebuildInjectionRoutesReplacement = require('./scripts/utils/pre-build/injection/routes-replacement');
57
-
58
- // utils -pre-build - translations
59
- const prebuildTranslationUtils = require('./scripts/utils/pre-build/translations/translation-utils');
60
- const prebuildTranslationsElements = require('./scripts/utils/pre-build/translations/elements');
61
- const prebuildTranslationsProjects = require('./scripts/utils/pre-build/translations/projects');
62
-
63
-
64
- // utils - publish
65
- const publishMaven = require('./scripts/utils/publish/maven');
66
- const publishNpm = require('./scripts/utils/publish/npm');
67
- const publishAll = require('./scripts/utils/publish/publish-all');
68
- const publishUtils = require('./scripts/utils/publish/publish-utils');
69
-
70
- // utils - serve - test
71
- const serveApp = require('./scripts/utils/serve/app');
72
- const serveElement = require('./scripts/utils/serve/element');
73
- const testUtils = require('./scripts/utils/test/test-utils');
74
-
75
- // utils - sonar
76
- const sonarUtils = require('./scripts/utils/sonar/sonar-utils');
77
-
78
-
79
- // csdr - audit
80
- const csdrAuditUtils = require('./scripts/csdr/audit/audit-utils');
81
-
82
- // csdr - cli
83
- const csdrCliUtils = require('./scripts/csdr/cli/cli-utils');
84
- const csdrCliApp = require('./scripts/csdr/cli/app');
85
- const csdrCliPackage = require('./scripts/csdr/cli/package');
86
-
87
- // csdr - config
88
- const csdrConfigAngular = require('./scripts/csdr/config/angular');
89
- const csdrConfigUtils = require('./scripts/csdr/config/config-utils');
90
- const csdrConfigGlobal = require('./scripts/csdr/config/global');
91
- const csdrConfigInit = require('./scripts/csdr/config/init');
92
- const csdrConfigPackages = require('./scripts/csdr/config/packages');
93
- const csdrConfigProjects = require('./scripts/csdr/config/projects');
94
- const csdrConfigSync = require('./scripts/csdr/config/sync');
95
-
96
- // csdr -init
97
- const csdrInit = require('./scripts/csdr/init/init');
98
- const csdrInitUtils = require('./scripts/csdr/init/init-utils');
99
- const csdrInitMeta = require('./scripts/csdr/init/meta');
100
- const csdrInitPrompt = require('./scripts/csdr/init/prompt');
101
- const csdrInitRepos = require('./scripts/csdr/init/repos');
102
-
103
- // csdr - install
104
- const csdrInstallBuildApp = require('./scripts/csdr/install/build-app');
105
- const csdrInstallBuildPackage = require('./scripts/csdr/install/build-package');
106
- const csdrInstallCommon = require('./scripts/csdr/install/common');
107
- const csdrInstallCompositeCore = require('./scripts/csdr/install/composite-core');
108
- const csdrInstallUtils = require('./scripts/csdr/install/install-utils');
109
- const csdrInstallLocalDev = require('./scripts/csdr/install/local-dev');
110
- const csdrInstallPackages = require('./scripts/csdr/install/packages');
111
- const csdrInstallProjects = require('./scripts/csdr/install/projects');
112
- const csdrInstallRemotes = require('./scripts/csdr/install/remotes');
113
-
114
- // csdr - metadata
115
- const csdrMetadataAppEnvs = require('./scripts/csdr/metadata/app-envs');
116
- const csdrMetadataAppHistory = require('./scripts/csdr/metadata/app-history');
117
- const csdrMetadataAppVersions = require('./scripts/csdr/metadata/app-versions');
118
- const csdrMetadataApp = require('./scripts/csdr/metadata/app');
119
- const csdrMetadataCommit = require('./scripts/csdr/metadata/commit');
120
- const csdrMetadataCommon = require('./scripts/csdr/metadata/common');
121
- const csdrMetadataUtils = require('./scripts/csdr/metadata/metadata-utils');
122
- const csdrMetadataPackageEnvs = require('./scripts/csdr/metadata/package-envs');
123
- const csdrMetadataPackageHistory = require('./scripts/csdr/metadata/package-history');
124
- const csdrMetadataPackageVersions = require('./scripts/csdr/metadata/package-versions');
125
- const csdrMetadataPackage = require('./scripts/csdr/metadata/package');
126
- const csdrMetadataStats = require('./scripts/csdr/metadata/stats');
127
-
128
- // csdr - release
129
- const csdrRealeaseApp = require('./scripts/csdr/release/app/release-app');
130
- const csdrReleasePackageBackend = require('./scripts/csdr/release/package/backend');
131
- const csdrReleasePackageCommon = require('./scripts/csdr/release/package/common');
132
- const csdrReleasePackage = require('./scripts/csdr/release/package/release-package');
133
- const csdrReleasePackageRemote = require('./scripts/csdr/release/package/remote');
134
- const csdrReleasePackageUi = require('./scripts/csdr/release/package/ui');
135
-
136
- // csdr - sync
137
- const csdrSyncUtils = require('./scripts/csdr/sync/sync-utils');
138
-
139
- // csdr - template
140
- const csdrTemplateUtils = require('./scripts/csdr/templates/template-utils');
141
-
142
- // csdr - version
143
- const csdrVersionAppDefault = require('./scripts/csdr/version/app-default');
144
- const csdrVersionAppEnvTarget = require('./scripts/csdr/version/app-env-target');
145
- const csdrVersionApp = require('./scripts/csdr/version/app');
146
- const csdrVersionCommon = require('./scripts/csdr/version/common');
147
- const csdrVersionPackageDefault = require('./scripts/csdr/version/package-default');
148
- const csdrVersionPackageRemote = require('./scripts/csdr/version/package-remote');
149
- const csdrVersionPackage = require('./scripts/csdr/version/package');
150
- const csdrVersionUtils = require('./scripts/csdr/version/version-utils');
151
- })
152
- })