@eui/tools 6.2.21 → 6.2.22

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.2.21
1
+ 6.2.22
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.2.22 (2022-11-14)
2
+
3
+ ##### Bug Fixes
4
+
5
+ * **other:**
6
+ * virtual host building issue - MWP-9010 [MWP-9010](https://webgate.ec.europa.eu/CITnet/jira/browse/MWP-9010) ([4e158dbf](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/4e158dbf0995cd9e5cf6b83ac51f0999ceab2b87))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.2.21 (2022-11-14)
2
11
 
3
12
  ##### Bug Fixes
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const lintAppUtils = require('../../scripts/utils/lint/app/lint-app-utils');
4
+
5
+ Promise.resolve()
6
+ .then(() => {
7
+ return lintAppUtils.run();
8
+ })
9
+ .catch((e) => {
10
+ console.error(e);
11
+ process.exit(1);
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.2.21",
3
+ "version": "6.2.22",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -87,12 +87,15 @@ module.exports.init = () => {
87
87
 
88
88
  // clone or install linked host package to project if any
89
89
  .then(() => {
90
- if (finalResponse.project && !build) {
90
+ // TODO
91
+ // if (finalResponse.project && !build) {
92
+ if (finalResponse.project) {
91
93
  return initUtils.packages.cloneHostPackage(finalResponse.project);
92
-
93
- } else if (finalResponse.project && build) {
94
- return initUtils.packages.installHostPackage(finalResponse.project);
95
94
  }
95
+ // TODO
96
+ // } else if (finalResponse.project && build) {
97
+ // return initUtils.packages.installHostPackage(finalResponse.project);
98
+ // }
96
99
  })
97
100
 
98
101
  // Initializing .meta based on .euirc.json for local respoisitories cloning
@@ -92,7 +92,7 @@ module.exports.cloneHostPackage = (projectName) => {
92
92
  return;
93
93
  }
94
94
 
95
- tools.logTitle('Installing host package');
95
+ tools.logTitle('Initializing host package');
96
96
 
97
97
  let pkg;
98
98
 
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ const tools = require('../../tools');
6
+ const configUtils = require('../../../csdr/config/config-utils');
7
+
8
+ let {
9
+ skipLint, skipTest, baseHref, maxSpaceSize, sourceMap,
10
+ } = tools.getArgs();
11
+
12
+
13
+ const getProjectInfos = () => {
14
+ // getting the project from installed config
15
+ const prj = configUtils.projects.getProject();
16
+
17
+ // exit if project can't be found in the local installed config
18
+ if (!prj) {
19
+ tools.logError('ERROR!!! Unable to find project to be used');
20
+ tools.logInfo('usage : eui-scripts build-app <project-name>');
21
+ throw new Error('PROJECT_NOT_FOUND');
22
+ }
23
+
24
+ return prj;
25
+ };
26
+
27
+
28
+ module.exports.run = () => {
29
+
30
+ const currentProject = getProjectInfos();
31
+
32
+ const ng = path.resolve(currentProject.paths.nodeModulesPath, '@angular', 'cli', 'bin', 'ng');
33
+
34
+ // getting param from project config
35
+ if (currentProject.build) {
36
+ if (currentProject.build.skipLint) {
37
+ skipLint = true;
38
+ }
39
+ if (currentProject.build.skipTest) {
40
+ skipTest = true;
41
+ }
42
+ if (currentProject.build.maxSpaceSize) {
43
+ maxSpaceSize = true;
44
+ }
45
+ if (currentProject.build.sourceMap) {
46
+ sourceMap = true;
47
+ }
48
+ // getting baseHref from project config, dynamic or staticly defined
49
+ baseHref = configUtils.projects.getBaseHref(currentProject, version, baseHref);
50
+ tools.logInfo(`base-href found : ${baseHref}`);
51
+ }
52
+
53
+
54
+ return Promise.resolve()
55
+ .then(() => {
56
+ if (!skipLint) {
57
+ tools.logInfo(`TS Linting application...`);
58
+ let tsLintPath = currentProject.paths.tslintPath;
59
+ let esLintPath = currentProject.paths.eslintPath;
60
+
61
+ // TODO: remove TSLint since it's deprecated and should not be used by projects in the future
62
+ if(tsLintPath) {
63
+ tsLintPath = path.join(tsLintPath);
64
+ let tsConfigPath = path.join(currentProject.paths.angularPath, 'tsconfig.app.json');
65
+ tools.logWarning('TSLint is deprecated and will be removed in the future. Consider migrating to ESLint')
66
+ if (!tools.isFileExists(tsConfigPath)) {
67
+ tsConfigPath = path.join(currentProject.paths.angularPath, 'src', 'tsconfig.app.json');
68
+ }
69
+ if (tools.isFileExists(tsConfigPath)) {
70
+ tools.logInfo(`running tslint -c ${tsLintPath} -p ${tsConfigPath}`);
71
+ return tools.runScript(`tslint -c ${tsLintPath} -p ${tsConfigPath}`);
72
+ }
73
+ } else if (esLintPath) {
74
+ // the project path information are located inside the .eslintrc.json
75
+ tools.logInfo(`running ng lint ${currentProject.name}`);
76
+ return tools.runScript(`ng lint ${currentProject.name}`);
77
+ } else {
78
+ tools.logError(`No ESLint or TSLint configuration found for the project`);
79
+ }
80
+
81
+ }
82
+ })
83
+
84
+ .catch((e) => {
85
+ throw e;
86
+ })
87
+ }