Skip to content

Commit

Permalink
chore: upgrade to Fresh v1.4.2 (denoland#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Aug 21, 2023
1 parent 44a16e4 commit 8b8febd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: main

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

permissions:
id-token: write # Needed for auth with Deno Deploy
contents: read # Needed to clone the repository

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install Deno
uses: denoland/setup-deno@v1

- name: Build step
run: deno task build

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: saaskit
entrypoint: ./main.ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
cov/
cov.lcov
.idea
_fresh/
11 changes: 7 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
"check:types": "deno check **/*.ts && deno check **/*.tsx",
"ok": "deno fmt --check && deno lint && deno task check:license --check && deno task check:types && deno task test",
"cov": "deno coverage ./cov/ --lcov --exclude='test.ts' > cov.lcov",
"update": "deno run -A -r https://fresh.deno.dev/update ."
"update": "deno run -A -r https://fresh.deno.dev/update .",
"build": "deno run -A --unstable dev.ts build",
"preview": "deno run -A --unstable main.ts"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
},
"imports": {
"@/": "./",
"$fresh/": "https://raw.githubusercontent.com/denoland/fresh/726740ed39aa0c5a9c484f4eba4f6e329cf730d1/",
"$fresh/": "https://deno.land/x/fresh@1.4.2/",
"$gfm": "https://deno.land/x/[email protected]/mod.ts",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"preact-render-to-string": "https://esm.sh/*[email protected].0",
"preact-render-to-string": "https://esm.sh/*[email protected].1",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"twind-preset-tailwind/": "https://esm.sh/@twind/[email protected]/",
Expand All @@ -37,7 +39,8 @@
"fresh_charts/": "https://deno.land/x/[email protected]/"
},
"exclude": [
"cov/"
"cov/",
"_fresh/"
],
"lint": {
"rules": {
Expand Down
3 changes: 2 additions & 1 deletion dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright 2023 the Deno authors. All rights reserved. MIT license.

import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";
import "std/dotenv/load.ts";

await dev(import.meta.url, "./main.ts");
await dev(import.meta.url, "./main.ts", config);
8 changes: 8 additions & 0 deletions fresh.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
import { defineConfig } from "$fresh/server.ts";
import twindPlugin from "$fresh/plugins/twindv1.ts";
import twindConfig from "./twind.config.ts";

export default defineConfig({
plugins: [twindPlugin(twindConfig)],
});
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";

import twindPlugin from "$fresh/plugins/twindv1.ts";
import twindConfig from "./twind.config.ts";
import config from "./fresh.config.ts";

/**
* @todo Remove at v1. This is a quick way to reset Deno KV, as database changes are likely to occur and require reset.
Expand All @@ -29,4 +27,4 @@ if (Deno.env.get("MIGRATE_DENO_KV") === "1") {
await migrateKv();
}

await start(manifest, { plugins: [twindPlugin(twindConfig)] });
await start(manifest, config);

0 comments on commit 8b8febd

Please sign in to comment.