virmator 8.0.5 → 9.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "8.0.5",
3
+ "version": "9.0.0",
4
4
  "description": "Handle common package configs, commands, and dependencies.",
5
5
  "keywords": [
6
6
  "automation",
@@ -43,25 +43,25 @@
43
43
  "test:types": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@augment-vir/common": "^19.4.0",
47
- "@augment-vir/node-js": "^19.4.0",
46
+ "@augment-vir/common": "^20.0.0",
47
+ "@augment-vir/node-js": "^20.0.0",
48
48
  "ansi-colors": "^4.1.3",
49
49
  "concurrently": "^8.2.1",
50
50
  "glob": "^8.1.0",
51
51
  "glob-promise": "^6.0.5",
52
52
  "semver": "^7.5.4",
53
53
  "simple-git": "^3.20.0",
54
- "type-fest": "^4.3.3"
54
+ "type-fest": "^4.4.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@electrovir/nyc": "15.1.0-fix0",
58
58
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
59
59
  "@open-wc/testing": "^3.2.0",
60
- "@types/chai": "^4.3.6",
60
+ "@types/chai": "^4.3.7",
61
61
  "@types/fs-extra": "^11.0.2",
62
62
  "@types/glob": "^8.1.0",
63
63
  "@types/mocha": "^10.0.2",
64
- "@types/node": "^20.8.2",
64
+ "@types/node": "^20.8.4",
65
65
  "@types/semver": "^7.5.3",
66
66
  "@web/dev-server-esbuild": "^0.4.1",
67
67
  "@web/test-runner": "^0.17.1",
@@ -70,7 +70,8 @@
70
70
  "@web/test-runner-visual-regression": "^0.8.2",
71
71
  "chai": "^4.3.10",
72
72
  "cspell": "^7.3.7",
73
- "element-vir": "^16.4.1",
73
+ "dependency-cruiser": "^14.1.1",
74
+ "element-vir": "^16.4.2",
74
75
  "esbuild": "^0.19.4",
75
76
  "fs-extra": "^11.1.1",
76
77
  "istanbul-smart-text-reporter": "^1.1.2",
@@ -90,10 +91,10 @@
90
91
  "test-established-expectations": "^0.5.0",
91
92
  "ts-node": "^10.9.1",
92
93
  "tsconfig-paths": "^4.2.0",
93
- "typedoc": "^0.25.1",
94
+ "typedoc": "^0.25.2",
94
95
  "typescript": "^5.2.2",
95
- "virmator": "^8.0.4",
96
- "vite": "^4.4.9",
96
+ "virmator": "^8.0.5",
97
+ "vite": "^4.4.11",
97
98
  "vite-tsconfig-paths": "^4.2.1"
98
99
  },
99
100
  "engines": {
@@ -1,33 +0,0 @@
1
- export declare const regenDepsCommandDefinition: {
2
- commandName: "regen-deps";
3
- subCommandDescriptions: {};
4
- configFiles: {};
5
- npmDeps: readonly [];
6
- } & {
7
- allAvailableSubCommands: readonly never[];
8
- subCommands: import("..").SubCommandsMap<{
9
- commandName: "regen-deps";
10
- subCommandDescriptions: {};
11
- configFiles: {};
12
- npmDeps: readonly [];
13
- }>;
14
- } & {
15
- executor: import("..").CommandExecutor<{
16
- commandName: "regen-deps";
17
- subCommandDescriptions: {};
18
- configFiles: {};
19
- npmDeps: readonly [];
20
- }>;
21
- createDescription: import("..").CreateDescriptionsCallback<{
22
- commandName: "regen-deps";
23
- subCommandDescriptions: {};
24
- configFiles: {};
25
- npmDeps: readonly [];
26
- }>;
27
- extend: import("../api/command/define-command").ExtendCallback<{
28
- commandName: "regen-deps";
29
- subCommandDescriptions: {};
30
- configFiles: {};
31
- npmDeps: readonly [];
32
- }>;
33
- };
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.regenDepsCommandDefinition = void 0;
4
- const common_1 = require("@augment-vir/common");
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");
9
- const define_command_1 = require("../api/command/define-command");
10
- const fs_2 = require("../augments/fs");
11
- exports.regenDepsCommandDefinition = (0, define_command_1.defineCommand)({
12
- commandName: 'regen-deps',
13
- subCommandDescriptions: {},
14
- configFiles: {},
15
- npmDeps: [],
16
- }, () => {
17
- return {
18
- sections: [
19
- {
20
- title: '',
21
- content: `Regenerates all npm deps.`,
22
- },
23
- ],
24
- examples: [],
25
- };
26
- }, async (inputs) => {
27
- const allChildNodeModules = await (0, node_js_1.readDirRecursive)(inputs.repoDir);
28
- const nodeModulesPaths = Array.from(new Set(allChildNodeModules
29
- .filter((path) => path.includes('node_modules'))
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
- }
62
- }));
63
- if (errorsHappened) {
64
- return {
65
- success: false,
66
- };
67
- }
68
- return {
69
- args: [
70
- 'npm',
71
- 'i',
72
- ],
73
- };
74
- });
@@ -1,89 +0,0 @@
1
- import { NpmDepTypeEnum } from '../api/command/define-command-inputs';
2
- export declare const upgradeDepsCommandDefinition: {
3
- commandName: "upgrade-deps";
4
- subCommandDescriptions: {};
5
- configFiles: {
6
- readonly ncuConfig: {
7
- readonly copyFromInternalPath: string;
8
- readonly copyToPathRelativeToRepoDir: string;
9
- };
10
- };
11
- npmDeps: readonly [{
12
- readonly name: "esbuild";
13
- readonly type: NpmDepTypeEnum.Dev;
14
- }, {
15
- readonly name: "npm-check-updates";
16
- readonly type: NpmDepTypeEnum.Dev;
17
- }];
18
- } & {
19
- allAvailableSubCommands: readonly never[];
20
- subCommands: import("../api/command/define-command-inputs").SubCommandsMap<{
21
- commandName: "upgrade-deps";
22
- subCommandDescriptions: {};
23
- configFiles: {
24
- readonly ncuConfig: {
25
- readonly copyFromInternalPath: string;
26
- readonly copyToPathRelativeToRepoDir: string;
27
- };
28
- };
29
- npmDeps: readonly [{
30
- readonly name: "esbuild";
31
- readonly type: NpmDepTypeEnum.Dev;
32
- }, {
33
- readonly name: "npm-check-updates";
34
- readonly type: NpmDepTypeEnum.Dev;
35
- }];
36
- }>;
37
- } & {
38
- executor: import("..").CommandExecutor<{
39
- commandName: "upgrade-deps";
40
- subCommandDescriptions: {};
41
- configFiles: {
42
- readonly ncuConfig: {
43
- readonly copyFromInternalPath: string;
44
- readonly copyToPathRelativeToRepoDir: string;
45
- };
46
- };
47
- npmDeps: readonly [{
48
- readonly name: "esbuild";
49
- readonly type: NpmDepTypeEnum.Dev;
50
- }, {
51
- readonly name: "npm-check-updates";
52
- readonly type: NpmDepTypeEnum.Dev;
53
- }];
54
- }>;
55
- createDescription: import("..").CreateDescriptionsCallback<{
56
- commandName: "upgrade-deps";
57
- subCommandDescriptions: {};
58
- configFiles: {
59
- readonly ncuConfig: {
60
- readonly copyFromInternalPath: string;
61
- readonly copyToPathRelativeToRepoDir: string;
62
- };
63
- };
64
- npmDeps: readonly [{
65
- readonly name: "esbuild";
66
- readonly type: NpmDepTypeEnum.Dev;
67
- }, {
68
- readonly name: "npm-check-updates";
69
- readonly type: NpmDepTypeEnum.Dev;
70
- }];
71
- }>;
72
- extend: import("../api/command/define-command").ExtendCallback<{
73
- commandName: "upgrade-deps";
74
- subCommandDescriptions: {};
75
- configFiles: {
76
- readonly ncuConfig: {
77
- readonly copyFromInternalPath: string;
78
- readonly copyToPathRelativeToRepoDir: string;
79
- };
80
- };
81
- npmDeps: readonly [{
82
- readonly name: "esbuild";
83
- readonly type: NpmDepTypeEnum.Dev;
84
- }, {
85
- readonly name: "npm-check-updates";
86
- readonly type: NpmDepTypeEnum.Dev;
87
- }];
88
- }>;
89
- };
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.upgradeDepsCommandDefinition = void 0;
27
- const node_js_1 = require("@augment-vir/node-js");
28
- const path_1 = require("path");
29
- const define_command_1 = require("../api/command/define-command");
30
- const define_command_inputs_1 = require("../api/command/define-command-inputs");
31
- const typescript_config_file_1 = require("../augments/typescript-config-file");
32
- const package_paths_1 = require("./../file-paths/package-paths");
33
- exports.upgradeDepsCommandDefinition = (0, define_command_1.defineCommand)({
34
- commandName: 'upgrade-deps',
35
- subCommandDescriptions: {},
36
- configFiles: {
37
- ncuConfig: {
38
- copyFromInternalPath: (0, path_1.join)(package_paths_1.virmatorConfigsDir, 'configs', 'ncu.config.ts'),
39
- copyToPathRelativeToRepoDir: (0, path_1.join)('configs', 'ncu.config.ts'),
40
- },
41
- },
42
- npmDeps: [
43
- { name: 'esbuild', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
44
- { name: 'npm-check-updates', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
45
- ],
46
- }, ({ commandName, packageBinName }) => {
47
- return {
48
- sections: [
49
- {
50
- title: '',
51
- content: `Upgrade all packages using npm-check-updates and config/ncu.config.ts.`,
52
- },
53
- ],
54
- examples: [
55
- {
56
- title: 'Run command',
57
- content: `${packageBinName} ${commandName}`,
58
- },
59
- ],
60
- };
61
- }, async ({ repoDir, configFiles }) => {
62
- const ncuConfigPath = (0, path_1.join)(repoDir, configFiles.ncuConfig.copyToPathRelativeToRepoDir);
63
- return await (0, typescript_config_file_1.withTypescriptConfigFile)(ncuConfigPath, async (loadedConfig) => {
64
- const repoPackageJson = await (0, node_js_1.readPackageJson)(repoDir);
65
- const config = loadedConfig.ncuConfig;
66
- await (await Promise.resolve().then(() => __importStar(require('npm-check-updates')))).run({
67
- ...config,
68
- cwd: repoDir,
69
- json: false,
70
- workspaces: !!repoPackageJson.workspaces,
71
- format: [],
72
- }, {
73
- cli: true,
74
- });
75
- return { success: true };
76
- });
77
- });