Skip to content

Commit 05f4512

Browse files
authored
Merge pull request #8 from cloudhal-dev/fix/npm-better-auth-peers
fix(api): npm installs no longer hang on better-auth's open peers (0.1.1)
2 parents 6f3871a + 22905d2 commit 05f4512

29 files changed

Lines changed: 377 additions & 13 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @cloudhal/agent-runtime
22

3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- @cloudhal/core-contracts@0.1.1
8+
- @cloudhal/storage@0.1.1
9+
310
## 0.1.0
411

512
Initial public release. See the [README](https://github.com/cloudhal-dev/cloudhal#readme) and the [docs](https://github.com/cloudhal-dev/cloudhal/tree/main/docs).

‎packages/agent-runtime/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudhal/agent-runtime",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Cloudhal agent runtime: policy engine (actors, scopes, approvals), skill loader, audit log",
55
"license": "Apache-2.0",
66
"homepage": "https://cloudhal.dev",

‎packages/analytics/CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @cloudhal/analytics
22

3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- @cloudhal/core-contracts@0.1.1
8+
- @cloudhal/storage@0.1.1
9+
310
## 0.1.0
411

512
Initial public release. See the [README](https://github.com/cloudhal-dev/cloudhal#readme) and the [docs](https://github.com/cloudhal-dev/cloudhal/tree/main/docs).

‎packages/analytics/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudhal/analytics",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Cloudhal site analytics (RFC-0006): query model, classifiers, beacon handler, SQLite/D1 store, daily rollups and Workers Analytics Engine adapters. Worker-safe.",
55
"license": "Apache-2.0",
66
"homepage": "https://cloudhal.dev",

‎packages/api/CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# @cloudhal/api
22

3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- `npm create cloudhal` and `npm install @cloudhal/cli` no longer hang. `@better-auth/api-key` names `@better-auth/core`, `@better-auth/utils` and `better-call` as open peers; npm picked newer releases whose peers conflict with better-auth 1.7.7's and backtracked forever (0.1.0). `@cloudhal/api` now depends on exactly the versions better-auth itself uses, so npm resolves the tree in seconds.
8+
- @cloudhal/agent-runtime@0.1.1
9+
- @cloudhal/analytics@0.1.1
10+
- @cloudhal/astro-renderer@0.1.1
11+
- @cloudhal/comments@0.1.1
12+
- @cloudhal/core-contracts@0.1.1
13+
- @cloudhal/core-ts@0.1.1
14+
- @cloudhal/mcp-server@0.1.1
15+
- @cloudhal/schedules@0.1.1
16+
- @cloudhal/storage@0.1.1
17+
318
## 0.1.0
419

520
Initial public release. See the [README](https://github.com/cloudhal-dev/cloudhal#readme) and the [docs](https://github.com/cloudhal-dev/cloudhal/tree/main/docs).

‎packages/api/package.json‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudhal/api",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Cloudhal HTTP API (Hono): sites, pages, entries, snapshots, auth — runs on Node and Cloudflare Workers",
55
"license": "Apache-2.0",
66
"homepage": "https://cloudhal.dev",
@@ -37,6 +37,9 @@
3737
"hono": "catalog:",
3838
"better-auth": "catalog:",
3939
"@better-auth/api-key": "catalog:",
40+
"@better-auth/core": "catalog:",
41+
"@better-auth/utils": "catalog:",
42+
"better-call": "catalog:",
4043
"@cloudhal/agent-runtime": "workspace:*",
4144
"@cloudhal/mcp-server": "workspace:*",
4245
"@cloudhal/astro-renderer": "workspace:*",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { readFileSync } from "node:fs";
2+
import { createRequire } from "node:module";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import { describe, expect, it } from "vitest";
6+
7+
const here = path.dirname(fileURLToPath(import.meta.url));
8+
const root = path.resolve(here, "../../..");
9+
const require = createRequire(path.join(here, "../package.json"));
10+
11+
/** The catalog's flat `name: version` entries (pnpm-workspace.yaml). */
12+
function catalog(): Record<string, string> {
13+
const out: Record<string, string> = {};
14+
let inside = false;
15+
for (const line of readFileSync(path.join(root, "pnpm-workspace.yaml"), "utf8").split("\n")) {
16+
if (/^catalog:\s*$/.test(line)) inside = true;
17+
else if (inside && /^\S/.test(line)) break;
18+
else if (inside) {
19+
const m = line.match(/^\s+"?([^":]+)"?:\s*(\S+)/);
20+
if (m?.[1] && m[2]) out[m[1]] = m[2];
21+
}
22+
}
23+
return out;
24+
}
25+
26+
describe("better-auth family pins", () => {
27+
// `@better-auth/api-key` names @better-auth/core, @better-auth/utils and better-call as open
28+
// peers. Left to npm, a fresh install picks newer releases whose own peers conflict with
29+
// better-auth's, and `npm create cloudhal` spins forever resolving them (found on 0.1.0).
30+
// @cloudhal/api therefore depends on exactly the versions better-auth itself uses.
31+
it("@cloudhal/api pins the versions better-auth depends on", () => {
32+
// better-auth's exports hide package.json: find it from its entry point.
33+
let dir = path.dirname(require.resolve("better-auth"));
34+
while (path.basename(dir) !== "better-auth") dir = path.dirname(dir);
35+
const ba = JSON.parse(readFileSync(path.join(dir, "package.json"), "utf8")) as {
36+
dependencies: Record<string, string>;
37+
};
38+
const api = JSON.parse(readFileSync(path.join(here, "../package.json"), "utf8")) as {
39+
dependencies: Record<string, string>;
40+
};
41+
const versions = catalog();
42+
for (const name of ["@better-auth/core", "@better-auth/utils", "better-call"]) {
43+
expect(api.dependencies[name], name).toBe("catalog:");
44+
expect(versions[name], name).toBe(ba.dependencies[name]);
45+
}
46+
});
47+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @cloudhal/astro-renderer
22

3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- @cloudhal/analytics@0.1.1
8+
- @cloudhal/comments@0.1.1
9+
- @cloudhal/core-contracts@0.1.1
10+
- @cloudhal/core-ts@0.1.1
11+
- @cloudhal/storage@0.1.1
12+
313
## 0.1.0
414

515
Initial public release. See the [README](https://github.com/cloudhal-dev/cloudhal#readme) and the [docs](https://github.com/cloudhal-dev/cloudhal/tree/main/docs).

‎packages/astro-renderer/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudhal/astro-renderer",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Render a Cloudhal Site Graph with Astro: data sources (live/snapshot), section components and the cloudhal() integration",
55
"license": "Apache-2.0",
66
"homepage": "https://cloudhal.dev",

‎packages/cli/CHANGELOG.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# @cloudhal/cli
22

3+
## 0.1.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @cloudhal/api@0.1.1
9+
- @cloudhal/cloudflare@0.1.1
10+
- @cloudhal/agent-runtime@0.1.1
11+
- @cloudhal/analytics@0.1.1
12+
- @cloudhal/comments@0.1.1
13+
- @cloudhal/core-contracts@0.1.1
14+
- @cloudhal/core-ts@0.1.1
15+
- @cloudhal/mcp-server@0.1.1
16+
- @cloudhal/schedules@0.1.1
17+
- @cloudhal/storage@0.1.1
18+
319
## 0.1.0
420

521
Initial public release. See the [README](https://github.com/cloudhal-dev/cloudhal#readme) and the [docs](https://github.com/cloudhal-dev/cloudhal/tree/main/docs).

0 commit comments

Comments
 (0)