virmator 1.3.6 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cspell.json +25 -6
- package/.github/workflows/virmator-prerelease.yml +7 -8
- package/.github/workflows/virmator-tagged-release.yml +13 -2
- package/.github/workflows/virmator-tests.yml +1 -1
- package/.prettierrc.js +13 -1
- package/dist/cli/commands/all-cli-commands.js +1 -1
- package/dist/cli/commands/implementations/format.command.js +15 -2
- package/dist/cli/commands/implementations/update-all-configs.command.js +4 -1
- package/dist/cli/commands/implementations/update-bare-configs.command.js +4 -1
- package/dist/cli/commands/run-command.js +1 -1
- package/dist/cli/config/config-key.d.ts +3 -3
- package/dist/cli/config/config-key.js +1 -1
- package/dist/cli/config/config-read.js +4 -1
- package/dist/cli/config/copy-config.js +1 -1
- package/package.json +11 -10
- package/tsconfig.json +6 -1
package/.cspell.json
CHANGED
|
@@ -11,32 +11,47 @@
|
|
|
11
11
|
"version": "0.2",
|
|
12
12
|
"words": [
|
|
13
13
|
"accum",
|
|
14
|
-
"adipiscing",
|
|
15
|
-
"amet",
|
|
16
|
-
"andymckay",
|
|
17
14
|
"argb",
|
|
18
15
|
"autofix",
|
|
19
16
|
"autofixable",
|
|
20
17
|
"autofixing",
|
|
18
|
+
"browserconfig",
|
|
19
|
+
"combinator",
|
|
20
|
+
"combinators",
|
|
21
21
|
"config's",
|
|
22
|
-
"consectetur",
|
|
23
22
|
"cpsell",
|
|
24
23
|
"derp",
|
|
25
24
|
"derpy",
|
|
26
25
|
"electrovir",
|
|
26
|
+
"entrypoint",
|
|
27
27
|
"entrypoints",
|
|
28
28
|
"esbenp",
|
|
29
|
+
"estree",
|
|
30
|
+
"fleek",
|
|
29
31
|
"gitattributes",
|
|
32
|
+
"globbing",
|
|
30
33
|
"globstar",
|
|
34
|
+
"inconsolata",
|
|
35
|
+
"lexend",
|
|
36
|
+
"lfsr",
|
|
31
37
|
"locationchange",
|
|
32
38
|
"marvinpinto",
|
|
39
|
+
"mmultiline",
|
|
40
|
+
"monospace",
|
|
41
|
+
"msapplication",
|
|
42
|
+
"mstile",
|
|
33
43
|
"nojekyll",
|
|
44
|
+
"noopener",
|
|
45
|
+
"noreferrer",
|
|
34
46
|
"npmignore",
|
|
35
47
|
"packagejson",
|
|
36
48
|
"parens",
|
|
37
49
|
"pdfs",
|
|
50
|
+
"postupgrade",
|
|
38
51
|
"prettierignore",
|
|
39
52
|
"prettierrc",
|
|
53
|
+
"preupgrade",
|
|
54
|
+
"protobuf",
|
|
40
55
|
"pushstate",
|
|
41
56
|
"replacestate",
|
|
42
57
|
"repo's",
|
|
@@ -44,13 +59,17 @@
|
|
|
44
59
|
"rgba",
|
|
45
60
|
"stylelint",
|
|
46
61
|
"stylelintrc",
|
|
47
|
-
"
|
|
62
|
+
"tabbable",
|
|
63
|
+
"tabindex",
|
|
48
64
|
"thingie",
|
|
49
65
|
"threejs",
|
|
50
66
|
"transpiled",
|
|
51
67
|
"transpiling",
|
|
52
68
|
"typeof",
|
|
53
69
|
"virmator's",
|
|
54
|
-
"virmator"
|
|
70
|
+
"virmator",
|
|
71
|
+
"vite",
|
|
72
|
+
"vitejs",
|
|
73
|
+
"xlink"
|
|
55
74
|
]
|
|
56
75
|
}
|
|
@@ -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
|
|
@@ -26,18 +26,17 @@ jobs:
|
|
|
26
26
|
id: vars
|
|
27
27
|
run: |
|
|
28
28
|
branchName="${GITHUB_REF#refs/*/}"
|
|
29
|
-
echo ::set-output name=
|
|
29
|
+
echo ::set-output name=prereleaseTagName::"$branchName-$GITHUB_SHA"
|
|
30
30
|
|
|
31
31
|
originalTarName="$(npm pack)"
|
|
32
32
|
packageName="$(npm -s run env echo '$npm_package_name')"
|
|
33
|
-
|
|
34
|
-
newTarName="$packageName-$timeStamp.tgz"
|
|
33
|
+
newTarName="$packageName-$GITHUB_SHA.tgz"
|
|
35
34
|
mv "$originalTarName" "$newTarName"
|
|
36
|
-
echo ::set-output name=
|
|
35
|
+
echo ::set-output name=tarName::"$newTarName"
|
|
37
36
|
- uses: 'marvinpinto/action-automatic-releases@latest'
|
|
38
37
|
with:
|
|
39
38
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
|
40
|
-
automatic_release_tag: 'prerelease-${{ steps.vars.outputs.
|
|
39
|
+
automatic_release_tag: 'prerelease-${{ steps.vars.outputs.prereleaseTagName }}'
|
|
41
40
|
prerelease: true
|
|
42
41
|
files: |
|
|
43
|
-
${{ steps.vars.outputs.
|
|
42
|
+
${{ steps.vars.outputs.tarName }}
|
|
@@ -12,16 +12,27 @@ jobs:
|
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v1
|
|
15
|
-
- name: Use Node.js
|
|
15
|
+
- name: Use Node.js 16.x
|
|
16
16
|
uses: actions/setup-node@v1
|
|
17
17
|
with:
|
|
18
|
-
node-version:
|
|
18
|
+
node-version: 16.x
|
|
19
19
|
- name: run test
|
|
20
20
|
run: |
|
|
21
21
|
npm ci
|
|
22
22
|
npm run test:full
|
|
23
|
+
- name: pack and set vars
|
|
24
|
+
id: vars
|
|
25
|
+
run: |
|
|
26
|
+
tagName="${GITHUB_REF#refs/*/}"
|
|
27
|
+
originalTarName="$(npm pack)"
|
|
28
|
+
packageName="$(npm -s run env echo '$npm_package_name')"
|
|
29
|
+
newTarName="$packageName-$tagName.tgz"
|
|
30
|
+
mv "$originalTarName" "$newTarName"
|
|
31
|
+
echo ::set-output name=tarName::"$newTarName"
|
|
23
32
|
|
|
24
33
|
- uses: 'marvinpinto/action-automatic-releases@latest'
|
|
25
34
|
with:
|
|
26
35
|
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
|
27
36
|
prerelease: false
|
|
37
|
+
files: |
|
|
38
|
+
${{ steps.vars.outputs.tarName }}
|
package/.prettierrc.js
CHANGED
|
@@ -4,9 +4,11 @@ const path = require('path');
|
|
|
4
4
|
const plugins = [
|
|
5
5
|
'prettier-plugin-sort-json',
|
|
6
6
|
'prettier-plugin-packagejson',
|
|
7
|
+
'prettier-plugin-multiline-arrays',
|
|
7
8
|
'prettier-plugin-organize-imports',
|
|
8
9
|
'prettier-plugin-jsdoc',
|
|
9
10
|
].map((pluginName) => {
|
|
11
|
+
// account for installations where deps are flattened and installations where they're nested
|
|
10
12
|
const defaultPath = `./node_modules/${pluginName}`;
|
|
11
13
|
if (fs.existsSync(path.resolve(__dirname, defaultPath))) {
|
|
12
14
|
return defaultPath;
|
|
@@ -15,10 +17,18 @@ const plugins = [
|
|
|
15
17
|
}
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @typedef {import('prettier-plugin-multiline-arrays').MultilineArrayOptions} MultilineOptions
|
|
22
|
+
*
|
|
23
|
+
* @typedef {import('prettier').Options} PrettierOptions
|
|
24
|
+
* @type {PrettierOptions & MultilineOptions}
|
|
25
|
+
*/
|
|
26
|
+
const prettierConfig = {
|
|
19
27
|
arrowParens: 'always',
|
|
20
28
|
bracketSpacing: false,
|
|
21
29
|
endOfLine: 'lf',
|
|
30
|
+
// Arrays with just a single element don't wrap. But after that, they always wrap.
|
|
31
|
+
multilineArrayWrapThreshold: 1,
|
|
22
32
|
htmlWhitespaceSensitivity: 'ignore',
|
|
23
33
|
jsonRecursiveSort: true,
|
|
24
34
|
bracketSameLine: false,
|
|
@@ -28,3 +38,5 @@ module.exports = {
|
|
|
28
38
|
tabWidth: 4,
|
|
29
39
|
trailingComma: 'all',
|
|
30
40
|
};
|
|
41
|
+
|
|
42
|
+
module.exports = prettierConfig;
|
|
@@ -64,7 +64,7 @@ function runHelpCommand({ stdoutCallback }) {
|
|
|
64
64
|
})
|
|
65
65
|
.join('\n ');
|
|
66
66
|
const helpMessage = `${cli_color_1.Color.Info} ${package_name_1.packageName} usage:${cli_color_1.Color.Reset}
|
|
67
|
-
[npx] ${package_name_1.packageName} [--flags] command
|
|
67
|
+
[npx] ${package_name_1.packageName} [--flags] command subCommand
|
|
68
68
|
|
|
69
69
|
npx is needed when the command is run directly from the terminal
|
|
70
70
|
(not scoped within an npm script) unless the package has been globally installed
|
|
@@ -16,7 +16,17 @@ var FormatOperation;
|
|
|
16
16
|
exports.defaultFormatArgs = {
|
|
17
17
|
operation: FormatOperation.Write,
|
|
18
18
|
prettierFlags: [],
|
|
19
|
-
fileExtensions: [
|
|
19
|
+
fileExtensions: [
|
|
20
|
+
'ts',
|
|
21
|
+
'tsx',
|
|
22
|
+
'json',
|
|
23
|
+
'html',
|
|
24
|
+
'css',
|
|
25
|
+
'md',
|
|
26
|
+
'js',
|
|
27
|
+
'yml',
|
|
28
|
+
'yaml',
|
|
29
|
+
],
|
|
20
30
|
};
|
|
21
31
|
exports.filesMarkerArg = '--format-files';
|
|
22
32
|
exports.formatImplementation = {
|
|
@@ -57,7 +67,10 @@ exports.formatImplementation = {
|
|
|
57
67
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} --ignore-path .prettierignore
|
|
58
68
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} ${FormatOperation.Write} --ignore-path .prettierignore
|
|
59
69
|
${package_name_1.packageName} ${cli_command_name_1.CliCommandName.Format} ${FormatOperation.Write} --ignore-path .prettierignore ${exports.filesMarkerArg} md json`,
|
|
60
|
-
configKeys: [
|
|
70
|
+
configKeys: [
|
|
71
|
+
config_key_1.ConfigKey.Prettier,
|
|
72
|
+
config_key_1.ConfigKey.PrettierIgnore,
|
|
73
|
+
],
|
|
61
74
|
implementation: runFormatCommand,
|
|
62
75
|
configFlagSupport: {
|
|
63
76
|
[cli_flags_1.CliFlagName.NoWriteConfig]: true,
|
|
@@ -7,7 +7,10 @@ const cli_command_name_1 = require("../../cli-util/cli-command-name");
|
|
|
7
7
|
const cli_flags_1 = require("../../cli-util/cli-flags");
|
|
8
8
|
const update_configs_1 = require("../../cli-util/update-configs");
|
|
9
9
|
const config_key_1 = require("../../config/config-key");
|
|
10
|
-
const exampleFlags = [
|
|
10
|
+
const exampleFlags = [
|
|
11
|
+
config_key_1.ConfigKey.Cspell,
|
|
12
|
+
config_key_1.ConfigKey.GitIgnore,
|
|
13
|
+
];
|
|
11
14
|
exports.updateAllConfigsCommandImplementation = {
|
|
12
15
|
commandName: cli_command_name_1.CliCommandName.UpdateAllConfigs,
|
|
13
16
|
description: `Update all config files.
|
|
@@ -7,7 +7,10 @@ const cli_command_name_1 = require("../../cli-util/cli-command-name");
|
|
|
7
7
|
const cli_flags_1 = require("../../cli-util/cli-flags");
|
|
8
8
|
const update_configs_1 = require("../../cli-util/update-configs");
|
|
9
9
|
const config_key_1 = require("../../config/config-key");
|
|
10
|
-
const exampleFlags = [
|
|
10
|
+
const exampleFlags = [
|
|
11
|
+
config_key_1.BareConfigKey.GitIgnore,
|
|
12
|
+
config_key_1.BareConfigKey.NpmIgnore,
|
|
13
|
+
];
|
|
11
14
|
exports.updateBareConfigsCommandImplementation = {
|
|
12
15
|
commandName: cli_command_name_1.CliCommandName.UpdateBareConfigs,
|
|
13
16
|
description: `Update config files that aren't used in any ${package_name_1.packageName} commands,
|
|
@@ -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,
|
|
@@ -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 };
|
|
@@ -58,7 +58,10 @@ async function updateVirmatorConfig(configKey, repoDir, extendable) {
|
|
|
58
58
|
const repoFileLines = repoConfigContents.split('\n');
|
|
59
59
|
const virmatorFileLines = virmatorConfigContents.split('\n');
|
|
60
60
|
const filteredRepoFileLines = repoFileLines.filter((repoLine) => !virmatorFileLines.includes(repoLine));
|
|
61
|
-
return [
|
|
61
|
+
return [
|
|
62
|
+
...virmatorFileLines,
|
|
63
|
+
...filteredRepoFileLines,
|
|
64
|
+
].join('\n');
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
break;
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virmator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Handle all the stuffs in one package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -38,23 +38,24 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"ansi-styles": "5.2.0",
|
|
41
|
-
"augment-vir": "^1.
|
|
42
|
-
"cspell": "^5.
|
|
41
|
+
"augment-vir": "^1.4.3",
|
|
42
|
+
"cspell": "^5.18.4",
|
|
43
43
|
"fs-extra": "^10.0.0",
|
|
44
44
|
"markdown-code-example-inserter": "^0.1.5",
|
|
45
|
-
"prettier": "^2.
|
|
46
|
-
"prettier-plugin-jsdoc": "^0.3.
|
|
45
|
+
"prettier": "^2.5.1",
|
|
46
|
+
"prettier-plugin-jsdoc": "^0.3.30",
|
|
47
|
+
"prettier-plugin-multiline-arrays": "^0.0.1",
|
|
47
48
|
"prettier-plugin-organize-imports": "^2.3.4",
|
|
48
|
-
"prettier-plugin-packagejson": "^2.2.
|
|
49
|
+
"prettier-plugin-packagejson": "^2.2.15",
|
|
49
50
|
"prettier-plugin-sort-json": "^0.0.2",
|
|
50
|
-
"simple-git": "^2.
|
|
51
|
+
"simple-git": "^3.2.4",
|
|
51
52
|
"test-vir": "^0.2.3",
|
|
52
|
-
"typescript": "^4.
|
|
53
|
+
"typescript": "^4.5.5"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@types/fs-extra": "^9.0.13",
|
|
56
|
-
"@types/node": "^
|
|
57
|
-
"ts-node": "^10.
|
|
57
|
+
"@types/node": "^17.0.17",
|
|
58
|
+
"ts-node": "^10.5.0"
|
|
58
59
|
},
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": ">=12",
|