Files
yetone 2051dfc232 library: the Pi market finds packages by name on npmmirror (eachg0 on X)
eachg0 on X: searching the Pi market for "rename" (or "pi-rename") found
nothing, though npm's pi-rename 1.2.0 carries the pi-package keyword.
cf20df721 (11-18) made the market ask the registry in use first: magpie's
own, the user's .npmrc/bunfig/env, or npmmirror with the 「国内镜像」
switch. npmmirror knows no keywords: qualifier. It answers 200
{"objects":[],"total":0} to "keywords:pi-package rename", so npm's own
search, asked only when the registry fails, never was. Its plain search,
"pi-package rename", finds 52, every one with the keyword.

A search with words that comes back empty is now asked again with the
qualifier as a plain word (plugin.PlainKeywords), and the keyword is
still checked here. The list before a search is unchanged: npmmirror
answers it with nothing, and magpie's snapshot stands, as before.

Sibling: the Plugins page's search (plugin.Search) asks
"keywords:pi-package <q>" too, and with the switch on source.Do sends it
to npmmirror first, so it found no pi provider packages there either.
searchNPM retries the same way. No other search uses a qualifier.

Tests, from npmmirror's own bytes (testdata/npmmirror, 2026-11-19):
TestPiSearchFindsByNameOnNPMMirror ("rename" and "pi-rename" find
pi-rename with npm's own search down), TestSearchFindsPiPackagesOnNPMMirror,
TestPlainKeywords.

Run (mica, at this tree; origin/main 3869aee3b, unchanged at push):
- gofmt -l: clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok; go build, GOOS=linux go build -tags
  nogui, GOOS=windows go build: ok
- go test -tags nogui ./internal/library ./internal/plugin: ok
- go test -tags nogui ./internal/gui: two reds, both filed and both
  passing alone at this tree: TestAppReplacesItsOlderGatewayOnceIdle
  (#6297) and TestGatewayModeListsNoOwnSessions (#7064)
- GUI library-pi-market.test.cjs: Chromium 22/22, WebKit 11/11

Broken by hand: the old pimarket.go and market.go with the new tests:
TestPiSearchFindsByNameOnNPMMirror red ("rename": [] asked
["keywords:pi-package" "keywords:pi-package rename"]),
TestSearchFindsPiPackagesOnNPMMirror red (Search = []).
Real use (sandbox HOME, NPM_CONFIG_REGISTRY=https://registry.npmmirror.com,
live npmmirror): old code "rename" 0 results, "pi-rename" 0; new code
52 and 52 with pi-rename; Plugins search "antigravity" finds the pi
provider packages. npm's own registry: pi-rename found before and after.
Not run: the full go test ./... (mote and mica each had another
session's full suite running), the whole GUI suite (no GUI or API change).
Not tried: the real 「国内镜像」 switch in the app (same registry URL as
the env var path).
2026-11-19 11:50:37 +08:00
..