Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
- name: Build desktop pipeline
run: bun run build:desktop

- name: Smoke test bundled CLI
run: bun --filter=t3 run smoke:cli-bundle

- name: Verify preload bundle output
run: |
test -f apps/desktop/dist-electron/preload.cjs
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ jobs:
- name: Build CLI package
run: bun --filter=t3 run build

- name: Smoke test bundled CLI
run: bun --filter=t3 run smoke:cli-bundle

- name: Publish CLI package
run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose

Expand Down
1 change: 1 addition & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dev": "node --watch src/bin.ts",
"build": "node scripts/cli.ts build",
"build:bundle": "tsdown",
"smoke:cli-bundle": "node scripts/smoke-cli-bundle.ts",
"start": "node dist/bin.mjs",
"typecheck": "tsc --noEmit",
"test": "vitest run",
Expand Down
48 changes: 48 additions & 0 deletions apps/server/scripts/smoke-cli-bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// @effect-diagnostics nodeBuiltinImport:off
import { execFileSync } from "node:child_process";
import { existsSync, mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import * as Console from "effect/Console";
import * as Effect from "effect/Effect";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary Effect imports for simple console.log

Low Severity

effect/Console and effect/Effect are imported solely for Effect.runSync(Console.log(...)), which is functionally identical to console.log(...). A smoke test that validates a bundled artifact ideally avoids pulling in the very framework being tested as a transitive dependency; a plain console.log keeps the script minimal and removes two unused-beyond-one-line imports.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e6ecfab. Configure here.


const serverRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const bundledCliPath = resolve(serverRoot, "dist/bin.mjs");

if (!existsSync(bundledCliPath)) {
throw new Error(`Missing bundled CLI at ${bundledCliPath}. Run the server build first.`);
}

const baseDir = mkdtempSync(join(tmpdir(), "t3-cli-bundle-smoke-base-"));
const workspaceRoot = mkdtempSync(join(tmpdir(), "t3-cli-bundle-smoke-workspace-"));

try {
const output = execFileSync(
process.execPath,
[
bundledCliPath,
"project",
"add",
workspaceRoot,
"--title",
"Bundle Smoke",
"--base-dir",
baseDir,
],
{
cwd: serverRoot,
encoding: "utf8",
stdio: ["ignore", "pipe", "inherit"],
},
);

if (!output.includes("Added project")) {
throw new Error(`Bundled CLI smoke did not add a project. Output:\n${output}`);
}

Effect.runSync(Console.log("Bundled CLI smoke checks passed."));
} finally {
rmSync(baseDir, { recursive: true, force: true });
rmSync(workspaceRoot, { recursive: true, force: true });
}
Loading