@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
@@ -1,14 +1,18 @@
1
1
  'use strict';
2
2
 
3
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');
4
+
5
+ // inner modules
6
+ const innerInitProject = require('./init-project');
7
+ const innerInitPackage = require('./init-package');
8
+ const innerInitRemote = require('./init-remote');
9
+ const innerInitCustom = require('./init-custom');
10
+
7
11
 
8
12
  // Getting arguments if they are provided for the CI/CD pipeline
9
13
  const {
10
14
  project, team, pkg, branch, configOnly, skipClone, skipInstall, reset, pkgOnly, prjOnly,
11
- build, containerOnly, skipAppContainers, remote, euiVersion, remoteOnly, remoteBuild, virtual
15
+ build, containerOnly, skipAppContainers, remote, euiVersion, remoteOnly, remoteBuild, virtual, custom
12
16
  } = tools.getArgs();
13
17
 
14
18
 
@@ -31,7 +35,8 @@ module.exports.init = () => {
31
35
  remoteOnly: remoteOnly || false,
32
36
  build: build || false,
33
37
  containerOnly: containerOnly || false,
34
- skipAppContainers: skipAppContainers || false
38
+ skipAppContainers: skipAppContainers || false,
39
+ custom: custom || false
35
40
  }
36
41
 
37
42
  // converting inputs args
@@ -52,7 +57,6 @@ module.exports.init = () => {
52
57
  initialResponse.pkg = null;
53
58
  }
54
59
 
55
-
56
60
  // Storing the response for propagation
57
61
  let finalResponse;
58
62
 
@@ -60,7 +64,7 @@ module.exports.init = () => {
60
64
  .then(() => {
61
65
 
62
66
  // if no project has been provided we prompt for project and team selection
63
- if (!project && !pkg && !remote) {
67
+ if (!project && !pkg && !remote && !custom ) {
64
68
  // TODO refactor to handle dynamic mywp-host-playground install (pre-remotes install etc...)
65
69
  // return initUtils.prompt.start();
66
70
  tools.logError('****************************************');
@@ -70,6 +74,7 @@ module.exports.init = () => {
70
74
  tools.logError('npm run init -- --pkg PKG_NAME [--branch BRANCH_NAME|default develop] [--git local] [--pkgOnly] [--skipInstall]');
71
75
  tools.logError('npm run init -- --project PROJECT_NAME [--branch BRANCH_NAME|default develop] [--git local] [--prjOnly] [--skipInstall]');
72
76
  tools.logError('npm run init -- --remote VIRTUAL_REMOTE_NAME [--remoteOnly] [--skipInstall]');
77
+ tools.logError('npm run init -- --custom [--skipInstall] [--git local]');
73
78
  process.exit(0);
74
79
 
75
80
  // if provided, we are on automated mode, we use the initialized response
@@ -86,118 +91,21 @@ module.exports.init = () => {
86
91
  console.log(finalResponse);
87
92
  })
88
93
 
89
- // Initializing .euirc.json local file - the core of CSDR operations
90
94
  .then(() => {
91
- // Initialize config
92
- return configUtils.init.run(finalResponse);
93
- })
94
-
95
- // clone or install linked host package to project if any
96
- .then(() => {
97
- // TODO
98
- // if (finalResponse.project && !build) {
99
95
  if (finalResponse.project) {
100
- return initUtils.packages.cloneHostPackage(finalResponse.project);
101
- }
102
- // TODO
103
- // } else if (finalResponse.project && build) {
104
- // return initUtils.packages.installHostPackage(finalResponse.project);
105
- // }
106
- })
96
+ return innerInitProject.init(finalResponse);
107
97
 
108
- // Initializing .meta based on .euirc.json for local respoisitories cloning
109
- .then(() => {
110
- if (!finalResponse.remote) {
111
- return initUtils.meta.init();
112
- }
113
- })
114
-
115
- // Cloning repositories based on the .meta file generated
116
- .then(() => {
117
- if (!skipClone && !finalResponse.remote) {
118
- return initUtils.repos.init(finalResponse);
119
- }
120
- })
98
+ } else if (finalResponse.pkg) {
99
+ return innerInitPackage.init(finalResponse);
121
100
 
122
- // Importing external sources
123
- .then(() => {
124
- if (finalResponse.project) {
125
- return initUtils.projects.importExternalSources(true);
126
- }
127
- })
101
+ } else if (finalResponse.remote) {
102
+ return innerInitRemote.init(finalResponse);
128
103
 
129
- // Generating virtual remote - experimental
130
- .then(() => {
131
- if (finalResponse.remote) {
132
- return initUtils.remotes.generateVirtualRemote(finalResponse.remote);
104
+ } else if (finalResponse.custom) {
105
+ return innerInitCustom.init(finalResponse);
133
106
  }
134
107
  })
135
108
 
136
- // Importing packages and generating definitions
137
- .then(() => {
138
- return initUtils.packages.importPackages(finalResponse);
139
- })
140
-
141
- // adapt and inject particular root data/config for eUI version detected on project
142
- // if multiple versions of eUI are detected on the same project, an exception is thrown
143
- .then(() => {
144
- return initUtils.global.processLocalEuiVersions();
145
- })
146
-
147
- // specific resolution injection based on NodeJS (recent failure of nodejs10.x for MWP v7)
148
- .then(() => {
149
- return initUtils.global.processResolutionsForNodeVersion();
150
- })
151
-
152
- // Install deps based on current config generated => take last know snapshots
153
- .then(() => {
154
- // this is only executed for local dev installation,
155
- // in case of release the initialisation is managed by the application / package themselves
156
- if (!build && !skipInstall) {
157
- if (finalResponse.pkgOnly || finalResponse.remoteOnly) {
158
- if (finalResponse.remote) {
159
- return installUtils.localDev.installRemote(finalResponse.remote);
160
- } else {
161
- return installUtils.localDev.installPackage(finalResponse.pkg);
162
- }
163
- } else {
164
- return installUtils.localDev.install();
165
- }
166
- }
167
- })
168
-
169
- // Attaching app scripts to root package.json
170
- .then(() => {
171
- if (finalResponse.project) {
172
- return initUtils.projects.importScripts();
173
- }
174
- })
175
-
176
-
177
- // Attaching extra tsconfig from project
178
- .then(() => {
179
- if (finalResponse.project) {
180
- return initUtils.projects.importExtraTsConfig();
181
- }
182
- })
183
-
184
-
185
- // Attaching external features from project
186
- .then(() => {
187
- if (finalResponse.project && !build) {
188
- return initUtils.projects.importExternalFeatures();
189
- }
190
- })
191
-
192
-
193
- // Attaching external mock repo for project
194
- .then(() => {
195
- if (finalResponse.project && !build && !finalResponse.prjOnly) {
196
- return initUtils.projects.importExternalMock();
197
- }
198
- })
199
-
200
-
201
109
  .then(() => {
202
110
  tools.logSuccess('OK => Project successfully initialized');
203
111
  })
@@ -148,7 +148,7 @@ const injectExternalAppRootCore = (project, build = false, injectedNpmPkg, injec
148
148
 
149
149
 
150
150
 
151
- module.exports.injectExternalAppSources = (project, build = false, init = false) => {
151
+ module.exports.injectExternalAppSources = (project, build = false, init = false, euiVersion) => {
152
152
 
153
153
  if (!project.externalSources) {
154
154
  tools.logInfo('No external app sources setup...skipping');
@@ -160,17 +160,18 @@ module.exports.injectExternalAppSources = (project, build = false, init = false)
160
160
  return;
161
161
  }
162
162
 
163
- let { euiVersion } = tools.getArgs();
164
-
165
- if (!euiVersion && project.virtual) {
166
- euiVersion = configUtils.projects.getProjectEuiVersion(project);
167
-
168
- if (!euiVersion) {
169
- throw new Error(`
170
- eUI version of ${project.name} cannot be found...
171
- if you're initializing the project, pass the "euiVersion" as parameter :
172
- f.e. : npm run init -- --project ${project.name} .... --euiVersion 10.x
173
- `);
163
+ if (!euiVersion) {
164
+ const { euiVersionArg } = tools.getArgs();
165
+ if (!euiVersionArg && project.virtual) {
166
+ euiVersion = configUtils.projects.getProjectEuiVersion(project);
167
+
168
+ if (!euiVersion) {
169
+ throw new Error(`
170
+ eUI version of ${project.name} cannot be found...
171
+ if you're initializing the project, pass the "euiVersion" as parameter :
172
+ f.e. : npm run init -- --project ${project.name} .... --euiVersion 10.x
173
+ `);
174
+ }
174
175
  }
175
176
  }
176
177
 
@@ -1,5 +0,0 @@
1
- describe('First test', () => {
2
- it('should work', () => {
3
- expect(true).toBe(true);
4
- });
5
- });
@@ -1,4 +0,0 @@
1
- export { DecideParticipantModule } from './module';
2
-
3
- export { MainParticipantModule } from './main/module';
4
- export { DecideParticipantContainerComponent } from './main/containers/decide.container';
@@ -1,14 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
-
3
- import { DecideBlock } from '../models';
4
-
5
- @Component({
6
- selector: 'cc-decide-cp',
7
- templateUrl: './decide.component.html',
8
- })
9
- export class DecideComponent {
10
- @Input() block: DecideBlock;
11
-
12
- constructor() {
13
- }
14
- }
@@ -1 +0,0 @@
1
- export const namespace = 'ccDecide:participant';
@@ -1,6 +0,0 @@
1
- /**
2
- * Sub-blocks
3
- */
4
- export class DecideBlockType {
5
- static CreateDossier = 'createDossier';
6
- }
@@ -1,10 +0,0 @@
1
- import { ParticipantBlock } from '@cc/shared';
2
-
3
- import { DecideBlockType } from './decide-block-type.model';
4
-
5
- export interface DecideBlock extends ParticipantBlock {
6
-
7
- config: {
8
- subType: DecideBlockType;
9
- }
10
- }
@@ -1,2 +0,0 @@
1
- export * from './decide-block.model';
2
- export * from './decide-block-type.model';
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
-
3
- import { DecideBlock } from '../../models';
4
-
5
- export enum DecideBlockActionType {
6
- UPSERT_BLOCK = '[ccDecide - Block] Upsert block',
7
- REMOVE_BLOCK = '[ccDecide - Block] Remove block',
8
- }
9
-
10
- export class UpsertBlock implements Action {
11
- readonly type = DecideBlockActionType.UPSERT_BLOCK;
12
-
13
- constructor(public payload: { block: DecideBlock }) {
14
- }
15
- }
16
-
17
- export class RemoveBlock implements Action {
18
- readonly type = DecideBlockActionType.REMOVE_BLOCK;
19
-
20
- constructor(public payload: { id: string }) {
21
- }
22
- }
23
-
24
- export type BlockActions =
25
- UpsertBlock |
26
- RemoveBlock;