From e586d7d704d475afe3373a1de6ae20d504f79d6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:25:23 +0000 Subject: Sync from a8e1c0a7402940e0fc5beef669522b315052df1b --- .../container-with-vitest/src/components/Card.astro | 8 ++++++++ .../container-with-vitest/src/components/Counter.jsx | 14 ++++++++++++++ .../src/components/CounterLight.astro | 9 +++++++++ .../src/components/ReactWrapper.astro | 5 +++++ .../container-with-vitest/src/pages/[locale].astro | 20 ++++++++++++++++++++ examples/container-with-vitest/src/pages/api.ts | 11 +++++++++++ examples/container-with-vitest/src/pages/index.astro | 16 ++++++++++++++++ 7 files changed, 83 insertions(+) create mode 100644 examples/container-with-vitest/src/components/Card.astro create mode 100644 examples/container-with-vitest/src/components/Counter.jsx create mode 100644 examples/container-with-vitest/src/components/CounterLight.astro create mode 100644 examples/container-with-vitest/src/components/ReactWrapper.astro create mode 100644 examples/container-with-vitest/src/pages/[locale].astro create mode 100644 examples/container-with-vitest/src/pages/api.ts create mode 100644 examples/container-with-vitest/src/pages/index.astro (limited to 'examples/container-with-vitest/src') diff --git a/examples/container-with-vitest/src/components/Card.astro b/examples/container-with-vitest/src/components/Card.astro new file mode 100644 index 000000000..a7e49f41c --- /dev/null +++ b/examples/container-with-vitest/src/components/Card.astro @@ -0,0 +1,8 @@ +--- + +--- + +
+ This is a card + +
diff --git a/examples/container-with-vitest/src/components/Counter.jsx b/examples/container-with-vitest/src/components/Counter.jsx new file mode 100644 index 000000000..2148bf3d8 --- /dev/null +++ b/examples/container-with-vitest/src/components/Counter.jsx @@ -0,0 +1,14 @@ +import { useState } from 'react'; + +export default function({ initialCount }) { + const [count, setCount] = useState(initialCount || 0); + return ( +
+

Counter

+

Count: {count}

+ +
+ ) +} diff --git a/examples/container-with-vitest/src/components/CounterLight.astro b/examples/container-with-vitest/src/components/CounterLight.astro new file mode 100644 index 000000000..7cee23bbe --- /dev/null +++ b/examples/container-with-vitest/src/components/CounterLight.astro @@ -0,0 +1,9 @@ +--- +interface Props { + count?: number; +} + +let { count = 0 } = Astro.props; +--- + +

{count}

diff --git a/examples/container-with-vitest/src/components/ReactWrapper.astro b/examples/container-with-vitest/src/components/ReactWrapper.astro new file mode 100644 index 000000000..73ac6baeb --- /dev/null +++ b/examples/container-with-vitest/src/components/ReactWrapper.astro @@ -0,0 +1,5 @@ +--- +import Counter from './Counter.jsx'; +--- + + diff --git a/examples/container-with-vitest/src/pages/[locale].astro b/examples/container-with-vitest/src/pages/[locale].astro new file mode 100644 index 000000000..b76d36d39 --- /dev/null +++ b/examples/container-with-vitest/src/pages/[locale].astro @@ -0,0 +1,20 @@ +--- +export function getStaticPaths() { + return [{ params: { locale: 'en' } }]; +} +const { locale } = Astro.params; +--- + + + + + + + + Astro + + +

Astro

+

Locale: {locale}

+ + diff --git a/examples/container-with-vitest/src/pages/api.ts b/examples/container-with-vitest/src/pages/api.ts new file mode 100644 index 000000000..c30def5bb --- /dev/null +++ b/examples/container-with-vitest/src/pages/api.ts @@ -0,0 +1,11 @@ +export function GET() { + const json = { + foo: 'bar', + number: 1, + }; + return new Response(JSON.stringify(json), { + headers: { + 'content-type': 'application/json', + }, + }); +} diff --git a/examples/container-with-vitest/src/pages/index.astro b/examples/container-with-vitest/src/pages/index.astro new file mode 100644 index 000000000..2d1410736 --- /dev/null +++ b/examples/container-with-vitest/src/pages/index.astro @@ -0,0 +1,16 @@ +--- + +--- + + + + + + + + Astro + + +

Astro

+ + -- cgit v1.2.3