clnt / alfred-tailwindcss-docs

An ultra-fast TailwindCSS docs search workflow for Alfred 4 & 5
http://www.packal.org/workflow/tailwind-docs-workflow-alfred
MIT License
122 stars 4 forks source link

Not working in Alfred 5 #17

Open tonieerik opened 2 years ago

tonieerik commented 2 years ago

Workflow is not working properly in Alfred 5 (I am using latest v5.0.3).

tw-error

clnt commented 1 year ago

Hey @tonieerik

Thanks for reporting this, I had a feeling it may break when I saw the changelog notes for Alfred 5 as workflows have been re-worked quite a bit.

I am currently still using Alfred 4, however I will get in contact with the Alfred team to retain my key for Alfred 4 so I can ensure I am still able to update the v4 version of the workflow. As soon as I have a key for both v4 and v5 I shall upgrade mine, this means I will need to update the underlying PHP dependency this uses to interact with the workflows - it looks like that has been updated so hopefully it won't take too much to fix for Alfred v5 - famous last words!

I'll drop a response as soon as I have an update.

Cheers

cowboyd commented 1 year ago

I am also seeing this behavior in Alfred 4.7

erashdan commented 8 months ago

+1

clnt commented 7 months ago

Hi all,

I have just installed Alfred 5 (5.1.4) on macOS Sonoma and downloaded the latest workflow file available at https://github.com/clnt/alfred-tailwindcss-docs/releases/tag/v3.0.1

From my testing it seems to be working without any issues, the results won't be identical to those shown on the TailwindCSS website search but I am not able to reproduce the issue above of it not returning results:

alfred_font alfred_flex_initial tailwindcss_site_flex_initial

I am running PHP 8.3 locally in my CLI although it should still work on earlier versions as it was before.

If you are having any issues can you check that you are definitely using the latest release and have a valid PHP version (PHP 8.1+).

If you continue to have issues let me know if there are any system differences, check PHP version with php -v

littlegreenguy commented 1 week ago

Hiya, I'm on a fresh install of Alfred 5.5, php 8.3 via laravel herd and macOs Somoma and I get the same issue as the OP.

clnt commented 6 days ago

Hi @littlegreenguy

Thanks for the info! If I am to take a guess at what it might be as everything is working fine for me on Homebrew it would be the path to the PHP binary.

Laravel Herd installs the binaries within the herd directory which is in the user's home directory. I could update the scripts in the workflow to include ~/Herd/bin/php but would need to issue a new release which I am unable to do today.

As a fix I would suggest creating a symlink between your working binary and one of the locations supported by the scripts.

Here is a command which should symlink your Herd PHP binary to the /usr/local/bin/php location:

sudo ln -s ~/Herd/bin/php /usr/local/bin/php

The other supported paths are the following:

littlegreenguy commented 6 days ago

Ok, cheers, will give it a shot and let you know. On Oct 23, 2024, at 10:17, Matt Clinton @.***> wrote: Hi @littlegreenguy Thanks for the info! If I am to take a guess at what it might be as everything is working fine for me on Homebrew it would be the path to the PHP binary. Laravel Herd installs the binaries within the herd directory which is in the user's home directory. I could update the scripts in the workflow to include ~/Herd/bin/php but would need to issue a new release which I am unable to do today. As a fix I would suggest creating a symlink between your working binary and one of the locations supported by the scripts. Here is a command which should symlink your Herd PHP binary to the /usr/local/bin/php location: sudo ln -s ~/Herd/bin/php /usr/local/bin/php The other supported paths are the following:

/opt/homebrew/bin/php /usr/bin/php

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

littlegreenguy commented 5 days ago

hiya, symlink didn't work for me, though I didn't try debugging (in theory, it SHOULD work). I realised I have a similar fix in for the laravel docs workflow. Indeed it was related to the php path. I have updated the workflow as follows:

if [ -f "/opt/homebrew/bin/php" ]; then
    /opt/homebrew/bin/php tailwindcss.php "{query}"
elif [ -f "/usr/local/bin/php" ]; then
    /usr/local/bin/php tailwindcss.php "{query}"
elif [ -f "/usr/bin/php" ]; then
    /usr/bin/php tailwindcss.php "{query}"
elif [ -L ~/Library/Application\ Support/Herd/bin/php ]; then
    ~/Library/Application\ Support/Herd/bin/php tailwindcss.php "{query}"
fi

and works great now. Hope this helps others. Thanks too for this workflow, really useful.