feat(netlify): support included/excluded files
Changes
Adds "includedFiles" and "excludedFiles" options. These allow extra files to be deployed in the SSR function bundle. It globs these files at build time, and includes them in the file list that is deployed in the function. This PR also ensures that process.cwd matches the site root during SSR.
Testing
Adds new test fixture and tests.
Docs
This needs docs. The changeset includes a lot of the required info, as do the types.
π¦ Changeset detected
Latest commit: 1a2319f105a6ae9b61ab0f3bde1b2e9bde83cc78
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @astrojs/netlify | Major |
| @test/netlify-hosted-astro-project | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
!preview include-files
Snapshots have been released for the following packages:
-
@astrojs/netlify@experimental--include-files
Publish Log
π¦ warn ===============================IMPORTANT!===============================
π¦ warn Packages will be released under the experimental--include-files tag
π¦ warn ----------------------------------------------------------------------
π¦ info npm info @astrojs/cloudflare
π¦ info npm info @astrojs/netlify
π¦ warn @astrojs/cloudflare is not being published because version 11.0.1 is already published on npm
π¦ info @astrojs/netlify is being published because our local version (0.0.0-include-files-20240712111209) has not been published on npm
π¦ info Publishing "@astrojs/netlify" at "0.0.0-include-files-20240712111209"
π¦ success packages published successfully:
π¦ @astrojs/[email protected]
π¦ Creating git tag...
π¦ New tag: @astrojs/[email protected]
Build Log
βWARNβ Unsupported engine: wanted: {"node":">=20.15.0"} (current: {"node":"v18.20.3","pnpm":"9.4.0"})
> [email protected] build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"
β’ Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
β’ Running build in 3 packages
β’ Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 263e5d99e0f2b801
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/netlify
> tsc
::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 81371b8c47fd6c9f
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc
::endgroup::
Tasks: 2 successful, 2 total
Cached: 0 cached, 2 total
Time: 3.605s
@ascorbic Do you want to land this before the next minor of the Netlify Adapter?
@alexanderniebuhr Ideally, yes. It's still waiting on an approval
I already looked at it and quite liked it, but I can review it later today, so we can land it before we cut the release :)
I was not able to wait for this PR to make it into the release, I needed to ship Cloudflare bugfixes.. Are all discussions resolved?
The changeset is fine by docs, but we will need documentation in the Netlify adapter page in docs. A new <h3> under Usage seems like a good place, I think? https://docs.astro.build/en/guides/integrations-guide/netlify/#usage
As Matt wrote, it can take very much the form of what's in the changeset, plus any other important characteristics to document (because I said the changeset doesn't have to be exhaustive -- but there may be other details appropriate for full documentation).
!preview include-files
Snapshots have been released for the following packages:
-
@astrojs/netlify@experimental--include-files
Publish Log
π¦ warn ===============================IMPORTANT!===============================
π¦ warn Packages will be released under the experimental--include-files tag
π¦ warn ----------------------------------------------------------------------
π¦ info npm info @astrojs/cloudflare
π¦ info npm info @astrojs/netlify
π¦ info npm info @astrojs/node
π¦ info npm info @astrojs/vercel
π¦ warn @astrojs/cloudflare is not being published because version 11.0.4 is already published on npm
π¦ info @astrojs/netlify is being published because our local version (0.0.0-include-files-20240905130315) has not been published on npm
π¦ warn @astrojs/node is not being published because version 8.3.3 is already published on npm
π¦ warn @astrojs/vercel is not being published because version 7.8.0 is already published on npm
π¦ info Publishing "@astrojs/netlify" at "0.0.0-include-files-20240905130315"
π¦ success packages published successfully:
π¦ @astrojs/[email protected]
π¦ Creating git tag...
π¦ New tag: @astrojs/[email protected]
Build Log
> [email protected] build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"
β’ Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/node, @astrojs/test-utils, @astrojs/vercel
β’ Running build in 5 packages
β’ Remote caching disabled
::group::@astrojs/node:build
cache miss, executing 500254f597799cf1
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/node
> tsc
::endgroup::
::group::@astrojs/netlify:build
cache miss, executing 2759776ada86b638
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/netlify
> tsc
::endgroup::
::group::@astrojs/vercel:build
cache miss, executing 6e63e7a22cb615dd
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/vercel
> tsc
::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing b168b1ba31cb4844
> @astrojs/[email protected] build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc
::endgroup::
Tasks: 4 successful, 4 total
Cached: 0 cached, 4 total
Time: 6.222s