rescript-relay 0.0.0-test-rust-compiler-cc037019 → 0.0.0-test-rust-compiler-a2f32b9e

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # master
2
2
 
3
+ # 1.0.0-beta.1
4
+
5
+ The time has finally come - RescriptRelay `1.0.0` is in beta! The one, big major thing this release brings is that the ReScript type generation for the Relay compiler has been completely rewritten, and fully integrated into the new Relay Rust compiler. The RescriptRelay fork of the compiler is available and maintained [here])(https://github.com/zth/relay/tree/rescript-relay).
6
+
7
+ ## Remove Packages
8
+
9
+ You can go ahead and remove these packages, that are no longer needed, as the compiler is now shipped in the main package:
10
+
11
+ - `relay-config`
12
+ - `relay-compiler`
13
+ - `graphql` (if you don't use it for anything else)
14
+
15
+ ## Breaking Changes
16
+
17
+ - The compiler expects the `__generated__` folder to always exist, so if you're not committing your artifacts to source control, make sure you add a `.gitkeep` to the generated folder so git keeps it around.
18
+
19
+ ## Improvements
20
+
21
+ - The compiler itself should be _much_ faster than the old one. An order of magnitude faster. Especially for incremental compilation in watch mode.
22
+ - There's no longer any need to manually select `__typename` on interfaces and unions for RescriptRelay's sake, unless you actually want to use it yourself.
23
+ - We now support the `@required` directive from Relay, which is a new directive that lets you force non-nullability for nullable fields on the client side. You can then choose to throw an error if null values are encountered, or let the null value bubble up. Docs are coming soon, and you'll need to do `RescriptRelay.relayFeatureFlags.enableRequiredDirective = true` somewhere in your code to enable it for now.
24
+ - The errors reported by the compiler is now quite a lot better.
25
+
3
26
  # 0.23.0
4
27
 
5
28
  _[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
package/cli/cli.js CHANGED
@@ -475,4 +475,4 @@ var BE=OT(4293);var LE=BE.Buffer;function copyProps(pT,xT){for(var OT in pT){xT[
475
475
  *
476
476
  * Copyright (c) 2015-present, Jon Schlinkert.
477
477
  * Released under the MIT License.
478
- */const BE=OT(5680);const toRegexRange=(pT,xT,OT)=>{if(BE(pT)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(xT===void 0||pT===xT){return String(pT)}if(BE(xT)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let LE={relaxZeros:true,...OT};if(typeof LE.strictZeros==="boolean"){LE.relaxZeros=LE.strictZeros===false}let RE=String(LE.relaxZeros);let ME=String(LE.shorthand);let jE=String(LE.capture);let VE=String(LE.wrap);let UE=pT+":"+xT+"="+RE+ME+jE+VE;if(toRegexRange.cache.hasOwnProperty(UE)){return toRegexRange.cache[UE].result}let JE=Math.min(pT,xT);let qE=Math.max(pT,xT);if(Math.abs(JE-qE)===1){let OT=pT+"|"+xT;if(LE.capture){return`(${OT})`}if(LE.wrap===false){return OT}return`(?:${OT})`}let KE=hasPadding(pT)||hasPadding(xT);let zE={min:pT,max:xT,a:JE,b:qE};let GE=[];let $E=[];if(KE){zE.isPadded=KE;zE.maxLen=String(zE.max).length}if(JE<0){let pT=qE<0?Math.abs(qE):1;$E=splitToPatterns(pT,Math.abs(JE),zE,LE);JE=zE.a=0}if(qE>=0){GE=splitToPatterns(JE,qE,zE,LE)}zE.negatives=$E;zE.positives=GE;zE.result=collatePatterns($E,GE,LE);if(LE.capture===true){zE.result=`(${zE.result})`}else if(LE.wrap!==false&&GE.length+$E.length>1){zE.result=`(?:${zE.result})`}toRegexRange.cache[UE]=zE;return zE.result};function collatePatterns(pT,xT,OT){let BE=filterPatterns(pT,xT,"-",false,OT)||[];let LE=filterPatterns(xT,pT,"",false,OT)||[];let RE=filterPatterns(pT,xT,"-?",true,OT)||[];let ME=BE.concat(RE).concat(LE);return ME.join("|")}function splitToRanges(pT,xT){let OT=1;let BE=1;let LE=countNines(pT,OT);let RE=new Set([xT]);while(pT<=LE&&LE<=xT){RE.add(LE);OT+=1;LE=countNines(pT,OT)}LE=countZeros(xT+1,BE)-1;while(pT<LE&&LE<=xT){RE.add(LE);BE+=1;LE=countZeros(xT+1,BE)-1}RE=[...RE];RE.sort(compare);return RE}function rangeToPattern(pT,xT,OT){if(pT===xT){return{pattern:pT,count:[],digits:0}}let BE=zip(pT,xT);let LE=BE.length;let RE="";let ME=0;for(let pT=0;pT<LE;pT++){let[xT,LE]=BE[pT];if(xT===LE){RE+=xT}else if(xT!=="0"||LE!=="9"){RE+=toCharacterClass(xT,LE,OT)}else{ME++}}if(ME){RE+=OT.shorthand===true?"\\d":"[0-9]"}return{pattern:RE,count:[ME],digits:LE}}function splitToPatterns(pT,xT,OT,BE){let LE=splitToRanges(pT,xT);let RE=[];let ME=pT;let jE;for(let pT=0;pT<LE.length;pT++){let xT=LE[pT];let VE=rangeToPattern(String(ME),String(xT),BE);let UE="";if(!OT.isPadded&&jE&&jE.pattern===VE.pattern){if(jE.count.length>1){jE.count.pop()}jE.count.push(VE.count[0]);jE.string=jE.pattern+toQuantifier(jE.count);ME=xT+1;continue}if(OT.isPadded){UE=padZeros(xT,OT,BE)}VE.string=UE+VE.pattern+toQuantifier(VE.count);RE.push(VE);ME=xT+1;jE=VE}return RE}function filterPatterns(pT,xT,OT,BE,LE){let RE=[];for(let LE of pT){let{string:pT}=LE;if(!BE&&!contains(xT,"string",pT)){RE.push(OT+pT)}if(BE&&contains(xT,"string",pT)){RE.push(OT+pT)}}return RE}function zip(pT,xT){let OT=[];for(let BE=0;BE<pT.length;BE++)OT.push([pT[BE],xT[BE]]);return OT}function compare(pT,xT){return pT>xT?1:xT>pT?-1:0}function contains(pT,xT,OT){return pT.some((pT=>pT[xT]===OT))}function countNines(pT,xT){return Number(String(pT).slice(0,-xT)+"9".repeat(xT))}function countZeros(pT,xT){return pT-pT%Math.pow(10,xT)}function toQuantifier(pT){let[xT=0,OT=""]=pT;if(OT||xT>1){return`{${xT+(OT?","+OT:"")}}`}return""}function toCharacterClass(pT,xT,OT){return`[${pT}${xT-pT===1?"":"-"}${xT}]`}function hasPadding(pT){return/^-?(0+)\d/.test(pT)}function padZeros(pT,xT,OT){if(!xT.isPadded){return pT}let BE=Math.abs(xT.maxLen-String(pT).length);let LE=OT.relaxZeros!==false;switch(BE){case 0:return"";case 1:return LE?"0?":"0";case 2:return LE?"0{0,2}":"00";default:{return LE?`0{0,${BE}}`:`0{${BE}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};pT.exports=toRegexRange},5278:(pT,xT,OT)=>{pT.exports=OT(1669).deprecate},4383:pT=>{pT.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},5917:(pT,xT,OT)=>{"use strict";var BE=OT(732);var LE=OT(4383);var RE={nul:0,control:0};pT.exports=function wcwidth(pT){return wcswidth(pT,RE)};pT.exports.config=function(pT){pT=BE(pT||{},RE);return function wcwidth(xT){return wcswidth(xT,pT)}};function wcswidth(pT,xT){if(typeof pT!=="string")return wcwidth(pT,xT);var OT=0;for(var BE=0;BE<pT.length;BE++){var LE=wcwidth(pT.charCodeAt(BE),xT);if(LE<0)return-1;OT+=LE}return OT}function wcwidth(pT,xT){if(pT===0)return xT.nul;if(pT<32||pT>=127&&pT<160)return xT.control;if(bisearch(pT))return 0;return 1+(pT>=4352&&(pT<=4447||pT==9001||pT==9002||pT>=11904&&pT<=42191&&pT!=12351||pT>=44032&&pT<=55203||pT>=63744&&pT<=64255||pT>=65040&&pT<=65049||pT>=65072&&pT<=65135||pT>=65280&&pT<=65376||pT>=65504&&pT<=65510||pT>=131072&&pT<=196605||pT>=196608&&pT<=262141))}function bisearch(pT){var xT=0;var OT=LE.length-1;var BE;if(pT<LE[0][0]||pT>LE[OT][1])return false;while(OT>=xT){BE=Math.floor((xT+OT)/2);if(pT>LE[BE][1])xT=BE+1;else if(pT<LE[BE][0])OT=BE-1;else return true}return false}},6615:pT=>{"use strict";pT.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')},2357:pT=>{"use strict";pT.exports=require("assert")},4293:pT=>{"use strict";pT.exports=require("buffer")},3129:pT=>{"use strict";pT.exports=require("child_process")},8614:pT=>{"use strict";pT.exports=require("events")},5747:pT=>{"use strict";pT.exports=require("fs")},2282:pT=>{"use strict";pT.exports=require("module")},2087:pT=>{"use strict";pT.exports=require("os")},5622:pT=>{"use strict";pT.exports=require("path")},1058:pT=>{"use strict";pT.exports=require("readline")},2413:pT=>{"use strict";pT.exports=require("stream")},3867:pT=>{"use strict";pT.exports=require("tty")},1669:pT=>{"use strict";pT.exports=require("util")}};var xT={};function __nccwpck_require__(OT){var BE=xT[OT];if(BE!==undefined){return BE.exports}var LE=xT[OT]={id:OT,loaded:false,exports:{}};var RE=true;try{pT[OT].call(LE.exports,LE,LE.exports,__nccwpck_require__);RE=false}finally{if(RE)delete xT[OT]}LE.loaded=true;return LE.exports}(()=>{__nccwpck_require__.n=pT=>{var xT=pT&&pT.__esModule?()=>pT["default"]:()=>pT;__nccwpck_require__.d(xT,{a:xT});return xT}})();(()=>{__nccwpck_require__.d=(pT,xT)=>{for(var OT in xT){if(__nccwpck_require__.o(xT,OT)&&!__nccwpck_require__.o(pT,OT)){Object.defineProperty(pT,OT,{enumerable:true,get:xT[OT]})}}}})();(()=>{__nccwpck_require__.o=(pT,xT)=>Object.prototype.hasOwnProperty.call(pT,xT)})();(()=>{__nccwpck_require__.r=pT=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(pT,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(pT,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=pT=>{pT.paths=[];if(!pT.children)pT.children=[];return pT}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var OT={};(()=>{"use strict";__nccwpck_require__.r(OT);var pT=__nccwpck_require__(1904);var xT=__nccwpck_require__(970);var BE=__nccwpck_require__.n(xT);var LE=__nccwpck_require__(5622);var RE=__nccwpck_require__.n(LE);var ME=__nccwpck_require__(5747);var jE=__nccwpck_require__.n(ME);var VE=__nccwpck_require__(6155);var UE=__nccwpck_require__(7314);var JE=__nccwpck_require__(9882);var qE=__nccwpck_require__(5655);let makeExtractTagsFromSource=pT=>xT=>{const OT=(0,UE.getLocator)(xT);const BE=[];let LE;while((LE=pT.exec(xT))!==null){let pT=OT(LE.index);let xT=OT(LE.index+LE[0].length);BE.push({content:LE[0],start:pT.character,end:xT.character})}return BE};const KE=new RegExp(/(?<=\%relay\([\s]*`)[\s\S.]+?(?=`[\s]*\))/g);const zE=makeExtractTagsFromSource(KE);function prettify(pT){return(0,JE.format)(pT,{parser:"graphql",plugins:[qE]}).replace(/^\s+|\s+$/g,"")}const padOperation=(pT,xT)=>pT.split("\n").map((pT=>" ".repeat(xT)+pT)).join("\n");const GE=new RegExp(/^[\s]*(?=[\w])/g);const $E=new RegExp(/[\s]*$/g);const findOperationPadding=pT=>{const xT=(pT.match(GE)||[]).pop();const OT=(xT||"").split("\n").pop();return OT?OT.length:0};const restoreOperationPadding=(pT,xT)=>{const OT=(xT.match($E)||[]).join("");return"\n"+padOperation(pT,findOperationPadding(xT))+OT};const isNodeInterfaceWithSingleMember=pT=>{var xT;const OT=pT.selectionSet.selections.find((pT=>pT.kind==="Field"&&pT.name.value==="node"));if((OT===null||OT===void 0?void 0:OT.kind)==="Field"){const pT=(xT=OT.selectionSet)===null||xT===void 0?void 0:xT.selections.filter((pT=>pT.kind==="InlineFragment"));return(pT===null||pT===void 0?void 0:pT.length)===1}return false};const namedPathOfAncestors=pT=>(pT||[]).reduce(((pT,xT)=>{var OT,BE;if(Array.isArray(xT)){return pT}const LE=xT;switch(LE.kind){case"Field":return[...pT,LE.name.value];case"InlineFragment":return[...pT,(BE=(OT=LE.typeCondition)===null||OT===void 0?void 0:OT.name.value)!==null&&BE!==void 0?BE:""];default:return pT}}),[]).join("_");const getPathAssets=({unusedFieldPaths:pT,fieldName:xT,ancestors:OT})=>{const BE=namedPathOfAncestors(OT);const LE=BE===""?xT:[namedPathOfAncestors(OT),xT].join("_");const RE=`${LE}.`;const ME=pT.filter((pT=>pT.startsWith(RE))).map((pT=>pT.slice(RE.length)));return{fieldsToRemove:ME,shouldRemoveFullSelection:pT.includes(LE),path:LE,ancestorPath:BE}};const removeUnusedFieldsFromOperation=({definition:pT,unusedFieldPaths:xT})=>{let OT=false;const BE=(0,VE.Vn3)(pT,{InlineFragment(OT,BE,LE,RE,ME){if(OT.typeCondition==null)return OT;const jE=namedPathOfAncestors(ME);const VE=jE==="node"&&isNodeInterfaceWithSingleMember(pT);const UE=VE?jE:[jE,OT.typeCondition.name.value].filter((pT=>pT!=="")).join("_");const JE=`${UE}.`;const qE=xT.filter((pT=>pT.startsWith(JE))).map((pT=>pT.slice(JE.length)));if(qE.length>0){const pT=qE.includes("fragmentRefs");const xT=Object.assign(Object.assign({},OT.selectionSet),{selections:OT.selectionSet.selections.filter((xT=>{var OT,BE;if(xT.kind==="FragmentSpread"&&pT){return false}if(xT.kind==="Field"){const pT=(BE=(OT=xT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:xT.name.value;return!qE.includes(pT)}return true}))});if(xT.selections.length===0){return null}return Object.assign(Object.assign({},OT),{selectionSet:xT})}return OT},FragmentDefinition(pT){const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},OperationDefinition(pT){if(pT.operation!=="query"){return pT}const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},Field(pT,OT,BE,LE,RE){var ME,jE,VE,UE;const JE=(jE=(ME=pT.alias)===null||ME===void 0?void 0:ME.value)!==null&&jE!==void 0?jE:pT.name.value;const{fieldsToRemove:qE,shouldRemoveFullSelection:KE}=getPathAssets({unusedFieldPaths:xT,fieldName:JE,ancestors:RE});if(KE){return null}if(qE.length>0){const xT=qE.includes("fragmentRefs");const OT=(UE=(VE=pT.selectionSet)===null||VE===void 0?void 0:VE.selections)===null||UE===void 0?void 0:UE.filter((pT=>{var OT,BE;if(pT.kind==="FragmentSpread"&&xT){return false}if(pT.kind==="Field"){const xT=(BE=(OT=pT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:pT.name.value;return!qE.includes(xT)}return true}));const BE={kind:"Field",name:{kind:"Name",value:"__typename"}};return Object.assign(Object.assign({},pT),{selectionSet:{kind:"SelectionSet",selections:(OT===null||OT===void 0?void 0:OT.length)===0?[BE]:OT}})}return pT}});if(OT){return null}return BE};const WE=new RegExp(/(?<=__generated__\/)[A-Za-z_0-9]+(?=_graphql\.res)/g);const YE=new RegExp(/(?<=Types\.(fragment|response)[_.])[A-Za-z_.0-9]+(?= )/g);const HE=new RegExp(/Types\.(fragment|response)/g);const processReanalyzeOutput=pT=>{const xT=pT.split(/\n\n/g).filter((pT=>pT.match(HE))).reduce(((pT,xT)=>{var OT,BE;const LE=xT.includes("Types.fragment")?"fragment":"query";const RE=(OT=xT.match(WE))===null||OT===void 0?void 0:OT[0];const ME=RE==null?null:`${RE}_graphql.res`;const jE=(BE=xT.match(YE))===null||BE===void 0?void 0:BE[0];if(LE==="query"&&!(RE===null||RE===void 0?void 0:RE.toLowerCase().endsWith("query"))){return pT}if(jE==="id"){return pT}if(jE===null||jE===void 0?void 0:jE.endsWith("__typename")){return pT}if(RE==null||jE==null||ME==null){return pT}pT[ME]=pT[ME]||{type:LE,graphqlName:RE,unusedFieldPaths:[]};pT[ME].unusedFieldPaths.push(jE);return pT}),{});return xT};const maybePluralize=(pT,xT)=>{if(xT===1){return`${xT} ${pT}`}return`${xT} ${pT}s`};var XE=__nccwpck_require__(7519);var QE=__nccwpck_require__.n(XE);var ZE=__nccwpck_require__(6743);var eC=__nccwpck_require__.n(ZE);var tC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const loadRelayConfig=()=>{const pT=eC().loadConfig();if(!pT){console.error("Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work.");process.exit(1)}if(!pT.artifactDirectory){console.error("RescriptRelay requires you to define 'artifactDirectory' (for outputing generated files in a single directory) in your relay.config.js. Please define it and re-run this command.");process.exit(1)}return pT};const getRelayArtifactDirectoryLocation=pT=>{const xT=RE().resolve(RE().join(process.cwd(),pT.artifactDirectory));return xT};const getAllGeneratedFiles=pT=>tC(void 0,void 0,void 0,(function*(){const xT=yield QE()(`${pT}/*.res`,{absolute:true,onlyFiles:true});return xT}));const rC=new RegExp(/(?<=\/\* @sourceLoc )[A-Za-z_.0-9]+(?= \*\/)/g);const findAllSourceFilesFromGeneratedFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=yield Promise.all(pT.map((pT=>tC(void 0,void 0,void 0,(function*(){var OT;if(xT!=null){xT.text=`Checking ${RE().basename(pT)}...`}const BE=yield jE().promises.readFile(pT,{encoding:"utf-8"});return(OT=BE.match(rC))===null||OT===void 0?void 0:OT[0]})))));const BE=OT.reduce(((pT,xT)=>{if(xT!=null){const OT=xT;if(!pT.includes(OT)){pT.push(OT)}return pT}return pT}),[]);return BE}));const getSrcCwd=pT=>RE().resolve(RE().join(process.cwd(),pT));const findSourceFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=getSrcCwd(xT);const BE=yield QE()(pT.map((pT=>`**/${pT}`)),{cwd:OT,absolute:true,onlyFiles:true});return BE}));const formatOperationsInDocument=pT=>{const xT=zE(pT);if(xT.length===0){return pT}let OT="";for(let BE=0;BE<=xT.length-1;BE+=1){const LE=xT[BE];const RE=xT[BE-1];const ME=RE==null?0:RE.end;OT+=pT.slice(ME,LE.start);OT+=restoreOperationPadding(prettify(LE.content),LE.content)}const BE=xT[xT.length-1];OT+=pT.slice(BE.end);return OT};var nC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addFormatGraphQLCommands=pT=>{pT.command("format-all-graphql").option("--ci","CI mode: Exit if unformatted files are encountered.").description("Format all GraphQL operations in project.").action((({ci:pT})=>nC(void 0,void 0,void 0,(function*(){const xT=loadRelayConfig();const OT=getRelayArtifactDirectoryLocation(xT);const LE=BE()("Findings files to format").start();const ME=yield getAllGeneratedFiles(OT);const VE=yield findAllSourceFilesFromGeneratedFiles(ME,LE);LE.text=`Searching for ${maybePluralize("source file",VE.length)}.`;const UE=yield findSourceFiles(VE,xT.src);const JE=yield Promise.all(UE.map((xT=>nC(void 0,void 0,void 0,(function*(){LE.text=`${pT?"Checking":"Formatting"} "${RE().basename(xT)}".`;const OT=yield jE().promises.readFile(xT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE&&!pT){yield jE().promises.writeFile(xT,BE)}return OT!==BE})))));const qE=JE.filter((pT=>pT===true)).length;if(pT){if(qE===0){LE.succeed(`Done! None of ${maybePluralize("file",UE.length)} in need of formatting.`);process.exit(0)}else{LE.fail(`${maybePluralize("file",qE)} needs formatting.`);process.exit(1)}}else{if(qE===0){LE.succeed(`Done! None of ${maybePluralize("scanned file",UE.length)} needed formatting.`)}else{LE.succeed(`Done! Formatted ${maybePluralize("file",qE)} of ${maybePluralize("scanned file",UE.length)}.`)}}}))));pT.command("format-single-graphql").description("Format GraphQL operations in single file.").argument("<file>","Path to file to format. Must be absolute.").action((pT=>nC(void 0,void 0,void 0,(function*(){const xT=BE()("Formatting file..").start();const OT=yield jE().promises.stat(pT,{throwIfNoEntry:false});if(OT==null){xT.fail("File does not exist.");process.exit(1)}try{const OT=yield jE().promises.readFile(pT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE){yield jE().promises.writeFile(pT,BE);xT.succeed("Successfully formatted file.")}else{xT.succeed("File already formatted.")}}catch(pT){xT.fail("Could not format file.");process.exit(1)}}))))};var iC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addDebugCommand=pT=>{pT.command("debug").description("Prints debug information for the CLI.").action((()=>iC(void 0,void 0,void 0,(function*(){const pT=loadRelayConfig();const xT=getRelayArtifactDirectoryLocation(pT);console.log(`Artifact directory location: ${xT}\n`);console.log("Getting all generated files...\n");const OT=yield getAllGeneratedFiles(xT);console.log(`Number of generated files found in artifact directory: ${OT.length}\n`);console.log("Looking up source files\n");const BE=yield findAllSourceFilesFromGeneratedFiles(OT);console.log(`Found ${BE.length} source locations with explicit definitions.\n`);console.log("Looking up source files..\n");const LE=yield findSourceFiles(BE,pT.src);console.log(`Found ${LE.length} actual source files, when looking in ${getSrcCwd(pT.src)}.\n`);console.log("Done!")}))))};var aC=__nccwpck_require__(3129);var oC=__nccwpck_require__.n(aC);var sC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addRemoveUnusedFieldsCommand=pT=>{pT.command("remove-unused-fields").option("--verbose","Verbose mode").option("--debug","Debug mode").option("--ci","CI mode: Exit if unused fields exist, but don't remove them.").description("Remove unused GraphQL selections in fragments in current project.").action((({ci:pT,verbose:xT,debug:OT})=>{var LE;const ME=loadRelayConfig();const UE=getRelayArtifactDirectoryLocation(ME);const JE=BE()("Analyzing ReScript project").start();const qE=oC().spawn("npx",["reanalyze","-dce"]);if(qE.stdout==null){console.error("Something went wrong.");process.exit(1)}let KE="";qE.stdout.on("data",(pT=>{KE+=pT}));(LE=qE.stderr)===null||LE===void 0?void 0:LE.on("data",(pT=>{if(pT.includes("End_of_file")){JE.fail(`Something went wrong trying to analyze the ReScript project. Try cleaning your ReScript project and rebuilding it from scratch before trying again.`)}else{JE.fail(`Something went wrong trying to analyze the ReScript project.`)}if(OT){console.error(pT)}process.exit(1)}));qE.on("close",(()=>sC(void 0,void 0,void 0,(function*(){JE.text="Analyzing GraphQL usage";const BE=processReanalyzeOutput(KE);if(OT){console.log(`Found ${maybePluralize("file",Object.keys(BE).length)} with potentially missing fields.`)}const LE=[];JE.text="Scanning fragment files";if(OT){console.log(`Extracing source locations for ${maybePluralize("files",Object.keys(BE).length)}.`)}yield Promise.all(Object.entries(BE).map((([pT,xT])=>sC(void 0,void 0,void 0,(function*(){var OT;const BE=RE().resolve(UE,pT);try{const pT=yield jE().promises.readFile(BE,{encoding:"utf-8"});const RE=(OT=pT.match(rC))===null||OT===void 0?void 0:OT[0];if(RE!=null){LE.push(Object.assign(Object.assign({},xT),{sourceLocation:RE}))}}catch(pT){console.error(pT)}})))));if(xT&&LE.length>0){console.log(`\n\n------\nUnused fields: \n`,LE.map((pT=>`${pT.type==="fragment"?"Fragment":"Query"} "${pT.graphqlName}" in ${pT.sourceLocation}: \n ${pT.unusedFieldPaths.join("\n ")}`)).join("\n\n"),`\n------\n\n`)}if(pT){if(LE.length===0){JE.succeed("No unused fields found.");process.exit(0)}else{JE.fail(`Found ${LE.length} file(s) with unused fields.`);process.exit(1)}}JE.text=`Findings files to modify`;const qE=LE.map((pT=>({path:pT.sourceLocation,graphqlName:pT.graphqlName})));const GE=yield findSourceFiles(qE.map((pT=>pT.path)),ME.src);const $E=GE.map((pT=>{const xT=LE.find((xT=>pT.endsWith(xT.sourceLocation)));if(xT!=null){return Object.assign(Object.assign({},xT),{absoluteFilePath:pT})}}));JE.text=`Removing unused fields`;yield Promise.all($E.map((pT=>sC(void 0,void 0,void 0,(function*(){var xT;if(pT==null)return;try{const OT=yield jE().promises.readFile(pT.absoluteFilePath,{encoding:"utf-8"});const BE=zE(OT);let LE=null;let RE=null;for(const OT of BE){const BE=(0,VE.Qc3)(OT.content);const ME=BE.definitions[0];if(ME==null){continue}if((ME.kind==="OperationDefinition"||ME.kind==="FragmentDefinition")&&((xT=ME.name)===null||xT===void 0?void 0:xT.value)===pT.graphqlName){LE=BE;RE=OT;break}}if(LE==null||RE==null)return;const ME=LE.definitions[0];if(ME==null||!(ME.kind==="FragmentDefinition"||ME.kind==="OperationDefinition")){return}const UE=removeUnusedFieldsFromOperation({definition:ME,unusedFieldPaths:pT.unusedFieldPaths});const JE=UE==null?"# This module is unused and can be removed":restoreOperationPadding(prettify((0,VE.S0v)(UE)),RE.content);yield jE().promises.writeFile(pT.absoluteFilePath,`${OT.slice(0,RE.start)}${JE}${OT.slice(RE.end)}`)}catch(pT){console.error(pT)}})))));const WE=$E.reduce(((pT,xT)=>{var OT;return pT+((OT=xT===null||xT===void 0?void 0:xT.unusedFieldPaths.length)!==null&&OT!==void 0?OT:0)}),0);if(WE===0){JE.succeed("Done! No unused fields found.")}else{JE.succeed(`Done! Removed ${maybePluralize("field",WE)} from ${maybePluralize("file",$E.length)}.`)}}))))}))};pT.program.version("0.1.0");addFormatGraphQLCommands(pT.program);addDebugCommand(pT.program);addRemoveUnusedFieldsCommand(pT.program);pT.program.parse(process.argv)})();module.exports=OT})();
478
+ */const BE=OT(5680);const toRegexRange=(pT,xT,OT)=>{if(BE(pT)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(xT===void 0||pT===xT){return String(pT)}if(BE(xT)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let LE={relaxZeros:true,...OT};if(typeof LE.strictZeros==="boolean"){LE.relaxZeros=LE.strictZeros===false}let RE=String(LE.relaxZeros);let ME=String(LE.shorthand);let jE=String(LE.capture);let VE=String(LE.wrap);let UE=pT+":"+xT+"="+RE+ME+jE+VE;if(toRegexRange.cache.hasOwnProperty(UE)){return toRegexRange.cache[UE].result}let JE=Math.min(pT,xT);let qE=Math.max(pT,xT);if(Math.abs(JE-qE)===1){let OT=pT+"|"+xT;if(LE.capture){return`(${OT})`}if(LE.wrap===false){return OT}return`(?:${OT})`}let KE=hasPadding(pT)||hasPadding(xT);let zE={min:pT,max:xT,a:JE,b:qE};let GE=[];let $E=[];if(KE){zE.isPadded=KE;zE.maxLen=String(zE.max).length}if(JE<0){let pT=qE<0?Math.abs(qE):1;$E=splitToPatterns(pT,Math.abs(JE),zE,LE);JE=zE.a=0}if(qE>=0){GE=splitToPatterns(JE,qE,zE,LE)}zE.negatives=$E;zE.positives=GE;zE.result=collatePatterns($E,GE,LE);if(LE.capture===true){zE.result=`(${zE.result})`}else if(LE.wrap!==false&&GE.length+$E.length>1){zE.result=`(?:${zE.result})`}toRegexRange.cache[UE]=zE;return zE.result};function collatePatterns(pT,xT,OT){let BE=filterPatterns(pT,xT,"-",false,OT)||[];let LE=filterPatterns(xT,pT,"",false,OT)||[];let RE=filterPatterns(pT,xT,"-?",true,OT)||[];let ME=BE.concat(RE).concat(LE);return ME.join("|")}function splitToRanges(pT,xT){let OT=1;let BE=1;let LE=countNines(pT,OT);let RE=new Set([xT]);while(pT<=LE&&LE<=xT){RE.add(LE);OT+=1;LE=countNines(pT,OT)}LE=countZeros(xT+1,BE)-1;while(pT<LE&&LE<=xT){RE.add(LE);BE+=1;LE=countZeros(xT+1,BE)-1}RE=[...RE];RE.sort(compare);return RE}function rangeToPattern(pT,xT,OT){if(pT===xT){return{pattern:pT,count:[],digits:0}}let BE=zip(pT,xT);let LE=BE.length;let RE="";let ME=0;for(let pT=0;pT<LE;pT++){let[xT,LE]=BE[pT];if(xT===LE){RE+=xT}else if(xT!=="0"||LE!=="9"){RE+=toCharacterClass(xT,LE,OT)}else{ME++}}if(ME){RE+=OT.shorthand===true?"\\d":"[0-9]"}return{pattern:RE,count:[ME],digits:LE}}function splitToPatterns(pT,xT,OT,BE){let LE=splitToRanges(pT,xT);let RE=[];let ME=pT;let jE;for(let pT=0;pT<LE.length;pT++){let xT=LE[pT];let VE=rangeToPattern(String(ME),String(xT),BE);let UE="";if(!OT.isPadded&&jE&&jE.pattern===VE.pattern){if(jE.count.length>1){jE.count.pop()}jE.count.push(VE.count[0]);jE.string=jE.pattern+toQuantifier(jE.count);ME=xT+1;continue}if(OT.isPadded){UE=padZeros(xT,OT,BE)}VE.string=UE+VE.pattern+toQuantifier(VE.count);RE.push(VE);ME=xT+1;jE=VE}return RE}function filterPatterns(pT,xT,OT,BE,LE){let RE=[];for(let LE of pT){let{string:pT}=LE;if(!BE&&!contains(xT,"string",pT)){RE.push(OT+pT)}if(BE&&contains(xT,"string",pT)){RE.push(OT+pT)}}return RE}function zip(pT,xT){let OT=[];for(let BE=0;BE<pT.length;BE++)OT.push([pT[BE],xT[BE]]);return OT}function compare(pT,xT){return pT>xT?1:xT>pT?-1:0}function contains(pT,xT,OT){return pT.some((pT=>pT[xT]===OT))}function countNines(pT,xT){return Number(String(pT).slice(0,-xT)+"9".repeat(xT))}function countZeros(pT,xT){return pT-pT%Math.pow(10,xT)}function toQuantifier(pT){let[xT=0,OT=""]=pT;if(OT||xT>1){return`{${xT+(OT?","+OT:"")}}`}return""}function toCharacterClass(pT,xT,OT){return`[${pT}${xT-pT===1?"":"-"}${xT}]`}function hasPadding(pT){return/^-?(0+)\d/.test(pT)}function padZeros(pT,xT,OT){if(!xT.isPadded){return pT}let BE=Math.abs(xT.maxLen-String(pT).length);let LE=OT.relaxZeros!==false;switch(BE){case 0:return"";case 1:return LE?"0?":"0";case 2:return LE?"0{0,2}":"00";default:{return LE?`0{0,${BE}}`:`0{${BE}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};pT.exports=toRegexRange},5278:(pT,xT,OT)=>{pT.exports=OT(1669).deprecate},4383:pT=>{pT.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},5917:(pT,xT,OT)=>{"use strict";var BE=OT(732);var LE=OT(4383);var RE={nul:0,control:0};pT.exports=function wcwidth(pT){return wcswidth(pT,RE)};pT.exports.config=function(pT){pT=BE(pT||{},RE);return function wcwidth(xT){return wcswidth(xT,pT)}};function wcswidth(pT,xT){if(typeof pT!=="string")return wcwidth(pT,xT);var OT=0;for(var BE=0;BE<pT.length;BE++){var LE=wcwidth(pT.charCodeAt(BE),xT);if(LE<0)return-1;OT+=LE}return OT}function wcwidth(pT,xT){if(pT===0)return xT.nul;if(pT<32||pT>=127&&pT<160)return xT.control;if(bisearch(pT))return 0;return 1+(pT>=4352&&(pT<=4447||pT==9001||pT==9002||pT>=11904&&pT<=42191&&pT!=12351||pT>=44032&&pT<=55203||pT>=63744&&pT<=64255||pT>=65040&&pT<=65049||pT>=65072&&pT<=65135||pT>=65280&&pT<=65376||pT>=65504&&pT<=65510||pT>=131072&&pT<=196605||pT>=196608&&pT<=262141))}function bisearch(pT){var xT=0;var OT=LE.length-1;var BE;if(pT<LE[0][0]||pT>LE[OT][1])return false;while(OT>=xT){BE=Math.floor((xT+OT)/2);if(pT>LE[BE][1])xT=BE+1;else if(pT<LE[BE][0])OT=BE-1;else return true}return false}},6615:pT=>{"use strict";pT.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')},2357:pT=>{"use strict";pT.exports=require("assert")},4293:pT=>{"use strict";pT.exports=require("buffer")},3129:pT=>{"use strict";pT.exports=require("child_process")},8614:pT=>{"use strict";pT.exports=require("events")},5747:pT=>{"use strict";pT.exports=require("fs")},2282:pT=>{"use strict";pT.exports=require("module")},2087:pT=>{"use strict";pT.exports=require("os")},5622:pT=>{"use strict";pT.exports=require("path")},1058:pT=>{"use strict";pT.exports=require("readline")},2413:pT=>{"use strict";pT.exports=require("stream")},3867:pT=>{"use strict";pT.exports=require("tty")},1669:pT=>{"use strict";pT.exports=require("util")}};var xT={};function __nccwpck_require__(OT){var BE=xT[OT];if(BE!==undefined){return BE.exports}var LE=xT[OT]={id:OT,loaded:false,exports:{}};var RE=true;try{pT[OT].call(LE.exports,LE,LE.exports,__nccwpck_require__);RE=false}finally{if(RE)delete xT[OT]}LE.loaded=true;return LE.exports}(()=>{__nccwpck_require__.n=pT=>{var xT=pT&&pT.__esModule?()=>pT["default"]:()=>pT;__nccwpck_require__.d(xT,{a:xT});return xT}})();(()=>{__nccwpck_require__.d=(pT,xT)=>{for(var OT in xT){if(__nccwpck_require__.o(xT,OT)&&!__nccwpck_require__.o(pT,OT)){Object.defineProperty(pT,OT,{enumerable:true,get:xT[OT]})}}}})();(()=>{__nccwpck_require__.o=(pT,xT)=>Object.prototype.hasOwnProperty.call(pT,xT)})();(()=>{__nccwpck_require__.r=pT=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(pT,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(pT,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=pT=>{pT.paths=[];if(!pT.children)pT.children=[];return pT}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var OT={};(()=>{"use strict";__nccwpck_require__.r(OT);var pT=__nccwpck_require__(1904);var xT=__nccwpck_require__(970);var BE=__nccwpck_require__.n(xT);var LE=__nccwpck_require__(5622);var RE=__nccwpck_require__.n(LE);var ME=__nccwpck_require__(5747);var jE=__nccwpck_require__.n(ME);var VE=__nccwpck_require__(6155);var UE=__nccwpck_require__(7314);var JE=__nccwpck_require__(9882);var qE=__nccwpck_require__(5655);let makeExtractTagsFromSource=pT=>xT=>{const OT=(0,UE.getLocator)(xT);const BE=[];let LE;while((LE=pT.exec(xT))!==null){let pT=OT(LE.index);let xT=OT(LE.index+LE[0].length);BE.push({content:LE[0],start:pT.character,end:xT.character})}return BE};const KE=new RegExp(/(?<=\%relay\([\s]*`)[\s\S.]+?(?=`[\s]*\))/g);const zE=makeExtractTagsFromSource(KE);function prettify(pT){return(0,JE.format)(pT,{parser:"graphql",plugins:[qE]}).replace(/^\s+|\s+$/g,"")}const padOperation=(pT,xT)=>pT.split("\n").map((pT=>" ".repeat(xT)+pT)).join("\n");const GE=new RegExp(/^[\s]*(?=[\w])/g);const $E=new RegExp(/[\s]*$/g);const findOperationPadding=pT=>{const xT=(pT.match(GE)||[]).pop();const OT=(xT||"").split("\n").pop();return OT?OT.length:0};const restoreOperationPadding=(pT,xT)=>{const OT=(xT.match($E)||[]).join("");return"\n"+padOperation(pT,findOperationPadding(xT))+OT};const isNodeInterfaceWithSingleMember=pT=>{var xT;const OT=pT.selectionSet.selections.find((pT=>pT.kind==="Field"&&pT.name.value==="node"));if((OT===null||OT===void 0?void 0:OT.kind)==="Field"){const pT=(xT=OT.selectionSet)===null||xT===void 0?void 0:xT.selections.filter((pT=>pT.kind==="InlineFragment"));return(pT===null||pT===void 0?void 0:pT.length)===1}return false};const namedPathOfAncestors=pT=>(pT||[]).reduce(((pT,xT)=>{var OT,BE;if(Array.isArray(xT)){return pT}const LE=xT;switch(LE.kind){case"Field":return[...pT,LE.name.value];case"InlineFragment":return[...pT,(BE=(OT=LE.typeCondition)===null||OT===void 0?void 0:OT.name.value)!==null&&BE!==void 0?BE:""];default:return pT}}),[]).join("_");const getPathAssets=({unusedFieldPaths:pT,fieldName:xT,ancestors:OT})=>{const BE=namedPathOfAncestors(OT);const LE=BE===""?xT:[namedPathOfAncestors(OT),xT].join("_");const RE=`${LE}.`;const ME=pT.filter((pT=>pT.startsWith(RE))).map((pT=>pT.slice(RE.length)));return{fieldsToRemove:ME,shouldRemoveFullSelection:pT.includes(LE),path:LE,ancestorPath:BE}};const removeUnusedFieldsFromOperation=({definition:pT,unusedFieldPaths:xT})=>{let OT=false;const BE=(0,VE.Vn3)(pT,{InlineFragment(OT,BE,LE,RE,ME){if(OT.typeCondition==null)return OT;const jE=namedPathOfAncestors(ME);const VE=jE==="node"&&isNodeInterfaceWithSingleMember(pT);const UE=VE?jE:[jE,OT.typeCondition.name.value].filter((pT=>pT!=="")).join("_");const JE=`${UE}.`;const qE=xT.filter((pT=>pT.startsWith(JE))).map((pT=>pT.slice(JE.length)));if(qE.length>0){const pT=qE.includes("fragmentRefs");const xT=Object.assign(Object.assign({},OT.selectionSet),{selections:OT.selectionSet.selections.filter((xT=>{var OT,BE;if(xT.kind==="FragmentSpread"&&pT){return false}if(xT.kind==="Field"){const pT=(BE=(OT=xT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:xT.name.value;return!qE.includes(pT)}return true}))});if(xT.selections.length===0){return null}return Object.assign(Object.assign({},OT),{selectionSet:xT})}return OT},FragmentDefinition(pT){const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},OperationDefinition(pT){if(pT.operation!=="query"){return pT}const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},Field(pT,OT,BE,LE,RE){var ME,jE,VE,UE;const JE=(jE=(ME=pT.alias)===null||ME===void 0?void 0:ME.value)!==null&&jE!==void 0?jE:pT.name.value;const{fieldsToRemove:qE,shouldRemoveFullSelection:KE}=getPathAssets({unusedFieldPaths:xT,fieldName:JE,ancestors:RE});if(KE){return null}if(qE.length>0){const xT=qE.includes("fragmentRefs");const OT=(UE=(VE=pT.selectionSet)===null||VE===void 0?void 0:VE.selections)===null||UE===void 0?void 0:UE.filter((pT=>{var OT,BE;if(pT.kind==="FragmentSpread"&&xT){return false}if(pT.kind==="Field"){const xT=(BE=(OT=pT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:pT.name.value;return!qE.includes(xT)}return true}));const BE={kind:"Field",name:{kind:"Name",value:"__typename"}};return Object.assign(Object.assign({},pT),{selectionSet:{kind:"SelectionSet",selections:(OT===null||OT===void 0?void 0:OT.length)===0?[BE]:OT}})}return pT}});if(OT){return null}return BE};const WE=new RegExp(/(?<=__generated__\/)[A-Za-z_0-9]+(?=_graphql\.res)/g);const YE=new RegExp(/(?<=Types\.(fragment|response)[_.])[A-Za-z_.0-9]+(?= )/g);const HE=new RegExp(/Types\.(fragment|response)/g);const processReanalyzeOutput=pT=>{const xT=pT.split(/\n\n/g).filter((pT=>pT.match(HE))).reduce(((pT,xT)=>{var OT,BE;const LE=xT.includes("Types.fragment")?"fragment":"query";const RE=(OT=xT.match(WE))===null||OT===void 0?void 0:OT[0];const ME=RE==null?null:`${RE}_graphql.res`;const jE=(BE=xT.match(YE))===null||BE===void 0?void 0:BE[0];if(LE==="query"&&!(RE===null||RE===void 0?void 0:RE.toLowerCase().endsWith("query"))){return pT}if(jE==="id"){return pT}if(jE===null||jE===void 0?void 0:jE.endsWith("__typename")){return pT}if(RE==null||jE==null||ME==null){return pT}pT[ME]=pT[ME]||{type:LE,graphqlName:RE,unusedFieldPaths:[]};pT[ME].unusedFieldPaths.push(jE);return pT}),{});return xT};const maybePluralize=(pT,xT)=>{if(xT===1){return`${xT} ${pT}`}return`${xT} ${pT}s`};var XE=__nccwpck_require__(7519);var QE=__nccwpck_require__.n(XE);var ZE=__nccwpck_require__(6743);var eC=__nccwpck_require__.n(ZE);var tC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const loadRelayConfig=()=>{const pT=eC().loadConfig();if(!pT){console.error("Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work.");process.exit(1)}if(!pT.artifactDirectory){console.error("RescriptRelay requires you to define 'artifactDirectory' (for outputing generated files in a single directory) in your relay.config.js. Please define it and re-run this command.");process.exit(1)}return pT};const getRelayArtifactDirectoryLocation=pT=>{const xT=RE().resolve(RE().join(process.cwd(),pT.artifactDirectory));return xT};const getAllGeneratedFiles=pT=>tC(void 0,void 0,void 0,(function*(){const xT=yield QE()(`${pT}/*.res`,{absolute:true,onlyFiles:true});return xT}));const rC=new RegExp(/(?<=\/\* @sourceLoc )[A-Za-z_.0-9]+(?= \*\/)/g);const findAllSourceFilesFromGeneratedFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=yield Promise.all(pT.map((pT=>tC(void 0,void 0,void 0,(function*(){var OT;if(xT!=null){xT.text=`Checking ${RE().basename(pT)}...`}const BE=yield jE().promises.readFile(pT,{encoding:"utf-8"});return(OT=BE.match(rC))===null||OT===void 0?void 0:OT[0]})))));const BE=OT.reduce(((pT,xT)=>{if(xT!=null){const OT=xT;if(!pT.includes(OT)){pT.push(OT)}return pT}return pT}),[]);return BE}));const getSrcCwd=pT=>RE().resolve(RE().join(process.cwd(),pT));const findSourceFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=getSrcCwd(xT);const BE=yield QE()(pT.map((pT=>`**/${pT}`)),{cwd:OT,absolute:true,onlyFiles:true});return BE}));const formatOperationsInDocument=pT=>{const xT=zE(pT);if(xT.length===0){return pT}let OT="";for(let BE=0;BE<=xT.length-1;BE+=1){const LE=xT[BE];const RE=xT[BE-1];const ME=RE==null?0:RE.end;OT+=pT.slice(ME,LE.start);OT+=restoreOperationPadding(prettify(LE.content),LE.content)}const BE=xT[xT.length-1];OT+=pT.slice(BE.end);return OT};var nC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addFormatGraphQLCommands=pT=>{pT.command("format-all-graphql").option("--ci","CI mode: Exit if unformatted files are encountered.").description("Format all GraphQL operations in project.").action((({ci:pT})=>nC(void 0,void 0,void 0,(function*(){const xT=loadRelayConfig();const OT=getRelayArtifactDirectoryLocation(xT);const LE=BE()("Findings files to format").start();const ME=yield getAllGeneratedFiles(OT);const VE=yield findAllSourceFilesFromGeneratedFiles(ME,LE);LE.text=`Searching for ${maybePluralize("source file",VE.length)}.`;const UE=yield findSourceFiles(VE,xT.src);const JE=yield Promise.all(UE.map((xT=>nC(void 0,void 0,void 0,(function*(){LE.text=`${pT?"Checking":"Formatting"} "${RE().basename(xT)}".`;const OT=yield jE().promises.readFile(xT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE&&!pT){yield jE().promises.writeFile(xT,BE)}return OT!==BE})))));const qE=JE.filter((pT=>pT===true)).length;if(pT){if(qE===0){LE.succeed(`Done! None of ${maybePluralize("file",UE.length)} in need of formatting.`);process.exit(0)}else{LE.fail(`${maybePluralize("file",qE)} needs formatting.`);process.exit(1)}}else{if(qE===0){LE.succeed(`Done! None of ${maybePluralize("scanned file",UE.length)} needed formatting.`)}else{LE.succeed(`Done! Formatted ${maybePluralize("file",qE)} of ${maybePluralize("scanned file",UE.length)}.`)}}}))));pT.command("format-single-graphql").description("Format GraphQL operations in single file.").argument("<file>","Path to file to format. Must be absolute.").action((pT=>nC(void 0,void 0,void 0,(function*(){const xT=BE()("Formatting file..").start();const OT=yield jE().promises.stat(pT,{throwIfNoEntry:false});if(OT==null){xT.fail("File does not exist.");process.exit(1)}try{const OT=yield jE().promises.readFile(pT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE){yield jE().promises.writeFile(pT,BE);xT.succeed("Successfully formatted file.")}else{xT.succeed("File already formatted.")}}catch(pT){xT.fail("Could not format file.");process.exit(1)}}))))};var iC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addDebugCommand=pT=>{pT.command("debug").description("Prints debug information for the CLI.").action((()=>iC(void 0,void 0,void 0,(function*(){const pT=loadRelayConfig();const xT=getRelayArtifactDirectoryLocation(pT);console.log(`Artifact directory location: ${xT}\n`);console.log("Getting all generated files...\n");const OT=yield getAllGeneratedFiles(xT);console.log(`Number of generated files found in artifact directory: ${OT.length}\n`);console.log("Looking up source files\n");const BE=yield findAllSourceFilesFromGeneratedFiles(OT);console.log(`Found ${BE.length} source locations with explicit definitions.\n`);console.log("Looking up source files..\n");const LE=yield findSourceFiles(BE,pT.src);console.log(`Found ${LE.length} actual source files, when looking in ${getSrcCwd(pT.src)}.\n`);console.log("Done!")}))))};var aC=__nccwpck_require__(3129);var oC=__nccwpck_require__.n(aC);var sC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addRemoveUnusedFieldsCommand=pT=>{pT.command("remove-unused-fields").option("--verbose","Verbose mode").option("--debug","Debug mode").option("--ci","CI mode: Exit if unused fields exist, but don't remove them.").description("Remove unused GraphQL selections in fragments in current project.").action((({ci:pT,verbose:xT,debug:OT})=>{var LE;const ME=loadRelayConfig();const UE=getRelayArtifactDirectoryLocation(ME);const JE=BE()("Analyzing ReScript project").start();const qE=oC().spawn("npx",["reanalyze","-dce"]);if(qE.stdout==null){console.error("Something went wrong.");process.exit(1)}let KE="";qE.stdout.on("data",(pT=>{KE+=pT}));(LE=qE.stderr)===null||LE===void 0?void 0:LE.on("data",(pT=>{if(pT.includes("End_of_file")){JE.fail(`Something went wrong trying to analyze the ReScript project. Try cleaning your ReScript project and rebuilding it from scratch before trying again.`)}else{JE.fail(`Something went wrong trying to analyze the ReScript project.`)}if(OT){console.error(pT)}process.exit(1)}));qE.on("close",(()=>sC(void 0,void 0,void 0,(function*(){JE.text="Analyzing GraphQL usage";const BE=processReanalyzeOutput(KE);if(OT){console.log(`Found ${maybePluralize("file",Object.keys(BE).length)} with potentially missing fields.`)}const LE=[];JE.text="Scanning fragment files";if(OT){console.log(`Extracing source locations for ${maybePluralize("files",Object.keys(BE).length)}.`)}yield Promise.all(Object.entries(BE).map((([pT,xT])=>sC(void 0,void 0,void 0,(function*(){var OT;const BE=RE().resolve(UE,pT);try{const pT=yield jE().promises.readFile(BE,{encoding:"utf-8"});const RE=(OT=pT.match(rC))===null||OT===void 0?void 0:OT[0];if(RE!=null){LE.push(Object.assign(Object.assign({},xT),{sourceLocation:RE}))}}catch(pT){console.error(pT)}})))));JE.text=`Findings files`;const qE=LE.map((pT=>({path:pT.sourceLocation,graphqlName:pT.graphqlName})));const GE=yield findSourceFiles(qE.map((pT=>pT.path)),ME.src);const $E=GE.map((pT=>{const xT=LE.find((xT=>pT.endsWith(xT.sourceLocation)));if(xT!=null){return Object.assign(Object.assign({},xT),{absoluteFilePath:pT})}}));JE.text=`Analyzing found files`;const WE=[];yield Promise.all($E.map((pT=>sC(void 0,void 0,void 0,(function*(){var xT;if(pT==null)return;try{const OT=yield jE().promises.readFile(pT.absoluteFilePath,{encoding:"utf-8"});const BE=zE(OT);let LE=null;let RE=null;for(const OT of BE){const BE=(0,VE.Qc3)(OT.content);const ME=BE.definitions[0];if(ME==null){continue}if((ME.kind==="OperationDefinition"||ME.kind==="FragmentDefinition")&&((xT=ME.name)===null||xT===void 0?void 0:xT.value)===pT.graphqlName){LE=BE;RE=OT;break}}if(LE==null||RE==null)return;const ME=LE.definitions[0];if(ME==null||!(ME.kind==="FragmentDefinition"||ME.kind==="OperationDefinition")){return}WE.push(Object.assign({targetDef:ME,fileContents:OT,targetTag:RE},pT))}catch(pT){console.error(pT)}})))));if(xT&&LE.length>0){console.log(`\n\n------\nUnused fields: \n`,WE.map((pT=>`${pT.type==="fragment"?"Fragment":"Query"} "${pT.graphqlName}" in ${pT.sourceLocation}: \n ${pT.unusedFieldPaths.join("\n ")}`)).join("\n\n"),`\n------\n\n`)}if(pT){if(WE.length===0){JE.succeed("No unused fields found.");process.exit(0)}else{JE.fail(`Found ${WE.length} file(s) with unused fields.`);process.exit(1)}}JE.text=`Removing unused fields`;yield Promise.all(WE.map((({targetDef:pT,unusedFieldPaths:xT,targetTag:OT,absoluteFilePath:BE,fileContents:LE})=>sC(void 0,void 0,void 0,(function*(){const RE=removeUnusedFieldsFromOperation({definition:pT,unusedFieldPaths:xT});const ME=RE==null?"# This module is unused and can be removed":restoreOperationPadding(prettify((0,VE.S0v)(RE)),OT.content);yield jE().promises.writeFile(BE,`${LE.slice(0,OT.start)}${ME}${LE.slice(OT.end)}`)})))));const YE=WE.reduce(((pT,xT)=>{var OT;return pT+((OT=xT===null||xT===void 0?void 0:xT.unusedFieldPaths.length)!==null&&OT!==void 0?OT:0)}),0);if(YE===0){JE.succeed("Done! No unused fields found.")}else{JE.succeed(`Done! Removed ${maybePluralize("field",YE)} from ${maybePluralize("file",WE.length)}.`)}}))))}))};pT.program.version("0.1.0");addFormatGraphQLCommands(pT.program);addDebugCommand(pT.program);addRemoveUnusedFieldsCommand(pT.program);pT.program.parse(process.argv)})();module.exports=OT})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rescript-relay",
3
- "version": "0.0.0-test-rust-compiler-cc037019",
3
+ "version": "0.0.0-test-rust-compiler-a2f32b9e",
4
4
  "main": "src/RescriptRelay.res",
5
5
  "license": "MIT",
6
6
  "author": "Gabriel Nordeborn",
@@ -35,7 +35,6 @@
35
35
  "@testing-library/jest-dom": "^5.16.1",
36
36
  "@testing-library/react": "^13.0.0-alpha.5",
37
37
  "bs-fetch": "^0.5.0",
38
- "graphql": "14.5.0",
39
38
  "graphql-query-test-mock": "^0.12.1",
40
39
  "jest": "^27.2.4",
41
40
  "nock": "^11.7.0",
@@ -47,9 +46,7 @@
47
46
  },
48
47
  "peerDependencies": {
49
48
  "@rescript/react": "*",
50
- "graphql": "*",
51
49
  "react-relay": "*",
52
- "relay-config": "*",
53
50
  "relay-runtime": "*",
54
51
  "rescript": "^9.1.2"
55
52
  },
Binary file
Binary file
Binary file
@@ -39,6 +39,8 @@ type featureFlags = {
39
39
  mutable enableRelayContainersSuspense: bool,
40
40
  @as("ENABLE_PRECISE_TYPE_REFINEMENT")
41
41
  mutable enablePrecisTypeRefinement: bool,
42
+ @as("ENABLE_REQUIRED_DIRECTIVES")
43
+ mutable enableRequiredDirective: bool,
42
44
  }
43
45
 
44
46
  @module("relay-runtime")
@@ -98,6 +98,8 @@ type featureFlags = {
98
98
  mutable enableRelayContainersSuspense: bool,
99
99
  @as("ENABLE_PRECISE_TYPE_REFINEMENT")
100
100
  mutable enablePrecisTypeRefinement: bool,
101
+ @as("ENABLE_REQUIRED_DIRECTIVES")
102
+ mutable enableRequiredDirective: bool,
101
103
  }
102
104
 
103
105
  @ocaml.doc(
@@ -315,6 +315,7 @@ function RescriptRelayRouter$Link(Props) {
315
315
  var className = Props.className;
316
316
  var classNameDynamic = Props.classNameDynamic;
317
317
  var browserTarget = Props.target;
318
+ var tabIndex = Props.tabIndex;
318
319
  var mode = Props.mode;
319
320
  var render = Props.render;
320
321
  var preloadOnHover = Props.preloadOnHover;
@@ -393,6 +394,9 @@ function RescriptRelayRouter$Link(Props) {
393
394
  if (id !== undefined) {
394
395
  tmp.id = Caml_option.valFromOption(id);
395
396
  }
397
+ if (tabIndex !== undefined) {
398
+ tmp.tabIndex = Caml_option.valFromOption(tabIndex);
399
+ }
396
400
  if (title !== undefined) {
397
401
  tmp.title = Caml_option.valFromOption(title);
398
402
  }
@@ -306,6 +306,7 @@ module Link = {
306
306
  ~className=?,
307
307
  ~classNameDynamic=?,
308
308
  ~target as browserTarget=?,
309
+ ~tabIndex=?,
309
310
  ~mode=?,
310
311
  ~render=?,
311
312
  ~preloadOnHover=?,
@@ -351,6 +352,7 @@ module Link = {
351
352
  }}
352
353
  ?title
353
354
  ?id
355
+ ?tabIndex
354
356
  className={className->Belt.Option.getWithDefault("") ++
355
357
  switch classNameDynamic {
356
358
  | Some(f) => " " ++ f(url, to_->Url.make)
@@ -56,6 +56,7 @@ module Link: {
56
56
  ~className: string=?,
57
57
  ~classNameDynamic: (RescriptReactRouter.url, RescriptReactRouter.url) => string=?,
58
58
  ~target: [#self | #blank]=?,
59
+ ~tabIndex: int=?,
59
60
  ~mode: [#push | #replace]=?,
60
61
  ~render: (
61
62
  ~preload: unit => unit,
package/src/utils.js CHANGED
@@ -270,7 +270,7 @@ function traverse(
270
270
  */
271
271
  function traverser(
272
272
  root,
273
- _instructionMaps,
273
+ instructionMaps_,
274
274
  theConverters,
275
275
  nullableValue,
276
276
  rootObjectKey
@@ -279,7 +279,7 @@ function traverser(
279
279
  return nullableValue;
280
280
  }
281
281
 
282
- var instructionMaps = _instructionMaps || {};
282
+ var instructionMaps = instructionMaps_ || {};
283
283
  var instructionMap = instructionMaps[rootObjectKey || "__root"];
284
284
 
285
285
  // No instructions
@@ -305,7 +305,15 @@ function traverser(
305
305
  return nullableValue;
306
306
  }
307
307
 
308
- var n = unionRootConverter != null ? [v.__typename] : [];
308
+ var n = [];
309
+
310
+ // Since a root level union is treated as a "new root level", we'll need
311
+ // to do a separate check here of whether there's a fragment on the root
312
+ // we need to account for, or not.
313
+ if (unionRootConverter != null) {
314
+ n = [v.__typename];
315
+ fragmentsOnRoot = (instructionMap[v.__typename] || {}).f === "";
316
+ }
309
317
 
310
318
  var traversedObj = traverse(
311
319
  instructionMaps,
@@ -326,7 +334,14 @@ function traverser(
326
334
 
327
335
  var newObj = Object.assign({}, root);
328
336
 
329
- var n = unionRootConverter != null ? [newObj.__typename] : [];
337
+ var n = [];
338
+
339
+ // Same as in the union array check above - if there's a fragment in the new
340
+ // root created by the union, we need to account for that separately here.
341
+ if (unionRootConverter != null) {
342
+ n = [newObj.__typename];
343
+ fragmentsOnRoot = (instructionMap[newObj.__typename] || {}).f === "";
344
+ }
330
345
 
331
346
  var v = traverse(
332
347
  instructionMaps,