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

Allow running in vanilla PHP projects #25

Merged
merged 2 commits into from
Sep 29, 2024
Merged

Conversation

timacdonald
Copy link
Contributor

The symfony/process is a hard requirement for the project but is no included in the dependency list.

shiki-php/src/Shiki.php

Lines 64 to 72 in 1895983

$command = [
(new ExecutableFinder())->find('node', 'node', [
'/usr/local/bin',
'/opt/homebrew/bin',
$home . '/n/bin', // support https://github.com/tj/n
]),
'shiki.js',
json_encode(array_values($arguments)),
];

shiki-php/src/Shiki.php

Lines 82 to 84 in 1895983

if (! $process->isSuccessful()) {
throw new ProcessFailedException($process);
}

This means the package is not usable outside of projects that already depend on symfony/process. I hit this on a recent project and had to manually install symfony/process even though I was not interacting with it directly.

I tested 5.0, 6.0, and 7.0 against the testsuite and static analysis and all the tests passed on my machine and not additional static analysis issues were introduced with either version.

@riasvdv riasvdv merged commit 24ff797 into spatie:main Sep 29, 2024
10 checks passed
@riasvdv
Copy link
Member

riasvdv commented Sep 29, 2024

Thanks!

@timacdonald timacdonald deleted the dep branch September 29, 2024 22:41
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.

2 participants