From e93df5653456974f79e1386e32fccace6d7d9666 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 12:04:35 +0000 Subject: [PATCH 1/6] Raycast: address Store review feedback - Move contributor notes (AGENTS.md, Development, Releasing) out of raycast/ to docs/raycast.md - Drop the redundant command subtitle; declare macOS as the platform - Unique temp file per catalog write - A typed ^ ticker is an index, so the Indices filter keeps it - Retry action on the symbol-list failure toast; Show/Hide Chart in its own section Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- AGENTS.md | 3 ++- raycast/AGENTS.md => docs/raycast.md | 20 ++++++++++++++++++++ raycast/README.md | 19 ------------------- raycast/package.json | 4 +++- raycast/src/lib/catalog.ts | 3 ++- raycast/src/search-symbol.tsx | 23 ++++++++++++++++------- 6 files changed, 43 insertions(+), 29 deletions(-) rename raycast/AGENTS.md => docs/raycast.md (67%) diff --git a/AGENTS.md b/AGENTS.md index 4b95e5b..7eaf46e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,8 @@ This repository hosts Pulse for Omarchy, Pulse for Claude Code, Pulse for openco commercial Mac and website source belongs in the private Pulse repository. - Keep `omarchy`, `plugins/claude-code`, `opencode`, `herdr` and `raycast` independent; follow their - scoped AGENTS.md instructions and run checks appropriate to the changed edition. + scoped AGENTS.md instructions (Raycast's live in docs/raycast.md, since the + Store ships everything in raycast/) and run checks appropriate to the changed edition. - Do not restore current Mac source, website source, signing material, private SDKs, or app publishing workflows here. - Preserve historical Git commits, version tags, MIT notices, free DMG/ZIP assets, diff --git a/raycast/AGENTS.md b/docs/raycast.md similarity index 67% rename from raycast/AGENTS.md rename to docs/raycast.md index 3b691a9..0f822d3 100644 --- a/raycast/AGENTS.md +++ b/docs/raycast.md @@ -21,3 +21,23 @@ `raycast-v*` or manual run, environment `raycast`): GitHub sign-in by device code approved with the owner's passkey, then `ray publish`. Never store a GitHub token for it. + +## Development + + +```sh +npm install +npm run dev # opens the extension in Raycast +npm test # search, catalog and quote tests +npm run lint +``` + +## Releasing + +The Raycast Store takes extensions as pull requests to `raycast/extensions`. +`.github/workflows/release-raycast.yml` submits this folder: push a tag +`raycast-v` (for example `raycast-v2026.11.03`) or start it from the +Actions tab. After the `raycast` environment approval, the job prints a +one-time GitHub device code; open `https://github.com/login/device`, sign in +with your passkey and enter it. No token is stored. The first run opens a +draft PR; mark it "Ready for review". Later runs update the same submission. diff --git a/raycast/README.md b/raycast/README.md index 5b2fc3c..8dea91f 100644 --- a/raycast/README.md +++ b/raycast/README.md @@ -36,22 +36,3 @@ on Yahoo Finance directly; a pair like `ETH/BTC` is priced on Binance. Want these prices in your menu bar all day, with watchlists, charts and positions? See [Pulse for Mac](https://www.pulseticker.app/?utm_source=raycast&utm_medium=extension&utm_content=readme). - -## Development - -```sh -npm install -npm run dev # opens the extension in Raycast -npm test # search, catalog and quote tests -npm run lint -``` - -## Releasing - -The Raycast Store takes extensions as pull requests to `raycast/extensions`. -`.github/workflows/release-raycast.yml` submits this folder: push a tag -`raycast-v` (for example `raycast-v2026.11.03`) or start it from the -Actions tab. After the `raycast` environment approval, the job prints a -one-time GitHub device code; open `https://github.com/login/device`, sign in -with your passkey and enter it. No token is stored. The first run opens a -draft PR; mark it "Ready for review". Later runs update the same submission. diff --git a/raycast/package.json b/raycast/package.json index 54de41b..8178187 100644 --- a/raycast/package.json +++ b/raycast/package.json @@ -9,11 +9,13 @@ "Finance" ], "license": "MIT", + "platforms": [ + "macOS" + ], "commands": [ { "name": "search-symbol", "title": "Search Symbol", - "subtitle": "Pulse", "description": "Find a stock, index or crypto pair by ticker or by name in English, Chinese, Japanese or Korean, and see its price and today's chart.", "mode": "view", "keywords": [ diff --git a/raycast/src/lib/catalog.ts b/raycast/src/lib/catalog.ts index 24cead2..fb14ad2 100644 --- a/raycast/src/lib/catalog.ts +++ b/raycast/src/lib/catalog.ts @@ -1,6 +1,7 @@ // Pulse's symbol catalog and Binance's pair directory, kept on disk and // refreshed at most once a day. The catalog download is conditional // (If-None-Match), so a day with no listing changes costs an empty response. +import { randomUUID } from "node:crypto"; import { mkdir, readFile, rename, writeFile } from "node:fs/promises"; import { join } from "node:path"; import type { CatalogDocument, CryptoPairs } from "./search"; @@ -31,7 +32,7 @@ async function readJSON(path: string): Promise { /** Write next to the target, then rename, so a crash never leaves half a file. */ async function writeAtomically(path: string, text: string): Promise { - const temporary = `${path}.${process.pid}.tmp`; + const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`; await writeFile(temporary, text, "utf8"); await rename(temporary, path); } diff --git a/raycast/src/search-symbol.tsx b/raycast/src/search-symbol.tsx index 6d67b6e..117ee2e 100644 --- a/raycast/src/search-symbol.tsx +++ b/raycast/src/search-symbol.tsx @@ -76,6 +76,8 @@ function typedInstrument(query: string, index: SymbolIndex | undefined): Instrum if (index && index.pairs.size > 0 && !index.pairs.has(symbol)) return null; return { symbol, market: "crypto", kind: "crypto", name: symbol.split("/")[0], exchange: "Binance Spot" }; } + // A typed "^FTSE" is an index whatever its exchange, so the Indices filter keeps it. + if (symbol.startsWith("^")) return { symbol, market: "index", kind: "index", name: symbol, exchange: null }; return { symbol, market: "us", kind: "equity", name: symbol, exchange: null }; } @@ -114,7 +116,12 @@ export default function Command() { revalidate: reloadIndex, } = usePromise(loadIndex, [], { onError: (error) => { - showToast({ style: Toast.Style.Failure, title: "Could not load the symbol list", message: error.message }); + showToast({ + style: Toast.Style.Failure, + title: "Could not load the symbol list", + message: error.message, + primaryAction: { title: "Retry", onAction: () => reloadIndex() }, + }); }, }); @@ -294,12 +301,6 @@ function InstrumentActions(props: { url={quotePageUrl(instrument.symbol)} onOpen={() => remember(instrument.symbol)} /> - )} + + + From 65eb1121fc4a2c612897cb0c15619dd40288d371 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 12:49:19 +0000 Subject: [PATCH 2/6] Raycast: address second Store review round - List rows: keep the rows that priced, and say which source failed with a Retry - A typed ticker with a known suffix (7203.T, 0700.HK) belongs to that market's filter - Validate catalog entries before replacing the copy in hand, with a malformed-export test - Use the hook's failureToastOptions instead of a hand-built toast - Copy Symbol is the second action, so it carries no custom shortcut Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- raycast/src/lib/catalog.ts | 24 +++++++++++++- raycast/src/search-symbol.tsx | 62 +++++++++++++++++++++++++++-------- raycast/tests/catalog.test.ts | 16 +++++++++ 3 files changed, 88 insertions(+), 14 deletions(-) diff --git a/raycast/src/lib/catalog.ts b/raycast/src/lib/catalog.ts index fb14ad2..901f422 100644 --- a/raycast/src/lib/catalog.ts +++ b/raycast/src/lib/catalog.ts @@ -42,11 +42,33 @@ export function validCatalog(value: unknown): value is CatalogDocument { return ( document?.schema === 1 && typeof document.generatedAt === "string" && + Array.isArray(document.markets) && Array.isArray(document.securities) && - Array.isArray(document.markets) + document.securities.every(validSecurity) && + (document.crypto === undefined || (Array.isArray(document.crypto) && document.crypto.every(validCoin))) ); } +const isObject = (value: unknown): value is Record => + typeof value === "object" && value !== null && !Array.isArray(value); +const optionalNames = (value: unknown) => value === undefined || isObject(value); +const optionalAliases = (value: unknown) => value === undefined || Array.isArray(value); + +// Every entry the index reads, so a malformed export never replaces the copy in hand. +function validSecurity(entry: unknown): boolean { + return ( + isObject(entry) && + typeof entry.m === "string" && + typeof entry.c === "string" && + optionalNames(entry.n) && + optionalAliases(entry.a) + ); +} + +function validCoin(entry: unknown): boolean { + return isObject(entry) && typeof entry.b === "string" && optionalNames(entry.n) && optionalAliases(entry.a); +} + export class CatalogStore { constructor( private readonly directory: string, diff --git a/raycast/src/search-symbol.tsx b/raycast/src/search-symbol.tsx index 117ee2e..e8ff4b2 100644 --- a/raycast/src/search-symbol.tsx +++ b/raycast/src/search-symbol.tsx @@ -25,6 +25,7 @@ import { MARKET_CURRENCIES, MARKET_FILTERS, MARKET_LABELS, + Market, PULSE_FOR_MAC_URL, isCryptoPair, normalizeTypedSymbol, @@ -78,9 +79,23 @@ function typedInstrument(query: string, index: SymbolIndex | undefined): Instrum } // A typed "^FTSE" is an index whatever its exchange, so the Indices filter keeps it. if (symbol.startsWith("^")) return { symbol, market: "index", kind: "index", name: symbol, exchange: null }; - return { symbol, market: "us", kind: "equity", name: symbol, exchange: null }; + const suffix = /\.([A-Z]+)$/.exec(symbol)?.[1]; + const market = (suffix && SUFFIX_MARKETS[suffix]) ?? "us"; + return { symbol, market, kind: "equity", name: symbol, exchange: null }; } +// The Yahoo suffixes of the markets the filter offers, so a typed `7203.T` stays under Japan. +const SUFFIX_MARKETS: Record = { + HK: "hk", + SS: "sh", + SZ: "sz", + T: "jp", + KS: "kr", + KQ: "kq", + TW: "tw", + TWO: "two", +}; + const changeColor = (value: number | null | undefined) => value === null || value === undefined ? Color.SecondaryText : value >= 0 ? Color.Green : Color.Red; @@ -115,14 +130,7 @@ export default function Command() { error: indexError, revalidate: reloadIndex, } = usePromise(loadIndex, [], { - onError: (error) => { - showToast({ - style: Toast.Style.Failure, - title: "Could not load the symbol list", - message: error.message, - primaryAction: { title: "Retry", onAction: () => reloadIndex() }, - }); - }, + failureToastOptions: { title: "Could not load the symbol list" }, }); const language: Language = readerLanguage(preferences.nameLanguage ?? "auto", searchText, SYSTEM_LOCALE); @@ -160,7 +168,11 @@ export default function Command() { const visible = useMemo(() => sections.flatMap((section) => section.items.map((item) => item.symbol)), [sections]); // List rows carry a price only while the detail pane is hidden; the pane prices the selected row itself. - const { data: rows, isLoading: rowsLoading } = useCachedPromise( + const { + data: priced, + isLoading: rowsLoading, + revalidate: repriceRows, + } = useCachedPromise( async (symbols: string[]) => { const crypto = symbols.filter(isCryptoPair); const stocks = symbols.filter((symbol) => !isCryptoPair(symbol)); @@ -172,14 +184,39 @@ export default function Command() { return Object.assign({}, ...each.map((result) => (result.status === "fulfilled" ? result.value : {}))); }), ]); - return { + const failed = [ + ...(stockRows.status === "rejected" ? ["Yahoo Finance"] : []), + ...(cryptoRows.status === "rejected" ? ["Binance"] : []), + ]; + const quotes = { ...(stockRows.status === "fulfilled" ? stockRows.value : {}), ...(cryptoRows.status === "fulfilled" ? cryptoRows.value : {}), } as Record; + // Nothing priced: fail outright, and the hook's toast offers Retry. + if (failed.length && Object.keys(quotes).length === 0) { + throw new Error(`${failed.join(" and ")} did not answer.`); + } + return { quotes, failed }; }, [visible], - { execute: !showingDetail && visible.length > 0, keepPreviousData: true }, + { + execute: !showingDetail && visible.length > 0, + keepPreviousData: true, + failureToastOptions: { title: "Could not load prices" }, + }, ); + const rows = priced?.quotes; + // Some rows priced and some not: keep the priced ones, and say which source failed. + const failedSources = priced?.failed.join(" and "); + useEffect(() => { + if (!failedSources) return; + showToast({ + style: Toast.Style.Failure, + title: "Some prices could not be loaded", + message: `${failedSources} did not answer.`, + primaryAction: { title: "Retry", onAction: () => repriceRows() }, + }); + }, [priced]); const remember = (symbol: string) => setRecent((current) => [symbol, ...current.filter((item) => item !== symbol)].slice(0, RECENT_LIMIT)); @@ -304,7 +341,6 @@ function InstrumentActions(props: { remember(instrument.symbol)} /> {instrument.name !== instrument.symbol && ( diff --git a/raycast/tests/catalog.test.ts b/raycast/tests/catalog.test.ts index 702dde3..58a370f 100644 --- a/raycast/tests/catalog.test.ts +++ b/raycast/tests/catalog.test.ts @@ -70,6 +70,22 @@ test("refuses a truncated or older file and keeps the copy in hand", async () => assert.equal(onDisk.generatedAt, "2026-11-02T00:00:00Z"); }); +test("refuses an export whose entries are malformed", async () => { + const directory = await mkdtemp(join(tmpdir(), "pulse-raycast-")); + const good = JSON.parse(catalog("2026-11-03T00:00:00Z", 100)); + const { fetcher } = fakeFetch([ + new Response(catalog("2026-11-02T00:00:00Z", 100), { headers: { etag: '"a"' } }), + new Response(JSON.stringify({ ...good, securities: [...good.securities, null] })), + new Response(JSON.stringify({ ...good, crypto: "BTC" })), + new Response(JSON.stringify({ ...good, securities: [...good.securities, { m: "us", c: 7 }] })), + ]); + const store = new CatalogStore(directory, fetcher); + const first = await store.refreshCatalog(null); + for (let attempt = 0; attempt < 3; attempt += 1) await assert.rejects(store.refreshCatalog(first)); + const onDisk = JSON.parse(await readFile(join(directory, "symbols-v1.json"), "utf8")); + assert.equal(onDisk.generatedAt, "2026-11-02T00:00:00Z"); +}); + test("keeps Binance's trading pairs as base and quote", async () => { const directory = await mkdtemp(join(tmpdir(), "pulse-raycast-")); const symbols = Array.from({ length: 150 }, (_, i) => ({ From 5e03ce317ef3cbb54724de06da32d2344bd5e509 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 12:51:46 +0000 Subject: [PATCH 3/6] Raycast: publish from the Mac mini, drop the CI release workflow ray publish updates the open Store submission only from the machine that holds its fork clone; a CI runner starts from scratch each time and replaced the submission PR (raycast/extensions#33095 -> #33098). Document the Mac mini command instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- .github/workflows/release-raycast.yml | 84 --------------------------- docs/raycast.md | 30 ++++++---- 2 files changed, 18 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/release-raycast.yml diff --git a/.github/workflows/release-raycast.yml b/.github/workflows/release-raycast.yml deleted file mode 100644 index 91068db..0000000 --- a/.github/workflows/release-raycast.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Release Pulse for Raycast - -# Submits raycast/ to the Raycast Store: `ray publish` forks raycast/extensions -# under the approving account and opens (or updates) the submission PR there. -# -# Start it by pushing a tag raycast-v (e.g. raycast-v2026.11.03), -# or from the Actions tab. No token is stored anywhere: the job asks GitHub for a -# one-time device code, prints it in the log and the run summary, and waits for -# you to approve it at https://github.com/login/device (signed in with your -# passkey). The token it gets lives only in this job. -on: - push: - tags: ["raycast-v*"] - workflow_dispatch: - -permissions: - contents: read - -jobs: - publish: - if: github.repository == 'fatwang2/Pulse' - runs-on: ubuntu-latest - timeout-minutes: 30 - environment: raycast # add required reviewers on this environment to approve each submission - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - with: - persist-credentials: false - - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: '24' - - name: Test, lint and build - run: make test-raycast - - name: Sign in to GitHub with a device code and publish - working-directory: raycast - env: - # The Raycast CLI's own GitHub OAuth app, the same one `npm run publish` uses on a Mac. - RAYCAST_GITHUB_CLIENT_ID: e69bae0ec90f5e838555 - run: | - set -euo pipefail - # JSON bodies, exactly as the Raycast CLI sends them. - post() { curl -fsS -X POST "$1" -H 'Accept: application/json' -H 'Content-Type: application/json' -d "$2"; } - device="$(post https://github.com/login/device/code \ - "$(jq -nc --arg id "$RAYCAST_GITHUB_CLIENT_ID" '{client_id: $id, scope: "repo"}')")" - code="$(jq -r .user_code <<<"$device")" - device_code="$(jq -r .device_code <<<"$device")" - interval="$(jq -r .interval <<<"$device")" - expires="$(jq -r .expires_in <<<"$device")" - url="$(jq -r .verification_uri <<<"$device")" - echo "::notice title=Approve the Raycast submission::Open ${url} and enter ${code} (valid for $((expires / 60)) minutes)." - { - echo "### Approve the Raycast submission" - echo - echo "Open ${url}, sign in with your passkey, and enter **${code}**." - echo "The code is valid for $((expires / 60)) minutes." - } >> "$GITHUB_STEP_SUMMARY" - - token="" - deadline=$(( $(date +%s) + expires )) - while [ "$(date +%s)" -lt "$deadline" ]; do - sleep "$interval" - answer="$(post https://github.com/login/oauth/access_token \ - "$(jq -nc --arg id "$RAYCAST_GITHUB_CLIENT_ID" --arg code "$device_code" \ - '{client_id: $id, device_code: $code, grant_type: "urn:ietf:params:oauth:grant-type:device_code"}')")" - error="$(jq -r '.error // empty' <<<"$answer")" - case "$error" in - "") token="$(jq -r .access_token <<<"$answer")"; break ;; - authorization_pending) ;; - slow_down) interval=$(( interval + 5 )) ;; - *) echo "GitHub refused the device code: ${error}" >&2; exit 1 ;; - esac - done - if [ -z "$token" ]; then - echo "The device code expired before it was approved." >&2 - exit 1 - fi - echo "::add-mask::${token}" - - login="$(curl -fsS https://api.github.com/user -H "Authorization: Bearer ${token}" | jq -r .login)" - echo "Approved by ${login}." - git config --global user.name "${login}" - git config --global user.email "${login}@users.noreply.github.com" - # `ray publish` skips its own interactive GitHub sign-in when this is set. - GITHUB_ACCESS_TOKEN="$token" npx ray publish diff --git a/docs/raycast.md b/docs/raycast.md index 0f822d3..e47c607 100644 --- a/docs/raycast.md +++ b/docs/raycast.md @@ -17,14 +17,11 @@ - Follow Raycast's Store rules: US English UI, Title Case action titles, `CHANGELOG.md` with `{PR_MERGE_DATE}`, `package-lock.json` committed, `npm run lint` and `npm run build` clean before publishing. -- Releases go through `.github/workflows/release-raycast.yml` (tag - `raycast-v*` or manual run, environment `raycast`): GitHub sign-in by device - code approved with the owner's passkey, then `ray publish`. Never store a - GitHub token for it. +- Publish only from the owner's Mac mini (see Releasing). Never from CI or a + fresh machine, and never store a GitHub token. ## Development - ```sh npm install npm run dev # opens the extension in Raycast @@ -34,10 +31,19 @@ npm run lint ## Releasing -The Raycast Store takes extensions as pull requests to `raycast/extensions`. -`.github/workflows/release-raycast.yml` submits this folder: push a tag -`raycast-v` (for example `raycast-v2026.11.03`) or start it from the -Actions tab. After the `raycast` environment approval, the job prints a -one-time GitHub device code; open `https://github.com/login/device`, sign in -with your passkey and enter it. No token is stored. The first run opens a -draft PR; mark it "Ready for review". Later runs update the same submission. +The Raycast Store takes extensions as pull requests to `raycast/extensions`, +and `ray publish` opens or updates that pull request. It keeps its own clone +of the fork in `~/.config/raycast/public-extensions-fork` and updates the open +submission only from the machine holding that clone. A fresh machine (or a CI +runner) rebuilds the `ext/pulse` branch, which closes the open submission and +opens a new one. So publish from the Mac mini only: + +```sh +cd raycast +GIT_CONFIG_COUNT=2 \ + GIT_CONFIG_KEY_0=user.name GIT_CONFIG_VALUE_0=fatwang2 \ + GIT_CONFIG_KEY_1=user.email GIT_CONFIG_VALUE_1=fatwang2@users.noreply.github.com \ + GITHUB_ACCESS_TOKEN="$(gh auth token)" npx ray publish +``` + +The token is gh's existing sign-in and is used for this command only. From dde3883973696d1965e507f616be57d7545d0cdd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 13:03:33 +0000 Subject: [PATCH 4/6] Raycast: fix the typed-market type error, type-check in CI ray build does not run tsc, so a '' | Market inference slipped through. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- Makefile | 2 +- raycast/package.json | 1 + raycast/src/search-symbol.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fade539..9321c6f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ test-opencode: node --test opencode/tests/*.test.mjs test-raycast: - cd raycast && npm ci && npm test && npm run lint && npm run build + cd raycast && npm ci && npm test && npm run typecheck && npm run lint && npm run build validate: test git diff --check diff --git a/raycast/package.json b/raycast/package.json index 8178187..e1f9545 100644 --- a/raycast/package.json +++ b/raycast/package.json @@ -86,6 +86,7 @@ "dev": "ray develop", "fix-lint": "ray lint --fix", "lint": "ray lint", + "typecheck": "tsc --noEmit", "test": "tsx --test tests/*.test.ts", "prepublishOnly": "echo \"\\n\\nIt seems like you are trying to publish the Raycast extension to npm.\\n\\nIf you did intend to publish it to npm, remove the \\`prepublishOnly\\` script and rerun \\`npm publish\\` again.\\nIf you wanted to publish it to the Raycast Store instead, use \\`npm run publish\\` instead.\\n\\n\" && exit 1", "publish": "npx @raycast/api@latest publish" diff --git a/raycast/src/search-symbol.tsx b/raycast/src/search-symbol.tsx index e8ff4b2..aab0fd8 100644 --- a/raycast/src/search-symbol.tsx +++ b/raycast/src/search-symbol.tsx @@ -80,7 +80,7 @@ function typedInstrument(query: string, index: SymbolIndex | undefined): Instrum // A typed "^FTSE" is an index whatever its exchange, so the Indices filter keeps it. if (symbol.startsWith("^")) return { symbol, market: "index", kind: "index", name: symbol, exchange: null }; const suffix = /\.([A-Z]+)$/.exec(symbol)?.[1]; - const market = (suffix && SUFFIX_MARKETS[suffix]) ?? "us"; + const market = (suffix ? SUFFIX_MARKETS[suffix] : undefined) ?? "us"; return { symbol, market, kind: "equity", name: symbol, exchange: null }; } From 1447699798ef0ff9dc58c9c78cfd363b96ee010d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 13:05:13 +0000 Subject: [PATCH 5/6] Raycast: type-check after the build generates raycast-env.d.ts Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9321c6f..4f27029 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ test-opencode: node --test opencode/tests/*.test.mjs test-raycast: - cd raycast && npm ci && npm test && npm run typecheck && npm run lint && npm run build + cd raycast && npm ci && npm test && npm run lint && npm run build && npm run typecheck validate: test git diff --check From 3f939646fa0c9b27a4d3c901b5d1db1afac1b631 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 04:55:06 +0000 Subject: [PATCH 6/6] Raycast: move tests out of the Store folder, restore the command subtitle The Store reviewer asked that raycast/ hold only what installs need. Tests move to tests/raycast/ and run via npx tsx from the Makefile; the test script and the tsx devDependency are gone. The reviewer also suggested the Pulse subtitle so the brand shows in root search. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DuYf7vdDtMHbY6YTKJrEqJ --- .github/workflows/open-source-checks.yml | 2 ++ Makefile | 2 +- docs/raycast.md | 5 ++- raycast/package-lock.json | 35 ------------------- raycast/package.json | 3 +- raycast/tsconfig.json | 2 +- .../tests => tests/raycast}/catalog.test.ts | 2 +- .../tests => tests/raycast}/quotes.test.ts | 6 ++-- .../tests => tests/raycast}/search.test.ts | 4 +-- 9 files changed, 15 insertions(+), 46 deletions(-) rename {raycast/tests => tests/raycast}/catalog.test.ts (98%) rename {raycast/tests => tests/raycast}/quotes.test.ts (95%) rename {raycast/tests => tests/raycast}/search.test.ts (97%) diff --git a/.github/workflows/open-source-checks.yml b/.github/workflows/open-source-checks.yml index 97065d7..a9b41ab 100644 --- a/.github/workflows/open-source-checks.yml +++ b/.github/workflows/open-source-checks.yml @@ -9,6 +9,7 @@ on: - 'plugins/**' - 'omarchy/**' - 'raycast/**' + - 'tests/raycast/**' - 'metrix/**' - 'Makefile' - '.github/workflows/open-source-checks.yml' @@ -21,6 +22,7 @@ on: - 'plugins/**' - 'omarchy/**' - 'raycast/**' + - 'tests/raycast/**' - 'metrix/**' - 'Makefile' - '.github/workflows/open-source-checks.yml' diff --git a/Makefile b/Makefile index 0517be0..a9d9139 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test-metrix: node --test metrix/tests/*.test.mjs test-raycast: - cd raycast && npm ci && npm test && npm run lint && npm run build && npm run typecheck + cd raycast && npm ci && npx --yes tsx@4.23.15 --test ../tests/raycast/*.test.ts && npm run lint && npm run build && npm run typecheck validate: test git diff --check diff --git a/docs/raycast.md b/docs/raycast.md index e47c607..92f3ba3 100644 --- a/docs/raycast.md +++ b/docs/raycast.md @@ -17,6 +17,9 @@ - Follow Raycast's Store rules: US English UI, Title Case action titles, `CHANGELOG.md` with `{PR_MERGE_DATE}`, `package-lock.json` committed, `npm run lint` and `npm run build` clean before publishing. +- Keep tests and other dev material out of `raycast/`: the Store reviewer + asked for only the extension, `README.md`, `CHANGELOG.md`, `media/` and + `metadata/`. Tests live in `tests/raycast/` and run with `npx tsx`. - Publish only from the owner's Mac mini (see Releasing). Never from CI or a fresh machine, and never store a GitHub token. @@ -25,7 +28,7 @@ ```sh npm install npm run dev # opens the extension in Raycast -npm test # search, catalog and quote tests +make -C .. test-raycast # tests (in tests/raycast/, outside the Store folder), lint, build, typecheck npm run lint ``` diff --git a/raycast/package-lock.json b/raycast/package-lock.json index cbd28fa..0c0b564 100644 --- a/raycast/package-lock.json +++ b/raycast/package-lock.json @@ -17,7 +17,6 @@ "@types/react": "19.3.0", "eslint": "^9.22.0", "prettier": "^3.5.3", - "tsx": "^4.23.15", "typescript": "^5.8.2" } }, @@ -2404,21 +2403,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -3495,25 +3479,6 @@ "typescript": ">=4.8.4" } }, - "node_modules/tsx": { - "version": "4.23.15", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", - "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.28.0" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/raycast/package.json b/raycast/package.json index e1f9545..7ceca44 100644 --- a/raycast/package.json +++ b/raycast/package.json @@ -16,6 +16,7 @@ { "name": "search-symbol", "title": "Search Symbol", + "subtitle": "Pulse", "description": "Find a stock, index or crypto pair by ticker or by name in English, Chinese, Japanese or Korean, and see its price and today's chart.", "mode": "view", "keywords": [ @@ -78,7 +79,6 @@ "@types/react": "19.3.0", "eslint": "^9.22.0", "prettier": "^3.5.3", - "tsx": "^4.23.15", "typescript": "^5.8.2" }, "scripts": { @@ -87,7 +87,6 @@ "fix-lint": "ray lint --fix", "lint": "ray lint", "typecheck": "tsc --noEmit", - "test": "tsx --test tests/*.test.ts", "prepublishOnly": "echo \"\\n\\nIt seems like you are trying to publish the Raycast extension to npm.\\n\\nIf you did intend to publish it to npm, remove the \\`prepublishOnly\\` script and rerun \\`npm publish\\` again.\\nIf you wanted to publish it to the Raycast Store instead, use \\`npm run publish\\` instead.\\n\\n\" && exit 1", "publish": "npx @raycast/api@latest publish" } diff --git a/raycast/tsconfig.json b/raycast/tsconfig.json index 110b49d..b48852f 100644 --- a/raycast/tsconfig.json +++ b/raycast/tsconfig.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/tsconfig", "display": "Node 22", - "include": ["src/**/*", "tests/**/*", "raycast-env.d.ts"], + "include": ["src/**/*", "raycast-env.d.ts"], "compilerOptions": { "lib": ["ES2023"], "module": "commonjs", diff --git a/raycast/tests/catalog.test.ts b/tests/raycast/catalog.test.ts similarity index 98% rename from raycast/tests/catalog.test.ts rename to tests/raycast/catalog.test.ts index 58a370f..2f16416 100644 --- a/raycast/tests/catalog.test.ts +++ b/tests/raycast/catalog.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, readFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { test } from "node:test"; -import { CATALOG_URL, CatalogStore, DAY_MS } from "../src/lib/catalog"; +import { CATALOG_URL, CatalogStore, DAY_MS } from "../../raycast/src/lib/catalog"; const catalog = (generatedAt: string, count: number) => JSON.stringify({ diff --git a/raycast/tests/quotes.test.ts b/tests/raycast/quotes.test.ts similarity index 95% rename from raycast/tests/quotes.test.ts rename to tests/raycast/quotes.test.ts index 2224974..3c8b82b 100644 --- a/raycast/tests/quotes.test.ts +++ b/tests/raycast/quotes.test.ts @@ -1,8 +1,8 @@ import assert from "node:assert/strict"; import { test } from "node:test"; -import { chartSvg } from "../src/lib/chart"; -import { formatAxis, formatChange, formatNumber, formatPrice } from "../src/lib/format"; -import { decodeSpark, decodeYahooChart } from "../src/lib/quotes"; +import { chartSvg } from "../../raycast/src/lib/chart"; +import { formatAxis, formatChange, formatNumber, formatPrice } from "../../raycast/src/lib/format"; +import { decodeSpark, decodeYahooChart } from "../../raycast/src/lib/quotes"; const now = Date.UTC(2026, 10, 2, 16, 0); const start = Date.UTC(2026, 10, 2, 14, 30) / 1000; diff --git a/raycast/tests/search.test.ts b/tests/raycast/search.test.ts similarity index 97% rename from raycast/tests/search.test.ts rename to tests/raycast/search.test.ts index 7690789..0a26b30 100644 --- a/raycast/tests/search.test.ts +++ b/tests/raycast/search.test.ts @@ -1,7 +1,7 @@ import assert from "node:assert/strict"; import { test } from "node:test"; -import { SymbolIndex, displayName, fold, readerLanguage, type CatalogDocument } from "../src/lib/search"; -import { normalizeTypedSymbol, yahooSymbol } from "../src/lib/symbols"; +import { SymbolIndex, displayName, fold, readerLanguage, type CatalogDocument } from "../../raycast/src/lib/search"; +import { normalizeTypedSymbol, yahooSymbol } from "../../raycast/src/lib/symbols"; const catalog: CatalogDocument = { schema: 1,