-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add createDeeplink #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query Parameters feature needs to be added.
fb83c33
to
aec4668
Compare
I currently don't have pro, so I can't test features regarding AI commands. Not sure if they have a special format or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @erics118! Could you add some examples in your GitHub PR to make it easier to visualize the proposed API?
Would it also be possible to add some tests in the Utils Smoke Tests
extension? Creating a new createDeeplink
command with some examples should be enough.
src/createDeeplink.ts
Outdated
export function createScriptCommandDeeplink(options: CreateScriptCommandDeeplinkOptions): string { | ||
const protocol = getProtocol(); | ||
|
||
const params = new URLSearchParams(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use URLSearchParams
, please use encodeURIComponent
instead. See here for more details: https://raycastcommunity.slack.com/archives/C02HEMAF2SJ/p1716016337748779
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've switched to encodeURIComponent
, but it looks a bit more janky now. Please see if you can add some more tests if this is implemented correctly.
I've added tests and a markdown file for documentation. I'm not too sure about how the changelog should be added, or how to properly place the markdown file so that gitbook uses it properly. |
@erics118 @LitoMore I've made a few changes:
Let me know if this looks good to you so we can merge it soon 🙂 |
Looks pretty good. I was just wondering if there were other command types that should be added, ie for pro features such as AI commands or custom window management commands. |
Let's keep it as is as they're the most common commands. We can always iterate on it later if needed as these would be additive improvements. I'll merge that during the day 🙂 |
src/createDeeplink.ts
Outdated
} | ||
|
||
export function createExtensionDeeplink(options: CreateExtensionDeeplinkOptions): string { | ||
let ownerOrAuthorName = environment.ownerOrAuthorName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a hack like https://github.com/raycast/utils/blob/main/src/handle-error-toast-action.ts#L10-L12 instead of bumping the required @raycast/api
version? It'd be sort of a breaking change otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Adds a function to create a deeplink. Before, needed to manually write out the deeplink, which was prone to errors.