Upgrade to deno 2.2
parent
5111b5a380
commit
5ca0e98300
|
@ -33,7 +33,7 @@ jobs:
|
||||||
- name: Setup Deno
|
- name: Setup Deno
|
||||||
uses: denoland/setup-deno@v1
|
uses: denoland/setup-deno@v1
|
||||||
with:
|
with:
|
||||||
deno-version: v2.1.9
|
deno-version: v2.2.0
|
||||||
|
|
||||||
- name: Run bundle build
|
- name: Run bundle build
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Setup Deno
|
- name: Setup Deno
|
||||||
uses: denoland/setup-deno@v2
|
uses: denoland/setup-deno@v2
|
||||||
with:
|
with:
|
||||||
deno-version: v2.1
|
deno-version: v2.2
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: deno task build
|
run: deno task build
|
||||||
- name: Bundle
|
- name: Bundle
|
||||||
|
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Setup Deno
|
- name: Setup Deno
|
||||||
uses: denoland/setup-deno@v2
|
uses: denoland/setup-deno@v2
|
||||||
with:
|
with:
|
||||||
deno-version: v2.1
|
deno-version: v2.2
|
||||||
|
|
||||||
- name: Build bundles
|
- name: Build bundles
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
- name: Setup Deno
|
- name: Setup Deno
|
||||||
uses: denoland/setup-deno@v2
|
uses: denoland/setup-deno@v2
|
||||||
with:
|
with:
|
||||||
deno-version: v2.1
|
deno-version: v2.2
|
||||||
|
|
||||||
- name: Run build
|
- name: Run build
|
||||||
run: deno task build
|
run: deno task build
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
FROM gitpod/workspace-full:latest
|
FROM gitpod/workspace-full:latest
|
||||||
|
|
||||||
RUN curl -fsSL https://deno.land/x/install/install.sh | sh -s v2.1.9
|
RUN curl -fsSL https://deno.land/x/install/install.sh | sh -s v2.2.0
|
||||||
RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && \
|
RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && \
|
||||||
echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \
|
echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \
|
||||||
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno
|
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM denoland/deno:debian-2.1.9
|
FROM denoland/deno:debian-2.2.0
|
||||||
|
|
||||||
# The volume that will keep the space data
|
# The volume that will keep the space data
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ export class HttpServer {
|
||||||
if (typeof response.body === "string") {
|
if (typeof response.body === "string") {
|
||||||
return ctx.text(response.body);
|
return ctx.text(response.body);
|
||||||
} else if (response.body instanceof Uint8Array) {
|
} else if (response.body instanceof Uint8Array) {
|
||||||
return ctx.body(response.body);
|
return ctx.body(response.body.buffer as ArrayBuffer);
|
||||||
} else {
|
} else {
|
||||||
return ctx.json(response.body);
|
return ctx.json(response.body);
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ export class HttpServer {
|
||||||
}
|
}
|
||||||
c.status(200);
|
c.status(200);
|
||||||
c.header("Content-type", this.clientAssetBundle.getMimeType(assetName));
|
c.header("Content-type", this.clientAssetBundle.getMimeType(assetName));
|
||||||
let data: Uint8Array | string = this.clientAssetBundle.readFileSync(
|
let data = this.clientAssetBundle.readFileSync(
|
||||||
assetName,
|
assetName,
|
||||||
);
|
);
|
||||||
c.header("Content-length", "" + data.length);
|
c.header("Content-length", "" + data.length);
|
||||||
|
@ -286,7 +286,7 @@ export class HttpServer {
|
||||||
// console.log(
|
// console.log(
|
||||||
// "Swapping out config hash in service worker",
|
// "Swapping out config hash in service worker",
|
||||||
// );
|
// );
|
||||||
data = textData.replaceAll(
|
return Promise.resolve(c.body(textData.replaceAll(
|
||||||
"{{CONFIG_HASH}}",
|
"{{CONFIG_HASH}}",
|
||||||
base64Encode(
|
base64Encode(
|
||||||
JSON.stringify([
|
JSON.stringify([
|
||||||
|
@ -295,9 +295,10 @@ export class HttpServer {
|
||||||
this.spaceServer.enableSpaceScript,
|
this.spaceServer.enableSpaceScript,
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
);
|
)));
|
||||||
|
} else {
|
||||||
|
return Promise.resolve(c.body(new Uint8Array(data).buffer));
|
||||||
}
|
}
|
||||||
return Promise.resolve(c.body(data));
|
|
||||||
} // else e.g. HEAD, OPTIONS, don't send body
|
} // else e.g. HEAD, OPTIONS, don't send body
|
||||||
} catch {
|
} catch {
|
||||||
return next();
|
return next();
|
||||||
|
@ -632,7 +633,7 @@ export class HttpServer {
|
||||||
) {
|
) {
|
||||||
return c.body(null, 304);
|
return c.body(null, 304);
|
||||||
}
|
}
|
||||||
return c.body(fileData.data, 200, {
|
return c.body(new Uint8Array(fileData.data).buffer, 200, {
|
||||||
...this.fileMetaToHeaders(fileData.meta),
|
...this.fileMetaToHeaders(fileData.meta),
|
||||||
"Last-Modified": lastModifiedHeader,
|
"Last-Modified": lastModifiedHeader,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue