Files
orca/config/knip.json
T
Neil 531658f1d1 Plugin test kit: orca/testing, orca plugin test and orca plugin check (#36969)
* feat(plugins): orca/testing kit, `orca plugin test` and `orca plugin check`

- `orca/testing` mounts a components panel in plain Node (node:test, vitest, bun) with the real
  runtime and Orca's own tree validator: find by text/role/label/testId, press/type/submit/toggle/
  select that resolve once the panel settles, tree() snapshots, errors (with stacks) and warnings,
  persisted state (with stored() for migrations), emit/setVisible/rerender, and unmount running
  setup cleanup. It re-exports node:test and strict assert so tests type-check without @types/node.
- mockHost refuses what Orca refuses with the same codes (surface, capability from the manifest,
  params, a gesture method without a press), checks configured results against the host API, and
  records calls.
- `orca plugin test [dir]` discovers *.test.ts(x) and runs them with node:test through Node module
  hooks that resolve `orca` like the guest's import map and transpile/resolve sources exactly as
  Orca's build-less loader, or with the plugin's own vitest via a generated config.
- `orca plugin check [dir]` validates, then renders each components panel once and reports what it
  threw (file:line), layouts Orca would refuse, and props it would drop.
- The kit, hooks and register entry ship minified beside orca-runtime.mjs and are unpacked from asar;
  typings land in .orca/types/orca-testing. The components template and hello-tsx get sample tests.
- ui.error carries an optional stack; a new runtime starts every atom from its initial value; the
  hydration fallback timer is cleared once hydrated.

* plugins: run plugin test/check on a system Node or Orca's own, and warn they are unsandboxed

* test(plugins): run the shipped example plugin tests from the unit suite
2026-11-01 02:42:12 -08:00

75 lines
3.2 KiB
JSON

{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"src/main/index.ts",
"src/preload/index.ts",
"src/preload/browser-window-close.ts",
"src/main/daemon/daemon-entry.ts",
"src/main/plugins/workers/plugin-host-entry.ts",
"src/main/computer/computer-sidecar.ts",
"src/main/speech/stt-worker.ts",
"src/main/warp-themes/warp-theme-parser-worker.ts",
"src/main/foreign-sqlite-readers/foreign-sqlite-reader-entry.ts",
"src/main/ports/port-scan-command-worker-entry.ts",
"src/main/plugins/panels/plugin-source-transpile-worker-entry.ts",
"src/main/worker-thread-child-process/worker-thread-child-process-entry.ts",
"src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.ts",
"src/main/hang-watchdog/main-thread-hang-watchdog-entry.ts",
"src/main/agent-hooks/managed-agent-hook-controls.ts",
"src/main/claude-accounts/keychain.ts",
"src/renderer/src/main.tsx",
"src/renderer/src/popout.tsx",
"src/renderer/src/web/main.tsx",
"src/renderer/src/component-fixtures/component-fixture-explorer.tsx",
"src/renderer/src/**/*.fixture.tsx",
"src/renderer/src/**/*.worker.ts",
"src/cli/index.ts",
"src/wsl-guest/wsl-agent-hook-relay.ts",
"config/scripts/**/*.{mjs,cjs,js,ts}",
"config/build-plugins/**/*.ts",
"electron.vite.config.ts",
"vite.web.config.ts",
"config/vitest.config.ts",
"config/i18next.config.ts",
"config/electron-builder.config.cjs",
"config/oxlint-plugins/**/*.{js,mjs,ts}",
"tests/**/*.{ts,tsx,mjs}",
"**/*.test.{ts,tsx,mjs}",
"src/preload/doc-preview-link.ts",
"src/preload/plugin-frame-guest.ts",
"src/main/plugins/testing/plugin-test-hooks.ts",
"src/main/plugins/testing/plugin-test-register.ts",
"src/main/ai-vault/session-scanner-service-entry.ts",
"src/main/native-chat/wsl-transcript-fs-process-entry.ts",
"src/main/usage/usage-scan-worker-entry.ts",
"src/main/workspace-space-scan-worker-entry.ts",
"src/main/claude-accounts/claude-profile-setup-worker-entry.ts",
"src/main/persistence/profile-state/profile-state-backup-worker-entry.ts",
"src/main/persistence/profile-state/profile-state-writer-worker-entry.ts",
"src/main/orcad/orcad-local-serve-selection-entry.ts",
"src/main/orcad/launcher.ts",
"src/main/claude-accounts/claude-profile-wsl-entry.ts",
"src/main/ai-vault/session-scanner-opencode-sqlite-process-entry.ts",
"src/wsl-guest/wsl-browser-network-relay.ts",
"src/renderer/src/space.tsx",
"src/**/*.bench.ts",
"src/**/*-electron-fixture.ts",
"src/**/*-test-fixture.ts",
"src/**/*.test-fixture.{ts,tsx}",
"src/main/runtime/rpc/rpc-params-type-parity.ts",
"src/main/runtime/rpc/methods/ui-state-schema-parity-checks.ts",
"src/renderer/src/components/editor/monaco-internal-test-module-types.ts",
"mobile/**/*.{ts,tsx}",
"cloud/**/*.{ts,tsx,mjs}"
],
"project": [
"src/**/*.{ts,tsx}",
"config/scripts/**/*.{mjs,cjs,js,ts}",
"config/build-plugins/**/*.ts"
],
"ignore": ["mobile/**", "out/**", "dist/**", "node_modules/**", "resources/**"],
"ignoreDependencies": ["electron", "@types/*"],
"ignoreExportsUsedInFile": true,
"includeEntryExports": false
}