-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add BART departures #17970
base: main
Are you sure you want to change the base?
Add BART departures #17970
Conversation
Congratulations on your new Raycast extension! 🚀 Due to our current reduced availability, the initial review may take up to 10-15 business days Once the PR is approved and merged, the extension will be available on our Store. |
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.
7 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile
"dependencies": { | ||
"@raycast/api": "^1.93.2", | ||
"@raycast/utils": "^1.19.1", | ||
"react": "^19.0.0" |
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.
logic: React 19 does not exist yet. Should be ^18.0.0
"react": "^19.0.0" | |
"react": "^18.0.0" |
"commands": [{ | ||
"name": "departures", | ||
"title": "BART Departures", | ||
"subtitle": "Show BART depatures from a given station", |
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.
syntax: 'depatures' is misspelled, should be 'departures'
"subtitle": "Show BART depatures from a given station", | |
"subtitle": "Show BART departures from a given station", |
1. Clone this repository or download the extension from the Raycast Store. | ||
2. Run `npm install` to install dependencies. | ||
3. Use `npm run dev` to start the extension in development mode or `npm run build` to build it for production. |
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.
logic: These installation instructions are incorrect for end users. The extension should only be installed through the Raycast Store, not by cloning the repo. Remove the npm commands since they are only relevant for development.
1. Clone this repository or download the extension from the Raycast Store. | |
2. Run `npm install` to install dependencies. | |
3. Use `npm run dev` to start the extension in development mode or `npm run build` to build it for production. | |
1. Install the extension from the Raycast Store. |
const { isLoading: isDeparturesLoading, data: departuresData } = useFetch( | ||
DEPARTURE_URL, | ||
{ | ||
parseResponse: (res) => res.json() as Promise<DepartureResponse>, | ||
}, | ||
); |
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.
style: Add error handling for API failures using try/catch with showFailureToast from @raycast/utils
const { isLoading: isDeparturesLoading, data: departuresData } = useFetch( | |
DEPARTURE_URL, | |
{ | |
parseResponse: (res) => res.json() as Promise<DepartureResponse>, | |
}, | |
); | |
const { isLoading: isDeparturesLoading, data: departuresData } = useFetch( | |
DEPARTURE_URL, | |
{ | |
parseResponse: async (res) => { | |
if (!res.ok) { | |
throw new Error(`Failed to fetch departures: ${res.statusText}`); | |
} | |
return res.json() as Promise<DepartureResponse>; | |
}, | |
onError: (error) => showFailureToast(error), | |
}, | |
); |
alertData?.root?.bsa?.[0]?.description["#cdata-section"] != | ||
"No delays reported." | ||
? alertData?.root?.bsa?.[0]?.description["#cdata-section"] |
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.
logic: Using != for string comparison instead of !==. This can cause type coercion issues
alertData?.root?.bsa?.[0]?.description["#cdata-section"] != | |
"No delays reported." | |
? alertData?.root?.bsa?.[0]?.description["#cdata-section"] | |
alertData?.root?.bsa?.[0]?.description["#cdata-section"] !== | |
"No delays reported." | |
? alertData?.root?.bsa?.[0]?.description["#cdata-section"] |
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.
7 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); |
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.
style: Consider removing allConfig since it's not being used. The recommendedConfig is sufficient when extending @raycast's config.
} | ||
|
||
function DepartureDetail({ station }: { station: string }) { | ||
const API_KEY = "Q58Q-PEEI-9DLT-DWEI"; |
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.
style: Move API_KEY to preferences using @raycast/api's getPreferenceValues() for better security
Description
This Raycast extension provides real-time BART (Bay Area Rapid Transit) departure schedules and service alerts, allowing users to view upcoming train departures by station and stay informed about delays or disruptions.
Screencast
2025-03-19.00-49-25.mp4
Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are located outside the metadata folder if they were not generated with our metadata toolGreptile Summary
This PR adds a new BART (Bay Area Rapid Transit) extension that provides real-time departure schedules and service alerts for Bay Area stations, with station selection and detailed departure information.
Q58Q-PEEI-9DLT-DWEI
insrc/departures.tsx
should be moved to preferences for better security and user customization^19.0.0
inpackage.json
is invalid and should be downgraded as React 19 doesn't exist yetmetadata
folder with screenshots for view commands as per Raycast Documentationpackage.json
has typo: "depatures" should be "departures"README.md
should be removed since users should only install through Raycast Store💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!