virmator 6.3.4 → 6.4.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.
- package/README.md +8 -0
- package/base-configs/base-cspell.js +1 -0
- package/configs/configs/ncu.config.ts +11 -0
- package/configs/configs/web-test-runner.config.mjs +1 -1
- package/dist/commands/extra-configs/all-extra-configs.js +0 -4
- package/dist/commands/upgrade-deps.command.d.ts +58 -0
- package/dist/commands/upgrade-deps.command.js +76 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +2 -0
- package/package.json +9 -7
- package/configs/.ncurc.js +0 -4
package/README.md
CHANGED
|
@@ -171,3 +171,11 @@ run web tests with code coverage calculations
|
|
|
171
171
|
## update-configs
|
|
172
172
|
|
|
173
173
|
Update all existing configuration files that virmator is able to update. (Like base config files.)
|
|
174
|
+
|
|
175
|
+
## upgrade-deps
|
|
176
|
+
|
|
177
|
+
Upgrade all packages using npm-check-updates and config/ncu.config.ts.
|
|
178
|
+
|
|
179
|
+
### Examples
|
|
180
|
+
|
|
181
|
+
- Run command: `virmator upgrade-deps`
|
|
@@ -17,5 +17,5 @@ export default webTestRunnerConfig;
|
|
|
17
17
|
|
|
18
18
|
// check if the current file is being run directly as a script
|
|
19
19
|
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
20
|
-
console.info(JSON.stringify(webTestRunnerConfig));
|
|
20
|
+
console.info(JSON.stringify(webTestRunnerConfig, null, 4));
|
|
21
21
|
}
|
|
@@ -16,10 +16,6 @@ exports.nonCommandConfigs = [
|
|
|
16
16
|
copyToPathRelativeToRepoDir: '.nvmrc',
|
|
17
17
|
updateExistingConfigFileCallback: (newContents) => newContents,
|
|
18
18
|
},
|
|
19
|
-
{
|
|
20
|
-
copyFromInternalPath: (0, path_1.join)(package_paths_1.virmatorConfigsDir, '.ncurc.js'),
|
|
21
|
-
copyToPathRelativeToRepoDir: '.ncurc.js',
|
|
22
|
-
},
|
|
23
19
|
{
|
|
24
20
|
copyFromInternalPath: (0, path_1.join)(package_paths_1.virmatorConfigsDir, 'LICENSE-MIT'),
|
|
25
21
|
copyToPathRelativeToRepoDir: 'LICENSE-MIT',
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const upgradeDepsCommandDefinition: {
|
|
2
|
+
commandName: "upgrade-deps";
|
|
3
|
+
subCommandDescriptions: {};
|
|
4
|
+
configFiles: {
|
|
5
|
+
readonly ncuConfig: {
|
|
6
|
+
readonly copyFromInternalPath: string;
|
|
7
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
11
|
+
} & {
|
|
12
|
+
allAvailableSubCommands: readonly never[];
|
|
13
|
+
subCommands: import("..").SubCommandsMap<{
|
|
14
|
+
commandName: "upgrade-deps";
|
|
15
|
+
subCommandDescriptions: {};
|
|
16
|
+
configFiles: {
|
|
17
|
+
readonly ncuConfig: {
|
|
18
|
+
readonly copyFromInternalPath: string;
|
|
19
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
23
|
+
}>;
|
|
24
|
+
} & {
|
|
25
|
+
executor: import("..").CommandExecutor<{
|
|
26
|
+
commandName: "upgrade-deps";
|
|
27
|
+
subCommandDescriptions: {};
|
|
28
|
+
configFiles: {
|
|
29
|
+
readonly ncuConfig: {
|
|
30
|
+
readonly copyFromInternalPath: string;
|
|
31
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
35
|
+
}>;
|
|
36
|
+
createDescription: import("..").CreateDescriptionsCallback<{
|
|
37
|
+
commandName: "upgrade-deps";
|
|
38
|
+
subCommandDescriptions: {};
|
|
39
|
+
configFiles: {
|
|
40
|
+
readonly ncuConfig: {
|
|
41
|
+
readonly copyFromInternalPath: string;
|
|
42
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
46
|
+
}>;
|
|
47
|
+
extend: import("../api/command/define-command").ExtendCallback<{
|
|
48
|
+
commandName: "upgrade-deps";
|
|
49
|
+
subCommandDescriptions: {};
|
|
50
|
+
configFiles: {
|
|
51
|
+
readonly ncuConfig: {
|
|
52
|
+
readonly copyFromInternalPath: string;
|
|
53
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
57
|
+
}>;
|
|
58
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upgradeDepsCommandDefinition = void 0;
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
6
|
+
const esbuild_1 = require("esbuild");
|
|
7
|
+
const promises_1 = require("fs/promises");
|
|
8
|
+
const npm_check_updates_1 = require("npm-check-updates");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const define_command_1 = require("../api/command/define-command");
|
|
11
|
+
const package_paths_1 = require("./../file-paths/package-paths");
|
|
12
|
+
exports.upgradeDepsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
13
|
+
commandName: 'upgrade-deps',
|
|
14
|
+
subCommandDescriptions: {},
|
|
15
|
+
configFiles: {
|
|
16
|
+
ncuConfig: {
|
|
17
|
+
copyFromInternalPath: (0, path_1.join)(package_paths_1.virmatorConfigsDir, 'configs', 'ncu.config.ts'),
|
|
18
|
+
copyToPathRelativeToRepoDir: (0, path_1.join)('configs', 'ncu.config.ts'),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
npmDeps: [
|
|
22
|
+
'npm-check-updates',
|
|
23
|
+
],
|
|
24
|
+
}, ({ commandName, packageBinName }) => {
|
|
25
|
+
return {
|
|
26
|
+
sections: [
|
|
27
|
+
{
|
|
28
|
+
title: '',
|
|
29
|
+
content: `Upgrade all packages using npm-check-updates and config/ncu.config.ts.`,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
examples: [
|
|
33
|
+
{
|
|
34
|
+
title: 'Run command',
|
|
35
|
+
content: `${packageBinName} ${commandName}`,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}, async (inputs) => {
|
|
40
|
+
const tempFilePath = (0, path_1.join)(__dirname, `config-output-${Date.now()}-${(0, node_js_1.randomString)()}.cjs`);
|
|
41
|
+
try {
|
|
42
|
+
const configPath = (0, path_1.join)(inputs.repoDir, inputs.configFiles.ncuConfig.copyToPathRelativeToRepoDir);
|
|
43
|
+
await (0, esbuild_1.build)({
|
|
44
|
+
entryPoints: [configPath],
|
|
45
|
+
outfile: tempFilePath,
|
|
46
|
+
write: true,
|
|
47
|
+
target: ['node18'],
|
|
48
|
+
platform: 'node',
|
|
49
|
+
bundle: true,
|
|
50
|
+
format: 'cjs',
|
|
51
|
+
});
|
|
52
|
+
const repoPackageJson = await (0, node_js_1.readPackageJson)(inputs.repoDir);
|
|
53
|
+
const loadedConfig = require(tempFilePath);
|
|
54
|
+
const config = loadedConfig.ncuConfig;
|
|
55
|
+
await (0, npm_check_updates_1.run)({
|
|
56
|
+
...config,
|
|
57
|
+
cwd: inputs.repoDir,
|
|
58
|
+
json: false,
|
|
59
|
+
workspaces: !!repoPackageJson.workspaces,
|
|
60
|
+
format: [],
|
|
61
|
+
}, {
|
|
62
|
+
cli: true,
|
|
63
|
+
});
|
|
64
|
+
return { success: true };
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
console.error((0, common_1.extractErrorMessage)(error));
|
|
68
|
+
return { success: false };
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
try {
|
|
72
|
+
await (0, promises_1.unlink)(tempFilePath);
|
|
73
|
+
}
|
|
74
|
+
catch (error) { }
|
|
75
|
+
}
|
|
76
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -607,6 +607,63 @@ export declare const virmator: Readonly<{
|
|
|
607
607
|
configFiles: {};
|
|
608
608
|
npmDeps: readonly [];
|
|
609
609
|
}>;
|
|
610
|
+
}) | ({
|
|
611
|
+
commandName: "upgrade-deps";
|
|
612
|
+
subCommandDescriptions: {};
|
|
613
|
+
configFiles: {
|
|
614
|
+
readonly ncuConfig: {
|
|
615
|
+
readonly copyFromInternalPath: string;
|
|
616
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
620
|
+
} & {
|
|
621
|
+
allAvailableSubCommands: readonly never[];
|
|
622
|
+
subCommands: import("./api/command/define-command-inputs").SubCommandsMap<{
|
|
623
|
+
commandName: "upgrade-deps";
|
|
624
|
+
subCommandDescriptions: {};
|
|
625
|
+
configFiles: {
|
|
626
|
+
readonly ncuConfig: {
|
|
627
|
+
readonly copyFromInternalPath: string;
|
|
628
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
632
|
+
}>;
|
|
633
|
+
} & {
|
|
634
|
+
executor: import("./api/command/command-executor").CommandExecutor<{
|
|
635
|
+
commandName: "upgrade-deps";
|
|
636
|
+
subCommandDescriptions: {};
|
|
637
|
+
configFiles: {
|
|
638
|
+
readonly ncuConfig: {
|
|
639
|
+
readonly copyFromInternalPath: string;
|
|
640
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
644
|
+
}>;
|
|
645
|
+
createDescription: import("./api/command/command-description").CreateDescriptionsCallback<{
|
|
646
|
+
commandName: "upgrade-deps";
|
|
647
|
+
subCommandDescriptions: {};
|
|
648
|
+
configFiles: {
|
|
649
|
+
readonly ncuConfig: {
|
|
650
|
+
readonly copyFromInternalPath: string;
|
|
651
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
655
|
+
}>;
|
|
656
|
+
extend: import("./api/command/define-command").ExtendCallback<{
|
|
657
|
+
commandName: "upgrade-deps";
|
|
658
|
+
subCommandDescriptions: {};
|
|
659
|
+
configFiles: {
|
|
660
|
+
readonly ncuConfig: {
|
|
661
|
+
readonly copyFromInternalPath: string;
|
|
662
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
npmDeps: readonly ["npm-check-updates"];
|
|
666
|
+
}>;
|
|
610
667
|
}))[]>;
|
|
611
668
|
extend: <CommandDefinitionsGeneric extends readonly import("./api/command/define-command").AnyCommandDefinition[]>(inputs: Readonly<{
|
|
612
669
|
packageBinName: string;
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ const spellcheck_command_1 = require("./commands/spellcheck.command");
|
|
|
26
26
|
const test_web_command_1 = require("./commands/test-web.command");
|
|
27
27
|
const test_command_1 = require("./commands/test.command");
|
|
28
28
|
const update_configs_command_1 = require("./commands/update-configs.command");
|
|
29
|
+
const upgrade_deps_command_1 = require("./commands/upgrade-deps.command");
|
|
29
30
|
const package_paths_1 = require("./file-paths/package-paths");
|
|
30
31
|
__exportStar(require("./api/command/command-description"), exports);
|
|
31
32
|
__exportStar(require("./api/command/command-executor"), exports);
|
|
@@ -57,5 +58,6 @@ exports.virmator = (0, create_virmator_1.createVirmator)({
|
|
|
57
58
|
test_command_1.testCommandDefinition,
|
|
58
59
|
test_web_command_1.testWebCommandDefinition,
|
|
59
60
|
update_configs_command_1.updateConfigsCommandDefinition,
|
|
61
|
+
upgrade_deps_command_1.upgradeDepsCommandDefinition,
|
|
60
62
|
],
|
|
61
63
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virmator",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Handle common package configs, commands, and dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"format": "npm run format:base -- --write --list-different",
|
|
36
36
|
"format:base": "prettier \"./**/*.+(ts|json|html|css|md|js)\"",
|
|
37
37
|
"publish": "virmator publish \"npm run test:all\"",
|
|
38
|
-
"test": "test-as-package mocha --config mocha.config.js",
|
|
38
|
+
"test": "npm run compile && test-as-package mocha --config mocha.config.js",
|
|
39
39
|
"test:all": "npm ci && npm run compile && npm run test && npm ci && npm run test:spelling -- --no-progress && npm run test:format && npm run docs:check",
|
|
40
40
|
"test:format": "npm run format:base -- --check",
|
|
41
41
|
"test:help": "ts-node src/cli/cli.ts --help",
|
|
@@ -62,18 +62,20 @@
|
|
|
62
62
|
"@types/mocha": "^10.0.1",
|
|
63
63
|
"@types/node": "^18.15.11",
|
|
64
64
|
"@types/semver": "^7.3.13",
|
|
65
|
-
"@web/dev-server-esbuild": "^0.3.
|
|
66
|
-
"@web/test-runner": "^0.15.
|
|
67
|
-
"@web/test-runner-commands": "^0.6.
|
|
65
|
+
"@web/dev-server-esbuild": "^0.3.6",
|
|
66
|
+
"@web/test-runner": "^0.15.3",
|
|
67
|
+
"@web/test-runner-commands": "^0.6.6",
|
|
68
68
|
"@web/test-runner-playwright": "^0.9.0",
|
|
69
|
-
"@web/test-runner-visual-regression": "^0.7.
|
|
69
|
+
"@web/test-runner-visual-regression": "^0.7.1",
|
|
70
70
|
"chai": "^4.3.7",
|
|
71
71
|
"cspell": "^6.31.1",
|
|
72
|
+
"esbuild": "^0.17.15",
|
|
72
73
|
"fs-extra": "^11.1.1",
|
|
73
74
|
"istanbul-smart-text-reporter": "^1.1.1",
|
|
74
75
|
"markdown-code-example-inserter": "^0.3.0",
|
|
75
76
|
"mocha": "^10.2.0",
|
|
76
77
|
"mocha-spec-reporter-with-file-names": "^0.0.3",
|
|
78
|
+
"npm-check-updates": "^16.10.2",
|
|
77
79
|
"prettier": "^2.8.7",
|
|
78
80
|
"prettier-plugin-interpolated-html-tags": "^0.0.3",
|
|
79
81
|
"prettier-plugin-jsdoc": "^0.4.2",
|
|
@@ -87,7 +89,7 @@
|
|
|
87
89
|
"ts-node": "^10.9.1",
|
|
88
90
|
"tsconfig-paths": "^4.2.0",
|
|
89
91
|
"typescript": "^5.0.3",
|
|
90
|
-
"virmator": "^6.3.
|
|
92
|
+
"virmator": "^6.3.4",
|
|
91
93
|
"vite": "^4.2.1",
|
|
92
94
|
"vite-tsconfig-paths": "^4.0.8"
|
|
93
95
|
},
|
package/configs/.ncurc.js
DELETED