@hiyve/cli 1.0.14 → 1.0.17

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/README.md CHANGED
@@ -107,6 +107,18 @@ Set `HIYVE_API_KEY` in your CI environment (GitHub Actions secrets, AWS SSM, etc
107
107
  - Check your internet connection
108
108
  - The registry may be temporarily unavailable
109
109
 
110
+ ### "401 Unauthorized" when running `npx @hiyve/cli login`
111
+
112
+ If you've previously logged in and your token has expired, `npx` may fail because npm routes all `@hiyve/*` packages (including the CLI) through the private registry. To fix this, remove the stale registry line from your `~/.npmrc` and re-run login:
113
+
114
+ ```bash
115
+ # Remove the stale @hiyve registry config
116
+ npm config delete @hiyve:registry
117
+
118
+ # Now login will work again
119
+ npx @hiyve/cli login
120
+ ```
121
+
110
122
  ### Packages not installing
111
123
 
112
124
  After login, verify your configuration:
@@ -129,6 +141,6 @@ cat ~/.npmrc | grep hiyve
129
141
 
130
142
  ## Support
131
143
 
132
- - Documentation: https://docs.hiyve.io
144
+ - Documentation: https://sdk.hiyve.dev
133
145
  - Issues: https://github.com/hiyve/hiyve-sdk/issues
134
146
  - Email: support@hiyve.io
package/bin/hiyve.js CHANGED
@@ -18,7 +18,7 @@ program
18
18
  .name('hiyve')
19
19
  .description('Hiyve SDK CLI - Configure npm for private @hiyve packages')
20
20
  .version('1.0.0')
21
- .option('--dev', 'Use dev registry (api.muziemedia.com)')
21
+ .option('--dev', 'Retained for compatibility — there is no separate dev registry; same host as production')
22
22
  .hook('preAction', () => {
23
23
  if (program.opts().dev) {
24
24
  setDevMode(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiyve/cli",
3
- "version": "1.0.14",
3
+ "version": "1.0.17",
4
4
  "description": "Hiyve SDK CLI - Configure npm for private @hiyve packages",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "src"
13
13
  ],
14
14
  "scripts": {
15
- "test": "vitest run",
15
+ "test": "vitest run --pool=forks --poolOptions.forks.singleFork",
16
16
  "test:watch": "vitest",
17
17
  "deploy": "./deploy.sh"
18
18
  },
@@ -44,6 +44,6 @@
44
44
  "prompts": "^2.4.2"
45
45
  },
46
46
  "devDependencies": {
47
- "vitest": "^2.1.9"
47
+ "vitest": "^3.2.6"
48
48
  }
49
49
  }
@@ -217,7 +217,7 @@ export default defineConfig({
217
217
  }
218
218
 
219
219
  function generateEnvExample(template) {
220
- let env = `# Hiyve API Key (from api.hiyve.dev)
220
+ let env = `# Hiyve API Key (from cloud.hiyve.io)
221
221
  HIYVE_API_KEY=pk_live_your_api_key_here
222
222
 
223
223
  # Room configuration
@@ -227,7 +227,7 @@ HIYVE_SIGNALING_URL=https://signal.hiyve.dev
227
227
  if (template.features.intelligence) {
228
228
  env += `
229
229
  # Cloud API (for AI features)
230
- HIYVE_CLOUD_URL=https://api.hiyve.dev
230
+ HIYVE_CLOUD_URL=https://cloud.hiyve.io
231
231
  `;
232
232
  }
233
233
 
@@ -383,7 +383,7 @@ app.use(express.json());
383
383
 
384
384
  const API_KEY = process.env.HIYVE_API_KEY;
385
385
  const SIGNALING_URL = process.env.HIYVE_SIGNALING_URL || 'https://signal.hiyve.dev';
386
- ${hasCloud ? `const CLOUD_URL = process.env.HIYVE_CLOUD_URL || 'https://api.hiyve.dev';\n` : ''}
386
+ ${hasCloud ? `const CLOUD_URL = process.env.HIYVE_CLOUD_URL || 'https://cloud.hiyve.io';\n` : ''}
387
387
  /**
388
388
  * Generate a room token for the client.
389
389
  * In production, add your own authentication before issuing tokens.
package/src/config.js CHANGED
@@ -6,13 +6,36 @@
6
6
  * - Registry URL: what goes into ~/.npmrc for npm to fetch tarballs. Always prod.
7
7
  */
8
8
 
9
- const PROD_API_URL = 'https://api.hiyve.dev/registry/';
10
- const DEV_API_URL = 'https://api.muziemedia.com/registry/';
9
+ // The CLI's own API — key verification and the package catalogue, served by
10
+ // hiyve-cloud at /registry/{verify,packages}.
11
+ const PROD_API_URL = 'https://cloud.hiyve.io/registry/';
12
+ // No separate development cloud exists — kept so --dev stays a valid flag,
13
+ // but it reaches the SAME live host (2026-08-24).
14
+ const DEV_API_URL = 'https://cloud.hiyve.io/registry/';
15
+
16
+ /**
17
+ * Where npm actually fetches tarballs. DELIBERATELY NOT the API URL.
18
+ *
19
+ * This used to return getApiUrl(), on the assumption that "tarballs are
20
+ * served through the same API". They are not: the cloud's /registry proxy
21
+ * serves a stale catalogue whose `dist.tarball` URLs still name
22
+ * api.muziemedia.com — a host with no DNS record — so a packument fetch
23
+ * succeeded and the download that followed failed with ENOTFOUND. npm does
24
+ * not rewrite tarball hosts for a non-npmjs registry, so the URL in the
25
+ * metadata is the URL it uses.
26
+ *
27
+ * registry.muziemedia.com is the Verdaccio registry `changeset publish`
28
+ * actually publishes to. Verified 2026-08-24 with a customer pk_ key: it
29
+ * authenticates API keys natively (the proxy is not needed for auth),
30
+ * serves current versions, its tarball URLs point at itself, and the
31
+ * download returns a valid package.
32
+ */
33
+ const REGISTRY_URL_VALUE = 'https://registry.muziemedia.com/';
11
34
 
12
35
  let _devMode = false;
13
36
 
14
37
  /**
15
- * Enable dev mode (CLI API calls go to api.muziemedia.com)
38
+ * Enable dev mode (there is no separate dev cloud — same host as prod)
16
39
  */
17
40
  export function setDevMode(enabled) {
18
41
  _devMode = enabled;
@@ -28,10 +51,10 @@ export function getApiUrl() {
28
51
 
29
52
  /**
30
53
  * Get the registry URL for ~/.npmrc (where npm fetches tarballs).
31
- * Matches the API URL tarballs are served through the same API.
54
+ * Independent of the API URL, and of --dev: there is one registry.
32
55
  */
33
56
  export function getRegistryUrl() {
34
- return getApiUrl();
57
+ return REGISTRY_URL_VALUE;
35
58
  }
36
59
 
37
60
  /**
@@ -42,7 +65,8 @@ export function isDevMode() {
42
65
  }
43
66
 
44
67
  // Backwards-compatible named export
45
- export const REGISTRY_URL = PROD_API_URL;
68
+ // The npm registry, NOT the CLI API (they are different hosts — see above).
69
+ export const REGISTRY_URL = REGISTRY_URL_VALUE;
46
70
 
47
71
  export default {
48
72
  REGISTRY_URL,
@@ -3,30 +3,38 @@ import config, { REGISTRY_URL, getApiUrl, getRegistryUrl, setDevMode } from './c
3
3
 
4
4
  describe('config', () => {
5
5
  it('exports REGISTRY_URL as a named export', () => {
6
- expect(REGISTRY_URL).toBe('https://api.hiyve.dev/registry/');
6
+ expect(REGISTRY_URL).toBe('https://registry.muziemedia.com/');
7
7
  });
8
8
 
9
9
  it('default export contains REGISTRY_URL', () => {
10
10
  expect(config).toHaveProperty('REGISTRY_URL');
11
- expect(config.REGISTRY_URL).toBe('https://api.hiyve.dev/registry/');
11
+ expect(config.REGISTRY_URL).toBe('https://registry.muziemedia.com/');
12
12
  });
13
13
 
14
14
  it('getApiUrl returns prod URL by default', () => {
15
15
  setDevMode(false);
16
- expect(getApiUrl()).toBe('https://api.hiyve.dev/registry/');
16
+ expect(getApiUrl()).toBe('https://cloud.hiyve.io/registry/');
17
17
  });
18
18
 
19
19
  it('getApiUrl returns dev URL when dev mode is enabled', () => {
20
20
  setDevMode(true);
21
- expect(getApiUrl()).toBe('https://api.muziemedia.com/registry/');
21
+ expect(getApiUrl()).toBe('https://cloud.hiyve.io/registry/');
22
22
  setDevMode(false);
23
23
  });
24
24
 
25
- it('getRegistryUrl switches with dev mode', () => {
25
+ it('getRegistryUrl is the npm registry, NOT the API host', () => {
26
+ // These are different services: the API serves /verify and /packages
27
+ // from hiyve-cloud; npm fetches tarballs from Verdaccio. Conflating them
28
+ // shipped a registry whose tarball URLs pointed at a dead host.
29
+ expect(getRegistryUrl()).toBe('https://registry.muziemedia.com/');
30
+ expect(getRegistryUrl()).not.toBe(getApiUrl());
31
+ });
32
+
33
+ it('getRegistryUrl does NOT switch with dev mode — there is one registry', () => {
26
34
  setDevMode(false);
27
- expect(getRegistryUrl()).toBe('https://api.hiyve.dev/registry/');
35
+ const prod = getRegistryUrl();
28
36
  setDevMode(true);
29
- expect(getRegistryUrl()).toBe('https://api.muziemedia.com/registry/');
37
+ expect(getRegistryUrl()).toBe(prod);
30
38
  setDevMode(false);
31
39
  });
32
40
  });
@@ -11,7 +11,16 @@ import path from 'path';
11
11
  const NPMRC_PATH = path.join(os.homedir(), '.npmrc');
12
12
 
13
13
  // Known Hiyve registry hosts (current and historical)
14
- const HIYVE_HOSTS = ['//console.hiyve.dev/', '//api.hiyve.dev/', '//api.muziemedia.com/'];
14
+ const HIYVE_HOSTS = [
15
+ '//registry.muziemedia.com/',
16
+ '//cloud.hiyve.io/',
17
+ // Historical hosts stay listed FOREVER: this array's job is to strip
18
+ // stale entries from a developer's .npmrc, so dropping a retired host
19
+ // leaves its dead token line behind.
20
+ '//console.hiyve.dev/',
21
+ '//api.hiyve.dev/',
22
+ '//api.muziemedia.com/',
23
+ ];
15
24
 
16
25
  /**
17
26
  * Check if a line in .npmrc is a Hiyve-related config line.
@@ -34,7 +43,7 @@ function filterOutHiyveLines(content) {
34
43
 
35
44
  /**
36
45
  * Configure ~/.npmrc for Hiyve registry
37
- * @param {string} registryUrl - The registry URL (e.g., https://api.hiyve.dev/registry/)
46
+ * @param {string} registryUrl - The registry URL (e.g., https://registry.muziemedia.com/)
38
47
  * @param {string} apiKey - The API key for authentication
39
48
  */
40
49
  export async function configureNpmrc(registryUrl, apiKey) {
@@ -14,12 +14,12 @@ const FETCH_TIMEOUT_MS = 15_000;
14
14
  */
15
15
  export function printDevHint(command) {
16
16
  if (isDevMode()) {
17
- console.log(chalk.gray(' You are using --dev mode (development registry).'));
18
- console.log(chalk.gray(' If you meant to use production, run without --dev:'));
17
+ // No longer suggests the opposite mode: both use the same host since
18
+ // 2026-08-24, so "try without --dev" sent people hunting a difference
19
+ // that cannot exist.
20
+ console.log(chalk.gray(' --dev no longer selects a different registry — same host as the'));
21
+ console.log(chalk.gray(' default, so re-running without it will not change this result.'));
19
22
  console.log(chalk.cyan(` npx @hiyve/cli ${command}`));
20
- } else {
21
- console.log(chalk.gray(' If you meant to use the development registry, use --dev:'));
22
- console.log(chalk.cyan(` npx @hiyve/cli --dev ${command}`));
23
23
  }
24
24
  }
25
25