Skip to content

Commit

Permalink
Update to deno v2.1.1
Browse files Browse the repository at this point in the history
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>
  • Loading branch information
M4RC3L05 committed Nov 21, 2024
1 parent da42afc commit d0ff5e1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: deno install

- name: build
run: ./scripts/bundle.ts && ./scripts/embed.ts && ./scripts/build.ts
run: ./scripts/bundle.ts && ./scripts/build.ts

- name: release
uses: ncipollo/release-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
experimental = true

[tools]
deno = "2.0.5"
deno = "2.1.1"

[tasks."check:format"]
run = """
Expand Down
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "4.6.3",
"exports": "./src/main.ts",
"tasks": {
"run": "./scripts/bundle.ts && ./scripts/embed.ts && deno run --cached-only --allow-env=ENV --allow-net=127.0.0.1 src/main.ts",
"compile": "./scripts/bundle.ts && ./scripts/embed.ts && deno compile --cached-only --allow-env=ENV --allow-net=127.0.0.1 --env=.env -o ./.bin/denotag ./src/main.ts"
"run": "./scripts/bundle.ts && deno run --allow-read=./data --cached-only --allow-env=ENV --allow-net=127.0.0.1 src/main.ts",
"compile": "./scripts/bundle.ts && deno compile --allow-read=./data --cached-only --allow-env=ENV --allow-net=127.0.0.1 --include ./data/index.html --env=.env -o ./.bin/denotag ./src/main.ts"
},
"compilerOptions": {
"lib": ["DOM", "deno.ns"],
Expand Down
17 changes: 0 additions & 17 deletions scripts/embed.ts

This file was deleted.

9 changes: 4 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import {
import { bootActions } from "./actions.ts";
import meta from "./../deno.json" with { type: "json" };

const indexFile = new URL("./../data/index.html", import.meta.url);
const indexFileContents = Deno.readTextFileSync(indexFile);

const multipartToObj = async (request: Request) => {
const response = new Map<string, unknown>();

Expand Down Expand Up @@ -80,10 +83,6 @@ const onTagCmd = async ({ dir }: { dir: string }) => {
throw new Error(`Dir "${dir}" it not a directory`);
}

const embed = await import("./../embed.json", { with: { type: "json" } })
.then(({ default: main }) => main);

const ui = Uint8Array.from(embed["index.html"]);
const { invokeAction } = bootActions({ dir: join(dir) });

return Deno.serve({
Expand Down Expand Up @@ -113,7 +112,7 @@ const onTagCmd = async ({ dir }: { dir: string }) => {
return Response.json(await invokeAction(callName as any, ...args));
}

return new Response(ui, {
return new Response(indexFileContents, {
headers: { "content-type": "text/html" },
status: 200,
});
Expand Down

0 comments on commit d0ff5e1

Please sign in to comment.