Skip to content

Commit 8a44472

Browse files
refactor(Build): Centralize keyboard layout path and optimize prefetch
- Introduced `KeyboardLayouts` constant to consolidate repeated path segments related to VS Code keyboard layout resources - Updated asset copy configurations in Astro build to use centralized constant, improving maintainability - Enabled full prefetching with viewport strategy in Astro config to optimize frontend asset loading for Sky UI - Added TypeScript exception comments for expected build-time type checks This refactoring supports Land's goal of maintaining a clean build configuration while reusing VS Code UI components. Centralizing path strings reduces error risk during future VS Code version updates in the Sky frontend. The prefetch optimization aligns with Land's performance focus by preloading keyboard layout resources critical for editor responsiveness. Refs #123
1 parent 1150e37 commit 8a44472

49 files changed

Lines changed: 51 additions & 771175 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Target/.vite/manifest.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

Target/Application/index.html

Lines changed: 1 addition & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1 @@
1-
<!DOCTYPE html>
2-
<html lang="en" class="no-js" dir="ltr">
3-
<head>
4-
<script type="module">document.documentElement.classList.remove("no-js");
5-
document.documentElement.classList.add("js");
6-
//# sourceMappingURL=Base.astro_astro_type_script_index_0_lang.DEh2XoS4.js.map</script>
7-
8-
<title>FIDDEE</title>
9-
10-
<meta charset="utf-8">
11-
<meta name="description" content>
12-
13-
<meta name="mobile-web-app-capable" content="yes">
14-
<meta name="apple-mobile-web-app-capable" content="yes">
15-
<meta name="apple-mobile-web-app-title" content="FIDDEE">
16-
17-
<!-- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" /> -->
18-
19-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
20-
<meta name="theme-color" content="#ffffff">
21-
<meta name="format-detection" content="telephone=no">
22-
<meta name="twitter:dnt" content="on">
23-
24-
<meta http-equiv="Content-Security-Policy" content="
25-
default-src
26-
'none'
27-
;
28-
29-
img-src
30-
'self'
31-
data:
32-
blob:
33-
vscode-remote-resource:
34-
vscode-managed-remote-resource:
35-
https:
36-
;
37-
38-
manifest-src
39-
'self'
40-
;
41-
42-
media-src
43-
'self'
44-
;
45-
46-
frame-src
47-
'self'
48-
vscode-webview:
49-
;
50-
51-
script-src
52-
'self'
53-
'unsafe-inline'
54-
'unsafe-eval'
55-
blob:
56-
;
57-
58-
style-src
59-
'self'
60-
'unsafe-inline'
61-
;
62-
63-
connect-src
64-
'self'
65-
wss://tauri.localhost
66-
https:
67-
;
68-
69-
font-src
70-
'self'
71-
vscode-remote-resource:
72-
vscode-managed-remote-resource:
73-
;
74-
75-
block-all-mixed-content
76-
;
77-
78-
upgrade-insecure-requests
79-
;
80-
81-
require-trusted-types-for
82-
'script'
83-
;
84-
85-
trusted-types
86-
WorkerApplication
87-
amdLoader
88-
cellRendererEditorText
89-
defaultWorkerFactory
90-
diffEditorWidget
91-
diffReview
92-
domLineBreaksComputer
93-
dompurify
94-
editorGhostText
95-
editorViewLayer
96-
notebookRenderer
97-
stickyScrollViewLayer
98-
tokenizeToString
99-
notebookChatEditController
100-
;
101-
"><meta id="vscode-workbench-web-configuration" data-settings="{&#34;remoteAuthority&#34;:&#34;&#34;,&#34;serverBasePath&#34;:&#34;/&#34;,&#34;connectionToken&#34;:&#34;&#34;,&#34;enableWorkspaceTrust&#34;:true,&#34;settingsSyncOptions&#34;:{&#34;enabled&#34;:false},&#34;productConfiguration&#34;:{&#34;embedderIdentifier&#34;:&#34;desktop&#34;,&#34;nameShort&#34;:&#34;FIDDEE&#34;,&#34;nameLong&#34;:&#34;FIDDEE&#34;,&#34;applicationName&#34;:&#34;fiddee&#34;},&#34;developmentOptions&#34;:{&#34;logLevel&#34;:2,&#34;enableSmokeTestDriver&#34;:true}}"><meta id="vscode-workbench-auth-session" data-settings="{}">
102-
103-
<link rel="manifest" href="/Manifest.json" crossorigin="use-credentials">
104-
105-
<script type="module">const Site = "https://tauri.localhost/";
106-
107-
// @ts-expect-error
108-
globalThis._VSCODE_FILE_ROOT = `${Site}/Static/Application/`;
109-
</script><script type="module">const Worker = "/Worker.js?BASE_REMOTE=https%3A%2F%2Ftauri.localhost%2F&Time=1746699413502";
110-
111-
// @ts-expect-error
112-
window._WORKER = Worker;
113-
</script>
114-
<link rel="stylesheet" href="/_astro/Browser.JL5CMxyc.css"></head>
115-
<body aria-label="">
116-
117-
118-
119-
120-
121-
122-
123-
124-
125-
126-
127-
128-
<script type="module" src="/_astro/Application.astro_astro_type_script_index_0_lang.Bsj3F86A.js"></script>
129-
130-
<script type="module" src="/_astro/Browser.astro_astro_type_script_index_0_lang.Bker8ZTw.js"></script>
131-
</body></html>
1+
<!DOCTYPE html><html class=no-js data-beasties-container dir=ltr lang=en><head><script type=module>document.documentElement.classList.remove("no-js"),document.documentElement.classList.add("js")</script><title>FIDDEE</title><meta charset=utf-8><meta content name=description><meta content=yes name=mobile-web-app-capable><meta content=yes name=apple-mobile-web-app-capable><meta content=FIDDEE name=apple-mobile-web-app-title><meta content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" name=viewport><meta content=#ffffff name=theme-color><meta content="telephone=no" name=format-detection><meta content=on name=twitter:dnt><meta content=" default-src 'none' ; img-src 'self' data: blob: vscode-remote-resource: vscode-managed-remote-resource: https: ; manifest-src 'self' ; media-src 'self' ; frame-src 'self' vscode-webview: ; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: ; style-src 'self' 'unsafe-inline' ; connect-src 'self' wss://tauri.localhost https: ; font-src 'self' vscode-remote-resource: vscode-managed-remote-resource: ; block-all-mixed-content ; upgrade-insecure-requests ; require-trusted-types-for 'script' ; trusted-types WorkerApplication amdLoader cellRendererEditorText defaultWorkerFactory diffEditorWidget diffReview domLineBreaksComputer dompurify editorGhostText editorViewLayer notebookRenderer stickyScrollViewLayer tokenizeToString notebookChatEditController ; " http-equiv=Content-Security-Policy><meta data-settings={&#34;remoteAuthority&#34;:&#34;&#34;,&#34;serverBasePath&#34;:&#34;/&#34;,&#34;connectionToken&#34;:&#34;&#34;,&#34;enableWorkspaceTrust&#34;:true,&#34;settingsSyncOptions&#34;:{&#34;enabled&#34;:false},&#34;productConfiguration&#34;:{&#34;embedderIdentifier&#34;:&#34;desktop&#34;,&#34;nameShort&#34;:&#34;FIDDEE&#34;,&#34;nameLong&#34;:&#34;FIDDEE&#34;,&#34;applicationName&#34;:&#34;fiddee&#34;},&#34;developmentOptions&#34;:{&#34;logLevel&#34;:0,&#34;enableSmokeTestDriver&#34;:false}} id=vscode-workbench-web-configuration><meta data-settings={} id=vscode-workbench-auth-session><link href=/Manifest.json rel=manifest crossorigin=use-credentials><script type=module>const Site="https://tauri.localhost/";globalThis._VSCODE_FILE_ROOT=`${Site}/Static/Application/`</script><script type=module>const Worker="/Worker.js?BASE_REMOTE=https%3A%2F%2Ftauri.localhost%2F&Time=1746700691533";window._WORKER=Worker</script><style>:root{--vscode-sash-size:4px;--vscode-sash-hover-size:4px}@property --chat-editing-last-edit-shift{syntax:"<percentage>";initial-value:100%;inherits:false}@property --inline-chat-frame-progress{syntax:"<percentage>";initial-value:0%;inherits:false}body{height:100%;width:100%;margin:0;padding:0;overflow:hidden;font-size:11px;user-select:none;-webkit-user-select:none}</style><link href=/_astro/Browser.CRM72xFj.css rel=stylesheet media=print onload="this.media=&#34;all&#34;"><noscript><link href=/_astro/Browser.CRM72xFj.css rel=stylesheet></noscript><script type=module src=/_astro/page.D5PnSXWY.js></script></head><body aria-label><script type=module>window._LOAD_CSS_WORKER=e=>{const r=e+(e.includes("?")?"&":"?")+"Skip=Intercept";try{if(document.querySelector(`link[href="${r}"]`))return;const e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=r,e.onerror=r=>{e.remove()},e.onload=()=>{},document.head.appendChild(e)}catch{}},(()=>{if(window._POLICY_WORKER=window._POLICY_WORKER||{},window.trustedTypes&&window.trustedTypes.createPolicy&&!window._POLICY_WORKER.WorkerApplication)try{window._POLICY_WORKER.WorkerApplication=window.trustedTypes.createPolicy("WorkerApplication",{createScriptURL:e=>{if(e&&/^\/[^/\\:]+\.js(\?.*)?$/.test(e))return e;throw new TypeError(`Invalid URL format for service worker script: ${e}`)}})}catch(e){e instanceof TypeError&&e.message.includes("already exists")}})();const s="string"==typeof window._WORKER?window._WORKER:"/Worker.js",e="WorkerReload";if("serviceWorker"in navigator){navigator.serviceWorker.addEventListener("controllerchange",(()=>{"true"===sessionStorage.getItem(e)&&(sessionStorage.removeItem(e),window.location.reload())})),navigator.serviceWorker.addEventListener("message",(e=>{"New"===e.data?.Version&&window.location.reload()}));const r=async()=>{const r=!!navigator.serviceWorker.controller;try{let t;if(window.trustedTypes)try{const e=window._POLICY_WORKER?.WorkerApplication;if(!e)throw new Error("Required Trusted Types policy 'WorkerApplication' not found. Ensure Policy.js executes first and succeeds.");t=e.createScriptURL(s)}catch(e){throw e}else t=s;const o=await navigator.serviceWorker.register(t,{scope:"/Application",type:"module"});o.installing||o.waiting||o.active,await navigator.serviceWorker.ready;const i=!!navigator.serviceWorker.controller;if(r||i)sessionStorage.getItem(e)&&sessionStorage.removeItem(e);else{if(!sessionStorage.getItem(e))return sessionStorage.setItem(e,"true"),void window.location.reload();sessionStorage.removeItem(e)}}catch(r){r instanceof TypeError&&(r.message.includes("TrustedScriptURL")||r.message.includes("Trusted Type")),sessionStorage.removeItem(e)}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}</script><script type=module src=/_astro/Browser.astro_astro_type_script_index_0_lang.BZmB-OSp.js></script></body></html>

Target/Isolation/index.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>Isolation Secure Script</title>
6-
</head>
7-
<body>
8-
<script type="module">window.__TAURI_ISOLATION_HOOK__ = (payload) => {
9-
console.log("hook", payload);
10-
return payload;
11-
};
12-
//# sourceMappingURL=Isolation.astro_astro_type_script_index_0_lang.Cd0588Je.js.map</script>
13-
</body>
14-
</html>
1+
<!DOCTYPE html><html data-beasties-container lang=en><head><meta charset=UTF-8><title>Isolation Secure Script</title><script type=module src=/_astro/page.D5PnSXWY.js></script></head><body><script type=module>window.__TAURI_ISOLATION_HOOK__=_=>_</script></body></html>

Target/Manifest.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
{
2-
"background_color": "#ffffff",
3-
"categories": [],
4-
"display": "minimal-ui",
5-
"name": "Land",
6-
"orientation": "landscape",
7-
"short_name": "land",
8-
"start_url": "/",
9-
"theme_color": "#ffffff"
10-
}
1+
{"background_color":"#ffffff","categories":[],"display":"minimal-ui","name":"Land","orientation":"landscape","short_name":"land","start_url":"/","theme_color":"#ffffff"}

Target/Static/Application/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js

Lines changed: 1 addition & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)