Upgrade to deno 1.40

pull/674/head
Zef Hemel 2024-01-28 14:13:37 +01:00
parent 146c6dbea9
commit c338693343
13 changed files with 29 additions and 23 deletions

View File

@ -33,7 +33,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.39
deno-version: v1.40
- name: Run bundle build
run: |

View File

@ -13,7 +13,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.39
deno-version: v1.40
- name: Run build
run: deno task build
- name: Bundle

View File

@ -16,7 +16,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.39
deno-version: v1.40
- name: Build bundles
run: |

View File

@ -20,7 +20,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.39
deno-version: v1.40
- name: Run build
run: deno task build

View File

@ -1,4 +1,4 @@
FROM lukechannings/deno:v1.39.4
FROM lukechannings/deno:v1.40.2
# The volume that will keep the space data
# Either create a volume:

View File

@ -17,7 +17,7 @@ export async function upgradeCommand() {
"So, that's done. Now let's see if this actually did anything...",
);
const vp = new Deno.Command("deno", {
args: ["run", "-A", "--unstable", Deno.mainModule, "version"],
args: ["run", "-A", Deno.mainModule, "version"],
});
const versionStatus = await vp.output();
if (!versionStatus.success) {

View File

@ -48,7 +48,7 @@ export class DiskSpacePrimitives implements SpacePrimitives {
const f = await Deno.open(localPath, { read: true });
const data = await readAll(f);
Deno.close(f.rid);
f.close();
return {
data,

View File

@ -4,13 +4,13 @@
"deep-clean-mac": "rm -f deno.lock && rm -rf $HOME/Library/Caches/deno && deno task clean",
"install": "deno install -f --unstable -A --importmap import_map.json silverbullet.ts",
"check": "find . -name '*.ts*' | xargs deno check",
"test": "deno test -A --unstable",
"build": "deno run -A build_plugs.ts && deno run -A --unstable build_web.ts",
"test": "deno test -A --unstable-kv --unstable-worker-options",
"build": "deno run -A build_plugs.ts && deno run -A build_web.ts",
"plugs": "deno run -A build_plugs.ts",
"server": "deno run -A --unstable --check silverbullet.ts",
"server": "deno run -A --unstable-kv --unstable-worker-options --check silverbullet.ts",
"watch-web": "deno run -A --check build_web.ts --watch",
"watch-server": "deno run -A --unstable --check --watch silverbullet.ts",
"watch-server": "deno run -A --unstable-kv --unstable-worker-options --check --watch silverbullet.ts",
"watch-plugs": "deno run -A --check build_plugs.ts -w",
"bundle": "deno run -A build_bundle.ts",
@ -18,11 +18,11 @@
"generate": "./scripts/generate.sh",
// Compile
"compile": "deno task bundle && deno compile -A --unstable -o silverbullet dist/silverbullet.js",
"server:dist:linux-x86_64": "deno task bundle && deno compile -A --unstable --target x86_64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-x86_64.zip silverbullet",
"server:dist:darwin-x86_64": "deno task bundle && deno compile -A --unstable --target x86_64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-x86_64.zip silverbullet",
"server:dist:darwin-aarch64": "deno task bundle && deno compile -A --unstable --target aarch64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-aarch64.zip silverbullet",
"server:dist:windows-x86_64": "deno task bundle && deno compile -A --unstable --target x86_64-pc-windows-msvc -o silverbullet.exe dist/silverbullet.js && zip silverbullet-server-windows-x86_64.zip silverbullet.exe"
"compile": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options -o silverbullet dist/silverbullet.js",
"server:dist:linux-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-unknown-linux-gnu -o silverbullet dist/silverbullet.js && zip silverbullet-server-linux-x86_64.zip silverbullet",
"server:dist:darwin-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-x86_64.zip silverbullet",
"server:dist:darwin-aarch64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target aarch64-apple-darwin -o silverbullet dist/silverbullet.js && zip silverbullet-server-darwin-aarch64.zip silverbullet",
"server:dist:windows-x86_64": "deno task bundle && deno compile -A --unstable-kv --unstable-worker-options --target x86_64-pc-windows-msvc -o silverbullet.exe dist/silverbullet.js && zip silverbullet-server-windows-x86_64.zip silverbullet.exe"
},
"compilerOptions": {

View File

@ -13,7 +13,7 @@ fi
if [ "$PUID" == "0" ] || [ "$UID" != "0" ]; then
# Will run SilverBullet as default user
deno run -A --unstable /silverbullet.js $@
deno run -A --unstable-kv --unstable-worker-options /silverbullet.js $@
else
# Create silverbullet user and group ad-hoc mapped to PUID and PGID
getent group $PGID &> /dev/null || groupadd -g $PGID silverbullet
@ -24,6 +24,6 @@ else
# And run via su as requested PUID, usually this will be 'silverbullet' but if a user with this idea already exists, we will use that
USERNAME=$(getent passwd $PUID | cut -d ":" -f 1)
echo "Running SilverBullet as $USERNAME (configured as PUID $PUID and PGID $PGID)"
su $USERNAME -s /bin/bash -c "deno run -A --unstable /silverbullet.js $args"
su $USERNAME -s /bin/bash -c "deno run -A --unstable-kv --unstable-worker-options /silverbullet.js $args"
fi

View File

@ -5,6 +5,6 @@ export { expandGlobSync } from "https://deno.land/std@0.165.0/fs/mod.ts";
export { mime } from "https://deno.land/x/mimetypes@v1.0.0/mod.ts";
export { default as cacheDir } from "https://deno.land/x/cache_dir@0.2.0/mod.ts";
export * as flags from "https://deno.land/std@0.165.0/flags/mod.ts";
export * as esbuild from "https://deno.land/x/esbuild@v0.19.12/mod.js";
export * as esbuild from "https://deno.land/x/esbuild@v0.20.0/mod.js";
export { denoPlugins } from "https://deno.land/x/esbuild_deno_loader@0.8.5/mod.ts";
export * as YAML from "https://deno.land/std@0.184.0/yaml/mod.ts";

View File

@ -7,7 +7,10 @@ import { compileManifest } from "../compile.ts";
import { esbuild } from "../deps.ts";
import { Hono } from "../../server/deps.ts";
Deno.test("Run a plugos endpoint server", async () => {
Deno.test("Run a plugos endpoint server", {
sanitizeResources: false,
sanitizeOps: false,
}, async () => {
const tempDir = await Deno.makeTempDir();
const system = new System<EndpointHookT>("server");

View File

@ -10,7 +10,10 @@ import {
import { sleep } from "$sb/lib/async.ts";
import { SysCallMapping } from "./system.ts";
Deno.test("Run a deno sandbox", async () => {
Deno.test("Run a deno sandbox", {
sanitizeResources: false,
sanitizeOps: false,
}, async () => {
const system = new System("server");
system.registerSyscalls([], {
addNumbers: (_ctx, a, b) => {

View File

@ -1,9 +1,9 @@
The SilverBullet is implemented using a JavaScript runtime called [Deno](https://deno.com/) which is a lot like node.js, just... you know, better. And we like better.
To run SilverBullet directly on your host system (so not in a [[Install/Docker]] container), you need to [install Deno](https://docs.deno.com/runtime/manual/getting_started/installation) 1.39:
To run SilverBullet directly on your host system (so not in a [[Install/Docker]] container), you need to [install Deno](https://docs.deno.com/runtime/manual/getting_started/installation) 1.40 or later:
```bash
$ curl -fsSL https://deno.land/install.sh | sh -s v1.39.4
$ curl -fsSL https://deno.land/install.sh | sh
```
After having installed Deno, run: