@eui/tools 6.18.0 → 6.19.0

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.18.0
1
+ 6.19.0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 6.19.0 (2024-07-25)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * adapted wrong path check ([95030187](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/9503018748e091defe17bb186a740bdd9bc9d768))
7
+ ##### New Features
8
+
9
+ * **other:**
10
+ * adapted to new config for baep standalone portal - adjusted esbuild for proxied configurations - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([cf062fc3](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/cf062fc35fda5423fcf136e556779d7c4012a77d))
11
+
12
+ * * *
13
+ * * *
1
14
  ## 6.18.0 (2024-07-24)
2
15
 
3
16
  ##### New Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.18.0",
3
+ "version": "6.19.0",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -26,9 +26,11 @@ const {
26
26
  angularProjectDefFullSkeletonV17esbuild,
27
27
  angularProjectDefConfiguration,
28
28
  angularProjectDefConfigurationHost,
29
+ angularProjectDefConfigurationHostEsbuild,
29
30
  angularProjectDefConfigurationLight,
30
31
  angularProjectDefConfigurationOptimized,
31
32
  angularProjectDefConfigurationOptimizedHost,
33
+ angularProjectDefConfigurationOptimizedHostEsbuild,
32
34
  angularProjectDefConfigurationOptimizedLight,
33
35
  angularPackageDef,
34
36
  angularPackageSubEntryDef,
@@ -321,8 +323,13 @@ module.exports.registerAngularProjectDef = (project, build = false, element = fa
321
323
  } else {
322
324
  tools.logInfo('Injecting angular configuration file replacement');
323
325
  if (project.host) {
324
- configurationDef = JSON.stringify(angularProjectDefConfigurationHost);
325
- configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimizedHost);
326
+ if (packageEuiVersionNumber >= 18) {
327
+ configurationDef = JSON.stringify(angularProjectDefConfigurationHostEsbuild);
328
+ configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimizedHostEsbuild);
329
+ } else {
330
+ configurationDef = JSON.stringify(angularProjectDefConfigurationHost);
331
+ configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimizedHost);
332
+ }
326
333
  } else {
327
334
  configurationDef = JSON.stringify(angularProjectDefConfiguration);
328
335
  configurationDefOptimized = JSON.stringify(angularProjectDefConfigurationOptimized);
@@ -393,7 +400,12 @@ module.exports.registerModulePaths = (pkg, isReset) => {
393
400
  const fileDev = path.join(process.cwd(), 'tsconfig.json');
394
401
  const fileBuild = path.join(process.cwd(), 'tsconfig.build.json');
395
402
  const fileBuildSpec = path.join(process.cwd(), 'tsconfig.build.spec.json');
396
- const defFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json');
403
+ let defFile;
404
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
405
+ defFile = path.join(process.cwd(), '.config', '.euirc-apps.json');
406
+ } else {
407
+ defFile = path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json');
408
+ }
397
409
 
398
410
  if ((!tools.isFileExists(fileBuild) || isReset) && !tools.isFileExists(defFile)) {
399
411
  tools.copy(fileDev, fileBuild);
@@ -1496,18 +1496,18 @@ module.exports.angularProjectDefFullSkeletonV17esbuild = {
1496
1496
  "serve": {
1497
1497
  "builder": "@angular-devkit/build-angular:dev-server",
1498
1498
  "options": {
1499
- "browserTarget": "@project.name@:build"
1499
+ "buildTarget": "@project.name@:build"
1500
1500
  },
1501
1501
  "configurations": {
1502
1502
  "proxy-mock": {
1503
- "browserTarget": "@project.name@:build",
1503
+ "buildTarget": "@project.name@:build",
1504
1504
  "proxyConfig": "apps/@project.name@/proxy-mock.conf.json"
1505
1505
  },
1506
1506
  "production": {
1507
- "browserTarget": "@project.name@:build:production"
1507
+ "buildTarget": "@project.name@:build:production"
1508
1508
  },
1509
1509
  "development": {
1510
- "browserTarget": "@project.name@:build:development"
1510
+ "buildTarget": "@project.name@:build:development"
1511
1511
  }
1512
1512
  },
1513
1513
  "defaultConfiguration": "development"
@@ -1560,6 +1560,49 @@ module.exports.angularProjectDefConfigurationHost = {
1560
1560
  "namedChunks": true
1561
1561
  };
1562
1562
 
1563
+ module.exports.angularProjectDefConfigurationOptimizedHost = {
1564
+ "optimization": true,
1565
+ "outputHashing": "all",
1566
+ "sourceMap": false,
1567
+ "extractCss": true,
1568
+ "namedChunks": true,
1569
+ "aot": true,
1570
+ "extractLicenses": true,
1571
+ "vendorChunk": false,
1572
+ "buildOptimizer": true,
1573
+ "budgets": [
1574
+ {
1575
+ "type": "initial",
1576
+ "maximumWarning": "2mb",
1577
+ "maximumError": "8mb"
1578
+ }
1579
+ ]
1580
+ }
1581
+
1582
+ module.exports.angularProjectDefConfigurationHostEsbuild = {
1583
+ "optimization": false,
1584
+ "extractLicenses": false,
1585
+ "sourceMap": true,
1586
+ "namedChunks": true
1587
+ };
1588
+
1589
+ module.exports.angularProjectDefConfigurationOptimizedHostEsbuild = {
1590
+ "optimization": true,
1591
+ "outputHashing": "all",
1592
+ "sourceMap": false,
1593
+ "extractCss": true,
1594
+ "namedChunks": true,
1595
+ "aot": true,
1596
+ "extractLicenses": true,
1597
+ "budgets": [
1598
+ {
1599
+ "type": "initial",
1600
+ "maximumWarning": "2mb",
1601
+ "maximumError": "8mb"
1602
+ }
1603
+ ]
1604
+ }
1605
+
1563
1606
 
1564
1607
  module.exports.angularProjectDefConfigurationLight = {
1565
1608
  "buildOptimizer": false,
@@ -1618,24 +1661,7 @@ module.exports.angularProjectDefConfigurationOptimized = {
1618
1661
  ]
1619
1662
  }
1620
1663
 
1621
- module.exports.angularProjectDefConfigurationOptimizedHost = {
1622
- "optimization": true,
1623
- "outputHashing": "all",
1624
- "sourceMap": false,
1625
- "extractCss": true,
1626
- "namedChunks": true,
1627
- "aot": true,
1628
- "extractLicenses": true,
1629
- "vendorChunk": false,
1630
- "buildOptimizer": true,
1631
- "budgets": [
1632
- {
1633
- "type": "initial",
1634
- "maximumWarning": "2mb",
1635
- "maximumError": "8mb"
1636
- }
1637
- ]
1638
- }
1664
+
1639
1665
 
1640
1666
 
1641
1667
 
@@ -13,10 +13,20 @@ const innerProjects = require('./projects');
13
13
 
14
14
 
15
15
  module.exports.getCsdrConfig = (full = true) => {
16
- const globalConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-config.json'));
17
- const appsConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json'));
18
- const packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
19
- const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
16
+ let globalConfig, appsConfig, packagesConfig, remotesConfig;
17
+
18
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
19
+ globalConfig = require(path.join(process.cwd(), '.config', '.euirc-config.json'));
20
+ appsConfig = require(path.join(process.cwd(), '.config', '.euirc-apps.json'));
21
+ packagesConfig = require(path.join(process.cwd(), '.config', '.euirc-packages.json'));
22
+ remotesConfig = require(path.join(process.cwd(), '.config', '.euirc-remotes.json'));
23
+
24
+ } else {
25
+ globalConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-config.json'));
26
+ appsConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-apps.json'));
27
+ packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
28
+ remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
29
+ }
20
30
 
21
31
  const config = globalConfig;
22
32
 
@@ -147,9 +157,13 @@ const getConfig = module.exports.getConfig = () => {
147
157
  let configFile;
148
158
  let isCsdr;
149
159
 
150
- if (tools.isDirExists(path.join(process.cwd(), '.csdr'))) {
151
- configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
160
+ if (tools.isDirExists(path.join(process.cwd(), '.csdr')) || tools.isDirExists(path.join(process.cwd(), '.config'))) {
152
161
  isCsdr = true;
162
+ if (tools.isDirExists(path.join(process.cwd(), '.csdr'))) {
163
+ configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
164
+ } else {
165
+ configFile = path.join(process.cwd(), '.config', '.euirc.json');
166
+ }
153
167
  } else {
154
168
  configFile = path.join(process.cwd(), '.euirc.json');
155
169
  isCsdr = false;
@@ -174,7 +188,13 @@ module.exports.updateConfig = (args = { project, projects, packages, packagesBra
174
188
  tools.logInfo('Updating euirc config');
175
189
  console.log(args);
176
190
 
177
- const configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
191
+ let configFile;
192
+
193
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
194
+ configFile = path.join(process.cwd(), '.config', '.euirc.json');
195
+ } else {
196
+ configFile = path.join(process.cwd(), '.csdr', '.euirc.json');
197
+ }
178
198
 
179
199
  let newConfig = {};
180
200
 
@@ -244,7 +244,13 @@ module.exports.getRemotePackages = () => {
244
244
  };
245
245
 
246
246
  module.exports.isRemote = (pkgName) => {
247
- const packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
247
+ let packagesConfig;
248
+
249
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
250
+ packagesConfig = require(path.join(process.cwd(), '.config', '.euirc-packages.json'));
251
+ } else {
252
+ packagesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json'));
253
+ }
248
254
  const packageConfig = packagesConfig[pkgName];
249
255
 
250
256
  if (packageConfig) {
@@ -92,9 +92,17 @@ module.exports.registerCsdrPackage = (pkg, rootPkgScope, rootPkgName, euiVersion
92
92
 
93
93
  let file;
94
94
  if (isRemote) {
95
- file = path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json');
95
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
96
+ file = path.join(process.cwd(), '.config', '.euirc-remotes.json');
97
+ } else {
98
+ file = path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json');
99
+ }
96
100
  } else {
97
- file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
101
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
102
+ file = path.join(process.cwd(), '.config', '.euirc-packages.json');
103
+ } else {
104
+ file = path.join(process.cwd(), '.csdr', '.euirc-csdr-packages.json');
105
+ }
98
106
  }
99
107
 
100
108
  const moduleJson = JSON.parse(replaceModule);
@@ -18,7 +18,12 @@ module.exports.getRemote = (remoteName) => {
18
18
  remoteName = tools.getArgs().root;
19
19
  }
20
20
 
21
- const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
21
+ let remotesConfig;
22
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
23
+ remotesConfig = require(path.join(process.cwd(), '.config', '.euirc-remotes.json'));
24
+ } else {
25
+ remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
26
+ }
22
27
  const remoteConfig = remotesConfig[remoteName];
23
28
 
24
29
  const configOptions = configUtils.global.getConfigOptions();
@@ -71,7 +76,14 @@ module.exports.getRemote = (remoteName) => {
71
76
 
72
77
 
73
78
  module.exports.isVirtualRemote = (remoteName) => {
74
- const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
79
+ let remotesConfig;
80
+ console.log(tools.isDirExists())
81
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
82
+ remotesConfig = require(path.join(process.cwd(), '.config', '.euirc-remotes.json'));
83
+ } else {
84
+ remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
85
+ }
86
+
75
87
  const remoteConfig = remotesConfig[remoteName];
76
88
 
77
89
  return remoteConfig !== undefined;
@@ -111,7 +123,13 @@ module.exports.getCsdrRemotes = (hostName, euiVersion) => {
111
123
  tools.logInfo(`--- for euiVersion: ${euiVersion}`);
112
124
  }
113
125
 
114
- const remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
126
+ let remotesConfig;
127
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
128
+ remotesConfig = require(path.join(process.cwd(), '.config', '.euirc-remotes.json'));
129
+ } else {
130
+ remotesConfig = require(path.join(process.cwd(), '.csdr', '.euirc-csdr-remotes.json'));
131
+ }
132
+
115
133
  let remotesArray = Object.keys(remotesConfig).map((r) => {
116
134
  const remote = remotesConfig[r];
117
135
  remote.name = r;
@@ -74,6 +74,9 @@ module.exports.run = () => {
74
74
  packages: pkgFolders,
75
75
  remotes: remoteFolders
76
76
  };
77
-
78
- tools.writeJsonFileSync(path.join(process.cwd(), '.csdr', '.euirc.json'), config);
77
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
78
+ tools.writeJsonFileSync(path.join(process.cwd(), '.config', '.euirc.json'), config);
79
+ } else {
80
+ tools.writeJsonFileSync(path.join(process.cwd(), '.csdr', '.euirc.json'), config);
81
+ }
79
82
  }
@@ -83,6 +83,7 @@ module.exports.cloneHostPackage = (projectName) => {
83
83
 
84
84
  return Promise.resolve()
85
85
  .then(() => {
86
+ tools.logInfo(`Fetching host package info : ${project.hostPackage}`);
86
87
  pkg = configUtils.packages.getPackageByNpmPkg(project.hostPackage, true);
87
88
  if (!pkg) {
88
89
  throw new Error('Invalid host package provided / unknown to CSDR config');
@@ -25,10 +25,17 @@ const getPackageVersions = (module.exports.getPackageVersions = (pkg) => {
25
25
  } catch(e) {
26
26
  npmOutput = e.stdout;
27
27
  }
28
- const json = JSON.parse(npmOutput);
28
+ // console.log(npmOutput);
29
29
 
30
30
  let versions = [];
31
31
 
32
+ if (!npmOutput) {
33
+ tools.logWarning('Cannot find version of pkg - package is probably not published yet');
34
+ return versions;
35
+ }
36
+
37
+ const json = JSON.parse(npmOutput);
38
+
32
39
  if (json.error) {
33
40
  tools.logWarning('Error detected while trying to fetch the pkg version');
34
41
  console.log(json.error);
@@ -17,7 +17,12 @@ module.exports.sync = () => {
17
17
  return Promise.resolve()
18
18
  .then(() => {
19
19
  tools.logInfo('Resetting package.json');
20
- return tools.copy(path.join(process.cwd(), '.csdr', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
20
+
21
+ if (tools.isDirExists(path.join(process.cwd(), '.config'))) {
22
+ return tools.copy(path.join(process.cwd(), '.config', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
23
+ } else {
24
+ return tools.copy(path.join(process.cwd(), '.csdr', 'package.json.reset'), path.join(process.cwd(), 'package.json'));
25
+ }
21
26
  })
22
27
  .then(() => {
23
28
  tools.logInfo('Removing yarn.lock');