Skip to content

Commit 10a996f

Browse files
committed
fix(publish): replace file: SDK dependency with >=0.9.0, add publish safety tests
npm workspaces rewrote the CLI's squad-sdk dependency to file:../squad-sdk, which breaks every global install (ERR_MODULE_NOT_FOUND). Fixed by: - CLI dependency: file:../squad-sdk -> >=0.9.0 - Added file: dependency guard in publish workflow - Added publish safety tests in cli-packaging-smoke.test.ts - Bumped to 0.9.1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b1e2a0 commit 10a996f

6 files changed

Lines changed: 40 additions & 9 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ jobs:
126126
- name: Install dependencies
127127
run: npm ci
128128

129+
- name: Guard against file: dependencies
130+
run: |
131+
SDK_DEP=$(node -p "require('./packages/squad-cli/package.json').dependencies['@bradygaster/squad-sdk']")
132+
if [[ "$SDK_DEP" == file:* ]]; then
133+
echo "::error::squad-cli has file: dependency on squad-sdk — this breaks global installs"
134+
exit 1
135+
fi
136+
echo "✅ SDK dependency is safe: $SDK_DEP"
137+
129138
- name: Build squad-sdk (required for CLI project references)
130139
run: npm -w packages/squad-sdk run build
131140

‎package-lock.json‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bradygaster/squad",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"private": true,
55
"description": "Squad — Programmable multi-agent runtime for GitHub Copilot, built on @github/copilot-sdk",
66
"type": "module",

‎packages/squad-cli/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bradygaster/squad-cli",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "Squad CLI — Command-line interface for the Squad multi-agent runtime",
55
"type": "module",
66
"bin": {
@@ -173,7 +173,7 @@
173173
"node": ">=22.5.0"
174174
},
175175
"dependencies": {
176-
"@bradygaster/squad-sdk": "file:../squad-sdk",
176+
"@bradygaster/squad-sdk": ">=0.9.0",
177177
"ink": "^6.8.0",
178178
"react": "^19.2.4",
179179
"vscode-jsonrpc": "^8.2.1"

‎packages/squad-sdk/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bradygaster/squad-sdk",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "Squad SDK — Programmable multi-agent runtime for GitHub Copilot",
55
"type": "module",
66
"main": "./dist/index.js",

‎test/cli-packaging-smoke.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,28 @@ describe('CLI packaging smoke test', { timeout: 120_000 }, () => {
188188
}
189189
}
190190

191+
// ============================================================================
192+
// PHASE 1.5 — PUBLISH SAFETY CHECKS
193+
// These prevent broken packages from reaching npm.
194+
// ============================================================================
195+
196+
it('squad-cli has no file: dependencies (breaks global installs)', () => {
197+
const pkgPath = join(tempDir, 'node_modules', '@bradygaster', 'squad-cli', 'package.json');
198+
const pkg = JSON.parse(require('fs').readFileSync(pkgPath, 'utf8'));
199+
const deps = pkg.dependencies || {};
200+
for (const [name, version] of Object.entries(deps)) {
201+
expect(String(version), `${name} has file: dependency — will break global installs`)
202+
.not.toMatch(/^file:/);
203+
}
204+
});
205+
206+
it('squad-sdk resolves as a real package (not a workspace link)', () => {
207+
const sdkPkg = join(tempDir, 'node_modules', '@bradygaster', 'squad-sdk', 'package.json');
208+
expect(existsSync(sdkPkg), 'squad-sdk not installed as dependency of squad-cli').toBe(true);
209+
const pkg = JSON.parse(require('fs').readFileSync(sdkPkg, 'utf8'));
210+
expect(pkg.name).toBe('@bradygaster/squad-sdk');
211+
});
212+
191213
// ============================================================================
192214
// PHASE 2 — SMOKE TESTS
193215
// ============================================================================

0 commit comments

Comments
 (0)