-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(react-server): test fresh install (#188)
- Loading branch information
Showing
14 changed files
with
102 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
# react-server basic example | ||
|
||
This example currently works only when running inside this monorepo. | ||
|
||
- https://rsc-experiment-hiroshi.vercel.app | ||
- https://rsc-experiment.hiro18181.workers.dev | ||
|
||
```sh | ||
npx degit@latest hi-ogawa/vite-plugins/packages/react-server/examples/basic my-project | ||
cd my-project | ||
|
||
pnpm i | ||
pnpm dev dev | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/react-server/examples/basic/src/routes/test/other/client.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use client"; | ||
|
||
import { Link } from "@hiogawa/react-server/client"; | ||
|
||
export function LinkInClientComponent() { | ||
return ( | ||
<div> | ||
<Link className="antd-link" href="/"> | ||
LinkInClientComponent | ||
</Link> | ||
</div> | ||
); | ||
} |
11 changes: 10 additions & 1 deletion
11
packages/react-server/examples/basic/src/routes/test/other/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import { LinkInClientComponent } from "./client"; | ||
|
||
export default function Page() { | ||
return <div>Other Page</div>; | ||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<h4 className="font-bold">Other Page</h4> | ||
<div> | ||
<LinkInClientComponent /> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
# react-server starter example | ||
|
||
https://react-server-starter.hiro18181.workers.dev/ | ||
- https://react-server-starter.hiro18181.workers.dev/ | ||
|
||
```sh | ||
# download template | ||
npx degit@latest hi-ogawa/vite-plugins/packages/react-server/examples/starter my-project | ||
cd my-project | ||
|
||
# development | ||
npm i | ||
npm run dev | ||
pnpm i | ||
pnpm dev | ||
|
||
# build and preview | ||
npm run build | ||
npm run preview | ||
pnpm build | ||
pnpm preview | ||
|
||
# deploy cloudflare workers | ||
npm i -D wrangler | ||
npm run cf-build | ||
npm run cf-preview | ||
npm run cf-release | ||
pnpm cf-build | ||
pnpm cf-preview | ||
pnpm cf-release | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
# run examples/basic e2e on fresh installation | ||
# bash misc/test.sh | ||
|
||
test_dir="/tmp/react-server-test" | ||
lib_dir="$PWD" | ||
|
||
rm -rf "$test_dir" | ||
cp -r examples/basic "$test_dir" | ||
|
||
cd "$test_dir" | ||
rm -rf dist node_modules | ||
|
||
pnpm i "@hiogawa/react-server@file:$lib_dir" | ||
|
||
if test "${CI:-}" = "true"; then | ||
npx playwright install chromium | ||
fi | ||
|
||
pnpm test-e2e | ||
pnpm build | ||
pnpm test-e2e-preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.