Skip to content

Commit 4f1955c

Browse files
refactor(Sky): Extract Wind bootstrapping logic into dedicated component
This commit refactors the `Sky` UI layer by extracting the Wind service layer initialization and VSCode workbench loading logic from `Application.astro` into a new, dedicated `Source/Workbench/Wind.astro` component. The new `Wind` component encapsulates the `Install` and `bootstrap` calls to the `@codeeditorland/wind` package, managing the bridge between the `Sky` UI and the Effect-TS based `Wind` services. It also handles the inclusion of the `workbench.js` script. Additionally, this change deprecates and removes the `WindIntegration.astro` file in favor of the new component structure. The `Application.astro` template is now simplified to conditionally render `<WindWorkbench />`, utilizing Astro's `define:vars` directive to pass the environment configuration cleanly.
1 parent a92bda4 commit 4f1955c

3 files changed

Lines changed: 57 additions & 554 deletions

File tree

Source/Workbench/Wind.astro

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
export const { On } = Astro.props;
3+
---
4+
5+
<!-- Wind Preload Script -->
6+
<script is:inline type="module" defer>
7+
import { Install } from "@codeeditorland/wind";
8+
9+
Install({ Configuration });
10+
</script>
11+
12+
<!-- Wind Bootstrap Script (Atomic) -->
13+
<script is:inline type="module" defer define:vars={{ On }}>
14+
import { bootstrap } from "@codeeditorland/wind/Bootstrap";
15+
16+
console.log("[Sky] Starting atomic bootstrap...");
17+
18+
bootstrap({
19+
debugMode: On,
20+
verboseLogging: On,
21+
showStatusUI: true,
22+
pauseBetweenStages: On,
23+
enablePerformanceTracking: true,
24+
})
25+
.then((result) => {
26+
console.log("[Sky] Bootstrap completed:", result.success);
27+
28+
if (result.success) {
29+
console.log("[Sky] All stages completed successfully");
30+
console.log(
31+
"[Sky] Total duration:",
32+
result.totalDuration.toFixed(0),
33+
"ms",
34+
);
35+
} else {
36+
console.error("[Sky] Bootstrap failed");
37+
}
38+
})
39+
.catch((error) => {
40+
console.error("[Sky] Fatal bootstrap error:", error);
41+
});
42+
</script>
43+
44+
<!-- VSCode Workbench Script -->
45+
<script
46+
is:inline
47+
type="module"
48+
src={Bust(
49+
"/Static/Application/vs/code/electron-browser/workbench/workbench.js",
50+
)}
51+
defer></script>

0 commit comments

Comments
 (0)