virmator 2.0.0 → 2.0.3

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/.github/workflows/virmator-prerelease.yml +9 -4
  2. package/README.md +2 -0
  3. package/dist/augments/ansi-regex.d.ts +1 -0
  4. package/dist/augments/ansi-regex.js +27 -0
  5. package/dist/augments/string.d.ts +1 -0
  6. package/dist/augments/string.js +8 -0
  7. package/dist/cli/cli-util/cli-flags.js +3 -3
  8. package/dist/cli/cli-util/shell-command-wrapper.d.ts +1 -1
  9. package/dist/cli/cli-util/shell-command-wrapper.js +2 -2
  10. package/dist/cli/cli-util/update-configs.js +3 -3
  11. package/dist/cli/commands/all-cli-commands.js +4 -4
  12. package/dist/cli/commands/implementations/code-in-markdown.command.js +2 -2
  13. package/dist/cli/commands/implementations/format.command.js +3 -3
  14. package/dist/cli/commands/implementations/test.command.js +11 -5
  15. package/dist/cli/commands/implementations/update-all-configs.command.js +3 -3
  16. package/dist/cli/commands/implementations/update-bare-configs.command.js +3 -3
  17. package/dist/cli/config/config-key.d.ts +4 -0
  18. package/dist/cli/config/config-key.js +2 -0
  19. package/dist/cli/config/config-paths.js +10 -0
  20. package/dist/cli/config/copy-config.js +3 -3
  21. package/dist/cli/config/extendable-config.js +3 -3
  22. package/dist/errors/cli-command-error.js +2 -2
  23. package/dist/errors/cli-flag-error.js +2 -2
  24. package/dist/exportable-jest-config/{separate-jest-configs/jest-config.d.ts → jest-config.d.ts} +0 -0
  25. package/dist/exportable-jest-config/{separate-jest-configs/jest-config.js → jest-config.js} +0 -2
  26. package/dist/exportable-jest-config/{separate-jest-configs/jest-setup.d.ts → jest-setup.d.ts} +0 -0
  27. package/dist/exportable-jest-config/{separate-jest-configs/jest-setup.js → jest-setup.js} +0 -0
  28. package/dist/file-paths/virmator-repo-paths.js +2 -2
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/jest/jest-config.js +3 -2
  32. package/package.json +21 -21
  33. package/separate-configs/jest/jest-config.ts +0 -2
  34. package/separate-configs/npmignore.txt +1 -3
  35. package/dist/exportable-jest-config/jest-config-path.d.ts +0 -1
  36. package/dist/exportable-jest-config/jest-config-path.js +0 -6
@@ -3,17 +3,22 @@ name: branch-prerelease
3
3
  on:
4
4
  workflow_run:
5
5
  workflows: ['tests']
6
- branches: '**'
7
6
  types:
8
7
  - completed
8
+ branches:
9
+ - '**'
10
+
11
+ # this is currently running on main no matter what, even when a different branch triggered "tests"
9
12
 
10
13
  jobs:
11
- package-release:
12
- name: 'package release'
14
+ branch-prerelease:
15
+ name: 'branch prerelease'
13
16
  runs-on: 'ubuntu-latest'
14
17
  if: ${{ github.event.workflow_run.conclusion == 'success' }}
15
18
  steps:
16
- - uses: actions/checkout@v1
19
+ - uses: actions/checkout@v3
20
+ with:
21
+ ref: 'update-commands'
17
22
  - name: Use Node.js 16.x
18
23
  uses: actions/setup-node@v1
19
24
  with:
package/README.md CHANGED
@@ -138,6 +138,8 @@ Update all config files. This command accepts a list of config file keys as argu
138
138
  #### list of possible arguments:
139
139
 
140
140
  Cspell
141
+ JestConfig
142
+ JestSetup
141
143
  PackageJson
142
144
  Prettier
143
145
  PrettierIgnore
@@ -0,0 +1 @@
1
+ export declare const ansiRegex: RegExp;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ansiRegex = void 0;
4
+ // cspell:disable
5
+ /*
6
+ Copied from
7
+ https://github.com/chalk/ansi-regex/blob/1b337add136eb520764634a328e2f6354398eee5/index.js
8
+ because the published ansi-regex package exports this in a manner that Jest can't handle and the
9
+ latest version of the package that doesn't do that has a security vulnerability. The package has
10
+ the following license from
11
+ https://github.com/chalk/ansi-regex/blob/1b337add136eb520764634a328e2f6354398eee5/license
12
+
13
+ MIT License
14
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+ */
22
+ // cspell:enable
23
+ const patterns = [
24
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
25
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))',
26
+ ];
27
+ exports.ansiRegex = new RegExp(patterns.join('|'), 'g');
@@ -0,0 +1 @@
1
+ export declare function stripColor(input: string): string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stripColor = void 0;
4
+ const ansi_regex_1 = require("./ansi-regex");
5
+ function stripColor(input) {
6
+ return input.replace(ansi_regex_1.ansiRegex, '');
7
+ }
8
+ exports.stripColor = stripColor;
@@ -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,8 +1,9 @@
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");
5
- const jest_config_path_1 = require("../../../exportable-jest-config/jest-config-path");
4
+ const node_only_1 = require("augment-vir/dist/node-only");
5
+ const config_key_1 = require("../../../cli/config/config-key");
6
+ const config_paths_1 = require("../../../cli/config/config-paths");
6
7
  const virmator_repo_paths_1 = require("../../../file-paths/virmator-repo-paths");
7
8
  const cli_command_name_1 = require("../../cli-util/cli-command-name");
8
9
  const cli_flags_1 = require("../../cli-util/cli-flags");
@@ -23,17 +24,22 @@ exports.testCommandImplementation = {
23
24
  ],
24
25
  },
25
26
  implementation: runTestCommand,
27
+ configKeys: [
28
+ config_key_1.CommandConfigKey.JestSetup,
29
+ config_key_1.CommandConfigKey.JestConfig,
30
+ ],
26
31
  configFlagSupport: {
27
- [cli_flags_1.CliFlagName.NoWriteConfig]: false,
32
+ [cli_flags_1.CliFlagName.NoWriteConfig]: true,
28
33
  },
29
34
  };
30
35
  const jestPath = (0, virmator_repo_paths_1.getNpmBinPath)('jest');
31
36
  async function runTestCommand(inputs) {
32
37
  const args = inputs.rawArgs.length ? inputs.rawArgs.join(' ') : '';
38
+ const defaultConfigPath = (0, config_paths_1.getRepoConfigFilePath)(config_key_1.CommandConfigKey.JestConfig, false);
33
39
  const configPath = args.includes('--config ') || args.includes('-c ')
34
40
  ? ''
35
- : `--config ${(0, node_1.interpolationSafeWindowsPath)(jest_config_path_1.virmatorJestConfigFilePath)}`;
36
- const testCommand = `${jestPath} ${configPath} ${args}`;
41
+ : `--config ${(0, node_only_1.interpolationSafeWindowsPath)(defaultConfigPath)}`;
42
+ const testCommand = `${jestPath} --colors ${configPath} ${args}`;
37
43
  const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(testCommand, inputs);
38
44
  return {
39
45
  command: testCommand,
@@ -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
  ],
@@ -11,6 +11,8 @@ export declare enum BareConfigKey {
11
11
  /** These are config files used by virmator commands. */
12
12
  export declare enum CommandConfigKey {
13
13
  Cspell = "Cspell",
14
+ JestConfig = "JestConfig",
15
+ JestSetup = "JestSetup",
14
16
  PackageJson = "PackageJson",
15
17
  Prettier = "Prettier",
16
18
  PrettierIgnore = "PrettierIgnore",
@@ -25,6 +27,8 @@ export declare const ConfigKey: {
25
27
  NpmIgnore: BareConfigKey.NpmIgnore;
26
28
  VsCodeSettings: BareConfigKey.VsCodeSettings;
27
29
  Cspell: CommandConfigKey.Cspell;
30
+ JestConfig: CommandConfigKey.JestConfig;
31
+ JestSetup: CommandConfigKey.JestSetup;
28
32
  PackageJson: CommandConfigKey.PackageJson;
29
33
  Prettier: CommandConfigKey.Prettier;
30
34
  PrettierIgnore: CommandConfigKey.PrettierIgnore;
@@ -16,6 +16,8 @@ var BareConfigKey;
16
16
  var CommandConfigKey;
17
17
  (function (CommandConfigKey) {
18
18
  CommandConfigKey["Cspell"] = "Cspell";
19
+ CommandConfigKey["JestConfig"] = "JestConfig";
20
+ CommandConfigKey["JestSetup"] = "JestSetup";
19
21
  CommandConfigKey["PackageJson"] = "PackageJson";
20
22
  CommandConfigKey["Prettier"] = "Prettier";
21
23
  CommandConfigKey["PrettierIgnore"] = "PrettierIgnore";
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getVirmatorConfigFilePath = exports.getRepoConfigFilePath = void 0;
4
4
  const path_1 = require("path");
5
5
  const virmator_repo_paths_1 = require("../../file-paths/virmator-repo-paths");
6
+ const package_name_1 = require("../../package-name");
6
7
  const config_key_1 = require("./config-key");
7
8
  const extendable_config_1 = require("./extendable-config");
8
9
  var DifferentConfigPathTypes;
@@ -12,6 +13,7 @@ var DifferentConfigPathTypes;
12
13
  /** The path that the config file should be written to when virmator is being used. */
13
14
  DifferentConfigPathTypes["Repo"] = "repo";
14
15
  })(DifferentConfigPathTypes || (DifferentConfigPathTypes = {}));
16
+ const hiddenVirmatorDirectory = `.${package_name_1.packageName}`;
15
17
  const configFileMap = {
16
18
  [config_key_1.ConfigKey.Cspell]: '.cspell.json',
17
19
  [config_key_1.ConfigKey.GitAttributes]: '.gitattributes',
@@ -22,6 +24,14 @@ const configFileMap = {
22
24
  virmator: (0, path_1.join)(virmator_repo_paths_1.relativeSeparateConfigsDir, 'gitignore.txt'),
23
25
  repo: '.gitignore',
24
26
  },
27
+ [config_key_1.ConfigKey.JestConfig]: {
28
+ virmator: (0, path_1.join)(virmator_repo_paths_1.relativeSeparateConfigsDir, 'jest', 'jest-config.ts'),
29
+ repo: (0, path_1.join)(hiddenVirmatorDirectory, 'jest', 'jest-config.ts'),
30
+ },
31
+ [config_key_1.ConfigKey.JestSetup]: {
32
+ virmator: (0, path_1.join)(virmator_repo_paths_1.relativeSeparateConfigsDir, 'jest', 'jest-setup.ts'),
33
+ repo: (0, path_1.join)(hiddenVirmatorDirectory, 'jest', 'jest-setup.ts'),
34
+ },
25
35
  [config_key_1.ConfigKey.NpmIgnore]: {
26
36
  virmator: (0, path_1.join)(virmator_repo_paths_1.relativeSeparateConfigsDir, 'npmignore.txt'),
27
37
  repo: '.npmignore',
@@ -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;
@@ -6,9 +6,7 @@ const cwd = process.cwd();
6
6
  exports.virmatorJestConfig = {
7
7
  preset: 'ts-jest',
8
8
  testEnvironment: 'node',
9
- verbose: false,
10
9
  rootDir: cwd,
11
- silent: false,
12
10
  modulePathIgnorePatterns: ['.*.type.test.ts$'],
13
11
  roots: [(0, path_1.join)(cwd, 'src')],
14
12
  setupFilesAfterEnv: [(0, path_1.join)(__dirname, 'jest-setup.ts')],
@@ -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/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This is exported so that it can be extended if needed. */
2
- export { virmatorJestConfig } from './exportable-jest-config/separate-jest-configs/jest-config';
2
+ export { virmatorJestConfig } from './exportable-jest-config/jest-config';
package/dist/index.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.virmatorJestConfig = void 0;
4
4
  /** This is exported so that it can be extended if needed. */
5
- var jest_config_1 = require("./exportable-jest-config/separate-jest-configs/jest-config");
5
+ var jest_config_1 = require("./exportable-jest-config/jest-config");
6
6
  Object.defineProperty(exports, "virmatorJestConfig", { enumerable: true, get: function () { return jest_config_1.virmatorJestConfig; } });
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const jest_config_1 = require("../exportable-jest-config/separate-jest-configs/jest-config");
3
+ const jest_config_1 = require("../exportable-jest-config/jest-config");
4
4
  const virmatorInternalTestingConfig = {
5
5
  ...jest_config_1.virmatorJestConfig,
6
- testTimeout: 30000,
6
+ // this insanely high timeout is for GitHub Actions, which takes an eternity to run
7
+ testTimeout: 60000,
7
8
  modulePathIgnorePatterns: [
8
9
  ...jest_config_1.virmatorJestConfig.modulePathIgnorePatterns,
9
10
  'test-files',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "2.0.0",
3
+ "version": "2.0.3",
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.9.0",
46
+ "cspell": "5.19.3",
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.32",
52
+ "prettier-plugin-multiline-arrays": "0.0.4",
53
+ "prettier-plugin-organize-imports": "2.3.4",
54
+ "prettier-plugin-packagejson": "2.2.17",
55
+ "prettier-plugin-sort-json": "0.0.2",
56
+ "simple-git": "3.4.0",
57
+ "ts-jest": "27.1.4",
58
+ "ts-node": "10.7.0",
59
+ "tsconfig-paths": "3.14.1",
60
+ "typescript": "4.6.3"
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.23"
65
65
  },
66
66
  "engines": {
67
- "node": ">=12",
67
+ "node": ">=14",
68
68
  "npm": ">=7"
69
69
  }
70
70
  }
@@ -6,9 +6,7 @@ const cwd = process.cwd();
6
6
  export const virmatorJestConfig: InitialOptionsTsJest = {
7
7
  preset: 'ts-jest',
8
8
  testEnvironment: 'node',
9
- verbose: false,
10
9
  rootDir: cwd,
11
- silent: false,
12
10
  modulePathIgnorePatterns: ['.*.type.test.ts$'],
13
11
  roots: [join(cwd, 'src')],
14
12
  setupFilesAfterEnv: [join(__dirname, 'jest-setup.ts')],
@@ -5,6 +5,7 @@
5
5
  .gitignore
6
6
  .prettierignore
7
7
  .prettierrc.js
8
+ .virmator/
8
9
  .vscode/
9
10
  *.test.d.ts
10
11
  *.test.js
@@ -13,9 +14,6 @@ dist/readme-examples/
13
14
  dist/scripts/
14
15
  dist/test/
15
16
  dist/vite/
16
- index.html
17
- public/
18
- scripts/
19
17
  src/
20
18
  test-files/
21
19
  tsconfig-base.json
@@ -1 +0,0 @@
1
- export declare const virmatorJestConfigFilePath: string;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.virmatorJestConfigFilePath = void 0;
4
- const path_1 = require("path");
5
- const virmator_repo_paths_1 = require("../file-paths/virmator-repo-paths");
6
- exports.virmatorJestConfigFilePath = (0, path_1.join)(virmator_repo_paths_1.virmatorRootDir, virmator_repo_paths_1.relativeSeparateConfigsDir, 'jest', 'jest-config.ts');