Compare commits

..

6 Commits

9 changed files with 90 additions and 20 deletions

View File

@@ -1,5 +1,26 @@
# Changelog
## 2025-10-17 - 2.6.2 - fix(@push.rocks/smartrequest)
Bump @push.rocks/smartrequest from ^4.3.1 to ^4.3.2
- Update dependency @push.rocks/smartrequest from ^4.3.1 to ^4.3.2
## 2025-10-17 - 2.6.1 - fix(runtime-adapters)
Silence shell version checks for Bun and Deno; add local Claude settings
- Replace smartshell.exec with execSilent in ts/tstest.classes.runtime.bun.ts to suppress output when checking Bun availability
- Replace smartshell.exec with execSilent in ts/tstest.classes.runtime.deno.ts to suppress output when checking Deno availability
- Add .claude/settings.local.json to record local Claude agent permissions/config used for development
## 2025-10-17 - 2.6.0 - feat(runtime-adapters)
Add runtime environment availability check and logger output; normalize runtime version strings
- Introduce checkEnvironment() in TsTest and invoke it at the start of run() to detect available runtimes before executing tests.
- Add environmentCheck(availability) to TsTestLogger to print a human-friendly environment summary (with JSON and quiet-mode handling).
- Normalize reported runtime version strings from adapters: prefix Deno and Bun versions with 'v' and simplify Chromium version text.
- Display runtime availability information to the user before moving previous logs or running tests.
- Includes addition of local .claude/settings.local.json (local dev/tooling settings).
## 2025-10-17 - 2.5.2 - fix(runtime.node)
Improve Node runtime adapter to use tsrun.spawnPath, strengthen tsrun detection, and improve process lifecycle and loader handling; update tsrun dependency.

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tstest",
"version": "2.5.2",
"version": "2.6.2",
"private": false,
"description": "a test utility to run tests that match test/**/*.ts",
"exports": {
@@ -46,7 +46,7 @@
"@push.rocks/smartnetwork": "^4.4.0",
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^4.3.1",
"@push.rocks/smartrequest": "^4.3.2",
"@push.rocks/smarts3": "^2.2.6",
"@push.rocks/smartshell": "^3.3.0",
"@push.rocks/smarttime": "^4.1.1",

20
pnpm-lock.yaml generated
View File

@@ -63,8 +63,8 @@ importers:
specifier: ^4.2.3
version: 4.2.3
'@push.rocks/smartrequest':
specifier: ^4.3.1
version: 4.3.1
specifier: ^4.3.2
version: 4.3.2
'@push.rocks/smarts3':
specifier: ^2.2.6
version: 2.2.6
@@ -1047,8 +1047,8 @@ packages:
'@push.rocks/smartrequest@2.1.0':
resolution: {integrity: sha512-3eHLTRInHA+u+W98TqJwgTES7rRimBAsJC4JxVNQC3UUezmblAhM5/TIQsEBQTsbjAY8SeQKy6NHzW6iTiaD8w==}
'@push.rocks/smartrequest@4.3.1':
resolution: {integrity: sha512-H5FQSfFEbSJCHpE2A+SasQQcxM5FlxhHIUEzhUsSLjtlCTEu9T7Xb1WzVLFYvdWfyP5VIrg+XM4AMOols8cG+Q==}
'@push.rocks/smartrequest@4.3.2':
resolution: {integrity: sha512-Alms3xnC9gpXg8XOgsczwJxnXEjAEf6SDUk0/Ykw9OJJVkZIstWkoytGwJS/hByx70WtPENvq30zBqxI1Gl9rQ==}
'@push.rocks/smartrouter@1.3.3':
resolution: {integrity: sha512-1+xZEnWlhzqLWAaJ1zFNhQ0zgbfCWQl1DBT72LygLxTs+P0K8AwJKgqo/IX6CT55kGCFnPAZIYSbVJlGsgrB0w==}
@@ -3996,7 +3996,7 @@ snapshots:
'@push.rocks/smartopen': 2.0.0
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartpromise': 4.2.3
'@push.rocks/smartrequest': 4.3.1
'@push.rocks/smartrequest': 4.3.2
'@push.rocks/smartrx': 3.0.10
'@push.rocks/smartsitemap': 2.0.3
'@push.rocks/smartstream': 3.2.5
@@ -5203,7 +5203,7 @@ snapshots:
'@push.rocks/smartlog': 3.1.10
'@push.rocks/smartnpm': 2.0.6
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartrequest': 4.3.1
'@push.rocks/smartrequest': 4.3.2
'@push.rocks/smartshell': 3.3.0
transitivePeerDependencies:
- aws-crt
@@ -5511,7 +5511,7 @@ snapshots:
'@push.rocks/smartfile': 11.2.7
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartpromise': 4.2.3
'@push.rocks/smartrequest': 4.3.1
'@push.rocks/smartrequest': 4.3.2
'@push.rocks/smartrx': 3.0.10
'@push.rocks/smartstream': 3.2.5
'@push.rocks/smartunique': 3.0.9
@@ -5693,7 +5693,7 @@ snapshots:
'@push.rocks/smartmime': 2.0.4
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartpromise': 4.2.3
'@push.rocks/smartrequest': 4.3.1
'@push.rocks/smartrequest': 4.3.2
'@push.rocks/smartstream': 3.2.5
'@types/fs-extra': 11.0.4
'@types/js-yaml': 4.0.9
@@ -5820,7 +5820,7 @@ snapshots:
'@push.rocks/smartfile': 11.2.7
'@push.rocks/smartpath': 6.0.0
'@push.rocks/smartpromise': 4.2.3
'@push.rocks/smartrequest': 4.3.1
'@push.rocks/smartrequest': 4.3.2
'@push.rocks/smarttime': 4.1.1
'@push.rocks/smartversion': 3.0.5
package-json: 8.1.1
@@ -5902,7 +5902,7 @@ snapshots:
agentkeepalive: 4.6.0
form-data: 4.0.4
'@push.rocks/smartrequest@4.3.1':
'@push.rocks/smartrequest@4.3.2':
dependencies:
'@push.rocks/smartenv': 5.0.13
'@push.rocks/smartpath': 6.0.0

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tstest',
version: '2.5.2',
version: '2.6.2',
description: 'a test utility to run tests that match test/**/*.ts'
}

View File

@@ -32,7 +32,7 @@ export class BunRuntimeAdapter extends RuntimeAdapter {
*/
async checkAvailable(): Promise<RuntimeAvailability> {
try {
const result = await this.smartshellInstance.exec('bun --version', {
const result = await this.smartshellInstance.execSilent('bun --version', {
cwd: process.cwd(),
onError: () => {
// Ignore error
@@ -47,11 +47,11 @@ export class BunRuntimeAdapter extends RuntimeAdapter {
}
// Bun version is just the version number
const version = result.stdout.trim();
const version = `v${result.stdout.trim()}`;
return {
available: true,
version: `Bun ${version}`,
version: version,
};
} catch (error) {
return {

View File

@@ -37,7 +37,7 @@ export class ChromiumRuntimeAdapter extends RuntimeAdapter {
// The browser binary is usually handled by @push.rocks/smartbrowser
return {
available: true,
version: 'Chromium (via smartbrowser)',
version: 'via smartbrowser',
};
} catch (error) {
return {

View File

@@ -51,7 +51,7 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
*/
async checkAvailable(): Promise<RuntimeAvailability> {
try {
const result = await this.smartshellInstance.exec('deno --version', {
const result = await this.smartshellInstance.execSilent('deno --version', {
cwd: process.cwd(),
onError: () => {
// Ignore error
@@ -67,11 +67,11 @@ export class DenoRuntimeAdapter extends RuntimeAdapter {
// Parse Deno version from output (first line is "deno X.Y.Z")
const versionMatch = result.stdout.match(/deno (\d+\.\d+\.\d+)/);
const version = versionMatch ? versionMatch[1] : 'unknown';
const version = versionMatch ? `v${versionMatch[1]}` : 'unknown';
return {
available: true,
version: `Deno ${version}`,
version: version,
};
} catch (error) {
return {

View File

@@ -62,7 +62,19 @@ export class TsTest {
);
}
/**
* Check and display available runtimes
*/
private async checkEnvironment() {
const availability = await this.runtimeRegistry.checkAvailability();
this.logger.environmentCheck(availability);
return availability;
}
async run() {
// Check and display environment
await this.checkEnvironment();
// Move previous log files if --logfile option is used
if (this.logger.options.logFile) {
await this.movePreviousLogFiles();

View File

@@ -137,6 +137,43 @@ export class TsTestLogger {
this.log(this.format(` Found: ${count} test file(s)`, 'green'));
}
}
// Environment check - display available runtimes
environmentCheck(availability: Map<string, { available: boolean; version?: string; error?: string }>) {
if (this.options.json) {
const runtimes: any = {};
for (const [runtime, info] of availability) {
runtimes[runtime] = info;
}
this.logJson({ event: 'environmentCheck', runtimes });
return;
}
if (this.options.quiet) return;
this.log(this.format('\n🌍 Test Environment', 'bold'));
// Define runtime display names
const runtimeNames: Record<string, string> = {
node: 'Node.js',
deno: 'Deno',
bun: 'Bun',
chromium: 'Chrome/Chromium'
};
// Display each runtime
for (const [runtime, info] of availability) {
const displayName = runtimeNames[runtime] || runtime;
if (info.available) {
const versionStr = info.version ? ` ${info.version}` : '';
this.log(this.format(`${displayName}${versionStr}`, 'green'));
} else {
const errorStr = info.error ? ` (${info.error})` : '';
this.log(this.format(`${displayName}${errorStr}`, 'dim'));
}
}
}
// Test execution
testFileStart(filename: string, runtime: string, index: number, total: number) {