@zohodesk/codestandard-validator 1.2.4-exp-3 → 1.2.4-exp-5

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.
package/bin/cliCI.js CHANGED
@@ -6,8 +6,9 @@
6
6
  */
7
7
 
8
8
  (async function () {
9
- const { initConfig, getConfigPathExecute } = require('../build/utils/General/Config');
9
+ const { initConfig, getConfigPathExecute, postInstallExecution } = require('../build/utils/General/Config');
10
10
  await initConfig(getConfigPathExecute());
11
+ await postInstallExecution()
11
12
  await require('../build/chunk/chunk_Restriction');
12
13
  require('@zohodesk/codestandard-analytics/build/lib/runner');
13
14
  })();
@@ -45,7 +45,8 @@ function getServicePathElseCommon() {
45
45
  configurationPath: resolveServiceOrCommon(baseDir, repoName, 'index.js'),
46
46
  pathOfServiceSpecificEslintConfigFile: resolveServiceOrCommon(baseDir, repoName, '.eslintrc.js'),
47
47
  pluginVersionPath: resolveServiceOrCommon(baseDir, repoName, 'pluginVersion.js', null) || undefined,
48
- pathOfServiceSpecificCssConfigFile: resolveServiceOrCommon(baseDir, repoName, '.stylelintrc.js')
48
+ pathOfServiceSpecificCssConfigFile: resolveServiceOrCommon(baseDir, repoName, '.stylelintrc.js'),
49
+ initializationPath: resolveServiceOrCommon(baseDir, repoName, 'initializeScript.js')
49
50
  };
50
51
  }
51
52
  function getLintConfigurationUtil() {
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  const path = require('path');
4
- const {
5
- getServicePathElseCommon
6
- } = require('../ConfigFileUtils/getLintConfiguration');
7
4
  const {
8
5
  Logger
9
6
  } = require('../Logger/Logger');
@@ -13,13 +10,18 @@ function initConfig(actualConfigPath) {
13
10
  process.env.SONARQUBE = config.meticHandler_api_token;
14
11
  process.env.ZGIT_TOKEN = config.token;
15
12
  process.env.TOOL_TOKEN = config.toolToken;
13
+ }
14
+ function postInstallExecution() {
15
+ const {
16
+ getServicePathElseCommon
17
+ } = require('../ConfigFileUtils/getLintConfiguration');
16
18
  try {
17
19
  const {
18
- configurationPath
20
+ initializationPath
19
21
  } = getServicePathElseCommon();
20
22
  const {
21
23
  intialize
22
- } = require(configurationPath);
24
+ } = require(initializationPath);
23
25
  intialize();
24
26
  } catch (error) {
25
27
  Logger.log(Logger.FAILURE_TYPE, `Error while initialize configuration: ${error}`);
@@ -38,5 +40,6 @@ module.exports = {
38
40
  initConfig,
39
41
  getConfigPathExecute,
40
42
  getConfigPathPostInstall,
41
- getConfigObject
43
+ getConfigObject,
44
+ postInstallExecution
42
45
  };
@@ -32,7 +32,10 @@ function getAllPlugins() {
32
32
  } else {
33
33
  serviceSpecificPlugins = [];
34
34
  }
35
- return [...commonPlugins, ...serviceSpecificPlugins];
35
+ if (!Array.isArray(commonPlugins) || !Array.isArray(serviceSpecificPlugins)) {
36
+ Logger.log(Logger.FAILURE_TYPE, 'Plugin details should be in an array format in pluginVersion.js file');
37
+ }
38
+ return Object.assign([], commonPlugins, serviceSpecificPlugins);
36
39
  }
37
40
 
38
41
  /**
package/changeLog.md CHANGED
@@ -47,3 +47,7 @@
47
47
 
48
48
  1. ProjectId api revamp
49
49
  2. code standard analytics bin bind to code standard validator bin
50
+
51
+ # 1.2.4
52
+
53
+ 1. Refactor configuration loading and linting process, update mandatory rules handling, and improve pre-commit hook functionality
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "1.2.4-exp-3",
3
+ "version": "1.2.4-exp-5",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "type": "commonjs",
18
18
  "dependencies": {
19
19
  "@zohodesk-private/client_deployment_tool": "0.0.5",
20
- "@zohodesk/codestandard-analytics": "1.1.4-exp-2",
20
+ "@zohodesk/codestandard-analytics": "1.1.5",
21
21
  "@stryker-mutator/core": "5.0.0",
22
22
  "eslint": "8.26.0",
23
23
  "marked": "9.1.6",