@eui/tools 6.12.44 → 6.12.45

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.44
1
+ 6.12.45
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.12.45 (2023-08-17)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * element pre-build copy rootPkg dist for local MFE generic portal dev - EUI-7680 [EUI-7680](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7680) ([3f256164](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/3f2561644d885898592974bea067a1b1f98129ca))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.12.44 (2023-08-17)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.12.44",
3
+ "version": "6.12.45",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -36,17 +36,27 @@ module.exports.preBuild = (pkg, build = false) => {
36
36
  const tsConfigFile = path.join(pkg.paths.root, 'tsconfig.app.json');
37
37
  const tsConfig = require(tsConfigFile);
38
38
 
39
- const registerPkg = (localPkg) => {
40
- tools.logInfo(`Registering local package on element : ${localPkg.name}`);
41
- const pathBase = './packages';
39
+ const copyRootPkgDist = (localPkg) => {
40
+ tools.logInfo('Copying root pkg dist folder to remote node_modules');
42
41
 
43
- tsConfig['compilerOptions']['paths'][`${localPkg.npmPkgScope}/${localPkg.npmPkgName}`] = [`${pathBase}/${localPkg.folder || localPkg.name}/dist`];
44
- tsConfig['compilerOptions']['paths'][`${localPkg.npmPkgScope}/${localPkg.npmPkgName}/*`] = [`${pathBase}/${localPkg.folder || localPkg.name}/dist`];
42
+ const nmPath = path.join(pkg.paths.root, 'node_modules');
43
+ const nmPkgScopePath = path.join(nmPath, localPkg.npmPkgScope);
44
+ const nmPkgPath = path.join(nmPkgScopePath, localPkg.npmPkgName);
45
+ const pkgDistPath = path.join(localPkg.paths.root, 'dist');
46
+
47
+ if (!tools.isDirExists(pkgDistPath)) {
48
+ tools.logWarning(`Package dist folder can't be found, build it before serving the remote locally : ${pkgDistPath}`);
49
+ throw new Error('ROOT_PACKAGE_DIST_NOT_FOUND');
50
+ }
51
+
52
+ if (!tools.isDirExists(nmPkgPath)) {
53
+ tools.copydir(pkgDistPath, nmPkgPath);
54
+ }
45
55
  }
46
56
 
47
57
  if (pkg.registerLocalRootPkg && pkg.skeletonConfig) {
48
58
  const localPkg = configUtils.packages.getPackageByNpmPkg(pkg.skeletonConfig.rootNpmPkg);
49
- registerPkg(localPkg);
59
+ copyRootPkgDist(localPkg);
50
60
  }
51
61
 
52
62
  tools.writeJsonFileSync(tsConfigFile, tsConfig);