@elliemae/ds-codemods 3.12.0-next.1 → 3.12.0-rc.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.
@@ -5,6 +5,9 @@ import {
5
5
  brightYellowStr,
6
6
  boldRedStr,
7
7
  boldBrightCyanStr,
8
+ brightCyanStr,
9
+ brightGreenStr,
10
+ redStr,
8
11
  } from '../../../utils/CLI_COLORS';
9
12
  import { getPackageJsonEmDsVersions } from './getPackageJsonEmDsVersions';
10
13
  import {
@@ -35,29 +38,54 @@ export const checkPackagesInconsistencies = async (options) => {
35
38
  const pathToFileToProcess = globArray(csvGlobs, globOptions);
36
39
  const { latestVersionParsed } = await getLatestDimsumVersion();
37
40
 
41
+ console.log(
42
+ brightCyanStr(
43
+ `detected latest dimsum version: ${yellowStr(`${latestVersionParsed.major}.${latestVersionParsed.minor}.X`)}`,
44
+ ),
45
+ );
38
46
  pathToFileToProcess.forEach((path) => {
47
+ console.log(`checking ${path} for incosistencies...`);
39
48
  const fileContent = fs.readFileSync(path, {
40
49
  encoding: 'utf8',
41
50
  flag: 'r',
42
51
  });
43
52
  if (fileContent && typeof fileContent === 'string') {
44
53
  const { matches } = getPackageJsonEmDsVersions(fileContent);
45
- const highestVersion = getHighestMatchVersion(matches);
46
- const { errors, hasErrors } = getErrors(highestVersion, matches);
47
- if (hasErrors) {
48
- console.log(yellowStr('Your Package json has some Elliemae dimsum inconsistencies'));
49
- console.log(errors);
50
- console.log(yellowStr('Please solve them as soon as possible to avoid unexpected errors'));
51
- }
52
- const shouldUpdateToNewest =
53
- highestVersion.major < latestVersionParsed.major ||
54
- (highestVersion.major === latestVersionParsed.major && highestVersion.minor < latestVersionParsed.minor - 6);
55
- if (shouldUpdateToNewest) {
56
- console.log(boldBrightYellowBgRedStr('We detected that you are using a version that is too outdated'));
57
- console.log(brightYellowStr(`Detected (highest) version:`, boldRedStr(highestVersion.fullVersion)));
58
- console.log(brightYellowStr(`Latest version:`, boldBrightCyanStr(latestVersionParsed.fullVersion)));
59
- console.log(boldBrightYellowBgRedStr('Please update to the newest version release as soon as possible!'));
54
+ if (matches) {
55
+ console.log(brightCyanStr(`Found dimsum dependencies:`), matches);
56
+ const highestVersion = getHighestMatchVersion(matches);
57
+ console.log(`checking for incosistencies...`);
58
+ const { errors, hasErrors } = getErrors(highestVersion, matches);
59
+
60
+ if (hasErrors) {
61
+ console.log(yellowStr('Your Package json has some Elliemae dimsum inconsistencies'));
62
+ console.log(errors);
63
+ console.log(yellowStr('Please solve them as soon as possible to avoid unexpected errors'));
64
+ } else {
65
+ console.log(yellowStr('no dimsum incosistencies detected!'));
66
+ }
67
+ console.log(`checking for outdated version...`);
68
+ const shouldUpdateToNewest =
69
+ highestVersion.major < latestVersionParsed.major ||
70
+ (highestVersion.major === latestVersionParsed.major && highestVersion.minor < latestVersionParsed.minor - 6);
71
+ if (shouldUpdateToNewest) {
72
+ console.log(boldBrightYellowBgRedStr('We detected that you are using a version that is too outdated'));
73
+ console.log(brightYellowStr(`Detected (highest) version:`, boldRedStr(highestVersion.fullVersion)));
74
+ console.log(brightYellowStr(`Latest version:`, boldBrightCyanStr(latestVersionParsed.fullVersion)));
75
+ console.log(boldBrightYellowBgRedStr('Please update to the newest version release as soon as possible!'));
76
+ } else {
77
+ console.log(yellowStr('you are using an aceptable dimsum version!'));
78
+ }
79
+ if (!hasErrors && !shouldUpdateToNewest) console.log(brightGreenStr('no immediate action is required!'));
80
+ if (highestVersion.minor !== latestVersionParsed.minor)
81
+ console.log(
82
+ brightYellowStr(
83
+ '\tstill, please consider updating to latest version as soon as possible to avoid more difficult updates in the future!',
84
+ ),
85
+ );
60
86
  }
87
+ } else {
88
+ console.log(redStr(`failed to load package.json file, are you executing this in the right directory?`));
61
89
  }
62
90
  });
63
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-codemods",
3
- "version": "3.12.0-next.1",
3
+ "version": "3.12.0-rc.0",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Code Mods",
6
6
  "files": [