virmator 2.0.7 → 3.0.2
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-build-for-gh-pages.yml +24 -0
- package/.github/workflows/virmator-tagged-release.yml +8 -4
- package/.github/workflows/virmator-tests.yml +4 -3
- package/.mocharc.js +9 -0
- package/.prettierignore +2 -3
- package/README.md +67 -82
- package/configs/.cspell.json +4 -0
- package/configs/.gitattributes +1 -0
- package/configs/.mocharc.js +8 -0
- package/configs/.prettierignore +6 -0
- package/configs/.prettierrc.js +13 -0
- package/{.cspell.json → configs/.virmator/.cspell-base.json} +5 -0
- package/configs/.virmator/mocharc-base.js +15 -0
- package/configs/.virmator/prettierrc-base.js +62 -0
- package/{tsconfig.json → configs/.virmator/tsconfig-base.json} +12 -8
- package/configs/.virmator/vite-always-reload-plugin.ts +90 -0
- package/configs/.virmator/vite-base.ts +11 -0
- package/configs/.virmator/vite.config.ts +8 -0
- package/configs/.virmator/web-test-runner-base.mjs +29 -0
- package/configs/.virmator/web-test-runner.config.mjs +8 -0
- package/{.vscode → configs/.vscode}/settings.json +12 -0
- package/configs/gitignore.txt +6 -0
- package/configs/npmignore.txt +13 -0
- package/configs/package.json +16 -0
- package/configs/src/global.d.ts +5 -0
- package/configs/tsconfig.json +3 -0
- package/dist/api/virmator-wrapper.d.ts +5 -0
- package/dist/api/virmator-wrapper.js +9 -0
- package/dist/augments/array.d.ts +1 -0
- package/dist/augments/array.js +7 -0
- package/dist/augments/fs.d.ts +5 -0
- package/dist/augments/fs.js +30 -0
- package/dist/augments/json.d.ts +1 -0
- package/dist/augments/json.js +12 -0
- package/dist/augments/object.d.ts +1 -0
- package/dist/augments/object.js +14 -0
- package/dist/augments/regexp.d.ts +1 -0
- package/dist/augments/regexp.js +7 -0
- package/dist/augments/test.d.ts +2 -0
- package/dist/augments/test.js +8 -0
- package/dist/augments/type.d.ts +1 -0
- package/dist/augments/type.js +2 -0
- package/dist/cli/all-cli-command-definitions.d.ts +54 -0
- package/dist/cli/all-cli-command-definitions.js +76 -0
- package/dist/cli/cli-color.d.ts +8 -0
- package/dist/cli/cli-color.js +12 -0
- package/dist/cli/cli-command/cli-command-help.d.ts +8 -0
- package/dist/cli/cli-command/cli-command-help.js +2 -0
- package/dist/cli/{commands/description-printing.d.ts → cli-command/cli-command-to-help-message.d.ts} +3 -2
- package/dist/cli/{commands/description-printing.js → cli-command/cli-command-to-help-message.js} +55 -21
- package/dist/cli/cli-command/define-cli-command.d.ts +41 -0
- package/dist/cli/cli-command/define-cli-command.js +29 -0
- package/dist/cli/cli-command/run-shell-command.d.ts +8 -0
- package/dist/cli/cli-command/run-shell-command.js +23 -0
- package/dist/cli/cli-command-implementations/code-in-markdown.command.d.ts +6 -0
- package/dist/cli/cli-command-implementations/code-in-markdown.command.js +67 -0
- package/dist/cli/cli-command-implementations/compile.command.d.ts +6 -0
- package/dist/cli/cli-command-implementations/compile.command.js +44 -0
- package/dist/cli/cli-command-implementations/format.command.d.ts +6 -0
- package/dist/cli/cli-command-implementations/format.command.js +116 -0
- package/dist/cli/cli-command-implementations/frontend.command.d.ts +7 -0
- package/dist/cli/cli-command-implementations/frontend.command.js +45 -0
- package/dist/cli/cli-command-implementations/init.command.d.ts +4 -0
- package/dist/cli/cli-command-implementations/init.command.js +31 -0
- package/dist/cli/cli-command-implementations/spellcheck.command.d.ts +4 -0
- package/dist/cli/cli-command-implementations/spellcheck.command.js +40 -0
- package/dist/cli/cli-command-implementations/test-web.command.d.ts +4 -0
- package/dist/cli/cli-command-implementations/test-web.command.js +50 -0
- package/dist/cli/cli-command-implementations/test.command.d.ts +4 -0
- package/dist/cli/cli-command-implementations/test.command.js +53 -0
- package/dist/cli/cli-command-implementations/update-configs.command.d.ts +4 -0
- package/dist/cli/cli-command-implementations/update-configs.command.js +31 -0
- package/dist/cli/cli-flags/cli-flag-name.d.ts +4 -0
- package/dist/cli/cli-flags/cli-flag-name.js +8 -0
- package/dist/cli/cli-flags/cli-flag-values.d.ts +4 -0
- package/dist/cli/cli-flags/cli-flag-values.js +19 -0
- package/dist/cli/cli-messages.d.ts +6 -0
- package/dist/cli/cli-messages.js +19 -0
- package/dist/cli/cli.js +27 -20
- package/dist/cli/config/combine-text-config.d.ts +2 -0
- package/dist/cli/config/combine-text-config.js +27 -0
- package/dist/cli/config/config-files.d.ts +133 -0
- package/dist/cli/config/config-files.js +138 -0
- package/dist/cli/config/copy-config.d.ts +25 -13
- package/dist/cli/config/copy-config.js +86 -86
- package/dist/cli/config/create-default-package-json.d.ts +1 -16
- package/dist/cli/config/create-default-package-json.js +37 -12
- package/dist/cli/is-global.d.ts +1 -0
- package/dist/cli/is-global.js +10 -0
- package/dist/cli/parse-arguments.d.ts +8 -0
- package/dist/cli/parse-arguments.js +42 -0
- package/dist/cli/run-cli-command.d.ts +13 -0
- package/dist/cli/run-cli-command.js +52 -0
- package/dist/cli/run-command.test-helper.d.ts +28 -0
- package/dist/cli/run-command.test-helper.js +87 -0
- package/dist/errors/virmator-cli.error.d.ts +3 -0
- package/dist/errors/virmator-cli.error.js +10 -0
- package/dist/errors/virmator-config-file.error.d.ts +4 -0
- package/dist/errors/virmator-config-file.error.js +11 -0
- package/dist/errors/virmator-invalid-command.error.d.ts +5 -0
- package/dist/errors/virmator-invalid-command.error.js +11 -0
- package/dist/errors/virmator-invalid-flags.error.d.ts +5 -0
- package/dist/errors/virmator-invalid-flags.error.js +13 -0
- package/dist/file-paths/virmator-package-paths.d.ts +11 -0
- package/dist/file-paths/virmator-package-paths.js +31 -0
- package/dist/file-paths/virmator-test-file-paths.d.ts +17 -7
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -4
- package/dist/logging.d.ts +10 -0
- package/dist/logging.js +9 -0
- package/package.json +26 -20
- package/.prettierrc.js +0 -40
- package/dist/augments/ansi-regex.d.ts +0 -1
- package/dist/augments/ansi-regex.js +0 -27
- package/dist/augments/string.d.ts +0 -1
- package/dist/augments/string.js +0 -8
- package/dist/cli/cli-util/cli-color.d.ts +0 -8
- package/dist/cli/cli-util/cli-color.js +0 -35
- package/dist/cli/cli-util/cli-command-name.d.ts +0 -11
- package/dist/cli/cli-util/cli-command-name.js +0 -15
- package/dist/cli/cli-util/cli-flags.d.ts +0 -18
- package/dist/cli/cli-util/cli-flags.js +0 -63
- package/dist/cli/cli-util/cli-messages.d.ts +0 -7
- package/dist/cli/cli-util/cli-messages.js +0 -19
- package/dist/cli/cli-util/get-all-command-output.d.ts +0 -7
- package/dist/cli/cli-util/get-all-command-output.js +0 -21
- package/dist/cli/cli-util/shell-command-wrapper.d.ts +0 -8
- package/dist/cli/cli-util/shell-command-wrapper.js +0 -25
- package/dist/cli/cli-util/update-configs.d.ts +0 -3
- package/dist/cli/cli-util/update-configs.js +0 -54
- package/dist/cli/commands/all-cli-commands.d.ts +0 -13
- package/dist/cli/commands/all-cli-commands.js +0 -99
- package/dist/cli/commands/cli-command.d.ts +0 -35
- package/dist/cli/commands/cli-command.js +0 -40
- package/dist/cli/commands/implementations/code-in-markdown.command.d.ts +0 -3
- package/dist/cli/commands/implementations/code-in-markdown.command.js +0 -54
- package/dist/cli/commands/implementations/compile.command.d.ts +0 -3
- package/dist/cli/commands/implementations/compile.command.js +0 -49
- package/dist/cli/commands/implementations/format.command.d.ts +0 -16
- package/dist/cli/commands/implementations/format.command.js +0 -143
- package/dist/cli/commands/implementations/init.command.d.ts +0 -3
- package/dist/cli/commands/implementations/init.command.js +0 -55
- package/dist/cli/commands/implementations/spellcheck.command.d.ts +0 -3
- package/dist/cli/commands/implementations/spellcheck.command.js +0 -35
- package/dist/cli/commands/implementations/test.command.d.ts +0 -3
- package/dist/cli/commands/implementations/test.command.js +0 -49
- package/dist/cli/commands/implementations/update-all-configs.command.d.ts +0 -3
- package/dist/cli/commands/implementations/update-all-configs.command.js +0 -46
- package/dist/cli/commands/implementations/update-bare-configs.command.d.ts +0 -3
- package/dist/cli/commands/implementations/update-bare-configs.command.js +0 -46
- package/dist/cli/commands/run-command.d.ts +0 -3
- package/dist/cli/commands/run-command.js +0 -65
- package/dist/cli/config/config-key.d.ts +0 -35
- package/dist/cli/config/config-key.js +0 -25
- package/dist/cli/config/config-paths.d.ts +0 -3
- package/dist/cli/config/config-paths.js +0 -69
- package/dist/cli/config/config-read.d.ts +0 -7
- package/dist/cli/config/config-read.js +0 -91
- package/dist/cli/config/extendable-config.d.ts +0 -12
- package/dist/cli/config/extendable-config.js +0 -45
- package/dist/errors/cli-command-error.d.ts +0 -4
- package/dist/errors/cli-command-error.js +0 -12
- package/dist/errors/cli-flag-error.d.ts +0 -4
- package/dist/errors/cli-flag-error.js +0 -12
- package/dist/errors/config-file-error.d.ts +0 -3
- package/dist/errors/config-file-error.js +0 -7
- package/dist/exportable-jest-config/jest-config.d.ts +0 -3
- package/dist/exportable-jest-config/jest-config.js +0 -23
- package/dist/exportable-jest-config/jest-setup.d.ts +0 -1
- package/dist/exportable-jest-config/jest-setup.js +0 -11
- package/dist/file-paths/virmator-repo-paths.d.ts +0 -5
- package/dist/file-paths/virmator-repo-paths.js +0 -19
- package/dist/jest/jest-config.d.ts +0 -3
- package/dist/jest/jest-config.js +0 -13
- package/extender-configs/.cspell.json +0 -3
- package/extender-configs/.prettierrc.js +0 -3
- package/extender-configs/tsconfig.json +0 -3
- package/separate-configs/.prettierignore +0 -3
- package/separate-configs/gitignore.txt +0 -4
- package/separate-configs/jest/jest-config.ts +0 -24
- package/separate-configs/jest/jest-setup.ts +0 -12
- package/separate-configs/npmignore.txt +0 -20
- package/separate-configs/package.json +0 -9
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const cliErrorMessages: {
|
|
2
|
+
missingCliCommand: string;
|
|
3
|
+
commandNotFound(commandName: string): string;
|
|
4
|
+
missingConfigFile(commandName: string, configFileNames: string[]): string;
|
|
5
|
+
};
|
|
6
|
+
export declare function getResultMessage(commandName: string, success: boolean): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResultMessage = exports.cliErrorMessages = void 0;
|
|
4
|
+
const cli_color_1 = require("./cli-color");
|
|
5
|
+
exports.cliErrorMessages = {
|
|
6
|
+
missingCliCommand: `Missing a command for virmator. Run "virmator help" for details.`,
|
|
7
|
+
commandNotFound(commandName) {
|
|
8
|
+
return `No command found by the name of "${commandName}"`;
|
|
9
|
+
},
|
|
10
|
+
missingConfigFile(commandName, configFileNames) {
|
|
11
|
+
return `Failed to run "${commandName}". Missing the following config file(s): ${configFileNames.join(', ')}`;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
function getResultMessage(commandName, success) {
|
|
15
|
+
const specificColor = success ? cli_color_1.Color.Success : cli_color_1.Color.Fail;
|
|
16
|
+
const specificPhrase = success ? 'succeeded' : 'failed';
|
|
17
|
+
return `${cli_color_1.Color.Bold}${specificColor}${commandName} ${specificPhrase}.${cli_color_1.Color.Reset}`;
|
|
18
|
+
}
|
|
19
|
+
exports.getResultMessage = getResultMessage;
|
package/dist/cli/cli.js
CHANGED
|
@@ -2,43 +2,50 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.cli = void 0;
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
5
|
+
const augment_vir_1 = require("augment-vir");
|
|
6
|
+
const virmator_invalid_command_error_1 = require("../errors/virmator-invalid-command.error");
|
|
7
|
+
const virmator_invalid_flags_error_1 = require("../errors/virmator-invalid-flags.error");
|
|
8
|
+
const all_cli_command_definitions_1 = require("./all-cli-command-definitions");
|
|
9
|
+
const cli_flag_name_1 = require("./cli-flags/cli-flag-name");
|
|
10
|
+
const cli_messages_1 = require("./cli-messages");
|
|
11
|
+
const parse_arguments_1 = require("./parse-arguments");
|
|
12
|
+
const run_cli_command_1 = require("./run-cli-command");
|
|
11
13
|
async function cli(rawArgs) {
|
|
12
14
|
try {
|
|
13
|
-
const { flags, invalidFlags, args,
|
|
15
|
+
const { flags, invalidFlags, args, commandName } = (0, parse_arguments_1.parseArguments)(rawArgs);
|
|
16
|
+
const cliCommandName = flags[cli_flag_name_1.CliFlagName.Help] ? all_cli_command_definitions_1.builtInCommandNames.help : commandName;
|
|
17
|
+
if (!cliCommandName) {
|
|
18
|
+
throw new virmator_invalid_command_error_1.VirmatorInvalidCommandError(cli_messages_1.cliErrorMessages.missingCliCommand, Object.values(all_cli_command_definitions_1.builtInCommandNames));
|
|
19
|
+
}
|
|
14
20
|
if (invalidFlags.length) {
|
|
15
|
-
throw new
|
|
21
|
+
throw new virmator_invalid_flags_error_1.VirmatorInvalidFlagsError(invalidFlags);
|
|
16
22
|
}
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
23
|
+
const shouldLogStatus = cliCommandName !== all_cli_command_definitions_1.builtInCommandNames.help && !flags[cli_flag_name_1.CliFlagName.Silent];
|
|
24
|
+
if (shouldLogStatus) {
|
|
25
|
+
console.info(`running ${cliCommandName}...`);
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
const commandDefinition = all_cli_command_definitions_1.allCliCommandDefinitions[cliCommandName];
|
|
28
|
+
if (!commandDefinition) {
|
|
29
|
+
throw new Error(cli_messages_1.cliErrorMessages.commandNotFound(cliCommandName));
|
|
23
30
|
}
|
|
24
|
-
const commandResult = await (0,
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
const commandResult = await (0, run_cli_command_1.runCommand)(commandDefinition, {
|
|
32
|
+
otherArgs: args,
|
|
33
|
+
cliFlags: flags,
|
|
34
|
+
repoDir: process.cwd(),
|
|
27
35
|
});
|
|
28
|
-
if (
|
|
29
|
-
console.info((0, cli_messages_1.getResultMessage)(
|
|
36
|
+
if (shouldLogStatus) {
|
|
37
|
+
console.info((0, cli_messages_1.getResultMessage)(cliCommandName, commandResult.success));
|
|
30
38
|
}
|
|
31
39
|
process.exit(commandResult.success ? 0 : 1);
|
|
32
40
|
}
|
|
33
41
|
catch (error) {
|
|
34
|
-
console.error(
|
|
42
|
+
console.error((0, augment_vir_1.extractErrorMessage)(error));
|
|
35
43
|
process.exit(1);
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
46
|
exports.cli = cli;
|
|
39
47
|
// To run the cli from within this repo itself, use the following bash command:
|
|
40
48
|
// node dist/cli/cli.js
|
|
41
|
-
// if you haven't compiled you'll also need to run npm run compile beforehand (and after all changes)
|
|
42
49
|
if (require.main === module) {
|
|
43
50
|
cli(process.argv.slice(2));
|
|
44
51
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.combineTextConfig = void 0;
|
|
4
|
+
const augment_vir_1 = require("augment-vir");
|
|
5
|
+
function formatContents(input) {
|
|
6
|
+
return input
|
|
7
|
+
.split('\n')
|
|
8
|
+
.map((line) => line.trim())
|
|
9
|
+
.filter(augment_vir_1.isTruthy)
|
|
10
|
+
.sort();
|
|
11
|
+
}
|
|
12
|
+
const combineTextConfig = (newConfigContents, existingConfigContents) => {
|
|
13
|
+
const sortedNew = formatContents(newConfigContents);
|
|
14
|
+
const sortedExisting = formatContents(existingConfigContents);
|
|
15
|
+
let existingLinesAppended = false;
|
|
16
|
+
sortedExisting.forEach((existingLine) => {
|
|
17
|
+
if (!sortedNew.includes(existingLine) && !sortedNew.includes(`${existingLine}/`)) {
|
|
18
|
+
if (!existingLinesAppended) {
|
|
19
|
+
sortedNew.push('');
|
|
20
|
+
existingLinesAppended = true;
|
|
21
|
+
}
|
|
22
|
+
sortedNew.push(existingLine);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return sortedNew.join('\n');
|
|
26
|
+
};
|
|
27
|
+
exports.combineTextConfig = combineTextConfig;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { createDefaultPackageJson } from './create-default-package-json';
|
|
2
|
+
export declare type ConfigFileCopyCallback = (copyFromContents: string, existingConfigContents: string, repoDir: string) => string | Promise<string>;
|
|
3
|
+
export declare type ConfigFileDefinition = {
|
|
4
|
+
path: string;
|
|
5
|
+
copyToPath?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Name to rename the config file to when copying it to a repo.
|
|
8
|
+
*
|
|
9
|
+
* Example: this is needed for the .npmignore config file because npm won't publish .npmignore,
|
|
10
|
+
* so it's saved in virmator configs as npmignore.txt. Upon copying, we must then rename it.
|
|
11
|
+
*/
|
|
12
|
+
copyName?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Used to modify the file contents before copying it over to a repo. The returned string should
|
|
15
|
+
* be the new file contents.
|
|
16
|
+
*/
|
|
17
|
+
updateCallback?: ConfigFileCopyCallback;
|
|
18
|
+
canBeUpdated?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function doesCopyToConfigPathExist(configFileDefinition: ConfigFileDefinition, repoDir: string): boolean;
|
|
21
|
+
export declare function getCopyToPath(configFileDefinition: ConfigFileDefinition, repoDir: string): string;
|
|
22
|
+
export declare const configFiles: {
|
|
23
|
+
/** Base config for spellchecking, contains a huge list of preset words defined within virmator. */
|
|
24
|
+
cSpellBase: {
|
|
25
|
+
path: string;
|
|
26
|
+
canBeUpdated: true;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Config for spellchecking. Extends the base config. Allows individual repos to add custom
|
|
30
|
+
* words while still using the virmator defined list of words.
|
|
31
|
+
*/
|
|
32
|
+
cSpell: {
|
|
33
|
+
path: string;
|
|
34
|
+
};
|
|
35
|
+
/** Primarily fixes line ending issues on Windows machines. */
|
|
36
|
+
gitAttributes: {
|
|
37
|
+
path: string;
|
|
38
|
+
updateCallback: ConfigFileCopyCallback;
|
|
39
|
+
};
|
|
40
|
+
gitIgnore: {
|
|
41
|
+
path: string;
|
|
42
|
+
copyName: string;
|
|
43
|
+
updateCallback: ConfigFileCopyCallback;
|
|
44
|
+
};
|
|
45
|
+
/** Provides a GitHub Actions workflow for building deploying to GitHub Pages */
|
|
46
|
+
gitHubActionsGhPagesBuild: {
|
|
47
|
+
path: string;
|
|
48
|
+
copyToPath: string;
|
|
49
|
+
canBeUpdated: true;
|
|
50
|
+
};
|
|
51
|
+
/** Provides a GitHub Actions workflow for bundling releases for each version tag. */
|
|
52
|
+
gitHubActionsTaggedRelease: {
|
|
53
|
+
path: string;
|
|
54
|
+
copyToPath: string;
|
|
55
|
+
canBeUpdated: true;
|
|
56
|
+
};
|
|
57
|
+
/** Provides a GitHub Actions workflow to run all tests. */
|
|
58
|
+
gitHubActionsTest: {
|
|
59
|
+
path: string;
|
|
60
|
+
copyToPath: string;
|
|
61
|
+
canBeUpdated: true;
|
|
62
|
+
};
|
|
63
|
+
/** Ignores files for npm publish. */
|
|
64
|
+
npmIgnore: {
|
|
65
|
+
path: string;
|
|
66
|
+
copyName: string;
|
|
67
|
+
updateCallback: ConfigFileCopyCallback;
|
|
68
|
+
};
|
|
69
|
+
/** Provides some defaults for package.json properties. */
|
|
70
|
+
packageJson: {
|
|
71
|
+
path: string;
|
|
72
|
+
updateCallback: typeof createDefaultPackageJson;
|
|
73
|
+
};
|
|
74
|
+
/** All the base configs for prettier. */
|
|
75
|
+
prettierBase: {
|
|
76
|
+
path: string;
|
|
77
|
+
canBeUpdated: true;
|
|
78
|
+
};
|
|
79
|
+
/** Prettier config that inherits the base config and can be changed on a per-repo basis. */
|
|
80
|
+
prettier: {
|
|
81
|
+
path: string;
|
|
82
|
+
};
|
|
83
|
+
/** Ignore certain files in the formatting process. */
|
|
84
|
+
prettierIgnore: {
|
|
85
|
+
path: string;
|
|
86
|
+
updateCallback: ConfigFileCopyCallback;
|
|
87
|
+
};
|
|
88
|
+
/** Provides base configuration for ts config. */
|
|
89
|
+
tsConfigBase: {
|
|
90
|
+
path: string;
|
|
91
|
+
canBeUpdated: true;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Configuration for the TypeScript compiler. Based on the base configuration above and can be
|
|
95
|
+
* configured on a per-repo basis without interfering with the virmator config.
|
|
96
|
+
*/
|
|
97
|
+
tsConfig: {
|
|
98
|
+
path: string;
|
|
99
|
+
};
|
|
100
|
+
/** VS Code settings. */
|
|
101
|
+
vsCodeSettings: {
|
|
102
|
+
path: string;
|
|
103
|
+
};
|
|
104
|
+
/** Global types. Specifically used at the moment to block un-imported test functions. */
|
|
105
|
+
globalTypes: {
|
|
106
|
+
path: string;
|
|
107
|
+
};
|
|
108
|
+
mochaBase: {
|
|
109
|
+
path: string;
|
|
110
|
+
canBeUpdated: true;
|
|
111
|
+
};
|
|
112
|
+
mocha: {
|
|
113
|
+
path: string;
|
|
114
|
+
};
|
|
115
|
+
viteBase: {
|
|
116
|
+
path: string;
|
|
117
|
+
canBeUpdated: true;
|
|
118
|
+
};
|
|
119
|
+
viteReloadPlugin: {
|
|
120
|
+
path: string;
|
|
121
|
+
canBeUpdated: true;
|
|
122
|
+
};
|
|
123
|
+
vite: {
|
|
124
|
+
path: string;
|
|
125
|
+
};
|
|
126
|
+
webTestRunnerBase: {
|
|
127
|
+
path: string;
|
|
128
|
+
canBeUpdated: true;
|
|
129
|
+
};
|
|
130
|
+
webTestRunner: {
|
|
131
|
+
path: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configFiles = exports.getCopyToPath = exports.doesCopyToConfigPathExist = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const regexp_1 = require("../../augments/regexp");
|
|
7
|
+
const virmator_package_paths_1 = require("../../file-paths/virmator-package-paths");
|
|
8
|
+
const combine_text_config_1 = require("./combine-text-config");
|
|
9
|
+
const create_default_package_json_1 = require("./create-default-package-json");
|
|
10
|
+
function doesCopyToConfigPathExist(configFileDefinition, repoDir) {
|
|
11
|
+
return (0, fs_1.existsSync)(getCopyToPath(configFileDefinition, repoDir));
|
|
12
|
+
}
|
|
13
|
+
exports.doesCopyToConfigPathExist = doesCopyToConfigPathExist;
|
|
14
|
+
function getCopyToPath(configFileDefinition, repoDir) {
|
|
15
|
+
const replacedDir = configFileDefinition.copyToPath
|
|
16
|
+
? (0, path_1.join)(repoDir, configFileDefinition.copyToPath, (0, path_1.basename)(configFileDefinition.path))
|
|
17
|
+
: configFileDefinition.path.replace(virmator_package_paths_1.virmatorConfigsDir, repoDir);
|
|
18
|
+
if (configFileDefinition.copyName) {
|
|
19
|
+
const replacedFileName = replacedDir.replace(new RegExp(`${(0, regexp_1.sanitizeStringForRegExpCreation)((0, path_1.basename)(replacedDir))}$`), configFileDefinition.copyName);
|
|
20
|
+
return replacedFileName;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return replacedDir;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.getCopyToPath = getCopyToPath;
|
|
27
|
+
exports.configFiles = ((input) => input)({
|
|
28
|
+
/** Base config for spellchecking, contains a huge list of preset words defined within virmator. */
|
|
29
|
+
cSpellBase: {
|
|
30
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, '.cspell-base.json'),
|
|
31
|
+
canBeUpdated: true,
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Config for spellchecking. Extends the base config. Allows individual repos to add custom
|
|
35
|
+
* words while still using the virmator defined list of words.
|
|
36
|
+
*/
|
|
37
|
+
cSpell: {
|
|
38
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, '.cspell.json'),
|
|
39
|
+
},
|
|
40
|
+
/** Primarily fixes line ending issues on Windows machines. */
|
|
41
|
+
gitAttributes: {
|
|
42
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, '.gitattributes'),
|
|
43
|
+
updateCallback: combine_text_config_1.combineTextConfig,
|
|
44
|
+
},
|
|
45
|
+
gitIgnore: {
|
|
46
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, 'gitignore.txt'),
|
|
47
|
+
copyName: '.gitignore',
|
|
48
|
+
updateCallback: combine_text_config_1.combineTextConfig,
|
|
49
|
+
},
|
|
50
|
+
/** Provides a GitHub Actions workflow for building deploying to GitHub Pages */
|
|
51
|
+
gitHubActionsGhPagesBuild: {
|
|
52
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.gitHubWorkflows, 'virmator-build-for-gh-pages.yml'),
|
|
53
|
+
copyToPath: (0, path_1.join)('.github', 'workflows'),
|
|
54
|
+
canBeUpdated: true,
|
|
55
|
+
},
|
|
56
|
+
/** Provides a GitHub Actions workflow for bundling releases for each version tag. */
|
|
57
|
+
gitHubActionsTaggedRelease: {
|
|
58
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.gitHubWorkflows, 'virmator-tagged-release.yml'),
|
|
59
|
+
copyToPath: (0, path_1.join)('.github', 'workflows'),
|
|
60
|
+
canBeUpdated: true,
|
|
61
|
+
},
|
|
62
|
+
/** Provides a GitHub Actions workflow to run all tests. */
|
|
63
|
+
gitHubActionsTest: {
|
|
64
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.gitHubWorkflows, 'virmator-tests.yml'),
|
|
65
|
+
copyToPath: (0, path_1.join)('.github', 'workflows'),
|
|
66
|
+
canBeUpdated: true,
|
|
67
|
+
},
|
|
68
|
+
/** Ignores files for npm publish. */
|
|
69
|
+
npmIgnore: {
|
|
70
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, 'npmignore.txt'),
|
|
71
|
+
copyName: '.npmignore',
|
|
72
|
+
updateCallback: combine_text_config_1.combineTextConfig,
|
|
73
|
+
},
|
|
74
|
+
/** Provides some defaults for package.json properties. */
|
|
75
|
+
packageJson: {
|
|
76
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, 'package.json'),
|
|
77
|
+
updateCallback: create_default_package_json_1.createDefaultPackageJson,
|
|
78
|
+
},
|
|
79
|
+
/** All the base configs for prettier. */
|
|
80
|
+
prettierBase: {
|
|
81
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'prettierrc-base.js'),
|
|
82
|
+
canBeUpdated: true,
|
|
83
|
+
},
|
|
84
|
+
/** Prettier config that inherits the base config and can be changed on a per-repo basis. */
|
|
85
|
+
prettier: {
|
|
86
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, '.prettierrc.js'),
|
|
87
|
+
},
|
|
88
|
+
/** Ignore certain files in the formatting process. */
|
|
89
|
+
prettierIgnore: {
|
|
90
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, '.prettierignore'),
|
|
91
|
+
updateCallback: combine_text_config_1.combineTextConfig,
|
|
92
|
+
},
|
|
93
|
+
/** Provides base configuration for ts config. */
|
|
94
|
+
tsConfigBase: {
|
|
95
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'tsconfig-base.json'),
|
|
96
|
+
canBeUpdated: true,
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Configuration for the TypeScript compiler. Based on the base configuration above and can be
|
|
100
|
+
* configured on a per-repo basis without interfering with the virmator config.
|
|
101
|
+
*/
|
|
102
|
+
tsConfig: {
|
|
103
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, 'tsconfig.json'),
|
|
104
|
+
},
|
|
105
|
+
/** VS Code settings. */
|
|
106
|
+
vsCodeSettings: {
|
|
107
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.vsCode, 'settings.json'),
|
|
108
|
+
},
|
|
109
|
+
/** Global types. Specifically used at the moment to block un-imported test functions. */
|
|
110
|
+
globalTypes: {
|
|
111
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.src, 'global.d.ts'),
|
|
112
|
+
},
|
|
113
|
+
mochaBase: {
|
|
114
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'mocharc-base.js'),
|
|
115
|
+
canBeUpdated: true,
|
|
116
|
+
},
|
|
117
|
+
mocha: {
|
|
118
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigsDir, '.mocharc.js'),
|
|
119
|
+
},
|
|
120
|
+
viteBase: {
|
|
121
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'vite-base.ts'),
|
|
122
|
+
canBeUpdated: true,
|
|
123
|
+
},
|
|
124
|
+
viteReloadPlugin: {
|
|
125
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'vite-always-reload-plugin.ts'),
|
|
126
|
+
canBeUpdated: true,
|
|
127
|
+
},
|
|
128
|
+
vite: {
|
|
129
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'vite.config.ts'),
|
|
130
|
+
},
|
|
131
|
+
webTestRunnerBase: {
|
|
132
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'web-test-runner-base.mjs'),
|
|
133
|
+
canBeUpdated: true,
|
|
134
|
+
},
|
|
135
|
+
webTestRunner: {
|
|
136
|
+
path: (0, path_1.join)(virmator_package_paths_1.virmatorConfigs.dotVirmator, 'web-test-runner.config.mjs'),
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { CliLogging } from '../../logging';
|
|
2
|
+
import { ConfigFileDefinition } from './config-files';
|
|
3
|
+
export declare enum CopyConfigOperation {
|
|
4
|
+
/** Only update the config file if it exists and is marked as being able to be updated. */
|
|
5
|
+
Update = "update",
|
|
6
|
+
/** Overwrite config file, even if it already exists in the repo. */
|
|
7
|
+
Overwrite = "overwrite",
|
|
8
|
+
/** Only write the config file if it doesn't exist already or if it can be updated. */
|
|
9
|
+
Init = "init"
|
|
10
|
+
}
|
|
11
|
+
export declare type CopyConfigInputs = {
|
|
12
|
+
configFileDefinition: ConfigFileDefinition;
|
|
9
13
|
repoDir: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
operation: CopyConfigOperation;
|
|
15
|
+
};
|
|
16
|
+
export declare type CopyConfigOutputs = {
|
|
17
|
+
copiedToPath: string;
|
|
18
|
+
shouldWrite: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function copyConfig(inputs: CopyConfigInputs): Promise<CopyConfigOutputs>;
|
|
21
|
+
export declare type CopyAllConfigFilesInputs = Omit<CopyConfigInputs, 'configFileDefinition'> & {
|
|
22
|
+
logging: CliLogging;
|
|
23
|
+
configFiles: Record<string, ConfigFileDefinition>;
|
|
24
|
+
};
|
|
25
|
+
/** Returns success state. True if success, false is errors were encountered. */
|
|
26
|
+
export declare function copyAllConfigFiles(inputs: CopyAllConfigFilesInputs): Promise<boolean>;
|
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.copyConfig = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
3
|
+
exports.copyAllConfigFiles = exports.copyConfig = exports.CopyConfigOperation = void 0;
|
|
4
|
+
const augment_vir_1 = require("augment-vir");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
6
7
|
const path_1 = require("path");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const shouldExtend = (repoConfigExists && (await isConfigFileExtending(configKey, repoDir))) ||
|
|
28
|
-
forceExtendableConfig;
|
|
29
|
-
if (!repoConfigExists) {
|
|
30
|
-
logs.push({
|
|
31
|
-
stderr: true,
|
|
32
|
-
log: `Config file not found, creating new file: ${repoConfigPath}\n${ifUndesiredMessage}`,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (shouldExtend && (0, extendable_config_1.isExtendableConfig)(configKey)) {
|
|
36
|
-
if (!(0, extendable_config_1.isExtendableConfig)(configKey)) {
|
|
37
|
-
throw new config_file_error_1.ConfigFileError(`Extendable config files are not supported for ${configKey}`);
|
|
38
|
-
}
|
|
39
|
-
if (!repoConfigExists) {
|
|
40
|
-
// if extender config file does not exist, create it
|
|
41
|
-
const extenderContents = await (0, config_read_1.readUpdatedVirmatorConfigFile)(configKey, repoDir, true);
|
|
42
|
-
await (0, node_only_1.writeFileAndDir)(repoConfigPath, extenderContents);
|
|
43
|
-
}
|
|
44
|
-
const repoExtendableConfigPath = (0, path_1.join)(repoDir, (0, extendable_config_1.getExtendableBaseConfigName)(configKey));
|
|
45
|
-
const repoExtendableConfigExists = (0, fs_extra_1.existsSync)(repoExtendableConfigPath);
|
|
46
|
-
if (repoExtendableConfigExists) {
|
|
47
|
-
// if the extendable config already exists, check if we need to update it
|
|
48
|
-
const repoExtendableConfigContents = await (0, config_read_1.readRepoConfigFile)(configKey, repoDir, true);
|
|
49
|
-
if (repoExtendableConfigContents !== virmatorConfigContents) {
|
|
50
|
-
// only write when we need to update the file
|
|
51
|
-
logs.push({
|
|
52
|
-
stderr: false,
|
|
53
|
-
log: `Updating ${repoExtendableConfigPath}\n${ifUndesiredMessage}`,
|
|
54
|
-
});
|
|
55
|
-
shouldWriteConfig = true;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
shouldWriteConfig = false;
|
|
8
|
+
const cli_color_1 = require("../cli-color");
|
|
9
|
+
const config_files_1 = require("./config-files");
|
|
10
|
+
var CopyConfigOperation;
|
|
11
|
+
(function (CopyConfigOperation) {
|
|
12
|
+
/** Only update the config file if it exists and is marked as being able to be updated. */
|
|
13
|
+
CopyConfigOperation["Update"] = "update";
|
|
14
|
+
/** Overwrite config file, even if it already exists in the repo. */
|
|
15
|
+
CopyConfigOperation["Overwrite"] = "overwrite";
|
|
16
|
+
/** Only write the config file if it doesn't exist already or if it can be updated. */
|
|
17
|
+
CopyConfigOperation["Init"] = "init";
|
|
18
|
+
})(CopyConfigOperation = exports.CopyConfigOperation || (exports.CopyConfigOperation = {}));
|
|
19
|
+
async function copyConfig(inputs) {
|
|
20
|
+
const copyFromPath = inputs.configFileDefinition.path;
|
|
21
|
+
const copyToPath = (0, config_files_1.getCopyToPath)(inputs.configFileDefinition, inputs.repoDir);
|
|
22
|
+
const copyToFileExists = (0, config_files_1.doesCopyToConfigPathExist)(inputs.configFileDefinition, inputs.repoDir);
|
|
23
|
+
let shouldWrite = false;
|
|
24
|
+
switch (inputs.operation) {
|
|
25
|
+
case CopyConfigOperation.Init: {
|
|
26
|
+
if (!copyToFileExists) {
|
|
27
|
+
shouldWrite = true;
|
|
59
28
|
}
|
|
29
|
+
break;
|
|
60
30
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
stderr: true,
|
|
65
|
-
log: `Extendable config file not found, creating new file: ${repoExtendableConfigPath}\n`,
|
|
66
|
-
});
|
|
67
|
-
shouldWriteConfig = true;
|
|
31
|
+
case CopyConfigOperation.Overwrite: {
|
|
32
|
+
shouldWrite = true;
|
|
33
|
+
break;
|
|
68
34
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (currentConfigPathContents !== virmatorConfigContents) {
|
|
76
|
-
logs.push({
|
|
77
|
-
stderr: false,
|
|
78
|
-
log: `Updating ${repoConfigPath}`,
|
|
79
|
-
});
|
|
80
|
-
shouldWriteConfig = true;
|
|
35
|
+
case CopyConfigOperation.Update: {
|
|
36
|
+
if (copyToFileExists &&
|
|
37
|
+
typeof inputs.configFileDefinition !== 'string' &&
|
|
38
|
+
(inputs.configFileDefinition.canBeUpdated ||
|
|
39
|
+
inputs.configFileDefinition.updateCallback)) {
|
|
40
|
+
shouldWrite = true;
|
|
81
41
|
}
|
|
82
|
-
|
|
83
|
-
shouldWriteConfig = false;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
shouldWriteConfig = true;
|
|
42
|
+
break;
|
|
88
43
|
}
|
|
89
|
-
outputFilePath = repoConfigPath;
|
|
90
44
|
}
|
|
91
|
-
|
|
92
|
-
await (0,
|
|
45
|
+
const currentRepoFileContents = (0, fs_1.existsSync)(copyToPath)
|
|
46
|
+
? (await (0, promises_1.readFile)(copyToPath)).toString()
|
|
47
|
+
: '';
|
|
48
|
+
const virmatorFileContents = (await (0, promises_1.readFile)(copyFromPath)).toString();
|
|
49
|
+
const writeContents = inputs.configFileDefinition.updateCallback
|
|
50
|
+
? await inputs.configFileDefinition.updateCallback(virmatorFileContents, currentRepoFileContents, inputs.repoDir)
|
|
51
|
+
: virmatorFileContents;
|
|
52
|
+
if (currentRepoFileContents === writeContents) {
|
|
53
|
+
shouldWrite = false;
|
|
54
|
+
}
|
|
55
|
+
if (shouldWrite) {
|
|
56
|
+
await (0, promises_1.mkdir)((0, path_1.dirname)(copyToPath), { recursive: true });
|
|
57
|
+
await (0, promises_1.writeFile)(copyToPath, writeContents);
|
|
93
58
|
}
|
|
94
59
|
return {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
didWrite: shouldWriteConfig,
|
|
60
|
+
copiedToPath: copyToPath,
|
|
61
|
+
shouldWrite,
|
|
98
62
|
};
|
|
99
63
|
}
|
|
100
64
|
exports.copyConfig = copyConfig;
|
|
65
|
+
const successfulOperation = {
|
|
66
|
+
[CopyConfigOperation.Init]: 'copied',
|
|
67
|
+
[CopyConfigOperation.Overwrite]: 'overwrote',
|
|
68
|
+
[CopyConfigOperation.Update]: 'updated',
|
|
69
|
+
};
|
|
70
|
+
const failedOperation = {
|
|
71
|
+
[CopyConfigOperation.Init]: 'copy',
|
|
72
|
+
[CopyConfigOperation.Overwrite]: 'overwrite',
|
|
73
|
+
[CopyConfigOperation.Update]: 'update',
|
|
74
|
+
};
|
|
75
|
+
/** Returns success state. True if success, false is errors were encountered. */
|
|
76
|
+
async function copyAllConfigFiles(inputs) {
|
|
77
|
+
const errors = [];
|
|
78
|
+
await (0, augment_vir_1.awaitedForEach)(Object.keys(inputs.configFiles).sort(), async (configKey) => {
|
|
79
|
+
const configFile = inputs.configFiles[configKey];
|
|
80
|
+
try {
|
|
81
|
+
const result = await copyConfig({
|
|
82
|
+
configFileDefinition: configFile,
|
|
83
|
+
operation: inputs.operation,
|
|
84
|
+
repoDir: inputs.repoDir,
|
|
85
|
+
});
|
|
86
|
+
if (result.shouldWrite) {
|
|
87
|
+
inputs.logging.stdout(`${cli_color_1.Color.Info}Successfully ${successfulOperation[inputs.operation]}${cli_color_1.Color.Reset} ${(0, path_1.basename)(result.copiedToPath)}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const copyError = new Error(`${cli_color_1.Color.Fail}Failed to ${failedOperation[inputs.operation]}${cli_color_1.Color.Reset} ${(0, path_1.basename)(configFile.path)}: ${(0, augment_vir_1.extractErrorMessage)(error)}`);
|
|
92
|
+
errors.push(copyError);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
errors.forEach((error) => {
|
|
96
|
+
inputs.logging.stderr(error.message);
|
|
97
|
+
});
|
|
98
|
+
return !errors.length;
|
|
99
|
+
}
|
|
100
|
+
exports.copyAllConfigFiles = copyAllConfigFiles;
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
export declare function createDefaultPackageJson(repoDir: string): Promise<
|
|
2
|
-
name: string;
|
|
3
|
-
homepage?: string;
|
|
4
|
-
bugs?: {
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
7
|
-
repository?: {
|
|
8
|
-
type: string;
|
|
9
|
-
url: string;
|
|
10
|
-
};
|
|
11
|
-
author?: {
|
|
12
|
-
name: string;
|
|
13
|
-
url: string;
|
|
14
|
-
};
|
|
15
|
-
scripts: object;
|
|
16
|
-
}>;
|
|
1
|
+
export declare function createDefaultPackageJson(copyFromContents: string, existingConfigContents: string, repoDir: string): Promise<string>;
|