Skip to content

Commit

Permalink
add landing page for effect tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
IMax153 committed Jun 14, 2024
1 parent 0e73533 commit b9a8968
Show file tree
Hide file tree
Showing 23 changed files with 860 additions and 34 deletions.
2 changes: 0 additions & 2 deletions content/tutorials/basics/100-your-first-effect.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Your first Effect
excerpt: Learn the basics of Effect
section: Learn the basics
---

### What is an Effect?
Expand Down
1 change: 0 additions & 1 deletion content/tutorials/basics/200-returning-values.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Returning values
excerpt: Learn the basics of Effect
---

Congratulations on running your first Effect!
Expand Down
1 change: 0 additions & 1 deletion content/tutorials/basics/300-combining-effects.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Combining Effects
excerpt: Learn the basics of Effect
---

Now that you can create and run effects, let's take a look at how you can
Expand Down
1 change: 0 additions & 1 deletion content/tutorials/basics/400-using-generators.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Using generators
excerpt: Learn the basics of Effect
---

To make using Effect more approachable, we can use generators to write our
Expand Down
8 changes: 6 additions & 2 deletions content/tutorials/basics/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
title: Welcome
excerpt: Learn the basics of Effect
section: Learn the basics
excerpt: Learn the basics of Effect by exploring fundamental concepts and core data types.
section: The Basics of Effect
difficulty: beginner
prerequisites:
- Familiarity with asynchronous programming in JavaScript
- Basic understanding of TypeScript syntax and features
---

Welcome to the Effect tutorials!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Getting Started
excerpt: Learn how to incrementally adopt Effect into your application
section: Incremental Adoption
workspace: express
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Dealing with Errors
excerpt: Learn how to incrementally adopt Effect into your application
section: Incremental Adoption
workspace: express
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: Handling Requirements
excerpt: Learn how to incrementally adopt Effect into your application
section: Incremental Adoption
workspace: express
---

Expand Down
8 changes: 7 additions & 1 deletion content/tutorials/incremental-adoption/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: Introduction
excerpt: Learn how to incrementally adopt Effect into your application
excerpt: Explore how Effect can be adopted incrementally into existing applications.
section: Incremental Adoption
difficulty: intermediate
workspace: express
prerequisites:
- Completion of The Basics of Effect
- Understanding of how effects are executed
- Ability to handle errors with Effect
- Comfort managing requirements with Effect
---

### Incrementally Adopting Effect
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
"@effect/rpc-http": "^0.28.44",
"@effect/schema": "^0.67.22",
"@headlessui/react": "1.7.17",
"@hookform/resolvers": "^3.6.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
Expand Down Expand Up @@ -55,6 +58,7 @@
"next-themes": "^0.3.0",
"react": "^18",
"react-dom": "^18",
"react-hook-form": "^7.51.5",
"react-instantsearch": "^7.4.1",
"react-resizable-panels": "^2.0.19",
"react-tweet": "^3.2.0",
Expand Down
111 changes: 111 additions & 0 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions src/app/tutorials/[...slug]/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export declare namespace Navigation {
}

export const Navigation: React.FC<Navigation.Props> = async ({ tutorial }) => {
console.log(groupedTutorials)
const group = groupedTutorials[tutorialSection(tutorial)]
const index = group.children.indexOf(tutorial)
const previous = group.children[index - 1]
Expand Down
33 changes: 19 additions & 14 deletions src/app/tutorials/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { notFound } from "next/navigation"
import * as FS from "node:fs/promises"
import * as Path from "node:path"
import { MDX } from "@/components/atoms/mdx"
import { groupedTutorials, tutorialSection } from "@/workspaces/domain/tutorial"
import {
groupedTutorials,
tutorialSection
} from "@/workspaces/domain/tutorial"
import { Navigation } from "./components/Navigation"
import { Tutorial } from "./components/Tutorial"

Expand Down Expand Up @@ -70,19 +73,21 @@ export default async function Page({
)

return (
<Tutorial
name={name}
files={filesWithContent}
workspace={page.workspace}
navigation={<Navigation tutorial={page} />}
next={
next && {
title: next.title,
url: next.urlPath
<div className="h-screen flex flex-col">
<Tutorial
name={name}
files={filesWithContent}
workspace={page.workspace}
navigation={<Navigation tutorial={page} />}
next={
next && {
title: next.title,
url: next.urlPath
}
}
}
>
<MDX content={page.body.code} />
</Tutorial>
>
<MDX content={page.body.code} />
</Tutorial>
</div>
)
}
Loading

0 comments on commit b9a8968

Please sign in to comment.