mirror of
https://github.com/coder/code-server.git
synced 2026-04-13 03:05:50 -05:00
Update Code to 1.94.2 (#7026)
* Update Code to 1.94.2 * Convert from yarn to npm This is to match VS Code. We were already partially using npm for the releases so this is some nice alignment. * Update caniuse-lite This was complaining on every unit test. * Update eslint I was having a bunch of dependency conflicts and eslint seemed to be the culprit so I just removed it and set it up again, since it seems things have changed quite a bit. * Update test dependencies I was getting oom when running the unit tests...updating seems to work. * Remove package.json `scripts` property in release The new pre-install script was being included, which is dev-only. This was always the intent; did not realize jq's merge was recursive. * Remove jest and devDependencies in release as well * Update test extension dependencies This appears to be conflicting with the root dependencies. * Fix playwright exec npm does not let you run binaries like yarn does, as far as I know. * Fix import of server-main.js * Fix several tests by waiting for selectors
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
self.addEventListener("install", () => {
|
||||
console.debug("[Service Worker] installed")
|
||||
})
|
||||
|
||||
@@ -41,19 +41,25 @@ export interface IVSCodeServerAPI {
|
||||
*/
|
||||
export type VSCodeModule = {
|
||||
// See ../../../lib/vscode/src/server-main.js:339.
|
||||
loadCodeWithNls(): {
|
||||
loadCodeWithNls(): Promise<{
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
createServer(address: string | net.AddressInfo | null, args: CodeArgs): Promise<IVSCodeServerAPI>
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
||||
spawnCli(args: CodeArgs): Promise<void>
|
||||
}
|
||||
}>
|
||||
}
|
||||
|
||||
/**
|
||||
* Load then create the VS Code server.
|
||||
*/
|
||||
async function loadVSCode(req: express.Request): Promise<IVSCodeServerAPI> {
|
||||
const mod = require(path.join(vsRootPath, "out/server-main")) as VSCodeModule
|
||||
// Since server-main.js is an ES module, we have to use `import`. However,
|
||||
// tsc will transpile this to `require` unless we change our module type,
|
||||
// which will also require that we switch to ESM, since a hybrid approach
|
||||
// breaks importing `rotating-file-stream` for some reason. To work around
|
||||
// this, use `eval` for now, but we should consider switching to ESM.
|
||||
const modPath = path.join(vsRootPath, "out/server-main.js")
|
||||
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
|
||||
const serverModule = await mod.loadCodeWithNls()
|
||||
return serverModule.createServer(null, {
|
||||
...(await toCodeArgs(req.args)),
|
||||
|
||||
@@ -47,7 +47,7 @@ export class SocketProxyProvider {
|
||||
proxy.once("connect", () => proxy.write(id))
|
||||
|
||||
const timeout = setTimeout(() => {
|
||||
listener.dispose() // eslint-disable-line @typescript-eslint/no-use-before-define
|
||||
listener.dispose()
|
||||
socket.destroy()
|
||||
proxy.destroy()
|
||||
reject(new Error("TLS socket proxy timed out"))
|
||||
|
||||
@@ -37,7 +37,6 @@ export async function makeEditorSessionManagerServer(
|
||||
): Promise<http.Server> {
|
||||
const router = express()
|
||||
|
||||
// eslint-disable-next-line import/no-named-as-default-member
|
||||
router.use(express.json())
|
||||
|
||||
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
||||
|
||||
@@ -54,5 +54,4 @@ export function Router(): WebsocketRouter {
|
||||
return new WebsocketRouter()
|
||||
}
|
||||
|
||||
// eslint-disable-next-line import/no-named-as-default-member -- the typings are not updated correctly
|
||||
export const wss = new Websocket.Server({ noServer: true })
|
||||
|
||||
Reference in New Issue
Block a user