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,