rescript-relay 0.0.0-pre-6d86bd52 → 0.0.0-test-rust-compiler-d2204036

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,20 +1,41 @@
1
1
  # master
2
2
 
3
+ # 0.23.0
4
+
5
+ _[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
6
+
7
+ Finally, a new release! This brings the Relay version to 12, and the React version to 18 (in rc.0 at the time of writing). This release has a few breaking changes which are necessary as we're slowly approaching version 1.0.0 of RescriptRelay. Check the new "Migrations" section below for a few scripts you can run to help the migration.
8
+
3
9
  ## Upgrade versions
4
10
 
5
11
  - `react-relay` to `12.0.0`
6
12
  - `relay-compiler` to `12.0.0`
7
13
  - `relay-config` to `12.0.0`
8
14
  - `relay-runtime` to `12.0.0`
9
- - `react` to `alpha`
10
- - `react-dom` to `alpha`
15
+
16
+ React to React 18 rc:
17
+
18
+ - `react` to `rc` (`yarn add react@rc`)
19
+ - `react-dom` to `rc`(`yarn add react-dom@rc`)
20
+
21
+ ## Migrations
22
+
23
+ Want help migrating most of the changes in this release? Install [comby](https://comby.dev) and run the migrations below (paste them into your terminal at the root of your project). Comby will guide you through the proposed changes.
24
+
25
+ - `comby 'ReactExperimental.unstable_useDeferredValue(:[1])' 'ReactExperimental.useDeferredValue(:[1])' .res -matcher .re -exclude-dir node_modules -review`
26
+ - `comby 'ReactExperimental.renderConcurrentRootAtElementWithId' 'ReactDOMExperimental.renderConcurrentRootAtElementWithId' .res -matcher .re -exclude-dir node_modules -review`
27
+ - `comby 'let (:[1], :[2]) = ReactExperimental.unstable_useTransition()' 'let (:[2], :[1]) = ReactExperimental.useTransition()' .res -matcher .re -exclude-dir node_modules -review`
11
28
 
12
29
  ## Breaking changes
13
30
 
14
- - Remove `reason-promise`. We're waiting for the official new Promise bindings, but since they seem to be quite far away, we'll have to revert back to stock `Js.Promise` for now. This is because `reason-promise` clashes with other Promise bindings that people might want to use before the new official ones are actually shipped.
15
- - `ReactExperimental.unstable_useTransition` is now called `ReactExperimental.useTransition`, and the order of the tuple that's returned has been reversed to align with the underlying API. This means that what was before `let (startTransition, isTransitioning) = ReactExperimental.unstable_useTransition()` is now `let (isTransitioning, startTransition) = ReactExperimental.useTransition()`.
16
- - `ReactExperimental.unstable_useDeferredValue` is now called `ReactExperimental.useDeferredValue`.
17
- - `ReactExperimental.renderConcurrentRootAtElementWithId` has moved to `ReactDOMExperimental`: `ReactDOMExperimental.renderConcurrentRootAtElementWithId`.
31
+ - Remove `reason-promise` (unless you're using it for something else yourself and want to keep it). We're waiting for the official new Promise bindings, but since they seem to be quite far away, we'll have to revert back to stock `Js.Promise` for now. This is because `reason-promise` clashes with other Promise bindings that people might want to use before the new official ones are actually shipped.
32
+ - `ReactExperimental.unstable_useTransition` is now called `ReactExperimental.useTransition`, and the order of the tuple that's returned has been reversed to align with the underlying API. This means that what was before `let (startTransition, isTransitioning) = ReactExperimental.unstable_useTransition()` is now `let (isTransitioning, startTransition) = ReactExperimental.useTransition()` (migration available above).
33
+ - `ReactExperimental.unstable_useDeferredValue` is now called `ReactExperimental.useDeferredValue` (migration available above).
34
+ - `ReactExperimental.renderConcurrentRootAtElementWithId` has moved to `ReactDOMExperimental`: `ReactDOMExperimental.renderConcurrentRootAtElementWithId` (migration available above).
35
+
36
+ ## Fixes & misc
37
+
38
+ - You're now allowed to configure Relay via `package.json`.
18
39
 
19
40
  # 0.22.0
20
41
 
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=()=>{let pT=null;try{pT=jE().statSync(RE().resolve(RE().join(process.cwd(),"relay.config.js")),{throwIfNoEntry:false})}catch(pT){}if(pT==null){console.error("relay.config.js must exist in the current working directory this script runs in.");process.exit(1)}const xT=eC().loadConfig();if(!xT){console.error("Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work.");process.exit(1)}if(!xT.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 xT};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)}})))));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})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rescript-relay",
3
- "version": "0.0.0-pre-6d86bd52",
3
+ "version": "0.0.0-test-rust-compiler-d2204036",
4
4
  "main": "src/RescriptRelay.res",
5
5
  "license": "MIT",
6
6
  "author": "Gabriel Nordeborn",
@@ -20,48 +20,44 @@
20
20
  "rescript"
21
21
  ],
22
22
  "bin": {
23
- "rescript-relay-compiler": "compiler/compiler-cli.js",
23
+ "rescript-relay-compiler": "relay-compiler",
24
24
  "rescript-relay-cli": "cli/cli.js"
25
25
  },
26
26
  "scripts": {
27
27
  "build": "rescript build -with-deps",
28
- "build:test": "compiler/compiler-cli.js",
28
+ "build:test": "./build-compiler-dev.sh && ./relay-compiler",
29
29
  "postinstall": "node postinstall.js",
30
30
  "test": "jest",
31
31
  "test:ci": "jest --ci --runInBand"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@rescript/react": "0.10.3",
35
- "@testing-library/jest-dom": "^5.14.1",
36
- "@testing-library/react": "^13.0.0-alpha.1",
35
+ "@testing-library/jest-dom": "^5.16.1",
36
+ "@testing-library/react": "^13.0.0-alpha.5",
37
37
  "bs-fetch": "^0.5.0",
38
38
  "graphql": "14.5.0",
39
39
  "graphql-query-test-mock": "^0.12.1",
40
40
  "jest": "^27.2.4",
41
41
  "nock": "^11.7.0",
42
42
  "node-fetch": "^2.6.0",
43
- "react": "0.0.0-experimental-d174d063d-20210922",
44
- "react-dom": "0.0.0-experimental-d174d063d-20210922",
43
+ "react": "^18.0.0-rc.0",
44
+ "react-dom": "^18.0.0-rc.0",
45
45
  "react-relay": "12.0.0",
46
- "relay-compiler": "12.0.0",
47
- "relay-config": "12.0.0",
48
46
  "relay-runtime": "12.0.0"
49
47
  },
50
48
  "peerDependencies": {
51
49
  "@rescript/react": "*",
52
50
  "graphql": "*",
53
51
  "react-relay": "*",
54
- "relay-compiler": "*",
55
52
  "relay-config": "*",
56
53
  "relay-runtime": "*",
57
54
  "rescript": "^9.1.2"
58
55
  },
59
56
  "dependencies": {
60
- "mkdirp-sync": "^0.0.3",
61
57
  "rescript": "^9.1.2"
62
58
  },
63
59
  "resolutions": {
64
- "react": "0.0.0-experimental-d174d063d-20210922",
65
- "react-dom": "0.0.0-experimental-d174d063d-20210922"
60
+ "react": "18.0.0-rc.0",
61
+ "react-dom": "18.0.0-rc.0"
66
62
  }
67
63
  }
package/postinstall.js CHANGED
@@ -10,16 +10,27 @@
10
10
  var path = require("path");
11
11
  var cp = require("child_process");
12
12
  var fs = require("fs");
13
- var os = require("os");
14
13
  var platform = process.platform;
15
14
 
15
+ function getRelayCompilerPlatformSuffix() {
16
+ if (process.platform === "darwin" && process.arch === "x64") {
17
+ return "macos-x64";
18
+ } else if (process.platform === "darwin" && process.arch === "arm64") {
19
+ return "macos-arm64";
20
+ } else if (process.platform === "linux" && process.arch === "x64") {
21
+ return "linux-x64";
22
+ }
23
+
24
+ return "linux-x86";
25
+ }
26
+
16
27
  /**
17
28
  * Since os.arch returns node binary's target arch, not
18
29
  * the system arch.
19
30
  * Credits: https://github.com/feross/arch/blob/af080ff61346315559451715c5393d8e86a6d33c/index.js#L10-L58
20
31
  */
21
32
 
22
- function arch() {
33
+ function ppxArch() {
23
34
  /**
24
35
  * Use Rosetta for ARM on macOS
25
36
  */
@@ -80,39 +91,46 @@ function arch() {
80
91
  }
81
92
 
82
93
  function copyPlatformBinaries(platform) {
94
+ /**
95
+ * Copy the PPX
96
+ */
83
97
  fs.copyFileSync(
84
98
  path.join(__dirname, "ppx-" + platform),
85
99
  path.join(__dirname, "ppx")
86
100
  );
87
101
  fs.chmodSync(path.join(__dirname, "ppx"), 0777);
88
102
 
103
+ /**
104
+ * Copy the Relay compiler
105
+ */
106
+
89
107
  fs.copyFileSync(
90
- path.join(__dirname, "bin-" + platform),
91
- path.join(__dirname, "language-plugin", "RescriptRelayBin.exe")
92
- );
93
- fs.chmodSync(
94
- path.join(__dirname, "language-plugin", "RescriptRelayBin.exe"),
95
- 0777
108
+ path.join(
109
+ __dirname,
110
+ "relay-compiler-" + getRelayCompilerPlatformSuffix(),
111
+ "relay"
112
+ ),
113
+ path.join(__dirname, "relay-compiler")
96
114
  );
115
+ fs.chmodSync(path.join(__dirname, "relay-compiler"), 0777);
97
116
  }
98
117
 
99
118
  function removeInitialBinaries() {
100
119
  fs.unlinkSync(path.join(__dirname, "ppx-darwin"));
101
120
  fs.unlinkSync(path.join(__dirname, "ppx-linux"));
102
- fs.unlinkSync(path.join(__dirname, "bin-darwin"));
103
- fs.unlinkSync(path.join(__dirname, "bin-linux"));
121
+ fs.unlinkSync(path.join(__dirname, "relay-compiler-linux-x86"));
122
+ fs.unlinkSync(path.join(__dirname, "relay-compiler-macos-x86"));
123
+ fs.unlinkSync(path.join(__dirname, "relay-compiler-macos-arm64"));
104
124
  }
105
125
 
106
126
  switch (platform) {
107
127
  case "win32": {
108
- if (arch() !== "x64") {
128
+ if (ppxArch() !== "x64") {
109
129
  console.warn("error: x86 is currently not supported on Windows");
110
130
  process.exit(1);
111
131
  }
112
132
 
113
133
  throw new Error("Windows currently not supported.");
114
- copyPlatformBinaries("windows");
115
- break;
116
134
  }
117
135
  case "linux":
118
136
  case "darwin":
package/ppx-darwin CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -319,6 +319,7 @@ function RescriptRelayRouter$Link(Props) {
319
319
  var render = Props.render;
320
320
  var preloadOnHover = Props.preloadOnHover;
321
321
  var children = Props.children;
322
+ var onClick = Props.onClick;
322
323
  var router = React.useContext(context);
323
324
  var url = RescriptReactRouter.useUrl(undefined, undefined);
324
325
  var changeRoute = React.useCallback((function (e) {
@@ -369,7 +370,13 @@ function RescriptRelayRouter$Link(Props) {
369
370
  target: browserTarget !== undefined ? (
370
371
  browserTarget === "blank" ? "_blank" : "_self"
371
372
  ) : "",
372
- onClick: changeRoute,
373
+ onClick: (function (e) {
374
+ Curry._1(changeRoute, e);
375
+ if (onClick !== undefined) {
376
+ return Curry._1(onClick, undefined);
377
+ }
378
+
379
+ }),
373
380
  onMouseDown: (function (param) {
374
381
  return Curry._1(preload, undefined);
375
382
  }),
@@ -310,6 +310,7 @@ module Link = {
310
310
  ~render=?,
311
311
  ~preloadOnHover=?,
312
312
  ~children,
313
+ ~onClick=?,
313
314
  (),
314
315
  ) => {
315
316
  let router = use()
@@ -355,7 +356,13 @@ module Link = {
355
356
  | Some(f) => " " ++ f(url, to_->Url.make)
356
357
  | None => ""
357
358
  }}
358
- onClick=changeRoute
359
+ onClick={e => {
360
+ changeRoute(e)
361
+ switch onClick {
362
+ | None => ()
363
+ | Some(onClick) => onClick()
364
+ }
365
+ }}
359
366
  onMouseDown={_ => preload()}
360
367
  onTouchStart={_ => preload()}
361
368
  onMouseEnter={_ =>
@@ -65,6 +65,7 @@ module Link: {
65
65
  ) => React.element=?,
66
66
  ~preloadOnHover: bool=?,
67
67
  ~children: React.element,
68
+ ~onClick: unit => unit=?,
68
69
  unit,
69
70
  ) => React.element
70
71
  }
package/src/utils.js CHANGED
@@ -108,10 +108,7 @@ function traverse(
108
108
  ) {
109
109
  isUnion = true;
110
110
 
111
- var newPath = makeNewPath(currentPath, [
112
- key,
113
- v.__typename.toLowerCase(),
114
- ]);
111
+ var newPath = makeNewPath(currentPath, [key, v.__typename]);
115
112
 
116
113
  var unionRootHasFragment =
117
114
  (instructionMap[getPathName(newPath)] || {}).f === "";
@@ -186,10 +183,7 @@ function traverse(
186
183
  ) {
187
184
  isUnion = true;
188
185
 
189
- var newPath = makeNewPath(currentPath, [
190
- key,
191
- v.__typename.toLowerCase(),
192
- ]);
186
+ var newPath = makeNewPath(currentPath, [key, v.__typename]);
193
187
 
194
188
  var unionRootHasFragment =
195
189
  (instructionMap[getPathName(newPath)] || {}).f === "";
@@ -311,9 +305,11 @@ function traverser(
311
305
  return nullableValue;
312
306
  }
313
307
 
308
+ var n = unionRootConverter != null ? [v.__typename] : [];
309
+
314
310
  var traversedObj = traverse(
315
311
  instructionMaps,
316
- [],
312
+ n,
317
313
  v,
318
314
  instructionMap,
319
315
  converters,
@@ -330,9 +326,11 @@ function traverser(
330
326
 
331
327
  var newObj = Object.assign({}, root);
332
328
 
329
+ var n = unionRootConverter != null ? [newObj.__typename] : [];
330
+
333
331
  var v = traverse(
334
332
  instructionMaps,
335
- [],
333
+ n,
336
334
  newObj,
337
335
  instructionMap,
338
336
  converters,
package/bin-darwin DELETED
Binary file
package/bin-linux DELETED
Binary file
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env node
2
- const path = require("path");
3
- const { spawn } = require("child_process");
4
-
5
- let relayConfig = require("relay-config").loadConfig();
6
-
7
- if (!relayConfig) {
8
- console.error(
9
- "Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work."
10
- );
11
-
12
- process.exit(1);
13
- }
14
-
15
- if (!relayConfig.artifactDirectory) {
16
- console.error(
17
- "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."
18
- );
19
- process.exit(1);
20
- }
21
-
22
- function runRelayCompiler(args) {
23
- const proc = spawn("relay-compiler", args, {
24
- stdio: "inherit",
25
- })
26
- // Propagate the relay compiler's exit code.
27
- .on("close", process.exit.bind(process));
28
-
29
- process.on("SIGINT", () => {
30
- proc.kill("SIGINT");
31
- });
32
- }
33
-
34
- function findArg(name) {
35
- return relayConfig[name];
36
- }
37
-
38
- async function runCompiler() {
39
- const schemaPath = findArg("schema");
40
-
41
- if (schemaPath) {
42
- runRelayCompiler(
43
- [
44
- "--language",
45
- path.resolve(__dirname + "/../language-plugin/dist/index.js"),
46
- process.argv.find((a) => a === "--watch"),
47
- ].filter(Boolean)
48
- );
49
- } else {
50
- runRelayCompiler(["--help"]);
51
- }
52
- }
53
-
54
- runCompiler();
@@ -1 +0,0 @@
1
- module.exports=(()=>{"use strict";var e={338:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.find=void 0,t.find=function(e,t){return function(e,t){if(!e.includes("%relay"))return[];const n=e.match(/(?<=\[%relay)([\s\S]*?)(?=];)/g);if(n)return n.map((e=>({template:e.replace(/({\||\|})/g,""),keyName:null,sourceLocationOffset:{line:1,column:1}})));const r=e.match(/(?<=\%relay\([\s]*`)[\s\S.]+?(?=`[\s]*\))/g);return r?r.map((e=>({template:e,keyName:null,sourceLocationOffset:{line:1,column:1}}))):[]}(e)}},189:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generateFromFlowTypes=void 0;const r=n(129),o=n(622);t.generateFromFlowTypes=e=>{var t;const n=r.spawnSync(o.resolve(o.join(__dirname,"../RescriptRelayBin.exe")),["generate-from-flow"],{cwd:__dirname,stdio:"pipe",encoding:"utf-8",input:JSON.stringify(e)});if(0!==n.status)throw null!==(t=n.error)&&void 0!==t?t:new Error("Error generating types");return n.output.filter(Boolean).join("")}},571:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transforms=t.generate=void 0;const r=n(791),o=n(224),a=n(148),i=n(354),s=n(189),l=n(602);function c(e){const t=Object.assign({Int:"int",Float:"float"},e);return Object.keys(t).forEach((e=>{t[e]=l.maskDots(t[e])})),t}t.generate=function(e,t,n){var a;let i=r.generate(e,t,Object.assign(Object.assign({},n),{customScalars:c(n.customScalars)}));const l=o.makeOperationDescriptor(t),d=o.extractOperationInfo(t);return s.generateFromFlowTypes({content:i,operation_type:["Query","Mutation","Subscription"].includes(l.tag)?{operation:l.tag,operation_value:l.value}:{operation:"Fragment",fragment_value:l.value},print_config:{variables_holding_connection_ids:null!==(a=d.variablesHoldingConnectionIds)&&void 0!==a?a:null,connection:d.connection?{at_object_path:d.connection.atObjectPath,field_name:d.connection.fieldName,key:d.connection.key}:null}})},t.transforms=[i.transform,a.transform,...r.transforms]},942:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=n(366),o=n(622);e.exports=({moduleName:e,documentType:t,concreteText:n,typeText:a,definition:i})=>{let s=null;"Source"===i.loc.kind&&(s=o.basename(i.loc.source.name));const l="ConcreteRequest"===t&&e.toLowerCase().endsWith("query_graphql")?"include RescriptRelay.MakeLoadQuery({\n type variables = Types.variables\n type loadedQueryRef = queryRef\n type response = Types.response\n type node = relayOperationNode\n let query = node\n let convertVariables = Internal.convertVariables\n });":"",{processedText:c,referencedNodes:d}=r.processConcreteText(n),u=`%raw(json\` ${c} \`)`;return[s?`/* @sourceLoc ${s} */`:null,a||"",...d.length>0?[`%%private(let makeNode = (${d.map((({identifier:e})=>e)).join(", ")}): operationType => {`,...d.map((({identifier:e})=>` ignore(${e})`)),` ${u}`,"})",`let node: operationType = makeNode(${d.map((({moduleName:e})=>`${e}_graphql.node`)).join(", ")})`]:[`let node: operationType = ${u}`],"",l,""].filter((e=>null!=e)).join("\n")}},602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unmaskDots=t.maskDots=void 0,t.maskDots=e=>e.split(".").join("__oo__"),t.unmaskDots=e=>e.split("__oo__").join(".")},607:(e,t,n)=>{const r=n(571),o=n(942),{find:a}=n(338),i=n(622),s=n(747);function l(e){return t=>{const n=i.join(e,t.relPath);let r="";try{r=s.readFileSync(n,"utf8")}catch(e){return console.warn(`RelaySourceModuleParser: Unable to read the file "${n}". Looks like it was removed.`),!1}return r.indexOf("%relay")>=0}}e.exports=()=>({inputExtensions:["re","res"],outputExtension:"res",schemaExtensions:[],typeGenerator:r,formatModule:o,findGraphQLTags:a,isGeneratedFile:e=>e.endsWith("_graphql.res")||e.endsWith(".js")||e.endsWith(".mjs"),keepExtraFile:e=>e.endsWith(".js")||e.endsWith(".mjs"),getFileFilter:l,getModuleName:e=>`${e}_graphql`})},224:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.makeOperationDescriptor=t.extractOperationInfo=void 0;const r=n(195);function o(e,t,n){if("Root"===e.kind&&["mutation","subscription"].includes(e.operation)){const e=t.directives.filter((e=>["appendNode","prependNode","appendEdge","prependEdge","deleteEdge"].includes(e.name)));e.length>0&&e.forEach((e=>{const t=e.args.find((e=>"connections"===e.name)),r=null==t?void 0:t.value;r&&"Variable"===r.kind&&(n.variablesHoldingConnectionIds?n.variablesHoldingConnectionIds.push(r.variableName):n.variablesHoldingConnectionIds=[r.variableName])}))}}t.extractOperationInfo=function(e){let t={};const n="Fragment"===e.kind?"fragment":"response";return n?(function e(n,a){r.IRVisitor.visit(a,{ScalarField(e){o(a,e,t)},LinkedField(e){const r=e.directives.find((e=>"connection"===e.name));if(r&&!t.connection){let o=null;r.args.forEach((e=>{"key"===e.name&&"Literal"===e.value.kind&&(o=e.value.value)})),o&&(t=Object.assign(Object.assign({},t),{connection:{key:o,atObjectPath:[...n],fieldName:e.alias}}))}o(a,e,t),n.push(e.alias)},InlineFragment(t){t.typeCondition.name&&t.selections.forEach((r=>{e([...n,t.typeCondition.name.toLowerCase()],r)}))}})}([n],e),t):t},t.makeOperationDescriptor=function(e){if("Root"===e.kind)switch(e.operation){case"mutation":return{tag:"Mutation",value:e.name};case"query":return{tag:"Query",value:e.name};case"subscription":return{tag:"Subscription",value:e.name}}else if("Fragment"==e.kind)return{tag:"Fragment",value:[e.name,Boolean(e.metadata&&e.metadata.plural)]};throw new Error("Could not map root node. This should not happen.")}},148:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transform=void 0;const r=n(724),{createUserError:o}=n(182),a=["and","as","asr","assert","begin","class","constraint","do","while","for","done","while","for","downto","else","end","exception","external","false","for","fun","function","functor","if","in","include","inherit","initializer","land","lazy","let","lor","lsl","lsr","lxor","match","method","mod","module","open","mutable","new","nonrec","object","of","open","open!","or","private","rec","let","module","sig","struct","then","to","true","try","type","val","virtual","val","method","class","when","while","with","switch"];let i=["fragment","t_fragment","subscription","mutation","response","variables","refetchVariables","t","fragmentRef","fragmentRefs","fragmentRefSelector","operationType"];function s(e){if(e.alias){let{disallowed:t,message:n}=function(e){let t=e[0];return/[A-Z]/.test(t)?{disallowed:!0,message:`Field names may not start with an uppercase letter. Please alias the '${e}' field to something starting with a lowercase letter.`}:a.includes(e)?{disallowed:!0,message:`'${e}' is a reserved keyword in ReasonML and therefore cannot be used as a field name. Please alias your field to something else.`}:i.includes(e)?{disallowed:!0,message:`'${e}' is a reserved keyword in RescriptRelay and therefore cannot be used as a field name. Please alias your field to something else.`}:{disallowed:!1,message:""}}(e.alias);if(t)throw o("Found an invalid field name: "+n,[e.loc])}e.selections&&e.selections.forEach(s)}function l(e){return s(e),e}t.transform=function(e){return r.transform(e,{ScalarField:l,LinkedField:l})}},354:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transform=void 0;const r=n(724),{createUserError:o}=n(182),{hasUnaliasedSelection:a}=n(124);function i(e){const t=this.getContext().getSchema();let n=this.traverse(e);if(t.isAbstractType(t.getRawType(n.type))&&!a(n,"__typename"))throw o('Unions and interfaces must have the field __typename explicitly selected. Please add __typename to the fields selected by "'+e.alias+'" in your operation.',[e.loc]);return n}t.transform=function(e){return r.transform(e,{LinkedField:i})}},366:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.processConcreteText=void 0,t.processConcreteText=function(e){let t=/(require\('.\/)([A-Za-z_.0-9/]+)(.graphql'\))/gm,n=e;const r=[];let o;for(;null!==(o=t.exec(e));){let[e,t,a]=o;const i=`node_${a}`;r.push({moduleName:a,identifier:i}),n=n.replace(e,`node_${a}`)}return{processedText:n,referencedNodes:r}}},129:e=>{e.exports=require("child_process")},747:e=>{e.exports=require("fs")},622:e=>{e.exports=require("path")},195:e=>{e.exports=require("relay-compiler")},182:e=>{e.exports=require("relay-compiler/lib/core/CompilerError")},724:e=>{e.exports=require("relay-compiler/lib/core/IRTransformer")},791:e=>{e.exports=require("relay-compiler/lib/language/javascript/RelayFlowGenerator")},124:e=>{e.exports=require("relay-compiler/lib/transforms/TransformUtils")}},t={};return function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}(607)})();