Repository: geoffrich/svelte-adapter-azure-swa
Pull request #117 (2023-02-27 20:56:32)

Add `staticDir` setting
## Why these changes.

Certain situations might necessitate the need to put pages or assets in different directories. For example in my situation where I need to put the page files in a subdirectory in order to deploy to in front of a CDN. 

## Description of changes
- Added `pages` and `assets` options from the official static adapter
- Added tests for these new settings
- Updated options type
- Updated `README`

## Questions 

- I output the pages and assets to the `static` folder. To me it just seemed to make things cleaner but, Idk if people would agree with this or want more freedom?
     - Also how I should document this in the readme?


Patch:
diff --git a/.github/workflows/azure-static-web-apps-polite-desert-00b80111e.yml b/.github/workflows/azure-static-web-apps-polite-desert-00b80111e.yml
index 64113a6..4f18a63 100644
--- a/.github/workflows/azure-static-web-apps-polite-desert-00b80111e.yml
+++ b/.github/workflows/azure-static-web-apps-polite-desert-00b80111e.yml
@@ -11,7 +11,7 @@ on:
 
 jobs:
   clean:
-    if: github.event_name == 'pull_request' && github.event.action != 'closed'
+    if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed'
     runs-on: ubuntu-latest
     name: Delete old bot comment
     steps:
@@ -24,9 +24,12 @@ jobs:
           user: 'github-actions[bot]'
           issue: '${{github.event.number}}'
   build_and_deploy_job:
-    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
+    if: github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed')
     runs-on: ubuntu-latest
     name: Build and Deploy Job
+    env:
+      # workaround for Oryx issue: see https://github.com/Azure/static-web-apps/issues/909#issuecomment-1320077142
+      CUSTOM_BUILD_COMMAND: 'chown -R root:root . && npm install --unsafe-perm && npm run build'
     steps:
       - uses: actions/checkout@v2
         with:
@@ -43,12 +46,14 @@ jobs:
           app_location: '/demo' # App source code path
           api_location: 'demo/build/server' # Api source code path - optional
           output_location: 'build/static' # Built app content directory - optional
+          # needed when we set CUSTOM_BUILD_COMMAND
+          skip_api_build: true
           ###### End of Repository/Build Configurations ######
     outputs:
       preview_url: ${{ steps.builddeploy.outputs.static_web_app_url }}
   test:
     needs: build_and_deploy_job
-    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
+    if: github.event_name == 'push' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action != 'closed')
     name: Run E2E Tests
     timeout-minutes: 10
     runs-on: ubuntu-latest
@@ -70,7 +75,7 @@ jobs:
           PLAYWRIGHT_TEST_BASE_URL: ${{ needs.build_and_deploy_job.outputs.preview_url }}
 
   close_pull_request_job:
-    if: github.event_name == 'pull_request' && github.event.action == 'closed'
+    if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.event.action == 'closed'
     runs-on: ubuntu-latest
     name: Close Pull Request Job
     steps:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf12a08..9b3ca00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,29 @@
 # Changelog
 
+## [0.15.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.14.0...v0.15.0) (2023-03-18)
+
+
+### Features
+
+* add context to the platform object ([#127](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/127)) ([e597d0c](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/e597d0cbd54a0e486a6bedc93d6b8071bb25f2b8))
+
+
+### Bug Fixes
+
+* await server init ([#128](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/128)) ([4900a35](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/4900a351ee78fcecf3050cf0a28696548646cd1a))
+
+## [0.14.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.13.0...v0.14.0) (2023-03-15)
+
+
+### Features
+
+* expose client principal through platform ([#107](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/107)) ([e41f89c](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/e41f89cde57858b76df61a7ba6316f5ac0a4498d))
+
+
+### Bug Fixes
+
+* binary body is incorrectly parsed as UTF-8 ([#123](https://www.github.com/geoffrich/svelte-adapter-azure-swa/issues/123)) ([4869959](https://www.github.com/geoffrich/svelte-adapter-azure-swa/commit/48699595be4cabe355f070250780492bba5a1fdb))
+
 ## [0.13.0](https://www.github.com/geoffrich/svelte-adapter-azure-swa/compare/v0.12.0...v0.13.0) (2023-01-23)
 
 
diff --git a/README.md b/README.md
index e776e26..418ec6c 100644
--- a/README.md
+++ b/README.md
@@ -41,7 +41,7 @@ When deploying to Azure, you will need to properly [configure your build](https:
 
 If you use a custom API directory (see [below](#apiDir)), your `api_location` will be the same as the value you pass to `apiDir`.
 
-If your `app_location` is not the repository root `./` but `./my_app_location`, then you also need to change the `api_location` to `my_app_location/build/server` (but not the `output_location`).
+If your `app_location` is in a subfolder (e.g. `./my_app_location`), then your `api_location` should include the path to that subfolder (e.g. `my_app_location/build/server`.) `output_location` should still be `build/static`.
 
 ## Running locally with the Azure SWA CLI
 
@@ -111,6 +111,25 @@ custom/
 
 Also note that the adapter reserves the folder prefix `sk_render` and API route prefix `__render` for Azure functions generated by the adapter. So, if you use a custom API directory, you cannot have any other folder starting with `sk_render` or functions available at the `__render` route, since these will conflict with the adapter's Azure functions.
 
+### staticDir
+
+The directory where the static assets will be placed. Most of the time, you shouldn't need to set this.
+
+By default, the adapter will output the static JS, CSS and HTML files to the `build/static` folder. If you want to output it to a different directory instead you can set this option.
+
+```js
+import azure from 'svelte-adapter-azure-swa';
+
+export default {
+	kit: {
+		...
+		adapter: azure({
+			staticDir: 'custom/static'
+		})
+	}
+};
+```
+
 ### customStaticWebAppConfig
 
 An object containing additional Azure SWA [configuration options](https://docs.microsoft.com/en-us/azure/static-web-apps/configuration). This will be merged with the `staticwebapp.config.json` generated by the adapter.
@@ -180,4 +199,50 @@ To get typings for the `platform` property, reference this adapter in your `src/
 
 ### `clientPrincipal`
 
-The client principal as passed in a header from SWA to the render function is available at `platform.clientPrincipal` in the same form it is provided by SWA. See the [official SWA documentation](https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript#api-functions) or [the types](index.d.ts) for further details.
+This contains the client principal as parsed from the `x-ms-client-principal` request header. See the [official SWA documentation](https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript#api-functions) or [the types](index.d.ts) for further details.
+
+This is currently only available when running in production on SWA. In addition, it is only available in certain circumstances in production - see [this adapter issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues/102) for more details. Please report any issues you encounter.
+
+### `context`
+
+All server requests to your SvelteKit app are handled by an Azure function. This property contains that Azure function's [request context](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node#context-object).
+
+## Monorepo support
+
+If you're deploying your app from a monorepo, here's what you need to know.
+
+The build currently fails if you use `pnpm` as a package manager. You can track [this issue](https://github.com/geoffrich/svelte-adapter-azure-swa/issues/135) for updates. For now, you can work around the issue by using `npm` instead.
+
+Also, since your SvelteKit app is in a subfolder of the monorepo, you will need to update your deployment workflow.
+
+For instance, if you have the following folder structure:
+
+```
+apps/
+	├── sveltekit-app
+	└── other-app
+```
+
+The `app_location` and `api_location` in your deployment configuration need to point to the `apps/sveltekit-app` subfolder. `output_location` should remain the same. Here's how that would look for an Azure SWA GitHub workflow:
+
+```diff
+steps:
+	 - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Build And Deploy
+        id: builddeploy
+        uses: Azure/static-web-apps-deploy@v1
+        with:
+          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_ORANGE_GRASS_0778C6300 }}
+          repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
+          action: "upload"
+          ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
+          # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
+-         app_location: "./" # App source code path
+-         api_location: "build/server" # Api source code path - optional
++         app_location: "./apps/sveltekit-app" # App source code path
++         api_location: "apps/sveltekit-app/build/server" # Api source code path - optional
+          output_location: "build/static" # Built app content directory - optional
+          ###### End of Repository/Build Configurations ######
+```
diff --git a/files/entry.js b/files/entry.js
index 1cd81aa..fccd645 100644
--- a/files/entry.js
+++ b/files/entry.js
@@ -14,7 +14,7 @@ const debug = DEBUG;
 installPolyfills();
 
 const server = new Server(manifest);
-server.init({ env: process.env });
+const initialized = server.init({ env: process.env });
 
 /**
  * @typedef {import('@azure/functions').AzureFunction} AzureFunction
@@ -35,12 +35,14 @@ export async function index(context) {
 	const ipAddress = getClientIPFromHeaders(request.headers);
 	const clientPrincipal = getClientPrincipalFromHeaders(request.headers);
 
+	await initialized;
 	const rendered = await server.respond(request, {
 		getClientAddress() {
 			return ipAddress;
 		},
 		platform: {
-			clientPrincipal
+			clientPrincipal,
+			context
 		}
 	});
 
@@ -58,7 +60,7 @@ export async function index(context) {
  * @returns {Request}
  * */
 function toRequest(context) {
-	const { method, headers, rawBody: body } = context.req;
+	const { method, headers, rawBody, body } = context.req;
 	// because we proxy all requests to the render function, the original URL in the request is /api/__render
 	// this header contains the URL the user requested
 	const originalUrl = headers['x-ms-original-url'];
@@ -70,7 +72,11 @@ function toRequest(context) {
 	};
 
 	if (method !== 'GET' && method !== 'HEAD') {
-		init.body = typeof body === 'string' ? Buffer.from(body, 'utf-8') : body;
+		init.body = Buffer.isBuffer(body)
+			? body
+			: typeof rawBody === 'string'
+			? Buffer.from(rawBody, 'utf-8')
+			: rawBody;
 	}
 
 	return new Request(originalUrl, init);
diff --git a/index.d.ts b/index.d.ts
index 90908bf..5d793a5 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,5 +1,6 @@
 import { Adapter } from '@sveltejs/kit';
 import { ClientPrincipal, CustomStaticWebAppConfig } from './types/swa';
+import { Context } from '@azure/functions';
 import esbuild from 'esbuild';
 
 export * from './types/swa';
@@ -9,6 +10,7 @@ export type Options = {
 	customStaticWebAppConfig?: CustomStaticWebAppConfig;
 	esbuildOptions?: Pick<esbuild.BuildOptions, 'external'>;
 	apiDir?: string;
+	staticDir?: string;
 };
 
 export default function plugin(options?: Options): Adapter;
@@ -28,7 +30,14 @@ declare global {
 			 *
 			 * @see The {@link https://learn.microsoft.com/en-us/azure/static-web-apps/user-information?tabs=javascript#api-functions SWA documentation}
 			 */
+
+			/**
+			 * The Azure function request context.
+			 *
+			 * @see The {@link https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node#context-object Azure function documentation}
+			 */
 			clientPrincipal?: ClientPrincipal;
+			context: Context;
 		}
 	}
 }
diff --git a/index.js b/index.js
index 51f7a76..bd5cb6d 100644
--- a/index.js
+++ b/index.js
@@ -48,7 +48,8 @@ export default function ({
 	debug = false,
 	customStaticWebAppConfig = {},
 	esbuildOptions = {},
-	apiDir: customApiDir = undefined
+	apiDir: customApiDir = undefined,
+	staticDir: customStaticDir = undefined
 } = {}) {
 	return {
 		name: 'adapter-azure-swa',
@@ -65,7 +66,7 @@ Please see the PR for migration instructions: https://github.com/geoffrich/svelt
 
 			const tmp = builder.getBuildDirectory('azure-tmp');
 			const publish = 'build';
-			const staticDir = join(publish, 'static');
+			const staticDir = customStaticDir || join(publish, 'static');
 			const apiDir = customApiDir || join(publish, 'server');
 			const functionDir = join(apiDir, 'sk_render');
 			const entry = `${tmp}/entry.js`;
diff --git a/package-lock.json b/package-lock.json
index 41c6047..576b218 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
 	"name": "svelte-adapter-azure-swa",
-	"version": "0.13.0",
+	"version": "0.15.0",
 	"lockfileVersion": 2,
 	"requires": true,
 	"packages": {
 		"": {
 			"name": "svelte-adapter-azure-swa",
-			"version": "0.13.0",
+			"version": "0.15.0",
 			"license": "MIT",
 			"dependencies": {
 				"esbuild": "^0.15.7",
@@ -14,7 +14,7 @@
 			},
 			"devDependencies": {
 				"@azure/functions": "^1.2.3",
-				"@sveltejs/kit": "^1.0.0",
+				"@sveltejs/kit": "^1.8.8",
 				"@types/node": "^17.0.5",
 				"@types/set-cookie-parser": "^2.4.2",
 				"@vitest/coverage-c8": "^0.23.4",
@@ -451,25 +451,25 @@
 			"dev": true
 		},
 		"node_modules/@sveltejs/kit": {
-			"version": "1.2.2",
-			"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.2.2.tgz",
-			"integrity": "sha512-aZUjAZ/6gWEYFQDrDNINuvOi6VxlG86kCcIDRWDIFJjI38Ueieo1fySb0j0d2VkQVrYXU7VqjTVMBZFix+hByA==",
+			"version": "1.8.8",
+			"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.8.8.tgz",
+			"integrity": "sha512-64bEcgIECQ8TPQ7sCMo1X1IMSkFjTP8MaKB4YpG4Tw3rvKDaVxBt6MuxdvMShDJu12CpXv692AY4jhfNUPwcmQ==",
 			"dev": true,
 			"hasInstallScript": true,
 			"dependencies": {
 				"@sveltejs/vite-plugin-svelte": "^2.0.0",
 				"@types/cookie": "^0.5.1",
 				"cookie": "^0.5.0",
-				"devalue": "^4.2.2",
+				"devalue": "^4.3.0",
 				"esm-env": "^1.0.0",
 				"kleur": "^4.1.5",
-				"magic-string": "^0.27.0",
+				"magic-string": "^0.30.0",
 				"mime": "^3.0.0",
 				"sade": "^1.8.1",
 				"set-cookie-parser": "^2.5.1",
 				"sirv": "^2.0.2",
 				"tiny-glob": "^0.2.9",
-				"undici": "5.15.1"
+				"undici": "5.20.0"
 			},
 			"bin": {
 				"svelte-kit": "svelte-kit.js"
@@ -482,6 +482,18 @@
 				"vite": "^4.0.0"
 			}
 		},
+		"node_modules/@sveltejs/kit/node_modules/magic-string": {
+			"version": "0.30.0",
+			"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
+			"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
+			"dev": true,
+			"dependencies": {
+				"@jridgewell/sourcemap-codec": "^1.4.13"
+			},
+			"engines": {
+				"node": ">=12"
+			}
+		},
 		"node_modules/@sveltejs/vite-plugin-svelte": {
 			"version": "2.0.2",
 			"resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.0.2.tgz",
@@ -790,9 +802,9 @@
 			}
 		},
 		"node_modules/devalue": {
-			"version": "4.2.2",
-			"resolved": "https://registry.npmjs.org/devalue/-/devalue-4.2.2.tgz",
-			"integrity": "sha512-Pkwd8qrI9O20VJ14fBNHu+on99toTNZFbgWRpZbC0zbDXpnE2WHYcrC1fHhMsF/3Ee+2yaW7vEujAT7fCYgqrA==",
+			"version": "4.3.0",
+			"resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.0.tgz",
+			"integrity": "sha512-n94yQo4LI3w7erwf84mhRUkUJfhLoCZiLyoOZ/QFsDbcWNZePrLwbQpvZBUG2TNxwV3VjCKPxkiiQA6pe3TrTA==",
 			"dev": true
 		},
 		"node_modules/emoji-regex": {
@@ -1946,9 +1958,9 @@
 			}
 		},
 		"node_modules/undici": {
-			"version": "5.15.1",
-			"resolved": "https://registry.npmjs.org/undici/-/undici-5.15.1.tgz",
-			"integrity": "sha512-XLk8g0WAngdvFqTI+VKfBtM4YWXgdxkf1WezC771Es0Dd+Pm1KmNx8t93WTC+Hh9tnghmVxkclU1HN+j+CvIUA==",
+			"version": "5.20.0",
+			"resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz",
+			"integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==",
 			"dev": true,
 			"dependencies": {
 				"busboy": "^1.6.0"
@@ -2515,24 +2527,35 @@
 			"dev": true
 		},
 		"@sveltejs/kit": {
-			"version": "1.2.2",
-			"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.2.2.tgz",
-			"integrity": "sha512-aZUjAZ/6gWEYFQDrDNINuvOi6VxlG86kCcIDRWDIFJjI38Ueieo1fySb0j0d2VkQVrYXU7VqjTVMBZFix+hByA==",
+			"version": "1.8.8",
+			"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.8.8.tgz",
+			"integrity": "sha512-64bEcgIECQ8TPQ7sCMo1X1IMSkFjTP8MaKB4YpG4Tw3rvKDaVxBt6MuxdvMShDJu12CpXv692AY4jhfNUPwcmQ==",
 			"dev": true,
 			"requires": {
 				"@sveltejs/vite-plugin-svelte": "^2.0.0",
 				"@types/cookie": "^0.5.1",
 				"cookie": "^0.5.0",
-				"devalue": "^4.2.2",
+				"devalue": "^4.3.0",
 				"esm-env": "^1.0.0",
 				"kleur": "^4.1.5",
-				"magic-string": "^0.27.0",
+				"magic-string": "^0.30.0",
 				"mime": "^3.0.0",
 				"sade": "^1.8.1",
 				"set-cookie-parser": "^2.5.1",
 				"sirv": "^2.0.2",
 				"tiny-glob": "^0.2.9",
-				"undici": "5.15.1"
+				"undici": "5.20.0"
+			},
+			"dependencies": {
+				"magic-string": {
+					"version": "0.30.0",
+					"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz",
+					"integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==",
+					"dev": true,
+					"requires": {
+						"@jridgewell/sourcemap-codec": "^1.4.13"
+					}
+				}
 			}
 		},
 		"@sveltejs/vite-plugin-svelte": {
@@ -2777,9 +2800,9 @@
 			"dev": true
 		},
 		"devalue": {
-			"version": "4.2.2",
-			"resolved": "https://registry.npmjs.org/devalue/-/devalue-4.2.2.tgz",
-			"integrity": "sha512-Pkwd8qrI9O20VJ14fBNHu+on99toTNZFbgWRpZbC0zbDXpnE2WHYcrC1fHhMsF/3Ee+2yaW7vEujAT7fCYgqrA==",
+			"version": "4.3.0",
+			"resolved": "https://registry.npmjs.org/devalue/-/devalue-4.3.0.tgz",
+			"integrity": "sha512-n94yQo4LI3w7erwf84mhRUkUJfhLoCZiLyoOZ/QFsDbcWNZePrLwbQpvZBUG2TNxwV3VjCKPxkiiQA6pe3TrTA==",
 			"dev": true
 		},
 		"emoji-regex": {
@@ -3508,9 +3531,9 @@
 			"dev": true
 		},
 		"undici": {
-			"version": "5.15.1",
-			"resolved": "https://registry.npmjs.org/undici/-/undici-5.15.1.tgz",
-			"integrity": "sha512-XLk8g0WAngdvFqTI+VKfBtM4YWXgdxkf1WezC771Es0Dd+Pm1KmNx8t93WTC+Hh9tnghmVxkclU1HN+j+CvIUA==",
+			"version": "5.20.0",
+			"resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz",
+			"integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==",
 			"dev": true,
 			"requires": {
 				"busboy": "^1.6.0"
diff --git a/package.json b/package.json
index 29f2ed2..f202bbb 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
 	"name": "svelte-adapter-azure-swa",
 	"description": "SvelteKit adapter for Azure Static Web Apps.",
-	"version": "0.13.0",
+	"version": "0.15.0",
 	"main": "index.js",
 	"type": "module",
 	"scripts": {
@@ -35,7 +35,7 @@
 	},
 	"devDependencies": {
 		"@azure/functions": "^1.2.3",
-		"@sveltejs/kit": "^1.0.0",
+		"@sveltejs/kit": "^1.8.8",
 		"@types/node": "^17.0.5",
 		"@types/set-cookie-parser": "^2.4.2",
 		"@vitest/coverage-c8": "^0.23.4",


Test patch:
diff --git a/test/index.test.js b/test/index.test.js
index c305af2..d90a37b 100644
--- a/test/index.test.js
+++ b/test/index.test.js
@@ -81,6 +81,15 @@ describe('adapt', () => {
 		expect(builder.copy).not.toBeCalledWith(expect.stringContaining('api'), 'custom/api');
 	});
 
+	test('writes to custom static directory', async () => {
+		vi.mocked(existsSync).mockImplementationOnce(() => false);
+		const adapter = azureAdapter({ staticDir: 'custom/static' });
+		const builder = getMockBuilder();
+		await adapter.adapt(builder);
+		expect(builder.writeClient).toBeCalledWith('custom/static');
+		expect(builder.writePrerendered).toBeCalledWith('custom/static');
+	});
+
 	test('logs warning when custom api directory set and required file does not exist', async () => {
 		vi.mocked(existsSync).mockImplementationOnce(() => false);
 		const adapter = azureAdapter({ apiDir: 'custom/api' });