@ceraph/react-native-mcp 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -21
- package/dist/babel-plugin/index.cjs +1 -1
- package/dist/babel-plugin/index.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +3 -3
- package/dist/shim/fiber-capture.js +1 -1
- package/dist/tool-catalog.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MCP server for React Native and Expo development. It lets your coding agent driv
|
|
|
4
4
|
|
|
5
5
|
Works with any MCP client: Claude Code, Cursor, Codex, VS Code, Antigravity, and others.
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> **To install and configure Ceraph, run this command from your project root:**
|
|
8
8
|
>
|
|
9
9
|
> ```bash
|
|
10
10
|
> npx @ceraph/react-native-mcp@latest init
|
|
@@ -16,8 +16,9 @@ Ceraph supports React Native and Expo apps. iOS testing runs on macOS through
|
|
|
16
16
|
Xcode and WebDriverAgent. Android testing runs on macOS, Windows, or Linux
|
|
17
17
|
through ADB and UiAutomator2.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
For both Expo and bare React Native projects, `ceraph start` creates, installs,
|
|
20
|
+
and launches the native development build as needed. Expo projects run
|
|
21
|
+
through that build rather than Expo Go.
|
|
21
22
|
|
|
22
23
|
| Target / host | Status | Notes |
|
|
23
24
|
| -------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
@@ -58,8 +59,8 @@ The `rn_target_status` tool reports the active platform, exact runtime, target p
|
|
|
58
59
|
## Requirements
|
|
59
60
|
|
|
60
61
|
- Node.js 20.19+, 22.12+, or 24+
|
|
61
|
-
- For iOS: macOS with Xcode 14+ and either an iOS 16+ USB device or
|
|
62
|
-
- For Android: the Android SDK/JDK used by your project, with `adb` available, and either an authorized USB device or a
|
|
62
|
+
- For iOS: macOS with Xcode 14+ and either an iOS 16+ USB device or an available Simulator runtime. See [iOS setup](#ios-setup).
|
|
63
|
+
- For Android: the Android SDK/JDK used by your project, with `adb` available, and either an authorized USB device or a configured Android Emulator. See [Android setup](#android-setup).
|
|
63
64
|
|
|
64
65
|
> **Multiple agents:** One running app instance has one active Ceraph driver. Simultaneous contenders are arbitrated so they receive a busy result instead of fighting over the same device, simulator, or emulator.
|
|
65
66
|
|
|
@@ -67,9 +68,6 @@ The `rn_target_status` tool reports the active platform, exact runtime, target p
|
|
|
67
68
|
|
|
68
69
|
iOS device testing requires macOS, Xcode 14+, and iOS 16 or later.
|
|
69
70
|
|
|
70
|
-
For projects with multiple iOS build flavors, use `--scheme <name>` and
|
|
71
|
-
`--configuration <name>` (default `Debug`).
|
|
72
|
-
|
|
73
71
|
### Physical device
|
|
74
72
|
|
|
75
73
|
Connect and unlock the device over USB, trust the Mac when prompted, and enable
|
|
@@ -86,27 +84,24 @@ dependency, `ceraph doctor` provides the exact installation step.
|
|
|
86
84
|
|
|
87
85
|
The Simulator has two presentation modes:
|
|
88
86
|
|
|
89
|
-
- `ceraph start --simulator`
|
|
87
|
+
- `ceraph start --simulator` selects and boots a windowed Simulator for visible testing.
|
|
90
88
|
- `ceraph start --headless` runs without Simulator.app for CI, cloud Macs, and
|
|
91
89
|
background agent verification. Screenshots, recordings, snapshots, and WDA
|
|
92
90
|
remain available; host audio is not disabled.
|
|
93
91
|
|
|
94
92
|
Add an exact simulator UDID after either flag to select a particular simulator.
|
|
93
|
+
For projects with multiple iOS build flavors, add `--scheme <name>` and
|
|
94
|
+
`--configuration <name>` (default `Debug`).
|
|
95
95
|
|
|
96
96
|
Ceraph automatically installs the optional `appium-webdriveragent` package the
|
|
97
97
|
first time it targets a Simulator, then builds and launches WDA. The first build
|
|
98
98
|
usually takes about a minute; later runs reuse it. Device-only setups do not
|
|
99
99
|
install this dependency.
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
# or: xcrun simctl boot <UDID>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Use `xcrun simctl list devices booted` to see booted Simulators. Call
|
|
109
|
-
`rn_wda_stop` to stop WDA, or exit the MCP server to stop its managed process.
|
|
101
|
+
Ceraph reuses an eligible booted Simulator or boots the selected/default one
|
|
102
|
+
when needed. Use `xcrun simctl list devices available` to see available
|
|
103
|
+
Simulators. Call `rn_wda_stop` to stop WDA, or exit the MCP server to stop its
|
|
104
|
+
managed process.
|
|
110
105
|
|
|
111
106
|
To make headless mode the default for the current environment:
|
|
112
107
|
|
|
@@ -127,8 +122,6 @@ never selected automatically. Target one explicitly with
|
|
|
127
122
|
|
|
128
123
|
## Android setup
|
|
129
124
|
|
|
130
|
-
Use `--variant <name>` when the project has multiple debuggable build variants.
|
|
131
|
-
|
|
132
125
|
Install Android Studio and use its SDK Manager to install Platform-Tools and the
|
|
133
126
|
SDK components required by your React Native project. Ensure `adb` is available
|
|
134
127
|
on your `PATH`, then confirm that it can see the intended runtime:
|
|
@@ -153,7 +146,8 @@ The Android Emulator has two presentation modes:
|
|
|
153
146
|
and background testing.
|
|
154
147
|
|
|
155
148
|
Add an AVD name after either flag to select the virtual device to start or reuse.
|
|
156
|
-
`--emulator` also accepts the adb serial of a running emulator.
|
|
149
|
+
`--emulator` also accepts the adb serial of a running emulator. When the project
|
|
150
|
+
has multiple debuggable build variants, add `--variant <name>`.
|
|
157
151
|
|
|
158
152
|
Ceraph manages build and installation, automation, app launch, wake and unlock
|
|
159
153
|
verification, and Expo dev-client routing for both Android targets.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const _0x51198b=_0x59b4;(function(_0x45942f,_0x48abe5){const _0x3d5773=_0x59b4,_0x37d5cf=_0x45942f();while(!![]){try{const _0x50af78=parseInt(_0x3d5773(0x166))/0x1+-parseInt(_0x3d5773(0x148))/0x2*(-parseInt(_0x3d5773(0x163))/0x3)+parseInt(_0x3d5773(0x160))/0x4+-parseInt(_0x3d5773(0x167))/0x5+-parseInt(_0x3d5773(0x149))/0x6*(-parseInt(_0x3d5773(0x141))/0x7)+-parseInt(_0x3d5773(0x168))/0x8*(parseInt(_0x3d5773(0x15d))/0x9)+-parseInt(_0x3d5773(0x13b))/0xa*(-parseInt(_0x3d5773(0x171))/0xb);if(_0x50af78===_0x48abe5)break;else _0x37d5cf['push'](_0x37d5cf['shift']());}catch(_0x5f336a){_0x37d5cf['push'](_0x37d5cf['shift']());}}}(_0x307e,0x3ba23));var __defProp=Object['defineProperty'],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__getOwnPropNames=Object[_0x51198b(0x170)],__hasOwnProp=Object['prototype'][_0x51198b(0x16a)],__export=(_0x38dd1d,_0x83eb36)=>{for(var _0x418f44 in _0x83eb36)__defProp(_0x38dd1d,_0x418f44,{'get':_0x83eb36[_0x418f44],'enumerable':!![]});},__copyProps=(_0x119769,_0xb7958b,_0x23a6e4,_0x45b1e1)=>{const _0x17c482=_0x51198b;if(_0xb7958b&&typeof _0xb7958b==='object'||typeof _0xb7958b==='function'){for(let _0x3bba5d of __getOwnPropNames(_0xb7958b))if(!__hasOwnProp[_0x17c482(0x154)](_0x119769,_0x3bba5d)&&_0x3bba5d!==_0x23a6e4)__defProp(_0x119769,_0x3bba5d,{'get':()=>_0xb7958b[_0x3bba5d],'enumerable':!(_0x45b1e1=__getOwnPropDesc(_0xb7958b,_0x3bba5d))||_0x45b1e1[_0x17c482(0x16f)]});}return _0x119769;},__toCommonJS=_0x48df48=>__copyProps(__defProp({},'__esModule',{'value':!![]}),_0x48df48),babel_plugin_exports={};__export(babel_plugin_exports,{'default':()=>ceraphTestIdPlugin}),module['exports']=__toCommonJS(babel_plugin_exports);var CERAPH_TESTID_PREFIX=_0x51198b(0x161);function _0x307e(){const _0x3cd0a4=['line','process','call','TextField','onLongPress','onChangeText','NODE_ENV','column','padStart','TouchableNativeFeedback','relative','738Vdzovb','name','Pressable','216628lmSSgd','cer_','isJSXAttribute','12eXABvP','relPath','onChange','19674CcrdOq','1168700KFcKno','26224VKGyDO','join','hasOwnProperty','has','MenuItem','length','node','enumerable','getOwnPropertyNames','143UQNoZH','stringLiteral','col','116930IrzLvL','isJSXNamespacedName','types','unshift','opts','charCodeAt','418103MuEEON','replace','testID','file','loc','split','start','51426REuHrn','42CPQvCZ','Picker','IrRKn','ListItem','onPressIn','toString','TextInput','attributes','push'];_0x307e=function(){return _0x3cd0a4;};return _0x307e();}function normalizeRelPath(_0x2dfc76){const _0x15e3a9=_0x51198b;return _0x2dfc76['replace'](/\\/g,'/')[_0x15e3a9(0x142)](/^\.\//,'')['replace'](/^\/+/,'');}function slug(_0x4e77e6){const _0x75b84b=_0x51198b,_0x55a407=_0x4e77e6['replace'](/\.[jt]sx?$/i,''),_0x4e97fb=_0x55a407['toLowerCase']()['replace'](/[^a-z0-9]+/g,'-')[_0x75b84b(0x142)](/-+/g,'-')['replace'](/^-+|-+$/g,'');return _0x4e97fb[_0x75b84b(0x16d)]>0x28?_0x4e97fb['slice'](_0x4e97fb['length']-0x28)['replace'](/^-+/,''):_0x4e97fb;}function fnv1a64Hex(_0xdc5f45){const _0x37065b=_0x51198b;let _0x555040=0xcbf29ce484222325n;const _0x5e784e=0x100000001b3n,_0x30e960=0xffffffffffffffffn;for(let _0x4e7d1c=0x0;_0x4e7d1c<_0xdc5f45['length'];_0x4e7d1c++){_0x555040^=BigInt(_0xdc5f45[_0x37065b(0x140)](_0x4e7d1c)),_0x555040=_0x555040*_0x5e784e&_0x30e960;}return _0x555040[_0x37065b(0x14e)](0x10)['padStart'](0x10,'0');}function deriveTestId(_0x1f97b9){const _0x448283=_0x51198b,_0x4d367f=normalizeRelPath(_0x1f97b9[_0x448283(0x164)]),_0x118410=_0x4d367f+'|'+_0x1f97b9[_0x448283(0x152)]+'|'+_0x1f97b9[_0x448283(0x173)]+'|'+(_0x1f97b9['tag']??''),_0x242002=fnv1a64Hex(_0x118410)['slice'](0x0,0xa);return''+CERAPH_TESTID_PREFIX+slug(_0x4d367f)+'_'+_0x1f97b9[_0x448283(0x152)]+'_'+_0x1f97b9['col']+'_'+_0x242002;}var INTERACTIVE_TAGS=new Set([_0x51198b(0x15f),'TouchableOpacity','TouchableHighlight','TouchableWithoutFeedback',_0x51198b(0x15b),'Button','Link','IconButton',_0x51198b(0x16c),_0x51198b(0x14c),'Chip']),INPUT_TAGS=new Set([_0x51198b(0x14f),_0x51198b(0x155),'Switch',_0x51198b(0x14a),'Slider','Checkbox','SegmentedControl','SearchBar']),PRESS_PROPS=new Set(['onPress',_0x51198b(0x14d),_0x51198b(0x156),'onClick']),INPUT_PROPS=new Set([_0x51198b(0x157),'onValueChange',_0x51198b(0x165)]);function baseTag(_0x151708){return _0x151708['split']('.')[0x0];}function isTargetableJsx(_0x1c4660,_0x378d7c){const _0x541b90=_0x51198b,_0x375ec7=baseTag(_0x1c4660);if(INTERACTIVE_TAGS[_0x541b90(0x16b)](_0x1c4660)||INTERACTIVE_TAGS[_0x541b90(0x16b)](_0x375ec7)||INPUT_TAGS[_0x541b90(0x16b)](_0x1c4660)||INPUT_TAGS[_0x541b90(0x16b)](_0x375ec7))return!![];for(const _0x6e6e8f of _0x378d7c){if(PRESS_PROPS['has'](_0x6e6e8f)||INPUT_PROPS['has'](_0x6e6e8f))return!![];}return![];}var import_node_path=require('path');function jsxTagName(_0x337a9b,_0x42a024){const _0x533d23=_0x51198b;if(_0x42a024['isJSXIdentifier'](_0x337a9b))return _0x337a9b[_0x533d23(0x15e)];if(_0x42a024['isJSXMemberExpression'](_0x337a9b)){const _0x1e1406=[];let _0x1a7b6a=_0x337a9b;while(_0x42a024['isJSXMemberExpression'](_0x1a7b6a)){if('iWMIG'===_0x533d23(0x14b)){let _0x303498=0xcbf29ce484222325n;const _0x24a2dc=0x100000001b3n,_0x31d911=0xffffffffffffffffn;for(let _0x2c2f4b=0x0;_0x2c2f4b<_0x2865a7[_0x533d23(0x16d)];_0x2c2f4b++){_0x303498^=_0x15ec85(_0x3d6cbf['charCodeAt'](_0x2c2f4b)),_0x303498=_0x303498*_0x24a2dc&_0x31d911;}return _0x303498['toString'](0x10)[_0x533d23(0x15a)](0x10,'0');}else _0x1e1406[_0x533d23(0x13e)](_0x1a7b6a['property'][_0x533d23(0x15e)]),_0x1a7b6a=_0x1a7b6a['object'];}if(_0x42a024['isJSXIdentifier'](_0x1a7b6a))_0x1e1406['unshift'](_0x1a7b6a[_0x533d23(0x15e)]);return _0x1e1406[_0x533d23(0x169)]('.');}if(_0x42a024[_0x533d23(0x13c)](_0x337a9b))return _0x337a9b['namespace']['name']+':'+_0x337a9b['name']['name'];return'';}function attrName(_0x3c13e9,_0x454b93){const _0x21672b=_0x51198b;return _0x454b93['isJSXIdentifier'](_0x3c13e9[_0x21672b(0x15e)])?_0x3c13e9[_0x21672b(0x15e)]['name']:void 0x0;}function attrNames(_0x5e2428,_0x29fbe9){const _0x131a47=_0x51198b,_0x55df7d=[];for(const _0x8a02c5 of _0x5e2428['attributes']){if(_0x29fbe9[_0x131a47(0x162)](_0x8a02c5)){if('MGgrv'!=='MGgrv'){const _0x1a778c=_0x4e3374(_0x3d1798);if(_0x13e807['has'](_0x2db297)||_0xf3081['has'](_0x1a778c)||_0x5b092b['has'](_0x5e47de)||_0x495ffe[_0x131a47(0x16b)](_0x1a778c))return!![];for(const _0x2d77a2 of _0x23c52b){if(_0x403f4d['has'](_0x2d77a2)||_0x11a352[_0x131a47(0x16b)](_0x2d77a2))return!![];}return![];}else{const _0x3f00c4=attrName(_0x8a02c5,_0x29fbe9);if(_0x3f00c4)_0x55df7d[_0x131a47(0x151)](_0x3f00c4);}}}return _0x55df7d;}function hasTestId(_0x307c59){return _0x307c59['includes']('testID');}function _0x59b4(_0x111992,_0x4d4318){_0x111992=_0x111992-0x13b;const _0x307e61=_0x307e();let _0x59b49a=_0x307e61[_0x111992];return _0x59b49a;}function toRelPath(_0x5255b5,_0x31c736){const _0x11c5da=_0x51198b,_0x2386e6=_0x5255b5??'',_0x33c8cc=_0x2386e6?(0x0,import_node_path[_0x11c5da(0x15c)])(_0x2386e6,_0x31c736):_0x31c736;return import_node_path['sep']==='/'?_0x33c8cc:_0x33c8cc[_0x11c5da(0x146)](import_node_path['sep'])[_0x11c5da(0x169)](import_node_path['posix']['sep']);}function defaultEnabled(){const _0x36aa09=_0x51198b,_0x479c92=globalThis[_0x36aa09(0x153)]?.['env'];return _0x479c92?.[_0x36aa09(0x158)]!=='production';}function ceraphTestIdPlugin(_0x2a408c,_0x52fa28={}){const _0xc477e5=_0x51198b,_0x1ad342=_0x2a408c[_0xc477e5(0x13d)],_0x40eeda=_0x52fa28['enabled']??defaultEnabled();return{'name':'ceraph-testid-injector','visitor':{'JSXOpeningElement'(_0x1d7034,_0x36c781){const _0x4a7010=_0xc477e5;if(!_0x40eeda)return;const _0x34de1b=_0x1d7034[_0x4a7010(0x16e)],_0x289f50=_0x34de1b[_0x4a7010(0x145)];if(!_0x289f50)return;const _0x135c94=_0x36c781['file'][_0x4a7010(0x13f)]['filename'];if(!_0x135c94)return;const _0x2ff256=jsxTagName(_0x34de1b['name'],_0x1ad342),_0x4874c1=attrNames(_0x34de1b,_0x1ad342);if(hasTestId(_0x4874c1))return;if(!isTargetableJsx(_0x2ff256,_0x4874c1))return;const _0x435e34=toRelPath(_0x36c781[_0x4a7010(0x144)][_0x4a7010(0x13f)]['root']??null,_0x135c94),_0x304ee6=deriveTestId({'relPath':_0x435e34,'line':_0x289f50['start'][_0x4a7010(0x152)],'col':_0x289f50[_0x4a7010(0x147)][_0x4a7010(0x159)]+0x1,'tag':_0x2ff256});_0x34de1b[_0x4a7010(0x150)][_0x4a7010(0x13e)](_0x1ad342['jsxAttribute'](_0x1ad342['jsxIdentifier'](_0x4a7010(0x143)),_0x1ad342[_0x4a7010(0x172)](_0x304ee6)));}}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x57ee3a=_0x2910;(function(_0x5c03fb,_0x5d82f6){const _0x413a5c=_0x2910,_0x4cc2f3=_0x5c03fb();while(!![]){try{const _0x5b6477=parseInt(_0x413a5c(0x172))/0x1+parseInt(_0x413a5c(0x153))/0x2*(parseInt(_0x413a5c(0x166))/0x3)+parseInt(_0x413a5c(0x14e))/0x4*(parseInt(_0x413a5c(0x171))/0x5)+parseInt(_0x413a5c(0x151))/0x6+-parseInt(_0x413a5c(0x160))/0x7*(-parseInt(_0x413a5c(0x16f))/0x8)+-parseInt(_0x413a5c(0x177))/0x9+-parseInt(_0x413a5c(0x155))/0xa;if(_0x5b6477===_0x5d82f6)break;else _0x4cc2f3['push'](_0x4cc2f3['shift']());}catch(_0x2f03a3){_0x4cc2f3['push'](_0x4cc2f3['shift']());}}}(_0x647c,0x68575));var CERAPH_TESTID_PREFIX=_0x57ee3a(0x164);function _0x647c(){const _0x3559d0=['slice','onValueChange','testID','namespace','Pressable','IconButton','line','types','ceraph-testid-injector','file','join','onLongPress','split','isJSXMemberExpression','40KzaPdk','TouchableHighlight','enabled','117954GRTfSg','node','2friuxM','replace','12917560cOfzvX','charCodeAt','dViHO','length','isJSXIdentifier','sep','isJSXAttribute','loc','root','attributes','Picker','161bpKujm','unshift','NODE_ENV','Switch','cer_','has','1331238tuihaR','SegmentedControl','jsxAttribute','TouchableOpacity','onPress','Checkbox','opts','ListItem','stringLiteral','201448BwcQEA','tag','252690jXxbyO','783752kdmMdn','TextField','start','push','toLowerCase','5513067AZPpyt','name','SearchBar'];_0x647c=function(){return _0x3559d0;};return _0x647c();}function normalizeRelPath(_0x59d9fa){const _0x2e432b=_0x57ee3a;return _0x59d9fa['replace'](/\\/g,'/')[_0x2e432b(0x154)](/^\.\//,'')['replace'](/^\/+/,'');}function slug(_0x3c0853){const _0x10c4e8=_0x57ee3a,_0x519460=_0x3c0853[_0x10c4e8(0x154)](/\.[jt]sx?$/i,''),_0xb94032=_0x519460[_0x10c4e8(0x176)]()[_0x10c4e8(0x154)](/[^a-z0-9]+/g,'-')['replace'](/-+/g,'-')['replace'](/^-+|-+$/g,'');return _0xb94032[_0x10c4e8(0x158)]>0x28?_0xb94032[_0x10c4e8(0x140)](_0xb94032[_0x10c4e8(0x158)]-0x28)[_0x10c4e8(0x154)](/^-+/,''):_0xb94032;}function fnv1a64Hex(_0xf7fbdc){const _0x156e6a=_0x57ee3a;let _0x37c152=0xcbf29ce484222325n;const _0x617b28=0x100000001b3n,_0x1cfc97=0xffffffffffffffffn;for(let _0x1337d8=0x0;_0x1337d8<_0xf7fbdc[_0x156e6a(0x158)];_0x1337d8++){_0x37c152^=BigInt(_0xf7fbdc[_0x156e6a(0x156)](_0x1337d8)),_0x37c152=_0x37c152*_0x617b28&_0x1cfc97;}return _0x37c152['toString'](0x10)['padStart'](0x10,'0');}function deriveTestId(_0x3b2ca6){const _0x35cee3=_0x57ee3a,_0x4c7877=normalizeRelPath(_0x3b2ca6['relPath']),_0x3737d6=_0x4c7877+'|'+_0x3b2ca6['line']+'|'+_0x3b2ca6['col']+'|'+(_0x3b2ca6[_0x35cee3(0x170)]??''),_0x2b4678=fnv1a64Hex(_0x3737d6)['slice'](0x0,0xa);return''+CERAPH_TESTID_PREFIX+slug(_0x4c7877)+'_'+_0x3b2ca6[_0x35cee3(0x146)]+'_'+_0x3b2ca6['col']+'_'+_0x2b4678;}var INTERACTIVE_TAGS=new Set([_0x57ee3a(0x144),_0x57ee3a(0x169),_0x57ee3a(0x14f),'TouchableWithoutFeedback','TouchableNativeFeedback','Button','Link',_0x57ee3a(0x145),'MenuItem',_0x57ee3a(0x16d),'Chip']),INPUT_TAGS=new Set(['TextInput',_0x57ee3a(0x173),_0x57ee3a(0x163),_0x57ee3a(0x15f),'Slider',_0x57ee3a(0x16b),_0x57ee3a(0x167),_0x57ee3a(0x13f)]),PRESS_PROPS=new Set([_0x57ee3a(0x16a),'onPressIn',_0x57ee3a(0x14b),'onClick']),INPUT_PROPS=new Set(['onChangeText',_0x57ee3a(0x141),'onChange']);function baseTag(_0x59a8cf){const _0x1c4883=_0x57ee3a;return _0x59a8cf[_0x1c4883(0x14c)]('.')[0x0];}function isTargetableJsx(_0x3a3f6c,_0x4418bb){const _0x512b75=_0x57ee3a,_0x1118c3=baseTag(_0x3a3f6c);if(INTERACTIVE_TAGS['has'](_0x3a3f6c)||INTERACTIVE_TAGS[_0x512b75(0x165)](_0x1118c3)||INPUT_TAGS[_0x512b75(0x165)](_0x3a3f6c)||INPUT_TAGS['has'](_0x1118c3))return!![];for(const _0x419e5d of _0x4418bb){if(PRESS_PROPS[_0x512b75(0x165)](_0x419e5d)||INPUT_PROPS[_0x512b75(0x165)](_0x419e5d))return!![];}return![];}import{posix,relative,sep}from'path';function jsxTagName(_0x31bbb6,_0x25c290){const _0x8f5103=_0x57ee3a;if(_0x25c290[_0x8f5103(0x159)](_0x31bbb6))return _0x31bbb6[_0x8f5103(0x178)];if(_0x25c290[_0x8f5103(0x14d)](_0x31bbb6)){if('NwHYR'!==_0x8f5103(0x157)){const _0x231934=[];let _0x36b2e4=_0x31bbb6;while(_0x25c290[_0x8f5103(0x14d)](_0x36b2e4)){_0x231934[_0x8f5103(0x161)](_0x36b2e4['property'][_0x8f5103(0x178)]),_0x36b2e4=_0x36b2e4['object'];}if(_0x25c290[_0x8f5103(0x159)](_0x36b2e4))_0x231934[_0x8f5103(0x161)](_0x36b2e4[_0x8f5103(0x178)]);return _0x231934[_0x8f5103(0x14a)]('.');}else{if(!_0x138fe9)return;const _0x4a8c33=_0x2376b4['node'],_0x3ecd0a=_0x4a8c33['loc'];if(!_0x3ecd0a)return;const _0x3971ff=_0x2216b9[_0x8f5103(0x149)][_0x8f5103(0x16c)]['filename'];if(!_0x3971ff)return;const _0x401844=_0x4ae0c7(_0x4a8c33[_0x8f5103(0x178)],_0x162b78),_0x368b38=_0x1cef9b(_0x4a8c33,_0x304c9d);if(_0x321b8d(_0x368b38))return;if(!_0x358c17(_0x401844,_0x368b38))return;const _0x262bbf=_0x53f735(_0x1bb857[_0x8f5103(0x149)]['opts'][_0x8f5103(0x15d)]??null,_0x3971ff),_0x469633=_0x2e7bee({'relPath':_0x262bbf,'line':_0x3ecd0a[_0x8f5103(0x174)][_0x8f5103(0x146)],'col':_0x3ecd0a['start']['column']+0x1,'tag':_0x401844});_0x4a8c33['attributes'][_0x8f5103(0x161)](_0x78ead8['jsxAttribute'](_0x18058f['jsxIdentifier'](_0x8f5103(0x142)),_0x31e750[_0x8f5103(0x16e)](_0x469633)));}}if(_0x25c290['isJSXNamespacedName'](_0x31bbb6))return _0x31bbb6[_0x8f5103(0x143)]['name']+':'+_0x31bbb6['name'][_0x8f5103(0x178)];return'';}function attrName(_0x2caa7d,_0x5ee43f){const _0x40bd92=_0x57ee3a;return _0x5ee43f['isJSXIdentifier'](_0x2caa7d['name'])?_0x2caa7d[_0x40bd92(0x178)]['name']:void 0x0;}function attrNames(_0xb30ec,_0x1eafb7){const _0x3e07f2=_0x57ee3a,_0x1f8f61=[];for(const _0x22661b of _0xb30ec['attributes']){if(_0x1eafb7[_0x3e07f2(0x15b)](_0x22661b)){const _0x1e576d=attrName(_0x22661b,_0x1eafb7);if(_0x1e576d)_0x1f8f61[_0x3e07f2(0x175)](_0x1e576d);}}return _0x1f8f61;}function hasTestId(_0x3f8e13){const _0x52b4fb=_0x57ee3a;return _0x3f8e13['includes'](_0x52b4fb(0x142));}function toRelPath(_0xb292c7,_0x4e9d31){const _0x3f509c=_0x57ee3a,_0x5d08f3=_0xb292c7??'',_0x1631e3=_0x5d08f3?relative(_0x5d08f3,_0x4e9d31):_0x4e9d31;return sep==='/'?_0x1631e3:_0x1631e3['split'](sep)[_0x3f509c(0x14a)](posix[_0x3f509c(0x15a)]);}function defaultEnabled(){const _0xa6f07d=_0x57ee3a,_0x5cd527=globalThis['process']?.['env'];return _0x5cd527?.[_0xa6f07d(0x162)]!=='production';}function ceraphTestIdPlugin(_0x5b1280,_0x594cb5={}){const _0x4648fd=_0x57ee3a,_0x2a8381=_0x5b1280[_0x4648fd(0x147)],_0x185ea6=_0x594cb5[_0x4648fd(0x150)]??defaultEnabled();return{'name':_0x4648fd(0x148),'visitor':{'JSXOpeningElement'(_0x2d2ea7,_0x1d6a3a){const _0x1ab614=_0x4648fd;if(!_0x185ea6)return;const _0x282c00=_0x2d2ea7[_0x1ab614(0x152)],_0x385387=_0x282c00[_0x1ab614(0x15c)];if(!_0x385387)return;const _0x23a561=_0x1d6a3a['file'][_0x1ab614(0x16c)]['filename'];if(!_0x23a561)return;const _0x2e9af9=jsxTagName(_0x282c00[_0x1ab614(0x178)],_0x2a8381),_0x519748=attrNames(_0x282c00,_0x2a8381);if(hasTestId(_0x519748))return;if(!isTargetableJsx(_0x2e9af9,_0x519748))return;const _0x41bc15=toRelPath(_0x1d6a3a[_0x1ab614(0x149)]['opts'][_0x1ab614(0x15d)]??null,_0x23a561),_0x5810a6=deriveTestId({'relPath':_0x41bc15,'line':_0x385387[_0x1ab614(0x174)][_0x1ab614(0x146)],'col':_0x385387['start']['column']+0x1,'tag':_0x2e9af9});_0x282c00[_0x1ab614(0x15e)]['unshift'](_0x2a8381[_0x1ab614(0x168)](_0x2a8381['jsxIdentifier'](_0x1ab614(0x142)),_0x2a8381['stringLiteral'](_0x5810a6)));}}};}function _0x2910(_0x49e452,_0x2fa3db){_0x49e452=_0x49e452-0x13f;const _0x647c1a=_0x647c();let _0x29102d=_0x647c1a[_0x49e452];return _0x29102d;}export{ceraphTestIdPlugin as default};
|