@eui/tools 6.7.0 → 6.7.2

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 (60) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/package.json +1 -1
  4. package/scripts/app/public/index.html +5 -5
  5. package/scripts/app/public/index.js +6 -6
  6. package/scripts/app/public/package-init.html +11 -0
  7. package/scripts/app/public/package-init.js +2 -0
  8. package/scripts/csdr/cli/package-build-frontend.js +5 -1
  9. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/.eslintrc.json +79 -0
  10. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/en.json +6 -0
  11. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/assets/i18n/fr.json +6 -0
  12. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-base.json +2 -0
  13. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dependencies-composite.json +3 -0
  14. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/gitignore_TO_REPLACE +46 -0
  15. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/karma.conf.js +7 -0
  16. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/ng-package.json +7 -0
  17. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/package.json +4 -0
  18. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/index.ts +4 -0
  19. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/module.ts +1 -1
  20. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/components/sample.component.ts +14 -0
  21. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/constants.ts +1 -0
  22. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/block-store.service.ts +3 -3
  23. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/containers/decide.container.ts → src/lib/main/containers/container.component.ts} +7 -7
  24. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/containers/generic-block-resolver.service.ts +5 -5
  25. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block-type.model.ts +6 -0
  26. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/block.model.ts +10 -0
  27. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/models/index.ts +2 -0
  28. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/module.ts +5 -5
  29. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/lib/main/store/actions/block.actions.ts +26 -0
  30. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/block.reducer.ts +8 -8
  31. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/reducers/index.ts +1 -1
  32. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main → src/lib/main}/store/selectors/block.selectors.ts +3 -3
  33. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{module.ts → src/lib/module.ts} +3 -3
  34. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/src/test.ts.TO_REPLACE +21 -0
  35. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.lib.json +32 -0
  36. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/tsconfig.spec.json +17 -0
  37. package/scripts/csdr/config/init.js +45 -2
  38. package/scripts/csdr/init/init-custom.js +54 -0
  39. package/scripts/csdr/init/init-old.js +210 -0
  40. package/scripts/csdr/init/init-package.js +63 -0
  41. package/scripts/csdr/init/init-project.js +103 -0
  42. package/scripts/csdr/init/init-remote.js +47 -0
  43. package/scripts/csdr/init/init-utils.js +3 -0
  44. package/scripts/csdr/init/init.js +19 -111
  45. package/scripts/utils/pre-build/injection/externals.js +13 -12
  46. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/dummy.spec.ts +0 -5
  47. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/index.ts +0 -4
  48. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/components/decide.component.ts +0 -14
  49. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/constants.ts +0 -1
  50. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block-type.model.ts +0 -6
  51. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/decide-block.model.ts +0 -10
  52. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/models/index.ts +0 -2
  53. package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/main/store/actions/block.actions.ts +0 -26
  54. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/{default/src/lib/dummy.spec.ts → participant/src/dummy.spec.ts.TO_REPLACE} +0 -0
  55. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.html +0 -0
  56. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/components/sample.component.ts +0 -0
  57. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/containers/container.component.ts +0 -0
  58. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/block.model.ts +0 -0
  59. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{blocks → src/lib/blocks}/sample/models/index.ts +0 -0
  60. /package/scripts/csdr/cli/skeletons/package/frontend/15.x/participant/{main/components/decide.component.html → src/lib/main/components/sample.component.html} +0 -0
@@ -0,0 +1,21 @@
1
+ // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
+
3
+ import 'zone.js/dist/zone';
4
+ import 'zone.js/dist/zone-testing';
5
+ import { getTestBed } from '@angular/core/testing';
6
+ import {
7
+ BrowserDynamicTestingModule,
8
+ platformBrowserDynamicTesting
9
+ } from '@angular/platform-browser-dynamic/testing';
10
+
11
+ declare const require: any;
12
+
13
+ // First, initialize the Angular testing environment.
14
+ getTestBed().initTestEnvironment(
15
+ BrowserDynamicTestingModule,
16
+ platformBrowserDynamicTesting()
17
+ );
18
+ // Then we find all the tests.
19
+ const context = require.context('./', true, /\.spec\.ts$/);
20
+ // And load the modules.
21
+ context.keys().map(context);
@@ -0,0 +1,32 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/lib",
5
+ "target": "ES2022",
6
+ "module": "ES2022",
7
+ "moduleResolution": "node",
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "inlineSources": true,
11
+ "emitDecoratorMetadata": true,
12
+ "experimentalDecorators": true,
13
+ "importHelpers": true,
14
+ "types": [],
15
+ "lib": [
16
+ "ES2022",
17
+ "dom"
18
+ ]
19
+ },
20
+ "angularCompilerOptions": {
21
+ "annotateForClosureCompiler": true,
22
+ "skipTemplateCodegen": true,
23
+ "strictMetadataEmit": true,
24
+ "fullTemplateTypeCheck": true,
25
+ "strictInjectionParameters": true,
26
+ "enableResourceInlining": true
27
+ },
28
+ "exclude": [
29
+ "src/test.ts",
30
+ "**/*.spec.ts"
31
+ ]
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/spec",
5
+ "types": [
6
+ "jasmine",
7
+ "node"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }
@@ -15,6 +15,47 @@ const innerGlobal = require('./global');
15
15
 
16
16
 
17
17
  module.exports.run = (args) => {
18
+ return Promise.resolve()
19
+ .then(() => {
20
+ if (args.custom) {
21
+ return initConfigCustom();
22
+
23
+ } else {
24
+ return initConfigCore(args);
25
+ }
26
+ })
27
+
28
+ .catch((e) => {
29
+ throw e;
30
+ })
31
+ }
32
+
33
+
34
+ const initConfigCustom = () => {
35
+ return Promise.resolve()
36
+ .then(() => {
37
+ tools.logInfo('Updating local configuration - custom init');
38
+
39
+ const customConfig = innerGlobal.getCustomConfig();
40
+
41
+ if (!customConfig) {
42
+ throw new Error('Custom config not found... run the command "npm run init:custom" to generate your customized config');
43
+ }
44
+
45
+ return innerGlobal.updateConfig({
46
+ project: customConfig.project,
47
+ packages: customConfig.packages,
48
+ remotes: customConfig.remotes,
49
+ reset: true
50
+ });
51
+ })
52
+ .catch((e) => {
53
+ throw e;
54
+ })
55
+ }
56
+
57
+
58
+ const initConfigCore = (args) => {
18
59
  return Promise.resolve()
19
60
  .then(() => {
20
61
  tools.logInfo('Updating local configuration')
@@ -28,14 +69,13 @@ module.exports.run = (args) => {
28
69
 
29
70
  if (args.remote) {
30
71
  const remote = innerRemotes.getCsdrRemotes()[args.remote];
31
- if (remote) {
72
+ if (remote) {
32
73
  remotes.push(args.remote);
33
74
  }
34
75
  }
35
76
 
36
77
  return innerGlobal.updateConfig({ project: args.project, packages: packages, remotes: remotes, reset: args.reset });
37
78
  })
38
-
39
79
  .catch((e) => {
40
80
  throw e;
41
81
  })
@@ -44,6 +84,9 @@ module.exports.run = (args) => {
44
84
 
45
85
 
46
86
 
87
+
88
+
89
+
47
90
  const getInputPackages = (project, pkg, team, prjOnly, containerOnly) => {
48
91
  tools.logInfo('Gathering team packages');
49
92
 
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ const tools = require('../../utils/tools');
4
+ const configUtils = require('../config/config-utils');
5
+
6
+ const innerInitProject = require('./init-project');
7
+ const innerRemotes = require('./remotes');
8
+ const innerPackages = require('./packages');
9
+
10
+ const { skipInstall, build } = tools.getArgs();
11
+
12
+
13
+ let customConfig;
14
+
15
+ module.exports.init = (finalResponse) => {
16
+ return Promise.resolve()
17
+ .then(() => {
18
+ customConfig = configUtils.global.getCustomConfig();
19
+ if (!customConfig) {
20
+ throw new Error('Custom config not found... run the command "npm run init:custom" to generate your customized config');
21
+ }
22
+ })
23
+
24
+ .then(() => {
25
+ finalResponse.project = customConfig.project;
26
+ finalResponse.euiVersion = customConfig.euiVersion;
27
+
28
+ return innerInitProject.init(finalResponse);
29
+ })
30
+
31
+ .then(() => {
32
+ return customConfig.remotes.reduce((promise, remote) => {
33
+ return promise.then(() => (
34
+ innerRemotes.generateVirtualRemote(remote)
35
+ ));
36
+ }, Promise.resolve());
37
+ })
38
+
39
+ .then(() => {
40
+ return innerPackages.importPackages(finalResponse);
41
+ })
42
+
43
+ .then(() => {
44
+ // this is only executed for local dev installation,
45
+ // in case of release the initialisation is managed by the application / package themselves
46
+ if (!build && !skipInstall) {
47
+ return installUtils.localDev.install();
48
+ }
49
+ })
50
+
51
+ .catch((e) => {
52
+ throw e;
53
+ });
54
+ }
@@ -0,0 +1,210 @@
1
+ 'use strict';
2
+
3
+ const tools = require('../../utils/tools');
4
+ const initUtils = require('./init-utils');
5
+ const installUtils = require('../install/install-utils');
6
+ const configUtils = require('../config/config-utils');
7
+
8
+ // Getting arguments if they are provided for the CI/CD pipeline
9
+ const {
10
+ project, team, pkg, branch, configOnly, skipClone, skipInstall, reset, pkgOnly, prjOnly,
11
+ build, containerOnly, skipAppContainers, remote, euiVersion, remoteOnly, remoteBuild, virtual, custom
12
+ } = tools.getArgs();
13
+
14
+
15
+ module.exports.init = () => {
16
+ // Initializing a common response
17
+ const initialResponse = {
18
+ project: project || null,
19
+ team: team || 'all',
20
+ pkg: pkg || null,
21
+ remote: remote || null,
22
+ remoteBuild: remoteBuild || false,
23
+ virtual: virtual || false,
24
+ euiVersion: euiVersion || null,
25
+ branch: branch || 'develop',
26
+ configOnly: configOnly || false,
27
+ skipClone: skipClone || false,
28
+ reset: reset || false,
29
+ pkgOnly: pkgOnly || false,
30
+ prjOnly: prjOnly || false,
31
+ remoteOnly: remoteOnly || false,
32
+ build: build || false,
33
+ containerOnly: containerOnly || false,
34
+ skipAppContainers: skipAppContainers || false,
35
+ custom: custom || false
36
+ }
37
+
38
+ // converting inputs args
39
+ initialResponse.branch = tools.convertStringArg(initialResponse.branch, 'develop');
40
+ initialResponse.euiVersion = tools.convertStringArg(initialResponse.euiVersion);
41
+ initialResponse.remoteBuild = tools.convertBooleanArg(initialResponse.remoteBuild);
42
+ initialResponse.virtual = tools.convertBooleanArg(initialResponse.virtual);
43
+
44
+
45
+ // setting project to null if forced to NONE
46
+ if (initialResponse.project === 'NONE') {
47
+ initialResponse.project = null;
48
+ }
49
+
50
+ // swapping to remote build if virtual remote is pass to default gitlab call
51
+ if (initialResponse.remoteBuild && initialResponse.pkg && initialResponse.virtual) {
52
+ initialResponse.remote = initialResponse.pkg;
53
+ initialResponse.pkg = null;
54
+ }
55
+
56
+
57
+ // Storing the response for propagation
58
+ let finalResponse;
59
+
60
+ return Promise.resolve()
61
+ .then(() => {
62
+
63
+ // if no project has been provided we prompt for project and team selection
64
+ if (!project && !pkg && !remote && !custom ) {
65
+ // TODO refactor to handle dynamic mywp-host-playground install (pre-remotes install etc...)
66
+ // return initUtils.prompt.start();
67
+ tools.logError('****************************************');
68
+ tools.logError('*************** ERROR ******************');
69
+ tools.logError('****************************************\n');
70
+ tools.logError('At least "pkg" or "project" or "remote" type should be used for init, for example :\n');
71
+ tools.logError('npm run init -- --pkg PKG_NAME [--branch BRANCH_NAME|default develop] [--git local] [--pkgOnly] [--skipInstall]');
72
+ tools.logError('npm run init -- --project PROJECT_NAME [--branch BRANCH_NAME|default develop] [--git local] [--prjOnly] [--skipInstall]');
73
+ tools.logError('npm run init -- --remote VIRTUAL_REMOTE_NAME [--remoteOnly] [--skipInstall]');
74
+ tools.logError('npm run init -- --custom [--skipInstall] [--git local]');
75
+ process.exit(0);
76
+
77
+ // if provided, we are on automated mode, we use the initialized response
78
+ } else {
79
+ return initialResponse;
80
+ }
81
+ })
82
+
83
+ // merge with response found from prompts
84
+ .then((response) => {
85
+ finalResponse = { ...initialResponse, ...response };
86
+
87
+ tools.logInfo('Configuration generated based on provided args:');
88
+ console.log(finalResponse);
89
+ })
90
+
91
+ // Initializing .euirc.json local file - the core of CSDR operations
92
+ .then(() => {
93
+ // Initialize config
94
+ return configUtils.init.run(finalResponse);
95
+ })
96
+
97
+ // clone or install linked host package to project if any
98
+ .then(() => {
99
+ // TODO
100
+ // if (finalResponse.project && !build) {
101
+ if (finalResponse.project) {
102
+ return initUtils.packages.cloneHostPackage(finalResponse.project);
103
+ }
104
+ // TODO
105
+ // } else if (finalResponse.project && build) {
106
+ // return initUtils.packages.installHostPackage(finalResponse.project);
107
+ // }
108
+ })
109
+
110
+ // Initializing .meta based on .euirc.json for local respoisitories cloning
111
+ .then(() => {
112
+ if (!finalResponse.remote) {
113
+ return initUtils.meta.init();
114
+ }
115
+ })
116
+
117
+ // Cloning repositories based on the .meta file generated
118
+ .then(() => {
119
+ if (!skipClone && !finalResponse.remote) {
120
+ return initUtils.repos.init(finalResponse);
121
+ }
122
+ })
123
+
124
+ // Importing external sources
125
+ .then(() => {
126
+ if (finalResponse.project) {
127
+ return initUtils.projects.importExternalSources(true);
128
+ }
129
+ })
130
+
131
+ // Generating virtual remote - experimental
132
+ .then(() => {
133
+ if (finalResponse.remote) {
134
+ return initUtils.remotes.generateVirtualRemote(finalResponse.remote);
135
+ }
136
+ })
137
+
138
+ // Importing packages and generating definitions
139
+ .then(() => {
140
+ return initUtils.packages.importPackages(finalResponse);
141
+ })
142
+
143
+ // adapt and inject particular root data/config for eUI version detected on project
144
+ // if multiple versions of eUI are detected on the same project, an exception is thrown
145
+ .then(() => {
146
+ return initUtils.global.processLocalEuiVersions();
147
+ })
148
+
149
+ // specific resolution injection based on NodeJS (recent failure of nodejs10.x for MWP v7)
150
+ .then(() => {
151
+ return initUtils.global.processResolutionsForNodeVersion();
152
+ })
153
+
154
+ // Install deps based on current config generated => take last know snapshots
155
+ .then(() => {
156
+ // this is only executed for local dev installation,
157
+ // in case of release the initialisation is managed by the application / package themselves
158
+ if (!build && !skipInstall) {
159
+ if (finalResponse.pkgOnly || finalResponse.remoteOnly) {
160
+ if (finalResponse.remote) {
161
+ return installUtils.localDev.installRemote(finalResponse.remote);
162
+ } else {
163
+ return installUtils.localDev.installPackage(finalResponse.pkg);
164
+ }
165
+ } else {
166
+ return installUtils.localDev.install();
167
+ }
168
+ }
169
+ })
170
+
171
+ // Attaching app scripts to root package.json
172
+ .then(() => {
173
+ if (finalResponse.project) {
174
+ return initUtils.projects.importScripts();
175
+ }
176
+ })
177
+
178
+
179
+ // Attaching extra tsconfig from project
180
+ .then(() => {
181
+ if (finalResponse.project) {
182
+ return initUtils.projects.importExtraTsConfig();
183
+ }
184
+ })
185
+
186
+
187
+ // Attaching external features from project
188
+ .then(() => {
189
+ if (finalResponse.project && !build) {
190
+ return initUtils.projects.importExternalFeatures();
191
+ }
192
+ })
193
+
194
+
195
+ // Attaching external mock repo for project
196
+ .then(() => {
197
+ if (finalResponse.project && !build && !finalResponse.prjOnly) {
198
+ return initUtils.projects.importExternalMock();
199
+ }
200
+ })
201
+
202
+
203
+ .then(() => {
204
+ tools.logSuccess('OK => Project successfully initialized');
205
+ })
206
+
207
+ .catch((e) => {
208
+ throw e;
209
+ });
210
+ }
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ const tools = require('../../utils/tools');
4
+ const initUtils = require('./init-utils');
5
+ const installUtils = require('../install/install-utils');
6
+ const configUtils = require('../config/config-utils');
7
+
8
+ const { skipClone, skipInstall, build } = tools.getArgs();
9
+
10
+
11
+ module.exports.init = (finalResponse) => {
12
+ return Promise.resolve()
13
+ // Initializing .euirc.json local file - the core of CSDR operations
14
+ .then(() => {
15
+ // Initialize config
16
+ return configUtils.init.run(finalResponse);
17
+ })
18
+
19
+ // Initializing .meta based on .euirc.json for local respoisitories cloning
20
+ .then(() => {
21
+ return initUtils.meta.init();
22
+ })
23
+
24
+ // Cloning repositories based on the .meta file generated
25
+ .then(() => {
26
+ if (!skipClone) {
27
+ return initUtils.repos.init(finalResponse);
28
+ }
29
+ })
30
+
31
+ // Importing packages and generating definitions
32
+ .then(() => {
33
+ return initUtils.packages.importPackages(finalResponse);
34
+ })
35
+
36
+ // adapt and inject particular root data/config for eUI version detected on project
37
+ // if multiple versions of eUI are detected on the same project, an exception is thrown
38
+ .then(() => {
39
+ return initUtils.global.processLocalEuiVersions();
40
+ })
41
+
42
+ // specific resolution injection based on NodeJS (recent failure of nodejs10.x for MWP v7)
43
+ .then(() => {
44
+ return initUtils.global.processResolutionsForNodeVersion();
45
+ })
46
+
47
+ // Install deps based on current config generated => take last know snapshots
48
+ .then(() => {
49
+ // this is only executed for local dev installation,
50
+ // in case of release the initialisation is managed by the application / package themselves
51
+ if (!build && !skipInstall) {
52
+ if (finalResponse.pkgOnly) {
53
+ return installUtils.localDev.installPackage(finalResponse.pkg);
54
+ } else {
55
+ return installUtils.localDev.install();
56
+ }
57
+ }
58
+ })
59
+
60
+ .catch((e) => {
61
+ throw e;
62
+ });
63
+ }
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ const tools = require('../../utils/tools');
4
+ const initUtils = require('./init-utils');
5
+ const installUtils = require('../install/install-utils');
6
+ const configUtils = require('../config/config-utils');
7
+ const injectionUtils = require('../../utils/pre-build/injection/injection-utils');
8
+
9
+ const { skipClone, skipInstall, build } = tools.getArgs();
10
+
11
+
12
+ module.exports.init = (finalResponse) => {
13
+ return Promise.resolve()
14
+ // Initializing .euirc.json local file - the core of CSDR operations
15
+ .then(() => {
16
+ // Initialize config
17
+ return configUtils.init.run(finalResponse);
18
+ })
19
+
20
+ // clone or install linked host package to project if any
21
+ .then(() => {
22
+ return initUtils.packages.cloneHostPackage(finalResponse.project);
23
+ })
24
+
25
+ // Initializing .meta based on .euirc.json for local respoisitories cloning
26
+ .then(() => {
27
+ return initUtils.meta.init();
28
+ })
29
+
30
+ // Cloning repositories based on the .meta file generated
31
+ .then(() => {
32
+ if (!skipClone) {
33
+ return initUtils.repos.init(finalResponse);
34
+ }
35
+ })
36
+
37
+ // Importing external sources
38
+ .then(() => {
39
+ const prj = configUtils.projects.getProject(finalResponse.project);
40
+ return injectionUtils.externals.injectExternalAppSources(prj, false, true, finalResponse.euiVersion);
41
+ // return initUtils.projects.importExternalSources(true);
42
+ })
43
+
44
+ // Importing packages and generating definitions
45
+ .then(() => {
46
+ return initUtils.packages.importPackages(finalResponse);
47
+ })
48
+
49
+ // adapt and inject particular root data/config for eUI version detected on project
50
+ // if multiple versions of eUI are detected on the same project, an exception is thrown
51
+ .then(() => {
52
+ return initUtils.global.processLocalEuiVersions();
53
+ })
54
+
55
+ // specific resolution injection based on NodeJS (recent failure of nodejs10.x for MWP v7)
56
+ .then(() => {
57
+ return initUtils.global.processResolutionsForNodeVersion();
58
+ })
59
+
60
+ // Install deps based on current config generated => take last know snapshots
61
+ .then(() => {
62
+ // this is only executed for local dev installation,
63
+ // in case of release the initialisation is managed by the application / package themselves
64
+ if (!build && !skipInstall) {
65
+ return installUtils.localDev.install();
66
+ }
67
+ })
68
+
69
+ // Attaching app scripts to root package.json
70
+ .then(() => {
71
+ return initUtils.projects.importScripts();
72
+ })
73
+
74
+
75
+ // Attaching extra tsconfig from project
76
+ .then(() => {
77
+ return initUtils.projects.importExtraTsConfig();
78
+ })
79
+
80
+
81
+ // Attaching external features from project
82
+ .then(() => {
83
+ if (!build) {
84
+ return initUtils.projects.importExternalFeatures();
85
+ }
86
+ })
87
+
88
+
89
+ // Attaching external mock repo for project
90
+ .then(() => {
91
+ if (!build) {
92
+ return initUtils.projects.importExternalMock();
93
+ }
94
+ })
95
+
96
+ .then(() => {
97
+ tools.logSuccess('OK => Project successfully initialized');
98
+ })
99
+
100
+ .catch((e) => {
101
+ throw e;
102
+ });
103
+ }
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ const tools = require('../../utils/tools');
4
+ const initUtils = require('./init-utils');
5
+ const installUtils = require('../install/install-utils');
6
+ const configUtils = require('../config/config-utils');
7
+
8
+ // Getting arguments if they are provided for the CI/CD pipeline
9
+ const { skipInstall, build } = tools.getArgs();
10
+
11
+
12
+
13
+ module.exports.init = (finalResponse) => {
14
+ return Promise.resolve()
15
+ // Initializing .euirc.json local file - the core of CSDR operations
16
+ .then(() => {
17
+ // Initialize config
18
+ return configUtils.init.run(finalResponse);
19
+ })
20
+
21
+ // Generating virtual remote - experimental
22
+ .then(() => {
23
+ return initUtils.remotes.generateVirtualRemote(finalResponse.remote);
24
+ })
25
+
26
+ // Importing packages and generating definitions
27
+ .then(() => {
28
+ return initUtils.packages.importPackages(finalResponse);
29
+ })
30
+
31
+ // Install deps based on current config generated => take last know snapshots
32
+ .then(() => {
33
+ // this is only executed for local dev installation,
34
+ // in case of release the initialisation is managed by the application / package themselves
35
+ if (!build && !skipInstall) {
36
+ if (finalResponse.remoteOnly) {
37
+ return installUtils.localDev.installRemote(finalResponse.remote);
38
+ } else {
39
+ return installUtils.localDev.install();
40
+ }
41
+ }
42
+ })
43
+
44
+ .catch((e) => {
45
+ throw e;
46
+ });
47
+ }
@@ -3,6 +3,9 @@
3
3
  // INNER MODULES - RE-EXPORTS
4
4
  module.exports.global = require('./global');
5
5
  module.exports.init = require('./init');
6
+ module.exports.initProject = require('./init-project');
7
+ module.exports.initPackage = require('./init-package');
8
+ module.exports.initRemote = require('./init-remote');
6
9
  module.exports.meta = require('./meta');
7
10
  module.exports.packages = require('./packages');
8
11
  module.exports.projects = require('./projects');