Skip to content

Commit 5619612

Browse files
feat(Sky): Add VS Code terminal and language detection node_modules
Add @xterm/xterm with all addon packages and @vscode/vscode-languagedetection to dependencies. Update the astro.config.ts build step to copy these node_modules to Static/Application/node_modules/ for runtime access. These packages are required for VS Code's terminal emulation and language detection functionality, enabling the editor to provide full VS Code feature parity.
1 parent 4f5bc5e commit 5619612

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

astro.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,46 @@ export default defineConfig({
481481
}
482482
}
483483

484+
// Step 7: Copy @xterm and other VS Code node_modules
485+
// VS Code's importAMDNodeModule loads from
486+
// /Static/Application/node_modules/@xterm/xterm/lib/xterm.js
487+
const NodeModulesToCopy = [
488+
"@xterm/xterm",
489+
"@xterm/addon-clipboard",
490+
"@xterm/addon-image",
491+
"@xterm/addon-ligatures",
492+
"@xterm/addon-progress",
493+
"@xterm/addon-search",
494+
"@xterm/addon-serialize",
495+
"@xterm/addon-unicode11",
496+
"@xterm/addon-webgl",
497+
"@vscode/vscode-languagedetection",
498+
"vscode-regexp-languagedetection",
499+
];
500+
501+
for (const Pkg of NodeModulesToCopy) {
502+
const Source = resolve(
503+
process.cwd(),
504+
"node_modules",
505+
Pkg,
506+
);
507+
const Destination = join(
508+
TargetDir,
509+
"Static/Application/node_modules",
510+
Pkg,
511+
);
512+
try {
513+
await cp(Source, Destination, {
514+
recursive: true,
515+
});
516+
} catch {
517+
// Package not installed — skip silently
518+
}
519+
}
520+
console.log(
521+
"[CopyVSCode] Step 7: Copied node_modules for terminal + language detection",
522+
);
523+
484524
console.log("[CopyVSCode] ✓ Assets ready in Target/");
485525
},
486526
},

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"@playform/build": "0.3.1",
3636
"@playform/compress": "0.2.3",
3737
"@playform/inline": "0.1.4",
38+
"@vscode/vscode-languagedetection": "^1.0.23",
39+
"@xterm/xterm": "6.1.0-beta.196",
3840
"astro": "6.1.5",
3941
"deepmerge-ts": "7.1.5",
4042
"dotenv": "17.4.1",

0 commit comments

Comments
 (0)