virmator 4.3.4 → 5.0.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/README.md +4 -3
- package/base-configs/base-mocharc.js +5 -3
- package/base-configs/base-nyc.js +8 -4
- package/base-configs/base-tsconfig.json +3 -6
- package/base-configs/web-test-runner-base.mjs +4 -3
- package/configs/.github/workflows/build-for-gh-pages.yml +1 -1
- package/configs/.github/workflows/tagged-release.yml +1 -1
- package/configs/.nvmrc +1 -1
- package/configs/gitignore.txt +1 -0
- package/dist/api/command/command-configs.d.ts +1 -0
- package/dist/api/command/command-configs.d.ts.map +1 -0
- package/dist/api/command/command-configs.js +3 -3
- package/dist/api/command/command-description.d.ts +1 -0
- package/dist/api/command/command-description.d.ts.map +1 -0
- package/dist/api/command/command-executor.d.ts +1 -0
- package/dist/api/command/command-executor.d.ts.map +1 -0
- package/dist/api/command/command-help.d.ts +1 -0
- package/dist/api/command/command-help.d.ts.map +1 -0
- package/dist/api/command/command-logging.d.ts +1 -0
- package/dist/api/command/command-logging.d.ts.map +1 -0
- package/dist/api/command/command-mapping.d.ts +2 -1
- package/dist/api/command/command-mapping.d.ts.map +1 -0
- package/dist/api/command/command-messages.d.ts +1 -0
- package/dist/api/command/command-messages.d.ts.map +1 -0
- package/dist/api/command/command-messages.js +3 -3
- package/dist/api/command/command-to-help-message.d.ts +1 -0
- package/dist/api/command/command-to-help-message.d.ts.map +1 -0
- package/dist/api/command/command-to-help-message.js +11 -10
- package/dist/api/command/define-command-inputs.d.ts +1 -0
- package/dist/api/command/define-command-inputs.d.ts.map +1 -0
- package/dist/api/command/define-command.d.ts +1 -0
- package/dist/api/command/define-command.d.ts.map +1 -0
- package/dist/api/command/define-command.js +3 -3
- package/dist/api/config/config-file-definition.d.ts +1 -0
- package/dist/api/config/config-file-definition.d.ts.map +1 -0
- package/dist/api/config/config-paths.d.ts +1 -0
- package/dist/api/config/config-paths.d.ts.map +1 -0
- package/dist/api/config/copy-config.d.ts +1 -0
- package/dist/api/config/copy-config.d.ts.map +1 -0
- package/dist/api/config/copy-config.js +5 -5
- package/dist/api/create-virmator.d.ts +1 -0
- package/dist/api/create-virmator.d.ts.map +1 -0
- package/dist/api/create-virmator.js +2 -2
- package/dist/api/run-command/check-npm-deps.d.ts +1 -0
- package/dist/api/run-command/check-npm-deps.d.ts.map +1 -0
- package/dist/api/run-command/check-npm-deps.js +9 -10
- package/dist/api/run-command/extract-arguments.d.ts +1 -0
- package/dist/api/run-command/extract-arguments.d.ts.map +1 -0
- package/dist/api/run-command/run-command-executor.d.ts +1 -0
- package/dist/api/run-command/run-command-executor.d.ts.map +1 -0
- package/dist/api/run-command/run-command-executor.js +6 -7
- package/dist/api/run-command/run-extended-virmator.d.ts +1 -0
- package/dist/api/run-command/run-extended-virmator.d.ts.map +1 -0
- package/dist/api/run-command/run-extended-virmator.js +3 -3
- package/dist/api/run-command/run-shell-command.d.ts +2 -1
- package/dist/api/run-command/run-shell-command.d.ts.map +1 -0
- package/dist/api/run-command/run-shell-command.js +2 -2
- package/dist/api/virmator-types.d.ts +1 -0
- package/dist/api/virmator-types.d.ts.map +1 -0
- package/dist/augments/array.d.ts +1 -0
- package/dist/augments/array.d.ts.map +1 -0
- package/dist/augments/console.d.ts +1 -0
- package/dist/augments/console.d.ts.map +1 -0
- package/dist/augments/fs.d.ts +1 -0
- package/dist/augments/fs.d.ts.map +1 -0
- package/dist/augments/fs.js +2 -2
- package/dist/augments/git.d.ts +1 -0
- package/dist/augments/git.d.ts.map +1 -0
- package/dist/augments/git.js +2 -2
- package/dist/augments/json.d.ts +1 -0
- package/dist/augments/json.d.ts.map +1 -0
- package/dist/augments/npm.d.ts +3 -2
- package/dist/augments/npm.d.ts.map +1 -0
- package/dist/augments/npm.js +2 -2
- package/dist/augments/object.d.ts +2 -1
- package/dist/augments/object.d.ts.map +1 -0
- package/dist/augments/object.js +7 -7
- package/dist/augments/path.d.ts +1 -0
- package/dist/augments/path.d.ts.map +1 -0
- package/dist/augments/prettier.d.ts +1 -0
- package/dist/augments/prettier.d.ts.map +1 -0
- package/dist/augments/prettier.js +1 -1
- package/dist/augments/regexp.d.ts +1 -0
- package/dist/augments/regexp.d.ts.map +1 -0
- package/dist/augments/string.d.ts +1 -0
- package/dist/augments/string.d.ts.map +1 -0
- package/dist/augments/test.d.ts.map +1 -0
- package/dist/augments/type.d.ts +1 -0
- package/dist/augments/type.d.ts.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/commands/code-in-markdown.command.d.ts +1 -0
- package/dist/commands/code-in-markdown.command.d.ts.map +1 -0
- package/dist/commands/code-in-markdown.command.test.d.ts.map +1 -0
- package/dist/commands/compile.command.d.ts +1 -0
- package/dist/commands/compile.command.d.ts.map +1 -0
- package/dist/commands/compile.command.js +1 -1
- package/dist/commands/compile.command.test.d.ts.map +1 -0
- package/dist/commands/extra-configs/all-extra-configs.d.ts +1 -0
- package/dist/commands/extra-configs/all-extra-configs.d.ts.map +1 -0
- package/dist/commands/extra-configs/combine-json-config.d.ts +1 -0
- package/dist/commands/extra-configs/combine-json-config.d.ts.map +1 -0
- package/dist/commands/extra-configs/combine-json-config.js +2 -2
- package/dist/commands/extra-configs/combine-text-config.d.ts +1 -0
- package/dist/commands/extra-configs/combine-text-config.d.ts.map +1 -0
- package/dist/commands/extra-configs/combine-text-config.js +2 -2
- package/dist/commands/extra-configs/create-default-package-json.d.ts +1 -0
- package/dist/commands/extra-configs/create-default-package-json.d.ts.map +1 -0
- package/dist/commands/extra-configs/create-default-package-json.js +4 -4
- package/dist/commands/format.command.d.ts +1 -0
- package/dist/commands/format.command.d.ts.map +1 -0
- package/dist/commands/format.command.js +3 -3
- package/dist/commands/format.command.test.d.ts.map +1 -0
- package/dist/commands/frontend.command.d.ts +2 -1
- package/dist/commands/frontend.command.d.ts.map +1 -0
- package/dist/commands/frontend.command.js +1 -1
- package/dist/commands/init.command.d.ts +1 -0
- package/dist/commands/init.command.d.ts.map +1 -0
- package/dist/commands/init.command.test.d.ts.map +1 -0
- package/dist/commands/publish.command.d.ts +1 -0
- package/dist/commands/publish.command.d.ts.map +1 -0
- package/dist/commands/publish.command.js +13 -13
- package/dist/commands/spellcheck.command.d.ts +1 -0
- package/dist/commands/spellcheck.command.d.ts.map +1 -0
- package/dist/commands/spellcheck.command.test.d.ts.map +1 -0
- package/dist/commands/test-web.command.d.ts +1 -0
- package/dist/commands/test-web.command.d.ts.map +1 -0
- package/dist/commands/test-web.command.test.d.ts.map +1 -0
- package/dist/commands/test.command.d.ts +2 -1
- package/dist/commands/test.command.d.ts.map +1 -0
- package/dist/commands/test.command.js +2 -2
- package/dist/commands/test.command.test.d.ts.map +1 -0
- package/dist/commands/update-configs.command.d.ts +1 -0
- package/dist/commands/update-configs.command.d.ts.map +1 -0
- package/dist/commands/update-configs.command.test.d.ts.map +1 -0
- package/dist/compiled-base-configs/base-vite.d.ts +1 -0
- package/dist/compiled-base-configs/base-vite.d.ts.map +1 -0
- package/dist/compiled-base-configs/vite-always-reload-plugin.d.ts +1 -0
- package/dist/compiled-base-configs/vite-always-reload-plugin.d.ts.map +1 -0
- package/dist/compiled-base-configs/vite-always-reload-plugin.js +2 -2
- package/dist/file-paths/package-paths.d.ts +1 -0
- package/dist/file-paths/package-paths.d.ts.map +1 -0
- package/dist/file-paths/package-paths.js +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +0 -1
- package/dist/scripts/save-help-message.d.ts +1 -0
- package/dist/scripts/save-help-message.d.ts.map +1 -0
- package/dist/scripts/save-help-message.js +2 -2
- package/mocha.config.js +1 -1
- package/package.json +24 -23
- package/tsconfig.tsbuildinfo +1 -0
- package/dist/api/cli-color.d.ts +0 -9
- package/dist/api/cli-color.js +0 -13
package/README.md
CHANGED
|
@@ -82,14 +82,15 @@ Any other arguments encountered between the operation command (if provided) and
|
|
|
82
82
|
|
|
83
83
|
```
|
|
84
84
|
virmator format
|
|
85
|
-
|
|
85
|
+
virmator format
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
- examples with extra Prettier flags:
|
|
89
|
+
|
|
89
90
|
```
|
|
90
91
|
virmator format --ignore-path .prettierignore
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
virmator format --ignore-path .prettierignore
|
|
93
|
+
virmator format --ignore-path .prettierignore --file-types md json
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
### check
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
const testFiles = require('./test-files-glob.js');
|
|
2
2
|
const SpecReporterWithFileNames = require('mocha-spec-reporter-with-file-names');
|
|
3
3
|
|
|
4
|
+
const oneMinuteMs = 60_000;
|
|
5
|
+
|
|
4
6
|
/** @type {import('mocha').MochaOptions} */
|
|
5
7
|
const mochaConfig = {
|
|
6
8
|
checkLeaks: true,
|
|
7
9
|
color: true,
|
|
8
10
|
parallel: true,
|
|
9
|
-
require: ['
|
|
10
|
-
slow:
|
|
11
|
+
require: ['tsx'],
|
|
12
|
+
slow: oneMinuteMs,
|
|
11
13
|
fullTrace: true,
|
|
12
|
-
timeout:
|
|
14
|
+
timeout: 20 * oneMinuteMs,
|
|
13
15
|
reporter: SpecReporterWithFileNames.pathToThisReporter,
|
|
14
16
|
...testFiles,
|
|
15
17
|
};
|
package/base-configs/base-nyc.js
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
function getBaseConfigWithCoveragePercent(percent) {
|
|
4
4
|
return {
|
|
5
|
+
// only works with @electrovir/nyc
|
|
6
|
+
failBelow: percent,
|
|
7
|
+
|
|
8
|
+
branches: percent,
|
|
9
|
+
functions: percent,
|
|
10
|
+
lines: percent,
|
|
11
|
+
statements: percent,
|
|
12
|
+
|
|
5
13
|
extends: '@istanbuljs/nyc-config-typescript',
|
|
6
14
|
all: true,
|
|
7
|
-
branches: percent,
|
|
8
15
|
clean: true,
|
|
9
16
|
cache: false,
|
|
10
17
|
instrument: true,
|
|
@@ -17,9 +24,7 @@ function getBaseConfigWithCoveragePercent(percent) {
|
|
|
17
24
|
'**/*.type.test.ts',
|
|
18
25
|
'**/*.test-helper.ts',
|
|
19
26
|
],
|
|
20
|
-
functions: percent,
|
|
21
27
|
include: ['src/**/*.ts'],
|
|
22
|
-
lines: percent,
|
|
23
28
|
// so we don't get error messages printed for every file
|
|
24
29
|
perFile: false,
|
|
25
30
|
reporter: [
|
|
@@ -28,7 +33,6 @@ function getBaseConfigWithCoveragePercent(percent) {
|
|
|
28
33
|
],
|
|
29
34
|
skipEmpty: true,
|
|
30
35
|
skipFull: true,
|
|
31
|
-
statements: percent,
|
|
32
36
|
tempDir: './node_modules/.nyc-output/',
|
|
33
37
|
};
|
|
34
38
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"alwaysStrict": true,
|
|
4
|
+
"composite": true,
|
|
4
5
|
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
5
7
|
"esModuleInterop": true,
|
|
6
8
|
"exactOptionalPropertyTypes": true,
|
|
7
9
|
"experimentalDecorators": true,
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
"isolatedModules": true,
|
|
10
12
|
"module": "CommonJS",
|
|
11
13
|
"moduleResolution": "Node",
|
|
12
|
-
"noEmitOnError":
|
|
14
|
+
"noEmitOnError": false,
|
|
13
15
|
"noErrorTruncation": true,
|
|
14
16
|
"noImplicitAny": true,
|
|
15
17
|
"noImplicitOverride": true,
|
|
@@ -23,10 +25,5 @@
|
|
|
23
25
|
"strict": true,
|
|
24
26
|
"target": "ES2019",
|
|
25
27
|
"useUnknownInCatchVariables": true
|
|
26
|
-
},
|
|
27
|
-
"ts-node": {
|
|
28
|
-
"compilerOptions": {
|
|
29
|
-
"module": "CommonJS"
|
|
30
|
-
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -2,6 +2,8 @@ import {esbuildPlugin} from '@web/dev-server-esbuild';
|
|
|
2
2
|
import {playwrightLauncher} from '@web/test-runner-playwright';
|
|
3
3
|
import testFiles from './test-files-glob.js';
|
|
4
4
|
|
|
5
|
+
const oneMinuteMs = 60_000;
|
|
6
|
+
|
|
5
7
|
/** @type {import('@web/test-runner').TestRunnerConfig} */
|
|
6
8
|
const webTestRunnerConfig = {
|
|
7
9
|
browsers: [
|
|
@@ -9,8 +11,7 @@ const webTestRunnerConfig = {
|
|
|
9
11
|
playwrightLauncher({product: 'firefox'}),
|
|
10
12
|
playwrightLauncher({product: 'webkit'}),
|
|
11
13
|
],
|
|
12
|
-
|
|
13
|
-
browserStartTimeout: 120_000,
|
|
14
|
+
browserStartTimeout: 20 * oneMinuteMs,
|
|
14
15
|
concurrentBrowsers: 3,
|
|
15
16
|
coverage: true,
|
|
16
17
|
files: testFiles.spec,
|
|
@@ -18,7 +19,7 @@ const webTestRunnerConfig = {
|
|
|
18
19
|
plugins: [esbuildPlugin({ts: true})],
|
|
19
20
|
testFramework: {
|
|
20
21
|
config: {
|
|
21
|
-
timeout:
|
|
22
|
+
timeout: 20 * oneMinuteMs,
|
|
22
23
|
},
|
|
23
24
|
},
|
|
24
25
|
};
|
package/configs/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
18
|
package/configs/gitignore.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ConfigFileDefinition } from '../config/config-file-definition';
|
|
2
2
|
import { CommandMapping } from './command-mapping';
|
|
3
3
|
export declare function extractAllConfigs(commandMapping: CommandMapping): ReadonlyArray<ConfigFileDefinition>;
|
|
4
|
+
//# sourceMappingURL=command-configs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-configs.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-configs.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,wBAAgB,iBAAiB,CAC7B,cAAc,EAAE,cAAc,GAC/B,aAAa,CAAC,oBAAoB,CAAC,CAMrC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractAllConfigs = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
5
|
function extractAllConfigs(commandMapping) {
|
|
6
|
-
const configFiles = (0,
|
|
7
|
-
.map((commandDefinition) => (0,
|
|
6
|
+
const configFiles = (0, common_1.getObjectTypedValues)(commandMapping)
|
|
7
|
+
.map((commandDefinition) => (0, common_1.getObjectTypedValues)(commandDefinition.configFiles))
|
|
8
8
|
.flat();
|
|
9
9
|
return configFiles;
|
|
10
10
|
}
|
|
@@ -6,3 +6,4 @@ export type CreateDescriptionsInputs<DefineCommandInputsGeneric extends DefineCo
|
|
|
6
6
|
configFiles: DefineCommandInputsGeneric['configFiles'];
|
|
7
7
|
};
|
|
8
8
|
export type CreateDescriptionsCallback<DefineCommandInputsGeneric extends DefineCommandInputs> = (inputs: CreateDescriptionsInputs<DefineCommandInputsGeneric>) => CommandDescription;
|
|
9
|
+
//# sourceMappingURL=command-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-description.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAE5E,MAAM,MAAM,wBAAwB,CAAC,0BAA0B,SAAS,mBAAmB,IAAI,IAAI,CAC/F,0BAA0B,EAC1B,aAAa,CAChB,GAAG;IACA,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACxD,WAAW,EAAE,0BAA0B,CAAC,aAAa,CAAC,CAAC;CAC1D,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,0BAA0B,SAAS,mBAAmB,IAAI,CAC7F,MAAM,EAAE,wBAAwB,CAAC,0BAA0B,CAAC,KAC3D,kBAAkB,CAAC"}
|
|
@@ -26,3 +26,4 @@ export declare function isCompletedExecutor(executorOutput: CommandExecutorOutpu
|
|
|
26
26
|
export type CommandExecutorOutput = BashCommandExecutorOutput | SuccessOnlyExecutorOutput;
|
|
27
27
|
export type CommandExecutorDefinition<DefineCommandInputsGeneric extends DefineCommandInputs> = (inputs: CommandExecutorDefinitionInputs<DefineCommandInputsGeneric>) => Promise<CommandExecutorOutput> | CommandExecutorOutput;
|
|
28
28
|
export type CommandExecutor<DefineCommandInputsGeneric extends DefineCommandInputs> = (inputs: CommandExecutorInputs<DefineCommandInputsGeneric>) => Promise<CommandExecutorOutput> | CommandExecutorOutput;
|
|
29
|
+
//# sourceMappingURL=command-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-executor.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AACvE,OAAO,EACH,mBAAmB,EACnB,wCAAwC,EAC3C,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,qBAAqB,CAC7B,0BAA0B,SAAS,mBAAmB,GAAG,mBAAmB,IAC5E;IACA,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,CAAC,MAAM,0BAA0B,CAAC,wBAAwB,CAAC,CAAC,EAAE,CAAC;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,+BAA+B,CACvC,0BAA0B,SAAS,mBAAmB,GAAG,mBAAmB,IAC5E,qBAAqB,CAAC,0BAA0B,CAAC,GACjD,wCAAwC,CAAC,0BAA0B,CAAC,CAAC;AAEzE,MAAM,MAAM,WAAW,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,wBAAwB,EAAE,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IAEpC,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,IAAI,EAAE,CAAC,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;CAClC,CAAC;AAEF,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,qBAAqB,GACtC,cAAc,IAAI,yBAAyB,CAE7C;AAED,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG,yBAAyB,CAAC;AAE1F,MAAM,MAAM,yBAAyB,CAAC,0BAA0B,SAAS,mBAAmB,IAAI,CAC5F,MAAM,EAAE,+BAA+B,CAAC,0BAA0B,CAAC,KAClE,OAAO,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,eAAe,CAAC,0BAA0B,SAAS,mBAAmB,IAAI,CAClF,MAAM,EAAE,qBAAqB,CAAC,0BAA0B,CAAC,KACxD,OAAO,CAAC,qBAAqB,CAAC,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-help.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-help.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACtC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAClC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;CACrC,CAAC,CAAC"}
|
|
@@ -9,3 +9,4 @@ export type CommandLogs = Record<keyof CommandLogging, string>;
|
|
|
9
9
|
export declare const identityCommandLogTransform: CommandLogTransform;
|
|
10
10
|
export type CommandLogTransform = (thingToTransform: string) => string;
|
|
11
11
|
export type CommandLogTransforms = Partial<Record<keyof CommandLogging, CommandLogTransform>>;
|
|
12
|
+
//# sourceMappingURL=command-logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-logging.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-logging.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IACzB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAG/D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAOpE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,cAAc,EAAE,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,mBAAsC,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,CAAC,gBAAgB,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ArrayElement } from 'augment-vir';
|
|
1
|
+
import { ArrayElement } from '@augment-vir/common';
|
|
2
2
|
import { CommandDefinition } from './define-command';
|
|
3
3
|
export type CommandMapping = Record<string, CommandDefinition>;
|
|
4
4
|
export declare function commandsToMapping(commands: ReadonlyArray<CommandDefinition>): Readonly<CommandMapping>;
|
|
5
5
|
export type CommandDefinitionArrayToMapping<DefinitionArray extends ReadonlyArray<CommandDefinition>> = {
|
|
6
6
|
[CommandName in ArrayElement<DefinitionArray>['commandName']]: CommandDefinition;
|
|
7
7
|
};
|
|
8
|
+
//# sourceMappingURL=command-mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-mapping.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE/D,wBAAgB,iBAAiB,CAC7B,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,GAC3C,QAAQ,CAAC,cAAc,CAAC,CAK1B;AAED,MAAM,MAAM,+BAA+B,CACvC,eAAe,SAAS,aAAa,CAAC,iBAAiB,CAAC,IACxD;KAAE,WAAW,IAAI,YAAY,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,GAAG,iBAAiB;CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-messages.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-messages.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,UAK5E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCommandResultMessage = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
5
5
|
function getCommandResultMessage(commandName, success) {
|
|
6
|
-
const specificColor = success ?
|
|
6
|
+
const specificColor = success ? node_js_1.logColors.success : node_js_1.logColors.error;
|
|
7
7
|
const specificPhrase = success ? 'succeeded' : 'failed';
|
|
8
|
-
return `${
|
|
8
|
+
return `${node_js_1.logColors.bold}${specificColor}${commandName} ${specificPhrase}.${node_js_1.logColors.reset}`;
|
|
9
9
|
}
|
|
10
10
|
exports.getCommandResultMessage = getCommandResultMessage;
|
|
@@ -7,3 +7,4 @@ export declare enum HelpMessageSyntax {
|
|
|
7
7
|
export declare function generateHelpMessage(packageBinName: string, commandDefinitions: Readonly<CommandMapping>, syntax: HelpMessageSyntax, cliWrapIfMoreThanThisManyColumns?: number): string;
|
|
8
8
|
export declare function flagToHelpString(flagName: string, description: string, syntax: HelpMessageSyntax): string;
|
|
9
9
|
export declare function commandToHelpString(packageBinName: string, commandDefinition: CommandDefinition, syntax: HelpMessageSyntax): string;
|
|
10
|
+
//# sourceMappingURL=command-to-help-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-to-help-message.d.ts","sourceRoot":"","sources":["../../../src/api/command/command-to-help-message.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAEnD,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;CACxB;AAED,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,EAC5C,MAAM,EAAE,iBAAiB,EACzB,gCAAgC,SAAM,UAmBzC;AAoDD,wBAAgB,gBAAgB,CAC5B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB,GAC1B,MAAM,CAMR;AAED,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,MAAM,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,iBAAiB,GAC1B,MAAM,CAoBR"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandToHelpString = exports.flagToHelpString = exports.generateHelpMessage = exports.HelpMessageSyntax = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
6
6
|
var HelpMessageSyntax;
|
|
7
7
|
(function (HelpMessageSyntax) {
|
|
8
8
|
HelpMessageSyntax["Cli"] = "cli";
|
|
9
9
|
HelpMessageSyntax["Markdown"] = "markdown";
|
|
10
10
|
})(HelpMessageSyntax = exports.HelpMessageSyntax || (exports.HelpMessageSyntax = {}));
|
|
11
11
|
function generateHelpMessage(packageBinName, commandDefinitions, syntax, cliWrapIfMoreThanThisManyColumns = 100) {
|
|
12
|
-
const commandsMessage = [...(0,
|
|
12
|
+
const commandsMessage = [...(0, common_1.getObjectTypedKeys)(commandDefinitions)]
|
|
13
13
|
.sort()
|
|
14
14
|
.map((commandName) => {
|
|
15
15
|
const commandDefinition = commandDefinitions[commandName];
|
|
@@ -27,11 +27,11 @@ function generateHelpMessage(packageBinName, commandDefinitions, syntax, cliWrap
|
|
|
27
27
|
exports.generateHelpMessage = generateHelpMessage;
|
|
28
28
|
const formatting = ((input) => input)({
|
|
29
29
|
h1: {
|
|
30
|
-
[HelpMessageSyntax.Cli]: `${
|
|
30
|
+
[HelpMessageSyntax.Cli]: `${node_js_1.logColors.info}`,
|
|
31
31
|
[HelpMessageSyntax.Markdown]: '# ',
|
|
32
32
|
},
|
|
33
33
|
h2: {
|
|
34
|
-
[HelpMessageSyntax.Cli]: `${
|
|
34
|
+
[HelpMessageSyntax.Cli]: `${node_js_1.logColors.bold}${node_js_1.logColors.info}`,
|
|
35
35
|
[HelpMessageSyntax.Markdown]: '## ',
|
|
36
36
|
},
|
|
37
37
|
h3: {
|
|
@@ -39,7 +39,7 @@ const formatting = ((input) => input)({
|
|
|
39
39
|
[HelpMessageSyntax.Markdown]: '### ',
|
|
40
40
|
},
|
|
41
41
|
reset: {
|
|
42
|
-
[HelpMessageSyntax.Cli]: `${
|
|
42
|
+
[HelpMessageSyntax.Cli]: `${node_js_1.logColors.reset}`,
|
|
43
43
|
[HelpMessageSyntax.Markdown]: '',
|
|
44
44
|
},
|
|
45
45
|
indent: {
|
|
@@ -93,7 +93,7 @@ function commandToHelpString(packageBinName, commandDefinition, syntax) {
|
|
|
93
93
|
}
|
|
94
94
|
exports.commandToHelpString = commandToHelpString;
|
|
95
95
|
function subCommandDescriptionsToMessage(subCommandDescriptions, syntax) {
|
|
96
|
-
return (0,
|
|
96
|
+
return (0, common_1.getObjectTypedKeys)(subCommandDescriptions).reduce((accum, currentKey, index) => {
|
|
97
97
|
const keyDescription = subCommandDescriptions[currentKey];
|
|
98
98
|
const leadingLine = index > 0 ? '\n\n' : '';
|
|
99
99
|
const fullDescription = `${leadingLine}${formatWithSyntax('h3', syntax)}${currentKey}${formatWithSyntax('colon', syntax)}\n${indent(2, syntax)}${keyDescription}`;
|
|
@@ -110,7 +110,8 @@ function sectionToString(section, extraIndent, syntax, bullets) {
|
|
|
110
110
|
const header = bullets ? '' : format('h3');
|
|
111
111
|
const title = section.title ? `${sectionIndent}${header}${section.title}${separator}` : '';
|
|
112
112
|
if (bullets && syntax === HelpMessageSyntax.Markdown) {
|
|
113
|
-
|
|
113
|
+
const isBlock = section.content.includes('\n');
|
|
114
|
+
return `${format('bullet')}${title}${isBlock ? '\n' : ''}${code(section.content, isBlock, syntax === HelpMessageSyntax.Markdown && isBlock ? ' ' : '', syntax)}`;
|
|
114
115
|
}
|
|
115
116
|
else {
|
|
116
117
|
const contentIndent = section.title ? indent(3 + extraIndent, syntax) : sectionIndent;
|
|
@@ -142,7 +143,7 @@ ${commandsText}`;
|
|
|
142
143
|
}
|
|
143
144
|
function getIndent(line) {
|
|
144
145
|
var _a;
|
|
145
|
-
return (_a = (0,
|
|
146
|
+
return (_a = (0, common_1.safeMatch)(line, /^(\s*)/)[0]) !== null && _a !== void 0 ? _a : '';
|
|
146
147
|
}
|
|
147
148
|
function wrapLines(input, limit) {
|
|
148
149
|
var _a, _b;
|
|
@@ -158,7 +159,7 @@ function wrapLines(input, limit) {
|
|
|
158
159
|
let wrappedPart = line.slice(limit);
|
|
159
160
|
// didn't wrap on a space, we need to shift a word down
|
|
160
161
|
if (!newLine.endsWith(' ') && !wrappedPart.startsWith(' ')) {
|
|
161
|
-
const lastWord = (_b = (0,
|
|
162
|
+
const lastWord = (_b = (0, common_1.safeMatch)(newLine, /(\s\S+$)/)[0]) !== null && _b !== void 0 ? _b : '';
|
|
162
163
|
lines[index] = newLine.slice(0, -1 * lastWord.length).trimEnd();
|
|
163
164
|
wrappedPart = `${lastWord}${wrappedPart.trim()}`;
|
|
164
165
|
}
|
|
@@ -12,3 +12,4 @@ export type SharedExecutorInputsAndCommandDefinition<DefineCommandInputsGeneric
|
|
|
12
12
|
export type SubCommandsMap<DefineCommandInputsGeneric extends DefineCommandInputs> = {
|
|
13
13
|
[Prop in keyof DefineCommandInputsGeneric['subCommandDescriptions']]: Prop;
|
|
14
14
|
};
|
|
15
|
+
//# sourceMappingURL=define-command-inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-command-inputs.d.ts","sourceRoot":"","sources":["../../../src/api/command/define-command-inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAEtE,MAAM,MAAM,mBAAmB,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC5E,WAAW,EAAE,WAAW,CAAC;IACzB,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACtE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,MAAM,wCAAwC,CAChD,0BAA0B,SAAS,mBAAmB,IACtD,0BAA0B,GAAG;IAC7B,uBAAuB,EAAE,aAAa,CAClC,MAAM,0BAA0B,CAAC,wBAAwB,CAAC,CAC7D,CAAC;IACF,WAAW,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,0BAA0B,SAAS,mBAAmB,IAAI;KAChF,IAAI,IAAI,MAAM,0BAA0B,CAAC,wBAAwB,CAAC,GAAG,IAAI;CAC7E,CAAC"}
|
|
@@ -6,3 +6,4 @@ export type CommandDefinition<DefineCommandInputsGeneric extends DefineCommandIn
|
|
|
6
6
|
createDescription: CreateDescriptionsCallback<DefineCommandInputsGeneric>;
|
|
7
7
|
};
|
|
8
8
|
export declare function defineCommand<DefineCommandInputsGeneric extends DefineCommandInputs>(defineCommandInputs: Readonly<DefineCommandInputsGeneric>, createDescription: CreateDescriptionsCallback<DefineCommandInputsGeneric>, inputExecutor: CommandExecutorDefinition<DefineCommandInputsGeneric>): CommandDefinition<DefineCommandInputsGeneric>;
|
|
9
|
+
//# sourceMappingURL=define-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-command.d.ts","sourceRoot":"","sources":["../../../src/api/command/define-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,0BAA0B,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAC,eAAe,EAAE,yBAAyB,EAAC,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACH,mBAAmB,EACnB,wCAAwC,EAE3C,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,iBAAiB,CACzB,0BAA0B,SAAS,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC,IACpF,wCAAwC,CAAC,0BAA0B,CAAC,GAAG;IACvE,QAAQ,EAAE,eAAe,CAAC,0BAA0B,CAAC,CAAC;IACtD,iBAAiB,EAAE,0BAA0B,CAAC,0BAA0B,CAAC,CAAC;CAC7E,CAAC;AAEF,wBAAgB,aAAa,CAAC,0BAA0B,SAAS,mBAAmB,EAChF,mBAAmB,EAAE,QAAQ,CAAC,0BAA0B,CAAC,EACzD,iBAAiB,EAAE,0BAA0B,CAAC,0BAA0B,CAAC,EACzE,aAAa,EAAE,yBAAyB,CAAC,0BAA0B,CAAC,GACrE,iBAAiB,CAAC,0BAA0B,CAAC,CA2B/C"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
5
|
function defineCommand(defineCommandInputs, createDescription, inputExecutor) {
|
|
6
|
-
const allAvailableSubCommands = (0,
|
|
7
|
-
const subCommands = (0,
|
|
6
|
+
const allAvailableSubCommands = (0, common_1.getObjectTypedKeys)(defineCommandInputs.subCommandDescriptions);
|
|
7
|
+
const subCommands = (0, common_1.mapObjectValues)(defineCommandInputs.subCommandDescriptions, (key) => key);
|
|
8
8
|
const init = {
|
|
9
9
|
...defineCommandInputs,
|
|
10
10
|
allAvailableSubCommands,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-file-definition.d.ts","sourceRoot":"","sources":["../../../src/api/config/config-file-definition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,CAC/B,gBAAgB,EAAE,MAAM,EACxB,sBAAsB,EAAE,MAAM,EAC9B,OAAO,EAAE,MAAM,KACd,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE9B,MAAM,MAAM,oBAAoB,GAAG;IAC/B,uCAAuC;IACvC,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IACpC;;;OAGG;IACH,gCAAgC,CAAC,EAAE,oBAAoB,CAAC;CAC3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-paths.d.ts","sourceRoot":"","sources":["../../../src/api/config/config-paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,oBAAoB,CAAC;CAC9C,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAAC,OAAO,EAAE,oBAAoB,EAAC,EAAE,mBAAmB,GAAG,MAAM,CAE1F"}
|
|
@@ -25,3 +25,4 @@ export type CopyAllConfigFilesInputs = Omit<CopyConfigInputs, 'configFileDefinit
|
|
|
25
25
|
};
|
|
26
26
|
/** Returns success state. True if success, false is errors were encountered. */
|
|
27
27
|
export declare function copyAllConfigFiles(inputs: CopyAllConfigFilesInputs): Promise<boolean>;
|
|
28
|
+
//# sourceMappingURL=copy-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-config.d.ts","sourceRoot":"","sources":["../../../src/api/config/copy-config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAG9D,oBAAY,mBAAmB;IAC3B,0FAA0F;IAC1F,MAAM,WAAW;IACjB,oEAAoE;IACpE,SAAS,cAAc;IACvB,sFAAsF;IACtF,IAAI,SAAS;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC;AA0BF,wBAAsB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgCrF;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,GAAG;IACpF,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACpD,CAAC;AAaF,gFAAgF;AAChF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,CAyC3F"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.copyAllConfigFiles = exports.copyConfig = exports.CopyConfigOperation = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const promises_1 = require("fs/promises");
|
|
7
8
|
const path_1 = require("path");
|
|
8
|
-
const cli_color_1 = require("../cli-color");
|
|
9
9
|
const config_paths_1 = require("./config-paths");
|
|
10
10
|
var CopyConfigOperation;
|
|
11
11
|
(function (CopyConfigOperation) {
|
|
@@ -69,7 +69,7 @@ const failedOperation = {
|
|
|
69
69
|
/** Returns success state. True if success, false is errors were encountered. */
|
|
70
70
|
async function copyAllConfigFiles(inputs) {
|
|
71
71
|
const errors = [];
|
|
72
|
-
await (0,
|
|
72
|
+
await (0, common_1.awaitedForEach)(inputs.configFiles.sort((a, b) => {
|
|
73
73
|
const aName = (0, path_1.basename)(a.copyToPathRelativeToRepoDir || a.copyFromInternalPath);
|
|
74
74
|
const bName = (0, path_1.basename)(b.copyToPathRelativeToRepoDir || b.copyFromInternalPath);
|
|
75
75
|
return aName.localeCompare(bName);
|
|
@@ -82,11 +82,11 @@ async function copyAllConfigFiles(inputs) {
|
|
|
82
82
|
packageDir: inputs.packageDir,
|
|
83
83
|
});
|
|
84
84
|
if (result.shouldWrite) {
|
|
85
|
-
inputs.logging.stdout(`${
|
|
85
|
+
inputs.logging.stdout(`${node_js_1.logColors.info}Successfully ${successfulOperation[inputs.operation]}${node_js_1.logColors.reset} ${(0, path_1.basename)(result.copiedToPath)}`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
catch (error) {
|
|
89
|
-
const copyError = new Error(`${
|
|
89
|
+
const copyError = new Error(`${node_js_1.logColors.error}Failed to ${failedOperation[inputs.operation]}${node_js_1.logColors.reset} ${(0, path_1.basename)(configFile.copyToPathRelativeToRepoDir || configFile.copyFromInternalPath)}: ${(0, common_1.extractErrorMessage)(error)}`);
|
|
90
90
|
errors.push(copyError);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -6,3 +6,4 @@ import { ExtendedVirmator, ExtendVirmatorInputs } from './virmator-types';
|
|
|
6
6
|
* can be passed in to add to virmator default configs or overwrite them.
|
|
7
7
|
*/
|
|
8
8
|
export declare function createVirmator<CommandDefinitionsGeneric extends ReadonlyArray<CommandDefinition<any>>>(inputs: ExtendVirmatorInputs<CommandDefinitionsGeneric>): ExtendedVirmator<CommandDefinitionArrayToMapping<CommandDefinitionsGeneric>>;
|
|
9
|
+
//# sourceMappingURL=create-virmator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-virmator.d.ts","sourceRoot":"","sources":["../../src/api/create-virmator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,+BAA+B,EAAoB,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAExE;;;GAGG;AACH,wBAAgB,cAAc,CAC1B,yBAAyB,SAAS,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAEvE,MAAM,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,GACxD,gBAAgB,CAAC,+BAA+B,CAAC,yBAAyB,CAAC,CAAC,CAyE9E"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createVirmator = void 0;
|
|
4
|
-
const
|
|
4
|
+
const common_1 = require("@augment-vir/common");
|
|
5
5
|
const command_configs_1 = require("./command/command-configs");
|
|
6
6
|
const command_mapping_1 = require("./command/command-mapping");
|
|
7
7
|
const command_to_help_message_1 = require("./command/command-to-help-message");
|
|
@@ -36,7 +36,7 @@ function createVirmator(inputs) {
|
|
|
36
36
|
await run(process.argv, process.cwd());
|
|
37
37
|
}
|
|
38
38
|
catch (error) {
|
|
39
|
-
console.error((0,
|
|
39
|
+
console.error((0, common_1.extractErrorMessage)(error));
|
|
40
40
|
process.exit(1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-npm-deps.d.ts","sourceRoot":"","sources":["../../../src/api/run-command/check-npm-deps.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC,CAAC;AAEH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B/E"}
|
|
@@ -24,14 +24,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.updateDepsAsNeeded = void 0;
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const common_1 = require("@augment-vir/common");
|
|
28
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
29
29
|
const fs_1 = require("fs");
|
|
30
30
|
const promises_1 = require("fs/promises");
|
|
31
31
|
const path_1 = require("path");
|
|
32
32
|
const semver = __importStar(require("semver"));
|
|
33
33
|
const fs_2 = require("../../augments/fs");
|
|
34
|
-
const cli_color_1 = require("../cli-color");
|
|
35
34
|
async function updateDepsAsNeeded(inputs) {
|
|
36
35
|
try {
|
|
37
36
|
const upgradeVersions = await getVersionsToUpgradeTo(inputs);
|
|
@@ -48,23 +47,23 @@ async function updateDepsAsNeeded(inputs) {
|
|
|
48
47
|
return undefined;
|
|
49
48
|
}
|
|
50
49
|
})
|
|
51
|
-
.filter(
|
|
52
|
-
await (0,
|
|
50
|
+
.filter(common_1.isTruthy);
|
|
51
|
+
await (0, common_1.awaitedForEach)(depsToUpdate, async (depDetails) => {
|
|
53
52
|
const depToInstall = `${depDetails.npmDep}@${depDetails.version}`;
|
|
54
|
-
console.info(`${
|
|
55
|
-
await (0,
|
|
53
|
+
console.info(`${node_js_1.logColors.info}Installing ${depToInstall}...`);
|
|
54
|
+
await (0, node_js_1.runShellCommand)(`npm i -D ${depToInstall}`, {
|
|
56
55
|
cwd: inputs.repoDir,
|
|
57
56
|
rejectOnError: true,
|
|
58
57
|
});
|
|
59
58
|
});
|
|
60
59
|
}
|
|
61
60
|
catch (error) {
|
|
62
|
-
throw new Error(`Failed to update deps: ${(0,
|
|
61
|
+
throw new Error(`Failed to update deps: ${(0, common_1.extractErrorMessage)(error)}`);
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
64
|
exports.updateDepsAsNeeded = updateDepsAsNeeded;
|
|
66
65
|
async function getVersionsToUpgradeTo({ repoDir, packageDir, npmDeps, packageBinName, }) {
|
|
67
|
-
const packageName = (await (0,
|
|
66
|
+
const packageName = (await (0, node_js_1.runShellCommand)(`cut -d "=" -f 2 <<< $(npm run env | grep "npm_package_name")`, {
|
|
68
67
|
cwd: repoDir,
|
|
69
68
|
rejectOnError: true,
|
|
70
69
|
})).stdout.trim();
|
|
@@ -99,7 +98,7 @@ async function findDepsListWithPackageName(repoDir, packageName) {
|
|
|
99
98
|
if (!(0, fs_1.existsSync)((0, path_1.join)(repoDir, 'package.json'))) {
|
|
100
99
|
return findDepsListWithPackageName((0, path_1.dirname)(repoDir), packageName);
|
|
101
100
|
}
|
|
102
|
-
const listedDeps = await (0,
|
|
101
|
+
const listedDeps = await (0, node_js_1.runShellCommand)(`npm list --depth=0 -json`, {
|
|
103
102
|
cwd: repoDir,
|
|
104
103
|
rejectOnError: true,
|
|
105
104
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-arguments.d.ts","sourceRoot":"","sources":["../../../src/api/run-command/extract-arguments.ts"],"names":[],"mappings":"AAGA,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,YAajE;AAED,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI;IAAC,WAAW,EAAE,CAAC,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAC,CAAC;AAErF,wBAAgB,kBAAkB,CAAC,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAC9B,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC,GACvC,wBAAwB,CAAC,CAAC,CAAC,CAkB7B"}
|
|
@@ -3,3 +3,4 @@ import { CommandDefinition } from '../command/define-command';
|
|
|
3
3
|
import { DefineCommandInputs } from '../command/define-command-inputs';
|
|
4
4
|
export declare function createCommandString(executorOutput: BashCommandExecutorOutput): string;
|
|
5
5
|
export declare function runCommandExecutor<DefineCommandInputsGeneric extends DefineCommandInputs>(commandDefinition: CommandDefinition<DefineCommandInputsGeneric>, commandInputs: CommandExecutorInputs<DefineCommandInputsGeneric>): Promise<boolean>;
|
|
6
|
+
//# sourceMappingURL=run-command-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command-executor.d.ts","sourceRoot":"","sources":["../../../src/api/run-command/run-command-executor.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EAExB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAIrE,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,yBAAyB,GAAG,MAAM,CAerF;AAED,wBAAsB,kBAAkB,CAAC,0BAA0B,SAAS,mBAAmB,EAC3F,iBAAiB,EAAE,iBAAiB,CAAC,0BAA0B,CAAC,EAChE,aAAa,EAAE,qBAAqB,CAAC,0BAA0B,CAAC,GACjE,OAAO,CAAC,OAAO,CAAC,CA4BlB"}
|