Skip to content

Add extended promotional component flag#326

Open
Haenlein1 wants to merge 2 commits into
tscircuit:mainfrom
Haenlein1:codex/add-extended-promotional-components
Open

Add extended promotional component flag#326
Haenlein1 wants to merge 2 commits into
tscircuit:mainfrom
Haenlein1:codex/add-extended-promotional-components

Conversation

@Haenlein1
Copy link
Copy Markdown

What changed

  • Adds a persisted/indexed is_extended_promotional component column derived from source metadata.
  • Exposes is_extended_promotional in /components/list and /api/search responses and supports is_extended_promotional=true filtering.
  • Carries the flag through the D1/cf-proxy component catalog and search index paths.
  • Adds focused helper tests for promotional-extended metadata detection.

Why it fixes the issue

Issue #92 asks for extended promotional parts to be available in a filterable column. This adds that column during DB optimization, keeps it indexed for filtering, and makes the field available through both the legacy app routes and the Cloudflare proxy/search paths.

Tested

  • npx @biomejs/biome format --write on touched files
  • npx tsc --noEmit
  • cd cf-proxy && npx tsc --noEmit
  • git diff --check

Limitations

  • cf-proxy Vitest startup is blocked in my local Windows workspace by the Cloudflare/Vitest worker loader resolving the username path with a space; the suite starts after optional native dependencies are installed but fails before collecting tests.
  • Root Bun tests were not run because Bun is not installed in this environment.

/claim #92

Bounty: #92

Copy link
Copy Markdown
Author

CI status update:

  • Format Check: passing
  • Type Check: passing
  • Bun Test: failing before tests run during setup, at scripts/setup-7z.ts with Failed to download: Not Found

This looks like the setup dependency download step rather than a test failure from this PR's code path.

Copy link
Copy Markdown
Author

Follow-up pushed in c5d4fcb.

What changed:

  • Updated scripts/setup-7z.ts from removed 7z2408 artifacts to current 7z2601 artifacts. I verified the old Linux x64 URL returns 404 and the new Linux x64/Linux arm64/mac URLs return 200.
  • Hardened the DB optimization guard to check pragma_table_info('components') for is_extended_promotional instead of probing the column with a select.

Local verification:

  • npx biome format --write scripts/setup-7z.ts lib/db/optimizations/component-extended-promotional-column.ts
  • npx biome format scripts/setup-7z.ts lib/db/optimizations/component-extended-promotional-column.ts
  • npx --yes --package typescript tsc --noEmit --types bun
  • cd cf-proxy && npx tsc --noEmit

One local limitation: cd cf-proxy && npm test still fails in this Windows workspace before collecting tests because the Cloudflare/Vitest worker resolves a path with the space in C:\Users\jj haenlein incorrectly (.../vitest/dist/file:/C:/Users/jj%20haenlein/.../threads.js).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant