Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ $detector
->addOption(new Angular())
->addOption(new Remix())
->addOption(new SvelteKit())
->addOption(new Lynx())
->addOption(new NextJs());

$detectedFramework = $detector->detect();
Expand Down Expand Up @@ -130,6 +131,7 @@ Framework Adapters:
| SvelteKit | ✅ |
| Angular | ✅ |
| Analog | ✅ |
| Lynx | ✅ |

Packager Adapters:

Expand Down
2 changes: 1 addition & 1 deletion src/Detection/Framework/Analog.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getName(): string
*/
public function getFiles(): array
{
return ['vite.config.js', 'vite.config.ts', 'angular.json'];
return ['angular.json'];
}

public function getInstallCommand(): string
Expand Down
44 changes: 44 additions & 0 deletions src/Detection/Framework/Lynx.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace Utopia\Detector\Detection\Framework;

use Utopia\Detector\Detection\Framework;

class Lynx extends Framework
{
public function getName(): string
{
return 'lynx';
}

/**
* @return array<string>
*/
public function getFiles(): array
{
return ['lynx.config.ts', 'lynx.config.js'];
}

public function getInstallCommand(): string
{
return match ($this->packager) {
'yarn' => 'yarn install',
'pnpm' => 'pnpm install',
default => 'npm install',
};
}

public function getBuildCommand(): string
{
return match ($this->packager) {
'yarn' => 'yarn build',
'pnpm' => 'pnpm build',
default => 'npm run build',
};
}

public function getOutputDirectory(): string
{
return './dist';
}
}
2 changes: 1 addition & 1 deletion src/Detection/Framework/Remix.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getName(): string
*/
public function getFiles(): array
{
return ['remix.config.js', 'remix.config.ts', 'vite.config.ts', 'vite.config.mjs'];
return ['remix.config.js', 'remix.config.ts'];
}

public function getInstallCommand(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Detection/Framework/SvelteKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getName(): string
*/
public function getFiles(): array
{
return ['svelte.config.js', 'vite.config.js', 'vite.config.mjs', 'vite.config.ts'];
return ['svelte.config.js'];
}

public function getInstallCommand(): string
Expand Down
1 change: 1 addition & 0 deletions src/Detection/Rendering/SSR.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SSR extends Rendering
'angular' => ['server/server.mjs'],
'analog' => ['server/index.mjs'],
'flutter' => [],
'lynx' => [],
];

public function getName(): string
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/DetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Utopia\Detector\Detection\Framework\Angular;
use Utopia\Detector\Detection\Framework\Astro;
use Utopia\Detector\Detection\Framework\Flutter;
use Utopia\Detector\Detection\Framework\Lynx;
use Utopia\Detector\Detection\Framework\NextJs;
use Utopia\Detector\Detection\Framework\Nuxt;
use Utopia\Detector\Detection\Framework\Remix;
Expand Down Expand Up @@ -262,6 +263,7 @@ public function testFrameworkDetection(array $files, ?string $framework, ?string
->addOption(new Remix())
->addOption(new SvelteKit())
->addOption(new NextJs())
->addOption(new Lynx())
->addOption(new Angular())
->addOption(new Analog());

Expand All @@ -287,6 +289,7 @@ public function frameworkDataProvider(): array
[['src', 'types', 'makefile', 'components.js', 'debug.js', 'package.json', 'svelte.config.js'], 'sveltekit', 'npm install', 'npm run build', './build'],
[['app', 'backend', 'public', 'Dockerfile', 'docker-compose.yml', 'ecosystem.config.js', 'middleware.ts', 'next.config.js', 'package-lock.json', 'package.json', 'server.js', 'tsconfig.json'], 'nextjs', 'npm install', 'npm run build', './.next'],
[['assets', 'components', 'layouts', 'pages', 'babel.config.js', 'error.vue', 'nuxt.config.js', 'yarn.lock'], 'nuxt', 'npm install', 'npm run build', './output'],
[['lynx.config.js'], 'lynx', 'npm install', 'npm run build', './dist'],
[['src', 'package.json', 'tsconfig.json', 'angular.json', 'logo.png'], 'angular', 'npm install', 'npm run build', './dist/angular'],
[['app', 'public', 'remix.config.js', 'remix.env.d.ts', 'sandbox.config.js', 'tsconfig.json', 'package.json'], 'remix', 'npm install', 'npm run build', './build'],
[['public', 'src', 'astro.config.mjs', 'package-lock.json', 'package.json', 'tsconfig.json'], 'astro', 'npm install', 'npm run build', './dist'],
Expand Down