@eui/tools 6.12.15 → 6.12.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 6.12.15
1
+ 6.12.16
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.12.16 (2023-06-24)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * added ag-grid license injection for v15 up remotes - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([2c64afaa](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/2c64afaa8e381d0e3c196681ce39909e2c824b36))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.12.15 (2023-06-23)
2
11
 
3
12
  ##### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.12.15",
3
+ "version": "6.12.16",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -36,6 +36,7 @@ module.exports.getRemote = (remoteName) => {
36
36
  virtual: true,
37
37
  paths: {
38
38
  root: remoteRootPath,
39
+ src: path.join(remoteRootPath, 'src'),
39
40
  dist: path.join(remoteRootPath, 'dist'),
40
41
  publish: path.join(remoteRootPath, 'dist'), // maintain compat with core publish utils
41
42
  fromRoot: `remotes/${remoteName}`,
@@ -0,0 +1,15 @@
1
+ import { enableProdMode } from '@angular/core';
2
+ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3
+ import { AppModule } from './app/module';
4
+ import { environment } from './environments/environment';
5
+ if (environment.production) {
6
+ enableProdMode();
7
+ }
8
+
9
+ import { LicenseManager } from 'ag-grid-enterprise';
10
+ // tslint:disable-next-line
11
+ LicenseManager.setLicenseKey(@ag-grid-license@);
12
+
13
+ platformBrowserDynamic()
14
+ .bootstrapModule(AppModule)
15
+ .catch(err => console.log(err));
@@ -169,6 +169,7 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
169
169
 
170
170
  const optionUserReducersPath = path.join(fullOptionsPath, 'user-reducers');
171
171
  const optionParticipantPath = path.join(fullOptionsPath, 'participant');
172
+ const optionAgGridPath = path.join(fullOptionsPath, 'ag-grid');
172
173
  const optionUserReducersDef = tools.getJsonFileContent(path.join(fullOptionsPath, 'definitions', 'user-reducers.json'));
173
174
  const optionZipkinDef = tools.getJsonFileContent(path.join(fullOptionsPath, 'definitions', 'zipkin.json'));
174
175
  const optionDynatraceDef = tools.getJsonFileContent(path.join(fullOptionsPath, 'definitions', 'dynatrace.json'));
@@ -238,14 +239,20 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
238
239
  if (remote.skeletonConfig.blockContainerTypes) {
239
240
  remote.skeletonConfig.blockContainerTypes.forEach((bc) => {
240
241
  blockContainerPlaceholder += `
241
- <ng-container *ngIf="${bc.condition}">
242
- <${bc.name} [block]="block"></${bc.name}>
243
- </ng-container>
242
+ <ng-container *ngIf="${bc.condition}">
243
+ <${bc.name} [block]="block"></${bc.name}>
244
+ </ng-container>
244
245
  `;
245
246
  });
246
247
  }
247
248
  tools.replaceInPath(remoteSrcPath, '<!-- BLOCK_CONTAINER_PLACEHOLDER -->', blockContainerPlaceholder);
248
249
  }
250
+
251
+ // ag-grid license specific main.ts
252
+ // license token is replaced at post-install, we get it from the remote root UI pkg assets at specific location
253
+ if (remote.skeletonConfig.options.aggridLicenseInjection) {
254
+ tools.copy(optionAgGridPath, remoteSrcPath);
255
+ }
249
256
  }
250
257
 
251
258
  // replace option in module.ts placeholders
@@ -39,6 +39,10 @@ module.exports.installRemote = (pkg, envTarget, compositeType) => {
39
39
  return deps;
40
40
  })
41
41
 
42
+ .then(() => {
43
+ return innerRemotes.postInstall(pkg);
44
+ })
45
+
42
46
  .catch((e) => {
43
47
  throw e;
44
48
  })
@@ -170,4 +170,45 @@ module.exports.installDeps = (pkg, envTarget, compositeType) => {
170
170
  .catch((e) => {
171
171
  throw e;
172
172
  })
173
- }
173
+ }
174
+
175
+
176
+ module.exports.postInstall = (pkg) => {
177
+ tools.logTitle('Executing post-install for remote skeleton replacement fetched from root UI package');
178
+
179
+ if (!pkg.fullSkeletonSources) {
180
+ return;
181
+ }
182
+
183
+ if (!pkg.skeletonConfig) {
184
+ return;
185
+ }
186
+
187
+ if (!pkg.skeletonConfig.options) {
188
+ return;
189
+ }
190
+
191
+ if (pkg.skeletonConfig.options.aggridLicenseInjection) {
192
+ return Promise.resolve()
193
+ .then(() => {
194
+ const rootPkgLicensePath = path.join(pkg.paths.repoNodeModules, 'assets', 'ag-grid-license', 'license.json');
195
+
196
+ if (!tools.isFileExists(rootPkgLicensePath)) {
197
+ throw 'NO_LICENSE_FILE_FOUND';
198
+ }
199
+
200
+ const licenseJSON = tools.getJsonFileContent(rootPkgLicensePath);
201
+ const license = licenseJSON.license;
202
+ tools.logInfo(`license key found : ${license}`);
203
+
204
+ const mainTsPath = path.join(pkg.paths.src, 'main.ts');
205
+ tools.replaceInFileSync(mainTsPath, '@ag-grid-license@', license);
206
+
207
+ tools.logSuccess('OK => main.ts replaced');
208
+ })
209
+
210
+ .catch((e) => {
211
+ throw e;
212
+ })
213
+ }
214
+ }