@virmator/core 13.0.5 → 13.1.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/dist/api/copy-configs.d.ts +4 -4
- package/dist/api/copy-configs.js +1 -1
- package/dist/api/execute-command.d.ts +2 -2
- package/dist/api/execute-command.js +12 -12
- package/dist/api/index.d.ts +5 -5
- package/dist/api/index.js +5 -5
- package/dist/api/install-deps.d.ts +4 -4
- package/dist/api/install-deps.js +2 -2
- package/dist/api/parse-args.d.ts +5 -5
- package/dist/api/parse-args.js +2 -2
- package/dist/api/typescript-config-file.js +1 -1
- package/dist/augments/index.d.ts +4 -4
- package/dist/augments/index.js +4 -4
- package/dist/augments/object/access.js +3 -3
- package/dist/augments/stream/callback-writable.d.ts +2 -2
- package/dist/augments/stream/callback-writable.js +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/plugin/index.d.ts +6 -6
- package/dist/plugin/index.js +6 -6
- package/dist/plugin/plugin-configs.d.ts +1 -1
- package/dist/plugin/plugin-executor.d.ts +4 -4
- package/dist/plugin/plugin-init.d.ts +2 -2
- package/dist/plugin/plugin-logger.d.ts +1 -1
- package/dist/plugin/plugin.d.ts +3 -3
- package/dist/plugin/plugin.js +1 -1
- package/package.json +4 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaybePromise } from '@augment-vir/common';
|
|
2
|
-
import { VirmatorPluginResolvedConfigFile } from '../plugin/plugin-configs';
|
|
3
|
-
import { PackageType } from '../plugin/plugin-env';
|
|
4
|
-
import { MonoRepoPackage, UsedVirmatorPluginCommands, VirmatorPluginResolvedConfigs } from '../plugin/plugin-executor';
|
|
5
|
-
import { PluginLogger } from '../plugin/plugin-logger';
|
|
2
|
+
import { VirmatorPluginResolvedConfigFile } from '../plugin/plugin-configs.js';
|
|
3
|
+
import { PackageType } from '../plugin/plugin-env.js';
|
|
4
|
+
import { MonoRepoPackage, UsedVirmatorPluginCommands, VirmatorPluginResolvedConfigs } from '../plugin/plugin-executor.js';
|
|
5
|
+
import { PluginLogger } from '../plugin/plugin-logger.js';
|
|
6
6
|
/**
|
|
7
7
|
* Extracts a 1d array of virmator plugin config files from previously calculated used commands and
|
|
8
8
|
* resolved configs.
|
package/dist/api/copy-configs.js
CHANGED
|
@@ -2,7 +2,7 @@ import { awaitedForEach, extractErrorMessage } from '@augment-vir/common';
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
4
4
|
import { basename, dirname, join } from 'node:path';
|
|
5
|
-
import { PackageType } from '../plugin/plugin-env';
|
|
5
|
+
import { PackageType } from '../plugin/plugin-env.js';
|
|
6
6
|
/**
|
|
7
7
|
* Extracts a 1d array of virmator plugin config files from previously calculated used commands and
|
|
8
8
|
* resolved configs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PartialAndUndefined } from '@augment-vir/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { PluginLogger } from '../plugin/plugin-logger.js';
|
|
3
|
+
import { VirmatorPlugin } from '../plugin/plugin.js';
|
|
4
4
|
/** Params for executing a plugin command. */
|
|
5
5
|
export type ExecuteCommandParams = {
|
|
6
6
|
/**
|
|
@@ -6,15 +6,15 @@ import { getRelativePosixPackagePathsInDependencyOrder } from 'mono-vir';
|
|
|
6
6
|
import { cpus } from 'node:os';
|
|
7
7
|
import { join, resolve } from 'node:path';
|
|
8
8
|
import { isRunTimeType } from 'run-time-assertions';
|
|
9
|
-
import { findClosestPackageDir } from '../augments/index';
|
|
10
|
-
import { CallbackWritable } from '../augments/stream/callback-writable';
|
|
11
|
-
import { getTerminalColor } from '../colors';
|
|
12
|
-
import { hideNoTraceTraces, VirmatorNoTraceError } from '../errors/virmator-no-trace.error';
|
|
13
|
-
import { PackageType } from '../plugin/plugin-env';
|
|
14
|
-
import { createPluginLogger } from '../plugin/plugin-logger';
|
|
15
|
-
import { copyPluginConfigs } from './copy-configs';
|
|
16
|
-
import { installNpmDeps, installPluginNpmDeps } from './install-deps';
|
|
17
|
-
import { parseCliArgs } from './parse-args';
|
|
9
|
+
import { findClosestPackageDir } from '../augments/index.js';
|
|
10
|
+
import { CallbackWritable } from '../augments/stream/callback-writable.js';
|
|
11
|
+
import { getTerminalColor } from '../colors.js';
|
|
12
|
+
import { hideNoTraceTraces, VirmatorNoTraceError } from '../errors/virmator-no-trace.error.js';
|
|
13
|
+
import { PackageType } from '../plugin/plugin-env.js';
|
|
14
|
+
import { createPluginLogger } from '../plugin/plugin-logger.js';
|
|
15
|
+
import { copyPluginConfigs } from './copy-configs.js';
|
|
16
|
+
import { installNpmDeps, installPluginNpmDeps } from './install-deps.js';
|
|
17
|
+
import { parseCliArgs } from './parse-args.js';
|
|
18
18
|
function resolveConfigs({ cwdPackagePath, pluginPackagePath }, cliCommands) {
|
|
19
19
|
return mapObjectValues(cliCommands, (commandName, command) => {
|
|
20
20
|
return {
|
|
@@ -40,7 +40,7 @@ async function determinePackageType(cwdPackagePath, monoRepoRootPath, cwdPackage
|
|
|
40
40
|
else {
|
|
41
41
|
if (monoRepoRootPath !== cwdPackagePath) {
|
|
42
42
|
const parentPackages = await getMonoRepoPackages(monoRepoRootPath);
|
|
43
|
-
if (parentPackages.
|
|
43
|
+
if (parentPackages.some((monoPackage) => {
|
|
44
44
|
return join(monoRepoRootPath, monoPackage.relativePath) === cwdPackagePath;
|
|
45
45
|
})) {
|
|
46
46
|
return PackageType.MonoPackage;
|
|
@@ -76,7 +76,7 @@ async function findMonoRepoDir(cwdPackagePath) {
|
|
|
76
76
|
});
|
|
77
77
|
if (parentPackageDir) {
|
|
78
78
|
const parentPackages = await getMonoRepoPackages(parentPackageDir);
|
|
79
|
-
if (parentPackages.
|
|
79
|
+
if (parentPackages.some((monoPackage) => {
|
|
80
80
|
return join(parentPackageDir, monoPackage.relativePath) === cwdPackagePath;
|
|
81
81
|
})) {
|
|
82
82
|
return parentPackageDir;
|
|
@@ -205,7 +205,7 @@ export async function executeVirmatorCommand({ log: logParam, entryPointFilePath
|
|
|
205
205
|
})).filter(isTruthy);
|
|
206
206
|
const writeStream = new CallbackWritable(log);
|
|
207
207
|
/** Force concurrently to use color even though it's being run as a subscript. */
|
|
208
|
-
process.env.FORCE_COLOR = '
|
|
208
|
+
process.env.FORCE_COLOR = '2';
|
|
209
209
|
let concurrentlyResults = [];
|
|
210
210
|
let failed = false;
|
|
211
211
|
try {
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './copy-configs';
|
|
2
|
-
export * from './execute-command';
|
|
3
|
-
export * from './parse-args';
|
|
4
|
-
export * from './typescript-config-file';
|
|
5
|
-
export * from './virmator-flags';
|
|
1
|
+
export * from './copy-configs.js';
|
|
2
|
+
export * from './execute-command.js';
|
|
3
|
+
export * from './parse-args.js';
|
|
4
|
+
export * from './typescript-config-file.js';
|
|
5
|
+
export * from './virmator-flags.js';
|
package/dist/api/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './copy-configs';
|
|
2
|
-
export * from './execute-command';
|
|
3
|
-
export * from './parse-args';
|
|
4
|
-
export * from './typescript-config-file';
|
|
5
|
-
export * from './virmator-flags';
|
|
1
|
+
export * from './copy-configs.js';
|
|
2
|
+
export * from './execute-command.js';
|
|
3
|
+
export * from './parse-args.js';
|
|
4
|
+
export * from './typescript-config-file.js';
|
|
5
|
+
export * from './virmator-flags.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PackageJson } from 'type-fest';
|
|
2
|
-
import { PackageType } from '../plugin/plugin-env';
|
|
3
|
-
import { UsedVirmatorPluginCommands } from '../plugin/plugin-executor';
|
|
4
|
-
import { PluginNpmDeps } from '../plugin/plugin-init';
|
|
5
|
-
import { PluginLogger } from '../plugin/plugin-logger';
|
|
2
|
+
import { PackageType } from '../plugin/plugin-env.js';
|
|
3
|
+
import { UsedVirmatorPluginCommands } from '../plugin/plugin-executor.js';
|
|
4
|
+
import { PluginNpmDeps } from '../plugin/plugin-init.js';
|
|
5
|
+
import { PluginLogger } from '../plugin/plugin-logger.js';
|
|
6
6
|
/** Install's a virmator plugin's listed npm deps depending on which command is being run. */
|
|
7
7
|
export declare function installPluginNpmDeps({ usedCommands, ...params }: {
|
|
8
8
|
cwdPackagePath: string;
|
package/dist/api/install-deps.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { awaitedBlockingMap, getObjectTypedEntries, isTruthy } from '@augment-vir/common';
|
|
2
2
|
import { readPackageJson, runShellCommand } from '@augment-vir/node-js';
|
|
3
3
|
import * as semver from 'semver';
|
|
4
|
-
import { VirmatorNoTraceError } from '../errors/virmator-no-trace.error';
|
|
5
|
-
import { NpmDepType } from '../plugin/plugin-init';
|
|
4
|
+
import { VirmatorNoTraceError } from '../errors/virmator-no-trace.error.js';
|
|
5
|
+
import { NpmDepType } from '../plugin/plugin-init.js';
|
|
6
6
|
/** Install's a virmator plugin's listed npm deps depending on which command is being run. */
|
|
7
7
|
export async function installPluginNpmDeps({ usedCommands, ...params }) {
|
|
8
8
|
const deps = flattenDeps(usedCommands);
|
package/dist/api/parse-args.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { SetVirmatorFlags } from './virmator-flags';
|
|
1
|
+
import { UsedVirmatorPluginCommands } from '../plugin/plugin-executor.js';
|
|
2
|
+
import { VirmatorPluginCliCommands } from '../plugin/plugin-init.js';
|
|
3
|
+
import { PluginLogger } from '../plugin/plugin-logger.js';
|
|
4
|
+
import { VirmatorPlugin } from '../plugin/plugin.js';
|
|
5
|
+
import { SetVirmatorFlags } from './virmator-flags.js';
|
|
6
6
|
/** All supported sets of args for virmator. */
|
|
7
7
|
export type ParsedArgs = {
|
|
8
8
|
virmatorFlags: SetVirmatorFlags;
|
package/dist/api/parse-args.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getObjectTypedEntries, hasKey, isLengthAtLeast, mapObjectValues, wrapInTry, } from '@augment-vir/common';
|
|
2
2
|
import { extractRelevantArgs } from 'cli-args-vir';
|
|
3
3
|
import { isRunTimeType } from 'run-time-assertions';
|
|
4
|
-
import { accessAtKeys } from '../augments/object/access';
|
|
5
|
-
import { virmatorFlags } from './virmator-flags';
|
|
4
|
+
import { accessAtKeys } from '../augments/object/access.js';
|
|
5
|
+
import { virmatorFlags } from './virmator-flags.js';
|
|
6
6
|
function extractNestedCommands(cliCommands) {
|
|
7
7
|
return mapObjectValues(cliCommands, (commandName, command) => {
|
|
8
8
|
if (command.subCommands) {
|
|
@@ -2,7 +2,7 @@ import { wrapInTry } from '@augment-vir/common';
|
|
|
2
2
|
import { toPosixPath } from '@augment-vir/node-js';
|
|
3
3
|
import { rm } from 'node:fs/promises';
|
|
4
4
|
import { basename, join, relative } from 'node:path';
|
|
5
|
-
import { findClosestNodeModulesDir } from '../augments/index';
|
|
5
|
+
import { findClosestNodeModulesDir } from '../augments/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Compiles and imports a TS file so it can be used within JS contexts. After the given callback is
|
|
8
8
|
* executed, the compiled JS output is deleted.
|
package/dist/augments/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './fs/search';
|
|
2
|
-
export * from './object/access';
|
|
3
|
-
export * from './stream/callback-writable';
|
|
4
|
-
export * from './tsconfig/parse-tsconfig';
|
|
1
|
+
export * from './fs/search.js';
|
|
2
|
+
export * from './object/access.js';
|
|
3
|
+
export * from './stream/callback-writable.js';
|
|
4
|
+
export * from './tsconfig/parse-tsconfig.js';
|
package/dist/augments/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './fs/search';
|
|
2
|
-
export * from './object/access';
|
|
3
|
-
export * from './stream/callback-writable';
|
|
4
|
-
export * from './tsconfig/parse-tsconfig';
|
|
1
|
+
export * from './fs/search.js';
|
|
2
|
+
export * from './object/access.js';
|
|
3
|
+
export * from './stream/callback-writable.js';
|
|
4
|
+
export * from './tsconfig/parse-tsconfig.js';
|
|
@@ -4,10 +4,10 @@ export function accessAtKeys(parent, keys) {
|
|
|
4
4
|
if (!parent) {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
|
-
else if (
|
|
8
|
-
return parent;
|
|
7
|
+
else if (isLengthAtLeast(keys, 1)) {
|
|
8
|
+
return accessAtKeys(parent[keys[0]], keys.slice(1));
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
return
|
|
11
|
+
return parent;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Writable } from 'stream';
|
|
2
|
-
import { PluginLogger } from '../../plugin/plugin-logger';
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import { PluginLogger } from '../../plugin/plugin-logger.js';
|
|
3
3
|
/** A {@link Writable} implementation that writes to the provided plugin logger. */
|
|
4
4
|
export declare class CallbackWritable extends Writable {
|
|
5
5
|
private readonly logger;
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './virmator-no-trace.error';
|
|
1
|
+
export * from './virmator-no-trace.error.js';
|
package/dist/errors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './virmator-no-trace.error';
|
|
1
|
+
export * from './virmator-no-trace.error.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './api/index';
|
|
2
|
-
export * from './augments/index';
|
|
3
|
-
export * from './colors';
|
|
4
|
-
export * from './errors/index';
|
|
5
|
-
export * from './plugin/index';
|
|
1
|
+
export * from './api/index.js';
|
|
2
|
+
export * from './augments/index.js';
|
|
3
|
+
export * from './colors.js';
|
|
4
|
+
export * from './errors/index.js';
|
|
5
|
+
export * from './plugin/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './api/index';
|
|
2
|
-
export * from './augments/index';
|
|
3
|
-
export * from './colors';
|
|
4
|
-
export * from './errors/index';
|
|
5
|
-
export * from './plugin/index';
|
|
1
|
+
export * from './api/index.js';
|
|
2
|
+
export * from './augments/index.js';
|
|
3
|
+
export * from './colors.js';
|
|
4
|
+
export * from './errors/index.js';
|
|
5
|
+
export * from './plugin/index.js';
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './plugin';
|
|
2
|
-
export * from './plugin-
|
|
3
|
-
export * from './plugin-
|
|
4
|
-
export * from './plugin-
|
|
5
|
-
export * from './plugin-
|
|
6
|
-
export * from './plugin
|
|
1
|
+
export * from './plugin-configs.js';
|
|
2
|
+
export * from './plugin-env.js';
|
|
3
|
+
export * from './plugin-executor.js';
|
|
4
|
+
export * from './plugin-init.js';
|
|
5
|
+
export * from './plugin-logger.js';
|
|
6
|
+
export * from './plugin.js';
|
package/dist/plugin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './plugin';
|
|
2
|
-
export * from './plugin-
|
|
3
|
-
export * from './plugin-
|
|
4
|
-
export * from './plugin-
|
|
5
|
-
export * from './plugin-
|
|
6
|
-
export * from './plugin
|
|
1
|
+
export * from './plugin-configs.js';
|
|
2
|
+
export * from './plugin-env.js';
|
|
3
|
+
export * from './plugin-executor.js';
|
|
4
|
+
export * from './plugin-init.js';
|
|
5
|
+
export * from './plugin-logger.js';
|
|
6
|
+
export * from './plugin.js';
|
|
@@ -2,10 +2,10 @@ import type { AnyObject, MaybePromise, PartialAndUndefined, TypedFunction } from
|
|
|
2
2
|
import type { LogOutputType, runShellCommand } from '@augment-vir/node-js';
|
|
3
3
|
import { ChalkInstance } from 'chalk';
|
|
4
4
|
import { EmptyObject, PackageJson, SetRequired } from 'type-fest';
|
|
5
|
-
import { VirmatorPluginResolvedConfigFile } from './plugin-configs';
|
|
6
|
-
import { PackageType } from './plugin-env';
|
|
7
|
-
import { IndividualPluginCommand, PluginNpmDeps, VirmatorPluginCliCommands, VirmatorPluginInit } from './plugin-init';
|
|
8
|
-
import { PluginLogger } from './plugin-logger';
|
|
5
|
+
import { VirmatorPluginResolvedConfigFile } from './plugin-configs.js';
|
|
6
|
+
import { PackageType } from './plugin-env.js';
|
|
7
|
+
import { IndividualPluginCommand, PluginNpmDeps, VirmatorPluginCliCommands, VirmatorPluginInit } from './plugin-init.js';
|
|
8
|
+
import { PluginLogger } from './plugin-logger.js';
|
|
9
9
|
/** A picked nesting of commands based on which commands are currently in use. */
|
|
10
10
|
export type UsedVirmatorPluginCommands<Commands extends VirmatorPluginCliCommands = VirmatorPluginCliCommands> = Partial<Readonly<{
|
|
11
11
|
[CliCommand in keyof Commands]: Readonly<Omit<IndividualPluginCommand, 'subCommands'> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VirmatorPluginConfigFile } from './plugin-configs';
|
|
2
|
-
import { PackageType, VirmatorEnv } from './plugin-env';
|
|
1
|
+
import { VirmatorPluginConfigFile } from './plugin-configs.js';
|
|
2
|
+
import { PackageType, VirmatorEnv } from './plugin-env.js';
|
|
3
3
|
/** A single doc entry for {@link PluginCommandDocs}. */
|
|
4
4
|
export type PluginDocEntry = Readonly<{
|
|
5
5
|
title?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger, LogOutputType } from '@augment-vir/node-js';
|
|
2
|
-
import { Socket } from 'net';
|
|
2
|
+
import { Socket } from 'node:net';
|
|
3
3
|
/** An extensions of `@augment-vir/node-js`'s logger with a `plain` log command. */
|
|
4
4
|
export type PluginLogger = Logger & {
|
|
5
5
|
plain: Logger['faint'];
|
package/dist/plugin/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VirmatorPlugin, VirmatorPluginExecutor } from './plugin-executor';
|
|
2
|
-
import { VirmatorPluginCliCommands, VirmatorPluginInit } from './plugin-init';
|
|
3
|
-
export type { VirmatorPlugin } from './plugin-executor';
|
|
1
|
+
import { VirmatorPlugin, VirmatorPluginExecutor } from './plugin-executor.js';
|
|
2
|
+
import { VirmatorPluginCliCommands, VirmatorPluginInit } from './plugin-init.js';
|
|
3
|
+
export type { VirmatorPlugin } from './plugin-executor.js';
|
|
4
4
|
/** Define a virmator plugin. */
|
|
5
5
|
export declare function defineVirmatorPlugin<const Commands extends VirmatorPluginCliCommands>(
|
|
6
6
|
/** Should be `import.meta.dirname`. Used to determine the directory of the plugin's package. */
|
package/dist/plugin/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { searchUpwardsForDir } from '../augments/fs/search';
|
|
3
|
+
import { searchUpwardsForDir } from '../augments/fs/search.js';
|
|
4
4
|
/** Define a virmator plugin. */
|
|
5
5
|
export function defineVirmatorPlugin(
|
|
6
6
|
/** Should be `import.meta.dirname`. Used to determine the directory of the plugin's package. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virmator/core",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.1",
|
|
4
4
|
"description": "Shared core functionality for all virmator plugins and the virmator CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
"@types/semver": "^7.5.8",
|
|
49
49
|
"esbuild": "^0.23.0"
|
|
50
50
|
},
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22"
|
|
53
|
+
},
|
|
51
54
|
"publishConfig": {
|
|
52
55
|
"access": "public"
|
|
53
56
|
}
|