mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-13 11:22:11 +02:00
rename klo to ktx
This commit is contained in:
parent
1a42152e6f
commit
3ce510b55b
704 changed files with 10205 additions and 10255 deletions
|
|
@ -5,14 +5,14 @@ import { execFile as childExecFile } from 'node:child_process';
|
|||
import { dirname, resolve } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
import { promisify } from 'node:util';
|
||||
import { runWorkspaceKlo } from './run-klo.mjs';
|
||||
import { runWorkspaceKtx } from './run-ktx.mjs';
|
||||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const kloRootDir = resolve(scriptDir, '..');
|
||||
const repoRootDir = resolve(kloRootDir, '..');
|
||||
const defaultProjectDir = resolve(kloRootDir, 'examples/orbit-relationship-verification');
|
||||
const ktxRootDir = resolve(scriptDir, '..');
|
||||
const repoRootDir = resolve(ktxRootDir, '..');
|
||||
const defaultProjectDir = resolve(ktxRootDir, 'examples/orbit-relationship-verification');
|
||||
const defaultReportPath = resolve(
|
||||
kloRootDir,
|
||||
ktxRootDir,
|
||||
'examples/orbit-relationship-verification/reports/orbit-verification.md',
|
||||
);
|
||||
const defaultExecFile = promisify(childExecFile);
|
||||
|
|
@ -43,7 +43,7 @@ export function defaultOrbitVerificationProjectDir() {
|
|||
}
|
||||
|
||||
function shellCommand(argv) {
|
||||
return ['pnpm', 'run', 'klo', '--', ...argv].join(' ');
|
||||
return ['pnpm', 'run', 'ktx', '--', ...argv].join(' ');
|
||||
}
|
||||
|
||||
function firstNonEmptyLine(...values) {
|
||||
|
|
@ -61,8 +61,8 @@ function firstNonEmptyLine(...values) {
|
|||
|
||||
function parseArgs(argv) {
|
||||
const options = {
|
||||
connectionId: process.env.KLO_ORBIT_CONNECTION_ID ?? 'orbit',
|
||||
projectDir: process.env.KLO_ORBIT_PROJECT_DIR ?? defaultProjectDir,
|
||||
connectionId: process.env.KTX_ORBIT_CONNECTION_ID ?? 'orbit',
|
||||
projectDir: process.env.KTX_ORBIT_PROJECT_DIR ?? defaultProjectDir,
|
||||
reportPath: defaultReportPath,
|
||||
};
|
||||
|
||||
|
|
@ -190,7 +190,7 @@ function formatBlocked(result) {
|
|||
|
||||
export function formatOrbitVerificationMarkdown(result) {
|
||||
const lines = [
|
||||
'# KLO Relationship Discovery Orbit Verification',
|
||||
'# KTX Relationship Discovery Orbit Verification',
|
||||
'',
|
||||
`Date: ${result.date}`,
|
||||
'',
|
||||
|
|
@ -219,7 +219,7 @@ export function formatOrbitVerificationMarkdown(result) {
|
|||
return `${lines.join('\n')}\n`;
|
||||
}
|
||||
|
||||
async function runBufferedWorkspaceKlo(runner, argv, rootDir, execFile) {
|
||||
async function runBufferedWorkspaceKtx(runner, argv, rootDir, execFile) {
|
||||
const stdout = new BufferWriter();
|
||||
const stderr = new BufferWriter();
|
||||
const exitCode = await runner(argv, { rootDir, execFile, stdout, stderr });
|
||||
|
|
@ -241,11 +241,11 @@ function orbitVerificationEnv(projectDir) {
|
|||
}
|
||||
|
||||
export async function runOrbitVerification(options = {}) {
|
||||
const connectionId = options.connectionId ?? process.env.KLO_ORBIT_CONNECTION_ID ?? 'orbit';
|
||||
const projectDir = options.projectDir ?? process.env.KLO_ORBIT_PROJECT_DIR ?? defaultProjectDir;
|
||||
const connectionId = options.connectionId ?? process.env.KTX_ORBIT_CONNECTION_ID ?? 'orbit';
|
||||
const projectDir = options.projectDir ?? process.env.KTX_ORBIT_PROJECT_DIR ?? defaultProjectDir;
|
||||
const reportPath = options.reportPath ?? defaultReportPath;
|
||||
const rootDir = options.rootDir ?? kloRootDir;
|
||||
const runner = options.runWorkspaceKlo ?? runWorkspaceKlo;
|
||||
const rootDir = options.rootDir ?? ktxRootDir;
|
||||
const runner = options.runWorkspaceKtx ?? runWorkspaceKtx;
|
||||
const execFile = options.execFile ?? defaultExecFile;
|
||||
const now = options.now ?? (() => new Date());
|
||||
const mkdir = options.mkdir ?? fsMkdir;
|
||||
|
|
@ -255,7 +255,7 @@ export async function runOrbitVerification(options = {}) {
|
|||
const runWithEnv = (argv, runnerOptions) => runner(argv, { ...runnerOptions, env });
|
||||
|
||||
const scanArgv = buildOrbitScanArgv({ connectionId, projectDir });
|
||||
const scan = await runBufferedWorkspaceKlo(runWithEnv, scanArgv, rootDir, execFile);
|
||||
const scan = await runBufferedWorkspaceKtx(runWithEnv, scanArgv, rootDir, execFile);
|
||||
let result;
|
||||
|
||||
if (scan.exitCode !== 0) {
|
||||
|
|
@ -280,13 +280,13 @@ export async function runOrbitVerification(options = {}) {
|
|||
projectDir,
|
||||
scanCommand: shellCommand(scanArgv),
|
||||
scanExitCode: scan.exitCode,
|
||||
blocker: 'KLO scan completed without printing a Run id',
|
||||
blocker: 'KTX scan completed without printing a Run id',
|
||||
scanStdout: scan.stdout,
|
||||
scanStderr: scan.stderr,
|
||||
};
|
||||
} else {
|
||||
const reportArgv = buildOrbitReportArgv({ projectDir, runId });
|
||||
const reportOutput = await runBufferedWorkspaceKlo(runWithEnv, reportArgv, rootDir, execFile);
|
||||
const reportOutput = await runBufferedWorkspaceKtx(runWithEnv, reportArgv, rootDir, execFile);
|
||||
if (reportOutput.exitCode !== 0) {
|
||||
result = {
|
||||
status: 'blocked',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue