virmator 2.0.1 → 2.0.4
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/.github/workflows/virmator-prerelease.yml +9 -4
- package/.prettierrc.js +0 -2
- package/README.md +2 -0
- package/dist/augments/ansi-regex.d.ts +1 -0
- package/dist/augments/ansi-regex.js +27 -0
- package/dist/augments/string.d.ts +1 -0
- package/dist/augments/string.js +8 -0
- package/dist/cli/commands/implementations/test.command.js +10 -4
- package/dist/cli/config/config-key.d.ts +4 -0
- package/dist/cli/config/config-key.js +2 -0
- package/dist/cli/config/config-paths.js +10 -0
- package/dist/exportable-jest-config/{separate-jest-configs/jest-config.d.ts → jest-config.d.ts} +0 -0
- package/dist/exportable-jest-config/{separate-jest-configs/jest-config.js → jest-config.js} +0 -2
- package/dist/exportable-jest-config/{separate-jest-configs/jest-setup.d.ts → jest-setup.d.ts} +0 -0
- package/dist/exportable-jest-config/{separate-jest-configs/jest-setup.js → jest-setup.js} +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/jest/jest-config.js +3 -2
- package/package.json +12 -12
- package/separate-configs/jest/jest-config.ts +0 -2
- package/separate-configs/npmignore.txt +1 -3
- package/dist/exportable-jest-config/jest-config-path.d.ts +0 -1
- 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
|
-
|
|
12
|
-
name: '
|
|
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@
|
|
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/.prettierrc.js
CHANGED
|
@@ -27,8 +27,6 @@ const prettierConfig = {
|
|
|
27
27
|
arrowParens: 'always',
|
|
28
28
|
bracketSpacing: false,
|
|
29
29
|
endOfLine: 'lf',
|
|
30
|
-
// Arrays with just a single element don't wrap. But after that, they always wrap.
|
|
31
|
-
multilineArrayWrapThreshold: 1,
|
|
32
30
|
htmlWhitespaceSensitivity: 'ignore',
|
|
33
31
|
jsonRecursiveSort: true,
|
|
34
32
|
bracketSameLine: false,
|
package/README.md
CHANGED
|
@@ -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;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runTestCommand = exports.testCommandImplementation = void 0;
|
|
4
4
|
const node_only_1 = require("augment-vir/dist/node-only");
|
|
5
|
-
const
|
|
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]:
|
|
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_only_1.interpolationSafeWindowsPath)(
|
|
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,
|
|
@@ -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',
|
package/dist/exportable-jest-config/{separate-jest-configs/jest-config.d.ts → jest-config.d.ts}
RENAMED
|
File without changes
|
|
@@ -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')],
|
package/dist/exportable-jest-config/{separate-jest-configs/jest-setup.d.ts → jest-setup.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
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/
|
|
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/
|
|
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; } });
|
package/dist/jest/jest-config.js
CHANGED
|
@@ -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/
|
|
3
|
+
const jest_config_1 = require("../exportable-jest-config/jest-config");
|
|
4
4
|
const virmatorInternalTestingConfig = {
|
|
5
5
|
...jest_config_1.virmatorJestConfig,
|
|
6
|
-
|
|
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.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Handle all the stuffs in one package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -42,26 +42,26 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@types/jest": "27.4.1",
|
|
44
44
|
"ansi-styles": "5.2.0",
|
|
45
|
-
"augment-vir": "1.
|
|
46
|
-
"cspell": "5.19.
|
|
45
|
+
"augment-vir": "1.9.1",
|
|
46
|
+
"cspell": "5.19.5",
|
|
47
47
|
"fs-extra": "10.0.1",
|
|
48
48
|
"jest": "27.5.1",
|
|
49
49
|
"markdown-code-example-inserter": "0.1.7",
|
|
50
|
-
"prettier": "2.6.
|
|
51
|
-
"prettier-plugin-jsdoc": "0.3.
|
|
52
|
-
"prettier-plugin-multiline-arrays": "0.0
|
|
50
|
+
"prettier": "2.6.2",
|
|
51
|
+
"prettier-plugin-jsdoc": "0.3.36",
|
|
52
|
+
"prettier-plugin-multiline-arrays": "1.0.0",
|
|
53
53
|
"prettier-plugin-organize-imports": "2.3.4",
|
|
54
|
-
"prettier-plugin-packagejson": "2.2.
|
|
54
|
+
"prettier-plugin-packagejson": "2.2.17",
|
|
55
55
|
"prettier-plugin-sort-json": "0.0.2",
|
|
56
|
-
"simple-git": "3.
|
|
57
|
-
"ts-jest": "27.1.
|
|
56
|
+
"simple-git": "3.5.0",
|
|
57
|
+
"ts-jest": "27.1.4",
|
|
58
58
|
"ts-node": "10.7.0",
|
|
59
|
-
"tsconfig-paths": "3.14.
|
|
60
|
-
"typescript": "4.6.
|
|
59
|
+
"tsconfig-paths": "3.14.1",
|
|
60
|
+
"typescript": "4.6.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/fs-extra": "9.0.13",
|
|
64
|
-
"@types/node": "17.0.
|
|
64
|
+
"@types/node": "17.0.23"
|
|
65
65
|
},
|
|
66
66
|
"engines": {
|
|
67
67
|
"node": ">=14",
|
|
@@ -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');
|