syncpack 13.0.1 → 13.0.2
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
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
> [!TIP]
|
|
10
|
-
> 🦀 A Rust rewrite is available to try at [`npm install -g syncpack@
|
|
10
|
+
> 🦀 A Rust rewrite is available to try at [`npm install -g syncpack@alpha`](https://github.com/JamieMason/syncpack/releases?q=14.0.0)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk-template';
|
|
2
2
|
import { Context, Effect, flow, pipe } from 'effect';
|
|
3
|
-
import { isObject } from 'tightrope/guard/is-object.js';
|
|
4
|
-
import { isUndefined } from 'tightrope/guard/is-undefined.js';
|
|
5
3
|
import { logIgnoredSize } from '../bin-lint-semver-ranges/lint-semver-ranges.js';
|
|
6
4
|
import { logMissingLocalVersion, logMissingSnappedToMismatch, logSameRangeMismatch, logUnsupportedMismatch, } from '../bin-list-mismatches/list-mismatches.js';
|
|
7
5
|
import { CliConfigTag } from '../config/tag.js';
|
|
@@ -73,7 +71,6 @@ export function fixMismatches({ io, cli, errorHandlers = defaultErrorHandlers, }
|
|
|
73
71
|
}
|
|
74
72
|
index++;
|
|
75
73
|
}
|
|
76
|
-
yield* $(removeEmptyObjects(ctx));
|
|
77
74
|
return ctx;
|
|
78
75
|
}), Effect.flatMap(writeIfChanged), Effect.catchTags({
|
|
79
76
|
WriteFileError: flow(errorHandlers.WriteFileError, Effect.map(() => {
|
|
@@ -85,22 +82,6 @@ export function fixMismatches({ io, cli, errorHandlers = defaultErrorHandlers, }
|
|
|
85
82
|
export function fixMismatch(report) {
|
|
86
83
|
return report.fixable.instance.write(report._tag === 'Banned' ? DELETE : report.fixable.raw);
|
|
87
84
|
}
|
|
88
|
-
/** Remove empty objects such as `{"dependencies": {}}` left after deleting */
|
|
89
|
-
function removeEmptyObjects(ctx) {
|
|
90
|
-
return Effect.sync(() => {
|
|
91
|
-
ctx.packageJsonFiles.forEach(file => {
|
|
92
|
-
const contents = file.jsonFile.contents;
|
|
93
|
-
Object.keys(contents).forEach(key => {
|
|
94
|
-
const value = contents[key];
|
|
95
|
-
if (isObject(value) &&
|
|
96
|
-
value &&
|
|
97
|
-
Object.values(value).every(isUndefined)) {
|
|
98
|
-
delete contents[key];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
85
|
export function logAlreadyValidSize(amount) {
|
|
105
86
|
const msg = chalk `${padStart(amount)} {green ${ICON.tick}} already valid`;
|
|
106
87
|
return Effect.logInfo(msg);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncpack",
|
|
3
3
|
"description": "Consistent dependency versions in large JavaScript Monorepos",
|
|
4
|
-
"version": "13.0.
|
|
4
|
+
"version": "13.0.2",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bin": {
|
|
7
7
|
"syncpack": "dist/bin.js",
|