-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: ESM support and use of built-in dependencies
Release-As: 2.0.0
- Loading branch information
Showing
172 changed files
with
2,095 additions
and
1,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
export class DebugServerError extends Error { | ||
public readonly cmd: string; | ||
public readonly args: string[]; | ||
public readonly command: string; | ||
public readonly output: string; | ||
|
||
constructor(options: { cmd: string; args: string[]; output: string }) { | ||
super(`Command "${options.cmd}" failed: ${options.output}`); | ||
constructor(options: { command: string; output: string }) { | ||
super(`Command "${options.command}" failed with output: ${options.output}`); | ||
this.name = 'DebugServerError'; | ||
this.cmd = options.cmd; | ||
this.args = options.args || []; | ||
this.command = options.command; | ||
this.output = options.output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface DebugServerExecutorOptions { | ||
signal?: AbortSignal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export interface Executor<Config> { | ||
execute(command: string, args: string[], config?: Config): Promise<string>; | ||
export interface Executor<Config = {}> { | ||
execute(command: string, config?: Config): Promise<string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import type { Executor } from '../Executor.js'; | ||
import { execute, type Config } from '../internal/execute.js'; | ||
import type { Executor } from '../Executor.ts'; | ||
import { execute } from '../internal/execute.js'; | ||
import type { Config } from '../internal/types.d.ts'; | ||
|
||
const pattern = /Done/; | ||
|
||
/** | ||
* Clear all caches that can affect channel launch time. | ||
*/ | ||
export async function clearLaunchCaches<Context extends Executor<{}>>( | ||
export async function clearLaunchCaches<Context extends Executor>( | ||
ctx: Context, | ||
config?: Config<Context> | ||
): Promise<void> { | ||
await execute(ctx, 'clear_launch_caches', [], [pattern], config); | ||
await execute(ctx, 'clear_launch_caches', [pattern], config); | ||
} |
9 changes: 5 additions & 4 deletions
9
packages/debug-server/src/commands/clearSceneGraphPerformanceMetrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import type { Executor } from '../Executor.js'; | ||
import { execute, type Config } from '../internal/execute.js'; | ||
import type { Executor } from '../Executor.ts'; | ||
import { execute } from '../internal/execute.js'; | ||
import type { Config } from '../internal/types.d.ts'; | ||
|
||
const pattern = /^\s*$/; | ||
|
||
/** | ||
* Clear SceneGraph node operation performance metrics. | ||
*/ | ||
export async function clearSceneGraphPerformanceMetrics< | ||
Context extends Executor<{}> | ||
Context extends Executor | ||
>(ctx: Context, config?: Config<Context>): Promise<void> { | ||
await execute(ctx, 'sgperf', ['clear'], [pattern], config); | ||
await execute(ctx, 'sgperf clear', [pattern], config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
packages/debug-server/src/commands/disableRendezvousLogging.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import type { Executor } from '../Executor.js'; | ||
import { execute, type Config } from '../internal/execute.js'; | ||
import type { Executor } from '../Executor.ts'; | ||
import { execute } from '../internal/execute.js'; | ||
import type { Config } from '../internal/types.d.ts'; | ||
|
||
const pattern = /rendezvous logging is off/; | ||
|
||
/** | ||
* Disable rendezvous logging. | ||
*/ | ||
export async function disableRendezvousLogging<Context extends Executor<{}>>( | ||
export async function disableRendezvousLogging<Context extends Executor>( | ||
ctx: Context, | ||
config?: Config<Context> | ||
): Promise<void> { | ||
await execute(ctx, 'logrendezvous', ['off'], [pattern], config); | ||
await execute(ctx, 'logrendezvous off', [pattern], config); | ||
} |
9 changes: 5 additions & 4 deletions
9
packages/debug-server/src/commands/enableRendezvousLogging.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import type { Executor } from '../Executor.js'; | ||
import { execute, type Config } from '../internal/execute.js'; | ||
import type { Executor } from '../Executor.ts'; | ||
import { execute } from '../internal/execute.js'; | ||
import type { Config } from '../internal/types.d.ts'; | ||
|
||
const pattern = /rendezvous logging is on/; | ||
|
||
/** | ||
* Enable rendezvous logging. | ||
*/ | ||
export async function enableRendezvousLogging<Context extends Executor<{}>>( | ||
export async function enableRendezvousLogging<Context extends Executor>( | ||
ctx: Context, | ||
config?: Config<Context> | ||
): Promise<void> { | ||
await execute(ctx, 'logrendezvous', ['on'], [pattern], config); | ||
await execute(ctx, 'logrendezvous on', [pattern], config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import type { Executor } from '../Executor.js'; | ||
import { execute, type Config } from '../internal/execute.js'; | ||
import type { Executor } from '../Executor.ts'; | ||
import { execute } from '../internal/execute.js'; | ||
import type { Config } from '../internal/types.d.ts'; | ||
|
||
const pattern = /Dev ID: (.+)/; | ||
|
||
/** | ||
* Returns current developer key. | ||
*/ | ||
export async function getDeveloperKey<Context extends Executor<{}>>( | ||
export async function getDeveloperKey<Context extends Executor>( | ||
ctx: Context, | ||
config?: Config<Context> | ||
): Promise<string> { | ||
const [[result]] = await execute(ctx, 'showkey', [], [pattern], config); | ||
const [[result]] = await execute(ctx, 'showkey', [pattern], config); | ||
return result[1]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.