virmator 12.0.0 → 12.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.
Files changed (36) hide show
  1. package/dist/api/command/command-configs.js +1 -2
  2. package/dist/api/command/command-executor.js +1 -2
  3. package/dist/api/command/command-mapping.js +1 -2
  4. package/dist/api/command/command-messages.js +1 -2
  5. package/dist/api/command/command-to-help-message.js +4 -4
  6. package/dist/api/command/define-command.js +1 -2
  7. package/dist/api/config/config-paths.js +1 -2
  8. package/dist/api/config/copy-config.js +3 -3
  9. package/dist/api/create-virmator.js +1 -2
  10. package/dist/api/run-command/check-npm-deps.js +1 -2
  11. package/dist/api/run-command/extract-arguments.js +2 -3
  12. package/dist/api/run-command/run-command-executor.js +2 -3
  13. package/dist/api/run-command/run-extended-virmator.js +1 -2
  14. package/dist/api/run-command/run-shell-command.js +1 -2
  15. package/dist/augments/array.js +1 -2
  16. package/dist/augments/console.js +2 -3
  17. package/dist/augments/fs.js +5 -5
  18. package/dist/augments/git.js +1 -2
  19. package/dist/augments/json.js +1 -2
  20. package/dist/augments/npm.js +3 -4
  21. package/dist/augments/object.js +3 -4
  22. package/dist/augments/path.js +1 -2
  23. package/dist/augments/prettier.js +1 -2
  24. package/dist/augments/regexp.js +1 -2
  25. package/dist/augments/string.js +1 -2
  26. package/dist/augments/typescript-config-file.js +2 -3
  27. package/dist/commands/docs.command.js +1 -1
  28. package/dist/commands/extra-configs/combine-json-config.js +1 -2
  29. package/dist/commands/extra-configs/combine-text-config.js +1 -2
  30. package/dist/commands/extra-configs/create-default-package-json.js +1 -2
  31. package/dist/compiled-base-configs/base-dep-cruiser.config.js +1 -2
  32. package/dist/compiled-base-configs/base-vite.js +5 -5
  33. package/dist/compiled-base-configs/vite-always-reload-plugin.js +1 -2
  34. package/dist/file-paths/package-paths.js +2 -2
  35. package/dist/index.d.ts +2 -15
  36. package/package.json +9 -9
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractAllConfigs = void 0;
3
+ exports.extractAllConfigs = extractAllConfigs;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  function extractAllConfigs(commandMapping) {
6
6
  const configFiles = (0, common_1.getObjectTypedValues)(commandMapping)
@@ -8,4 +8,3 @@ function extractAllConfigs(commandMapping) {
8
8
  .flat();
9
9
  return configFiles;
10
10
  }
11
- exports.extractAllConfigs = extractAllConfigs;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isCompletedExecutor = void 0;
3
+ exports.isCompletedExecutor = isCompletedExecutor;
4
4
  function isCompletedExecutor(executorOutput) {
5
5
  return 'success' in executorOutput;
6
6
  }
7
- exports.isCompletedExecutor = isCompletedExecutor;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commandsToMapping = void 0;
3
+ exports.commandsToMapping = commandsToMapping;
4
4
  function commandsToMapping(commands) {
5
5
  return commands.reduce((mapping, currentCommandDefinition) => {
6
6
  mapping[currentCommandDefinition.commandName] = currentCommandDefinition;
7
7
  return mapping;
8
8
  }, {});
9
9
  }
10
- exports.commandsToMapping = commandsToMapping;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCommandResultMessage = void 0;
3
+ exports.getCommandResultMessage = getCommandResultMessage;
4
4
  const node_js_1 = require("@augment-vir/node-js");
5
5
  function getCommandResultMessage(commandName, success) {
6
6
  const specificColor = success ? node_js_1.logColors.success : node_js_1.logColors.error;
7
7
  const specificPhrase = success ? 'succeeded' : 'failed';
8
8
  return `${node_js_1.logColors.bold}${specificColor}${commandName} ${specificPhrase}.${node_js_1.logColors.reset}`;
9
9
  }
10
- exports.getCommandResultMessage = getCommandResultMessage;
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commandToHelpString = exports.flagToHelpString = exports.generateHelpMessage = exports.HelpMessageSyntax = void 0;
3
+ exports.HelpMessageSyntax = void 0;
4
+ exports.generateHelpMessage = generateHelpMessage;
5
+ exports.flagToHelpString = flagToHelpString;
6
+ exports.commandToHelpString = commandToHelpString;
4
7
  const common_1 = require("@augment-vir/common");
5
8
  const node_js_1 = require("@augment-vir/node-js");
6
9
  var HelpMessageSyntax;
@@ -24,7 +27,6 @@ function generateHelpMessage(packageBinName, commandDefinitions, syntax, cliWrap
24
27
  ? wrapLines(helpMessage, cliWrapIfMoreThanThisManyColumns)
25
28
  : helpMessage;
26
29
  }
27
- exports.generateHelpMessage = generateHelpMessage;
28
30
  const formatting = ((input) => input)({
29
31
  h1: {
30
32
  [HelpMessageSyntax.Cli]: `${node_js_1.logColors.info}`,
@@ -77,7 +79,6 @@ function flagToHelpString(flagName, description, syntax) {
77
79
  const format = (key) => formatWithSyntax(key, syntax);
78
80
  return `${indent(1, syntax)}${format('h2')}${code(flagName, false, '', syntax)}${format('reset')}${format('colon')}\n${indent(2, syntax)}${description.trim()}`;
79
81
  }
80
- exports.flagToHelpString = flagToHelpString;
81
82
  function commandToHelpString(packageBinName, commandDefinition, syntax) {
82
83
  const commandDescription = commandDefinition.createDescription({
83
84
  packageBinName,
@@ -91,7 +92,6 @@ function commandToHelpString(packageBinName, commandDefinition, syntax) {
91
92
  const subCommandDescriptions = subCommandDescriptionsToMessage(commandDefinition.subCommandDescriptions, syntax);
92
93
  return `${title}\n${description}\n${subCommandDescriptions}\n`;
93
94
  }
94
- exports.commandToHelpString = commandToHelpString;
95
95
  function subCommandDescriptionsToMessage(subCommandDescriptions, syntax) {
96
96
  return (0, common_1.getObjectTypedKeys)(subCommandDescriptions).reduce((accum, currentKey, index) => {
97
97
  const keyDescription = subCommandDescriptions[currentKey];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineCommand = void 0;
3
+ exports.defineCommand = defineCommand;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  function defineCommand(defineCommandInputs, createDescription, inputExecutor) {
6
6
  const allAvailableSubCommands = (0, common_1.getObjectTypedKeys)(defineCommandInputs.subCommandDescriptions);
@@ -39,4 +39,3 @@ function defineCommand(defineCommandInputs, createDescription, inputExecutor) {
39
39
  extend,
40
40
  };
41
41
  }
42
- exports.defineCommand = defineCommand;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCopyToPath = void 0;
3
+ exports.getCopyToPath = getCopyToPath;
4
4
  const path_1 = require("path");
5
5
  function getCopyToPath({ repoDir, configFileDefinition }) {
6
6
  return (0, path_1.join)(repoDir, configFileDefinition.copyToPathRelativeToRepoDir);
7
7
  }
8
- exports.getCopyToPath = getCopyToPath;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copyAllConfigFiles = exports.copyConfig = exports.CopyConfigOperation = void 0;
3
+ exports.CopyConfigOperation = void 0;
4
+ exports.copyConfig = copyConfig;
5
+ exports.copyAllConfigFiles = copyAllConfigFiles;
4
6
  const common_1 = require("@augment-vir/common");
5
7
  const node_js_1 = require("@augment-vir/node-js");
6
8
  const fs_1 = require("fs");
@@ -55,7 +57,6 @@ async function copyConfig(inputs) {
55
57
  shouldWrite,
56
58
  };
57
59
  }
58
- exports.copyConfig = copyConfig;
59
60
  const successfulOperation = {
60
61
  [CopyConfigOperation.Init]: 'copied',
61
62
  [CopyConfigOperation.Overwrite]: 'overwrote',
@@ -95,4 +96,3 @@ async function copyAllConfigFiles(inputs) {
95
96
  });
96
97
  return !errors.length;
97
98
  }
98
- exports.copyAllConfigFiles = copyAllConfigFiles;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createVirmator = void 0;
3
+ exports.createVirmator = createVirmator;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  const command_configs_1 = require("./command/command-configs");
6
6
  const command_mapping_1 = require("./command/command-mapping");
@@ -65,4 +65,3 @@ function createVirmator(inputs) {
65
65
  run,
66
66
  };
67
67
  }
68
- exports.createVirmator = createVirmator;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.updateDepsAsNeeded = void 0;
26
+ exports.updateDepsAsNeeded = updateDepsAsNeeded;
27
27
  const common_1 = require("@augment-vir/common");
28
28
  const node_js_1 = require("@augment-vir/node-js");
29
29
  const fs_1 = require("fs");
@@ -49,7 +49,6 @@ async function updateDepsAsNeeded(inputs) {
49
49
  throw new Error(`Failed to update deps: ${(0, common_1.extractErrorMessage)(error)}`);
50
50
  }
51
51
  }
52
- exports.updateDepsAsNeeded = updateDepsAsNeeded;
53
52
  function cleanDepVersion(input) {
54
53
  if (input === '*') {
55
54
  return '*';
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractSubCommands = exports.getRelevantArgs = void 0;
3
+ exports.getRelevantArgs = getRelevantArgs;
4
+ exports.extractSubCommands = extractSubCommands;
4
5
  const path_1 = require("path");
5
6
  const array_1 = require("../../augments/array");
6
7
  function getRelevantArgs(allArgs, binName) {
@@ -15,7 +16,6 @@ function getRelevantArgs(allArgs, binName) {
15
16
  const sliceIndexStart = binWasFound ? binIndex : firstJsOrTsWasFound ? firstJsOrTsIndex : 0;
16
17
  return allArgs.slice(sliceIndexStart + 1);
17
18
  }
18
- exports.getRelevantArgs = getRelevantArgs;
19
19
  function extractSubCommands(allArgs, availableSubCommands) {
20
20
  let stillInSubCommands = true;
21
21
  return allArgs.reduce((accum, currentArg) => {
@@ -34,4 +34,3 @@ function extractSubCommands(allArgs, availableSubCommands) {
34
34
  return accum;
35
35
  }, { subCommands: [], filteredArgs: [] });
36
36
  }
37
- exports.extractSubCommands = extractSubCommands;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommandExecutor = exports.createCommandString = void 0;
3
+ exports.createCommandString = createCommandString;
4
+ exports.runCommandExecutor = runCommandExecutor;
4
5
  const common_1 = require("@augment-vir/common");
5
6
  const node_js_1 = require("@augment-vir/node-js");
6
7
  const path_1 = require("path");
@@ -22,7 +23,6 @@ function createCommandString(executorOutput) {
22
23
  const commandString = `${args.filter(common_1.isTruthy).join(' ')}`;
23
24
  return commandString;
24
25
  }
25
- exports.createCommandString = createCommandString;
26
26
  async function runCommandExecutor(commandDefinition, commandInputs) {
27
27
  console.info(`${node_js_1.logColors.info}running ${commandDefinition.commandName}...${node_js_1.logColors.reset}`);
28
28
  await (0, copy_config_1.copyAllConfigFiles)({
@@ -48,4 +48,3 @@ async function runCommandExecutor(commandDefinition, commandInputs) {
48
48
  return commandResult.exitCode === 0;
49
49
  }
50
50
  }
51
- exports.runCommandExecutor = runCommandExecutor;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runExtendedVirmator = void 0;
3
+ exports.runExtendedVirmator = runExtendedVirmator;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  const command_logging_1 = require("../command/command-logging");
6
6
  const command_messages_1 = require("../command/command-messages");
@@ -51,4 +51,3 @@ async function runExtendedVirmator({ allArgs, allConfigs, commandMapping, packag
51
51
  throw new Error(resultMessage);
52
52
  }
53
53
  }
54
- exports.runExtendedVirmator = runExtendedVirmator;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runVirmatorShellCommand = void 0;
3
+ exports.runVirmatorShellCommand = runVirmatorShellCommand;
4
4
  const node_js_1 = require("@augment-vir/node-js");
5
5
  const command_logging_1 = require("../command/command-logging");
6
6
  function logWrapper(handleLog, logTransformer) {
@@ -19,4 +19,3 @@ async function runVirmatorShellCommand(command, { repoDir: cwd, logging, logTran
19
19
  });
20
20
  return shellResults;
21
21
  }
22
- exports.runVirmatorShellCommand = runVirmatorShellCommand;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isInTypedArray = void 0;
3
+ exports.isInTypedArray = isInTypedArray;
4
4
  function isInTypedArray(input, array) {
5
5
  return array.includes(input);
6
6
  }
7
- exports.isInTypedArray = isInTypedArray;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.askQuestionUntilConditionMet = exports.askQuestion = void 0;
3
+ exports.askQuestion = askQuestion;
4
+ exports.askQuestionUntilConditionMet = askQuestionUntilConditionMet;
4
5
  const readline_1 = require("readline");
5
6
  async function askQuestion(questionToAsk, timeoutMs = 60_000) {
6
7
  const cliInterface = (0, readline_1.createInterface)({
@@ -23,7 +24,6 @@ async function askQuestion(questionToAsk, timeoutMs = 60_000) {
23
24
  });
24
25
  });
25
26
  }
26
- exports.askQuestion = askQuestion;
27
27
  async function askQuestionUntilConditionMet({ questionToAsk, conditionCallback, invalidInputMessage, tryCountMax = 5, timeoutMs = 60_000, }) {
28
28
  let wasConditionMet = false;
29
29
  let retryCount = 0;
@@ -41,4 +41,3 @@ async function askQuestionUntilConditionMet({ questionToAsk, conditionCallback,
41
41
  }
42
42
  return response;
43
43
  }
44
- exports.askQuestionUntilConditionMet = askQuestionUntilConditionMet;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recursivelyUpwardsSearchForDir = exports.writeFiles = exports.readAllDirContents = exports.systemRootPath = exports.removeDirectory = void 0;
3
+ exports.systemRootPath = void 0;
4
+ exports.removeDirectory = removeDirectory;
5
+ exports.readAllDirContents = readAllDirContents;
6
+ exports.writeFiles = writeFiles;
7
+ exports.recursivelyUpwardsSearchForDir = recursivelyUpwardsSearchForDir;
4
8
  const common_1 = require("@augment-vir/common");
5
9
  const fs_1 = require("fs");
6
10
  const fs_extra_1 = require("fs-extra");
@@ -18,7 +22,6 @@ async function removeDirectory(dirPath) {
18
22
  await (0, fs_extra_1.remove)(dirPath);
19
23
  }
20
24
  }
21
- exports.removeDirectory = removeDirectory;
22
25
  exports.systemRootPath = (0, path_1.parse)(process.cwd()).root;
23
26
  async function readAllDirContents({ dir, recursive = false, }) {
24
27
  const fileNames = await (0, promises_1.readdir)(dir);
@@ -38,7 +41,6 @@ async function readAllDirContents({ dir, recursive = false, }) {
38
41
  }, {});
39
42
  return mappedFileContents;
40
43
  }
41
- exports.readAllDirContents = readAllDirContents;
42
44
  async function writeFiles(dir, allFileContents) {
43
45
  await (0, common_1.awaitedForEach)(Object.keys(allFileContents), async (fileOrDirName) => {
44
46
  const value = allFileContents[fileOrDirName];
@@ -54,7 +56,6 @@ async function writeFiles(dir, allFileContents) {
54
56
  }
55
57
  });
56
58
  }
57
- exports.writeFiles = writeFiles;
58
59
  async function recursivelyUpwardsSearchForDir(startDirPath, check) {
59
60
  if (!(0, fs_1.existsSync)(startDirPath) || !startDirPath) {
60
61
  throw new Error(`Could not search in "${startDirPath}": it does not exist.`);
@@ -68,4 +69,3 @@ async function recursivelyUpwardsSearchForDir(startDirPath, check) {
68
69
  }
69
70
  return recursivelyUpwardsSearchForDir(parent, check);
70
71
  }
71
- exports.recursivelyUpwardsSearchForDir = recursivelyUpwardsSearchForDir;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.doChangesExist = void 0;
3
+ exports.doChangesExist = doChangesExist;
4
4
  const node_js_1 = require("@augment-vir/node-js");
5
5
  async function doChangesExist(repoDirPath) {
6
6
  const getChangesCommand = `git status --porcelain=v1 2>/dev/null`;
@@ -10,4 +10,3 @@ async function doChangesExist(repoDirPath) {
10
10
  });
11
11
  return !!getChangesOutput.stdout;
12
12
  }
13
- exports.doChangesExist = doChangesExist;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonParseOrUndefined = void 0;
3
+ exports.jsonParseOrUndefined = jsonParseOrUndefined;
4
4
  function jsonParseOrUndefined(input) {
5
5
  try {
6
6
  return JSON.parse(input);
@@ -9,4 +9,3 @@ function jsonParseOrUndefined(input) {
9
9
  return undefined;
10
10
  }
11
11
  }
12
- exports.jsonParseOrUndefined = jsonParseOrUndefined;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readTopLevelPackageJson = exports.readPackageJson = exports.findTopLevelPackageJsonFile = void 0;
3
+ exports.findTopLevelPackageJsonFile = findTopLevelPackageJsonFile;
4
+ exports.readPackageJson = readPackageJson;
5
+ exports.readTopLevelPackageJson = readTopLevelPackageJson;
4
6
  const common_1 = require("@augment-vir/common");
5
7
  const fs_1 = require("fs");
6
8
  const promises_1 = require("fs/promises");
@@ -22,7 +24,6 @@ function findTopLevelPackageJsonFile(startDir) {
22
24
  return undefined;
23
25
  }
24
26
  }
25
- exports.findTopLevelPackageJsonFile = findTopLevelPackageJsonFile;
26
27
  async function readPackageJson(packageJsonPath) {
27
28
  let parsed;
28
29
  try {
@@ -39,7 +40,6 @@ async function readPackageJson(packageJsonPath) {
39
40
  }
40
41
  return parsed;
41
42
  }
42
- exports.readPackageJson = readPackageJson;
43
43
  async function readTopLevelPackageJson(startDir) {
44
44
  const topLevelPackageJsonPath = findTopLevelPackageJsonFile(startDir);
45
45
  if (!topLevelPackageJsonPath) {
@@ -50,4 +50,3 @@ async function readTopLevelPackageJson(startDir) {
50
50
  path: topLevelPackageJsonPath,
51
51
  };
52
52
  }
53
- exports.readTopLevelPackageJson = readTopLevelPackageJson;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterToDifferentValues = exports.deeplyCombineObjects = exports.filterObject = void 0;
3
+ exports.filterObject = filterObject;
4
+ exports.deeplyCombineObjects = deeplyCombineObjects;
5
+ exports.filterToDifferentValues = filterToDifferentValues;
4
6
  const common_1 = require("@augment-vir/common");
5
7
  function filterObject(fullObject, callback) {
6
8
  return (0, common_1.getObjectTypedKeys)(fullObject).reduce((accum, key) => {
@@ -11,7 +13,6 @@ function filterObject(fullObject, callback) {
11
13
  return accum;
12
14
  }, {});
13
15
  }
14
- exports.filterObject = filterObject;
15
16
  function deeplyCombineObjects(originalObject, overwriteObject) {
16
17
  return (0, common_1.getObjectTypedKeys)(overwriteObject).reduce((accum, currentKey) => {
17
18
  const currentNewValue = overwriteObject[currentKey];
@@ -25,7 +26,6 @@ function deeplyCombineObjects(originalObject, overwriteObject) {
25
26
  return accum;
26
27
  }, originalObject);
27
28
  }
28
- exports.deeplyCombineObjects = deeplyCombineObjects;
29
29
  function filterToDifferentValues(baseObject, changedObject) {
30
30
  return (0, common_1.getObjectTypedKeys)(baseObject).reduce((accum, key) => {
31
31
  const beforeValue = baseObject[key];
@@ -42,4 +42,3 @@ function filterToDifferentValues(baseObject, changedObject) {
42
42
  return accum;
43
43
  }, {});
44
44
  }
45
- exports.filterToDifferentValues = filterToDifferentValues;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFirstPartOfPath = void 0;
3
+ exports.getFirstPartOfPath = getFirstPartOfPath;
4
4
  const path_1 = require("path");
5
5
  function getFirstPartOfPath(inputPath) {
6
6
  const split = inputPath.split(path_1.sep);
@@ -10,4 +10,3 @@ function getFirstPartOfPath(inputPath) {
10
10
  }
11
11
  return firstPart;
12
12
  }
13
- exports.getFirstPartOfPath = getFirstPartOfPath;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.formatCode = void 0;
26
+ exports.formatCode = formatCode;
27
27
  const fs_1 = require("fs");
28
28
  const path_1 = require("path");
29
29
  async function formatCode(text, filePath) {
@@ -41,7 +41,6 @@ async function formatCode(text, filePath) {
41
41
  return text;
42
42
  }
43
43
  }
44
- exports.formatCode = formatCode;
45
44
  function findNearestConfig(dir) {
46
45
  const currentDirConfig = (0, path_1.join)(dir, '.prettierrc.js');
47
46
  if ((0, fs_1.existsSync)(currentDirConfig)) {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sanitizeStringForRegExpCreation = void 0;
3
+ exports.sanitizeStringForRegExpCreation = sanitizeStringForRegExpCreation;
4
4
  function sanitizeStringForRegExpCreation(inputString) {
5
5
  return inputString.replace(/\//g, '\\/').replace(/(\(|\)|\[|\]|\.|\}|\{|\||\+)/g, '\\$1');
6
6
  }
7
- exports.sanitizeStringForRegExpCreation = sanitizeStringForRegExpCreation;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureNonEmptyString = void 0;
3
+ exports.ensureNonEmptyString = ensureNonEmptyString;
4
4
  function ensureNonEmptyString(inputString) {
5
5
  if (!inputString) {
6
6
  throw new Error(`Expected a non-empty string.`);
7
7
  }
8
8
  return inputString;
9
9
  }
10
- exports.ensureNonEmptyString = ensureNonEmptyString;
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.compileTs = exports.withTypescriptConfigFile = void 0;
26
+ exports.withTypescriptConfigFile = withTypescriptConfigFile;
27
+ exports.compileTs = compileTs;
27
28
  const promises_1 = require("fs/promises");
28
29
  const path_1 = require("path");
29
30
  async function withTypescriptConfigFile(configPath, callback) {
@@ -40,7 +41,6 @@ async function withTypescriptConfigFile(configPath, callback) {
40
41
  catch (error) { }
41
42
  }
42
43
  }
43
- exports.withTypescriptConfigFile = withTypescriptConfigFile;
44
44
  function createOutfilePath(inputFilePath) {
45
45
  return (0, path_1.join)((0, path_1.dirname)(inputFilePath), [
46
46
  'generated-config',
@@ -60,4 +60,3 @@ async function compileTs({ inputPath, outputPath, }) {
60
60
  });
61
61
  return outfile;
62
62
  }
63
- exports.compileTs = compileTs;
@@ -139,7 +139,7 @@ async function runTypeDoc(options, packageBinName, typeDoc) {
139
139
  return true;
140
140
  }
141
141
  else if (app.options.getValue('help')) {
142
- console.info(app.options.getHelp());
142
+ console.info(app.options.getHelp);
143
143
  return true;
144
144
  }
145
145
  else if (app.options.getValue('showConfig')) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.combineJsonConfig = void 0;
3
+ exports.combineJsonConfig = combineJsonConfig;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  const object_1 = require("../../augments/object");
6
6
  const prettier_1 = require("../../augments/prettier");
@@ -16,7 +16,6 @@ async function combineJsonConfig(...[newConfigContents, existingConfigContents,]
16
16
  }
17
17
  return stringify((0, object_1.deeplyCombineObjects)(oldJson, newJson));
18
18
  }
19
- exports.combineJsonConfig = combineJsonConfig;
20
19
  async function stringify(input) {
21
20
  return await (0, prettier_1.formatCode)(JSON.stringify(input, null, 4), 'a.json');
22
21
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.combineTextConfig = void 0;
3
+ exports.combineTextConfig = combineTextConfig;
4
4
  const common_1 = require("@augment-vir/common");
5
5
  function splitContentsIntoArrayOfLines(input) {
6
6
  return input
@@ -24,4 +24,3 @@ function combineTextConfig(...[newConfigContents, existingConfigContents,]) {
24
24
  });
25
25
  return sortedNew.join('\n');
26
26
  }
27
- exports.combineTextConfig = combineTextConfig;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createDefaultPackageJson = void 0;
6
+ exports.createDefaultPackageJson = createDefaultPackageJson;
7
7
  const common_1 = require("@augment-vir/common");
8
8
  const path_1 = require("path");
9
9
  const simple_git_1 = __importDefault(require("simple-git"));
@@ -29,7 +29,6 @@ async function createDefaultPackageJson(copyFromContents, existingConfigContents
29
29
  };
30
30
  return await (0, prettier_1.formatCode)(JSON.stringify(newPackageJson), 'package.json');
31
31
  }
32
- exports.createDefaultPackageJson = createDefaultPackageJson;
33
32
  function combineScripts(virmatorPackageJson, currentRepoPackageJson) {
34
33
  const scripts = {
35
34
  ...currentRepoPackageJson.scripts,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateDepCruiserConfig = void 0;
3
+ exports.generateDepCruiserConfig = generateDepCruiserConfig;
4
4
  function generateDepCruiserConfig({ fileExceptions, omitRules, }) {
5
5
  const forbiddenRules = [
6
6
  /* rules from the 'recommended' preset: */
@@ -204,4 +204,3 @@ function generateDepCruiserConfig({ fileExceptions, omitRules, }) {
204
204
  },
205
205
  };
206
206
  }
207
- exports.generateDepCruiserConfig = generateDepCruiserConfig;
@@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.defineConfig = exports.combineConfigs = exports.createBaseConfig = exports.findGitRepoRoot = exports.basePlugins = void 0;
6
+ exports.basePlugins = void 0;
7
+ exports.findGitRepoRoot = findGitRepoRoot;
8
+ exports.createBaseConfig = createBaseConfig;
9
+ exports.combineConfigs = combineConfigs;
10
+ exports.defineConfig = defineConfig;
7
11
  const node_js_1 = require("@augment-vir/node-js");
8
12
  const fs_1 = require("fs");
9
13
  const path_1 = require("path");
@@ -24,7 +28,6 @@ function findGitRepoRoot(dir) {
24
28
  }
25
29
  return findGitRepoRoot(nextDir);
26
30
  }
27
- exports.findGitRepoRoot = findGitRepoRoot;
28
31
  function createBaseConfig({ forGitHubPages, packageDirPath }) {
29
32
  const cwd = packageDirPath || process.cwd();
30
33
  const basePath = forGitHubPages && process.env.CI ? `/${(0, path_1.basename)(findGitRepoRoot(cwd))}` : '/';
@@ -53,7 +56,6 @@ function createBaseConfig({ forGitHubPages, packageDirPath }) {
53
56
  },
54
57
  };
55
58
  }
56
- exports.createBaseConfig = createBaseConfig;
57
59
  async function combineConfigs(baseConfigOptions, overrideCallback) {
58
60
  const { baseConfig, basePaths } = createBaseConfig(baseConfigOptions);
59
61
  const fullConfig = overrideCallback
@@ -67,8 +69,6 @@ async function combineConfigs(baseConfigOptions, overrideCallback) {
67
69
  }
68
70
  return fullConfig;
69
71
  }
70
- exports.combineConfigs = combineConfigs;
71
72
  function defineConfig(baseConfigOptions, overrideCallback) {
72
73
  return combineConfigs(baseConfigOptions, overrideCallback);
73
74
  }
74
- exports.defineConfig = defineConfig;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.alwaysReloadPlugin = void 0;
3
+ exports.alwaysReloadPlugin = alwaysReloadPlugin;
4
4
  const node_js_1 = require("@augment-vir/node-js");
5
5
  const fs_1 = require("fs");
6
6
  const path_1 = require("path");
@@ -97,4 +97,3 @@ function alwaysReloadPlugin(config = {}) {
97
97
  },
98
98
  };
99
99
  }
100
- exports.alwaysReloadPlugin = alwaysReloadPlugin;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNpmBinPath = exports.virmatorConfigs = exports.virmatorConfigsDir = exports.virmatorPackageDir = void 0;
3
+ exports.virmatorConfigs = exports.virmatorConfigsDir = exports.virmatorPackageDir = void 0;
4
+ exports.getNpmBinPath = getNpmBinPath;
4
5
  const common_1 = require("@augment-vir/common");
5
6
  const node_js_1 = require("@augment-vir/node-js");
6
7
  const fs_1 = require("fs");
@@ -17,7 +18,6 @@ async function getNpmBinPath({ repoDir, command, packageDirPath, }) {
17
18
  return ((await getNpmBinPathInternal({ repoDir, command, packageDirPath })) ??
18
19
  getNpmBinPathInternal({ repoDir, command, packageDirPath: exports.virmatorPackageDir }));
19
20
  }
20
- exports.getNpmBinPath = getNpmBinPath;
21
21
  async function getNpmBinPathInternal({ repoDir, command, packageDirPath, }) {
22
22
  const topLevelBinPath = (0, path_1.join)('node_modules', '.bin', command);
23
23
  const internalPackageBinPath = (0, path_1.join)(packageDirPath, 'node_modules', '.bin', command);
package/dist/index.d.ts CHANGED
@@ -1405,21 +1405,8 @@ export declare const virmator: Readonly<{
1405
1405
  npmDeps: readonly [];
1406
1406
  }>;
1407
1407
  }))[]>;
1408
- extend: <CommandDefinitionsGeneric extends readonly import("./api/command/define-command").AnyCommandDefinition[]>(inputs: Readonly<{
1409
- packageBinName: string;
1410
- packageRootDir: string;
1411
- commandDefinitions?: CommandDefinitionsGeneric;
1412
- }>) => Readonly<{
1413
- packageBinName: string;
1414
- cliHelpMessage: string;
1415
- markdownHelpMessage: string;
1416
- commandMapping: import("./api/command/command-mapping").CommandDefinitionArrayToMapping<CommandDefinitionsGeneric>;
1417
- extend: any;
1418
- allConfigs: readonly import("./api/config/config-file-definition").ConfigFileDefinition[];
1419
- runInCli: () => Promise<void>;
1420
- run: (allArgs: string[], repoDir: string) => Promise<void>;
1421
- }>;
1422
- allConfigs: readonly import("./api/config/config-file-definition").ConfigFileDefinition[];
1408
+ extend: <CommandDefinitionsGeneric extends ReadonlyArray<import("./api/command/define-command").CommandDefinition>>(inputs: import("./api/virmator-types").ExtendVirmatorInputs<CommandDefinitionsGeneric>) => import("./api/virmator-types").ExtendedVirmator<import("./api/command/command-mapping").CommandDefinitionArrayToMapping<CommandDefinitionsGeneric>>;
1409
+ allConfigs: ReadonlyArray<import("./api/config/config-file-definition").ConfigFileDefinition>;
1423
1410
  runInCli: () => Promise<void>;
1424
1411
  run: (allArgs: string[], repoDir: string) => Promise<void>;
1425
1412
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Handle common package configs, commands, and dependencies.",
5
5
  "keywords": [
6
6
  "automation",
@@ -43,10 +43,11 @@
43
43
  "test:types": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@augment-vir/common": "^28.1.0",
47
- "@augment-vir/node-js": "^28.1.0",
46
+ "@augment-vir/common": "^29.1.2",
47
+ "@augment-vir/node-js": "^29.1.2",
48
48
  "ansi-colors": "^4.1.3",
49
49
  "concurrently": "^8.2.2",
50
+ "fs-extra": "^11.2.0",
50
51
  "glob": "^8.1.0",
51
52
  "glob-promise": "^6.0.7",
52
53
  "mono-vir": "^1.0.1",
@@ -61,8 +62,8 @@
61
62
  "@types/chai": "^4.3.16",
62
63
  "@types/fs-extra": "^11.0.4",
63
64
  "@types/glob": "^8.1.0",
64
- "@types/mocha": "^10.0.6",
65
- "@types/node": "^20.14.2",
65
+ "@types/mocha": "^10.0.7",
66
+ "@types/node": "^20.14.8",
66
67
  "@types/semver": "^7.5.8",
67
68
  "@web/dev-server-esbuild": "^1.0.2",
68
69
  "@web/test-runner": "^0.18.2",
@@ -70,11 +71,10 @@
70
71
  "@web/test-runner-playwright": "^0.11.0",
71
72
  "@web/test-runner-visual-regression": "^0.9.0",
72
73
  "chai": "^4.3.10",
73
- "cspell": "^8.8.4",
74
+ "cspell": "^8.9.1",
74
75
  "dependency-cruiser": "^16.3.3",
75
76
  "element-vir": "^22.2.2",
76
77
  "esbuild": "^0.21.5",
77
- "fs-extra": "^11.2.0",
78
78
  "istanbul-smart-text-reporter": "^1.1.4",
79
79
  "markdown-code-example-inserter": "^1.0.0",
80
80
  "mocha": "^10.4.0",
@@ -92,8 +92,8 @@
92
92
  "test-established-expectations": "^1.0.0",
93
93
  "ts-node": "^10.9.2",
94
94
  "tsconfig-paths": "^4.2.0",
95
- "typedoc": "^0.25.13",
96
- "typescript": "5.4.5",
95
+ "typedoc": "^0.26.0",
96
+ "typescript": "^5.5.2",
97
97
  "virmator": "./",
98
98
  "vite": "^4.5.0",
99
99
  "vite-tsconfig-paths": "^4.3.2"