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

Feature/forge sites #1115

Merged
merged 11 commits into from
Mar 24, 2022
Merged

Feature/forge sites #1115

merged 11 commits into from
Mar 24, 2022

Conversation

macbookandrew
Copy link
Contributor

Closes #991

Description

Adds two items to the Laravel Forge site commands:

  • Open on Laravel Forge
  • Edit .env file

Screenshot

Screen Shot 2022-03-15 at 15 51 02

Checklist

@raycastbot raycastbot added the extension fix / improvement Label for PRs with extension's fix improvements label Mar 15, 2022
@raycastbot
Copy link
Collaborator

raycastbot commented Mar 15, 2022

Thank you for your first contribution! 🎉

🔔 @KevinBatdorf you might want to have a look.

Copy link
Contributor

@KevinBatdorf KevinBatdorf left a comment

Choose a reason for hiding this comment

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

Hey @macbookandrew Thanks for adding these. I think they will be useful. I left a few comments. Also, maybe you're not done yet too, but there was a prettier error as well.

I have a question. Do you notice sometimes when using this extension that if you type too quickly on load that the text you type before the site's load in is carried through to the next view? I think it's a Raycast bug but not sure if it's only me experiencing it. It could also be that I need to tweak the loading mechanism too.

@@ -81,6 +81,18 @@ export const SitesSingleView = ({ site, server }: { site: ISite; server: IServer
<>
<List searchBarPlaceholder="Search sites...">
<List.Section title={`Site Commands (${current.name})`}>
<List.Item
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you put this second?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor

Choose a reason for hiding this comment

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

Well I should have asked if you think it's more useful at the top. Personally I mainly use the deploy exclusively, but I wonder if I'm the only one. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have gitlab webhooks set up that run deploy automatically so personally I would rarely use the deploy script, but I frequently open the site in the Forge dashboard to check/modify a .env value or perform some other task

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking the Open command may be more popular. I think that's how the Alfred workflow worked. If you want to add it back to how you had it then I think that's fine. I don't think it should be specific to my personal use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done—same on the quick links too

key="open-on-forge"
title="Open on Laravel Forge"
icon={Icon.Globe}
accessoryTitle="forge.laravel.com"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably have the site name included, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess it could; I made it parallel with the server but 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine either way. What ever you think. I just added it originally because it looked worse with nothing there at all. It's probably okay how you have it now.

Comment on lines 131 to 142
<List.Item
id="edit-site-env"
key="edit-site-env"
title="Edit .env file"
icon={Icon.Globe}
accessoryTitle="press to edit in browser"
actions={
<ActionPanel>
<OpenInBrowserAction url={`https://forge.laravel.com/servers/${server.id}/sites/${site.id}/environment`} />
</ActionPanel>
}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this would fit better as a sub action to the view .env file. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that makes sense

@macbookandrew
Copy link
Contributor Author

I have a question. Do you notice sometimes when using this extension that if you type too quickly on load that the text you type before the site's load in is carried through to the next view? I think it's a Raycast bug but not sure if it's only me experiencing it. It could also be that I need to tweak the loading mechanism too.

Yes, but I’m seeing that with other Raycast extensions, so I suspect it’s a Raycast bug.

@macbookandrew
Copy link
Contributor Author

I also just added the “open on forge” quick action for sites:

Screen Shot 2022-03-15 at 16 33 26

@KevinBatdorf
Copy link
Contributor

LGTM

If you have any other ideas of what features might be useful I'd be interested in working on it some more. I was thinking, for example, to somehow detect WordPress then offer WP-CLI commands. Or detect Laravel and do the same with artisan.

@macbookandrew
Copy link
Contributor Author

I was thinking, for example, to somehow detect WordPress then offer WP-CLI commands. Or detect Laravel and do the same with artisan.

I like that idea! I guess we could run a site command to detect the presence of either artisan or wp-load.php

@pernielsentikaer
Copy link
Collaborator

Is this ready to review, or still in progress? 🔥

@macbookandrew
Copy link
Contributor Author

Ready to review as far as I’m concerned

Copy link
Collaborator

@pernielsentikaer pernielsentikaer left a comment

Choose a reason for hiding this comment

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

Hi @macbookandrew 👋

Thanks for your contribution, much appreciated 🔥

@mattisssa mattisssa merged commit be77253 into raycast:main Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forge: Shortcut to access sites without server layer
5 participants