@profoundlogic/codermake 1.1.0 → 1.3.0

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.
@@ -0,0 +1 @@
1
+ (function(_0x4ae2ed,_0xd04041){const _0x38444f=_0x1859,_0x4dd4e8=_0x4ae2ed();while(!![]){try{const _0x1baf1a=parseInt(_0x38444f(0x1e6))/0x1+parseInt(_0x38444f(0x1b8))/0x2+parseInt(_0x38444f(0x1cf))/0x3*(-parseInt(_0x38444f(0x1db))/0x4)+-parseInt(_0x38444f(0x1d8))/0x5+parseInt(_0x38444f(0x1d2))/0x6*(parseInt(_0x38444f(0x1e1))/0x7)+-parseInt(_0x38444f(0x1bb))/0x8+parseInt(_0x38444f(0x1f7))/0x9;if(_0x1baf1a===_0xd04041)break;else _0x4dd4e8['push'](_0x4dd4e8['shift']());}catch(_0x540cf2){_0x4dd4e8['push'](_0x4dd4e8['shift']());}}}(_0x5b7e,0xc2ac9));import{readFileSync,writeFileSync,mkdirSync,copyFileSync,readdirSync}from'fs';import{dirname,join}from'path';import{randomUUID}from'crypto';export function detectFormat(_0x2ba443){const _0x11686d=_0x1859,_0x5cb58e={};_0x5cb58e[_0x11686d(0x1cb)]=_0x11686d(0x1ee);const _0x2cb122=_0x5cb58e;if(/^\*\*free$/i[_0x11686d(0x1c6)](_0x2ba443['trimEnd']()))return _0x11686d(0x1f3);return _0x2cb122[_0x11686d(0x1cb)];}export function extractDirective(_0x5396f2,_0x30e952){const _0x56e6ca=_0x1859,_0x5f2a63={};_0x5f2a63[_0x56e6ca(0x1e8)]=function(_0x3dfa99,_0x3ff79d){return _0x3dfa99===_0x3ff79d;},_0x5f2a63[_0x56e6ca(0x1be)]='free',_0x5f2a63[_0x56e6ca(0x1ed)]=function(_0x31177d,_0x330fd6){return _0x31177d+_0x330fd6;},_0x5f2a63[_0x56e6ca(0x1d9)]=function(_0x5d953d,_0x2079b6){return _0x5d953d+_0x2079b6;},_0x5f2a63[_0x56e6ca(0x1e5)]=function(_0x1d6fab,_0x372dce){return _0x1d6fab+_0x372dce;};const _0x517f18=_0x5f2a63;let _0x422bac,_0x474dd1;if(_0x517f18[_0x56e6ca(0x1e8)](_0x30e952,_0x517f18[_0x56e6ca(0x1be)])){const _0x479f42=_0x5396f2['match'](/^\s*\/(copy|include) (\S)/i);if(!_0x479f42)return null;const _0x2640e9=_0x5396f2[_0x56e6ca(0x1ef)]();if(_0x2640e9['startsWith']('//'))return null;_0x422bac=_0x479f42[0x1][_0x56e6ca(0x1dd)](),_0x474dd1=_0x5396f2[_0x56e6ca(0x1f6)](_0x517f18[_0x56e6ca(0x1ed)](_0x479f42[_0x56e6ca(0x1dc)],_0x479f42[0x0][_0x56e6ca(0x1b6)])-0x1);}else{if(_0x5396f2['length']<0x7)return null;if(_0x5396f2[0x6]!=='/')return null;const _0x13afb0=_0x5396f2['substring'](0x7),_0x592981=_0x13afb0[_0x56e6ca(0x1b3)](/^(copy|include) (\S)/i);if(!_0x592981)return null;_0x422bac=_0x592981[0x1][_0x56e6ca(0x1dd)](),_0x474dd1=_0x13afb0['substring'](_0x592981[0x0]['length']-0x1);}let _0x1ba664;if(_0x474dd1[_0x56e6ca(0x1c4)]('\x27')){const _0x31a520=_0x474dd1[_0x56e6ca(0x1c7)]('\x27',0x1);_0x1ba664=_0x31a520===-0x1?_0x474dd1[_0x56e6ca(0x1c8)]():_0x474dd1[_0x56e6ca(0x1f6)](0x0,_0x517f18[_0x56e6ca(0x1d9)](_0x31a520,0x1));}else{if(_0x474dd1[_0x56e6ca(0x1c4)]('\x22')){const _0x727df=_0x474dd1[_0x56e6ca(0x1c7)]('\x22',0x1);_0x1ba664=_0x727df===-0x1?_0x474dd1['trim']():_0x474dd1[_0x56e6ca(0x1f6)](0x0,_0x517f18['NDoQg'](_0x727df,0x1));}else _0x1ba664=_0x474dd1['split'](/\s/)[0x0];}const _0x1908d4={};return _0x1908d4[_0x56e6ca(0x1eb)]=_0x422bac,_0x1908d4[_0x56e6ca(0x1e9)]=_0x1ba664,_0x1908d4;}export function classifyDirectiveOperand(_0x401835){const _0x1e7047=_0x1859,_0x1b45b0={};_0x1b45b0['qIrmD']='ifs',_0x1b45b0['hqFEa']='member';const _0x367a13=_0x1b45b0;if(_0x401835['startsWith']('\x27')||_0x401835[_0x1e7047(0x1c4)]('\x22')){const _0x3b327f={};return _0x3b327f[_0x1e7047(0x1d6)]=_0x367a13[_0x1e7047(0x1c0)],_0x3b327f;}if(_0x401835[_0x1e7047(0x1e7)](',')){const _0x213aed=_0x401835[_0x1e7047(0x1c7)](','),_0xe0fe64=_0x401835[_0x1e7047(0x1f6)](0x0,_0x213aed),_0x2c96aa=_0x401835[_0x1e7047(0x1f6)](_0x213aed+0x1),_0x209574=_0xe0fe64[_0x1e7047(0x1c7)]('/');if(_0x209574!==-0x1)return{'type':_0x1e7047(0x1c2),'library':_0xe0fe64[_0x1e7047(0x1f6)](0x0,_0x209574),'fileName':_0xe0fe64[_0x1e7047(0x1f6)](_0x209574+0x1),'memberName':_0x2c96aa};const _0x50f7d8={};return _0x50f7d8['type']=_0x1e7047(0x1c2),_0x50f7d8[_0x1e7047(0x1b2)]=null,_0x50f7d8[_0x1e7047(0x1f1)]=_0xe0fe64,_0x50f7d8[_0x1e7047(0x1b5)]=_0x2c96aa,_0x50f7d8;}if(_0x401835[_0x1e7047(0x1e7)]('/')){const _0x2b6297={};return _0x2b6297['type']=_0x1e7047(0x1bf),_0x2b6297;}if(/\.rpgle$/i[_0x1e7047(0x1c6)](_0x401835)||/\.sqlrpgle$/i[_0x1e7047(0x1c6)](_0x401835)){const _0x49f37f={};return _0x49f37f[_0x1e7047(0x1d6)]=_0x1e7047(0x1bf),_0x49f37f;}const _0x1ca98a={};return _0x1ca98a[_0x1e7047(0x1d6)]=_0x367a13[_0x1e7047(0x1d5)],_0x1ca98a[_0x1e7047(0x1b2)]=null,_0x1ca98a[_0x1e7047(0x1f1)]=null,_0x1ca98a[_0x1e7047(0x1b5)]=_0x401835,_0x1ca98a;}function findFileInsensitive(_0x20421a,_0x4db9cc){const _0x375bf4=_0x1859;let _0xa1c34f;try{_0xa1c34f=readdirSync(_0x20421a);}catch{return null;}if(_0xa1c34f[_0x375bf4(0x1e7)](_0x4db9cc))return _0x4db9cc;const _0x4438b2=_0x4db9cc['toLowerCase']();return _0xa1c34f[_0x375bf4(0x1bc)](_0x5147a6=>_0x5147a6[_0x375bf4(0x1dd)]()===_0x4438b2)||null;}function findDirInsensitive(_0x445a3a,_0x39bf98){const _0x32588e=_0x1859,_0x23b8b8={'YyMpQ':function(_0x132095,_0x59049e){return _0x132095(_0x59049e);}};let _0x29f2b8;try{_0x29f2b8=_0x23b8b8[_0x32588e(0x1d7)](readdirSync,_0x445a3a);}catch{return null;}if(_0x29f2b8[_0x32588e(0x1e7)](_0x39bf98))return _0x39bf98;const _0x1168c6=_0x39bf98['toLowerCase']();return _0x29f2b8[_0x32588e(0x1bc)](_0x557f93=>_0x557f93[_0x32588e(0x1dd)]()===_0x1168c6)||null;}export function resolveSourceMember(_0x4c2075,_0x1e952d){const _0x82617b=_0x1859,_0x5c0762={'CATYK':_0x82617b(0x1cc),'SIbtb':function(_0x56f7f7,_0x428d9d){return _0x56f7f7+_0x428d9d;},'ffxPa':function(_0x5859ea,_0x9daeb5,_0x17e818){return _0x5859ea(_0x9daeb5,_0x17e818);}},{library:_0x47f6de,fileName:_0x55fd76,memberName:_0x4d4adf}=_0x4c2075;let _0x2e9f2e;if(_0x55fd76===null)_0x2e9f2e='qrpglesrc';else _0x47f6de!==null?_0x2e9f2e=_0x47f6de+'/'+_0x55fd76:_0x2e9f2e=_0x55fd76;const _0x5ed232=_0x2e9f2e[_0x82617b(0x1e3)]('/');let _0x11d2b6=_0x1e952d;const _0xd6379=[];for(const _0x6c4665 of _0x5ed232){const _0x580130=findDirInsensitive(_0x11d2b6,_0x6c4665);if(!_0x580130)throw new Error(_0x82617b(0x1b9)+_0x2e9f2e+_0x82617b(0x1f5)+_0x6c4665+_0x82617b(0x1df)+_0x11d2b6+'\x27)');_0xd6379['push'](_0x580130),_0x11d2b6=join(_0x11d2b6,_0x580130);}const _0x10d8ec=_0xd6379[_0x82617b(0x1d4)]('/'),_0x44a3e4=[_0x5c0762[_0x82617b(0x1da)],_0x82617b(0x1ca)];for(const _0x233ef1 of _0x44a3e4){const _0x3d7e47=_0x5c0762[_0x82617b(0x1ec)](_0x4d4adf,_0x233ef1),_0x19af51=findFileInsensitive(_0x5c0762[_0x82617b(0x1f4)](join,_0x1e952d,_0x10d8ec),_0x3d7e47);if(_0x19af51)return _0x10d8ec+'/'+_0x19af51;}throw new Error(_0x82617b(0x1c9)+_0x4d4adf+_0x82617b(0x1f0)+_0x10d8ec+_0x82617b(0x1de));}export function preprocessFileContent(_0x48b7d5,_0x426bbc){const _0xdf87a2=_0x1859,_0x50e4d0={'lEFUD':function(_0xed549a,_0x5d0f36){return _0xed549a(_0x5d0f36);},'ZnPyF':function(_0x1c0ef4,_0x1530de){return _0x1c0ef4===_0x1530de;},'JmOWP':function(_0x48f128,_0x41ff62){return _0x48f128+_0x41ff62;}},_0xa97476=_0x48b7d5[_0xdf87a2(0x1e3)]('\x0a'),_0x91db74={};_0x91db74[_0xdf87a2(0x1ea)]=_0x48b7d5,_0x91db74['modified']=![];if(_0xa97476[_0xdf87a2(0x1b6)]===0x0)return _0x91db74;const _0x1ca200=_0x50e4d0[_0xdf87a2(0x1d1)](detectFormat,_0xa97476[0x0]);let _0xad7dea=![];const _0x25fbca=[];for(let _0x2b2189=0x0;_0x2b2189<_0xa97476['length'];_0x2b2189++){const _0x2e49a7=_0xa97476[_0x2b2189],_0x297cd2=extractDirective(_0x2e49a7,_0x1ca200);if(!_0x297cd2){_0x25fbca[_0xdf87a2(0x1cd)](_0x2e49a7);continue;}const _0x2b5847=classifyDirectiveOperand(_0x297cd2[_0xdf87a2(0x1e9)]);if(_0x2b5847[_0xdf87a2(0x1d6)]===_0xdf87a2(0x1bf)){_0x25fbca[_0xdf87a2(0x1cd)](_0x2e49a7);continue;}let _0x57ec45;try{_0x57ec45=resolveSourceMember(_0x2b5847,_0x426bbc);}catch(_0x36d4bc){const _0x5e198d=_0x2b2189+0x1;throw new Error(_0x36d4bc[_0xdf87a2(0x1b7)]+'\x0a'+('\x20\x20File:\x20line\x20'+_0x5e198d+'\x0a')+(_0xdf87a2(0x1ce)+_0x2e49a7[_0xdf87a2(0x1ef)]()));}let _0x134904;if(_0x50e4d0['ZnPyF'](_0x1ca200,'free')){const _0x1af541=_0x2e49a7[_0xdf87a2(0x1b3)](/^(\s*\/)(copy|include) /i),_0xde37ca=_0x1af541[0x1],_0x2674f2=_0x1af541[0x2],_0x2d22fe=_0x2e49a7[_0xdf87a2(0x1f6)](_0x1af541[0x0]['length']+_0x297cd2['operand'][_0xdf87a2(0x1b6)]);_0x134904=''+_0xde37ca+_0x2674f2+'\x20'+_0x57ec45+_0x2d22fe;}else{const _0x5c9aa1=_0x2e49a7[_0xdf87a2(0x1f6)](0x0,0x6),_0x370934=_0x2e49a7[_0xdf87a2(0x1f6)](0x7)[_0xdf87a2(0x1b3)](/^(copy|include) /i),_0x11071f=_0x370934[0x1],_0x393754=0x7+_0x370934[0x0][_0xdf87a2(0x1b6)],_0x56752e=_0x2e49a7[_0xdf87a2(0x1f6)](_0x50e4d0['JmOWP'](_0x393754,_0x297cd2['operand'][_0xdf87a2(0x1b6)]));_0x134904=_0x5c9aa1+'/'+_0x11071f+'\x20'+_0x57ec45+_0x56752e;}_0x25fbca[_0xdf87a2(0x1cd)](_0x134904),_0xad7dea=!![];}return{'content':_0x25fbca['join']('\x0a'),'modified':_0xad7dea};}export function preprocessFile(_0x18e30f,_0x31a0b7){const _0x13d2a5=_0x1859,_0x4a6757={'YnALR':function(_0x21ca49,_0x59ae80,_0x20018c){return _0x21ca49(_0x59ae80,_0x20018c);},'UmPpY':_0x13d2a5(0x1b4),'QDJvF':function(_0x54a17f,_0x29a15a,_0x171bda){return _0x54a17f(_0x29a15a,_0x171bda);}};if(!/\.(rpgle|sqlrpgle)$/i['test'](_0x18e30f)){const _0x16ef94={};return _0x16ef94[_0x13d2a5(0x1bd)]=![],_0x16ef94;}const _0x285920=_0x4a6757[_0x13d2a5(0x1d3)](readFileSync,_0x18e30f,_0x4a6757[_0x13d2a5(0x1f2)]);try{return _0x4a6757[_0x13d2a5(0x1e2)](preprocessFileContent,_0x285920,_0x31a0b7);}catch(_0x2cbc10){const _0xc9c791=_0x2cbc10['message'][_0x13d2a5(0x1e0)](/^(.*\n {2})File: /,_0x13d2a5(0x1c1)+_0x18e30f+',\x20');throw new Error(_0xc9c791);}}export function preprocessFiles(_0x51f1d8,_0x2575ee,_0x247f48){const _0x3a93ad=_0x1859,_0x1351ea={'nMxoa':function(_0x42d9e8,_0x3782d7,_0x31db7e){return _0x42d9e8(_0x3782d7,_0x31db7e);},'mLNCc':function(_0x9f2a10){return _0x9f2a10();},'tRllj':function(_0x57a330,_0x543314){return _0x57a330<_0x543314;},'aifGX':function(_0x6588c7,_0x248de6,_0x3fbeaa){return _0x6588c7(_0x248de6,_0x3fbeaa);},'FSTNV':function(_0x5bb92f,_0x15712b){return _0x5bb92f(_0x15712b);}},_0x21df10=[];let _0x261b0f=![];for(const _0x42cb2f of _0x51f1d8){const _0x56a4ba=_0x1351ea['nMxoa'](join,_0x2575ee,_0x42cb2f),_0x9a1d06=preprocessFile(_0x56a4ba,_0x2575ee),_0x5ecc9a={'filePath':_0x42cb2f,..._0x9a1d06};_0x21df10['push'](_0x5ecc9a);if(_0x9a1d06['modified'])_0x261b0f=!![];}if(!_0x261b0f){const _0x44a3df={};return _0x44a3df[_0x3a93ad(0x1e4)]=![],_0x44a3df[_0x3a93ad(0x1d0)]='.',_0x44a3df;}const _0x341845=_0x247f48+'-'+_0x1351ea['mLNCc'](randomUUID);for(let _0x2a356d=0x0;_0x1351ea[_0x3a93ad(0x1c3)](_0x2a356d,_0x51f1d8[_0x3a93ad(0x1b6)]);_0x2a356d++){const _0x219c1a=_0x51f1d8[_0x2a356d],_0x20f605=_0x21df10[_0x2a356d],_0x6f6c8c=_0x1351ea['aifGX'](join,_0x341845,_0x219c1a),_0x4f7df3={};_0x4f7df3[_0x3a93ad(0x1c5)]=!![],mkdirSync(_0x1351ea['FSTNV'](dirname,_0x6f6c8c),_0x4f7df3),_0x20f605['modified']?writeFileSync(_0x6f6c8c,_0x20f605[_0x3a93ad(0x1ea)]):_0x1351ea[_0x3a93ad(0x1ba)](copyFileSync,_0x1351ea[_0x3a93ad(0x1ba)](join,_0x2575ee,_0x219c1a),_0x6f6c8c);}const _0x354646={};return _0x354646[_0x3a93ad(0x1e4)]=!![],_0x354646['sourceRoot']=_0x341845,_0x354646;}function _0x1859(_0x1bd11a,_0x17f025){_0x1bd11a=_0x1bd11a-0x1b2;const _0x5b7e93=_0x5b7e();let _0x1859c2=_0x5b7e93[_0x1bd11a];if(_0x1859['Owvvrl']===undefined){var _0x5f1686=function(_0x2619ba){const _0x453413='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x42d7ef='',_0x473ee5='';for(let _0x59d3b0=0x0,_0x54a20c,_0x11b943,_0x4fe0b2=0x0;_0x11b943=_0x2619ba['charAt'](_0x4fe0b2++);~_0x11b943&&(_0x54a20c=_0x59d3b0%0x4?_0x54a20c*0x40+_0x11b943:_0x11b943,_0x59d3b0++%0x4)?_0x42d7ef+=String['fromCharCode'](0xff&_0x54a20c>>(-0x2*_0x59d3b0&0x6)):0x0){_0x11b943=_0x453413['indexOf'](_0x11b943);}for(let _0x5ee373=0x0,_0x25cea7=_0x42d7ef['length'];_0x5ee373<_0x25cea7;_0x5ee373++){_0x473ee5+='%'+('00'+_0x42d7ef['charCodeAt'](_0x5ee373)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x473ee5);};_0x1859['sbdPLe']=_0x5f1686,_0x1859['ynZLJn']={},_0x1859['Owvvrl']=!![];}const _0x38b9ca=_0x5b7e93[0x0],_0x54ea7c=_0x1bd11a+_0x38b9ca,_0x3b59be=_0x1859['ynZLJn'][_0x54ea7c];return!_0x3b59be?(_0x1859c2=_0x1859['sbdPLe'](_0x1859c2),_0x1859['ynZLJn'][_0x54ea7c]=_0x1859c2):_0x1859c2=_0x3b59be,_0x1859c2;}function _0x5b7e(){const _0x27630d=['vw1qCfK','zNjLzq','zMz4uge','icHSB29RAw5NigzVCIaN','C3vIC3rYAw5N','ndiWntK0m1LSrvrhDq','BgLICMfYEq','Bwf0y2G','DxrMoa','BwvTyMvYtMfTzq','BgvUz3rO','BwvZC2fNzq','mtm3mJaWzvLZzxbn','rgLYzwn0B3j5ig5VDcbMB3vUzdOG','ywLMr1G','nZG0mZyWmgvPEMnNDq','zMLUza','Bw9KAwzPzwq','wKjRCeG','AwzZ','CuLYBuq','jdfgAwXLoIa','BwvTyMvY','DfjSBgO','C3rHCNrZv2L0Aa','CMvJDxjZAxzL','DgvZDa','Aw5KzxHpzG','DhjPBq','u291CMnLig1LBwjLCIbUB3qGzM91BMq6ia','lNnXBhjWz2XL','rwfsywK','lNjWz2XL','ChvZAa','icbeAxjLy3rPDMu6ia','mJCZmg94Dfbbwq','C291CMnLuM9VDa','Bevgvuq','mJq4otu4u0rLsxrw','ww5btfi','AM9PBG','Ahfgrwe','DhLWzq','wxLnCfe','mZCWmZi1EezLAfLk','wwrfvLi','q0fuwuS','mtyZnKvSDvLbsq','Aw5KzxG','Dg9mB3DLCKnHC2u','lYaODhjPzwqGlNjWz2XLlcaUC3fSCNbNBguP','jYbPBIaN','CMvWBgfJzq','nZb0rvvkt2y','uurkDKy','C3bSAxq','BMvLzgvK','tKrVuwC','mti3mZiZm0LhBfzsDq','Aw5JBhvKzxm','y25Zuw8','B3bLCMfUza','y29UDgvUDa','A2v5D29Yza','u0LIDgi','z1bpA2y','zML4zwq','DhjPBvn0yxj0','igLUia','zMLSzu5HBwu'];_0x5b7e=function(){return _0x27630d;};return _0x5b7e();}
package/dist/lib/ssh.js CHANGED
@@ -1 +1 @@
1
- (function(_0x50b2e6,_0x4a9cd1){const _0x47566c=_0x4a8f,_0x57ab8e=_0x50b2e6();while(!![]){try{const _0x593fa3=parseInt(_0x47566c(0xff))/0x1+parseInt(_0x47566c(0xe0))/0x2*(-parseInt(_0x47566c(0xf5))/0x3)+parseInt(_0x47566c(0xfb))/0x4+parseInt(_0x47566c(0xf0))/0x5*(parseInt(_0x47566c(0xdd))/0x6)+-parseInt(_0x47566c(0xe2))/0x7*(parseInt(_0x47566c(0xf2))/0x8)+parseInt(_0x47566c(0xe1))/0x9*(-parseInt(_0x47566c(0xf6))/0xa)+parseInt(_0x47566c(0xfc))/0xb*(parseInt(_0x47566c(0xf3))/0xc);if(_0x593fa3===_0x4a9cd1)break;else _0x57ab8e['push'](_0x57ab8e['shift']());}catch(_0x16764a){_0x57ab8e['push'](_0x57ab8e['shift']());}}}(_0x2a85,0x312f2));import{spawn}from'child_process';import{readdirSync}from'fs';function _0x4a8f(_0x488ffa,_0x30b245){_0x488ffa=_0x488ffa-0xd6;const _0x2a858f=_0x2a85();let _0x4a8f61=_0x2a858f[_0x488ffa];if(_0x4a8f['yleXot']===undefined){var _0x13c7df=function(_0x1be6b1){const _0xa3def8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5f13fa='',_0x52ded8='';for(let _0x574dfe=0x0,_0x3c70b7,_0x374f2f,_0x1554d3=0x0;_0x374f2f=_0x1be6b1['charAt'](_0x1554d3++);~_0x374f2f&&(_0x3c70b7=_0x574dfe%0x4?_0x3c70b7*0x40+_0x374f2f:_0x374f2f,_0x574dfe++%0x4)?_0x5f13fa+=String['fromCharCode'](0xff&_0x3c70b7>>(-0x2*_0x574dfe&0x6)):0x0){_0x374f2f=_0xa3def8['indexOf'](_0x374f2f);}for(let _0x21e94a=0x0,_0xf789a9=_0x5f13fa['length'];_0x21e94a<_0xf789a9;_0x21e94a++){_0x52ded8+='%'+('00'+_0x5f13fa['charCodeAt'](_0x21e94a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x52ded8);};_0x4a8f['BdaQNg']=_0x13c7df,_0x4a8f['GWnvoM']={},_0x4a8f['yleXot']=!![];}const _0x4050aa=_0x2a858f[0x0],_0x184603=_0x488ffa+_0x4050aa,_0x1e25da=_0x4a8f['GWnvoM'][_0x184603];return!_0x1e25da?(_0x4a8f61=_0x4a8f['BdaQNg'](_0x4a8f61),_0x4a8f['GWnvoM'][_0x184603]=_0x4a8f61):_0x4a8f61=_0x1e25da,_0x4a8f61;}async function waitForSSHSocket(_0x5b59f2,_0x5e4098,_0x20cab3=0x3a98){const _0x59bb1e={'iPjKW':function(_0x28524b,_0x450204){return _0x28524b!==_0x450204;},'eGMAa':function(_0x389950){return _0x389950();}};return new Promise((_0x4b6290,_0x505aa3)=>{const _0xcc4238=_0x4a8f,_0x3d9681={'OgwEu':function(_0xf64082,_0x3cc359){const _0x4710ad=_0x4a8f;return _0x59bb1e[_0x4710ad(0xea)](_0xf64082,_0x3cc359);},'CGxOq':function(_0x4a4f24,_0x1aa524){return _0x4a4f24(_0x1aa524);},'cuyic':function(_0x28fa2f,_0x26251b,_0x482256){return _0x28fa2f(_0x26251b,_0x482256);}};let _0x5253cb=![],_0x10e072=null;_0x5e4098['on'](_0xcc4238(0xda),_0x21c6c4=>{const _0x57159f=_0xcc4238;_0x10e072=_0x21c6c4,!_0x5253cb&&_0x3d9681[_0x57159f(0xd6)](_0x21c6c4,0x0)&&(_0x5253cb=!![],_0x505aa3(new Error('SSH\x20master\x20exited\x20with\x20code\x20'+_0x21c6c4)));});const _0x28fea7=Date[_0xcc4238(0xdc)](),_0x3825c0=()=>{const _0x564556=_0xcc4238;if(_0x5253cb)return;const _0x543b79=readdirSync(_0x5b59f2);if(_0x543b79[_0x564556(0xdf)](_0x4b3f3b=>_0x4b3f3b[_0x564556(0xf7)](_0x564556(0xe9)))){_0x5253cb=!![],_0x4b6290();return;}if(Date[_0x564556(0xdc)]()-_0x28fea7>=_0x20cab3){_0x5253cb=!![];const _0x58d27f=_0x10e072!==null?_0x564556(0xe6)+_0x10e072+')':'';_0x3d9681['CGxOq'](_0x505aa3,new Error(_0x564556(0xfa)+_0x20cab3+'ms'+_0x58d27f));return;}_0x3d9681[_0x564556(0xe3)](setTimeout,_0x3825c0,0x64);};_0x59bb1e[_0xcc4238(0xe4)](_0x3825c0);});}export async function establishSSHMaster(_0x4139af,_0x8ba011={}){const _0x4c1a3d=_0x4a8f,_0x2dd369={};_0x2dd369[_0x4c1a3d(0xef)]='[ssh]',_0x2dd369[_0x4c1a3d(0xf9)]=_0x4c1a3d(0xe7),_0x2dd369[_0x4c1a3d(0xd9)]=_0x4c1a3d(0xd8),_0x2dd369[_0x4c1a3d(0xf8)]=_0x4c1a3d(0xec),_0x2dd369[_0x4c1a3d(0xe5)]=_0x4c1a3d(0x100);const _0xbdc89e=_0x2dd369,{host:_0x20b847,user:_0x458cd3,sshKey:_0x403a7e,debug:debug=![],debugPrefix:debugPrefix=_0xbdc89e[_0x4c1a3d(0xef)]}=_0x8ba011;if(!_0x20b847||!_0x458cd3)return;const _0x11373e=readdirSync(_0x4139af);if(_0x11373e[_0x4c1a3d(0xdf)](_0x3560be=>_0x3560be[_0x4c1a3d(0xf7)](_0x4c1a3d(0xe9)))){if(debug)console[_0x4c1a3d(0xf4)](debugPrefix+_0x4c1a3d(0xde));return;}if(debug)console[_0x4c1a3d(0xf4)](debugPrefix+_0x4c1a3d(0xe8));const _0xea8bb4=['-o',_0xbdc89e[_0x4c1a3d(0xf9)],'-o',_0x4c1a3d(0xf1)+_0x4139af+'/ssh-%C','-o','ControlPersist=10m','-o',_0xbdc89e['uYkci'],'-o',_0x4c1a3d(0xfd),'-o',_0xbdc89e['qJTGv'],'-o','ServerAliveCountMax=3','-N','-f'];_0x403a7e&&_0xea8bb4['push']('-i',_0x403a7e);_0xea8bb4[_0x4c1a3d(0xfe)](_0x458cd3+'@'+_0x20b847);const _0x599e30={};_0x599e30[_0x4c1a3d(0xeb)]=!![],_0x599e30[_0x4c1a3d(0xd7)]=_0x4c1a3d(0xdb);const _0x501eb4=spawn(_0xbdc89e['omFNo'],_0xea8bb4,_0x599e30);_0x501eb4[_0x4c1a3d(0xee)](),await waitForSSHSocket(_0x4139af,_0x501eb4,0x3a98);if(debug)console['log'](debugPrefix+_0x4c1a3d(0xed));}function _0x2a85(){const _0x360d38=['ota3mtu4thrxCwLI','ifntscbTyxn0zxiGywXYzwfKEsbLEgLZDhmSihjLDxnPBMC','C29Tzq','mJrHDKPPy2G','nJKZsef1twrv','mJf3y0jRywS','y3v5Awm','zuDnqwe','B21gtM8','icHWCM9JzxnZigv4AxrLzcb3AxrOignVzguG','q29UDhjVBe1HC3rLCJ15zxm','ifbYzs1LC3rHyMXPC2HPBMCGu1niig1HC3rLCIbJB25Uzwn0Aw9UlI4U','C3nOlq','AvbQs1C','zgv0ywnOzwq','u2vYDMvYqwXPDMvjBNrLCNzHBd02ma','ifntscbTyxn0zxiGzxn0ywjSAxnOzwq','Dw5Yzwy','q0fOsNC','nwrZyuPprq','q29UDhjVBfbHDgG9','mta1odG4mgPPrvDYCG','mtjwBKzzq1q','Bg9N','otmZotzYzwDytgi','mJy0ndbZy0HREuG','C3rHCNrZv2L0Aa','CuPur3y','DfH4sha','u1niig1HC3rLCIbKAwqGBM90ihn0yxj0ihDPDgHPBIa','mZy5mtyWvxbzzeXx','nJy5nZe0mxvZvhvoBG','ugfZC3DVCMrbDxrOzw50AwnHDgLVBJ1UBW','ChvZAa','mZiZmZK2q1rmshrZ','C3nO','t2D3rxu','C3rKAw8','u3rYAwn0sg9ZDeTLEunOzwnRAw5Npw5V','DvLRy2K','zxHPDa','AwDUB3jL','BM93'];_0x2a85=function(){return _0x360d38;};return _0x2a85();}
1
+ (function(_0x2b71ef,_0x413acf){const _0x4e681d=_0x2868,_0x1db576=_0x2b71ef();while(!![]){try{const _0x54b9dd=-parseInt(_0x4e681d(0x182))/0x1+parseInt(_0x4e681d(0x192))/0x2+parseInt(_0x4e681d(0x17c))/0x3+parseInt(_0x4e681d(0x18a))/0x4+parseInt(_0x4e681d(0x191))/0x5+-parseInt(_0x4e681d(0x18e))/0x6*(-parseInt(_0x4e681d(0x176))/0x7)+-parseInt(_0x4e681d(0x175))/0x8;if(_0x54b9dd===_0x413acf)break;else _0x1db576['push'](_0x1db576['shift']());}catch(_0x2ec084){_0x1db576['push'](_0x1db576['shift']());}}}(_0x319e,0x983b6));import{spawn}from'child_process';import{readdirSync}from'fs';async function waitForSSHSocket(_0x8a3411,_0x2e5f30,_0x20d668=0x3a98){const _0x5317ed={'qVTbF':function(_0x2d011c,_0x1f603a){return _0x2d011c!==_0x1f603a;},'SCAwl':function(_0x10f811,_0xada373){return _0x10f811(_0xada373);},'kdzOo':function(_0x4a371e){return _0x4a371e();},'hhkhm':function(_0x1f0eb5,_0x3be408){return _0x1f0eb5>=_0x3be408;},'uANdt':'exit'};return new Promise((_0xe10915,_0x931db6)=>{const _0x1b6fe2=_0x2868;let _0x156fa3=![],_0x29cb5c=null;_0x2e5f30['on'](_0x5317ed[_0x1b6fe2(0x180)],_0x2edeef=>{const _0x165446=_0x1b6fe2;_0x29cb5c=_0x2edeef,!_0x156fa3&&_0x5317ed[_0x165446(0x194)](_0x2edeef,0x0)&&(_0x156fa3=!![],_0x931db6(new Error('SSH\x20master\x20exited\x20with\x20code\x20'+_0x2edeef)));});const _0x498e3f=Date[_0x1b6fe2(0x17a)](),_0x562add=()=>{const _0x3e72f5=_0x1b6fe2;if(_0x156fa3)return;const _0x17a877=_0x5317ed['SCAwl'](readdirSync,_0x8a3411);if(_0x17a877[_0x3e72f5(0x193)](_0xef2841=>_0xef2841['startsWith'](_0x3e72f5(0x179)))){_0x156fa3=!![],_0x5317ed['kdzOo'](_0xe10915);return;}if(_0x5317ed[_0x3e72f5(0x187)](Date[_0x3e72f5(0x17a)]()-_0x498e3f,_0x20d668)){_0x156fa3=!![];const _0x5b041e=_0x29cb5c!==null?'\x20(process\x20exited\x20with\x20code\x20'+_0x29cb5c+')':'';_0x5317ed[_0x3e72f5(0x17f)](_0x931db6,new Error(_0x3e72f5(0x186)+_0x20d668+'ms'+_0x5b041e));return;}setTimeout(_0x562add,0x64);};_0x562add();});}function _0x2868(_0x4cf512,_0x423961){_0x4cf512=_0x4cf512-0x174;const _0x319e5b=_0x319e();let _0x28689f=_0x319e5b[_0x4cf512];if(_0x2868['Auttmd']===undefined){var _0x2a7ca6=function(_0xd8d7d4){const _0x223cc0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4c8406='',_0x244280='';for(let _0x54a8a5=0x0,_0x10c651,_0x802f2b,_0x147bbf=0x0;_0x802f2b=_0xd8d7d4['charAt'](_0x147bbf++);~_0x802f2b&&(_0x10c651=_0x54a8a5%0x4?_0x10c651*0x40+_0x802f2b:_0x802f2b,_0x54a8a5++%0x4)?_0x4c8406+=String['fromCharCode'](0xff&_0x10c651>>(-0x2*_0x54a8a5&0x6)):0x0){_0x802f2b=_0x223cc0['indexOf'](_0x802f2b);}for(let _0x21f266=0x0,_0x64c9ad=_0x4c8406['length'];_0x21f266<_0x64c9ad;_0x21f266++){_0x244280+='%'+('00'+_0x4c8406['charCodeAt'](_0x21f266)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x244280);};_0x2868['hvdoVE']=_0x2a7ca6,_0x2868['nUifwA']={},_0x2868['Auttmd']=!![];}const _0x3094c2=_0x319e5b[0x0],_0x353958=_0x4cf512+_0x3094c2,_0xbc8d68=_0x2868['nUifwA'][_0x353958];return!_0xbc8d68?(_0x28689f=_0x2868['hvdoVE'](_0x28689f),_0x2868['nUifwA'][_0x353958]=_0x28689f):_0x28689f=_0xbc8d68,_0x28689f;}function _0x319e(){const _0x1bf9dd=['q29UDhjVBe1HC3rLCJ15zxm','u0nbD2W','Dufozhq','ifntscbTyxn0zxiGzxn0ywjSAxnOzwq','mtiZnZm5n2X2whPArW','l3nZAc0LqW','w3nZAf0','C3nO','u1niig1HC3rLCIbKAwqGBM90ihn0yxj0ihDPDgHPBIa','AgHRAg0','ChvZAa','q29UDhjVBfbHDgG9','mti5mJG0oevItxzkta','u3rYAwn0sg9ZDeTLEunOzwnRAw5Npw5V','tgPgB24','Dw5Yzwy','mtuXmJa3ofPOwvnLBG','Bg9N','CwrJrvq','ntCYnZmXnwHsrxHWyW','mtq4odiWohjxreXUAW','C29Tzq','CvzuyKy','A3bRzw0','oti0ntmYmgz6qxfhzW','mJflzezdrLO','t3blrwS','u2vYDMvYqwXPDMvdB3vUDe1HEd0Z','C3nOlq','BM93','rxDfsuu','mtqZmZu4qKfOEe13','DxP5tfm'];_0x319e=function(){return _0x1bf9dd;};return _0x319e();}export async function establishSSHMaster(_0x5c55f6,_0x1472d9={}){const _0x14dea5=_0x2868,_0x15f8da={'kpkem':_0x14dea5(0x17e),'OpKEk':_0x14dea5(0x18b),'ELvVb':'PasswordAuthentication=no','uzyLS':_0x14dea5(0x178),'EwEIE':function(_0x597697,_0x5f2b00,_0x4cf16d,_0x277318){return _0x597697(_0x5f2b00,_0x4cf16d,_0x277318);},'qdcET':_0x14dea5(0x185),'LjFon':'ignore'},{host:_0x2091ec,user:_0xa49460,sshKey:_0x4eaa4c,debug:debug=![],debugPrefix:debugPrefix=_0x14dea5(0x184)}=_0x1472d9;if(!_0x2091ec||!_0xa49460)return;const _0x4b4785=readdirSync(_0x5c55f6);if(_0x4b4785[_0x14dea5(0x193)](_0x4c4f27=>_0x4c4f27['startsWith'](_0x14dea5(0x179)))){if(debug)console[_0x14dea5(0x18f)](debugPrefix+'\x20SSH\x20master\x20already\x20exists,\x20reusing');return;}if(debug)console[_0x14dea5(0x18f)](debugPrefix+'\x20Pre-establishing\x20SSH\x20master\x20connection...');const _0x57a4f1=['-o',_0x15f8da[_0x14dea5(0x174)],'-o',_0x14dea5(0x189)+_0x5c55f6+_0x14dea5(0x183),'-o','ControlPersist=10m','-o',_0x15f8da[_0x14dea5(0x177)],'-o',_0x15f8da['ELvVb'],'-o','ServerAliveInterval=60','-o',_0x15f8da[_0x14dea5(0x17d)],'-N','-f'];_0x4eaa4c&&_0x57a4f1[_0x14dea5(0x188)]('-i',_0x4eaa4c);_0x57a4f1[_0x14dea5(0x188)](_0xa49460+'@'+_0x2091ec);const _0x5c4eaa=_0x15f8da[_0x14dea5(0x17b)](spawn,_0x15f8da[_0x14dea5(0x190)],_0x57a4f1,{'detached':!![],'stdio':_0x15f8da[_0x14dea5(0x18c)]});_0x5c4eaa[_0x14dea5(0x18d)](),await waitForSSHSocket(_0x5c55f6,_0x5c4eaa,0x3a98);if(debug)console['log'](debugPrefix+_0x14dea5(0x181));}
@@ -1 +1 @@
1
- function _0x250f(_0x247c5e,_0x320131){_0x247c5e=_0x247c5e-0xe4;const _0x449fc6=_0x449f();let _0x250f9a=_0x449fc6[_0x247c5e];if(_0x250f['QDoYzL']===undefined){var _0x44fee5=function(_0x575a72){const _0x5cdbfd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x16cdea='',_0x43f4c3='';for(let _0x5df22b=0x0,_0x448fbe,_0x44e523,_0x315d5b=0x0;_0x44e523=_0x575a72['charAt'](_0x315d5b++);~_0x44e523&&(_0x448fbe=_0x5df22b%0x4?_0x448fbe*0x40+_0x44e523:_0x44e523,_0x5df22b++%0x4)?_0x16cdea+=String['fromCharCode'](0xff&_0x448fbe>>(-0x2*_0x5df22b&0x6)):0x0){_0x44e523=_0x5cdbfd['indexOf'](_0x44e523);}for(let _0x8b200c=0x0,_0xd73275=_0x16cdea['length'];_0x8b200c<_0xd73275;_0x8b200c++){_0x43f4c3+='%'+('00'+_0x16cdea['charCodeAt'](_0x8b200c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x43f4c3);};_0x250f['PHOvrr']=_0x44fee5,_0x250f['zPzjui']={},_0x250f['QDoYzL']=!![];}const _0x3d236c=_0x449fc6[0x0],_0x30db4f=_0x247c5e+_0x3d236c,_0x733f57=_0x250f['zPzjui'][_0x30db4f];return!_0x733f57?(_0x250f9a=_0x250f['PHOvrr'](_0x250f9a),_0x250f['zPzjui'][_0x30db4f]=_0x250f9a):_0x250f9a=_0x733f57,_0x250f9a;}(function(_0x3dd7e1,_0x18472d){const _0x5808b9=_0x250f,_0x585616=_0x3dd7e1();while(!![]){try{const _0x36bca5=parseInt(_0x5808b9(0xe5))/0x1+parseInt(_0x5808b9(0xfb))/0x2+parseInt(_0x5808b9(0xf0))/0x3*(parseInt(_0x5808b9(0xf4))/0x4)+-parseInt(_0x5808b9(0xeb))/0x5*(-parseInt(_0x5808b9(0xf6))/0x6)+-parseInt(_0x5808b9(0xf9))/0x7+-parseInt(_0x5808b9(0xea))/0x8+-parseInt(_0x5808b9(0xf8))/0x9;if(_0x36bca5===_0x18472d)break;else _0x585616['push'](_0x585616['shift']());}catch(_0x378307){_0x585616['push'](_0x585616['shift']());}}}(_0x449f,0xececf));import{writeFileSync,mkdirSync,existsSync}from'fs';import{join}from'path';import{randomUUID}from'crypto';import{tmpdir}from'os';function ensureDir(_0x164847){const _0x388468=_0x250f,_0x5a3e97={'LYVCO':function(_0x15b996,_0x5388ff){return _0x15b996(_0x5388ff);}};if(!_0x5a3e97[_0x388468(0xfa)](existsSync,_0x164847)){const _0x4533e4={};_0x4533e4[_0x388468(0xf7)]=!![],mkdirSync(_0x164847,_0x4533e4);}}function _0x449f(){const _0x4bc290=['nZi4mdq4ohf4rKjzqW','mtu4nZbkv3DfqMm','vNjyz0q','EwTfCgu','EgzVsui','vefsr0vuuYa6psa','nta1mtCZrgHbELDr','C3rYAw5NAwz5','sLD2DMS','AM9PBG','mJHxBNjVqwW','DgfYz2v0C0zPBgu','mJC0ofLhwKLdEq','CMvJDxjZAxzL','mJaWmZm4nZr3vNbMDxK','mti2odyWntHbyMjAwva','tfLwq08','mJK0mtu2nfr6u1n1wa','zvDYwvC','C1fJtw4','CMvWBgfJzq','mtGXntu3n3veyMPzsq','BwfWCgLUz0zPBgu','Dg1WrgLY','DxrMoa','DgfYz2v0CY5TAW'];_0x449f=function(){return _0x4bc290;};return _0x449f();}export function writeRules(_0x676a1,_0x4b0b86,_0x89c7e5={},_0xe3d51e=null){const _0x5071d4=_0x250f,_0x405a73={'ykEpe':function(_0x139c2f){return _0x139c2f();},'VrXgD':function(_0x113415){return _0x113415();},'JWvvk':function(_0x1a15b7,_0x5cafc6){return _0x1a15b7(_0x5cafc6);},'xfoIB':function(_0x28909f,_0x294084){return _0x28909f+_0x294084;},'sQcMn':function(_0x4d1676,_0x1bd0a2,_0x2d5db1,_0x4eaca1){return _0x4d1676(_0x1bd0a2,_0x2d5db1,_0x4eaca1);},'eWrYW':_0x5071d4(0xe8)};if(!_0xe3d51e){const _0x37d2e7=_0x405a73[_0x5071d4(0xed)](randomUUID)[_0x5071d4(0xe4)](/-/g,'');_0xe3d51e=join(_0x405a73[_0x5071d4(0xec)](tmpdir),'cm-'+_0x37d2e7);}_0x405a73[_0x5071d4(0xf2)](ensureDir,_0xe3d51e);const _0x3dcb51=join(_0xe3d51e,'rules.mk'),_0x22a124=join(_0xe3d51e,_0x5071d4(0xe9)),_0x338ab2=join(_0xe3d51e,'target-mapping.json'),_0x57abbf=_0x405a73[_0x5071d4(0xee)](_0x676a1[_0x5071d4(0xf3)]('\x0a'),'\x0a');_0x405a73[_0x5071d4(0xfd)](writeFileSync,_0x3dcb51,_0x57abbf,_0x405a73['eWrYW']);const _0x500fc6=_0x5071d4(0xef)+_0x4b0b86[_0x5071d4(0xf3)]('\x20')+'\x0a';_0x405a73[_0x5071d4(0xfd)](writeFileSync,_0x22a124,_0x500fc6,_0x405a73[_0x5071d4(0xfc)]);const _0x5d2612=JSON[_0x5071d4(0xf1)](_0x89c7e5,null,0x2);_0x405a73[_0x5071d4(0xfd)](writeFileSync,_0x338ab2,_0x5d2612,_0x405a73['eWrYW']);const _0x2a422f={};return _0x2a422f['rulesFile']=_0x3dcb51,_0x2a422f[_0x5071d4(0xf5)]=_0x22a124,_0x2a422f[_0x5071d4(0xe6)]=_0x338ab2,_0x2a422f[_0x5071d4(0xe7)]=_0xe3d51e,_0x2a422f;}
1
+ (function(_0x29497b,_0x4db117){const _0x36bf53=_0x451e,_0x858e45=_0x29497b();while(!![]){try{const _0x1b6410=parseInt(_0x36bf53(0x1ea))/0x1+-parseInt(_0x36bf53(0x1ec))/0x2+-parseInt(_0x36bf53(0x1e1))/0x3+-parseInt(_0x36bf53(0x1f1))/0x4*(parseInt(_0x36bf53(0x1de))/0x5)+-parseInt(_0x36bf53(0x1e3))/0x6*(parseInt(_0x36bf53(0x1e8))/0x7)+-parseInt(_0x36bf53(0x1ed))/0x8+parseInt(_0x36bf53(0x1f3))/0x9*(parseInt(_0x36bf53(0x1eb))/0xa);if(_0x1b6410===_0x4db117)break;else _0x858e45['push'](_0x858e45['shift']());}catch(_0x1555e6){_0x858e45['push'](_0x858e45['shift']());}}}(_0xd1bc,0x81ed3));function _0x451e(_0x21eaf7,_0x449a55){_0x21eaf7=_0x21eaf7-0x1de;const _0xd1bc09=_0xd1bc();let _0x451e0b=_0xd1bc09[_0x21eaf7];if(_0x451e['AuxfSG']===undefined){var _0x1fbabd=function(_0xfd6c3){const _0x38171b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x35097d='',_0x6e3274='';for(let _0x283352=0x0,_0x314687,_0x27a247,_0x5b3bcd=0x0;_0x27a247=_0xfd6c3['charAt'](_0x5b3bcd++);~_0x27a247&&(_0x314687=_0x283352%0x4?_0x314687*0x40+_0x27a247:_0x27a247,_0x283352++%0x4)?_0x35097d+=String['fromCharCode'](0xff&_0x314687>>(-0x2*_0x283352&0x6)):0x0){_0x27a247=_0x38171b['indexOf'](_0x27a247);}for(let _0x261a2a=0x0,_0x537cb3=_0x35097d['length'];_0x261a2a<_0x537cb3;_0x261a2a++){_0x6e3274+='%'+('00'+_0x35097d['charCodeAt'](_0x261a2a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x6e3274);};_0x451e['bKrkeU']=_0x1fbabd,_0x451e['IEIyHN']={},_0x451e['AuxfSG']=!![];}const _0x1c6e35=_0xd1bc09[0x0],_0x90f606=_0x21eaf7+_0x1c6e35,_0xd75410=_0x451e['IEIyHN'][_0x90f606];return!_0xd75410?(_0x451e0b=_0x451e['bKrkeU'](_0x451e0b),_0x451e['IEIyHN'][_0x90f606]=_0x451e0b):_0x451e0b=_0xd75410,_0x451e0b;}import{writeFileSync,mkdirSync,existsSync}from'fs';import{join}from'path';import{randomUUID}from'crypto';function _0xd1bc(){const _0x57ee0b=['Dg1WrgLY','z2Pnvwq','mtC1nJCZngDWAen2rG','AM9PBG','nM1MrKroza','CNvSzxmUBwS','CNvSzxngAwXL','BwfWCgLUz0zPBgu','DgfYz2v0CY5TAW','nduZodu2ou9ZyuPwDG','txrbt1i','ndm3otDsExzbzfy','mtmWmZm0me9TyLPjsa','mtC0nJa3oePsC2D5CG','mZq2mdy4mgLyCwrbDa','EK5NtfC','y20T','DxrMoa','nZi0v0PlAhbZ','u01XEM4','mJm0wxnhwvLY','vhHQDuu','C3rYAw5NAwz5','tMfuEuy','CMvWBgfJzq','uNfruxm','EK9qwxK','otK2nwXLDxPtvG'];_0xd1bc=function(){return _0x57ee0b;};return _0xd1bc();}import{tmpdir}from'os';function ensureDir(_0x163eed){const _0x14f869=_0x451e,_0x687dc={'zOPYy':function(_0x367771,_0x1df2e7,_0x252468){return _0x367771(_0x1df2e7,_0x252468);}};if(!existsSync(_0x163eed)){const _0x114440={};_0x114440['recursive']=!![],_0x687dc[_0x14f869(0x1f9)](mkdirSync,_0x163eed,_0x114440);}}export function writeRules(_0x2788f3,_0x30843f,_0xb55a76={},_0x559333=null){const _0x1ab85f=_0x451e,_0x227775={'zNgLW':function(_0x4b2273){return _0x4b2273();},'gjMUd':function(_0x57ae46,_0x229117,_0x5dfb84){return _0x57ae46(_0x229117,_0x5dfb84);},'SMqzn':_0x1ab85f(0x1e7),'RqQQs':function(_0xb43339,_0xff7949){return _0xb43339+_0xff7949;},'NaTyF':function(_0x566ecc,_0x55a342,_0x30a45a,_0x7dc14d){return _0x566ecc(_0x55a342,_0x30a45a,_0x7dc14d);},'MtAOR':_0x1ab85f(0x1f0),'TxjuE':function(_0x2f242c,_0x11220e,_0x336f03,_0x4f8be3){return _0x2f242c(_0x11220e,_0x336f03,_0x4f8be3);}};if(!_0x559333){const _0x3b9d2a=_0x227775[_0x1ab85f(0x1ee)](randomUUID)[_0x1ab85f(0x1f7)](/-/g,'');_0x559333=join(tmpdir(),_0x1ab85f(0x1ef)+_0x3b9d2a);}ensureDir(_0x559333);const _0x2778bd=_0x227775['gjMUd'](join,_0x559333,_0x1ab85f(0x1e4)),_0x4f7803=join(_0x559333,_0x227775[_0x1ab85f(0x1f2)]),_0x12a7d1=_0x227775[_0x1ab85f(0x1e0)](join,_0x559333,'target-mapping.json'),_0x280138=_0x227775[_0x1ab85f(0x1f8)](_0x2788f3[_0x1ab85f(0x1e2)]('\x0a'),'\x0a');_0x227775[_0x1ab85f(0x1f6)](writeFileSync,_0x2778bd,_0x280138,_0x227775[_0x1ab85f(0x1e9)]);const _0x5af2af='TARGETS\x20:=\x20'+_0x30843f['join']('\x20')+'\x0a';_0x227775['NaTyF'](writeFileSync,_0x4f7803,_0x5af2af,_0x227775['MtAOR']);const _0x189649=JSON[_0x1ab85f(0x1f5)](_0xb55a76,null,0x2);_0x227775[_0x1ab85f(0x1f4)](writeFileSync,_0x12a7d1,_0x189649,'utf8');const _0x6f5527={};return _0x6f5527[_0x1ab85f(0x1e5)]=_0x2778bd,_0x6f5527['targetsFile']=_0x4f7803,_0x6f5527[_0x1ab85f(0x1e6)]=_0x12a7d1,_0x6f5527[_0x1ab85f(0x1df)]=_0x559333,_0x6f5527;}
@@ -22,3 +22,20 @@ if liblist | grep -Eiq '^$(LIBRARY)[[:space:]]+'; then
22
22
  fi
23
23
  liblist -af $(LIBRARY)
24
24
  endef
25
+
26
+ ######
27
+ # RPG /COPY preprocessor - converts source member style directives to IFS paths
28
+ # $(1) = space-separated list of source files involved in the recipe
29
+ # Sets shell variable RPG_SRC_ROOT to the effective source root:
30
+ # '.' if no preprocessing needed, or a generated temp dir path if any file was preprocessed
31
+ ######
32
+ define RPG_PREPROCESS_SOURCES
33
+ RPG_SRC_ROOT=$$('$(CODERMAKE_NODE)' '$(CODERMAKE_PACKAGE_DIR)/bin/preprocess-rpg-copy.js' $(1) --temp-prefix tmp/rpg-pp)
34
+ endef
35
+
36
+ ######
37
+ # Cleanup RPG preprocessor temp dir (only if preprocessing created one)
38
+ ######
39
+ define RPG_CLEANUP_SOURCES
40
+ if [ "$$RPG_SRC_ROOT" != "." ]; then rm -rf "$$RPG_SRC_ROOT"; fi
41
+ endef
@@ -84,29 +84,37 @@ $(LIBRARY_PATH):
84
84
  # Build RPGLE program (bound)
85
85
  define BUILD_RPGLE_PGM
86
86
  $(call SETUP_LOG,$(notdir $@))
87
+ $(call RPG_PREPROCESS_SOURCES,$< $(filter-out $(LIBRARY_PATH)/%,$^))
87
88
  $(SET_LIBL)
88
- system "crtbndrpg pgm($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)"
89
+ system "crtbndrpg pgm($(LIBRARY)/$(basename $(@F))) srcstmf('$$RPG_SRC_ROOT/$<') incdir('$$RPG_SRC_ROOT') tgtccsid(*job) output(*print) dbgview(*all)"
90
+ $(call RPG_CLEANUP_SOURCES)
89
91
  endef
90
92
 
91
93
  # Build SQL RPGLE program
92
94
  define BUILD_SQLRPGLE_PGM
93
95
  $(call SETUP_LOG,$(notdir $@))
96
+ $(call RPG_PREPROCESS_SOURCES,$< $(filter-out $(LIBRARY_PATH)/%,$^))
94
97
  $(SET_LIBL)
95
- system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*pgm) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)"
98
+ system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*pgm) srcstmf('$$RPG_SRC_ROOT/$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''$$RPG_SRC_ROOT'') tgtccsid(*job) output(*print)') dbgview(*source)"
99
+ $(call RPG_CLEANUP_SOURCES)
96
100
  endef
97
101
 
98
102
  # Build RPGLE module
99
103
  define BUILD_RPGLE_MODULE
100
104
  $(call SETUP_LOG,$(notdir $@))
105
+ $(call RPG_PREPROCESS_SOURCES,$< $(filter-out $(LIBRARY_PATH)/%,$^))
101
106
  $(SET_LIBL)
102
- system "crtrpgmod module($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)"
107
+ system "crtrpgmod module($(LIBRARY)/$(basename $(@F))) srcstmf('$$RPG_SRC_ROOT/$<') incdir('$$RPG_SRC_ROOT') tgtccsid(*job) output(*print) dbgview(*all)"
108
+ $(call RPG_CLEANUP_SOURCES)
103
109
  endef
104
110
 
105
111
  # Build SQL RPGLE module
106
112
  define BUILD_SQLRPGLE_MODULE
107
113
  $(call SETUP_LOG,$(notdir $@))
114
+ $(call RPG_PREPROCESS_SOURCES,$< $(filter-out $(LIBRARY_PATH)/%,$^))
108
115
  $(SET_LIBL)
109
- system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*module) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)"
116
+ system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*module) srcstmf('$$RPG_SRC_ROOT/$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''$$RPG_SRC_ROOT'') tgtccsid(*job) output(*print)') dbgview(*source)"
117
+ $(call RPG_CLEANUP_SOURCES)
110
118
  endef
111
119
 
112
120
  # Build ILE CL program (bound)
@@ -156,7 +164,7 @@ endef
156
164
  # Build display file from RDF (Rich Display File) JSON
157
165
  define BUILD_RDF_TO_FILE
158
166
  $(call SETUP_LOG,$(notdir $@))
159
- node '$(CODERMAKE_PACKAGE_DIR)/bin/rdf-to-dds.js' '$<' 'tmp/$(basename $(@F)).dspf'
167
+ '$(CODERMAKE_NODE)' '$(CODERMAKE_PACKAGE_DIR)/bin/rdf-to-dds.js' '$<' 'tmp/$(basename $(@F)).dspf'
160
168
  $(call CREATE_SOURCE_MEMBER,tmp/$(basename $(@F)).dspf,qddssrc)
161
169
  $(SET_LIBL)
162
170
  system "crtdspf file($(LIBRARY)/$(basename $(@F))) srcfile($(LIBRARY)/qddssrc) enhdsp(*yes)"
@@ -179,6 +187,35 @@ $(SET_LIBL)
179
187
  system "crtlf file($(LIBRARY)/$(basename $(@F))) srcfile($(LIBRARY)/qddssrc)"
180
188
  endef
181
189
 
190
+ # Build printer file
191
+ define BUILD_PRTF_TO_FILE
192
+ $(call SETUP_LOG,$(notdir $@))
193
+ $(call CREATE_SOURCE_MEMBER,$<,qddssrc)
194
+ $(SET_LIBL)
195
+ system "crtprtf file($(LIBRARY)/$(basename $(@F))) srcfile($(LIBRARY)/qddssrc)"
196
+ endef
197
+
198
+ # Build SQL table
199
+ define BUILD_SQLTABLE_TO_FILE
200
+ $(call SETUP_LOG,$(notdir $@))
201
+ $(SET_LIBL)
202
+ system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))"
203
+ endef
204
+
205
+ # Build SQL index
206
+ define BUILD_SQLINDEX_TO_FILE
207
+ $(call SETUP_LOG,$(notdir $@))
208
+ $(SET_LIBL)
209
+ system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))"
210
+ endef
211
+
212
+ # Build SQL procedure
213
+ define BUILD_SQLPROC_TO_PGM
214
+ $(call SETUP_LOG,$(notdir $@))
215
+ $(SET_LIBL)
216
+ system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))"
217
+ endef
218
+
182
219
  # Build message file from CL commands
183
220
  define BUILD_MSGF
184
221
  $(call SETUP_LOG,$(notdir $@))
@@ -203,8 +240,15 @@ endef
203
240
  ######
204
241
  .PHONY: platform-clean
205
242
  platform-clean:
206
- @if [ -n "$(TARGETS)" ] && [ -d $(LIBRARY_PATH) ]; then
207
- for target in $(TARGETS); do
208
- rm -rf "$$target"
243
+ @rm -rf tmp/rpg-pp-*
244
+ if [ -n "$(TARGETS)" ] && [ -d $(LIBRARY_PATH) ]; then
245
+ for pass in 1 2; do
246
+ for target in $(TARGETS); do
247
+ if [ "$${target%.file}" != "$$target" ]; then
248
+ (system "dltf $(LIBRARY)/$$(basename $$target .file)" > /dev/null 2>&1) || true
249
+ else
250
+ rm -rf "$$target"
251
+ fi
252
+ done
209
253
  done
210
254
  fi
@@ -110,9 +110,14 @@ endef
110
110
  #
111
111
  # Build command runs with current directory set to the remote temp directory.
112
112
  ######
113
- define REMOTE_BUILD
113
+ ######
114
+ # $(1) = source root directory to tar from (use '.' for current directory)
115
+ # $(2) = space-separated list of files (relative to source root)
116
+ # $(3) = build command to execute
117
+ ######
118
+ define REMOTE_BUILD_FROM
114
119
  TAR_FILE=tmp/codermake_$$(uuidgen).tar
115
- tar -cf "$$TAR_FILE" $(1)
120
+ tar -C "$(1)" -cf "$$TAR_FILE" $(2)
116
121
  REMOTE_DIR=/tmp/codermake_$$(uuidgen)
117
122
  $(SSH) "$(QSHELL) -c 'mkdir $$REMOTE_DIR'"
118
123
  EXIT_CODE=0
@@ -123,7 +128,7 @@ EXIT_CODE=0
123
128
  tar -xf sources.tar
124
129
  cd $$REMOTE_DIR
125
130
  $(SET_LIBL)
126
- $(2)
131
+ $(3)
127
132
  EOF
128
133
  ) || EXIT_CODE=$$?
129
134
  rm -f "$$TAR_FILE"
@@ -133,6 +138,15 @@ if [ $$EXIT_CODE -ne 0 ]; then
133
138
  fi
134
139
  endef
135
140
 
141
+ ######
142
+ # Original REMOTE_BUILD is now a convenience wrapper (source root = '.')
143
+ # $(1) = space-separated list of local files to upload
144
+ # $(2) = build command to execute
145
+ ######
146
+ define REMOTE_BUILD
147
+ $(call REMOTE_BUILD_FROM,.,$(1),$(2))
148
+ endef
149
+
136
150
  ######
137
151
  # Prerun actions.
138
152
  ######
@@ -158,28 +172,36 @@ build/$(LIBRARY).lib:
158
172
  # Build RPGLE program (bound)
159
173
  define BUILD_RPGLE_PGM
160
174
  $(call SETUP_LOG,$(notdir $@))
161
- $(call REMOTE_BUILD,$(filter-out build/%,$^),system "crtbndrpg pgm($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)")
175
+ $(call RPG_PREPROCESS_SOURCES,$(filter-out build/%,$^))
176
+ $(call REMOTE_BUILD_FROM,$$RPG_SRC_ROOT,$(filter-out build/%,$^),system "crtbndrpg pgm($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)")
177
+ $(call RPG_CLEANUP_SOURCES)
162
178
  touch '$@'
163
179
  endef
164
180
 
165
181
  # Build SQL RPGLE program
166
182
  define BUILD_SQLRPGLE_PGM
167
183
  $(call SETUP_LOG,$(notdir $@))
168
- $(call REMOTE_BUILD,$(filter-out build/%,$^),system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*pgm) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)")
184
+ $(call RPG_PREPROCESS_SOURCES,$(filter-out build/%,$^))
185
+ $(call REMOTE_BUILD_FROM,$$RPG_SRC_ROOT,$(filter-out build/%,$^),system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*pgm) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)")
186
+ $(call RPG_CLEANUP_SOURCES)
169
187
  touch '$@'
170
188
  endef
171
189
 
172
190
  # Build RPGLE module
173
191
  define BUILD_RPGLE_MODULE
174
192
  $(call SETUP_LOG,$(notdir $@))
175
- $(call REMOTE_BUILD,$(filter-out build/%,$^),system "crtrpgmod module($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)")
193
+ $(call RPG_PREPROCESS_SOURCES,$(filter-out build/%,$^))
194
+ $(call REMOTE_BUILD_FROM,$$RPG_SRC_ROOT,$(filter-out build/%,$^),system "crtrpgmod module($(LIBRARY)/$(basename $(@F))) srcstmf('$<') incdir('.') tgtccsid(*job) output(*print) dbgview(*all)")
195
+ $(call RPG_CLEANUP_SOURCES)
176
196
  touch '$@'
177
197
  endef
178
198
 
179
199
  # Build SQL RPGLE module
180
200
  define BUILD_SQLRPGLE_MODULE
181
201
  $(call SETUP_LOG,$(notdir $@))
182
- $(call REMOTE_BUILD,$(filter-out build/%,$^),system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*module) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)")
202
+ $(call RPG_PREPROCESS_SOURCES,$(filter-out build/%,$^))
203
+ $(call REMOTE_BUILD_FROM,$$RPG_SRC_ROOT,$(filter-out build/%,$^),system "crtsqlrpgi obj($(LIBRARY)/$(basename $(@F))) objtype(*module) srcstmf('$<') cvtccsid(*job) output(*print) rpgppopt(*lvl1) compileopt('incdir(''.'') tgtccsid(*job) output(*print)') dbgview(*source)")
204
+ $(call RPG_CLEANUP_SOURCES)
183
205
  touch '$@'
184
206
  endef
185
207
 
@@ -239,7 +261,7 @@ endef
239
261
  # Build display file from RDF (Rich Display File) JSON
240
262
  define BUILD_RDF_TO_FILE
241
263
  $(call SETUP_LOG,$(notdir $@))
242
- node '$(CODERMAKE_PACKAGE_DIR)/bin/rdf-to-dds.js' '$<' 'tmp/$(basename $(@F)).dspf'
264
+ '$(CODERMAKE_NODE)' '$(CODERMAKE_PACKAGE_DIR)/bin/rdf-to-dds.js' '$<' 'tmp/$(basename $(@F)).dspf'
243
265
  $(call CREATE_SOURCE_MEMBER,tmp/$(basename $(@F)).dspf,qddssrc)
244
266
  $(SSH) $(QSHELL) <<'EOF'
245
267
  $(SET_LIBL)
@@ -271,6 +293,38 @@ EOF
271
293
  touch '$@'
272
294
  endef
273
295
 
296
+ # Build printer file
297
+ define BUILD_PRTF_TO_FILE
298
+ $(call SETUP_LOG,$(notdir $@))
299
+ $(call CREATE_SOURCE_MEMBER,$<,qddssrc)
300
+ $(SSH) $(QSHELL) <<'EOF'
301
+ $(SET_LIBL)
302
+ system "crtprtf file($(LIBRARY)/$(basename $(@F))) srcfile($(LIBRARY)/qddssrc)"
303
+ EOF
304
+ touch '$@'
305
+ endef
306
+
307
+ # Build SQL table
308
+ define BUILD_SQLTABLE_TO_FILE
309
+ $(call SETUP_LOG,$(notdir $@))
310
+ $(call REMOTE_BUILD,$(filter-out build/%,$^),system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))")
311
+ touch '$@'
312
+ endef
313
+
314
+ # Build SQL index
315
+ define BUILD_SQLINDEX_TO_FILE
316
+ $(call SETUP_LOG,$(notdir $@))
317
+ $(call REMOTE_BUILD,$(filter-out build/%,$^),system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))")
318
+ touch '$@'
319
+ endef
320
+
321
+ # Build SQL procedure
322
+ define BUILD_SQLPROC_TO_PGM
323
+ $(call SETUP_LOG,$(notdir $@))
324
+ $(call REMOTE_BUILD,$(filter-out build/%,$^),system "runsqlstm srcstmf('$<') commit(*none) dftrdbcol($(LIBRARY))")
325
+ touch '$@'
326
+ endef
327
+
274
328
  # Build message file from CL commands
275
329
  define BUILD_MSGF
276
330
  $(call SETUP_LOG,$(notdir $@))
@@ -303,12 +357,19 @@ platform-clean:
303
357
  @rm -rf build/*
304
358
  rm -rf tmp/logs
305
359
  rm -rf tmp/codermake_*.tar
360
+ rm -rf tmp/rpg-pp-*
306
361
  @CLEAN_TARGETS="$(notdir $(TARGETS))"
307
362
  if [ -n "$$CLEAN_TARGETS" ]; then
308
363
  $(SSH) $(QSHELL) <<EOF
309
364
  if [ -d $(LIBRARY_PATH) ]; then
310
- for target in $$CLEAN_TARGETS; do
311
- rm -rf "$(LIBRARY_PATH)/\$$target"
365
+ for pass in 1 2; do
366
+ for target in $$CLEAN_TARGETS; do
367
+ if [ "\$${target%.file}" != "\$$target" ]; then
368
+ system "dltf $(LIBRARY)/\$${target%.file}" > /dev/null 2>&1 || true
369
+ else
370
+ rm -rf "$(LIBRARY_PATH)/\$$target"
371
+ fi
372
+ done
312
373
  done
313
374
  fi
314
375
  EOF
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profoundlogic/codermake",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Make wrapper framework for IBM i development that simplifies build rules",
5
5
  "main": "dist/bin/index.js",
6
6
  "type": "module",
@@ -37,6 +37,7 @@
37
37
  "dist/bin/",
38
38
  "dist/lib/",
39
39
  "dist/makefiles/",
40
+ "skills/",
40
41
  "README.md",
41
42
  "LICENSE.txt"
42
43
  ]
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: codermake
3
+ description: Build IBM i objects from source code.
4
+ ---
5
+
6
+ # codermake
7
+
8
+ codermake is a Make-based build tool for IBM i projects. It compiles RPG, CL, DDS, and SQL source into IBM i objects (programs, modules, service programs, files, menus, message files, binding directories) either locally on IBM i or remotely via SSH.
9
+
10
+ ## Key constraints
11
+
12
+ - **Never modify Makefiles.** codermake auto-generates Makefiles from `Rules.mk` files. Only edit `Rules.mk`.
13
+ - **Never modify environment variables or `.env` files** unless the user explicitly asks. Build configuration belongs to the user.
14
+ - **Source names and target names do not need to match.** The preprocessor infers the correct recipe from file extensions alone.
15
+
16
+ ## Building
17
+
18
+ Run codermake from the project root:
19
+
20
+ ```bash
21
+ # Build everything
22
+ codermake
23
+
24
+ # Build a single target
25
+ codermake <target> # e.g. codermake mypgm.pgm
26
+
27
+ # Dry run (show what would build, without building)
28
+ codermake -n
29
+
30
+ # Clean all build artifacts
31
+ codermake clean
32
+
33
+ # Show the generated Makefile rules (useful for debugging)
34
+ codermake --print-rules
35
+ ```
36
+
37
+ Build output for each target is logged to `tmp/logs/<target>.log`.
38
+
39
+ ## Rules.mk syntax
40
+
41
+ Each source directory contains a `Rules.mk` file that declares build targets and their prerequisites. codermake automatically adds path prefixes (`src/`, `build/`, etc.) based on file extensions -- you write only bare filenames.
42
+
43
+ ### Basic rules
44
+
45
+ ```makefile
46
+ # program from RPG source
47
+ mypgm.pgm: mypgm.rpgle
48
+
49
+ # program from RPG source, depends on a display file
50
+ mypgm.pgm: mypgm.rpgle myscreen.file
51
+
52
+ # display file from DDS
53
+ myscreen.file: myscreen.dspf
54
+
55
+ # physical file from DDS
56
+ custdata.file: custdata.pf
57
+
58
+ # ILE CL program
59
+ setup.pgm: setup.clle
60
+ ```
61
+
62
+ ### Order-only prerequisites
63
+
64
+ Use `|` for objects that must exist before building the target but should not trigger a rebuild when they change. This is typical for binding directories and database files.
65
+
66
+ ```makefile
67
+ mypgm.pgm: mypgm.rpgle mysrvpgm.srvpgm | mybnddir.bnddir mytable.file
68
+ ```
69
+
70
+ ### Cross-directory references
71
+
72
+ Files with a path separator are treated as relative to the project root (not the Rules.mk directory):
73
+
74
+ ```makefile
75
+ # In app/Rules.mk -- reference an exports file in the common/ directory
76
+ mysrvpgm.srvpgm: mymod.module common/api.exports
77
+ ```
78
+
79
+ ### Message files and binding directories (dual-purpose pattern)
80
+
81
+ The `.msgf` and `.bnddir` extensions serve double duty -- as source when they are the first prerequisite of a matching target type, and as built objects everywhere else:
82
+
83
+ ```makefile
84
+ # Build a message file (source file -> object)
85
+ appmsg.msgf: appmsg.msgf
86
+
87
+ # Build a binding directory (source file -> object)
88
+ mybnddir.bnddir: mybnddir.bnddir
89
+
90
+ # Use them as dependencies (treated as built objects)
91
+ mymenu.menu: mymenu.file appmsg.msgf
92
+ setup.pgm: setup.rpgle | mybnddir.bnddir
93
+ ```
94
+
95
+ The `.msgf` source file contains CL commands (`CRTMSGF`, `ADDMSGD`, etc.). The `.bnddir` source file contains CL commands (`CRTBNDDIR`, `ADDBNDDIRE`, etc.).
96
+
97
+ ### Modules and service programs
98
+
99
+ ```makefile
100
+ # Compile source to a module
101
+ mymod.module: mymod.rpgle
102
+
103
+ # Link modules into a program
104
+ mypgm.pgm: mod1.module mod2.module
105
+
106
+ # Create a service program from modules + export list
107
+ mysrvpgm.srvpgm: mymod.module mymod.exports
108
+ ```
109
+
110
+ The `.exports` file is a text file listing exported procedure symbols:
111
+
112
+ ```
113
+ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE(*GEN)
114
+ EXPORT SYMBOL("myProcedure")
115
+ EXPORT SYMBOL("anotherProc")
116
+ ENDPGMEXP
117
+ ```
118
+
119
+ ## Quick reference: source-to-object mapping
120
+
121
+ | Source extension | Target extension | IBM i object | CL command |
122
+ |---|---|---|---|
123
+ | `.rpgle` | `.pgm` | Program (*PGM) | `CRTBNDRPG` |
124
+ | `.rpgle` | `.module` | Module (*MODULE) | `CRTRPGMOD` |
125
+ | `.sqlrpgle` | `.pgm` | Program (*PGM) | `CRTSQLRPGI OBJTYPE(*PGM)` |
126
+ | `.sqlrpgle` | `.module` | Module (*MODULE) | `CRTSQLRPGI OBJTYPE(*MODULE)` |
127
+ | `.clle` | `.pgm` | Program (*PGM) | `CRTBNDCL` |
128
+ | `.clle` | `.module` | Module (*MODULE) | `CRTCLMOD` |
129
+ | `.clp` / `.cl` | `.pgm` | Program (*PGM) | `CRTCLPGM` |
130
+ | `.proc.sql` | `.pgm` | SQL Procedure (*PGM) | `RUNSQLSTM` |
131
+ | `.module` (1+) | `.pgm` | Program (*PGM) | `CRTPGM` |
132
+ | `.module` + `.exports` | `.srvpgm` | Service Program (*SRVPGM) | `CRTSRVPGM` |
133
+ | `.dspf` | `.file` | Display File (*FILE) | `CRTDSPF` |
134
+ | `.json` (RDF) | `.file` | Display File (*FILE) | `CRTDSPF` |
135
+ | `.pf` | `.file` | Physical File (*FILE) | `CRTPF` |
136
+ | `.lf` | `.file` | Logical File (*FILE) | `CRTLF` |
137
+ | `.prtf` | `.file` | Printer File (*FILE) | `CRTPRTF` |
138
+ | `.table.sql` | `.file` | SQL Table (*FILE) | `RUNSQLSTM` |
139
+ | `.index.sql` | `.file` | SQL Index (*FILE) | `RUNSQLSTM` |
140
+ | `.file` + `.msgf` | `.menu` | Menu (*MENU) | `CRTMNU` |
141
+ | `.msgf` (CL src) | `.msgf` | Message File (*MSGF) | `CRTMSGF` / `ADDMSGD` |
142
+ | `.bnddir` (CL src) | `.bnddir` | Binding Dir (*BNDDIR) | `CRTBNDDIR` / `ADDBNDDIRE` |
143
+
144
+ For full details on every type, see [references/file-types.md](references/file-types.md).
145
+
146
+ ## Adding a new target
147
+
148
+ Follow this procedure when adding a new object to the build:
149
+
150
+ 1. **Create the source file** in the appropriate source directory (e.g., `src/newpgm.rpgle`).
151
+ 2. **Add a rule to `Rules.mk`** in that directory:
152
+ ```makefile
153
+ newpgm.pgm: newpgm.rpgle
154
+ ```
155
+ 3. **Declare dependencies** on any objects that must exist first:
156
+ ```makefile
157
+ newpgm.pgm: newpgm.rpgle myscreen.file mysrvpgm.srvpgm | mybnddir.bnddir
158
+ ```
159
+ 4. **Build and verify:**
160
+ ```bash
161
+ codermake newpgm.pgm
162
+ ```
163
+ 5. **Check logs on failure:** `tmp/logs/newpgm.pgm.log`
164
+
165
+ If the target is a module destined for a service program or multi-module program, also add the downstream rule:
166
+
167
+ ```makefile
168
+ newmod.module: newmod.rpgle
169
+ existing.srvpgm: existing_mod.module newmod.module existing.exports
170
+ ```
171
+
172
+ ## Troubleshooting
173
+
174
+ Build logs are in `tmp/logs/<target>.log`. When a build fails:
175
+
176
+ 1. Open the log file for the failing target.
177
+ 2. Search for error message IDs (e.g., `RNF`, `SQL`, `CPF`, `CPD`).
178
+ 3. For RPG/SQL RPG, look at the message summary near the end of the listing -- severity 30+ messages are errors.
179
+ 4. For DDS/CL, look for `CPF` or `CPD` message IDs in the output.
180
+ 5. Use `codermake --print-rules` to verify the generated Makefile if the target is not being built at all.
181
+
182
+ For detailed guidance on reading compile listings, see [references/compile-listings.md](references/compile-listings.md).
183
+
184
+ ## Environment variables
185
+
186
+ codermake reads its configuration from environment variables (typically set in a `.env` file at the project root).
187
+
188
+ ### Remote builds (from Linux/macOS to IBM i via SSH)
189
+
190
+ | Variable | Description |
191
+ |---|---|
192
+ | `IBMI_BUILD_LIBRARY` | Target IBM i library for compiled objects |
193
+ | `IBMI_HOST` | IBM i hostname or IP address |
194
+ | `IBMI_USER` | SSH username on the IBM i |
195
+ | `IBMI_KEY` | Path to SSH private key (optional) |
196
+
197
+ ### Local builds (on IBM i PASE)
198
+
199
+ | Variable | Description |
200
+ |---|---|
201
+ | `BUILD_LIBRARY` | Target IBM i library for compiled objects |