@tramvai/tools-check-versions 0.3.12 → 0.3.16
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/README.md +11 -12
- package/bin/check-versions.js +1 -1
- package/lib/checkVersions.js +13 -13
- package/lib/checkVersions.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Tool for checking module versions in the tramvai application
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Various conflicts and compatibility errors may rise when using _mismatched_ versions of the tramvai dependencies. That's way this tool exists.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The tool checks that all of the tramvai dependencies are consistent in `package.json` for the app. That includes checks for mismatched versions between different dependencies and checks for mismatched versions in `package.json` and real versions that are resolved in dependency tree.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Пример невалидного списка зависимостей:
|
|
7
|
+
Example of the wrong dependencies:
|
|
10
8
|
|
|
11
9
|
```json
|
|
12
10
|
"dependencies": {
|
|
13
|
-
"@tramvai/core": "0.5.0", //
|
|
11
|
+
"@tramvai/core": "0.5.0", // the most fresh version. The error will be thrown with the suggestion to update other dependencies
|
|
14
12
|
"@tramvai/module-common": "0.4.2",
|
|
15
13
|
"@tramvai/module-router": "0.4.2",
|
|
16
14
|
"@tramvai/state": "0.4.2",
|
|
17
15
|
}
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
## Prerelease
|
|
18
|
+
## Prerelease versions
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
пример валидного списка зависимостей:
|
|
20
|
+
Prerelease versions often used for the testing. The tool will recognize prerelease versions for the tramvai dependencies and won't count this as mismatched in case all of the prerelease versions are higher than other stable versions.
|
|
24
21
|
|
|
25
22
|
```json
|
|
26
23
|
"dependencies": {
|
|
27
|
-
"@tramvai/core": "0.5.0-rc.2", // release candidate
|
|
24
|
+
"@tramvai/core": "0.5.0-rc.2", // release candidate version. The version is higher than other dependencies, so no error will be generated
|
|
28
25
|
"@tramvai/module-common": "0.4.2",
|
|
29
26
|
"@tramvai/module-router": "0.4.2",
|
|
30
27
|
"@tramvai/state": "0.4.2",
|
|
31
28
|
}
|
|
32
29
|
```
|
|
33
30
|
|
|
34
|
-
##
|
|
31
|
+
## Patterns for the related dependencies
|
|
32
|
+
|
|
33
|
+
Packages with the name that matches the following patterns are considered related and for these packages the `@tramvai/tools-check-versions` will execute checks
|
|
35
34
|
|
|
36
35
|
- `/^@tramvai\/core$/`
|
|
37
36
|
- `/^@tramvai\/module-/`
|
package/bin/check-versions.js
CHANGED
package/lib/checkVersions.js
CHANGED
|
@@ -4,11 +4,11 @@ exports.checkVersions = void 0;
|
|
|
4
4
|
const logger_1 = require("@tinkoff/logger");
|
|
5
5
|
const log = logger_1.logger('tramvai-check-versions');
|
|
6
6
|
const checkVersions = (depsVersions) => {
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
7
|
+
// Pre-release versions must be processed separately,
|
|
8
|
+
// for them it is enough to check that they are higher,
|
|
9
|
+
// than other stable versions.
|
|
10
|
+
// If all versions of the tramvai libraries of the application will be pre-release,
|
|
11
|
+
// they will not be compared to each other.
|
|
12
12
|
const prereleaseDepsVersions = new Map();
|
|
13
13
|
let maxVersion;
|
|
14
14
|
let hasWrongVersions = false;
|
|
@@ -30,18 +30,18 @@ const checkVersions = (depsVersions) => {
|
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
if (!hasWrongVersions) {
|
|
33
|
-
log.info('
|
|
33
|
+
log.info('The tramvai versions are okay!');
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
log.error(
|
|
36
|
+
log.error(`The versions of the tramvai modules do not match!
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
1.
|
|
40
|
-
2.
|
|
41
|
-
3.
|
|
42
|
-
4.
|
|
38
|
+
It is necessary to do the following:
|
|
39
|
+
1. Check package.json and set the package versions to a fixed version "${maxVersion.raw}" for the packages listed below
|
|
40
|
+
2. Update the lock file with the command "npm i" or "yarn"
|
|
41
|
+
3. If after upgrading the error still occurs - check the lock file for incorrect versions and maybe rebuild the lock file
|
|
42
|
+
4. If there is no version of a package when you upgrade, it is probably an outdated package and you should look up for the replacement at https://tramvai.dev/docs/releases/migration.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
List of packages to update:
|
|
45
45
|
`);
|
|
46
46
|
depsVersions.forEach((version, name) => {
|
|
47
47
|
if (maxVersion.compare(version) !== 0) {
|
package/lib/checkVersions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkVersions.js","sourceRoot":"","sources":["../src/checkVersions.ts"],"names":[],"mappings":";;;AACA,4CAAyC;AAEzC,MAAM,GAAG,GAAG,eAAM,CAAC,wBAAwB,CAAC,CAAC;AAEtC,MAAM,aAAa,GAAG,CAAC,YAAiC,EAAE,EAAE;IACjE,qDAAqD;IACrD,
|
|
1
|
+
{"version":3,"file":"checkVersions.js","sourceRoot":"","sources":["../src/checkVersions.ts"],"names":[],"mappings":";;;AACA,4CAAyC;AAEzC,MAAM,GAAG,GAAG,eAAM,CAAC,wBAAwB,CAAC,CAAC;AAEtC,MAAM,aAAa,GAAG,CAAC,YAAiC,EAAE,EAAE;IACjE,qDAAqD;IACrD,uDAAuD;IACvD,8BAA8B;IAC9B,mFAAmF;IACnF,2CAA2C;IAC3C,MAAM,sBAAsB,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC9D,IAAI,UAAkB,CAAC;IACvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;QACrC,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,sBAAsB,CAAC,GAAG,CA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IACpC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEhB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;AA/DW,QAAA,aAAa,iBA+DxB"}
|
package/lib/index.js
CHANGED
|
@@ -8,7 +8,7 @@ const checkVersions_1 = require("./checkVersions");
|
|
|
8
8
|
const log = logger_1.logger('tramvai-check-versions');
|
|
9
9
|
logger_1.logger.enable('info', 'tramvai-check-versions');
|
|
10
10
|
const run = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
log.info('
|
|
11
|
+
log.info('Checking the versions of tramvai modules in the application');
|
|
12
12
|
const depsVersions = yield getTramvaiDepsVersions_1.getTramvaiDepsVersions();
|
|
13
13
|
checkVersions_1.checkVersions(depsVersions);
|
|
14
14
|
});
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,qEAAkE;AAClE,mDAAgD;AAEhD,MAAM,GAAG,GAAG,eAAM,CAAC,wBAAwB,CAAC,CAAC;AAE7C,eAAM,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEzC,MAAM,GAAG,GAAG,GAAS,EAAE;IAC5B,GAAG,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,4CAAyC;AACzC,qEAAkE;AAClE,mDAAgD;AAEhD,MAAM,GAAG,GAAG,eAAM,CAAC,wBAAwB,CAAC,CAAC;AAE7C,eAAM,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEzC,MAAM,GAAG,GAAG,GAAS,EAAE;IAC5B,GAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IAExE,MAAM,YAAY,GAAG,MAAM,+CAAsB,EAAE,CAAC;IAEpD,6BAAa,CAAC,YAAY,CAAC,CAAC;AAC9B,CAAC,CAAA,CAAC;AANW,QAAA,GAAG,OAMd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/tools-check-versions",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@tinkoff/logger": "0.10.
|
|
15
|
+
"@tinkoff/logger": "0.10.12",
|
|
16
16
|
"@tinkoff/utils": "^2.1.2",
|
|
17
17
|
"fs-extra": "^9.0.0",
|
|
18
18
|
"p-map": "^4.0.0",
|