virmator 3.0.5 → 4.0.0
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/README.md +1 -14
- package/base-configs/base-cspell.js +83 -0
- package/base-configs/base-mocharc.js +14 -0
- package/{configs/.virmator/prettierrc-base.js → base-configs/base-prettierrc.js} +0 -0
- package/{configs/.virmator/tsconfig-base.json → base-configs/base-tsconfig.json} +0 -6
- package/{configs/.virmator/vite-base.ts → base-configs/base-vite.ts} +0 -0
- package/base-configs/test-files-glob.js +5 -0
- package/{configs/.virmator → base-configs}/vite-always-reload-plugin.ts +5 -3
- package/{configs/.virmator → base-configs}/web-test-runner-base.mjs +4 -5
- package/configs/.gitattributes +1 -0
- package/configs/.nvmrc +1 -0
- package/configs/.prettierignore +1 -1
- package/configs/.prettierrc.js +1 -1
- package/configs/{.mocharc.js → configs/.mocharc.js} +1 -1
- package/configs/{.virmator → configs}/vite.config.ts +1 -1
- package/configs/{.virmator → configs}/web-test-runner.config.mjs +1 -1
- package/configs/cspell.config.js +9 -0
- package/configs/gitignore.txt +1 -0
- package/configs/npmignore.txt +1 -0
- package/configs/package.json +9 -5
- package/configs/tsconfig.json +1 -1
- package/cspell.config.js +11 -0
- package/dist/{cli → api}/cli-color.d.ts +1 -0
- package/dist/{cli → api}/cli-color.js +1 -0
- package/dist/api/command/command-configs.d.ts +3 -0
- package/dist/api/command/command-configs.js +11 -0
- package/dist/api/command/command-description.d.ts +8 -0
- package/dist/{cli/cli-command/cli-command-help.js → api/command/command-description.js} +0 -0
- package/dist/api/command/command-executor.d.ts +28 -0
- package/dist/api/command/command-executor.js +7 -0
- package/dist/api/command/command-help.d.ts +8 -0
- package/dist/{package-name.js → api/command/command-help.js} +0 -2
- package/dist/api/command/command-logging.d.ts +11 -0
- package/dist/api/command/command-logging.js +17 -0
- package/dist/api/command/command-mapping.d.ts +7 -0
- package/dist/api/command/command-mapping.js +10 -0
- package/dist/api/command/command-messages.d.ts +1 -0
- package/dist/api/command/command-messages.js +10 -0
- package/dist/api/command/command-to-help-message.d.ts +9 -0
- package/dist/{cli/cli-command/cli-command-to-help-message.js → api/command/command-to-help-message.js} +41 -48
- package/dist/api/command/define-command-inputs.d.ts +14 -0
- package/dist/api/command/define-command-inputs.js +2 -0
- package/dist/api/command/define-command.d.ts +8 -0
- package/dist/api/command/define-command.js +25 -0
- package/dist/api/config/config-file-definition.d.ts +16 -0
- package/dist/api/config/config-file-definition.js +2 -0
- package/dist/api/config/config-paths.d.ts +7 -0
- package/dist/api/config/config-paths.js +8 -0
- package/dist/{cli → api}/config/copy-config.d.ts +5 -4
- package/dist/{cli → api}/config/copy-config.js +26 -28
- package/dist/api/create-virmator.d.ts +8 -0
- package/dist/api/create-virmator.js +65 -0
- package/dist/api/run-command/check-npm-deps.d.ts +7 -0
- package/dist/api/run-command/check-npm-deps.js +107 -0
- package/dist/api/run-command/extract-arguments.d.ts +6 -0
- package/dist/api/run-command/extract-arguments.js +37 -0
- package/dist/api/run-command/run-command-executor.d.ts +5 -0
- package/dist/api/run-command/run-command-executor.js +51 -0
- package/dist/api/run-command/run-extended-virmator.d.ts +10 -0
- package/dist/api/run-command/run-extended-virmator.js +53 -0
- package/dist/{cli/cli-command → api/run-command}/run-shell-command.d.ts +3 -3
- package/dist/{cli/cli-command → api/run-command}/run-shell-command.js +3 -3
- package/dist/api/virmator-types.d.ts +18 -0
- package/dist/api/virmator-types.js +2 -0
- package/dist/augments/fs.d.ts +5 -2
- package/dist/augments/fs.js +20 -8
- package/dist/augments/object.d.ts +3 -0
- package/dist/augments/object.js +33 -2
- package/dist/augments/path.d.ts +1 -0
- package/dist/augments/path.js +14 -0
- package/dist/augments/prettier.d.ts +1 -0
- package/dist/augments/prettier.js +47 -0
- package/dist/augments/string.d.ts +2 -0
- package/dist/augments/string.js +10 -0
- package/dist/augments/test.d.ts +2 -1
- package/dist/augments/test.js +7 -3
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/{cli/cli-command-implementations → commands}/code-in-markdown.command.d.ts +3 -1
- package/dist/{cli/cli-command-implementations → commands}/code-in-markdown.command.js +23 -24
- package/dist/commands/compile.command.d.ts +14 -0
- package/dist/commands/compile.command.js +54 -0
- package/dist/commands/extra-configs/all-extra-configs.d.ts +2 -0
- package/dist/commands/extra-configs/all-extra-configs.js +44 -0
- package/dist/commands/extra-configs/combine-json-config.d.ts +2 -0
- package/dist/commands/extra-configs/combine-json-config.js +22 -0
- package/dist/commands/extra-configs/combine-text-config.d.ts +2 -0
- package/dist/{cli/config → commands/extra-configs}/combine-text-config.js +5 -5
- package/dist/{cli/config → commands/extra-configs}/create-default-package-json.d.ts +0 -0
- package/dist/{cli/config → commands/extra-configs}/create-default-package-json.js +30 -18
- package/dist/commands/format.command.d.ts +19 -0
- package/dist/{cli/cli-command-implementations → commands}/format.command.js +59 -33
- package/dist/commands/frontend.command.d.ts +15 -0
- package/dist/commands/frontend.command.js +78 -0
- package/dist/commands/init.command.d.ts +8 -0
- package/dist/commands/init.command.js +53 -0
- package/dist/commands/spellcheck.command.d.ts +12 -0
- package/dist/commands/spellcheck.command.js +54 -0
- package/dist/commands/test-web.command.d.ts +12 -0
- package/dist/commands/test-web.command.js +68 -0
- package/dist/commands/test.command.d.ts +12 -0
- package/dist/commands/test.command.js +67 -0
- package/dist/{cli/cli-command-implementations → commands}/update-configs.command.d.ts +3 -1
- package/dist/{cli/cli-command-implementations → commands}/update-configs.command.js +14 -10
- package/dist/file-paths/{virmator-package-paths.d.ts → package-paths.d.ts} +1 -1
- package/dist/file-paths/{virmator-package-paths.js → package-paths.js} +3 -4
- package/dist/index.d.ts +134 -1
- package/dist/index.js +55 -0
- package/dist/scripts/save-help-message.d.ts +1 -0
- package/dist/scripts/save-help-message.js +33 -0
- package/package.json +33 -28
- package/.gitattributes +0 -1
- package/.github/workflows/virmator-build-for-gh-pages.yml +0 -24
- package/.github/workflows/virmator-tagged-release.yml +0 -42
- package/.github/workflows/virmator-tests.yml +0 -26
- package/.mocharc.js +0 -9
- package/.prettierignore +0 -5
- package/configs/.cspell.json +0 -4
- package/configs/.virmator/.cspell-base.json +0 -81
- package/configs/.virmator/mocharc-base.js +0 -15
- package/configs/src/global.d.ts +0 -5
- package/dist/api/virmator-wrapper.d.ts +0 -5
- package/dist/api/virmator-wrapper.js +0 -9
- package/dist/cli/all-cli-command-definitions.d.ts +0 -56
- package/dist/cli/all-cli-command-definitions.js +0 -76
- package/dist/cli/cli-command/cli-command-help.d.ts +0 -8
- package/dist/cli/cli-command/cli-command-to-help-message.d.ts +0 -11
- package/dist/cli/cli-command/define-cli-command.d.ts +0 -41
- package/dist/cli/cli-command/define-cli-command.js +0 -29
- package/dist/cli/cli-command-implementations/compile.command.d.ts +0 -6
- package/dist/cli/cli-command-implementations/compile.command.js +0 -44
- package/dist/cli/cli-command-implementations/format.command.d.ts +0 -6
- package/dist/cli/cli-command-implementations/frontend.command.d.ts +0 -7
- package/dist/cli/cli-command-implementations/frontend.command.js +0 -45
- package/dist/cli/cli-command-implementations/init.command.d.ts +0 -6
- package/dist/cli/cli-command-implementations/init.command.js +0 -42
- package/dist/cli/cli-command-implementations/spellcheck.command.d.ts +0 -4
- package/dist/cli/cli-command-implementations/spellcheck.command.js +0 -40
- package/dist/cli/cli-command-implementations/test-web.command.d.ts +0 -4
- package/dist/cli/cli-command-implementations/test-web.command.js +0 -50
- package/dist/cli/cli-command-implementations/test.command.d.ts +0 -4
- package/dist/cli/cli-command-implementations/test.command.js +0 -53
- package/dist/cli/cli-flags/cli-flag-name.d.ts +0 -4
- package/dist/cli/cli-flags/cli-flag-name.js +0 -8
- package/dist/cli/cli-flags/cli-flag-values.d.ts +0 -4
- package/dist/cli/cli-flags/cli-flag-values.js +0 -19
- package/dist/cli/cli-messages.d.ts +0 -6
- package/dist/cli/cli-messages.js +0 -19
- package/dist/cli/cli.d.ts +0 -2
- package/dist/cli/cli.js +0 -54
- package/dist/cli/config/combine-text-config.d.ts +0 -2
- package/dist/cli/config/config-files.d.ts +0 -133
- package/dist/cli/config/config-files.js +0 -138
- package/dist/cli/is-global.d.ts +0 -1
- package/dist/cli/is-global.js +0 -10
- package/dist/cli/parse-arguments.d.ts +0 -8
- package/dist/cli/parse-arguments.js +0 -42
- package/dist/cli/run-cli-command.d.ts +0 -13
- package/dist/cli/run-cli-command.js +0 -52
- package/dist/cli/run-command.test-helper.d.ts +0 -28
- package/dist/cli/run-command.test-helper.js +0 -87
- package/dist/errors/virmator-cli.error.d.ts +0 -3
- package/dist/errors/virmator-cli.error.js +0 -10
- package/dist/errors/virmator-config-file.error.d.ts +0 -4
- package/dist/errors/virmator-config-file.error.js +0 -11
- package/dist/errors/virmator-invalid-command.error.d.ts +0 -5
- package/dist/errors/virmator-invalid-command.error.js +0 -11
- package/dist/errors/virmator-invalid-flags.error.d.ts +0 -5
- package/dist/errors/virmator-invalid-flags.error.js +0 -13
- package/dist/file-paths/repo-paths.d.ts +0 -2
- package/dist/file-paths/repo-paths.js +0 -6
- package/dist/file-paths/virmator-test-file-paths.d.ts +0 -44
- package/dist/logging.d.ts +0 -10
- package/dist/logging.js +0 -9
- package/dist/package-name.d.ts +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.testCommandDefinition = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const define_command_1 = require("../api/command/define-command");
|
|
6
|
+
const package_paths_1 = require("../file-paths/package-paths");
|
|
7
|
+
exports.testCommandDefinition = (0, define_command_1.defineCommand)({
|
|
8
|
+
commandName: 'test',
|
|
9
|
+
subCommandDescriptions: {},
|
|
10
|
+
configFiles: {
|
|
11
|
+
mocharc: {
|
|
12
|
+
copyFromInternalPath: (0, path_1.join)(package_paths_1.virmatorConfigsDir, 'configs', '.mocharc.js'),
|
|
13
|
+
copyToPathRelativeToRepoDir: (0, path_1.join)('configs', '.mocharc.js'),
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
npmDeps: [
|
|
18
|
+
'@types/chai',
|
|
19
|
+
'@types/mocha',
|
|
20
|
+
'chai',
|
|
21
|
+
'mocha',
|
|
22
|
+
'ts-node',
|
|
23
|
+
],
|
|
24
|
+
}, ({ commandName, packageBinName }) => {
|
|
25
|
+
return {
|
|
26
|
+
sections: [
|
|
27
|
+
{
|
|
28
|
+
title: '',
|
|
29
|
+
content: `Test all .test.ts files with Mocha and Chai. By default this command tests all ".test.ts" files in the current directory (recursively) that are not ".type.test.ts" files. To override this behavior, override the "spec" property in .mocharc.js.`,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
title: '',
|
|
33
|
+
content: `This command is meant to run Node.js tests. For running web-based testing, see the test-web command.`,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: '',
|
|
37
|
+
content: `Note that the below single file examples only work because the base Mocha config from ${packageBinName} is setup to handle them. (So if you don't use that config, the examples may not work properly.)`,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
examples: [
|
|
41
|
+
{
|
|
42
|
+
title: 'Test all .test.ts and .test.tsx files',
|
|
43
|
+
content: `${packageBinName} ${commandName}`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: 'Test a single file',
|
|
47
|
+
content: `${packageBinName} ${commandName} ./path/to/single/file.js`,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
title: 'Test multiple files',
|
|
51
|
+
content: `${packageBinName} ${commandName} "./**/single-file.js"`,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}, (inputs) => {
|
|
56
|
+
const useDefaultConfigArgs = !inputs.filteredInputArgs.includes('--config');
|
|
57
|
+
const configString = useDefaultConfigArgs
|
|
58
|
+
? `--config ${inputs.configFiles.mocharc.copyToPathRelativeToRepoDir} `
|
|
59
|
+
: '';
|
|
60
|
+
return {
|
|
61
|
+
mainCommand: (0, package_paths_1.getNpmBinPath)('mocha'),
|
|
62
|
+
args: [
|
|
63
|
+
configString,
|
|
64
|
+
...inputs.filteredInputArgs,
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const updateConfigsCommandDefinition: import("../
|
|
1
|
+
export declare const updateConfigsCommandDefinition: import("../api/command/define-command").CommandDefinition<{
|
|
2
2
|
commandName: "update-configs";
|
|
3
3
|
subCommandDescriptions: {};
|
|
4
|
+
configFiles: {};
|
|
5
|
+
npmDeps: readonly [];
|
|
4
6
|
}>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateConfigsCommandDefinition = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const copy_config_1 = require("../config/copy-config");
|
|
7
|
-
|
|
4
|
+
const command_logging_1 = require("../api/command/command-logging");
|
|
5
|
+
const define_command_1 = require("../api/command/define-command");
|
|
6
|
+
const copy_config_1 = require("../api/config/copy-config");
|
|
7
|
+
const all_extra_configs_1 = require("./extra-configs/all-extra-configs");
|
|
8
|
+
exports.updateConfigsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
8
9
|
commandName: 'update-configs',
|
|
9
10
|
subCommandDescriptions: {},
|
|
11
|
+
configFiles: {},
|
|
12
|
+
npmDeps: [],
|
|
10
13
|
}, () => {
|
|
11
14
|
return {
|
|
12
15
|
sections: [
|
|
@@ -19,13 +22,14 @@ exports.updateConfigsCommandDefinition = (0, define_cli_command_1.defineCliComma
|
|
|
19
22
|
};
|
|
20
23
|
}, async (inputs) => {
|
|
21
24
|
const success = await (0, copy_config_1.copyAllConfigFiles)({
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
packageDir: inputs.packageDir,
|
|
26
|
+
configFiles: [
|
|
27
|
+
...inputs.allConfigs,
|
|
28
|
+
...all_extra_configs_1.nonCommandConfigs,
|
|
29
|
+
],
|
|
30
|
+
logging: command_logging_1.defaultConsoleLogging,
|
|
24
31
|
operation: copy_config_1.CopyConfigOperation.Update,
|
|
25
32
|
repoDir: inputs.repoDir,
|
|
26
33
|
});
|
|
27
|
-
return {
|
|
28
|
-
fullExecutedCommand: '',
|
|
29
|
-
success: success,
|
|
30
|
-
};
|
|
34
|
+
return { success };
|
|
31
35
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const virmatorPackageDir: string;
|
|
2
|
-
export declare const virmatorDistDir: string;
|
|
3
2
|
export declare const virmatorConfigsDir: string;
|
|
4
3
|
export declare const virmatorConfigs: {
|
|
5
4
|
dotVirmator: string;
|
|
@@ -7,5 +6,6 @@ export declare const virmatorConfigs: {
|
|
|
7
6
|
vsCode: string;
|
|
8
7
|
src: string;
|
|
9
8
|
};
|
|
9
|
+
export declare const virmatorNodeBin: string;
|
|
10
10
|
export declare function getNpmBinPath(command: string): string;
|
|
11
11
|
export declare function relativeToVirmatorRoot(fullPath: string): string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.relativeToVirmatorRoot = exports.getNpmBinPath = exports.
|
|
3
|
+
exports.relativeToVirmatorRoot = exports.getNpmBinPath = exports.virmatorNodeBin = exports.virmatorConfigs = exports.virmatorConfigsDir = exports.virmatorPackageDir = void 0;
|
|
4
4
|
const node_only_1 = require("augment-vir/dist/cjs/node-only");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
exports.virmatorPackageDir = (0, path_1.dirname)((0, path_1.dirname)(__dirname));
|
|
8
|
-
exports.virmatorDistDir = (0, path_1.join)(exports.virmatorPackageDir, 'dist');
|
|
9
8
|
exports.virmatorConfigsDir = (0, path_1.join)(exports.virmatorPackageDir, 'configs');
|
|
10
9
|
exports.virmatorConfigs = {
|
|
11
10
|
dotVirmator: (0, path_1.join)(exports.virmatorConfigsDir, '.virmator'),
|
|
@@ -13,9 +12,9 @@ exports.virmatorConfigs = {
|
|
|
13
12
|
vsCode: (0, path_1.join)(exports.virmatorConfigsDir, '.vscode'),
|
|
14
13
|
src: (0, path_1.join)(exports.virmatorConfigsDir, 'src'),
|
|
15
14
|
};
|
|
16
|
-
|
|
15
|
+
exports.virmatorNodeBin = (0, path_1.join)(exports.virmatorPackageDir, 'node_modules', '.bin');
|
|
17
16
|
function getNpmBinPath(command) {
|
|
18
|
-
const virmatorBinPath = (0, path_1.join)(virmatorNodeBin, command);
|
|
17
|
+
const virmatorBinPath = (0, path_1.join)(exports.virmatorNodeBin, command);
|
|
19
18
|
const actualBinPath = (0, fs_1.existsSync)(virmatorBinPath)
|
|
20
19
|
? virmatorBinPath
|
|
21
20
|
: (0, path_1.join)(exports.virmatorPackageDir, '..', '.bin', command);
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,134 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './api/cli-color';
|
|
2
|
+
export * from './api/command/command-description';
|
|
3
|
+
export * from './api/command/command-executor';
|
|
4
|
+
export * from './api/command/command-help';
|
|
5
|
+
export * from './api/command/command-logging';
|
|
6
|
+
export * from './api/command/command-mapping';
|
|
7
|
+
export * from './api/command/command-messages';
|
|
8
|
+
export * from './api/command/command-to-help-message';
|
|
9
|
+
export * from './api/command/define-command';
|
|
10
|
+
export * from './api/command/define-command-inputs';
|
|
11
|
+
export * from './api/config/config-file-definition';
|
|
12
|
+
export * from './api/config/config-paths';
|
|
13
|
+
export * from './api/virmator-types';
|
|
14
|
+
export * from './commands/extra-configs/combine-text-config';
|
|
15
|
+
export declare const virmator: Readonly<{
|
|
16
|
+
packageBinName: string;
|
|
17
|
+
cliHelpMessage: string;
|
|
18
|
+
markdownHelpMessage: string;
|
|
19
|
+
commandMapping: import("./api/command/command-mapping").CommandDefinitionArrayToMapping<(import("./api/command/define-command").CommandDefinition<{
|
|
20
|
+
commandName: "code-in-markdown";
|
|
21
|
+
subCommandDescriptions: {
|
|
22
|
+
readonly check: "Check that markdown files have their examples inserted and are up-to-date.";
|
|
23
|
+
};
|
|
24
|
+
configFiles: {};
|
|
25
|
+
npmDeps: readonly ["markdown-code-example-inserter"];
|
|
26
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
27
|
+
commandName: "compile";
|
|
28
|
+
subCommandDescriptions: {
|
|
29
|
+
readonly check: "Run type checking without emitting compiled files.";
|
|
30
|
+
};
|
|
31
|
+
configFiles: {
|
|
32
|
+
readonly tsConfig: {
|
|
33
|
+
readonly copyFromInternalPath: string;
|
|
34
|
+
readonly copyToPathRelativeToRepoDir: "tsconfig.json";
|
|
35
|
+
readonly required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
npmDeps: readonly ["typescript"];
|
|
39
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
40
|
+
commandName: "format";
|
|
41
|
+
subCommandDescriptions: {
|
|
42
|
+
readonly check: "check formatting without overwriting files.";
|
|
43
|
+
};
|
|
44
|
+
configFiles: {
|
|
45
|
+
readonly prettierrc: {
|
|
46
|
+
readonly copyFromInternalPath: string;
|
|
47
|
+
readonly copyToPathRelativeToRepoDir: ".prettierrc.js";
|
|
48
|
+
readonly required: true;
|
|
49
|
+
};
|
|
50
|
+
readonly prettierIgnore: {
|
|
51
|
+
readonly copyFromInternalPath: string;
|
|
52
|
+
readonly copyToPathRelativeToRepoDir: ".prettierignore";
|
|
53
|
+
readonly required: true;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
npmDeps: readonly ["prettier", "prettier-plugin-jsdoc", "prettier-plugin-multiline-arrays", "prettier-plugin-organize-imports", "prettier-plugin-packagejson", "prettier-plugin-sort-json", "prettier-plugin-toml"];
|
|
57
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
58
|
+
commandName: "frontend";
|
|
59
|
+
subCommandDescriptions: {
|
|
60
|
+
readonly build: "Builds and bundles the frontend for deployment.";
|
|
61
|
+
readonly preview: "Builds and previews the built output.";
|
|
62
|
+
};
|
|
63
|
+
configFiles: {
|
|
64
|
+
readonly vite: {
|
|
65
|
+
readonly copyFromInternalPath: string;
|
|
66
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
67
|
+
readonly required: true;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
npmDeps: readonly ["vite", "ansi-colors"];
|
|
71
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
72
|
+
commandName: "init";
|
|
73
|
+
subCommandDescriptions: {
|
|
74
|
+
readonly force: "force overwrite files even if they already exist.";
|
|
75
|
+
};
|
|
76
|
+
configFiles: {};
|
|
77
|
+
npmDeps: readonly ["prettier", "prettier-plugin-jsdoc", "prettier-plugin-multiline-arrays", "prettier-plugin-organize-imports", "prettier-plugin-packagejson", "prettier-plugin-sort-json", "prettier-plugin-toml"];
|
|
78
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
79
|
+
commandName: "spellcheck";
|
|
80
|
+
subCommandDescriptions: {};
|
|
81
|
+
configFiles: {
|
|
82
|
+
readonly cspell: {
|
|
83
|
+
readonly copyFromInternalPath: string;
|
|
84
|
+
readonly copyToPathRelativeToRepoDir: "cspell.config.js";
|
|
85
|
+
readonly required: true;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
npmDeps: readonly ["cspell"];
|
|
89
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
90
|
+
commandName: "test";
|
|
91
|
+
subCommandDescriptions: {};
|
|
92
|
+
configFiles: {
|
|
93
|
+
readonly mocharc: {
|
|
94
|
+
readonly copyFromInternalPath: string;
|
|
95
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
96
|
+
readonly required: true;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
npmDeps: readonly ["@types/chai", "@types/mocha", "chai", "mocha", "ts-node"];
|
|
100
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
101
|
+
commandName: "test-web";
|
|
102
|
+
subCommandDescriptions: {};
|
|
103
|
+
configFiles: {
|
|
104
|
+
readonly webTestRunner: {
|
|
105
|
+
readonly copyFromInternalPath: string;
|
|
106
|
+
readonly copyToPathRelativeToRepoDir: string;
|
|
107
|
+
readonly required: true;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
npmDeps: readonly ["@open-wc/testing", "@web/dev-server-esbuild", "@web/test-runner", "@web/test-runner-commands", "@web/test-runner-playwright"];
|
|
111
|
+
}> | import("./api/command/define-command").CommandDefinition<{
|
|
112
|
+
commandName: "update-configs";
|
|
113
|
+
subCommandDescriptions: {};
|
|
114
|
+
configFiles: {};
|
|
115
|
+
npmDeps: readonly [];
|
|
116
|
+
}>)[]>;
|
|
117
|
+
extend: <CommandDefinitionsGeneric extends readonly any[]>(inputs: Readonly<{
|
|
118
|
+
packageBinName: string;
|
|
119
|
+
packageRootDir: string;
|
|
120
|
+
commandDefinitions?: CommandDefinitionsGeneric;
|
|
121
|
+
}>) => Readonly<{
|
|
122
|
+
packageBinName: string;
|
|
123
|
+
cliHelpMessage: string;
|
|
124
|
+
markdownHelpMessage: string;
|
|
125
|
+
commandMapping: import("./api/command/command-mapping").CommandDefinitionArrayToMapping<CommandDefinitionsGeneric>;
|
|
126
|
+
extend: any;
|
|
127
|
+
allConfigs: readonly import("./api/config/config-file-definition").ConfigFileDefinition[];
|
|
128
|
+
runInCli: () => Promise<void>;
|
|
129
|
+
run: (allArgs: string[], repoDir: string) => Promise<void>;
|
|
130
|
+
}>;
|
|
131
|
+
allConfigs: readonly import("./api/config/config-file-definition").ConfigFileDefinition[];
|
|
132
|
+
runInCli: () => Promise<void>;
|
|
133
|
+
run: (allArgs: string[], repoDir: string) => Promise<void>;
|
|
134
|
+
}>;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.virmator = void 0;
|
|
18
|
+
const create_virmator_1 = require("./api/create-virmator");
|
|
19
|
+
const code_in_markdown_command_1 = require("./commands/code-in-markdown.command");
|
|
20
|
+
const compile_command_1 = require("./commands/compile.command");
|
|
21
|
+
const format_command_1 = require("./commands/format.command");
|
|
22
|
+
const frontend_command_1 = require("./commands/frontend.command");
|
|
23
|
+
const init_command_1 = require("./commands/init.command");
|
|
24
|
+
const spellcheck_command_1 = require("./commands/spellcheck.command");
|
|
25
|
+
const test_web_command_1 = require("./commands/test-web.command");
|
|
26
|
+
const test_command_1 = require("./commands/test.command");
|
|
27
|
+
const update_configs_command_1 = require("./commands/update-configs.command");
|
|
28
|
+
const package_paths_1 = require("./file-paths/package-paths");
|
|
29
|
+
__exportStar(require("./api/cli-color"), exports);
|
|
30
|
+
__exportStar(require("./api/command/command-description"), exports);
|
|
31
|
+
__exportStar(require("./api/command/command-executor"), exports);
|
|
32
|
+
__exportStar(require("./api/command/command-help"), exports);
|
|
33
|
+
__exportStar(require("./api/command/command-logging"), exports);
|
|
34
|
+
__exportStar(require("./api/command/command-mapping"), exports);
|
|
35
|
+
__exportStar(require("./api/command/command-messages"), exports);
|
|
36
|
+
__exportStar(require("./api/command/command-to-help-message"), exports);
|
|
37
|
+
__exportStar(require("./api/command/define-command"), exports);
|
|
38
|
+
__exportStar(require("./api/command/define-command-inputs"), exports);
|
|
39
|
+
__exportStar(require("./api/config/config-file-definition"), exports);
|
|
40
|
+
__exportStar(require("./api/config/config-paths"), exports);
|
|
41
|
+
__exportStar(require("./api/virmator-types"), exports);
|
|
42
|
+
__exportStar(require("./commands/extra-configs/combine-text-config"), exports);
|
|
43
|
+
exports.virmator = (0, create_virmator_1.createVirmator)({
|
|
44
|
+
packageBinName: 'virmator',
|
|
45
|
+
packageRootDir: package_paths_1.virmatorPackageDir,
|
|
46
|
+
commandDefinitions: [
|
|
47
|
+
code_in_markdown_command_1.codeInMarkdownCommandDefinition,
|
|
48
|
+
compile_command_1.compileCommandDefinition,
|
|
49
|
+
format_command_1.formatCommandDefinition,
|
|
50
|
+
frontend_command_1.frontendCommandDefinition,
|
|
51
|
+
init_command_1.initCommandDefinition,
|
|
52
|
+
spellcheck_command_1.spellcheckCommandDefinition,
|
|
53
|
+
test_web_command_1.testWebCommandDefinition,
|
|
54
|
+
test_command_1.testCommandDefinition,
|
|
55
|
+
update_configs_command_1.updateConfigsCommandDefinition,
|
|
56
|
+
],
|
|
57
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const promises_1 = require("fs/promises");
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const cli_color_1 = require("../api/cli-color");
|
|
6
|
+
const command_to_help_message_1 = require("../api/command/command-to-help-message");
|
|
7
|
+
const prettier_1 = require("../augments/prettier");
|
|
8
|
+
const virmator_test_file_paths_1 = require("../test/virmator-test-file-paths");
|
|
9
|
+
const usageTrigger = '<!-- usage below -->';
|
|
10
|
+
async function main(args) {
|
|
11
|
+
const check = args.join(' ').includes('check');
|
|
12
|
+
const helpMessage = (0, command_to_help_message_1.generateHelpMessage)(__1.virmator.packageBinName, __1.virmator.commandMapping, command_to_help_message_1.HelpMessageSyntax.Markdown);
|
|
13
|
+
const originalReadme = (await (0, promises_1.readFile)(virmator_test_file_paths_1.virmatorReadme)).toString();
|
|
14
|
+
const triggerIndex = originalReadme.indexOf(usageTrigger);
|
|
15
|
+
if (triggerIndex === -1) {
|
|
16
|
+
throw new Error(`Could not find the trigger "${usageTrigger}" in the README file: ${virmator_test_file_paths_1.virmatorReadme}`);
|
|
17
|
+
}
|
|
18
|
+
const newReadme = await (0, prettier_1.formatCode)(`${originalReadme.slice(0, triggerIndex + usageTrigger.length)}\n\n${helpMessage}`, 'README.md');
|
|
19
|
+
await (0, promises_1.writeFile)(virmator_test_file_paths_1.virmatorReadme, newReadme);
|
|
20
|
+
if (check) {
|
|
21
|
+
const formattedReadme = (await (0, promises_1.readFile)(virmator_test_file_paths_1.virmatorReadme)).toString();
|
|
22
|
+
const wasReadmeChanged = formattedReadme !== originalReadme;
|
|
23
|
+
await (0, promises_1.writeFile)(virmator_test_file_paths_1.virmatorReadme, originalReadme);
|
|
24
|
+
if (wasReadmeChanged) {
|
|
25
|
+
console.info(`${cli_color_1.Color.Bold}${cli_color_1.Color.Fail}README usage message is not up to date.${cli_color_1.Color.Reset}\nRun ${cli_color_1.Color.Info}npm run readme:update${cli_color_1.Color.Reset} to update.\n`);
|
|
26
|
+
throw new Error(`README not up to date.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
main(process.argv.slice(2)).catch((error) => {
|
|
31
|
+
console.error(error);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "virmator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Handle all the stuffs in one package.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -25,52 +25,57 @@
|
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/index.js",
|
|
27
27
|
"types": "dist/index.d.ts",
|
|
28
|
-
"bin": "dist/cli
|
|
28
|
+
"bin": "dist/cli.js",
|
|
29
29
|
"scripts": {
|
|
30
|
-
"compile": "rm -rf dist && tsc
|
|
31
|
-
"format": "npm run format:base -- --write",
|
|
30
|
+
"compile": "rm -rf dist && tsc",
|
|
31
|
+
"format": "npm run format:base -- --write --list-different",
|
|
32
32
|
"format:base": "prettier \"./**/*.+(ts|json|html|css|md|js)\"",
|
|
33
33
|
"format:check": "npm run format:base -- --check",
|
|
34
34
|
"prepublishOnly": "npm run test:full",
|
|
35
35
|
"readme:check": "npm run compile && ts-node -r tsconfig-paths/register src/scripts/save-help-message.ts check && md-code --check README.md",
|
|
36
36
|
"readme:update": "npm run compile && ts-node -r tsconfig-paths/register src/scripts/save-help-message.ts && md-code README.md",
|
|
37
37
|
"spellcheck": "cspell \"{*,.*,**/{.*,*}/**/{.*,*}}\" --exclude \"test-files/spellcheck/invalid-spellcheck-repo/**/*\" --exclude \"extender-configs\"",
|
|
38
|
-
"test": "
|
|
38
|
+
"test": "bash src/scripts/run-tests.sh",
|
|
39
39
|
"test:full": "npm run test && npm run spellcheck -- --no-progress && npm run format:check && npm run readme:check",
|
|
40
|
-
"test:help": "ts-node -r tsconfig-paths/register src/cli/cli.ts --help"
|
|
40
|
+
"test:help": "ts-node -r tsconfig-paths/register src/cli/cli.ts --help",
|
|
41
|
+
"test:types": "tsc --noEmit"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
44
|
+
"ansi-colors": "^4.1.3",
|
|
45
|
+
"augment-vir": "2.5.1",
|
|
46
|
+
"semver": "7.3.7",
|
|
47
|
+
"simple-git": "3.14.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
43
50
|
"@open-wc/testing": "3.1.6",
|
|
44
|
-
"@types/chai": "4.3.
|
|
45
|
-
"@types/mocha": "
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@web/
|
|
49
|
-
"@web/test-runner
|
|
51
|
+
"@types/chai": "4.3.3",
|
|
52
|
+
"@types/mocha": "10.0.0",
|
|
53
|
+
"@types/node": "18.8.0",
|
|
54
|
+
"@types/semver": "7.3.12",
|
|
55
|
+
"@web/dev-server-esbuild": "0.3.2",
|
|
56
|
+
"@web/test-runner": "0.14.0",
|
|
57
|
+
"@web/test-runner-commands": "0.6.5",
|
|
58
|
+
"@web/test-runner-playwright": "0.8.10",
|
|
50
59
|
"ansi-colors": "4.1.3",
|
|
51
|
-
"augment-vir": "2.
|
|
60
|
+
"augment-vir": "2.5.1",
|
|
52
61
|
"chai": "4.3.6",
|
|
53
|
-
"cspell": "6.
|
|
62
|
+
"cspell": "6.12.0",
|
|
54
63
|
"markdown-code-example-inserter": "0.1.11",
|
|
55
64
|
"mocha": "10.0.0",
|
|
56
65
|
"prettier": "2.7.1",
|
|
57
|
-
"prettier-plugin-jsdoc": "0.
|
|
58
|
-
"prettier-plugin-multiline-arrays": "1.1.
|
|
59
|
-
"prettier-plugin-organize-imports": "3.
|
|
60
|
-
"prettier-plugin-packagejson": "2.
|
|
61
|
-
"prettier-plugin-sort-json": "0.0.
|
|
66
|
+
"prettier-plugin-jsdoc": "0.4.2",
|
|
67
|
+
"prettier-plugin-multiline-arrays": "1.1.1",
|
|
68
|
+
"prettier-plugin-organize-imports": "3.1.1",
|
|
69
|
+
"prettier-plugin-packagejson": "2.3.0",
|
|
70
|
+
"prettier-plugin-sort-json": "0.0.3",
|
|
62
71
|
"prettier-plugin-toml": "0.3.1",
|
|
63
|
-
"simple-git": "3.10.0",
|
|
64
72
|
"ts-node": "10.9.1",
|
|
65
|
-
"tsconfig-paths": "4.
|
|
66
|
-
"typescript": "4.
|
|
67
|
-
"vite": "3.
|
|
68
|
-
},
|
|
69
|
-
"devDependencies": {
|
|
70
|
-
"@types/node": "18.0.6"
|
|
73
|
+
"tsconfig-paths": "4.1.0",
|
|
74
|
+
"typescript": "4.8.4",
|
|
75
|
+
"vite": "3.1.4"
|
|
71
76
|
},
|
|
72
77
|
"engines": {
|
|
73
|
-
"node": ">=
|
|
74
|
-
"npm": ">=
|
|
78
|
+
"node": ">=16",
|
|
79
|
+
"npm": ">=8"
|
|
75
80
|
}
|
|
76
81
|
}
|
package/.gitattributes
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
* text=auto eol=lf
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
name: build-for-gh-pages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build-for-gh-pages:
|
|
10
|
-
runs-on: 'ubuntu-latest'
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v3
|
|
14
|
-
- uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: 16.x
|
|
17
|
-
- name: build
|
|
18
|
-
run: |
|
|
19
|
-
npm ci
|
|
20
|
-
npm run build
|
|
21
|
-
- uses: JamesIves/github-pages-deploy-action@v4
|
|
22
|
-
with:
|
|
23
|
-
branch: 'gh-pages'
|
|
24
|
-
folder: 'dist'
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
name: 'tagged-release'
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
tagged-release:
|
|
10
|
-
name: 'Tagged Release'
|
|
11
|
-
if: github.event.base_ref == 'refs/heads/main' || github.event.base_ref == 'refs/heads/master'
|
|
12
|
-
runs-on: 'ubuntu-latest'
|
|
13
|
-
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v3
|
|
16
|
-
- name: Use Node.js
|
|
17
|
-
uses: actions/setup-node@v3
|
|
18
|
-
with:
|
|
19
|
-
node-version: 16.x
|
|
20
|
-
- name: run test
|
|
21
|
-
run: |
|
|
22
|
-
npm ci
|
|
23
|
-
npx playwright install --with-deps
|
|
24
|
-
npm run test:full
|
|
25
|
-
- name: pack and set vars
|
|
26
|
-
id: vars
|
|
27
|
-
run: |
|
|
28
|
-
tagName="${GITHUB_REF#refs/*/}"
|
|
29
|
-
originalTarName="$(npm pack)"
|
|
30
|
-
packageNameWithoutFileExtension="${originalTarName%.tgz}"
|
|
31
|
-
tagNameWithoutV="${tagName##v}"
|
|
32
|
-
packageName="${packageNameWithoutFileExtension%-$tagNameWithoutV}"
|
|
33
|
-
newTarName="$packageName-$tagName.tgz"
|
|
34
|
-
mv "$originalTarName" "$newTarName"
|
|
35
|
-
echo ::set-output name=tarName::"$newTarName"
|
|
36
|
-
|
|
37
|
-
- uses: 'marvinpinto/action-automatic-releases@latest'
|
|
38
|
-
with:
|
|
39
|
-
repo_token: '${{ secrets.GITHUB_TOKEN }}'
|
|
40
|
-
prerelease: false
|
|
41
|
-
files: |
|
|
42
|
-
${{ steps.vars.outputs.tarName }}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
name: tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- '**'
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ${{ matrix.os }}
|
|
11
|
-
strategy:
|
|
12
|
-
fail-fast: false
|
|
13
|
-
matrix:
|
|
14
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
-
node-version: [16.x, 18.x]
|
|
16
|
-
steps:
|
|
17
|
-
- uses: actions/checkout@v3
|
|
18
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
19
|
-
uses: actions/setup-node@v3
|
|
20
|
-
with:
|
|
21
|
-
node-version: ${{ matrix.node-version }}
|
|
22
|
-
- name: run test
|
|
23
|
-
run: |
|
|
24
|
-
npm ci
|
|
25
|
-
npx playwright install --with-deps
|
|
26
|
-
npm run test:full
|
package/.mocharc.js
DELETED
package/.prettierignore
DELETED
package/configs/.cspell.json
DELETED