Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection Library #1

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

Detection Library #1

wants to merge 44 commits into from

Conversation

vermakhushboo
Copy link
Member

@vermakhushboo vermakhushboo commented Jan 9, 2025

Detection Library PR to detect the following:

  1. Package Manager for Functions
  2. Runtime for Functions
  3. Package Manager for Sites
  4. Framework for Sites
  5. Rendering Strategy for Sites
  6. SPA detection for sites

@vermakhushboo vermakhushboo changed the title Draft directory structure for detection Detection Library Jan 24, 2025
Copy link
Member

@eldadfux eldadfux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm conflicted about the namespaces Detector vs Detection they don't really server their purpose to distinguish between the two parts. I might even consider just dropping the Detection one or just nest it under Detector if we don't find a better separation.

example.php Outdated Show resolved Hide resolved
src/Detection/Runtime/Cpp.php Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
src/Detector/Runtime.php Outdated Show resolved Hide resolved
Comment on lines +9 to +14
protected ?string $fallbackFile;

public function __construct(?string $fallbackFile = null)
{
$this->fallbackFile = $fallbackFile;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected ?string $fallbackFile;
public function __construct(?string $fallbackFile = null)
{
$this->fallbackFile = $fallbackFile;
}
public function __construct(protected ?string $fallbackFile = null)
{
}

$matches = array_intersect($this->inputs, SSR::FRAMEWORK_FILES[$this->framework]);

if (count($matches) > 0) {
return new SSR(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new SSR(null);
return new SSR();

if (count($htmlFiles) === 1) {
return new SSG($htmlFiles[0]);
} else {
return new SSG(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return new SSG(null);
return new SSG();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants