Skip to content

Commit

Permalink
[bgw-docs] Added bgw-net api endpoints to reference
Browse files Browse the repository at this point in the history
  • Loading branch information
smilefx authored Feb 28, 2025
1 parent 54efa7c commit b5335f7
Show file tree
Hide file tree
Showing 8 changed files with 385 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,4 @@ bgw-gui/src/jvmMain/kotlin/tools/aqua/bgw/application/Config.kt
bgw-docs/website/public/bgw/bgw-gui.js
bgw-docs/website/public/bgw/bgwSamples.json
bgw-docs/website/public/bgw/cleanedStructure.json
bgw-docs/build/
1 change: 1 addition & 0 deletions bgw-docs/parser/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules/
/example/
/output/
/build/
package-lock.json
14 changes: 11 additions & 3 deletions bgw-docs/parser/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const {

let rootDir = "./example/htmlPartial";

function loadPackageList() {
function loadPackageList(filename) {
const packageList = fs.readFileSync(
"./example/htmlPartial/package-list",
"./example/htmlPartial/" + filename,
"utf8"
);

Expand All @@ -23,7 +23,15 @@ function loadPackageList() {
return lines;
}

let validPackages = loadPackageList();
function loadAllPackages() {
const bgwGui = loadPackageList("package-list");
const bgwClient = loadPackageList("package-list-client");
const bgwCommon = loadPackageList("package-list-common");

return [...bgwGui, ...bgwClient, ...bgwCommon];
}

let validPackages = loadAllPackages();

function getDirectoryStructure(dir) {
let results = {};
Expand Down
25 changes: 24 additions & 1 deletion bgw-docs/parser/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ tasks.register("buildAndCopySamples") {
}

tasks.register("buildAndCopyDokkaHtml") {
dependsOn(":bgw-gui:dokkaHtmlPartial")
dependsOn(
rootProject.project(":bgw-gui").tasks.named("dokkaHtmlPartial"),
rootProject.project(":bgw-net:bgw-net-client").tasks.named("dokkaHtmlPartial"),
rootProject.project(":bgw-net:bgw-net-common").tasks.named("dokkaHtmlPartial"))
this.group = "build"
doLast {
val sourceDir = project(":bgw-gui").buildDir.resolve("dokka/htmlPartial")
Expand All @@ -86,6 +89,26 @@ tasks.register("buildAndCopyDokkaHtml") {
from(sourceDir)
into(destinationDir)
}

val sourceDir2 =
rootProject.project(":bgw-net:bgw-net-client").buildDir.resolve("dokka/htmlPartial")
val destinationDir2 = projectDir.resolve("example/htmlPartial")
println("Copying files from $sourceDir2 to $destinationDir2")
copy {
from(sourceDir2)
into(destinationDir2)
rename("package-list", "package-list-client")
}

val sourceDir3 =
rootProject.project(":bgw-net:bgw-net-common").buildDir.resolve("dokka/htmlPartial")
val destinationDir3 = projectDir.resolve("example/htmlPartial")
println("Copying files from $sourceDir3 to $destinationDir3")
copy {
from(sourceDir3)
into(destinationDir3)
rename("package-list", "package-list-common")
}
}
}

Expand Down
68 changes: 68 additions & 0 deletions bgw-docs/website/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,98 +334,166 @@ export const layoutMap = {
description: "Animations are a powerful tool to bring your app to life.",
icon: "motion_play",
package: "tools.aqua.bgw.animation",
module: "bgw-gui",
},
components: {
title: "Components",
description: "Components are the building blocks of your BGW app.",
icon: "shapes",
package: "tools.aqua.bgw.components",
module: "bgw-gui",
},
container: {
title: "Container",
description:
"Containers are used to layout and align your game components.",
icon: "stacks",
package: "tools.aqua.bgw.components.container",
module: "bgw-gui",
},
gamecomponentviews: {
title: "GameComponentViews",
description: "GameComponentViews are used to display your game components.",
icon: "playing_cards",
package: "tools.aqua.bgw.components.gamecomponentviews",
module: "bgw-gui",
},
layoutviews: {
title: "LayoutViews",
description: "LayoutViews are used to layout and align your ui components.",
icon: "view_carousel",
package: "tools.aqua.bgw.components.layoutviews",
module: "bgw-gui",
},
uicomponents: {
title: "UIComponents",
description: "UIComponents are used to build your UI.",
icon: "buttons_alt",
package: "tools.aqua.bgw.components.uicomponents",
module: "bgw-gui",
},
core: {
title: "Core",
description: "Includes core classes, functions and constants.",
icon: "token",
package: "tools.aqua.bgw.core",
module: "bgw-gui",
},
dialog: {
title: "Dialog",
description: "Dialogs are popups that can be used to display information.",
icon: "wysiwyg",
package: "tools.aqua.bgw.dialog",
module: "bgw-gui",
},
event: {
title: "Event",
description: "Events are used to handle user interactions.",
icon: "web_traffic",
package: "tools.aqua.bgw.event",
module: "bgw-gui",
},
io: {
title: "IO",
description: "IO classes are used to read and write files.",
icon: "save",
package: "tools.aqua.bgw.io",
module: "bgw-gui",
},
observable: {
title: "Observable",
description: "Observables are used to listen for changes in your data.",
icon: "visibility",
package: "tools.aqua.bgw.observable",
module: "bgw-gui",
},
lists: {
title: "Lists",
description:
"Observable lists are used to store data as a list and observe changes.",
icon: "format_list_numbered",
package: "tools.aqua.bgw.observable.lists",
module: "bgw-gui",
},
properties: {
title: "Properties",
description: "Properties are used to store data and observe changes.",
icon: "123",
package: "tools.aqua.bgw.observable.properties",
module: "bgw-gui",
},
style: {
title: "Style",
description: "Style classes are used to style your components.",
icon: "style",
package: "tools.aqua.bgw.style",
module: "bgw-gui",
},
util: {
title: "Util",
description: "Util classes are used to perform common tasks.",
icon: "function",
package: "tools.aqua.bgw.util",
module: "bgw-gui",
},
visual: {
title: "Visual",
description: "Visual classes are used to give your components color.",
icon: "colors",
package: "tools.aqua.bgw.visual",
module: "bgw-gui",
},
annotations: {
title: "Annotations",
description:
"Network annotations are used to annotate network message receivers.",
icon: "alternate_email",
package: "tools.aqua.bgw.net.common.annotations",
module: "bgw-net",
},
client: {
title: "Client",
description: "The client is used to communicate with the BGW-Net server.",
icon: "cast",
package: "tools.aqua.bgw.net.client",
module: "bgw-net",
},
common: {
title: "Common",
description: "Common classes are used to define network messages.",
icon: "device_hub",
package: "tools.aqua.bgw.net.common",
module: "bgw-net",
},
message: {
title: "Message",
description:
"Messages are used to send custom game messages between clients.",
icon: "message",
package: "tools.aqua.bgw.net.common.message",
module: "bgw-net",
},
notification: {
title: "Notification",
description: "Notifications are used to send alerts between clients.",
icon: "mark_chat_unread",
package: "tools.aqua.bgw.net.common.notification",
module: "bgw-net",
},
request: {
title: "Request",
description:
"Requests are used to send predefined framework messages to clients.",
icon: "keyboard_double_arrow_right",
package: "tools.aqua.bgw.net.common.request",
module: "bgw-net",
},
response: {
title: "Response",
description: "Responses are used to receive data from clients.",
icon: "keyboard_double_arrow_left",
package: "tools.aqua.bgw.net.common.response",
module: "bgw-net",
},
};

Expand Down
Loading

0 comments on commit b5335f7

Please sign in to comment.