@eui/tools 6.12.15 → 6.12.17

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.17
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 6.12.17 (2023-06-24)
2
+
3
+ ##### Bug Fixes
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) ([72e3f699](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/72e3f69973c2f8ae604a8fc000a418d1d6849ad4))
7
+
8
+ * * *
9
+ * * *
10
+ ## 6.12.16 (2023-06-24)
11
+
12
+ ##### Chores
13
+
14
+ * **other:**
15
+ * 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))
16
+
17
+ * * *
18
+ * * *
1
19
  ## 6.12.15 (2023-06-23)
2
20
 
3
21
  ##### 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.17",
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));
@@ -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'));
@@ -191,6 +192,11 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
191
192
  if (!remote.skeletonConfig.options) {
192
193
  definitionsContent.push('StoreModule.forRoot(TOKEN, { metaReducers })');
193
194
 
195
+ // ag-grid license specific main.ts
196
+ // license token is replaced at post-install, we get it from the remote root UI pkg assets at specific location
197
+ if (remote.skeletonConfig.aggridLicenseInjection) {
198
+ tools.copy(optionAgGridPath, remoteSrcPath);
199
+ }
194
200
 
195
201
  // if options, all options are checked and default modules defs are injected following certain conditions
196
202
  } else {
@@ -238,9 +244,9 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
238
244
  if (remote.skeletonConfig.blockContainerTypes) {
239
245
  remote.skeletonConfig.blockContainerTypes.forEach((bc) => {
240
246
  blockContainerPlaceholder += `
241
- <ng-container *ngIf="${bc.condition}">
242
- <${bc.name} [block]="block"></${bc.name}>
243
- </ng-container>
247
+ <ng-container *ngIf="${bc.condition}">
248
+ <${bc.name} [block]="block"></${bc.name}>
249
+ </ng-container>
244
250
  `;
245
251
  });
246
252
  }
@@ -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.aggridLicenseInjection) {
188
+ return Promise.resolve()
189
+ .then(() => {
190
+ const rootPkgLicensePath = path.join(
191
+ pkg.paths.repoNodeModules,
192
+ pkg.skeletonConfig.rootNpmPkg,
193
+ 'assets', 'ag-grid-license', 'license.json'
194
+ );
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
+ }