virmator 7.2.2 → 7.2.4
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.
|
@@ -7,10 +7,10 @@ exports.noCommandLogging = {
|
|
|
7
7
|
};
|
|
8
8
|
exports.defaultConsoleLogging = {
|
|
9
9
|
stdout: (input) => {
|
|
10
|
-
|
|
10
|
+
process.stdout.write(input.replace(/\n$/, '') + '\n');
|
|
11
11
|
},
|
|
12
12
|
stderr: (input) => {
|
|
13
|
-
|
|
13
|
+
process.stderr.write(input.replace(/\n$/, '') + '\n');
|
|
14
14
|
},
|
|
15
15
|
};
|
|
16
16
|
const identityCommandLogTransform = (input) => input;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.regenDepsCommandDefinition = void 0;
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
4
5
|
const node_js_1 = require("@augment-vir/node-js");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const promises_1 = require("fs/promises");
|
|
8
|
+
const path_1 = require("path");
|
|
5
9
|
const define_command_1 = require("../api/command/define-command");
|
|
6
|
-
const
|
|
10
|
+
const fs_2 = require("../augments/fs");
|
|
7
11
|
exports.regenDepsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
8
12
|
commandName: 'regen-deps',
|
|
9
13
|
subCommandDescriptions: {},
|
|
@@ -21,12 +25,46 @@ exports.regenDepsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
|
21
25
|
};
|
|
22
26
|
}, async (inputs) => {
|
|
23
27
|
const allChildNodeModules = await (0, node_js_1.readDirRecursive)(inputs.repoDir);
|
|
24
|
-
const nodeModulesPaths = new Set(allChildNodeModules
|
|
28
|
+
const nodeModulesPaths = Array.from(new Set(allChildNodeModules
|
|
25
29
|
.filter((path) => path.includes('node_modules'))
|
|
26
|
-
.map((path) => path.replace(/([\\\/]|^)node_modules[\\\/].+$/, '$1node_modules')));
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
.map((path) => path.replace(/([\\\/]|^)node_modules[\\\/].+$/, '$1node_modules'))));
|
|
31
|
+
const packageLockPath = (0, path_1.join)(inputs.repoDir, 'package-lock.json');
|
|
32
|
+
const removePackageLock = (0, fs_1.existsSync)(packageLockPath);
|
|
33
|
+
const logLines = [
|
|
34
|
+
'Removing node_modules:',
|
|
35
|
+
...nodeModulesPaths.map((nodeModulesPath) => ` ${nodeModulesPath}`),
|
|
36
|
+
removePackageLock ? '\nRemoving package-lock.json' : '',
|
|
37
|
+
].filter(common_1.isTruthy);
|
|
38
|
+
inputs.logging.stdout((0, node_js_1.toLogString)({
|
|
39
|
+
args: [
|
|
40
|
+
logLines.join('\n'),
|
|
41
|
+
],
|
|
42
|
+
colors: node_js_1.ColorKey.faint,
|
|
43
|
+
}));
|
|
44
|
+
let errorsHappened = false;
|
|
45
|
+
if (removePackageLock) {
|
|
46
|
+
try {
|
|
47
|
+
await (0, promises_1.unlink)(packageLockPath);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
errorsHappened = true;
|
|
51
|
+
inputs.logging.stderr('Failed to remove package-lock.json.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
await Promise.all(nodeModulesPaths.map(async (nodeModulesPath) => {
|
|
55
|
+
try {
|
|
56
|
+
await (0, fs_2.removeDirectory)(nodeModulesPath);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
errorsHappened = true;
|
|
60
|
+
inputs.logging.stderr('Failed to remove package-lock.json.');
|
|
61
|
+
}
|
|
29
62
|
}));
|
|
63
|
+
if (errorsHappened) {
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
30
68
|
return {
|
|
31
69
|
args: [
|
|
32
70
|
'npm',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virmator",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.4",
|
|
4
4
|
"description": "Handle common package configs, commands, and dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"test:types": "tsc --noEmit"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@augment-vir/common": "^15.
|
|
47
|
-
"@augment-vir/node-js": "^15.
|
|
46
|
+
"@augment-vir/common": "^15.4.0",
|
|
47
|
+
"@augment-vir/node-js": "^15.4.0",
|
|
48
48
|
"ansi-colors": "^4.1.3",
|
|
49
49
|
"concurrently": "^8.2.0",
|
|
50
50
|
"glob": "^8.1.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"ts-node": "^10.9.1",
|
|
92
92
|
"tsconfig-paths": "^4.2.0",
|
|
93
93
|
"typescript": "^5.1.6",
|
|
94
|
-
"virmator": "^7.2.
|
|
94
|
+
"virmator": "^7.2.3",
|
|
95
95
|
"vite": "^4.4.4",
|
|
96
96
|
"vite-tsconfig-paths": "^4.2.0"
|
|
97
97
|
},
|