Skip to content

Commit

Permalink
Migrate to separate @http packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jollytoad committed Apr 18, 2024
1 parent fcee551 commit 6f8f683
Show file tree
Hide file tree
Showing 39 changed files with 274 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
project: jollytoad
entrypoint: main.ts
exclude: scripts
exclude: scripts, dev.ts, import_map_sw.json, README.md
5 changes: 2 additions & 3 deletions cache/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
service</li>
<li><a href="https://htmx.org">htmx</a> - used for many of the interactive demos</li>
<li><a href="https://missing.style">missing.css</a> - css library</li>
<li><a href="https://jsr.io/@http/fns">@http/fns</a> - my HTTP server functions library (for
<li><a href="https://jsr.io/@http">HTTP Functions</a> - my HTTP server functions library (for
routing etc)</li>
<li><a href="https://jsr.io/@http/jsx-stream">@http/jsx-stream</a> - my JSX streaming
serializer</li>
<li><a href="https://remark.js.org">remark</a> - the markdown processor (although I use
<a href="https://github.com/syntax-tree/mdast">mdast</a> and it&#39;s utilities directly)</li>
<li><a href="https://esbuild.github.io/">esbuild</a> - to build the service worker, as not
all browsers support ESM in service workers yet
(<a href="https://deno.land/x/esbuild">Deno module</a>)</li>
all browsers support ESM in service workers yet</li>
</ul><div id="wcb" class="carbonbadge"></div><script src="https://unpkg.com/website-carbon-badges@1.1.3/b.min.js" defer></script></main><footer><div class="src"><a href="https://github.com/jollytoad/home/blob/main/routes/index.tsx" target="_blank">View source on GitHub</a></div><div>©️ 2024 Mark Gibson</div></footer></body></html>
44 changes: 29 additions & 15 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cache": "deno run --allow-all scripts/cache.ts",
"cache:clean": "rm -rf cache",
"gen": "deno run --allow-net --allow-read --allow-write --allow-env scripts/gen.ts",
"start": "deno run --allow-net --allow-read --allow-env --env --allow-sys --allow-run --allow-write --allow-hrtime --watch scripts/dev.ts",
"start": "deno run --allow-net --allow-read --allow-env --env --allow-sys --allow-run --allow-write --allow-hrtime --watch dev.ts",
"start:prod": "deno run --allow-net --allow-env main.ts",
"mkcert": "mkcert -install -key-file localhost-key.pem -cert-file localhost-cert.pem localhost",
"deploy": "deno run --allow-sys --allow-net --allow-read --allow-write --allow-env jsr:@deno/deployctl deploy",
Expand All @@ -35,21 +35,29 @@
"imports": {
"$store": "https://deno.land/x/storage_modules@v0.1.0/deno_kv.ts",
"@cross/env": "jsr:@cross/env@^1.0.0",
"@http/fns": "jsr:@http/fns@^0.7.0",
"@http/fns/": "jsr:/@http/fns@^0.7.0/",
"@http/discovery/": "jsr:/@http/discovery@^0.9.0-beta.2/",
"@http/generate/": "jsr:/@http/generate@^0.9.0-beta.2/",
"@http/handler/": "jsr:/@http/handler@^0.9.0-beta.2/",
"@http/host-deno-deploy/": "jsr:/@http/host-deno-deploy@^0.9.0-beta.2/",
"@http/host-deno-local/": "jsr:/@http/host-deno-local@^0.9.0-beta.2/",
"@http/interceptor/": "jsr:/@http/interceptor@^0.9.0-beta.2/",
"@http/jsx-stream": "jsr:@http/jsx-stream@^0.1.1",
"@http/jsx-stream/": "jsr:/@http/jsx-stream@^0.1.1/",
"@std/async": "jsr:@std/async@^0.219.1",
"@std/async/": "jsr:/@std/async@^0.219.1/",
"@std/collections": "jsr:@std/collections@^0.219.1",
"@std/collections/": "jsr:/@std/collections@^0.219.1/",
"@std/fs": "jsr:@std/fs@^0.219.1",
"@std/fs/": "jsr:/@std/fs@^0.219.1/",
"@std/http": "jsr:@std/http@^0.219.1",
"@std/http/": "jsr:/@std/http@^0.219.1/",
"@std/path": "jsr:@std/path@^0.219.1",
"@std/path/": "jsr:/@std/path@^0.219.1/",
"@std/ulid": "jsr:@std/ulid@^0.219.1",
"@http/request/": "jsr:/@http/request@^0.9.0-beta.2/",
"@http/response/": "jsr:/@http/response@^0.9.0-beta.2/",
"@http/route/": "jsr:/@http/route@^0.9.0-beta.2/",
"@http/route-deno/": "jsr:/@http/route-deno@^0.9.0-beta.2/",
"@std/async": "jsr:@std/async@^0.222.1",
"@std/async/": "jsr:/@std/async@^0.222.1/",
"@std/collections": "jsr:@std/collections@^0.222.1",
"@std/collections/": "jsr:/@std/collections@^0.222.1/",
"@std/fs": "jsr:@std/fs@^0.222.1",
"@std/fs/": "jsr:/@std/fs@^0.222.1/",
"@std/http": "jsr:@std/http@^0.222.1",
"@std/http/": "jsr:/@std/http@^0.222.1/",
"@std/path": "jsr:@std/path@^0.222.1",
"@std/path/": "jsr:/@std/path@^0.222.1/",
"@std/ulid": "jsr:@std/ulid@^0.222.1",
"esbuild": "npm:esbuild@0.20",
"esbuild-deno-loader": "jsr:@luca/esbuild-deno-loader@^0.10.3",
"hast-util-raw": "npm:hast-util-raw@9.0.2",
Expand All @@ -63,7 +71,13 @@
},
"deploy": {
"project": "jollytoad",
"exclude": [".env", "localhost-cert.pem", "localhost-key.pem", "scripts"],
"exclude": [
".env",
"localhost-cert.pem",
"localhost-key.pem",
"scripts",
"dev.ts"
],
"include": [],
"entrypoint": "main.ts"
}
Expand Down
202 changes: 141 additions & 61 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import handler from "./handler.ts";
import { buildServiceWorker } from "./scripts/build.ts";
import { generateCron, generateRoutes } from "./scripts/gen.ts";
import init from "@http/host-deno-local/init";
import initCron from "./cron.ts";
import generateQuote from "./routes/quote/_cron/generate_quote.ts";

await generateRoutes();
await generateCron();

await buildServiceWorker();

await generateQuote();

await initCron();

await Deno.serve(await init(handler)).finished;
Loading

0 comments on commit 6f8f683

Please sign in to comment.