diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1118dacded..3cdd3f8ae5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -330,6 +330,7 @@ jobs: - run: bash scripts/ci/install-workspace-dependencies.sh - run: bun run build - run: bun run verify:packed-manifests + - run: bun run check:cli-lazy-deps - name: Share the built CLI with the edit accuracy shards if: needs.changes.outputs.edit_accuracy == 'true' uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 diff --git a/bun.lock b/bun.lock index 658a031442..d04c3aca45 100644 --- a/bun.lock +++ b/bun.lock @@ -83,7 +83,6 @@ "open": "^10.0.0", "postcss": "^8.5.8", "puppeteer-core": "^25.10.0", - "sharp": "^0.35.0", "yauzl": "^3.4.0", }, "devDependencies": { @@ -111,6 +110,9 @@ "typescript": "^5.0.0", "vitest": "^4.1.11", }, + "optionalDependencies": { + "sharp": "^0.35.0", + }, }, "packages/core": { "name": "@hyperframes/core", @@ -403,7 +405,6 @@ "linkedom": "^0.18.12", "postcss": "^8.5.8", "postcss-selector-parser": "^7.1.2", - "sharp": "^0.35.0", }, "devDependencies": { "@types/node": "^25.0.10", @@ -412,6 +413,9 @@ "typescript": "^5.0.0", "vitest": "^4.1.11", }, + "optionalDependencies": { + "sharp": "^0.35.0", + }, }, }, "overrides": { diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx index 684a0a8515..4969f96905 100644 --- a/docs/packages/cli.mdx +++ b/docs/packages/cli.mdx @@ -442,7 +442,10 @@ after that. Peak inference RAM is about 1.5 GB. `--device auto` picks CoreML on Apple Silicon, CUDA where available, CPU otherwise. The first run installs the CPU build of `onnxruntime-node` into `~/.cache/hyperframes/optional/` (one line on stderr, once, no prompt); for CUDA, set -`HYPERFRAMES_CUDA=1` and supply a GPU-enabled build. +`HYPERFRAMES_CUDA=1` and supply a GPU-enabled build. With +`HYPERFRAMES_NO_OPTIONAL_INSTALL=1` the CLI installs nothing on first use (this +package, `@google/genai`, or a missing `sharp`) and the command fails, naming the package; +a comma-separated list such as `HYPERFRAMES_NO_OPTIONAL_INSTALL=sharp` turns off only those. Chrome's `