summaryrefslogtreecommitdiff
path: root/packages/integrations/netlify/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-05[ci] formatGravatar matthewp 2-6/+8
2023-06-05Redirects (#7067)Gravatar Matthew Phillips 3-130/+37
* Redirects spike * Allow redirects in static mode * Support in Netlify as well * Adding a changeset * Rename file * Fix build problem * Refactor to be more modular * Fix location ref * Late test should only run in SSR * Support redirects in Netlify SSR configuration (#7167) * Implement support for dynamic routes in redirects (#7173) * Implement support for dynamic routes in redirects * Remove the .only * No need to special-case redirects in static build * Implement support for redirects config in the Vercel adapter (#7182) * Implement support for redirects config in the Vercel adapter * Remove unused condition * Move to a internal helper package * Add support for the object notation in redirects * Use status 308 for non-GET redirects (#7186) * Implement redirects in Cloudflare (#7198) * Implement redirects in Cloudflare * Fix build * Update tests b/c of new ordering * Debug issue * Use posix.join * Update packages/underscore-redirects/package.json Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> * Update based on review comments * Update broken test --------- Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> * Test that redirects can come from middleware (#7213) * Test that redirects can come from middleware * Allow non-promise returns for middleware * Implement priority (#7210) * Refactor * Fix netlify test ordering * Fix ordering again * Redirects: Allow preventing the output of the static HTML file (#7245) * Do a simple push for priority * Adding changesets * Put the implementation behind a flag. * Self review * Update .changeset/chatty-actors-stare.md Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update docs on dynamic restrictions. * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Code review changes * Document netlify static adapter * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Slight reword * Update .changeset/twenty-suns-vanish.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Add a note about public/_redirects file * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Emanuele Stoppa <my.burning@gmail.com> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-05-17feat: hybrid output (#6991)Gravatar Happydev 2-2/+6
* update config schema * adapt default route `prerender` value * adapt error message for hybrid output * core hybrid output support * add JSDocs for hybrid output * dev server hybrid output support * defer hybrid output check * update endpoint request warning * support `output=hybrid` in integrations * put constant variable out of for loop * revert: reapply back ssr plugin in ssr mode * change `prerender` option default * apply `prerender` by default in hybrid mode * simplfy conditional * update config schema * add `isHybridOutput` helper * more readable prerender condition * set default prerender value if no export is found * only add `pagesVirtualModuleId` ro rollup input in `output=static` * don't export vite plugin * remove unneeded check * don't prerender when it shouldn't * extract fallback `prerender` meta Extract the fallback `prerender` module meta out of the `scan` function. It shouldn't be its responsibility to handle that * pass missing argument to function * test: update cloudflare integration tests * test: update tests of vercel integration * test: update tests of node integration * test: update tests of netlify func integration * test: update tests of netlify edge integration * throw when `hybrid` mode is malconfigured * update node integraiton `output` warning * test(WIP): skip node prerendering tests for now * remove non-existant import * test: bring back prerendering tests * remove outdated comments * test: refactor test to support windows paths * remove outdated comments * apply sarah review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * docs: `experiment.hybridOutput` jsodcs * test: prevent import from being cached * refactor: extract hybrid output check to function * add `hybrid` to output warning in adapter hooks * chore: changeset * add `.js` extension to import * chore: use spaces instead of tabs for gh formating * resolve merge conflict * chore: move test to another file for consitency --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2023-04-10Fix no edge functions deployed to netlify (#6793)Gravatar André Alves 1-1/+2
2023-04-06[ci] formatGravatar matthewp 1-4/+5
2023-04-06Use Deno API to set Astro.clientAddress (#6651)Gravatar Matthew Phillips 1-2/+5
* Use Deno API to set Astro.clientAddress * Add types
2023-03-20feat(all): Migrate to TypeScript 5.0 (#6579)Gravatar Erika 1-1/+1
2023-03-10fix: Enforce the usage of type imports when possible (#6502)Gravatar Erika 1-1/+1
2023-02-21Use .mjs extension when building for netlify edge and vercel serverless (#6317)Gravatar Bjorn Lu 1-1/+1
2023-02-21fix(cookies): Update Undici to 5.20 and fix cookies behaviour (#6323)Gravatar Erika 1-28/+5
* fix(cookies): Update Undici to 5.20 and fix cookies behaviour * chore: changeset
2023-01-27[ci] formatGravatar matthewp 2-2/+2
2023-01-27feat(@astrojs/netlify): Add on-demand builders Netlify functions (#5874)Gravatar Juan Miguel Guerrero 4-7/+14
* Add on-demand builders option * chore: add changeset * docs: add documentation in configuration section * Update packages/integrations/netlify/README.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/integrations/netlify/README.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update packages/integrations/netlify/README.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/twenty-pans-agree.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-01-23[ci] formatGravatar matthewp 1-23/+34
2023-01-23Support prerender in Netlify redirects (#5904)Gravatar Matthew Phillips 3-16/+104
* Support prerender in Netlify redirects * Updated sorting algorithm * Update packages/integrations/netlify/src/shared.ts Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
2023-01-18[ci] formatGravatar natemoo-re 1-1/+0
2023-01-18fix(#5723): build prerendered pages with Netlify edge functions (#5885)Gravatar Nate Moore 1-15/+0
* fix(#5723): build prerendered pages with Netlify edge functions * chore: add changeset Co-authored-by: Nate Moore <nate@astro.build>
2023-01-09Output assets to `_astro` directory (#5772)Gravatar Nate Moore 1-1/+2
* WIP: emit assets to _astro * chore: better _astro handling * refactor: emit server assets to `chunks/` * chore: update /asset tests * test: add explicit build output tests * fix: update image to emit to configured asset path * chore: update changeset * chore: update image tests * chore: update image tests * test: update css test * test: update bundling test * test: update tests * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * chore: add clarifying comment Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2023-01-06Drop Node 14 in CI for Node 16 and add Node 18 to the matrix (#5768)Gravatar Erika 1-12/+105
* ci(node): Move CI to Node 16 and add Node 18 to the matrix * fix(netlify): Fix set-cookie not working on Node 18 * fix(netlify): Handle if `set-cookie` is already somehow an array (apparently it can?) * test(node): Fix `toPromise` to match Astro's * fix(tests): Use the actual underlying ArrayBuffer instance to create the buffer in toPromise * chore: changeset
2023-01-05feat: change path into assets (#5584)Gravatar wulinsheng123 1-1/+1
* feat: change path * feat: fix bug #5502 * fix: astro fix to patch * feat: change to major * chore: update changelog * fix: change entryFileNames into assets folder * fix: fix error message in test Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2023-01-03Remove deprecated APIs (#5707)Gravatar Bjorn Lu 2-20/+0
* Remove deprecated Astro globals * Remove deprecated hook param * Fix test * Add changeset * Add TODO
2022-12-19Fix spelling mistakes found by codespell and mwic (#5627)Gravatar Anders Kaseorg 1-1/+1
2022-12-16Experimental Prerender API (#5297)Gravatar Nate Moore 1-4/+14
* wip: hybrid output * wip: hybrid output mvp * refactor: move hybrid => server * wip: hybrid support for `output: 'server'` * feat(hybrid): overwrite static files * fix: update static build * feat(hybrid): skip page generation if no static entrypoints * feat: migrate from hybrid output => prerender flag * fix: appease typescript * fix: appease typescript * fix: appease typescript * fix: appease typescript * fix: improve static cleanup * attempt: avoid preprocess scanning * hack: force generated .js files to be treated as ESM * better handling for astro metadata * fix: update scanner plugin * fix: page name bug * fix: keep ssr false when generating pages * fix: force output to be treated as ESM * fix: client output should respect buildConfig * fix: ensure outDir is always created * fix: do not replace files with noop * fix(netlify): add support for `experimental_prerender` pages * feat: switch to `experimental_prerender` * chore: update es-module-lexer code in test * feat: improved code-splitting, cleanup * feat: move prerender behind flag * test: prerender * test: update prerender test * chore: update lockfile * fix: only match `.html` files when resolving assets * chore: update changeset * chore: remove ESM hack * chore: allow `--experimental-prerender` flag, move `--experimental-error-overlay` into subobject * chore: update changeset * test(vite-plugin-scanner): add proper unit tests for vite-plugin-scanner * chore: remove leftover code * chore: add comment on cleanup task * refactor: move manual chunks logic to vite-plugin-prerender * fix: do not support let declarations * test: add var test * refactor: prefer existing util * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/core/errors/errors-data.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> * Update packages/astro/src/@types/astro.ts Co-authored-by: Chris Swithinbank <swithinbank@gmail.com> Co-authored-by: Nate Moore <nate@astro.build> Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-11-08Support environment variables in Cloudflare and Netlify Edge functions (#5301)Gravatar Bjorn Lu 1-1/+1
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-10-12[ci] formatGravatar matthewp 2-3/+3
2022-10-12Node.js standalone mode + support for astro preview (#5056)Gravatar Matthew Phillips 2-27/+47
* wip * Deprecate buildConfig and move to config.build * Implement the standalone server * Stay backwards compat * Add changesets * correctly merge URLs * Get config earlier * update node tests * Return the preview server * update remaining tests * swap usage and config ordering * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/metal-pumas-walk.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/metal-pumas-walk.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/stupid-points-refuse.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update .changeset/stupid-points-refuse.md Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Link to build.server config Co-authored-by: Fred K. Schott <fkschott@gmail.com> Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2022-09-28[ci] formatGravatar matthewp 2-4/+4
2022-09-28Astro.cookies implementation (#4876)Gravatar Matthew Phillips 2-1/+17
* Astro.cookies implementation * Remove unused var * Fix build * Add a changesetp * Remove spoken-word expires
2022-09-20[ci] formatGravatar matthewp 1-1/+1
2022-09-20Fixes processing of images in Netlify functions (#4820)Gravatar Matthew Phillips 1-3/+8
2022-09-12Fix route validation for Netlify Edge (#4722)Gravatar Ben Holmes 1-1/+4
* fix: serialize route pattern for Netlify edge Co-authored-by: Jackie Macharia <jackiewmacharia> * chore: changeset
2022-08-11[ci] formatGravatar FredKSchott 1-1/+1
2022-08-11Add 404 routing logic to Netlify redirects file (#4274)Gravatar Matthew Phillips 1-0/+5
* Add 404 routing logic to Netlify redirects file * changeset
2022-07-25[ci] formatastro@0.0.0-rc-20220725043302@astrojs/vue@0.0.0-rc-20220725043302@astrojs/vercel@0.0.0-rc-20220725043302@astrojs/tailwind@0.0.0-rc-20220725043302@astrojs/svelte@0.0.0-rc-20220725043302@astrojs/sitemap@0.0.0-rc-20220725043302@astrojs/prefetch@0.0.0-rc-20220725043302@astrojs/partytown@0.0.0-rc-20220725043302@astrojs/node@0.0.0-rc-20220725043302@astrojs/netlify@0.0.0-rc-20220725043302@astrojs/mdx@0.0.0-rc-20220725043302@astrojs/markdown-remark@0.0.0-rc-20220725043302@astrojs/markdown-component@0.0.0-rc-20220725043302@astrojs/lit@0.0.0-rc-20220725043302@astrojs/image@0.0.0-rc-20220725043302@astrojs/deno@0.0.0-rc-20220725043302@astrojs/cloudflare@0.0.0-rc-20220725043302Gravatar FredKSchott 2-5/+9
2022-07-25Add the `output` option (#4015)Gravatar Matthew Phillips 2-0/+10
* Start of work on astroConfig.mode === 'server' * Add tests and more * adapter -> deploy in some places * Add fallback for `adapter` config * Update more tests * Update image tests * Fix clientAddress test * Updates based on PR review * Add a changeset * Update integrations tests + readme * Oops * Remove old option * Rename `mode` to `output` * Update Node adapter test * Update test * fred pass * fred pass * fred pass * fix test Co-authored-by: Fred K. Schott <fkschott@gmail.com>
2022-07-22SSR 404 and 500 routes in adapters (#4018)Gravatar Okiki Ojo 1-2/+4
* fix(WIP): SSR 404 and 500 routes * Implement the feature Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-07-19Adds support for Astro.clientAddress (#3973)Gravatar Matthew Phillips 2-0/+9
* Adds support for Astro.clientAddress * Pass through mode and adapterName in SSG * Pass through the mode provided * Provide an adapter specific error message when possible
2022-06-27[ci] formatGravatar bholmesdev 1-1/+1
2022-06-27Refactor: remove Deno shim to esbuild "banner" (#3734)Gravatar Ben Holmes 3-5/+8
* refactor: remove Deno shim to esbuild "banner" * refactor: move shim to const * refactor: add shim to netlify edge * chore: changeset
2022-06-21[ci] formatGravatar matthewp 1-6/+6
2022-06-21Support re-exporting astro components containing client components (#3625)Gravatar Matthew Phillips 1-1/+21
* Support re-exporting astro components containing client components * Include metadata for markdown too * Fix ssr, probably * Inject post-build * Remove tagName custom element test * Allows using the constructor for lit elements * Fix hoisted script scanning * Pass through plugin context * Get edge functions working in the edge tests * Fix types for the edge function integration * Upgrade the compiler * Upgrade compiler version * Better release notes for lit * Update .changeset/unlucky-hairs-camp.md Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Properly test that the draft was not rendered * Prevent from rendering draft posts * Add a changeset about the build perf improvement. Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-17[ci] formatGravatar bholmesdev 1-1/+1
2022-06-16Fix: Netlify edge deployment when using markdown (#3612)Gravatar Ben Holmes 1-2/+2
* wip: revert sitemap PR * fix: extract SSR-ready "slug" helper to separate module * Un-revert sitemap PR. Not to blame! This reverts commit 7cd2a8a5ea1e9fdee6837425881328928ceff852. * fix: use .netlify for edge deployment test * refactor: add md file to edge function fixture * fix: add netlify edge tests to ci * chore: remove stray console log * wip: undo "dist" change on edge tests * chore: changeset * Revert "wip: undo "dist" change on edge tests" This reverts commit 70e565ef06b228150547bca92bc12d1c236c0ed9. * temp: add ignore to breaking edge tests
2022-06-15[ci] formatGravatar tony-sull 2-4/+7
2022-06-15Adds support base64 encoding in Netlify Functions (#3592)Gravatar Tony Sullivan 2-7/+54
* Adding support for base64 encoded responses in Netlify Functions * chore: add changeset * removing the regex check for a more simple header-based check * nit: cleaning up the readme a bit
2022-06-07[ci] formatGravatar matthewp 1-5/+6
2022-06-07Allow dynamic imports when using Netlify Edge Functions (#3535)Gravatar Matthew Phillips 1-2/+33
* Allow dynamic imports when using Netlify Edge Functions * Update deno test script and changeset
2022-06-06[ci] formatfix/map-file-404-logsGravatar FredKSchott 5-8/+7
2022-06-02fix: alias astro to @types/astro (#3503)Gravatar William Tetlow 1-2/+11
* fix: alias astro to @types/astro * fix: handle resolve.alias being array * chore: add integrations patch to changeset * chore: remove empty file
2022-05-16Update out directories for Netlify Functions (#3381)Gravatar Sarah Etter 1-2/+2
* Change out directories for Netlify Functions * Changeset * Update test
2022-05-16Netlify outdirectory (#3377)Gravatar Sarah Etter 1-2/+2
* Change dist directory, and functions out directory * Add changeset * update docs * Fix changeset