mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Add deploy button
This commit is contained in:
1 parent
acde35632a
commit
895653fae3
5 files changed
+82
-18
No files matched your search
+15
-1
@@ -14,7 +14,7 @@ export interface JSRuntime {
|
||||
* @param options Spawn options
|
||||
* @returns Process handle
|
||||
*/
|
||||
spawn(command: string, args?: string[], options?: Record<string, unknown>): Promise<JSRuntimeChildProcess>;
|
||||
spawn(command: string, args?: string[], options?: SpawnOptions): Promise<JSRuntimeChildProcess>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,4 +87,18 @@ export interface JSRuntimeChildProcess {
|
||||
* Kills the process.
|
||||
*/
|
||||
kill(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that control process spawning.
|
||||
*/
|
||||
export interface SpawnOptions {
|
||||
/**
|
||||
* Current working directory for the process, relative to the workdir of this instance.
|
||||
*/
|
||||
cwd?: string;
|
||||
/**
|
||||
* Environment variables to set for the process.
|
||||
*/
|
||||
env?: Record<string, string | number | boolean>;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WebContainer } from '@webcontainer/api';
|
||||
import type { JSRuntime, JSRuntimeFS, JSRuntimeChildProcess, DirectoryEntry } from './JSRuntime';
|
||||
import type { JSRuntime, JSRuntimeFS, JSRuntimeChildProcess, DirectoryEntry, SpawnOptions } from './JSRuntime';
|
||||
|
||||
/**
|
||||
* WebContainer adapter that implements the JSRuntime interface
|
||||
@@ -36,7 +36,7 @@ export class WebContainerAdapter implements JSRuntime {
|
||||
* Spawn a process in the WebContainer
|
||||
* Automatically boots the container on first call
|
||||
*/
|
||||
async spawn(command: string, args: string[] = [], options: Record<string, unknown> = {}): Promise<JSRuntimeChildProcess> {
|
||||
async spawn(command: string, args: string[] = [], options: SpawnOptions = {}): Promise<JSRuntimeChildProcess> {
|
||||
const webcontainer = await this.ensureBooted();
|
||||
return webcontainer.spawn(command, args, options);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user