Skip to content

Commit 23f04e0

Browse files
committed
feat: reinit project by Fresh v2 Beta
1 parent 8b58943 commit 23f04e0

15 files changed

Lines changed: 1440 additions & 1461 deletions

File tree

README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,10 @@
1010

1111
## 本リポジトリの達成目標
1212
- [x] Fresh v2を`jsr:@fresh/init`で作成する
13-
- [x] esm.shを使って`react-icons`を追加し、表示する
14-
- [ ] ~~esm.shを使って`@ark-ui/react`を追加し、表示する~~
15-
- React互換性の`createContext`に引っかかったらしくエラーで表示ならず([当該commit](https://github.com/whyk-pg/learn-fresh-v2/commit/65e881029e353ac17de50607fe0a4f0e43bfb51a))
16-
- [ ] ~~`preact/compat`を使って`react-icons`を追加し、表示する~~
17-
- エラーにはならなかったものの、画面に表示されずDOMにも描画されていなかった([当該commit](https://github.com/whyk-pg/learn-fresh-v2/commit/1d3d5d317d8d4dda6009711e3d4abebfa1c572dd))
13+
- [ ] `react-icons`を追加し、表示する
14+
- [ ] `@ark-ui/react`を追加し、表示する
1815
- [ ] HonoでAPIを構築する
1916
- [ ] フォームを使って簡易なログイン処理を実装する
2017

21-
### エラー内容
22-
#### esm.shを使った`@ark-ui/react`で発生したエラー
23-
```sh
24-
GET http://localhost:8000/
25-
TypeError: Cannot read properties of undefined (reading 'context')
26-
at G (https://esm.sh/preact@10.25.4/denonext/hooks.mjs:2:1577)
27-
at n (https://esm.sh/@ark-ui/react@4.9.1/X-YXJlYWN0OnByZWFjdC9jb21wYXQKZHByZWFjdEAxMC4yNS40/denonext/dist/utils/create-context.mjs:2:363)
28-
at Fa (https://esm.sh/@ark-ui/react@4.9.1/X-YXJlYWN0OnByZWFjdC9jb21wYXQKZHByZWFjdEAxMC4yNS40/denonext/react.mjs:2:9389)
29-
at https://esm.sh/@ark-ui/react@4.9.1/X-YXJlYWN0OnByZWFjdC9jb21wYXQKZHByZWFjdEAxMC4yNS40/denonext/react.mjs:2:9617
30-
at Object.t (https://esm.sh/preact@10.25.4/denonext/compat.mjs:2:1860)
31-
at U (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/preact-render-to-string/6.5.13/dist/index.mjs:1:5660)
32-
at U (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/preact-render-to-string/6.5.13/dist/index.mjs:1:5330)
33-
at U (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/preact-render-to-string/6.5.13/dist/index.mjs:1:6324)
34-
at U (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/preact-render-to-string/6.5.13/dist/index.mjs:1:6324)
35-
at U (file:///home/windchime-yk/.cache/deno/npm/registry.npmjs.org/preact-render-to-string/6.5.13/dist/index.mjs:1:4876)
36-
```
37-
3818
## 参考資料
3919
- 特になし
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
42
.fresh-gradient {
53
background-color: rgb(134, 239, 172);
64
background-image: linear-gradient(

client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Import CSS files here for hot module reloading to work.
2+
import "./assets/styles.css";

components/Button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ComponentChildren } from "preact";
22

33
export interface ButtonProps {
4+
id?: string;
45
onClick?: () => void;
56
children?: ComponentChildren;
67
disabled?: boolean;
@@ -10,7 +11,7 @@ export function Button(props: ButtonProps) {
1011
return (
1112
<button
1213
{...props}
13-
class="px-2 py-1 border-gray-500 border-2 rounded bg-white hover:bg-gray-200 transition-colors"
14+
class="px-2 py-1 border-gray-500 border-2 rounded-sm bg-white hover:bg-gray-200 transition-colors"
1415
/>
1516
);
1617
}

deno.json

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"tasks": {
3-
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
4-
"dev": "deno run -A --watch=static/,routes/ dev.ts",
5-
"build": "deno run -A dev.ts build",
6-
"start": "deno run -A main.ts",
3+
"dev": "vite",
4+
"build": "vite build",
5+
"start": "deno serve -A _fresh/server.js",
6+
"check": "deno fmt --check . && deno lint . && deno check",
77
"update": "deno run -A -r jsr:@fresh/update ."
88
},
99
"nodeModulesDir": "auto",
@@ -20,12 +20,13 @@
2020
"README.md"
2121
],
2222
"imports": {
23-
"fresh": "jsr:@fresh/core@^2.0.0-alpha.29",
24-
"@fresh/plugin-tailwind": "jsr:@fresh/plugin-tailwind@^0.0.1-alpha.7",
25-
"preact": "npm:preact@^10.25.4",
26-
"@preact/signals": "npm:@preact/signals@^2.0.1",
27-
"react-icons/fa": "https://esm.sh/react-icons@5.4.0/fa?alias=react:preact/compat&deps=preact@10.25.4",
28-
"tailwindcss": "npm:tailwindcss@^3.4.3"
23+
"fresh": "jsr:@fresh/core@^2.0.0-beta.4",
24+
"preact": "npm:preact@^10.27.1",
25+
"@preact/signals": "npm:@preact/signals@^2.3.1",
26+
"@fresh/plugin-vite": "jsr:@fresh/plugin-vite@^0.9.13",
27+
"vite": "npm:vite@^7.1.3",
28+
"tailwindcss": "npm:tailwindcss@^4.1.10",
29+
"@tailwindcss/vite": "npm:@tailwindcss/vite@^4.1.12"
2930
},
3031
"compilerOptions": {
3132
"lib": [
@@ -42,7 +43,18 @@
4243
"source",
4344
"body",
4445
"html",
45-
"head"
46+
"head",
47+
"title",
48+
"meta",
49+
"script",
50+
"link",
51+
"style",
52+
"base",
53+
"noscript",
54+
"template"
55+
],
56+
"types": [
57+
"vite/client"
4658
]
4759
}
4860
}

0 commit comments

Comments
 (0)