virmator 2.0.0 → 2.0.1

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractArguments = exports.fillInCliFlags = exports.flagDescriptions = exports.defaultCliFlags = exports.CliFlagName = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const cli_command_name_1 = require("./cli-command-name");
6
6
  var CliFlagName;
7
7
  (function (CliFlagName) {
@@ -28,11 +28,11 @@ function fillInCliFlags(inputFlags) {
28
28
  exports.fillInCliFlags = fillInCliFlags;
29
29
  function extractArguments(args) {
30
30
  const { inputFlags, invalidFlags, otherArgs, command } = args.reduce((accum, currentArg) => {
31
- if ((0, node_1.isEnumValue)(currentArg, cli_command_name_1.CliCommandName) && !accum.command) {
31
+ if ((0, augment_vir_1.isEnumValue)(currentArg, cli_command_name_1.CliCommandName) && !accum.command) {
32
32
  accum.command = currentArg;
33
33
  }
34
34
  else if (currentArg.startsWith('--')) {
35
- if ((0, node_1.isEnumValue)(currentArg, CliFlagName)) {
35
+ if ((0, augment_vir_1.isEnumValue)(currentArg, CliFlagName)) {
36
36
  accum.inputFlags[currentArg] = true;
37
37
  }
38
38
  else if (!accum.command) {
@@ -1,4 +1,4 @@
1
- import { ShellOutput } from 'augment-vir/dist/node';
1
+ import { ShellOutput } from 'augment-vir/dist/node-only';
2
2
  import { CommandFunctionInput } from '../commands/cli-command';
3
3
  export declare type OutputFilter = (toPrint: string) => string;
4
4
  export declare type Filters = {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runVirmatorShellCommand = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
5
  const defaultFilter = (input) => input;
6
6
  function outputWrapper(callback, filter) {
7
7
  return (input) => {
@@ -15,7 +15,7 @@ async function runVirmatorShellCommand(command, { repoDir: cwd, stdoutCallback,
15
15
  stdoutFilter: defaultFilter,
16
16
  stderrFilter: defaultFilter,
17
17
  }) {
18
- const shellResults = await (0, node_1.runShellCommand)(command, {
18
+ const shellResults = await (0, node_only_1.runShellCommand)(command, {
19
19
  cwd,
20
20
  stdoutCallback: outputWrapper(stdoutCallback, stdoutFilter),
21
21
  stderrCallback: outputWrapper(stderrCallback, stderrFilter),
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateConfigs = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const fs_1 = require("fs");
6
6
  const cli_command_1 = require("../commands/cli-command");
7
7
  const format_command_1 = require("../commands/implementations/format.command");
@@ -9,10 +9,10 @@ const copy_config_1 = require("../config/copy-config");
9
9
  const extendable_config_1 = require("../config/extendable-config");
10
10
  const cli_flags_1 = require("./cli-flags");
11
11
  async function updateConfigs(configKeysEnum, commandInputs) {
12
- const inputConfigFiles = (0, node_1.filterToEnumValues)(commandInputs.rawArgs, configKeysEnum);
12
+ const inputConfigFiles = (0, augment_vir_1.filterToEnumValues)(commandInputs.rawArgs, configKeysEnum);
13
13
  const configFilesToCopy = inputConfigFiles.length
14
14
  ? inputConfigFiles
15
- : (0, node_1.getEnumTypedValues)(configKeysEnum);
15
+ : (0, augment_vir_1.getEnumTypedValues)(configKeysEnum);
16
16
  let writtenFileCount = 0;
17
17
  const errors = [];
18
18
  await Promise.all(configFilesToCopy.map(async (configKey) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.allCliCommands = exports.runHelpCommand = exports.generateHelpMessage = exports.helpImplementation = exports.getUnsupportedFlags = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const cli_command_name_1 = require("../cli-util/cli-command-name");
6
6
  const cli_flags_1 = require("../cli-util/cli-flags");
7
7
  const description_printing_1 = require("./description-printing");
@@ -34,7 +34,7 @@ function createUnImplementedCommand(commandName) {
34
34
  };
35
35
  }
36
36
  function getUnsupportedFlags(currentFlags, flagSupport) {
37
- return (0, node_1.getObjectTypedKeys)(currentFlags).filter((currentFlag) => {
37
+ return (0, augment_vir_1.getObjectTypedKeys)(currentFlags).filter((currentFlag) => {
38
38
  if (currentFlags[currentFlag]) {
39
39
  return !flagSupport[currentFlag];
40
40
  }
@@ -61,13 +61,13 @@ exports.helpImplementation = {
61
61
  },
62
62
  };
63
63
  function generateHelpMessage(syntax) {
64
- const flagsMessage = (0, node_1.getEnumTypedValues)(cli_flags_1.CliFlagName)
64
+ const flagsMessage = (0, augment_vir_1.getEnumTypedValues)(cli_flags_1.CliFlagName)
65
65
  .sort()
66
66
  .map((flagName) => {
67
67
  return (0, description_printing_1.flagToHelpString)(flagName, cli_flags_1.flagDescriptions[flagName], syntax);
68
68
  })
69
69
  .join('\n');
70
- const commandsMessage = (0, node_1.getEnumTypedValues)(cli_command_name_1.CliCommandName)
70
+ const commandsMessage = (0, augment_vir_1.getEnumTypedValues)(cli_command_name_1.CliCommandName)
71
71
  .sort()
72
72
  .map((commandName) => {
73
73
  return (0, description_printing_1.commandToHelpString)(exports.allCliCommands[commandName], syntax);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runCodeInMarkdownCommand = exports.codeInMarkdownCommandImplementation = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
5
  const virmator_repo_paths_1 = require("../../../file-paths/virmator-repo-paths");
6
6
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
7
7
  const cli_flags_1 = require("../../cli-util/cli-flags");
@@ -42,7 +42,7 @@ exports.codeInMarkdownCommandImplementation = {
42
42
  const mdCodePath = (0, virmator_repo_paths_1.getNpmBinPath)('md-code');
43
43
  async function runCodeInMarkdownCommand(inputs) {
44
44
  const args = inputs.rawArgs.length
45
- ? (0, node_1.interpolationSafeWindowsPath)(inputs.rawArgs.join(' '))
45
+ ? (0, node_only_1.interpolationSafeWindowsPath)(inputs.rawArgs.join(' '))
46
46
  : `\"./**/*.md\"`;
47
47
  const mdCodeCommand = `${mdCodePath} ${args}`;
48
48
  const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(mdCodeCommand, inputs);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractFormatArgs = exports.runFormatCommand = exports.formatImplementation = exports.filesMarkerArg = exports.defaultFormatArgs = exports.FormatOperation = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const virmator_repo_paths_1 = require("../../../file-paths/virmator-repo-paths");
6
6
  const package_name_1 = require("../../../package-name");
7
7
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
@@ -109,11 +109,11 @@ async function runFormatCommand(inputs) {
109
109
  exports.runFormatCommand = runFormatCommand;
110
110
  function extractFormatArgs(rawArgs) {
111
111
  let addingFileExtensions = false;
112
- const operation = (0, node_1.isEnumValue)(rawArgs[0], FormatOperation)
112
+ const operation = (0, augment_vir_1.isEnumValue)(rawArgs[0], FormatOperation)
113
113
  ? rawArgs[0]
114
114
  : FormatOperation.Write;
115
115
  const extractedArgs = rawArgs.reduce((accum, currentRawArg, index) => {
116
- if (index === 0 && (0, node_1.isEnumValue)(rawArgs[index], FormatOperation)) {
116
+ if (index === 0 && (0, augment_vir_1.isEnumValue)(rawArgs[index], FormatOperation)) {
117
117
  return accum;
118
118
  }
119
119
  else if (currentRawArg === exports.filesMarkerArg) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runTestCommand = exports.testCommandImplementation = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
5
  const jest_config_path_1 = require("../../../exportable-jest-config/jest-config-path");
6
6
  const virmator_repo_paths_1 = require("../../../file-paths/virmator-repo-paths");
7
7
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
@@ -32,7 +32,7 @@ async function runTestCommand(inputs) {
32
32
  const args = inputs.rawArgs.length ? inputs.rawArgs.join(' ') : '';
33
33
  const configPath = args.includes('--config ') || args.includes('-c ')
34
34
  ? ''
35
- : `--config ${(0, node_1.interpolationSafeWindowsPath)(jest_config_path_1.virmatorJestConfigFilePath)}`;
35
+ : `--config ${(0, node_only_1.interpolationSafeWindowsPath)(jest_config_path_1.virmatorJestConfigFilePath)}`;
36
36
  const testCommand = `${jestPath} ${configPath} ${args}`;
37
37
  const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(testCommand, inputs);
38
38
  return {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runUpdateAllConfigsCommand = exports.updateAllConfigsCommandImplementation = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const package_name_1 = require("../../../package-name");
6
6
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
7
7
  const cli_flags_1 = require("../../cli-util/cli-flags");
@@ -21,7 +21,7 @@ exports.updateAllConfigsCommandImplementation = {
21
21
  },
22
22
  {
23
23
  title: 'list of possible arguments',
24
- content: (0, node_1.getEnumTypedValues)(config_key_1.ConfigKey).join('\n'),
24
+ content: (0, augment_vir_1.getEnumTypedValues)(config_key_1.ConfigKey).join('\n'),
25
25
  },
26
26
  ],
27
27
  examples: [
@@ -30,7 +30,7 @@ exports.updateAllConfigsCommandImplementation = {
30
30
  content: `${package_name_1.packageName} ${cli_command_name_1.CliCommandName.UpdateAllConfigs}`,
31
31
  },
32
32
  {
33
- title: `update only ${(0, node_1.joinWithFinalConjunction)(exampleFlags)} files`,
33
+ title: `update only ${(0, augment_vir_1.joinWithFinalConjunction)(exampleFlags)} files`,
34
34
  content: `${package_name_1.packageName} ${cli_command_name_1.CliCommandName.UpdateAllConfigs} ${exampleFlags.join(' ')}`,
35
35
  },
36
36
  ],
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runUpdateBareConfigsCommand = exports.updateBareConfigsCommandImplementation = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const package_name_1 = require("../../../package-name");
6
6
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
7
7
  const cli_flags_1 = require("../../cli-util/cli-flags");
@@ -21,7 +21,7 @@ exports.updateBareConfigsCommandImplementation = {
21
21
  },
22
22
  {
23
23
  title: 'list of possible arguments',
24
- content: (0, node_1.getEnumTypedValues)(config_key_1.BareConfigKey).join('\n'),
24
+ content: (0, augment_vir_1.getEnumTypedValues)(config_key_1.BareConfigKey).join('\n'),
25
25
  },
26
26
  ],
27
27
  examples: [
@@ -30,7 +30,7 @@ exports.updateBareConfigsCommandImplementation = {
30
30
  content: `${package_name_1.packageName} ${cli_command_name_1.CliCommandName.UpdateBareConfigs}`,
31
31
  },
32
32
  {
33
- title: `update only ${(0, node_1.joinWithFinalConjunction)(exampleFlags)} files`,
33
+ title: `update only ${(0, augment_vir_1.joinWithFinalConjunction)(exampleFlags)} files`,
34
34
  content: `${package_name_1.packageName} ${cli_command_name_1.CliCommandName.UpdateBareConfigs} ${exampleFlags.join(' ')},`,
35
35
  },
36
36
  ],
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.copyConfig = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
5
  const fs_extra_1 = require("fs-extra");
6
6
  const path_1 = require("path");
7
7
  const config_file_error_1 = require("../../errors/config-file-error");
@@ -39,7 +39,7 @@ async function copyConfig({ configKey, forceExtendableConfig, repoDir, }) {
39
39
  if (!repoConfigExists) {
40
40
  // if extender config file does not exist, create it
41
41
  const extenderContents = await (0, config_read_1.readUpdatedVirmatorConfigFile)(configKey, repoDir, true);
42
- await (0, node_1.writeFileAndDir)(repoConfigPath, extenderContents);
42
+ await (0, node_only_1.writeFileAndDir)(repoConfigPath, extenderContents);
43
43
  }
44
44
  const repoExtendableConfigPath = (0, path_1.join)(repoDir, (0, extendable_config_1.getExtendableBaseConfigName)(configKey));
45
45
  const repoExtendableConfigExists = (0, fs_extra_1.existsSync)(repoExtendableConfigPath);
@@ -89,7 +89,7 @@ async function copyConfig({ configKey, forceExtendableConfig, repoDir, }) {
89
89
  outputFilePath = repoConfigPath;
90
90
  }
91
91
  if (shouldWriteConfig) {
92
- await (0, node_1.writeFileAndDir)(outputFilePath, virmatorConfigContents);
92
+ await (0, node_only_1.writeFileAndDir)(outputFilePath, virmatorConfigContents);
93
93
  }
94
94
  return {
95
95
  logs,
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isConfigExtending = exports.isExtendableConfig = exports.getExtendableBaseConfigName = exports.ExtendableConfig = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const config_key_1 = require("./config-key");
6
6
  const extendableConfigFileMap = {
7
7
  [config_key_1.ConfigKey.Prettier]: '.prettierrc-base.js',
8
8
  [config_key_1.ConfigKey.Cspell]: '.cspell-base.json',
9
9
  [config_key_1.ConfigKey.TsConfig]: 'tsconfig-base.json',
10
10
  };
11
- exports.ExtendableConfig = (0, node_1.getObjectTypedKeys)(extendableConfigFileMap).reduce((accum, key) => {
11
+ exports.ExtendableConfig = (0, augment_vir_1.getObjectTypedKeys)(extendableConfigFileMap).reduce((accum, key) => {
12
12
  accum[key] = key;
13
13
  return accum;
14
14
  }, {});
@@ -23,7 +23,7 @@ function isExtendableConfig(ConfigKey) {
23
23
  if (!ConfigKey) {
24
24
  return false;
25
25
  }
26
- return (0, node_1.isEnumValue)(ConfigKey, exports.ExtendableConfig);
26
+ return (0, augment_vir_1.isEnumValue)(ConfigKey, exports.ExtendableConfig);
27
27
  }
28
28
  exports.isExtendableConfig = isExtendableConfig;
29
29
  function isConfigExtending(key, contents) {
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VirmatorCliCommandError = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const cli_command_name_1 = require("../cli/cli-util/cli-command-name");
6
6
  class VirmatorCliCommandError extends Error {
7
7
  name = 'VirmatorCliCommandError';
8
8
  constructor(message) {
9
- super(`${message}\nExpected one of the following: ${(0, node_1.getEnumTypedValues)(cli_command_name_1.CliCommandName).join(', ')}`);
9
+ super(`${message}\nExpected one of the following: ${(0, augment_vir_1.getEnumTypedValues)(cli_command_name_1.CliCommandName).join(', ')}`);
10
10
  }
11
11
  }
12
12
  exports.VirmatorCliCommandError = VirmatorCliCommandError;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CliFlagError = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const augment_vir_1 = require("augment-vir");
5
5
  const cli_flags_1 = require("../cli/cli-util/cli-flags");
6
6
  class CliFlagError extends Error {
7
7
  name = 'CliFlagError';
8
8
  constructor(invalidFlags) {
9
- super(`Invalid flags given: ${invalidFlags.join(',')}\nValid flags: ${(0, node_1.getObjectTypedKeys)(cli_flags_1.defaultCliFlags).join(',')}`);
9
+ super(`Invalid flags given: ${invalidFlags.join(',')}\nValid flags: ${(0, augment_vir_1.getObjectTypedKeys)(cli_flags_1.defaultCliFlags).join(',')}`);
10
10
  }
11
11
  }
12
12
  exports.CliFlagError = CliFlagError;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getNpmBinPath = exports.relativeSeparateConfigsDir = exports.extenderConfigsDir = exports.virmatorDistDir = exports.virmatorRootDir = void 0;
4
- const node_1 = require("augment-vir/dist/node");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
5
  const fs_1 = require("fs");
6
6
  const path_1 = require("path");
7
7
  exports.virmatorRootDir = __dirname.replace(/(?:src|node_modules\/dist|dist).*/, '');
@@ -14,6 +14,6 @@ function getNpmBinPath(command) {
14
14
  const actualBinPath = (0, fs_1.existsSync)(virmatorBinPath)
15
15
  ? virmatorBinPath
16
16
  : (0, path_1.join)(exports.virmatorRootDir, '..', '.bin', command);
17
- return (0, node_1.interpolationSafeWindowsPath)(actualBinPath);
17
+ return (0, node_only_1.interpolationSafeWindowsPath)(actualBinPath);
18
18
  }
19
19
  exports.getNpmBinPath = getNpmBinPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Handle all the stuffs in one package.",
5
5
  "keywords": [
6
6
  "automation",
@@ -40,31 +40,31 @@
40
40
  "test:help": "ts-node -r tsconfig-paths/register src/cli/cli.ts --help"
41
41
  },
42
42
  "dependencies": {
43
- "@types/jest": "^27.4.1",
43
+ "@types/jest": "27.4.1",
44
44
  "ansi-styles": "5.2.0",
45
- "augment-vir": "^1.5.1",
46
- "cspell": "^5.19.2",
47
- "fs-extra": "^10.0.1",
48
- "jest": "^27.5.1",
49
- "markdown-code-example-inserter": "^0.1.5",
50
- "prettier": "^2.6.0",
51
- "prettier-plugin-jsdoc": "^0.3.31",
52
- "prettier-plugin-multiline-arrays": "^0.0.3",
53
- "prettier-plugin-organize-imports": "^2.3.4",
54
- "prettier-plugin-packagejson": "^2.2.16",
55
- "prettier-plugin-sort-json": "^0.0.2",
56
- "simple-git": "^3.4.0",
57
- "ts-jest": "^27.1.3",
58
- "ts-node": "^10.7.0",
59
- "tsconfig-paths": "^3.14.0",
60
- "typescript": "^4.6.2"
45
+ "augment-vir": "1.7.0",
46
+ "cspell": "5.19.2",
47
+ "fs-extra": "10.0.1",
48
+ "jest": "27.5.1",
49
+ "markdown-code-example-inserter": "0.1.7",
50
+ "prettier": "2.6.0",
51
+ "prettier-plugin-jsdoc": "0.3.31",
52
+ "prettier-plugin-multiline-arrays": "0.0.4",
53
+ "prettier-plugin-organize-imports": "2.3.4",
54
+ "prettier-plugin-packagejson": "2.2.16",
55
+ "prettier-plugin-sort-json": "0.0.2",
56
+ "simple-git": "3.4.0",
57
+ "ts-jest": "27.1.3",
58
+ "ts-node": "10.7.0",
59
+ "tsconfig-paths": "3.14.0",
60
+ "typescript": "4.6.2"
61
61
  },
62
62
  "devDependencies": {
63
- "@types/fs-extra": "^9.0.13",
64
- "@types/node": "^17.0.21"
63
+ "@types/fs-extra": "9.0.13",
64
+ "@types/node": "17.0.21"
65
65
  },
66
66
  "engines": {
67
- "node": ">=12",
67
+ "node": ">=14",
68
68
  "npm": ">=7"
69
69
  }
70
70
  }