Skip to content

Commit

Permalink
chore: upgrade fresh (#44)
Browse files Browse the repository at this point in the history
* chore: upgrade fresh

* chore: deno fmt

* chore: migrate configration
  • Loading branch information
9renpoto authored Sep 3, 2023
1 parent d898d74 commit c0d1b05
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 9 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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
with:
deno-version: v1.x

- name: Build step
run: "deno task build"

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "9renpoto"
entrypoint: "./main.ts"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_fresh
24 changes: 21 additions & 3 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"tasks": {
"start": "deno run -A --watch=static/,routes/ dev.ts"
"start": "deno run -A --watch=static/,routes/ dev.ts",
"build": "deno run -A dev.ts build",
"preview": "deno run -A main.ts"
},
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "preact"
},
"lock": false,
"imports": {
"$fresh/": "https://deno.land/x/fresh@1.2.0/",
"$fresh/": "https://deno.land/x/fresh@1.4.2/",
"preact": "https://esm.sh/preact@10.15.1",
"preact/": "https://esm.sh/preact@10.15.1/",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0",
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
"twind": "https://esm.sh/twind@0.16.19",
Expand All @@ -21,5 +23,21 @@
"./": "./",
"$gfm": "https://deno.land/x/gfm@0.1.26/mod.ts",
"$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts"
},
"lint": {
"rules": {
"tags": [
"fresh",
"recommended"
]
},
"exclude": [
"_fresh"
]
},
"fmt": {
"exclude": [
"_fresh"
]
}
}
3 changes: 2 additions & 1 deletion dev.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env -S deno run -A --watch=static/,routes/

import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";

await dev(import.meta.url, "./main.ts");
await dev(import.meta.url, "./main.ts", config);
7 changes: 7 additions & 0 deletions fresh.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "$fresh/server.ts";
import twindPlugin from "$fresh/plugins/twind.ts";
import twindConfig from "./twind.config.ts";

export default defineConfig({
plugins: [twindPlugin(twindConfig)],
});
2 changes: 1 addition & 1 deletion fresh.gen.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DO NOT EDIT. This file is generated by fresh.
// DO NOT EDIT. This file is generated by Fresh.
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.

Expand Down
6 changes: 2 additions & 4 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

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

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

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

0 comments on commit c0d1b05

Please sign in to comment.