diff options
Diffstat (limited to 'packages/integrations/vercel/test/fixtures')
87 files changed, 702 insertions, 0 deletions
diff --git a/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs b/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs new file mode 100644 index 000000000..942139f3d --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/basic/astro.config.mjs @@ -0,0 +1,8 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + functionPerRoute: true + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/basic/package.json b/packages/integrations/vercel/test/fixtures/basic/package.json new file mode 100644 index 000000000..d74792900 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/basic/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-basic", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/basic/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/basic/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/basic/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/basic/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/basic/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/basic/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs b/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs new file mode 100644 index 000000000..eb2c7699e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/astro.config.mjs @@ -0,0 +1,9 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + functionPerRoute: true + }), + output: "server" +}); diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json b/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json new file mode 100644 index 000000000..5180b3999 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-function-per-route", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/prerender.astro b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/prerender.astro new file mode 100644 index 000000000..c61b83a97 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/prerender.astro @@ -0,0 +1,12 @@ +--- +export const prerender = true; +--- + +<html> + <head> + <title>Prerendered Page</title> + </head> + <body> + <h1>Prerendered Page</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/functionPerRoute/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/image/astro.config.mjs b/packages/integrations/vercel/test/fixtures/image/astro.config.mjs new file mode 100644 index 000000000..78923f2cb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/image/astro.config.mjs @@ -0,0 +1,15 @@ +import vercel from '@astrojs/vercel/static'; +import { defineConfig } from 'astro/config'; +import { testImageService } from '../../../../../astro/test/test-image-service.js'; + +export default defineConfig({ + adapter: vercel({imageService: true}), + image: { + service: testImageService(), + domains: ['astro.build'], + remotePatterns: [{ + protocol: 'https', + hostname: '**.amazonaws.com', + }], + }, +}); diff --git a/packages/integrations/vercel/test/fixtures/image/package.json b/packages/integrations/vercel/test/fixtures/image/package.json new file mode 100644 index 000000000..1ad1f438d --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/image/package.json @@ -0,0 +1,12 @@ +{ + "name": "@test/astro-vercel-image", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "astro dev" + }, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/image/src/assets/astro.jpeg b/packages/integrations/vercel/test/fixtures/image/src/assets/astro.jpeg Binary files differnew file mode 100644 index 000000000..40d35ef48 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/image/src/assets/astro.jpeg diff --git a/packages/integrations/vercel/test/fixtures/image/src/assets/penguin.svg b/packages/integrations/vercel/test/fixtures/image/src/assets/penguin.svg new file mode 100644 index 000000000..d93379b68 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/image/src/assets/penguin.svg @@ -0,0 +1 @@ +<svg height="600pt" width="500pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a"><stop offset="0" stop-color="#fff" stop-opacity=".65"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="b"><stop offset="0" stop-color="#ffa63f"/><stop offset="1" stop-color="#ff0"/></linearGradient><linearGradient id="c"><stop offset="0" stop-color="#ffeed7"/><stop offset="1" stop-color="#bdbfc2"/></linearGradient><linearGradient id="d"><stop offset="0" stop-color="#fff" stop-opacity=".8"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><radialGradient id="e" cx="446.77762" cy="1219.4125" gradientTransform="scale(1.045233 .956725)" gradientUnits="userSpaceOnUse" r="195.07191"><stop offset="0" stop-color="#3f2600" stop-opacity=".6"/><stop offset="1" stop-color="#3f2600" stop-opacity="0"/></radialGradient><linearGradient id="f" gradientTransform="scale(.575262 1.738339)" gradientUnits="userSpaceOnUse" x1="400.57785" x2="400.84448" xlink:href="#c" y1="369.53015" y2="304.07886"/><linearGradient id="g" gradientTransform="scale(1.116071 .896001)" gradientUnits="userSpaceOnUse" x1="303.01761" x2="297.0856" xlink:href="#d" y1="237.93179" y2="330.09561"/><linearGradient id="h" gradientTransform="scale(.816497 1.224744)" gradientUnits="userSpaceOnUse" x1="378.93771" x2="380.27319" xlink:href="#c" y1="278.60202" y2="243.91606"/><linearGradient id="i" gradientTransform="scale(.816497 1.224744)" gradientUnits="userSpaceOnUse" x1="381.38742" x2="380.5517" xlink:href="#c" y1="277.495" y2="245.68338"/><linearGradient id="j" gradientTransform="scale(.816497 1.224744)" gradientUnits="userSpaceOnUse" x1="379.09573" x2="376.79556" xlink:href="#a" y1="240.92712" y2="281.01636"/><linearGradient id="k" gradientTransform="scale(.816497 1.224744)" gradientUnits="userSpaceOnUse" x1="389.63535" x2="387.06866" xlink:href="#a" y1="242.28218" y2="281.32513"/><linearGradient id="l" gradientTransform="scale(.812855 1.230232)" gradientUnits="userSpaceOnUse" spreadMethod="reflect" x1="437.57941" x2="437.57941" xlink:href="#c" y1="528.87177" y2="394.10361"/><linearGradient id="m" gradientTransform="scale(.649784 1.538974)" gradientUnits="userSpaceOnUse" x1="375.17325" x2="377.48541" xlink:href="#c" y1="419.78485" y2="324.03815"/><linearGradient id="n" gradientTransform="scale(1.074798 .930408)" gradientUnits="userSpaceOnUse" x1="320.75104" x2="321.32224" xlink:href="#d" y1="498.17776" y2="614.50439"/><linearGradient id="o" gradientTransform="scale(1.077001 .928504)" gradientUnits="userSpaceOnUse" x1="322.48257" x2="323.2514" xlink:href="#a" y1="435.26761" y2="488.48251"/><linearGradient id="p" gradientTransform="scale(.571707 1.749147)" gradientUnits="userSpaceOnUse" x1="411.2215" x2="411.2215" xlink:href="#a" y1="242.94365" y2="331.44858"/><linearGradient id="q" gradientTransform="scale(.572667 1.746214)" gradientUnits="userSpaceOnUse" x1="867.34546" x2="867.33453" xlink:href="#a" y1="234.73897" y2="314.83911"/><linearGradient id="r" gradientTransform="scale(1.011514 .988617)" gradientUnits="userSpaceOnUse" x1="236.25362" x2="212.5099" xlink:href="#b" y1="657.11133" y2="737.41229"/><linearGradient id="s" gradientTransform="scale(1.065499 .938527)" gradientUnits="userSpaceOnUse" x1="381.56607" x2="279.64313" xlink:href="#c" y1="655.73102" y2="386.66583"/><linearGradient id="t" gradientTransform="scale(1.009851 .990245)" gradientUnits="userSpaceOnUse" x1="218.11714" x2="203.12654" xlink:href="#b" y1="630.30475" y2="737.8537"/><linearGradient id="u" gradientTransform="scale(1.007724 .992335)" gradientUnits="userSpaceOnUse" x1="117.88966" x2="182.24524" xlink:href="#a" y1="587.23602" y2="704.73077"/><linearGradient id="v" gradientTransform="scale(.999504 1.000496)" gradientUnits="userSpaceOnUse" x1="223.10072" x2="230.53499" xlink:href="#a" y1="570.41809" y2="710.97723"/><linearGradient id="w" gradientTransform="scale(1.065499 .938527)" gradientUnits="userSpaceOnUse" x1="316.93988" x2="371.60889" xlink:href="#a" y1="474.01779" y2="582.63507"/><linearGradient id="x" gradientTransform="scale(1.218684 .820557)" gradientUnits="userSpaceOnUse" x1="284.68652" x2="285.45923" xlink:href="#b" y1="410.46326" y2="485.69934"/><linearGradient id="y" gradientTransform="scale(1.221941 .81837)" gradientUnits="userSpaceOnUse" x1="288.82358" x2="288.37628" xlink:href="#a" y1="398.85422" y2="482.55939"/><path d="m670.88202 1166.6423a203.89551 186.63016 0 1 1 -407.79102 0 203.89551 186.63016 0 1 1 407.79102 0z" fill="url(#e)" transform="matrix(1.4177 0 0 .414745 -349.5468 157.94132)"/><path d="m223.627 632.24c-22.388-32.223-26.754-136.984 25.487-201.43 25.886-30.918 32.49-52.465 34.531-81.393 1.389-32.979-23.325-131.442 69.883-138.944 94.406-7.532 89.336 85.66 88.793 134.975-.451 41.64 30.574 65.241 51.796 97.695 39.279 59.63 35.957 162.3-7.399 217.872-54.917 69.568-101.953 39.398-133.19 41.93-58.493 3.202-60.427 34.391-129.901-70.705z" transform="matrix(1.25 0 0 1.25 -125.2984 -231.75768)"/><path d="m246.571 470.864c-12.239 12.496-44.396 69.092 4.869 105.36 17.369 12.633-16.377 59.495-32.005 36.308-27.57-41.618-8.831-106.941 8.315-130.188 11.652-16.487 29.23-22.676 18.821-11.48z" fill="url(#f)" transform="matrix(-1.67739 -.0224516 -.0211236 1.4709 862.8276 -357.26968)"/><path d="m256.513 459.837c-19.915 17.717-56.176 80.091-3.288 120.606 17.37 12.632-15.393 52.463-33.79 32.089-63.963-70.82 1.669-152.254 24.262-180.25 20.192-24.347 38.078 5.752 12.816 27.555z" stroke="#000" stroke-width=".977298" transform="matrix(-1.67755 0 0 1.52374 863.8676 -382.33468)"/><path d="m399.56879 258.15753a58.37323 46.863022 0 1 1 -116.74646 0 58.37323 46.863022 0 1 1 116.74646 0z" fill="url(#g)" transform="matrix(1.26626 -.0713667 -.0459795 1.19574 -108.6094 -190.01368)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" fill="url(#h)" transform="matrix(1.30445 -.0755326 .0771251 1.34257 -165.9954 -241.86968)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" fill="url(#i)" transform="matrix(-1.81082 .0495107 .0317324 1.55333 896.7076 -349.02968)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" transform="matrix(-.823196 -.00176123 -.0182321 .852662 602.9216 -102.24288)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" transform="matrix(.59438 -.0722959 .0688176 .705838 56.6956 -31.83408)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" fill="url(#j)" transform="matrix(-.480323 -.036454 -.0467935 .475606 502.7436 22.75972)"/><path d="m328.86324 320.64151a18.087479 27.131195 0 1 1 -36.17496 0 18.087479 27.131195 0 1 1 36.17496 0z" fill="url(#k)" transform="matrix(.35691 -.0408211 .0413232 .398544 138.5816 50.73832)"/><path d="m258.702 495.425c12.836-29.103 40.114-80.226 40.695-119.758 0-31.442 94.179-38.951 101.737-7.558s26.741 78.483 38.95 101.156c12.208 22.672 47.809 94.695 9.884 157.546-34.157 55.644-137.725 99.666-193.01-7.557-18.603-37.207-15.285-83.315 1.744-123.829z" fill="url(#l)" transform="matrix(1.25 0 0 1.25 -125.2984 -232.48268)"/><path d="m242.905 473.815c-11.263 18.967-35.5 69.309 12.137 102.047 51.311 34.82 46.473 97.062-15.607 61.955-56.777-31.789-22.845-137.778-4.51-162.266 12.107-17.214 29.897-38.031 7.98-1.736z" fill="url(#m)" transform="matrix(1.38936 -.111074 .102211 1.30214 -202.3394 -230.19068)"/><path d="m256.513 449.72c-17.465 28.508-59.377 95.813-3.288 130.723 75.569 46.355 54.173 92.711-14.799 50.974-97.109-58.264-11.825-175.616 27.131-220.338 44.444-50.2 8.554 9.087-9.044 38.641z" stroke="#000" stroke-width="1.25" transform="matrix(1.25 0 0 1.25 -125.2984 -231.75768)"/><path d="m421.481 504.727c0 32.412-29.272 74.516-79.528 74.138-51.828.455-73.949-41.726-73.949-74.138s34.379-58.717 76.739-58.717c42.359 0 76.738 26.305 76.738 58.717z" fill="url(#n)" transform="matrix(1.30209 0 0 1.22525 -140.7104 -217.80968)"/><path d="m398.227 412.292c-.612 38.572-23.18 47.671-51.74 47.671-28.561 0-49.292-5.694-51.741-47.671 0-26.314 23.18-41.542 51.741-41.542 28.56 0 51.74 15.228 51.74 41.542z" fill="url(#o)" transform="matrix(1.1868 0 0 1.06708 -100.1294 -164.33068)"/><g transform="matrix(1.25 0 0 1.25 -125.2984 -231.75768)"><path d="m234.285 456.475c17.716-26.996 55.015-68.364 6.977 5.813-38.951 61.043-14.403 100.273-1.744 111.039 36.527 32.562 34.966 54.349 6.395 37.206-61.625-36.626-48.835-98.248-11.628-154.058z" fill="url(#p)"/><path d="m490.662 467.52c-15.319-31.701-64.134-111.902 2.326-18.603 60.461 84.297 18.022 143.013 10.464 148.827-7.557 5.813-33.137 17.44-25.579-2.907 7.557-20.347 45.234-58.973 12.789-127.317z" fill="url(#q)"/><path d="m220.915 716.921c-40.442-21.416-99.252 4.124-77.902-54.066 4.276-13.238-6.375-33.008.581-45.926 8.139-15.698 25.58-12.209 36.045-22.674 10.318-10.891 16.859-29.649 36.044-26.742 19.184 2.907 31.945 26.461 45.344 55.229 9.883 20.638 44.941 49.664 42.65 72.758-2.696 35.5-43.027 42.19-82.762 21.421z" fill="url(#r)" stroke="#e68c3f" stroke-width="6.25"/></g><path d="m415.072 495.764c-3.007 24.906-35.813 76.627-69.518 81.534-34.26 5.336-66.432-34.06-74.147-71.114-9.889-41.206 22.587-57.6 71.938-56.627 53.301 1.654 74.121 13.891 71.727 46.207z" fill="url(#s)" transform="matrix(.598206 .268584 -.239623 .617213 389.8156 76.21132)"/><path d="m220.274 718.402c-41.327-23.59-99.894 5.605-77.261-55.547 4.736-13.068-6.596-33.552.36-46.47 8.139-15.698 25.801-11.665 36.266-22.13 10.318-10.891 18.827-27.868 38.012-24.961 19.184 2.907 29.977 24.68 43.376 53.448 9.883 20.638 43.415 48.971 41.124 72.065-2.696 35.5-42.724 45.471-81.877 23.595z" fill="url(#t)" stroke="#e68c3f" stroke-width="6.25068" transform="matrix(-1.1685 .423145 .475283 1.16478 417.5906 -278.07368)"/><path d="m216.482 675.68c-86.531-57.503-47.308-70.96-36.843-81.425 10.318-10.891 18.827-27.868 38.012-24.961 19.184 2.907 29.977 24.68 43.376 53.448 9.883 20.638 43.06 48.918 41.124 72.065-2.616 27.11-48.19 5.487-85.669-19.127z" fill="url(#u)" transform="matrix(-.945096 .343745 .424076 .956058 403.5756 -128.59468)"/><path d="m216.506 677.071c-86.531-57.503-46.797-73.57-33.946-81.28 15.399-9.942 15.158-30.831 34.343-27.924 19.184 2.907 30.725 26.107 44.124 54.875 9.883 20.638 43.06 48.918 41.124 72.065-2.616 27.11-48.166 6.878-85.645-17.736z" fill="url(#v)" transform="matrix(1.00431 -.052286 -.0174 1.04575 -66.5614 -92.71798)"/><path d="m415.072 495.764c-3.007 24.906-35.813 76.627-69.518 81.534-34.26 5.336-66.432-34.06-74.147-71.114-9.889-41.206 22.587-57.6 71.938-56.627 53.301 1.654 74.121 13.891 71.727 46.207z" transform="matrix(.515584 .215259 -.206526 .49467 402.5476 158.30632)"/><path d="m415.072 495.764c-3.007 24.906-35.813 76.627-69.518 81.534-34.26 5.336-66.432-34.06-74.147-71.114-9.889-41.206 22.587-57.6 71.938-56.627 53.301 1.654 74.121 13.891 71.727 46.207z" fill="url(#w)" transform="matrix(.351231 .149463 -.128856 .343469 413.7696 254.03832)"/><path d="m309.954 338.729c7.147-6.77 24.811-27.066 57.961-5.755 6.162 4.01 11.162 4.377 23.021 9.455 23.726 9.749 12.382 33.259-12.744 41.108-10.758 3.489-20.536 16.556-40.129 15.439-16.734-.977-21.119-11.874-31.398-17.906-18.269-10.311-20.965-24.254-11.1-31.653 9.866-7.399 13.725-10.059 14.389-10.688z" fill="url(#x)" stroke="#e68c3f" stroke-width="3.75" transform="matrix(1.25 0 0 1.25 -125.2984 -231.75768)"/><path d="m391.251 357.645c-9.883.581-31.393 22.091-54.066 22.091s-36.044-20.929-39.532-20.929" fill="none" stroke="#e68c3f" stroke-width="2.5" transform="matrix(1.25 0 0 1.25 -125.2984 -231.75768)"/><path d="m309.954 338.729c7.147-6.77 29.691-25.348 59.588-6.328 6.299 3.766 12.804 7.865 22.478 13.464 19.162 11.748 9.671 28.678-13.286 39.39-10.418 4.495-27.593 14.415-40.671 13.721-14.533-1.408-23.935-11.399-33.567-17.906-17.67-12.303-16.597-22.237-8.389-30.508 6.205-5.679 13.183-11.204 13.847-11.833z" fill="url(#y)" transform="matrix(.627885 0 0 .595666 81.6136 -12.43538)"/></svg>
\ No newline at end of file diff --git a/packages/integrations/vercel/test/fixtures/image/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/image/src/pages/index.astro new file mode 100644 index 000000000..db7c22eeb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/image/src/pages/index.astro @@ -0,0 +1,13 @@ +--- +import { Image } from "astro:assets"; +import astro from "../assets/astro.jpeg"; +import penguin from "../assets/penguin.svg"; +--- + +<div id="basic-image"> + <Image src={astro} alt="Astro" /> +</div> + +<div id="svg"> + <Image src={penguin} alt="Astro" /> +</div> diff --git a/packages/integrations/vercel/test/fixtures/isr/astro.config.mjs b/packages/integrations/vercel/test/fixtures/isr/astro.config.mjs new file mode 100644 index 000000000..4b675ab6c --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/isr/astro.config.mjs @@ -0,0 +1,13 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: "server", + adapter: vercel({ + isr: { + bypassToken: "1c9e601d-9943-4e7c-9575-005556d774a8", + expiration: 120, + exclude: ["/two", "/excluded/[dynamic]"] + } + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/isr/package.json b/packages/integrations/vercel/test/fixtures/isr/package.json new file mode 100644 index 000000000..91eb1edeb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/isr/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-isr", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/isr/src/pages/excluded/[dynamic].astro b/packages/integrations/vercel/test/fixtures/isr/src/pages/excluded/[dynamic].astro new file mode 100644 index 000000000..54ba67fa8 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/isr/src/pages/excluded/[dynamic].astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Dynamic</title> + </head> + <body> + <h1>Dynamic</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/isr/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/isr/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/isr/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/isr/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/isr/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/isr/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/max-duration/astro.config.mjs b/packages/integrations/vercel/test/fixtures/max-duration/astro.config.mjs new file mode 100644 index 000000000..b1866a75b --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/max-duration/astro.config.mjs @@ -0,0 +1,9 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: "server", + adapter: vercel({ + maxDuration: 60 + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/max-duration/package.json b/packages/integrations/vercel/test/fixtures/max-duration/package.json new file mode 100644 index 000000000..63ec42edd --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/max-duration/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-max-duration", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/max-duration/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/max-duration/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/max-duration/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/max-duration/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/max-duration/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/max-duration/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs new file mode 100644 index 000000000..f92b18a4e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/astro.config.mjs @@ -0,0 +1,9 @@ +import vercel from "@astrojs/vercel/serverless"; +import {defineConfig} from "astro/config"; + +export default defineConfig({ + adapter: vercel({ + edgeMiddleware: true + }), + output: 'server' +}); diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/package.json b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/package.json new file mode 100644 index 000000000..777da22a5 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-edge-middleware-with-edge-file", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js new file mode 100644 index 000000000..b1a67f550 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js @@ -0,0 +1,9 @@ +/** + * @type {import("astro").MiddlewareResponseHandler} + */ +export const onRequest = async (context, next) => { + const test = 'something'; + context.cookies.set('foo', 'bar'); + const response = await next(); + return response; +}; diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/pages/index.astro new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/pages/index.astro diff --git a/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/vercel-edge-middleware.js b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/vercel-edge-middleware.js new file mode 100644 index 000000000..bf69edb3e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/vercel-edge-middleware.js @@ -0,0 +1,5 @@ +export default function ({ request, context }) { + return { + title: 'Hello world', + }; +} diff --git a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs new file mode 100644 index 000000000..f92b18a4e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/astro.config.mjs @@ -0,0 +1,9 @@ +import vercel from "@astrojs/vercel/serverless"; +import {defineConfig} from "astro/config"; + +export default defineConfig({ + adapter: vercel({ + edgeMiddleware: true + }), + output: 'server' +}); diff --git a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/package.json b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/package.json new file mode 100644 index 000000000..5e56e9ab3 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-edge-middleware-without-edge-file", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/middleware.js b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/middleware.js new file mode 100644 index 000000000..349a0aa79 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/middleware.js @@ -0,0 +1,8 @@ +/** + * @type {import("astro").MiddlewareResponseHandler} + */ +export const onRequest = async (context, next) => { + const test = 'something'; + const response = await next(); + return response; +}; diff --git a/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/pages/index.astro new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/middleware-without-edge-file/src/pages/index.astro diff --git a/packages/integrations/vercel/test/fixtures/no-output/astro.config.mjs b/packages/integrations/vercel/test/fixtures/no-output/astro.config.mjs new file mode 100644 index 000000000..179d18d38 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/no-output/astro.config.mjs @@ -0,0 +1,6 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel() +}); diff --git a/packages/integrations/vercel/test/fixtures/no-output/package.json b/packages/integrations/vercel/test/fixtures/no-output/package.json new file mode 100644 index 000000000..d77fb224f --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/no-output/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-no-output", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/no-output/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/no-output/src/pages/index.astro new file mode 100644 index 000000000..6368ce118 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/no-output/src/pages/index.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>testing</title> + </head> + <body> + <h1>testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/prerendered-error-pages/astro.config.mjs b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/astro.config.mjs new file mode 100644 index 000000000..83e1f2f38 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/astro.config.mjs @@ -0,0 +1,7 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: 'server', + adapter: vercel() +}); diff --git a/packages/integrations/vercel/test/fixtures/prerendered-error-pages/package.json b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/package.json new file mode 100644 index 000000000..5daed73b8 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-prerendered-error-pages", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/404.astro b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/404.astro new file mode 100644 index 000000000..162ff90b6 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/404.astro @@ -0,0 +1,4 @@ +--- +export const prerender = true +--- +<h1>404</h1> diff --git a/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/prerendered-error-pages/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs b/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs new file mode 100644 index 000000000..1071b7e67 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/astro.config.mjs @@ -0,0 +1,7 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: 'hybrid', + adapter: vercel(), +}); diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json b/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json new file mode 100644 index 000000000..f5d9b202a --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-redirects-serverless", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro new file mode 100644 index 000000000..9c077e2a3 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/index.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Testing</title> + </head> + <body> + <h1>Testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/subpage.astro b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/subpage.astro new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects-serverless/src/pages/subpage.astro diff --git a/packages/integrations/vercel/test/fixtures/redirects/astro.config.mjs b/packages/integrations/vercel/test/fixtures/redirects/astro.config.mjs new file mode 100644 index 000000000..707805087 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects/astro.config.mjs @@ -0,0 +1,6 @@ +import vercel from '@astrojs/vercel/static'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel(), +}); diff --git a/packages/integrations/vercel/test/fixtures/redirects/package.json b/packages/integrations/vercel/test/fixtures/redirects/package.json new file mode 100644 index 000000000..5f11f47ae --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-redirects", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/redirects/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/redirects/src/pages/index.astro new file mode 100644 index 000000000..9c077e2a3 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects/src/pages/index.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Testing</title> + </head> + <body> + <h1>Testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/redirects/src/pages/subpage.astro b/packages/integrations/vercel/test/fixtures/redirects/src/pages/subpage.astro new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects/src/pages/subpage.astro diff --git a/packages/integrations/vercel/test/fixtures/redirects/src/pages/team/articles/[...slug].astro b/packages/integrations/vercel/test/fixtures/redirects/src/pages/team/articles/[...slug].astro new file mode 100644 index 000000000..716d3bd5d --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/redirects/src/pages/team/articles/[...slug].astro @@ -0,0 +1,25 @@ +--- +export const getStaticPaths = (async () => { + const posts = [ + { slug: 'one', data: {draft: false, title: 'One'} }, + { slug: 'two', data: {draft: false, title: 'Two'} } + ]; + return posts.map((post) => { + return { + params: { slug: post.slug }, + props: { draft: post.data.draft, title: post.data.title }, + }; + }); +}) + +const { slug } = Astro.params; +const { title } = Astro.props; +--- +<html> + <head> + <title>{ title }</title> + </head> + <body> + <h1>{ title }</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/server-islands/astro.config.mjs b/packages/integrations/vercel/test/fixtures/server-islands/astro.config.mjs new file mode 100644 index 000000000..534197429 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/server-islands/astro.config.mjs @@ -0,0 +1,10 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: "server", + adapter: vercel(), + experimental: { + serverIslands: true, + } +}); diff --git a/packages/integrations/vercel/test/fixtures/server-islands/package.json b/packages/integrations/vercel/test/fixtures/server-islands/package.json new file mode 100644 index 000000000..0a397ff90 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/server-islands/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-server-islands", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/server-islands/src/components/Island.astro b/packages/integrations/vercel/test/fixtures/server-islands/src/components/Island.astro new file mode 100644 index 000000000..9d2832bc1 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/server-islands/src/components/Island.astro @@ -0,0 +1 @@ +<h1>I'm an island</h1> diff --git a/packages/integrations/vercel/test/fixtures/server-islands/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/server-islands/src/pages/index.astro new file mode 100644 index 000000000..835126c2b --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/server-islands/src/pages/index.astro @@ -0,0 +1,12 @@ +--- +import Island from '../components/Island.astro'; +--- +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + <Island server:defer /> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/serverless-prerender/astro.config.mjs b/packages/integrations/vercel/test/fixtures/serverless-prerender/astro.config.mjs new file mode 100644 index 000000000..4d8f76288 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-prerender/astro.config.mjs @@ -0,0 +1,10 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + // Pass some value to make sure it doesn't error out + includeFiles: ['included.js'], + }), + output: 'server' +}); diff --git a/packages/integrations/vercel/test/fixtures/serverless-prerender/included.js b/packages/integrations/vercel/test/fixtures/serverless-prerender/included.js new file mode 100644 index 000000000..4e64b2d61 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-prerender/included.js @@ -0,0 +1 @@ +'works'
\ No newline at end of file diff --git a/packages/integrations/vercel/test/fixtures/serverless-prerender/package.json b/packages/integrations/vercel/test/fixtures/serverless-prerender/package.json new file mode 100644 index 000000000..98b6abfa9 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-prerender/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-serverless-prerender", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/serverless-prerender/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/serverless-prerender/src/pages/index.astro new file mode 100644 index 000000000..b6b833e53 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-prerender/src/pages/index.astro @@ -0,0 +1,12 @@ +--- +export const prerender = import.meta.env.PRERENDER; +--- + +<html> + <head> + <title>testing</title> + </head> + <body> + <h1>testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/astro.config.mjs b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/astro.config.mjs new file mode 100644 index 000000000..3132bfc53 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/astro.config.mjs @@ -0,0 +1,11 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + // Pass some value to make sure it doesn't error out + includeFiles: ['included.js'], + functionPerRoute: true, + }), + output: 'server' +}); diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/included.js b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/included.js new file mode 100644 index 000000000..4e64b2d61 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/included.js @@ -0,0 +1 @@ +'works'
\ No newline at end of file diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/package.json b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/package.json new file mode 100644 index 000000000..730e1e0eb --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-serverless-with-dynamic-routes", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/[id]/index.astro b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/[id]/index.astro new file mode 100644 index 000000000..4eab5952d --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/[id]/index.astro @@ -0,0 +1,12 @@ +--- +export const prerender = false; +--- + +<html> + <head> + <title>testing {Astro.params.id}</title> + </head> + <body> + <h1>testing {Astro.params.id}</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/api/[id].js b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/api/[id].js new file mode 100644 index 000000000..f54e673a8 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/api/[id].js @@ -0,0 +1,7 @@ +export const prerender = false; + +export async function GET({ params }) { + return Response.json({ + id: params.id + }); +} diff --git a/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/index.astro new file mode 100644 index 000000000..b6b833e53 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/serverless-with-dynamic-routes/src/pages/index.astro @@ -0,0 +1,12 @@ +--- +export const prerender = import.meta.env.PRERENDER; +--- + +<html> + <head> + <title>testing</title> + </head> + <body> + <h1>testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/static-assets/astro.config.mjs b/packages/integrations/vercel/test/fixtures/static-assets/astro.config.mjs new file mode 100644 index 000000000..20b0b8e2b --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static-assets/astro.config.mjs @@ -0,0 +1,4 @@ +import { defineConfig } from 'astro/config'; + +export default defineConfig({ +}); diff --git a/packages/integrations/vercel/test/fixtures/static-assets/package.json b/packages/integrations/vercel/test/fixtures/static-assets/package.json new file mode 100644 index 000000000..bf47be6e7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static-assets/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-static-assets", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/static-assets/src/pages/index.astro b/packages/integrations/vercel/test/fixtures/static-assets/src/pages/index.astro new file mode 100644 index 000000000..9c077e2a3 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static-assets/src/pages/index.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Testing</title> + </head> + <body> + <h1>Testing</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/static/astro.config.mjs b/packages/integrations/vercel/test/fixtures/static/astro.config.mjs new file mode 100644 index 000000000..6e2d7bff7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static/astro.config.mjs @@ -0,0 +1,6 @@ +import vercel from '@astrojs/vercel/static'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel() +}); diff --git a/packages/integrations/vercel/test/fixtures/static/package.json b/packages/integrations/vercel/test/fixtures/static/package.json new file mode 100644 index 000000000..2cfd7db1e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-static", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/static/src/pages/404.astro b/packages/integrations/vercel/test/fixtures/static/src/pages/404.astro new file mode 100644 index 000000000..9e307c5c2 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static/src/pages/404.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>404</title> + </head> + <body> + <h1>404</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/static/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/static/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/static/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/static/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/static/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/streaming/astro.config.mjs b/packages/integrations/vercel/test/fixtures/streaming/astro.config.mjs new file mode 100644 index 000000000..94f52a3d6 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/streaming/astro.config.mjs @@ -0,0 +1,7 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + output: "server", + adapter: vercel() +}); diff --git a/packages/integrations/vercel/test/fixtures/streaming/package.json b/packages/integrations/vercel/test/fixtures/streaming/package.json new file mode 100644 index 000000000..1ae09b73a --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/streaming/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/vercel-streaming", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/streaming/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/streaming/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/streaming/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/streaming/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/streaming/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/streaming/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/astro.config.mjs b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/astro.config.mjs new file mode 100644 index 000000000..794734f78 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/astro.config.mjs @@ -0,0 +1,10 @@ +import vercel from '@astrojs/vercel/serverless'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + speedInsights: { + enabled: true + } + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/package.json b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/package.json new file mode 100644 index 000000000..d1e9a9f76 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-with-speed-insights-enabled-output-as-server", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-server/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/astro.config.mjs b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/astro.config.mjs new file mode 100644 index 000000000..589aa3662 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/astro.config.mjs @@ -0,0 +1,10 @@ +import vercel from '@astrojs/vercel/static'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + speedInsights: { + enabled: true + } + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/package.json b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/package.json new file mode 100644 index 000000000..c349e5b15 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-with-speed-insights-enabled-output-as-static", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-speed-insights-enabled/output-as-static/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/astro.config.mjs b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/astro.config.mjs new file mode 100644 index 000000000..7a3cec1fd --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/astro.config.mjs @@ -0,0 +1,10 @@ +import vercel from '@astrojs/vercel/static'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + adapter: vercel({ + webAnalytics: { + enabled: true + } + }) +}); diff --git a/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/package.json b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/package.json new file mode 100644 index 000000000..9dbcd9728 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/package.json @@ -0,0 +1,9 @@ +{ + "name": "@test/astro-vercel-with-web-analytics-enabled-output-as-static", + "version": "0.0.0", + "private": true, + "dependencies": { + "@astrojs/vercel": "workspace:*", + "astro": "^4.14.6" + } +} diff --git a/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/one.astro b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/one.astro new file mode 100644 index 000000000..0c7fb90a7 --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/one.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>One</title> + </head> + <body> + <h1>One</h1> + </body> +</html> diff --git a/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/two.astro b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/two.astro new file mode 100644 index 000000000..e7ba9910e --- /dev/null +++ b/packages/integrations/vercel/test/fixtures/with-web-analytics-enabled/output-as-static/src/pages/two.astro @@ -0,0 +1,8 @@ +<html> + <head> + <title>Two</title> + </head> + <body> + <h1>Two</h1> + </body> +</html> |