claudepluginhub 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/dist/fetch.js +9 -7
  2. package/package.json +1 -1
package/dist/fetch.js CHANGED
@@ -14,7 +14,7 @@ export function resolveMarketplaceUrl(input) {
14
14
  printError(`Only claudepluginhub.com URLs are supported. Got: ${parsed.hostname}`);
15
15
  return null;
16
16
  }
17
- return input;
17
+ return parsed.href;
18
18
  }
19
19
  catch {
20
20
  printError('Invalid URL format.');
@@ -32,11 +32,11 @@ export function resolveMarketplaceUrl(input) {
32
32
  export async function fetchMarketplace(url) {
33
33
  try {
34
34
  // Ensure ?source=cli is present for install tracking
35
- const fetchUrl = url.includes('source=cli')
36
- ? url
37
- : url.includes('?')
38
- ? `${url}&source=cli`
39
- : `${url}?source=cli`;
35
+ const parsed = new URL(url);
36
+ if (!parsed.searchParams.has('source')) {
37
+ parsed.searchParams.set('source', 'cli');
38
+ }
39
+ const fetchUrl = parsed.toString();
40
40
  const response = await fetch(fetchUrl, {
41
41
  signal: AbortSignal.timeout(15_000),
42
42
  });
@@ -50,7 +50,9 @@ export async function fetchMarketplace(url) {
50
50
  return null;
51
51
  }
52
52
  const data = (await response.json());
53
- if (!data.name || !Array.isArray(data.plugins)) {
53
+ if (!data.name ||
54
+ !Array.isArray(data.plugins) ||
55
+ data.plugins.some((p) => !p.name)) {
54
56
  printError('Invalid marketplace JSON format.');
55
57
  return null;
56
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudepluginhub",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Install Claude Code plugins from ClaudePluginHub",
5
5
  "bin": {
6
6
  "claudepluginhub": "./dist/index.js"