@collectui/bdui 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/registry.js +3 -3
package/package.json
CHANGED
package/src/registry.js
CHANGED
|
@@ -38,9 +38,9 @@ export async function fetchItem(name, key) {
|
|
|
38
38
|
try {
|
|
39
39
|
return await fetchJson(`${registryBaseUrl()}/${name}.json`);
|
|
40
40
|
} catch (error) {
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
if (error?.status !== 404) throw error;
|
|
41
|
+
// 公共端 404(条目不在免费层)或 401(服务端 Pro 标记)都视为 Pro;
|
|
42
|
+
// 网络/5xx 原样抛出,否则会把上游抖动误诊成"Pro 组件需要 key",误导用户。
|
|
43
|
+
if (error?.status !== 404 && error?.status !== 401) throw error;
|
|
44
44
|
if (!key) {
|
|
45
45
|
throw new Error(
|
|
46
46
|
`"${name}" is a BoardUI Pro component. Pass --key <license-key> to install it (CLI), or start the MCP server with --key <key>. The key is distributed by your platform or administrator.`
|