@eui/tools 6.19.1 → 6.19.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.
@@ -1 +1 @@
1
- 6.19.1
1
+ 6.19.2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.19.2 (2024-07-26)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * add option for injection of host sources for api config and mock - EUI-9788 [EUI-9788](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-9788) ([ec2b5075](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/ec2b50755fba6d0b4b085b0621870ba508880a2d))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.19.1 (2024-07-26)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.19.1",
3
+ "version": "6.19.2",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -25,7 +25,7 @@ const configUtils = require('../../../csdr/config/config-utils');
25
25
 
26
26
  /* PRIVATE METHODS */
27
27
 
28
- const injectConfigCore = (project, npmPkg) => {
28
+ const injectConfigCore = (project, npmPkg, folder = 'assets') => {
29
29
  // check if package is locally cloned
30
30
  const localPackage = configUtils.packages.getPackages().filter((p) => {
31
31
  return p.npmPkg === npmPkg
@@ -37,13 +37,13 @@ const injectConfigCore = (project, npmPkg) => {
37
37
 
38
38
  // if local package is found
39
39
  if (localPackage) {
40
- pkgAssetsPath = path.join(process.cwd(), 'packages', localPackage.name, 'assets');
40
+ pkgAssetsPath = path.join(process.cwd(), 'packages', localPackage.name, folder);
41
41
 
42
42
  // if not sources are taken from the npm package def in node_modules
43
43
  } else {
44
44
  const npmPkgScope = npmPkg.substr(0, npmPkg.indexOf('/'));
45
45
  const npmPkgName = npmPkg.substr(npmPkg.indexOf('/') + 1);
46
- pkgAssetsPath = path.join(process.cwd(), 'node_modules', npmPkgScope, npmPkgName, 'assets');
46
+ pkgAssetsPath = path.join(process.cwd(), 'node_modules', npmPkgScope, npmPkgName, folder);
47
47
  }
48
48
 
49
49
  if (!tools.isDirExists(pkgAssetsPath)) {
@@ -83,7 +83,8 @@ module.exports.injectConfig = (project) => {
83
83
 
84
84
  // single config/npm package defined
85
85
  } else {
86
- injectConfigCore(project, project.config.npmPkg);
86
+ console.log(project.config.folder)
87
+ injectConfigCore(project, project.config.npmPkg, project.config.folder);
87
88
  }
88
89
  })
89
90
 
@@ -387,11 +387,23 @@ module.exports.injectExternalMock = (project) => {
387
387
 
388
388
  return Promise.resolve()
389
389
  .then(() => {
390
- if (!(project.mock && project.mock.external)) {
390
+ if (!project.mock) {
391
391
  tools.logInfo('No external mock setup...skipping')
392
392
 
393
393
  } else {
394
- return gitUtils.cloneRepo(project.mock.repository, project.mock.folder, false, true);
394
+ if (project.mock.npmPkg && project.mock.folder) {
395
+ const localPackage = configUtils.packages.getPackages().filter((p) => {
396
+ return p.npmPkg === project.mock.npmPkg
397
+ })[0];
398
+
399
+ tools.copydir(
400
+ path.join(process.cwd(), 'packages', localPackage.name, project.mock.folder),
401
+ path.join(process.cwd(), project.folder, 'mock')
402
+ );
403
+
404
+ } else {
405
+ return gitUtils.cloneRepo(project.mock.repository, project.mock.folder, false, true);
406
+ }
395
407
  }
396
408
  })
397
409