Files
orca/.gitattributes
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

83 lines
3.6 KiB
Plaintext

# CRLF shebangs break Vite's SSR transform.
/config/scripts/**/*.mjs text eol=lf
/skill-guides/*.md text eol=lf
/skill-stubs/*.md text eol=lf
/skill-stubs/_shared/*.md text eol=lf
/skills/*/SKILL.md text eol=lf
/src/cli/bundled-skill-guides.ts text eol=lf
# SVG bytes feed embedded data URLs and asset hashes on every build host.
*.svg text eol=lf
# Compiler input line breaks must not depend on the checkout OS.
*.ts text eol=lf
*.tsx text eol=lf
*.html text eol=lf
# Bundled plugin trees are byte-hashed; CRLF checkout would break the pinned hash.
/resources/plugins/** text eol=lf
# Keep patch diffs stable; pnpm hashes them with LF normalization.
# CRLF upstream sources still need git -c core.autocrlf=input apply (windows-process-tree-gyp-rebuild.mjs).
/config/patches/*.patch -text
# CRLF patches fail pnpm parsing on Windows.
/mobile/patches/*.patch -text
# Review xterm-src/ instead of generated bundle hunks.
/config/patches/@xterm__xterm@*.patch -diff
/config/patches/xterm-src/*.patch text eol=lf
# pnpm parses these unified diffs during Windows installs; keep checkout bytes stable.
/mobile/patches/*.patch -text
# Collapse generated wrappers but keep diffs available; tests compare LF bytes.
/src/main/__fixtures__/shell-wrapper-snapshots/*.txt linguist-generated=true text eol=lf
# PTY transcripts must retain captured CR and CRLF bytes.
/src/main/runtime/__fixtures__/*.txt -text
/src/main/daemon/__fixtures__/pty-transcripts/*.txt -text
/src/main/daemon/__fixtures__/git-bash-installed-dll-format-capacity.bin -text
/src/renderer/src/components/terminal-pane/terminal-link-transcripts/*.txt -text whitespace=cr-at-eol
# verify:localization-runtime-catalog compares LF bytes.
/src/renderer/src/i18n/en-runtime-required.json linguist-generated=true text eol=lf
# verify:rpc-params-catalog compares LF bytes.
/src/shared/rpc-contract/rpc-params-catalog.generated.ts linguist-generated=true text eol=lf
# RPC recording goldens must match rpc:record's LF output.
/mobile/rpc-foundation/goldens/*.json text eol=lf
# Mobile build IDs hash source bytes; checkout line endings must match across hosts.
/mobile/src/** text eol=lf
/mobile/app/** text eol=lf
/mobile/web-entry/** text eol=lf
# Preserve binary assets under the text-pinned mobile directories.
/mobile/src/**/*.png -text
/mobile/src/**/*.jpg -text
/mobile/src/**/*.jpeg -text
/mobile/src/**/*.gif -text
/mobile/src/**/*.ico -text
/mobile/src/**/*.webp -text
/mobile/src/**/*.ttf -text
/mobile/src/**/*.otf -text
/mobile/src/**/*.woff -text
/mobile/src/**/*.woff2 -text
/mobile/app/**/*.png -text
/mobile/app/**/*.jpg -text
/mobile/app/**/*.jpeg -text
/mobile/app/**/*.gif -text
/mobile/app/**/*.ico -text
/mobile/app/**/*.webp -text
/mobile/app/**/*.ttf -text
/mobile/app/**/*.otf -text
/mobile/app/**/*.woff -text
/mobile/app/**/*.woff2 -text
/mobile/web-entry/**/*.png -text
/mobile/web-entry/**/*.jpg -text
/mobile/web-entry/**/*.jpeg -text
/mobile/web-entry/**/*.gif -text
/mobile/web-entry/**/*.ico -text
/mobile/web-entry/**/*.webp -text
/mobile/web-entry/**/*.ttf -text
/mobile/web-entry/**/*.otf -text
/mobile/web-entry/**/*.woff -text
/mobile/web-entry/**/*.woff2 -text
# Generated ACP schemas are checked byte-for-byte against formatted output.
/src/main/acp/generated/*.generated.ts linguist-generated=true text eol=lf
# Generated skill bundle artifacts are verified byte-for-byte against fresh output.
/resources/skills/*.json linguist-generated=true text eol=lf
# Vitest writes snapshots with LF, so checkout bytes must match on every host.
**/__snapshots__/*.snap text eol=lf
# Generated, minified bundles (config/scripts/build-plugin-declarative-runtime.mjs).
/resources/plugins/declarative/orca-test*.mjs linguist-generated=true -diff