This repository has been archived by the owner on Dec 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toolchain): dispatch backend config update events
- Loading branch information
1 parent
871122d
commit 1dea393
Showing
6 changed files
with
235 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { z } from "zod"; | ||
import { globalOptsSchema, initProject } from "../../common.ts"; | ||
import { metaPath } from "../../../toolchain/project/mod.ts"; | ||
|
||
export const optsSchema = z.object({}).merge(globalOptsSchema); | ||
|
||
type Opts = z.infer<typeof optsSchema>; | ||
|
||
export async function execute(opts: Opts) { | ||
const project = await initProject(opts); | ||
console.log(metaPath(project)); | ||
} |
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 +1,32 @@ | ||
use serde::Serialize; | ||
|
||
#[derive(Serialize)] | ||
pub enum TaskEvent { | ||
#[serde(rename = "log")] | ||
Log(String), | ||
#[serde(rename = "result")] | ||
Result { | ||
result: Box<serde_json::value::RawValue>, | ||
}, | ||
#[serde(rename = "port_update")] | ||
PortUpdate { backend_port: u16, editor_port: u16 }, | ||
#[serde(rename = "backend_config_update")] | ||
BackendConfigUpdate(backend_config_update::Event), | ||
} | ||
|
||
pub mod backend_config_update { | ||
use serde::Serialize; | ||
|
||
#[derive(Serialize)] | ||
pub struct Event { | ||
pub modules: Vec<Module>, | ||
} | ||
|
||
#[derive(Serialize)] | ||
pub struct Module { | ||
pub slug: String, | ||
pub name: String, | ||
pub config_url: String, | ||
pub docs_url: 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,9 +1,11 @@ | ||
mod ctx; | ||
pub mod event; | ||
mod register; | ||
mod run; | ||
mod task; | ||
|
||
pub use ctx::*; | ||
pub use event::*; | ||
pub use register::*; | ||
pub use run::*; | ||
pub use task::*; |