From 4a6b57de89a0fff03be3b03ccce8339c0e9d1dcb Mon Sep 17 00:00:00 2001
From: Luca Casonato
Date: Mon, 4 Oct 2021 11:12:12 +0200
Subject: [PATCH] docs: new website (#66)
---
.github/workflows/ci.yml | 2 +-
README.md | 2 +-
docs/getting-started.md | 2 +-
example/pages/[name].tsx | 11 --
example/pages/api/joke.ts | 21 ---
example/pages/index.tsx | 47 -------
example/pages/suspense.tsx | 28 ----
example/pages/x/[module].tsx | 40 ------
examples/todo-app/.vscode/settings.json | 5 +
{example => examples/todo-app}/README.md | 2 +-
examples/todo-app/deps.ts | 2 +
examples/todo-app/main.ts | 11 ++
examples/todo-app/pages/index.tsx | 50 ++++++++
examples/todo-app/routes.gen.ts | 14 ++
examples/todo-app/utils/database.ts | 43 +++++++
makefile | 4 +-
src/cli/init.ts | 2 +-
src/server/render.tsx | 3 +
tests/fixture/README.md | 2 +-
www/README.md | 20 +++
{example => www}/components/Button.tsx | 0
{example => www}/components/Icons.tsx | 0
{example => www}/deps.ts | 0
{example => www}/main.ts | 0
{example => www}/pages/_render.ts | 0
www/pages/index.tsx | 155 +++++++++++++++++++++++
{example => www}/routes.gen.ts | 8 --
{example => www}/server_deps.ts | 0
{example => www}/static/favicon.ico | Bin
29 files changed, 311 insertions(+), 163 deletions(-)
delete mode 100644 example/pages/[name].tsx
delete mode 100644 example/pages/api/joke.ts
delete mode 100644 example/pages/index.tsx
delete mode 100644 example/pages/suspense.tsx
delete mode 100644 example/pages/x/[module].tsx
create mode 100644 examples/todo-app/.vscode/settings.json
rename {example => examples/todo-app}/README.md (79%)
create mode 100644 examples/todo-app/deps.ts
create mode 100644 examples/todo-app/main.ts
create mode 100644 examples/todo-app/pages/index.tsx
create mode 100644 examples/todo-app/routes.gen.ts
create mode 100644 examples/todo-app/utils/database.ts
create mode 100644 www/README.md
rename {example => www}/components/Button.tsx (100%)
rename {example => www}/components/Icons.tsx (100%)
rename {example => www}/deps.ts (100%)
rename {example => www}/main.ts (100%)
rename {example => www}/pages/_render.ts (100%)
create mode 100644 www/pages/index.tsx
rename {example => www}/routes.gen.ts (56%)
rename {example => www}/server_deps.ts (100%)
rename {example => www}/static/favicon.ico (100%)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5c543e5f..6bbcf726 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,4 +36,4 @@ jobs:
run: deno cache --no-check src/*/deps.ts
- name: Run tests
- run: deno test -A --unstable --no-check
+ run: deno test -A --no-check
diff --git a/README.md b/README.md
index 5c07e737..251a4cc0 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ fresh init myproject
To now start the project, call `deno run`:
```
-deno run -A --unstable --watch main.ts
+deno run -A --watch main.ts
```
To deploy the script to [Deno Deploy](https://deno.com/deploy), push your
diff --git a/docs/getting-started.md b/docs/getting-started.md
index 87ef3a83..d6abbdc4 100644
--- a/docs/getting-started.md
+++ b/docs/getting-started.md
@@ -45,7 +45,7 @@ To learn more about how projects are structured, take a look at the
You can now run your new project locally using the `deno` CLI:
```
-deno run -A --unstable --watch main.ts
+deno run -A --watch main.ts
```
The `--watch` option will cause your script to be reloaded on any changes to the
diff --git a/example/pages/[name].tsx b/example/pages/[name].tsx
deleted file mode 100644
index 505b0895..00000000
--- a/example/pages/[name].tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-/** @jsx h */
-
-import { h } from "../deps.ts";
-
-interface Props {
- params: Record;
-}
-
-export default function Greet(props: Props) {
- return
Hello {props.params.name}
;
-}
diff --git a/example/pages/api/joke.ts b/example/pages/api/joke.ts
deleted file mode 100644
index 86656fa5..00000000
--- a/example/pages/api/joke.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { HandlerContext } from "../../../server.ts";
-
-// Jokes courtesy of https://punsandoneliners.com/randomness/programmer-jokes/
-const JOKES = [
- "Why do Java developers often wear glasses? They can’t C#.",
- "A SQL query walks into a bar, goes up to two tables and says “can I join you?",
- "Wasn’t hard to crack Forrest Gump’s password. 1forrest1.",
- "I love pressing the F5 key. It’s refreshing.",
- "Called IT support and a chap from Australia came to fix my network connection. I asked “Do you come from a LAN down under?”",
- "There are 10 types of people in the world. Those who understand binary and those who don’t.",
- "Why are assembly programmers often wet? They work below C level.",
- "My favourite computer based band is the Black IPs.",
- "What programme do you use to predict the music tastes of former US presidential candidates? An Al Gore Rhythm.",
- "An SEO expert walked into a bar, pub, inn, tavern, hostelry, public house.",
-];
-
-export const handler = (_ctx: HandlerContext): Response => {
- const randomIndex = Math.floor(Math.random() * 10);
- const body = JOKES[randomIndex];
- return new Response(body);
-};
diff --git a/example/pages/index.tsx b/example/pages/index.tsx
deleted file mode 100644
index 8b6521e2..00000000
--- a/example/pages/index.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @jsx h */
-
-import { RoundedButton } from "../components/Button.tsx";
-import { IconMinus, IconPlus } from "../components/Icons.tsx";
-import { h, IS_BROWSER, PageConfig, tw, useState } from "../deps.ts";
-
-export default function Home() {
- return (
-
-
- Welcome to `fresh`. Try update this message in the ./pages/index.tsx
- file, and refresh.
-