Repository: vercel/next.js
Pull request: Add telemetry for adapterPath config usage

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## What?

Adds telemetry tracking for when the `adapterPath` config option is used in Next.js.

## Why?

As mentioned in the Slack discussion, telemetry for adapter usage was missing. This helps track adoption of the adapter feature.

## How?

- Added `adapterPath` field to the `EventCliSessionStarted` type in `telemetry/events/version.ts`
- The field is automatically populated from `nextConfig.adapterPath` when CLI sessions start
- This covers both `next dev` and `next build` commands

The telemetry emits a CLI session event with `"adapterPath": true` when the config option is set, and `"adapterPath": false` when it's not.

## Testing

Updated the test in `test/integration/telemetry/test/config.test.ts` to:
1. Create a config with `adapterPath` set
2. Run a build with telemetry debug enabled
3. Verify the CLI session telemetry includes `"adapterPath": true`

The test passes locally.


Changed files:
filename: packages/next/src/telemetry/events/version.ts
patch: @@ -40,6 +40,7 @@ type EventCliSessionStarted = {
   reactCompiler: boolean
   reactCompilerCompilationMode: string | null
   reactCompilerPanicThreshold: string | null
+  adapterPath: boolean
 }
 
 export function eventCliSession(
@@ -75,6 +76,7 @@ export function eventCliSession(
     | 'reactCompilerCompilationMode'
     | 'reactCompilerPanicThreshold'
     | 'isRspack'
+    | 'adapterPath'
   >
 ): { eventName: string; payload: EventCliSessionStarted }[] {
   // This should be an invariant, if it fails our build tooling is broken.
@@ -132,6 +134,7 @@ export function eventCliSession(
       typeof nextConfig.reactCompiler !== 'boolean'
         ? (nextConfig.reactCompiler?.panicThreshold ?? null)
         : null,
+    adapterPath: !!nextConfig?.adapterPath,
   }
   return [{ eventName: EVENT_VERSION, payload }]
 }

filename: test/integration/telemetry/adapter.js
patch: @@ -0,0 +1,3 @@
+module.exports = {
+  name: 'test-adapter',
+}

filename: test/integration/telemetry/next.config.adapter-path
patch: @@ -0,0 +1,5 @@
+const path = require('path')
+
+module.exports = {
+  adapterPath: path.join(__dirname, 'adapter.js'),
+}

filename: test/integration/telemetry/test/config.test.ts
patch: @@ -342,6 +342,34 @@ describe('config telemetry', () => {
         })
       })
 
+      it('emits telemetry for usage of `adapterPath`', async () => {
+        await fs.rename(
+          path.join(appDir, 'next.config.adapter-path'),
+          path.join(appDir, 'next.config.js')
+        )
+
+        const { stderr } = await nextBuild(appDir, [], {
+          stderr: true,
+          env: { NEXT_TELEMETRY_DEBUG: '1' },
+        })
+
+        await fs.rename(
+          path.join(appDir, 'next.config.js'),
+          path.join(appDir, 'next.config.adapter-path')
+        )
+
+        try {
+          const event1 = /NEXT_CLI_SESSION_STARTED[\s\S]+?{([\s\S]+?)}/
+            .exec(stderr)
+            .pop()
+
+          expect(event1).toMatch(/"adapterPath": true/)
+        } catch (err) {
+          require('console').error('failing stderr', stderr, err)
+          throw err
+        }
+      })
+
       it('emits telemetry for usage of middleware', async () => {
         await fs.writeFile(
           path.join(appDir, 'middleware.js'),