Skip to main content
在 Manus 中运行任何 Skill
一键导入

symbiote-rn-import-testability

星标1
分支0
更新时间2026年7月6日 13:53

Symbiote react-native-import testability — read BEFORE writing any NEW file in core/engine, core/components, or an adapter (adapters/react|vue|angular) that imports from 'react-native' directly (processColor, DeviceEventEmitter, Image, AppRegistry, a deep RN internal path, etc.), or before adding a new package.json 'exports' subpath, or when a Vitest run throws 'RolldownError: Parse failure: Flow is not supported' / 'Cannot find package react-native'. Covers: (1) WHY — react-native's own source is Flow syntax; Vitest's Rolldown/Vite transform cannot parse it, so a file that imports 'react-native' must stay OUTSIDE every package's main index.ts barrel and outside anything a test transitively imports. (2) THE PATTERN — export such a file via a separate package.json 'exports' subpath (precedent: './metro-css-parser', './runtime-helpers', './bootstrap') instead of the main barrel; Metro resolves these subpaths fine (unstable_enablePackageExports is on by default in this repo's metro-config). (3) THE TEST RECIPE —

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly