-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: extend deeplinks with pause/resume + Raycast extension #1687
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "$schema": "https://www.raycast.com/schemas/extension.json", | ||
| "name": "cap", | ||
| "title": "Cap", | ||
| "description": "Control Cap screen recording from Raycast", | ||
| "icon": "command-icon.png", | ||
| "author": "TateLyman", | ||
| "categories": ["Productivity"], | ||
| "license": "MIT", | ||
| "commands": [ | ||
| { "name": "start-recording", "title": "Start Recording", "description": "Start a new screen recording", "mode": "no-view" }, | ||
| { "name": "stop-recording", "title": "Stop Recording", "description": "Stop the current recording", "mode": "no-view" }, | ||
| { "name": "toggle-pause", "title": "Toggle Pause", "description": "Pause or resume the current recording", "mode": "no-view" }, | ||
| { "name": "open-settings", "title": "Open Settings", "description": "Open Cap settings", "mode": "no-view" } | ||
| ], | ||
| "dependencies": { | ||
| "@raycast/api": "^1.50.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@raycast/eslint-config": "^1.0.6", | ||
| "typescript": "^5.0.0" | ||
| } | ||
| } | ||
|
Comment on lines
+1
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A standard Raycast TypeScript extension requires both a Without Prompt To Fix With AIThis is a comment left during a code review.
Path: extensions/raycast/package.json
Line: 1-23
Comment:
**Missing `tsconfig.json` and lock file**
A standard Raycast TypeScript extension requires both a `tsconfig.json` (Raycast's scaffolder ships one that sets `"moduleResolution": "bundler"` and `"jsx": "react-jsx"`) and a lock file (`package-lock.json` or `yarn.lock`) so that CI and reviewers can reproduce the exact dependency tree. Neither is present in this PR.
Without `tsconfig.json` the TypeScript compiler will use loose defaults, which can mask type errors. Without a lock file, `@raycast/api` will float to whatever `^1.50.0` resolves to at install time, potentially breaking the build later.
How can I resolve this? If you propose a fix, please make it concise. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { showHUD } from "@raycast/api"; | ||
| import { sendDeepLink } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendDeepLink({ open_settings: { page: null } }); | ||
| await showHUD("Opening Cap settings"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { showHUD, getPreferenceValues } from "@raycast/api"; | ||
| import { sendDeepLink } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendDeepLink({ | ||
| start_recording: { | ||
| capture_mode: { screen: "" }, | ||
| camera: null, | ||
| mic_label: null, | ||
| capture_system_audio: false, | ||
| mode: "studio", | ||
| }, | ||
| }); | ||
| await showHUD("Recording started"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { showHUD } from "@raycast/api"; | ||
| import { sendDeepLink } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendDeepLink({ stop_recording: {} }); | ||
| await showHUD("Recording stopped"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { showHUD } from "@raycast/api"; | ||
| import { sendDeepLink } from "./utils"; | ||
|
|
||
| export default async function Command() { | ||
| await sendDeepLink({ toggle_pause_recording: {} }); | ||
| await showHUD("Recording pause toggled"); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { open, showToast, Toast } from "@raycast/api"; | ||
|
|
||
| export async function sendDeepLink(action: Record<string, unknown>) { | ||
| const value = encodeURIComponent(JSON.stringify(action)); | ||
| const url = `cap://action?value=${value}`; | ||
| try { | ||
| await open(url); | ||
| } catch { | ||
| await showToast({ | ||
| style: Toast.Style.Failure, | ||
| title: "Cap Not Running", | ||
| message: "Please open Cap and try again", | ||
| }); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2020", | ||
| "module": "ES2020", | ||
| "moduleResolution": "bundler", | ||
| "strict": true, | ||
| "esModuleInterop": true, | ||
| "skipLibCheck": true, | ||
| "outDir": "dist", | ||
| "rootDir": "src", | ||
| "jsx": "react-jsx", | ||
| "lib": ["ES2020"] | ||
| }, | ||
| "include": ["src/**/*"] | ||
| } |
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.
command-icon.pngis referenced but not included in the PRpackage.jsondeclares"icon": "command-icon.png", but no such file appears inextensions/raycast/. Raycast validates the icon at build and submission time — the extension will fail to build or be rejected from the store without it. The icon must be a512×512PNG placed at the root of the extension directory.Prompt To Fix With AI