From 23f99e2dbebab8a37ab7becaf1de1bbef216c85e Mon Sep 17 00:00:00 2001 From: Twilight Sparkle Date: Wed, 22 Nov 2023 07:12:32 -0500 Subject: [PATCH] update Fresh and Deno Signed-off-by: Twilight Sparkle --- .gitignore | 1 + Dockerfile | 4 +--- deno.json | 5 +++-- fresh.config.ts | 8 ++++++++ main.ts | 8 ++------ 5 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 fresh.config.ts diff --git a/.gitignore b/.gitignore index 6f15975..c57df97 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ # Fresh build directory _fresh/ +_fresh diff --git a/Dockerfile b/Dockerfile index 0b714a1..05a2cf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,8 @@ WORKDIR /app ARG GIT_REVISION ENV DENO_DEPLOYMENT_ID=${GIT_REVISION} -USER deno - COPY . . -RUN deno cache --reload main.ts +RUN ls -la && deno task build ENV NODE_ENV=production ENV HOME=/deno-dir/location_data/.home diff --git a/deno.json b/deno.json index 116b22e..8d9b4fe 100644 --- a/deno.json +++ b/deno.json @@ -2,8 +2,9 @@ "tasks": { "start": "deno run --unstable -A --watch=static/,routes/ dev.ts", "update": "deno run -A -r https://fresh.deno.dev/update .", - "build": "deno run -A dev.ts build", - "preview": "deno run -A main.ts" + "build": "deno run --unstable -A dev.ts build", + "preview": "deno run --unstable -A main.ts", + "deploy": "~/.fly/bin/fly deploy" }, "lock": false, "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, diff --git a/fresh.config.ts b/fresh.config.ts new file mode 100644 index 0000000..c965a47 --- /dev/null +++ b/fresh.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "$fresh/server.ts"; + +import freshwind from "@freshwind"; +import config, { configURL } from "./twind.config.ts"; + +export default defineConfig({ + plugins: [freshwind(config, configURL)], +}); diff --git a/main.ts b/main.ts index 7793635..e88cb2f 100644 --- a/main.ts +++ b/main.ts @@ -8,13 +8,9 @@ import "std/dotenv/load.ts"; import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; - -import freshwind from "@freshwind"; -import config, { configURL } from "./twind.config.ts"; +import config from "./fresh.config.ts"; import * as comrak from "@comrak"; await comrak.init(); -await start(manifest, { - plugins: [freshwind(config, configURL)], -}); +await start(manifest, config);