Add support for MDX (#17)

* feat: add support for MDX

* fix: prevent empty server handler error message

* doc: add MDX mention to README

* feat: update version to v0.7.0
This commit is contained in:
Valerio Ageno
2024-07-22 07:59:43 +02:00
committed by GitHub
parent 2949ea4dfa
commit 444d1479b0
27 changed files with 318 additions and 19 deletions
+9
View File
@@ -16,4 +16,13 @@ $ tuono new [NAME] --template [TEMPLATE]
`[TEMPLATE]` is the folder name.
## Troubleshooting for contributors
There is a common error that happens during example development due to
pnpm workspace about the findings of different react versions.
To overcome this issue run within the single example folder:
```
pnpm install --ignore-workspace && pnpm upgrade --save
```
+13
View File
@@ -0,0 +1,13 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.tuono
out
target
+13
View File
@@ -0,0 +1,13 @@
[package]
name = "tuono"
version = "0.0.1"
edition = "2021"
[[bin]]
name = "tuono"
path = ".tuono/main.rs"
[dependencies]
tuono_lib = { path = "../../crates/tuono_lib/"}
serde = { version = "1.0.202", features = ["derive"] }
+9
View File
@@ -0,0 +1,9 @@
# Tuono starter
This is the starter tuono project. To download it run in your terminal:
```shell
$ tuono new [NAME]
```
+16
View File
@@ -0,0 +1,16 @@
{
"name": "tuono",
"description": "The react/rust fullstack framework",
"version": "0.0.1",
"dependencies": {
"@mdx-js/react": "^3.0.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"tuono": "link:../../packages/tuono"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.3"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+14
View File
@@ -0,0 +1,14 @@
import type { ReactNode } from 'react'
import { MDXProvider } from '@mdx-js/react'
interface RootRouteProps {
children: ReactNode
}
export default function RootRoute({ children }: RootRouteProps): JSX.Element {
return (
<main className="main">
<MDXProvider components={{}}>{children}</MDXProvider>
</main>
)
}
+1
View File
@@ -0,0 +1 @@
# Index page
+109
View File
@@ -0,0 +1,109 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-style: normal;
}
body {
background: #fbfbfb;
}
main {
width: 673px;
margin: 20px auto;
}
.header {
display: flex;
gap: 20px;
}
.header a {
color: black;
font-size: 18px;
font-weight: 600;
text-decoration: none;
z-index: 2;
}
.title-wrap {
height: 200px;
}
.title {
position: absolute;
font-size: 200px;
line-height: 200px;
z-index: 0;
letter-spacing: -2px;
margin-left: -8px;
user-select: none;
pointer-events: none;
}
.title span {
opacity: 0;
}
.button {
width: 140px;
height: 30px;
border: solid 3px black;
border-radius: 10px;
color: black;
text-decoration: none;
display: flex;
justify-content: center;
align-items: center;
transition: 0.2s;
}
.button:hover {
color: white;
background: black;
}
.logo {
margin-left: 240px;
position: relative;
top: 25px;
}
.logo img {
position: absolute;
}
.rust {
animation: rotate 6s ease-in-out infinite;
}
.react {
top: 33px;
left: 28px;
animation: rotate 6s linear infinite reverse;
}
.subtitle {
font-size: 30px;
line-height: 30px;
letter-spacing: -1px;
}
.subtitle-wrap {
display: flex;
justify-content: space-between;
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
+11
View File
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts"]
}