diff --git a/app/config/frameworks.php b/app/config/frameworks.php index d7cd958ece..342657017f 100644 --- a/app/config/frameworks.php +++ b/app/config/frameworks.php @@ -240,15 +240,11 @@ return [ 'bundleCommand' => 'bash /usr/local/server/helpers/tanstack-start/bundle.sh', 'envCommand' => 'source /usr/local/server/helpers/tanstack-start/env.sh', 'adapters' => [ - // TanStack Start >= 1.133 builds vite-native, emitting the server - // entry as dist/server/server.js next to dist/client. Builds that - // opt into the nitro plugin emit .output instead, which the runtime - // still detects, but they have to override the directory here. 'ssr' => [ 'key' => 'ssr', 'buildCommand' => 'npm run build', 'installCommand' => 'npm install', - 'outputDirectory' => './dist', + 'outputDirectory' => './.output', 'startCommand' => 'bash helpers/tanstack-start/server.sh', ], 'static' => [ diff --git a/tests/unit/Deployment/DetectionTest.php b/tests/unit/Deployment/DetectionTest.php index 984fae98a9..42ec656830 100644 --- a/tests/unit/Deployment/DetectionTest.php +++ b/tests/unit/Deployment/DetectionTest.php @@ -24,49 +24,4 @@ final class DetectionTest extends TestCase $this->assertSame('ssr', $detection->getName()); $this->assertNull($detection->getFallbackFile()); } - - /** - * TanStack Start >= 1.133 builds vite-native, emitting the server entry as - * dist/server/server.js alongside dist/client. - */ - public function testRenderingFindsTanStackStartSSR(): void - { - $detection = Detection::rendering('tanstack-start', [ - './client/assets/main-BBU0Zbc3.js', - './server/server.js', - ]); - - $this->assertSame('ssr', $detection->getName()); - $this->assertNull($detection->getFallbackFile()); - } - - /** - * Opting into the nitro plugin keeps the older layout, where the server - * entry is .output/server/index.mjs. - */ - public function testRenderingFindsTanStackStartNitroSSR(): void - { - $detection = Detection::rendering('tanstack-start', [ - './public/favicon.ico', - './server/index.mjs', - ]); - - $this->assertSame('ssr', $detection->getName()); - $this->assertNull($detection->getFallbackFile()); - } - - /** - * A prerendered build ships only the client bundle, so no server entry is - * present to match on. - */ - public function testRenderingFindsTanStackStartStatic(): void - { - $detection = Detection::rendering('tanstack-start', [ - './index.html', - './assets/main-BBU0Zbc3.js', - ]); - - $this->assertSame('static', $detection->getName()); - $this->assertSame('index.html', $detection->getFallbackFile()); - } } diff --git a/tests/unit/Deployment/FrameworksTest.php b/tests/unit/Deployment/FrameworksTest.php deleted file mode 100644 index 3d3a2d34ec..0000000000 --- a/tests/unit/Deployment/FrameworksTest.php +++ /dev/null @@ -1,79 +0,0 @@ - - */ - private array $frameworks; - - protected function setUp(): void - { - parent::setUp(); - - // Read the file rather than Config, which other suites overwrite. - $this->frameworks = require __DIR__ . '/../../../app/config/frameworks.php'; - } - - /** - * TanStack Start >= 1.133 builds vite-native: dist/server/server.js next to - * dist/client. Only builds that opt into the nitro plugin still emit - * .output, and those override the directory on the site. - */ - public function testTanStackStartAdaptersShareViteOutput(): void - { - $adapters = $this->frameworks['tanstack-start']['adapters']; - - $this->assertSame('./dist', $adapters['ssr']['outputDirectory']); - $this->assertSame('./dist/client', $adapters['static']['outputDirectory']); - } - - /** - * nuxt generate writes .output/public, and leaves dist as a symlink to it. - */ - public function testNuxtStaticOutputIsInsideDotOutput(): void - { - $adapters = $this->frameworks['nuxt']['adapters']; - - $this->assertSame('./.output', $adapters['ssr']['outputDirectory']); - $this->assertSame('./.output/public', $adapters['static']['outputDirectory']); - } - - /** - * Next.js is the one framework whose static export genuinely leaves the ssr - * build root, so it is excluded rather than special-cased below. - */ - public function testStaticOutputStaysInsideSsrOutput(): void - { - foreach ($this->frameworks as $key => $framework) { - if ($key === 'nextjs') { - continue; - } - - $ssr = $framework['adapters']['ssr']['outputDirectory'] ?? null; - $static = $framework['adapters']['static']['outputDirectory'] ?? null; - - if ($ssr === null || $static === null) { - continue; - } - - $this->assertStringStartsWith( - \rtrim($ssr, '/') . '/', - \rtrim($static, '/') . '/', - "Framework '{$key}' serves static files from outside its ssr build output." - ); - } - } -}