virmator 1.3.4 → 1.3.8
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 +2 -2
- package/.github/workflows/virmator-tagged-release.yml +2 -2
- package/.github/workflows/virmator-tests.yml +1 -1
- package/dist/cli/cli-util/shell-command-wrapper.js +3 -3
- package/dist/cli/commands/implementations/format.command.js +7 -3
- package/dist/cli/commands/implementations/test.command.js +5 -1
- package/dist/cli/commands/run-command.js +7 -3
- package/dist/cli/config/config-key.d.ts +3 -3
- package/dist/cli/config/config-key.js +1 -1
- package/dist/cli/config/copy-config.js +1 -1
- package/package.json +18 -11
|
@@ -14,10 +14,10 @@ jobs:
|
|
|
14
14
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
15
15
|
steps:
|
|
16
16
|
- uses: actions/checkout@v1
|
|
17
|
-
- name: Use Node.js
|
|
17
|
+
- name: Use Node.js 16.x
|
|
18
18
|
uses: actions/setup-node@v1
|
|
19
19
|
with:
|
|
20
|
-
node-version:
|
|
20
|
+
node-version: 16.x
|
|
21
21
|
- name: run test
|
|
22
22
|
run: |
|
|
23
23
|
npm ci
|
|
@@ -5,9 +5,9 @@ const node_1 = require("augment-vir/dist/node");
|
|
|
5
5
|
const defaultFilter = (input) => input;
|
|
6
6
|
function outputWrapper(callback, filter) {
|
|
7
7
|
return (input) => {
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
callback(
|
|
8
|
+
const callbackString = filter(input.toString());
|
|
9
|
+
if (callbackString) {
|
|
10
|
+
callback(callbackString);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
}
|
|
@@ -16,7 +16,7 @@ var FormatOperation;
|
|
|
16
16
|
exports.defaultFormatArgs = {
|
|
17
17
|
operation: FormatOperation.Write,
|
|
18
18
|
prettierFlags: [],
|
|
19
|
-
fileExtensions: ['ts', 'json', 'html', 'css', 'md', 'js', 'yml', 'yaml'],
|
|
19
|
+
fileExtensions: ['ts', 'tsx', 'json', 'html', 'css', 'md', 'js', 'yml', 'yaml'],
|
|
20
20
|
};
|
|
21
21
|
exports.filesMarkerArg = '--format-files';
|
|
22
22
|
exports.formatImplementation = {
|
|
@@ -57,7 +57,7 @@ exports.formatImplementation = {
|
|
|
57
57
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} --ignore-path .prettierignore
|
|
58
58
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} ${FormatOperation.Write} --ignore-path .prettierignore
|
|
59
59
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} ${FormatOperation.Write} --ignore-path .prettierignore ${exports.filesMarkerArg} md json`,
|
|
60
|
-
configKeys: [config_key_1.ConfigKey.Prettier],
|
|
60
|
+
configKeys: [config_key_1.ConfigKey.Prettier, config_key_1.ConfigKey.PrettierIgnore],
|
|
61
61
|
implementation: runFormatCommand,
|
|
62
62
|
configFlagSupport: {
|
|
63
63
|
[cli_flags_1.CliFlagName.NoWriteConfig]: true,
|
|
@@ -69,7 +69,11 @@ async function runFormatCommand(inputs) {
|
|
|
69
69
|
const operationFlag = args.operation === FormatOperation.Check ? '--check' : '--write';
|
|
70
70
|
const prettierCommand = `${prettierPath} --color ${args.prettierFlags.join(' ')} \"./**/*.+(${args.fileExtensions.join('|')})\" ${operationFlag}`;
|
|
71
71
|
const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(prettierCommand, inputs, {
|
|
72
|
-
stdoutFilter: (stdout) => stdout
|
|
72
|
+
stdoutFilter: (stdout) => stdout
|
|
73
|
+
// only relevant when running the check command
|
|
74
|
+
.replace('Checking formatting...\n', '')
|
|
75
|
+
// only relevant when running the check command
|
|
76
|
+
.replace('All matched files use Prettier code style!\n', ''),
|
|
73
77
|
});
|
|
74
78
|
return {
|
|
75
79
|
success: !results.error,
|
|
@@ -34,7 +34,11 @@ async function runTestCommand(inputs) {
|
|
|
34
34
|
? (0, node_1.interpolationSafeWindowsPath)(inputs.rawArgs.join(' '))
|
|
35
35
|
: `\"./dist/**/!(*.type).test.js\"`;
|
|
36
36
|
const testCommand = `${testVirPath} ${args}`;
|
|
37
|
-
const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(testCommand, inputs
|
|
37
|
+
const results = await (0, shell_command_wrapper_1.runVirmatorShellCommand)(testCommand, inputs, {
|
|
38
|
+
stdoutFilter: (logString) =>
|
|
39
|
+
// weird looking hex codes here are for color codes from test-vir
|
|
40
|
+
logString.replace('\x1B[1m\x1B[32mAll tests passed.\x1B[0m\n', ''),
|
|
41
|
+
});
|
|
38
42
|
return {
|
|
39
43
|
success: !results.error,
|
|
40
44
|
};
|
|
@@ -17,7 +17,7 @@ async function runCommand(command, commandInput) {
|
|
|
17
17
|
const defaultFlagSupport = {
|
|
18
18
|
[cli_flags_1.CliFlagName.Silent]: true,
|
|
19
19
|
[cli_flags_1.CliFlagName.Help]: true,
|
|
20
|
-
[cli_flags_1.CliFlagName.ExtendableConfig]: !!((_a = commandImplementation.configKeys) === null || _a === void 0 ? void 0 : _a.
|
|
20
|
+
[cli_flags_1.CliFlagName.ExtendableConfig]: !!((_a = commandImplementation.configKeys) === null || _a === void 0 ? void 0 : _a.some((configKey) => (0, extendable_config_1.isExtendableConfig)(configKey))),
|
|
21
21
|
};
|
|
22
22
|
const unsupportedFlagsInUse = (0, all_cli_commands_1.getUnsupportedFlags)(cliFlags, {
|
|
23
23
|
...defaultFlagSupport,
|
|
@@ -46,8 +46,12 @@ async function runCommand(command, commandInput) {
|
|
|
46
46
|
const loggers = cliFlags[cli_flags_1.CliFlagName.Silent] && command !== cli_command_name_1.CliCommandName.Help
|
|
47
47
|
? cli_command_1.EmptyOutputCallbacks
|
|
48
48
|
: {
|
|
49
|
-
stdoutCallback:
|
|
50
|
-
|
|
49
|
+
stdoutCallback: (input) => {
|
|
50
|
+
console.info(input.replace(/\n$/, ''));
|
|
51
|
+
},
|
|
52
|
+
stderrCallback: (input) => {
|
|
53
|
+
console.error(input.replace(/\n$/, ''));
|
|
54
|
+
},
|
|
51
55
|
};
|
|
52
56
|
const commandResult = await commandImplementation.implementation({
|
|
53
57
|
...(0, cli_command_1.fillInCommandInput)({
|
|
@@ -6,7 +6,6 @@ export declare enum BareConfigKey {
|
|
|
6
6
|
GitHubActionsPrerelease = "GitHubActionsPrerelease",
|
|
7
7
|
GitIgnore = "GitIgnore",
|
|
8
8
|
NpmIgnore = "NpmIgnore",
|
|
9
|
-
PrettierIgnore = "PrettierIgnore",
|
|
10
9
|
VsCodeSettings = "VsCodeSettings"
|
|
11
10
|
}
|
|
12
11
|
/** These are config files used by virmator commands. */
|
|
@@ -14,7 +13,8 @@ export declare enum CommandConfigKey {
|
|
|
14
13
|
Cspell = "Cspell",
|
|
15
14
|
Prettier = "Prettier",
|
|
16
15
|
TsConfig = "TsConfig",
|
|
17
|
-
PackageJson = "PackageJson"
|
|
16
|
+
PackageJson = "PackageJson",
|
|
17
|
+
PrettierIgnore = "PrettierIgnore"
|
|
18
18
|
}
|
|
19
19
|
export declare const ConfigKey: {
|
|
20
20
|
GitAttributes: BareConfigKey.GitAttributes;
|
|
@@ -23,11 +23,11 @@ export declare const ConfigKey: {
|
|
|
23
23
|
GitHubActionsPrerelease: BareConfigKey.GitHubActionsPrerelease;
|
|
24
24
|
GitIgnore: BareConfigKey.GitIgnore;
|
|
25
25
|
NpmIgnore: BareConfigKey.NpmIgnore;
|
|
26
|
-
PrettierIgnore: BareConfigKey.PrettierIgnore;
|
|
27
26
|
VsCodeSettings: BareConfigKey.VsCodeSettings;
|
|
28
27
|
Cspell: CommandConfigKey.Cspell;
|
|
29
28
|
Prettier: CommandConfigKey.Prettier;
|
|
30
29
|
TsConfig: CommandConfigKey.TsConfig;
|
|
31
30
|
PackageJson: CommandConfigKey.PackageJson;
|
|
31
|
+
PrettierIgnore: CommandConfigKey.PrettierIgnore;
|
|
32
32
|
};
|
|
33
33
|
export declare type ConfigKey = CommandConfigKey | BareConfigKey;
|
|
@@ -10,7 +10,6 @@ var BareConfigKey;
|
|
|
10
10
|
BareConfigKey["GitHubActionsPrerelease"] = "GitHubActionsPrerelease";
|
|
11
11
|
BareConfigKey["GitIgnore"] = "GitIgnore";
|
|
12
12
|
BareConfigKey["NpmIgnore"] = "NpmIgnore";
|
|
13
|
-
BareConfigKey["PrettierIgnore"] = "PrettierIgnore";
|
|
14
13
|
BareConfigKey["VsCodeSettings"] = "VsCodeSettings";
|
|
15
14
|
})(BareConfigKey = exports.BareConfigKey || (exports.BareConfigKey = {}));
|
|
16
15
|
/** These are config files used by virmator commands. */
|
|
@@ -20,5 +19,6 @@ var CommandConfigKey;
|
|
|
20
19
|
CommandConfigKey["Prettier"] = "Prettier";
|
|
21
20
|
CommandConfigKey["TsConfig"] = "TsConfig";
|
|
22
21
|
CommandConfigKey["PackageJson"] = "PackageJson";
|
|
22
|
+
CommandConfigKey["PrettierIgnore"] = "PrettierIgnore";
|
|
23
23
|
})(CommandConfigKey = exports.CommandConfigKey || (exports.CommandConfigKey = {}));
|
|
24
24
|
exports.ConfigKey = { ...CommandConfigKey, ...BareConfigKey };
|
|
@@ -32,7 +32,7 @@ async function copyConfig({ configKey, forceExtendableConfig, repoDir, }) {
|
|
|
32
32
|
log: `Config file not found, creating new file: ${repoConfigPath}\n${ifUndesiredMessage}`,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
if (shouldExtend) {
|
|
35
|
+
if (shouldExtend && (0, extendable_config_1.isExtendableConfig)(configKey)) {
|
|
36
36
|
if (!(0, extendable_config_1.isExtendableConfig)(configKey)) {
|
|
37
37
|
throw new config_file_error_1.ConfigFileError(`Extendable config files are not supported for ${configKey}`);
|
|
38
38
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virmator",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Handle all the stuffs in one package.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"automation",
|
|
7
|
+
"template",
|
|
8
|
+
"vir",
|
|
9
|
+
"formatting",
|
|
10
|
+
"spellcheck",
|
|
11
|
+
"config"
|
|
12
|
+
],
|
|
6
13
|
"homepage": "https://github.com/electrovir/virmator",
|
|
7
14
|
"bugs": {
|
|
8
15
|
"url": "https://github.com/electrovir/virmator/issues"
|
|
@@ -31,23 +38,23 @@
|
|
|
31
38
|
},
|
|
32
39
|
"dependencies": {
|
|
33
40
|
"ansi-styles": "5.2.0",
|
|
34
|
-
"augment-vir": "^1.
|
|
35
|
-
"cspell": "^5.
|
|
41
|
+
"augment-vir": "^1.4.3",
|
|
42
|
+
"cspell": "^5.17.0",
|
|
36
43
|
"fs-extra": "^10.0.0",
|
|
37
44
|
"markdown-code-example-inserter": "^0.1.5",
|
|
38
|
-
"prettier": "^2.
|
|
39
|
-
"prettier-plugin-jsdoc": "^0.3.
|
|
45
|
+
"prettier": "^2.5.1",
|
|
46
|
+
"prettier-plugin-jsdoc": "^0.3.30",
|
|
40
47
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
41
|
-
"prettier-plugin-packagejson": "^2.2.
|
|
48
|
+
"prettier-plugin-packagejson": "^2.2.15",
|
|
42
49
|
"prettier-plugin-sort-json": "^0.0.2",
|
|
43
|
-
"simple-git": "^
|
|
50
|
+
"simple-git": "^3.1.1",
|
|
44
51
|
"test-vir": "^0.2.3",
|
|
45
|
-
"typescript": "^4.
|
|
52
|
+
"typescript": "^4.5.5"
|
|
46
53
|
},
|
|
47
54
|
"devDependencies": {
|
|
48
55
|
"@types/fs-extra": "^9.0.13",
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"ts-node": "^10.
|
|
56
|
+
"@types/node": "^17.0.12",
|
|
57
|
+
"ts-node": "^10.4.0"
|
|
51
58
|
},
|
|
52
59
|
"engines": {
|
|
53
60
|
"node": ">=12",
|