From 77ddfd5b27367a594143c1881a5a9565f67a87ed Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Sat, 24 Oct 2026 17:44:23 +0200 Subject: [PATCH] test(server): expect the source export condition in the sidecar and e2e builds (P2.1) --- packages/server/tests/tauri-config.test.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/server/tests/tauri-config.test.ts b/packages/server/tests/tauri-config.test.ts index 36de7f8..5f6d91f 100644 --- a/packages/server/tests/tauri-config.test.ts +++ b/packages/server/tests/tauri-config.test.ts @@ -499,9 +499,8 @@ describe('Tauri Production Configuration', () => { expect(content).toContain("path.join(root, 'packages', 'marketplace', 'marketplace.db')"); expect(content).not.toContain("'marketplace', 'seed', 'marketplace.db'"); expect(content).toContain('Required marketplace database is missing'); - expect(content).toContain( - "'@waggle/agent/external-process-env': path.join(root, 'packages', 'agent', 'src', 'external-process-env.ts')", - ); + // Workspace packages compile from src/ through their `source` export (P2.1). + expect(content).toContain("conditions: ['source']"); const serverIndex = fs.readFileSync( path.join(ROOT, 'packages', 'server', 'src', 'local', 'index.ts'), @@ -510,7 +509,7 @@ describe('Tauri Production Configuration', () => { expect(serverIndex).toContain("path.resolve(__dirname, 'marketplace.db')"); }); - it('build-sidecar exact alias resolves the agent env helper before its root alias', async () => { + it('build-sidecar source condition resolves the agent env helper subpath from src', async () => { const esbuild = await import('esbuild'); const result = await esbuild.build({ stdin: { @@ -526,16 +525,15 @@ describe('Tauri Production Configuration', () => { format: 'esm', write: false, logLevel: 'silent', - alias: { - '@waggle/agent/external-process-env': path.join( - ROOT, 'packages', 'agent', 'src', 'external-process-env.ts', - ), - '@waggle/agent': path.join(ROOT, 'packages', 'agent', 'src', 'index.ts'), - }, + conditions: ['source'], + metafile: true, }); expect(result.errors).toEqual([]); expect(result.outputFiles[0]?.text).toContain('buildExternalProcessEnv'); + expect(Object.keys(result.metafile?.inputs ?? {})).toContain( + 'packages/agent/src/external-process-env.ts', + ); }); it('build-sidecar provenance follows transitive tsconfig inheritance', () => { @@ -7342,7 +7340,7 @@ describe('Playwright Visual Regression Setup', () => { : '"$WAGGLE_E2E_NODE_EXEC"'; expect(webServer.command).toBe( `npm run build:all && ${nodeReference} ` - + 'node_modules/tsx/dist/cli.mjs packages/server/src/local/start.ts --skip-litellm', + + 'node_modules/tsx/dist/cli.mjs --conditions=source packages/server/src/local/start.ts --skip-litellm', ); expect(webServer.command).not.toContain(nodePath); expect(webServer.reuseExistingServer).toBe(false);