@ceraph/react-native-mcp 0.4.5 → 0.4.6
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/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 +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const _0x21f2ef=_0x4906;(function(_0x5b2516,_0x552fd5){const _0x5e2d8b=_0x4906,_0x26527b=_0x5b2516();while(!![]){try{const _0x166e35=parseInt(_0x5e2d8b(0x204))/0x1*(parseInt(_0x5e2d8b(0x20b))/0x2)+-parseInt(_0x5e2d8b(0x1f7))/0x3+parseInt(_0x5e2d8b(0x1ef))/0x4*(-parseInt(_0x5e2d8b(0x20f))/0x5)+parseInt(_0x5e2d8b(0x1ff))/0x6+-parseInt(_0x5e2d8b(0x218))/0x7+-parseInt(_0x5e2d8b(0x1f5))/0x8*(parseInt(_0x5e2d8b(0x1fd))/0x9)+parseInt(_0x5e2d8b(0x201))/0xa;if(_0x166e35===_0x552fd5)break;else _0x26527b['push'](_0x26527b['shift']());}catch(_0x29fdf5){_0x26527b['push'](_0x26527b['shift']());}}}(_0x59ce,0xc82a3));var __defProp=Object['defineProperty'],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__getOwnPropNames=Object['getOwnPropertyNames'],__hasOwnProp=Object['prototype'][_0x21f2ef(0x1e9)],__export=(_0x1b2d97,_0x2c33d2)=>{for(var _0x4851f9 in _0x2c33d2)__defProp(_0x1b2d97,_0x4851f9,{'get':_0x2c33d2[_0x4851f9],'enumerable':!![]});},__copyProps=(_0x1f8637,_0x9277c,_0x35b760,_0x44b3bd)=>{const _0x1a5beb=_0x21f2ef;if(_0x9277c&&typeof _0x9277c===_0x1a5beb(0x216)||typeof _0x9277c===_0x1a5beb(0x1f2)){for(let _0x1c7567 of __getOwnPropNames(_0x9277c))if(!__hasOwnProp[_0x1a5beb(0x1eb)](_0x1f8637,_0x1c7567)&&_0x1c7567!==_0x35b760)__defProp(_0x1f8637,_0x1c7567,{'get':()=>_0x9277c[_0x1c7567],'enumerable':!(_0x44b3bd=__getOwnPropDesc(_0x9277c,_0x1c7567))||_0x44b3bd[_0x1a5beb(0x1f1)]});}return _0x1f8637;},__toCommonJS=_0x448aa8=>__copyProps(__defProp({},'__esModule',{'value':!![]}),_0x448aa8),babel_plugin_exports={};__export(babel_plugin_exports,{'default':()=>ceraphTestIdPlugin}),module[_0x21f2ef(0x200)]=__toCommonJS(babel_plugin_exports);var CERAPH_TESTID_PREFIX=_0x21f2ef(0x203);function normalizeRelPath(_0x1d6c1f){const _0x3def1b=_0x21f2ef;return _0x1d6c1f['replace'](/\\/g,'/')[_0x3def1b(0x1e7)](/^\.\//,'')['replace'](/^\/+/,'');}function slug(_0x3607d1){const _0x1b8d8a=_0x21f2ef,_0x1adca6=_0x3607d1[_0x1b8d8a(0x1e7)](/\.[jt]sx?$/i,''),_0x12aea3=_0x1adca6['toLowerCase']()['replace'](/[^a-z0-9]+/g,'-')['replace'](/-+/g,'-')[_0x1b8d8a(0x1e7)](/^-+|-+$/g,'');return _0x12aea3['length']>0x28?_0x12aea3[_0x1b8d8a(0x1ed)](_0x12aea3[_0x1b8d8a(0x1f3)]-0x28)[_0x1b8d8a(0x1e7)](/^-+/,''):_0x12aea3;}function fnv1a64Hex(_0x49cf15){const _0x50f366=_0x21f2ef;let _0x4f2b91=0xcbf29ce484222325n;const _0x5e65c1=0x100000001b3n,_0x20b9c7=0xffffffffffffffffn;for(let _0x462f41=0x0;_0x462f41<_0x49cf15[_0x50f366(0x1f3)];_0x462f41++){_0x4f2b91^=BigInt(_0x49cf15['charCodeAt'](_0x462f41)),_0x4f2b91=_0x4f2b91*_0x5e65c1&_0x20b9c7;}return _0x4f2b91['toString'](0x10)[_0x50f366(0x1e3)](0x10,'0');}function deriveTestId(_0x4d2c68){const _0x14b3f0=_0x21f2ef,_0x43f433=normalizeRelPath(_0x4d2c68['relPath']),_0x3ca73a=_0x43f433+'|'+_0x4d2c68[_0x14b3f0(0x206)]+'|'+_0x4d2c68[_0x14b3f0(0x1f6)]+'|'+(_0x4d2c68[_0x14b3f0(0x1f8)]??''),_0x552f81=fnv1a64Hex(_0x3ca73a)['slice'](0x0,0xa);return''+CERAPH_TESTID_PREFIX+slug(_0x43f433)+'_'+_0x4d2c68[_0x14b3f0(0x206)]+'_'+_0x4d2c68[_0x14b3f0(0x1f6)]+'_'+_0x552f81;}var INTERACTIVE_TAGS=new Set([_0x21f2ef(0x209),_0x21f2ef(0x1fe),'TouchableHighlight','TouchableWithoutFeedback',_0x21f2ef(0x214),_0x21f2ef(0x1f4),_0x21f2ef(0x1fb),'IconButton','MenuItem',_0x21f2ef(0x1f0),'Chip']),INPUT_TAGS=new Set(['TextInput','TextField',_0x21f2ef(0x20a),'Picker',_0x21f2ef(0x1f9),_0x21f2ef(0x20c),'SegmentedControl','SearchBar']),PRESS_PROPS=new Set(['onPress','onPressIn','onLongPress','onClick']),INPUT_PROPS=new Set(['onChangeText','onValueChange','onChange']);function baseTag(_0x815ba0){return _0x815ba0['split']('.')[0x0];}function _0x4906(_0x27ed9b,_0x41ff15){_0x27ed9b=_0x27ed9b-0x1e2;const _0x59ce4e=_0x59ce();let _0x4906d2=_0x59ce4e[_0x27ed9b];return _0x4906d2;}function _0x59ce(){const _0x2ec0c3=['isJSXMemberExpression','25895nCPeLy','env','column','file','namespace','TouchableNativeFeedback','unshift','object','sep','10986549zWceKj','NODE_ENV','padStart','split','has','testID','replace','push','hasOwnProperty','start','call','attributes','slice','isJSXAttribute','340wpFjTs','ListItem','enumerable','function','length','Button','8mdSeOc','col','2007636NGLfDP','tag','Slider','loc','Link','name','134163UIhRZO','TouchableOpacity','7762398gWElfZ','exports','14262200EAISuY','filename','cer_','41777wjRViV','opts','line','enabled','property','Pressable','Switch','38PxUITV','Checkbox','ceraph-testid-injector'];_0x59ce=function(){return _0x2ec0c3;};return _0x59ce();}function isTargetableJsx(_0x4492b2,_0x1c0059){const _0x4300fc=_0x21f2ef,_0x261e51=baseTag(_0x4492b2);if(INTERACTIVE_TAGS[_0x4300fc(0x1e5)](_0x4492b2)||INTERACTIVE_TAGS['has'](_0x261e51)||INPUT_TAGS[_0x4300fc(0x1e5)](_0x4492b2)||INPUT_TAGS['has'](_0x261e51))return!![];for(const _0x140184 of _0x1c0059){if(PRESS_PROPS[_0x4300fc(0x1e5)](_0x140184)||INPUT_PROPS[_0x4300fc(0x1e5)](_0x140184))return!![];}return![];}var import_node_path=require('path');function jsxTagName(_0x4eed95,_0x1c1631){const _0x4f21b8=_0x21f2ef;if(_0x1c1631['isJSXIdentifier'](_0x4eed95))return _0x4eed95[_0x4f21b8(0x1fc)];if(_0x1c1631[_0x4f21b8(0x20e)](_0x4eed95)){const _0x269421=[];let _0x298a88=_0x4eed95;while(_0x1c1631['isJSXMemberExpression'](_0x298a88)){_0x269421['unshift'](_0x298a88[_0x4f21b8(0x208)][_0x4f21b8(0x1fc)]),_0x298a88=_0x298a88[_0x4f21b8(0x216)];}if(_0x1c1631['isJSXIdentifier'](_0x298a88))_0x269421[_0x4f21b8(0x215)](_0x298a88[_0x4f21b8(0x1fc)]);return _0x269421['join']('.');}if(_0x1c1631['isJSXNamespacedName'](_0x4eed95))return _0x4eed95[_0x4f21b8(0x213)][_0x4f21b8(0x1fc)]+':'+_0x4eed95[_0x4f21b8(0x1fc)]['name'];return'';}function attrName(_0x25658f,_0x3cf082){const _0x592f5b=_0x21f2ef;return _0x3cf082['isJSXIdentifier'](_0x25658f['name'])?_0x25658f[_0x592f5b(0x1fc)][_0x592f5b(0x1fc)]:void 0x0;}function attrNames(_0x4f7d83,_0x5cd44b){const _0x2c548b=_0x21f2ef,_0x1c5401=[];for(const _0x483c21 of _0x4f7d83['attributes']){if(_0x5cd44b[_0x2c548b(0x1ee)](_0x483c21)){const _0x5a4f89=attrName(_0x483c21,_0x5cd44b);if(_0x5a4f89)_0x1c5401[_0x2c548b(0x1e8)](_0x5a4f89);}}return _0x1c5401;}function hasTestId(_0x31257d){const _0x3d5255=_0x21f2ef;return _0x31257d['includes'](_0x3d5255(0x1e6));}function toRelPath(_0x3d6ac7,_0x2c19db){const _0x56330d=_0x21f2ef,_0x88ed96=_0x3d6ac7??'',_0xc7f6d2=_0x88ed96?(0x0,import_node_path['relative'])(_0x88ed96,_0x2c19db):_0x2c19db;return import_node_path[_0x56330d(0x217)]==='/'?_0xc7f6d2:_0xc7f6d2[_0x56330d(0x1e4)](import_node_path['sep'])['join'](import_node_path['posix'][_0x56330d(0x217)]);}function defaultEnabled(){const _0x3ba803=_0x21f2ef,_0x28271e=globalThis['process']?.[_0x3ba803(0x210)];return _0x28271e?.[_0x3ba803(0x1e2)]!=='production';}function ceraphTestIdPlugin(_0x425062,_0x300af5={}){const _0x42372f=_0x21f2ef,_0x3c7664=_0x425062['types'],_0x4b4d5c=_0x300af5[_0x42372f(0x207)]??defaultEnabled();return{'name':_0x42372f(0x20d),'visitor':{'JSXOpeningElement'(_0x1b3be3,_0x2003df){const _0x437728=_0x42372f;if(!_0x4b4d5c)return;const _0x145895=_0x1b3be3['node'],_0x15a4f5=_0x145895[_0x437728(0x1fa)];if(!_0x15a4f5)return;const _0x372d5a=_0x2003df[_0x437728(0x212)][_0x437728(0x205)][_0x437728(0x202)];if(!_0x372d5a)return;const _0x46d4bb=jsxTagName(_0x145895['name'],_0x3c7664),_0x40e2fb=attrNames(_0x145895,_0x3c7664);if(hasTestId(_0x40e2fb))return;if(!isTargetableJsx(_0x46d4bb,_0x40e2fb))return;const _0x5458a9=toRelPath(_0x2003df[_0x437728(0x212)]['opts']['root']??null,_0x372d5a),_0x29cfae=deriveTestId({'relPath':_0x5458a9,'line':_0x15a4f5['start'][_0x437728(0x206)],'col':_0x15a4f5[_0x437728(0x1ea)][_0x437728(0x211)]+0x1,'tag':_0x46d4bb});_0x145895[_0x437728(0x1ec)]['unshift'](_0x3c7664['jsxAttribute'](_0x3c7664['jsxIdentifier']('testID'),_0x3c7664['stringLiteral'](_0x29cfae)));}}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x20ecbd=_0x57cf;(function(_0x58d4d1,_0x100f73){const _0x5ae4c7=_0x57cf,_0x482b8f=_0x58d4d1();while(!![]){try{const _0x1b0909=-parseInt(_0x5ae4c7(0x133))/0x1+-parseInt(_0x5ae4c7(0x11a))/0x2+parseInt(_0x5ae4c7(0x137))/0x3+parseInt(_0x5ae4c7(0x115))/0x4*(parseInt(_0x5ae4c7(0x113))/0x5)+-parseInt(_0x5ae4c7(0x142))/0x6+parseInt(_0x5ae4c7(0x12d))/0x7*(parseInt(_0x5ae4c7(0x13a))/0x8)+-parseInt(_0x5ae4c7(0x13f))/0x9*(parseInt(_0x5ae4c7(0x11c))/0xa);if(_0x1b0909===_0x100f73)break;else _0x482b8f['push'](_0x482b8f['shift']());}catch(_0x4af8b1){_0x482b8f['push'](_0x482b8f['shift']());}}}(_0x45cd,0xdd4cc));var CERAPH_TESTID_PREFIX='cer_';function normalizeRelPath(_0x591053){const _0x4c2032=_0x57cf;return _0x591053['replace'](/\\/g,'/')['replace'](/^\.\//,'')[_0x4c2032(0x141)](/^\/+/,'');}function slug(_0x412217){const _0x4c46a4=_0x57cf,_0xf05090=_0x412217[_0x4c46a4(0x141)](/\.[jt]sx?$/i,''),_0x535b71=_0xf05090[_0x4c46a4(0x130)]()[_0x4c46a4(0x141)](/[^a-z0-9]+/g,'-')[_0x4c46a4(0x141)](/-+/g,'-')['replace'](/^-+|-+$/g,'');return _0x535b71['length']>0x28?_0x535b71['slice'](_0x535b71['length']-0x28)['replace'](/^-+/,''):_0x535b71;}function fnv1a64Hex(_0x65a5de){const _0x58598a=_0x57cf;let _0x13ecdb=0xcbf29ce484222325n;const _0x510bbf=0x100000001b3n,_0x19125e=0xffffffffffffffffn;for(let _0x368b81=0x0;_0x368b81<_0x65a5de[_0x58598a(0x126)];_0x368b81++){_0x13ecdb^=BigInt(_0x65a5de[_0x58598a(0x112)](_0x368b81)),_0x13ecdb=_0x13ecdb*_0x510bbf&_0x19125e;}return _0x13ecdb[_0x58598a(0x12b)](0x10)['padStart'](0x10,'0');}function deriveTestId(_0x4a8c41){const _0x142077=_0x57cf,_0x50a983=normalizeRelPath(_0x4a8c41['relPath']),_0x3467e9=_0x50a983+'|'+_0x4a8c41['line']+'|'+_0x4a8c41[_0x142077(0x125)]+'|'+(_0x4a8c41[_0x142077(0x123)]??''),_0x9bace7=fnv1a64Hex(_0x3467e9)['slice'](0x0,0xa);return''+CERAPH_TESTID_PREFIX+slug(_0x50a983)+'_'+_0x4a8c41['line']+'_'+_0x4a8c41[_0x142077(0x125)]+'_'+_0x9bace7;}var INTERACTIVE_TAGS=new Set(['Pressable',_0x20ecbd(0x116),_0x20ecbd(0x13d),'TouchableWithoutFeedback',_0x20ecbd(0x13b),'Button','Link',_0x20ecbd(0x119),_0x20ecbd(0x127),_0x20ecbd(0x124),'Chip']),INPUT_TAGS=new Set(['TextInput',_0x20ecbd(0x121),'Switch','Picker','Slider','Checkbox',_0x20ecbd(0x12c),'SearchBar']),PRESS_PROPS=new Set([_0x20ecbd(0x144),_0x20ecbd(0x11d),_0x20ecbd(0x114),_0x20ecbd(0x131)]),INPUT_PROPS=new Set([_0x20ecbd(0x140),_0x20ecbd(0x110),'onChange']);function baseTag(_0x3402c1){const _0x577ce7=_0x20ecbd;return _0x3402c1[_0x577ce7(0x128)]('.')[0x0];}function isTargetableJsx(_0x50be75,_0x61e4e7){const _0xa5a4ad=_0x20ecbd,_0x497df3=baseTag(_0x50be75);if(INTERACTIVE_TAGS[_0xa5a4ad(0x12a)](_0x50be75)||INTERACTIVE_TAGS['has'](_0x497df3)||INPUT_TAGS[_0xa5a4ad(0x12a)](_0x50be75)||INPUT_TAGS[_0xa5a4ad(0x12a)](_0x497df3))return!![];for(const _0x2d36ee of _0x61e4e7){if(PRESS_PROPS[_0xa5a4ad(0x12a)](_0x2d36ee)||INPUT_PROPS[_0xa5a4ad(0x12a)](_0x2d36ee))return!![];}return![];}import{posix,relative,sep}from'path';function jsxTagName(_0x2f22f0,_0x3c9cc4){const _0x3da31f=_0x20ecbd;if(_0x3c9cc4['isJSXIdentifier'](_0x2f22f0))return _0x2f22f0[_0x3da31f(0x135)];if(_0x3c9cc4[_0x3da31f(0x13e)](_0x2f22f0)){const _0x2948ad=[];let _0x302206=_0x2f22f0;while(_0x3c9cc4['isJSXMemberExpression'](_0x302206)){_0x2948ad[_0x3da31f(0x118)](_0x302206['property']['name']),_0x302206=_0x302206['object'];}if(_0x3c9cc4['isJSXIdentifier'](_0x302206))_0x2948ad['unshift'](_0x302206['name']);return _0x2948ad['join']('.');}if(_0x3c9cc4[_0x3da31f(0x139)](_0x2f22f0))return _0x2f22f0[_0x3da31f(0x11b)]['name']+':'+_0x2f22f0['name'][_0x3da31f(0x135)];return'';}function attrName(_0x33ca7d,_0x33b513){const _0x302411=_0x20ecbd;return _0x33b513[_0x302411(0x13c)](_0x33ca7d[_0x302411(0x135)])?_0x33ca7d['name']['name']:void 0x0;}function attrNames(_0x32b27d,_0x480f03){const _0x567b71=_0x20ecbd,_0x32ddfa=[];for(const _0x30c394 of _0x32b27d['attributes']){if(_0x567b71(0x129)!=='Cinml'){if(_0x480f03['isJSXAttribute'](_0x30c394)){const _0x170a09=attrName(_0x30c394,_0x480f03);if(_0x170a09)_0x32ddfa['push'](_0x170a09);}}else{const _0x8dba6c=[];for(const _0x366806 of _0x21d7e2['attributes']){if(_0x15e480[_0x567b71(0x12f)](_0x366806)){const _0x1af027=_0xd6fc94(_0x366806,_0x553278);if(_0x1af027)_0x8dba6c[_0x567b71(0x120)](_0x1af027);}}return _0x8dba6c;}}return _0x32ddfa;}function hasTestId(_0x5a9b05){return _0x5a9b05['includes']('testID');}function toRelPath(_0x2e313c,_0x588d72){const _0x1d3488=_0x20ecbd,_0x3af1d2=_0x2e313c??'',_0x33c012=_0x3af1d2?relative(_0x3af1d2,_0x588d72):_0x588d72;return sep==='/'?_0x33c012:_0x33c012[_0x1d3488(0x128)](sep)[_0x1d3488(0x136)](posix[_0x1d3488(0x111)]);}function _0x57cf(_0x1ba854,_0x2e3cf){_0x1ba854=_0x1ba854-0x10f;const _0x45cd08=_0x45cd();let _0x57cf4b=_0x45cd08[_0x1ba854];return _0x57cf4b;}function defaultEnabled(){const _0xc7a9f0=_0x20ecbd,_0x242457=globalThis[_0xc7a9f0(0x122)]?.['env'];return _0x242457?.['NODE_ENV']!==_0xc7a9f0(0x132);}function _0x45cd(){const _0x1cb0f9=['toLowerCase','onClick','production','1106456VeTTua','jsxAttribute','name','join','4697955vtTOED','start','isJSXNamespacedName','8728pABMYS','TouchableNativeFeedback','isJSXIdentifier','TouchableHighlight','isJSXMemberExpression','3983076PDLsbV','onChangeText','replace','10462344VbTsmX','loc','onPress','testID','filename','onValueChange','sep','charCodeAt','590FHuEsU','onLongPress','60776KqAfwZ','TouchableOpacity','jsxIdentifier','unshift','IconButton','1459276wWjUsC','namespace','10QaFasf','onPressIn','file','ceraph-testid-injector','push','TextField','process','tag','ListItem','col','length','MenuItem','split','igClQ','has','toString','SegmentedControl','10073jdbbbN','column','isJSXAttribute'];_0x45cd=function(){return _0x1cb0f9;};return _0x45cd();}function ceraphTestIdPlugin(_0xa92e70,_0x44b4ff={}){const _0x506e0a=_0x20ecbd,_0x16ec2f=_0xa92e70['types'],_0x3e138c=_0x44b4ff['enabled']??defaultEnabled();return{'name':_0x506e0a(0x11f),'visitor':{'JSXOpeningElement'(_0x1f6aae,_0x4ec0a5){const _0x592d0e=_0x506e0a;if(!_0x3e138c)return;const _0x32dfdf=_0x1f6aae['node'],_0x4c3c46=_0x32dfdf[_0x592d0e(0x143)];if(!_0x4c3c46)return;const _0x34b816=_0x4ec0a5[_0x592d0e(0x11e)]['opts'][_0x592d0e(0x10f)];if(!_0x34b816)return;const _0x36ab19=jsxTagName(_0x32dfdf['name'],_0x16ec2f),_0x3cb592=attrNames(_0x32dfdf,_0x16ec2f);if(hasTestId(_0x3cb592))return;if(!isTargetableJsx(_0x36ab19,_0x3cb592))return;const _0x3a342b=toRelPath(_0x4ec0a5['file']['opts']['root']??null,_0x34b816),_0x38f103=deriveTestId({'relPath':_0x3a342b,'line':_0x4c3c46[_0x592d0e(0x138)]['line'],'col':_0x4c3c46[_0x592d0e(0x138)][_0x592d0e(0x12e)]+0x1,'tag':_0x36ab19});_0x32dfdf['attributes'][_0x592d0e(0x118)](_0x16ec2f[_0x592d0e(0x134)](_0x16ec2f[_0x592d0e(0x117)](_0x592d0e(0x145)),_0x16ec2f['stringLiteral'](_0x38f103)));}}};}export{ceraphTestIdPlugin as default};
|