Skip to content

Commit

Permalink
Merge pull request #34 from BrowserSync/not-found
Browse files Browse the repository at this point in the history
not found handler
  • Loading branch information
shakyShane authored Oct 11, 2024
2 parents ea7eb2d + 36b390f commit 9c40129
Show file tree
Hide file tree
Showing 46 changed files with 883 additions and 679 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ workspace.resolver = "2"
[workspace.dependencies]
clap = { version = "4.5.3", features = ["derive"] }
axum = { version = "0.7.5", features = ["ws"] }
matchit = { version = "0.7.3" }
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
futures = "0.3.30"
Expand All @@ -31,3 +32,4 @@ toml = { version = "0.8.12" }
mime_guess = "2.0.4"
tempfile = "3.10.1"
insta = { version = "1.38.0", features = ["yaml"] }
miette = { version = "7.2.0", features = ["fancy", "syntect-highlighter"] }
58 changes: 25 additions & 33 deletions crates/bsnext_client/generated/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,19 @@ export interface ServerDTO {
socket_addr: string;
}

export interface GetServersMessageResponse {
export interface GetServersMessageResponseDTO {
servers: ServerDTO[];
}

export interface ServersChanged {
servers_resp: GetServersMessageResponse;
export interface ServersChangedDTO {
servers_resp: GetServersMessageResponseDTO;
}

export enum EventLevel {
External = "BSLIVE_EXTERNAL",
}

export type ExternalEvents =
| { kind: "ServersChanged", payload: ServersChanged }
| { kind: "Watching", payload: Watching }
| { kind: "WatchingStopped", payload: StoppedWatching }
| { kind: "FileChanged", payload: FileChanged }
| { kind: "FilesChanged", payload: FilesChangedDTO }
| { kind: "InputFileChanged", payload: FileChanged }
| { kind: "InputAccepted", payload: InputAccepted }
| { kind: "InputError", payload: InputErrorDTO };

export interface ExternalEvent {
level: EventLevel;
fields: ExternalEvents;
}

export interface InputAccepted {
export interface InputAcceptedDTO {
path: string;
}

export interface FileChanged {
export interface FileChangedDTO {
path: string;
}

Expand All @@ -95,12 +76,12 @@ export interface DebounceDTO {
ms: string;
}

export interface Watching {
export interface WatchingDTO {
paths: string[];
debounce: DebounceDTO;
}

export interface StoppedWatching {
export interface StoppedWatchingDTO {
paths: string[];
}

Expand Down Expand Up @@ -139,14 +120,24 @@ export interface ClientConfigDTO {
* todo(alpha): clean this up
*/
export type InternalEventsDTO =
| { kind: "ServersChanged", payload: GetServersMessageResponse };
| { kind: "ServersChanged", payload: GetServersMessageResponseDTO };

export type StartupEvent =
| { kind: "Started", payload?: undefined }
| { kind: "FailedStartup", payload: StartupErrorDTO };
export enum EventLevel {
External = "BSLIVE_EXTERNAL",
}

export type StartupErrorDTO =
| { kind: "InputError", payload: InputErrorDTO };
export type ExternalEventsDTO =
| { kind: "ServersChanged", payload: ServersChangedDTO }
| { kind: "Watching", payload: WatchingDTO }
| { kind: "WatchingStopped", payload: StoppedWatchingDTO }
| { kind: "FileChanged", payload: FileChangedDTO }
| { kind: "FilesChanged", payload: FilesChangedDTO }
| { kind: "InputFileChanged", payload: FileChangedDTO }
| { kind: "InputAccepted", payload: InputAcceptedDTO };

export type StartupEventDTO =
| { kind: "Started", payload?: undefined }
| { kind: "FailedStartup", payload: string };

export type InputErrorDTO =
| { kind: "MissingInputs", payload: string }
Expand All @@ -161,7 +152,8 @@ export type InputErrorDTO =
| { kind: "Io", payload: string }
| { kind: "UnsupportedExtension", payload: string }
| { kind: "MissingExtension", payload: string }
| { kind: "EmptyInput", payload: string };
| { kind: "EmptyInput", payload: string }
| { kind: "BsLiveRules", payload: string };

export type ClientEvent =
| { kind: "Change", payload: ChangeDTO }
Expand Down
Loading

0 comments on commit 9c40129

Please sign in to comment.