Skip to content

fix(frontend): canonical Apache project names + sync target audience (#14)#40

Open
milamberspace wants to merge 1 commit into
apache:mainfrom
milamberspace:fix/issue-14-project-audience-sync
Open

fix(frontend): canonical Apache project names + sync target audience (#14)#40
milamberspace wants to merge 1 commit into
apache:mainfrom
milamberspace:fix/issue-14-project-audience-sync

Conversation

@milamberspace

Copy link
Copy Markdown
Contributor

Fixes #14.

The new-question form showed the lowercase project id (jmeter) in the picker and in the target-audience default (Apache jmeter community), and changing the selected project left a stale target audience behind.

Canonical casing like JMeter, CloudStack, CouchDB cannot be recovered from the lowercase id alone, so this bundles the authoritative names published by projects.apache.org:

  • src/lib/apache-projects.json — an id -> "Apache Name" map of all 373 ASF top-level projects, generated from the official feed by scripts/gen-apache-projects.mjs (re-runnable when the project list changes).
  • src/lib/projects.ts — synchronous lookup against the bundled map, with a lazy one-shot live fetch of the same feed for any id missing from the bundle (the feed serves Access-Control-Allow-Origin: *), and a capitalize-each-word heuristic as the final offline fallback.
  • ProjectPicker now renders the canonical name; the option value stays the project id sent as project_id.
  • The target audience follows the selected project while it still holds the auto-generated default, and is left untouched once the user edits it by hand.

npm run check passes (0 errors, 0 warnings) and npm run build succeeds. dist/ is left for CI to regenerate.

🤖 Generated with Claude Code

…ache#14)

The new-question form showed the lowercase project id ("jmeter") in the
picker and in the target-audience default ("Apache jmeter community"),
and changing the project left a stale audience.

- Bundle src/lib/apache-projects.json: an id -> "Apache Name" map of every
  ASF top-level project (373 entries), generated from the authoritative
  projects.apache.org feed by scripts/gen-apache-projects.mjs. This is the
  only way to get canonical casing (JMeter, CloudStack, CouchDB) that a
  lowercase id can't express.
- Add src/lib/projects.ts: synchronous lookup (bundled map), with a lazy
  one-shot live fetch of the same feed for ids missing from the bundle,
  and a capitalize heuristic as the final offline fallback.
- ProjectPicker renders the canonical name (value stays the id).
- Target audience follows the selected project while it holds the
  auto-generated default, and is left untouched once edited by hand.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015qQoQHpb4kR81SSzc8y6Dv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include case for characters (Capitalize project names) + Sync Project field with Target audience field

1 participant