aboutsummaryrefslogtreecommitdiff
path: root/packages/astro/test/fixtures/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro/test/fixtures/fetch')
-rw-r--r--packages/astro/test/fixtures/fetch/astro.config.mjs10
-rw-r--r--packages/astro/test/fixtures/fetch/package.json14
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/AlreadyImported.astro1
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/AstroComponent.astro1
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/CustomDeclaration.astro5
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/JsxComponent.jsx7
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte1
-rw-r--r--packages/astro/test/fixtures/fetch/src/components/VueComponent.vue16
-rw-r--r--packages/astro/test/fixtures/fetch/src/pages/index.astro23
9 files changed, 78 insertions, 0 deletions
diff --git a/packages/astro/test/fixtures/fetch/astro.config.mjs b/packages/astro/test/fixtures/fetch/astro.config.mjs
new file mode 100644
index 000000000..92bd62f2b
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/astro.config.mjs
@@ -0,0 +1,10 @@
+import { defineConfig } from 'astro/config';
+
+import preact from '@astrojs/preact';
+import svelte from '@astrojs/svelte';
+import vue from '@astrojs/vue';
+
+// https://astro.build/config
+export default defineConfig({
+ integrations: [preact(), svelte(), vue()],
+}); \ No newline at end of file
diff --git a/packages/astro/test/fixtures/fetch/package.json b/packages/astro/test/fixtures/fetch/package.json
new file mode 100644
index 000000000..f06807168
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@test/fetch",
+ "version": "0.0.0",
+ "private": true,
+ "dependencies": {
+ "@astrojs/preact": "workspace:*",
+ "@astrojs/svelte": "workspace:*",
+ "@astrojs/vue": "workspace:*",
+ "astro": "workspace:*",
+ "preact": "^10.26.4",
+ "svelte": "^5.25.3",
+ "vue": "^3.5.13"
+ }
+}
diff --git a/packages/astro/test/fixtures/fetch/src/components/AlreadyImported.astro b/packages/astro/test/fixtures/fetch/src/components/AlreadyImported.astro
new file mode 100644
index 000000000..40dd58012
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/AlreadyImported.astro
@@ -0,0 +1 @@
+<span id="already-imported">{typeof fetch}</span>
diff --git a/packages/astro/test/fixtures/fetch/src/components/AstroComponent.astro b/packages/astro/test/fixtures/fetch/src/components/AstroComponent.astro
new file mode 100644
index 000000000..e56cfd3cd
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/AstroComponent.astro
@@ -0,0 +1 @@
+<span id="astro-component">{typeof fetch}</span>
diff --git a/packages/astro/test/fixtures/fetch/src/components/CustomDeclaration.astro b/packages/astro/test/fixtures/fetch/src/components/CustomDeclaration.astro
new file mode 100644
index 000000000..7fdf16903
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/CustomDeclaration.astro
@@ -0,0 +1,5 @@
+---
+const fetch = 0;
+---
+
+<span id="custom-declaration">{typeof fetch}</span>
diff --git a/packages/astro/test/fixtures/fetch/src/components/JsxComponent.jsx b/packages/astro/test/fixtures/fetch/src/components/JsxComponent.jsx
new file mode 100644
index 000000000..071473ea9
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/JsxComponent.jsx
@@ -0,0 +1,7 @@
+import { h } from 'preact';
+
+export default function() {
+ return (
+ <span id="jsx">{ typeof fetch }</span>
+ );
+} \ No newline at end of file
diff --git a/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte b/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte
new file mode 100644
index 000000000..49f32acbb
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/SvelteComponent.svelte
@@ -0,0 +1 @@
+<span id="svelte">{ typeof fetch }</span>
diff --git a/packages/astro/test/fixtures/fetch/src/components/VueComponent.vue b/packages/astro/test/fixtures/fetch/src/components/VueComponent.vue
new file mode 100644
index 000000000..1ea2e2ccc
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/components/VueComponent.vue
@@ -0,0 +1,16 @@
+<template>
+ <span id="vue">{{ type }}</span>
+</template>
+
+<script>
+import { defineComponent } from 'vue'
+
+export default defineComponent({
+ setup() {
+ return {
+ type: typeof fetch
+ }
+ }
+})
+</script>
+
diff --git a/packages/astro/test/fixtures/fetch/src/pages/index.astro b/packages/astro/test/fixtures/fetch/src/pages/index.astro
new file mode 100644
index 000000000..944873d0c
--- /dev/null
+++ b/packages/astro/test/fixtures/fetch/src/pages/index.astro
@@ -0,0 +1,23 @@
+---
+import AlreadyImported from '../components/AlreadyImported.astro';
+import Test from '../components/AstroComponent.astro';
+import CustomDeclaration from '../components/CustomDeclaration.astro';
+import JsxComponent from '../components/JsxComponent.jsx';
+import SvelteComponent from '../components/SvelteComponent.svelte';
+import VueComponent from '../components/VueComponent.vue';
+---
+
+<html lang="en">
+<head>
+ <title>Global fetch</title>
+</head>
+<body>
+ <span id="astro-page">{typeof fetch}</span>
+ <Test />
+ <AlreadyImported />
+ <CustomDeclaration />
+ <JsxComponent />
+ <SvelteComponent />
+ <VueComponent />
+</body>
+</html>