chore(cli-v2): un-ignore CLI source tree for binary release workflow
Some checks failed
CI / Lint (push) Has been cancelled
CI / Typecheck (push) Has been cancelled
CI / Broker tests (Postgres) (push) Has been cancelled
CI / Docker build (linux/amd64) (push) Has been cancelled

The CLI source (242 files, ~14k lines) was gitignored during the
earlier cli→cli-v2 reorg so only the published npm package carried it.
That blocks the GitHub Actions release workflow (release-cli.yml),
which clones the repo fresh on each runner and needs the source to
compile binaries via `bun build --compile`.

Moves the gitignore from root-level to `apps/cli-v2/.gitignore` with
only the usual build artefacts excluded (node_modules, dist, .turbo,
.cache). Source is now in git at apps/cli-v2/src/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-04-15 02:45:44 +01:00
parent 5b69de08da
commit d37516213a
243 changed files with 14507 additions and 1 deletions

View File

@@ -0,0 +1,48 @@
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { mkdirSync, rmSync, existsSync, readFileSync, statSync } from "node:fs";
import { join } from "node:path";
import { tmpdir } from "node:os";
const TEST_DIR = join(tmpdir(), "claudemesh-test-" + Date.now());
describe("config", () => {
beforeEach(() => {
mkdirSync(TEST_DIR, { recursive: true });
process.env.CLAUDEMESH_CONFIG_DIR = TEST_DIR;
});
afterEach(() => {
rmSync(TEST_DIR, { recursive: true, force: true });
delete process.env.CLAUDEMESH_CONFIG_DIR;
});
it("readConfig returns empty when no file", async () => {
// Dynamic import to pick up env change
const { readConfig } = await import("~/services/config/read.js");
const config = readConfig();
expect(config.version).toBe(1);
expect(config.meshes).toEqual([]);
});
it("writeConfig + readConfig round-trip", async () => {
const { writeConfig } = await import("~/services/config/write.js");
const { readConfig } = await import("~/services/config/read.js");
writeConfig({
version: 1,
meshes: [{ meshId: "m1", memberId: "mb1", slug: "test", name: "Test", pubkey: "a".repeat(64), secretKey: "b".repeat(128), brokerUrl: "wss://localhost/ws", joinedAt: "2026-01-01" }],
});
const config = readConfig();
expect(config.meshes).toHaveLength(1);
expect(config.meshes[0]!.slug).toBe("test");
});
it("config file has 0600 permissions on unix", async () => {
if (process.platform === "win32") return;
const { writeConfig } = await import("~/services/config/write.js");
writeConfig({ version: 1, meshes: [] });
const configPath = join(TEST_DIR, "config.json");
const mode = statSync(configPath).mode & 0o777;
expect(mode).toBe(0o600);
});
});