rescript-relay 0.23.0 → 1.0.0-beta.11
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 +82 -0
- package/README.md +6 -10
- package/cli/cli.js +1 -1
- package/compiler.js +11 -0
- package/package.json +13 -12
- package/postinstall.js +40 -13
- package/ppx-darwin +0 -0
- package/ppx-linux +0 -0
- package/relay-compiler-linux-x64/relay +0 -0
- package/relay-compiler-macos-arm64/relay +0 -0
- package/relay-compiler-macos-x64/relay +0 -0
- package/src/RescriptRelay.bs.js +13 -1
- package/src/RescriptRelay.res +48 -5
- package/src/RescriptRelay.resi +45 -6
- package/src/experimental-router/RescriptRelayRouter.bs.js +12 -1
- package/src/experimental-router/RescriptRelayRouter.res +10 -1
- package/src/experimental-router/RescriptRelayRouter.resi +2 -0
- package/src/utils.js +182 -190
- package/src/utils.mjs +339 -0
- package/bin-darwin +0 -0
- package/bin-linux +0 -0
- package/compiler/compiler-cli.js +0 -54
- package/language-plugin/dist/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,89 @@
|
|
|
1
1
|
# master
|
|
2
2
|
|
|
3
|
+
# 1.0.0-beta.11
|
|
4
|
+
|
|
5
|
+
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/5831c2f1f0f13eedc1cb60468c32fd32b2dc01d3)_
|
|
6
|
+
|
|
7
|
+
The time has finally come - RescriptRelay `1.0.0` is in beta! The one, big major thing this release brings is that the ReScript type generation for the Relay compiler has been completely rewritten, and fully integrated into the new Relay Rust compiler. The RescriptRelay fork of the compiler is available and maintained [here])(https://github.com/zth/relay/tree/rescript-relay).
|
|
8
|
+
|
|
9
|
+
## Upgrade versions
|
|
10
|
+
|
|
11
|
+
- `react-relay` and `relay-runtime` to `13.0.1`
|
|
12
|
+
|
|
13
|
+
## Remove Packages
|
|
14
|
+
|
|
15
|
+
You can go ahead and remove these packages, that are no longer needed, as the compiler is now shipped in the main package:
|
|
16
|
+
|
|
17
|
+
- `relay-config`
|
|
18
|
+
- `relay-compiler`
|
|
19
|
+
- `graphql` (if you don't use it for anything else)
|
|
20
|
+
|
|
21
|
+
## Improvements
|
|
22
|
+
|
|
23
|
+
- The compiler itself should be _much_ faster than the old one. An order of magnitude faster. Especially for incremental compilation in watch mode.
|
|
24
|
+
- There's no longer any need to manually select `__typename` on interfaces and unions for RescriptRelay's sake, unless you actually want to use it yourself.
|
|
25
|
+
- We now support the `@required` directive from Relay, which is a new directive that lets you force non-nullability for nullable fields on the client side. You can then choose to throw an error if null values are encountered, or let the null value bubble up. Docs are coming soon.
|
|
26
|
+
- The errors reported by the compiler is now quite a lot better.
|
|
27
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
28
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
29
|
+
- Improved utils for [dealing with enums](https://rescript-relay-documentation.vercel.app/docs/enums).
|
|
30
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
31
|
+
|
|
32
|
+
## Beta fix changelog
|
|
33
|
+
|
|
34
|
+
### unreleased
|
|
35
|
+
|
|
36
|
+
### beta.11
|
|
37
|
+
|
|
38
|
+
- Another batch of experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
39
|
+
|
|
40
|
+
### beta.10
|
|
41
|
+
|
|
42
|
+
- Sneaking out some experimental stuff... Nothing new in this version compared to `beta.9`.
|
|
43
|
+
|
|
44
|
+
### beta.9
|
|
45
|
+
|
|
46
|
+
- `recordSourceRecords` is now typed as `Js.Json.t` rather than being abstract.
|
|
47
|
+
- The field name of the `id` field of the `Node` interface is now configurable via `schemaConfig: {nodeInterfaceIdField: "idNameHere"}`.
|
|
48
|
+
|
|
49
|
+
### beta.8
|
|
50
|
+
|
|
51
|
+
- More fixes for conversion instructions in variables and input objects.
|
|
52
|
+
- Project now works in `"type": "module"` mode in `package.json` (kudos [cometkim](https://github.com/cometkim))
|
|
53
|
+
|
|
54
|
+
### beta.7
|
|
55
|
+
|
|
56
|
+
- Full support for `reanalyze` as all false positive dead code results from generated code are now suppressed.
|
|
57
|
+
- Bindings for `requiredFieldLogger` for logging when missing fields are encountered (kudos [Emilios1995](https://github.com/Emilios1995)).
|
|
58
|
+
- Fix bug with conversion instructions in variables with input instructions.
|
|
59
|
+
|
|
60
|
+
### beta.6
|
|
61
|
+
|
|
62
|
+
- Fix wrong enum type being printed in input objects
|
|
63
|
+
- Fix `__typename` not being automatically selected (and by that forcing a manual select) in some cases, even though it's not supposed to be required to select manually anymore
|
|
64
|
+
|
|
65
|
+
### beta.5
|
|
66
|
+
|
|
67
|
+
- Generate helpers for moving between unsafe enums coming from the server, and safe enums. Also, provide a "fromString" function for each enum used, that can be used to turn any string into your enum.
|
|
68
|
+
- Suppress dead code warnings _in most places_ when running `reanalyze` on a `rescript-relay` code base. Still a few things left to fix, that requires changes to reanalyze. But this should be much better than before.
|
|
69
|
+
|
|
70
|
+
### beta.4
|
|
71
|
+
|
|
72
|
+
- Revert JSON.parse micro optimization experiment.
|
|
73
|
+
|
|
74
|
+
### beta.3
|
|
75
|
+
|
|
76
|
+
- Fix issue with duplicate keys being printed in the conversion instructions.
|
|
77
|
+
- Get rid of the need of nullability conversion instructions, and infer them instead.
|
|
78
|
+
|
|
79
|
+
### beta.2
|
|
80
|
+
|
|
81
|
+
- Fix issue with recursive input objects not being converted correctly.
|
|
82
|
+
|
|
3
83
|
# 0.23.0
|
|
4
84
|
|
|
85
|
+
_[Here's a commit showing a project being upgraded to this version](https://github.com/zth/rescript-relay/commit/6e96dfafaec918b1d4e9519d3fcbf5e5c46be6c0)_
|
|
86
|
+
|
|
5
87
|
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.
|
|
6
88
|
|
|
7
89
|
## Upgrade versions
|
package/README.md
CHANGED
|
@@ -6,11 +6,11 @@ Use Relay with ReScript.
|
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
8
|
|
|
9
|
-
> Are you using version `>= 0.13.0` and ReScript syntax with VSCode? Make sure you install our [
|
|
9
|
+
> Are you using version `>= 0.13.0` and ReScript syntax with VSCode? Make sure you install our [dedicated VSCode extension](https://marketplace.visualstudio.com/items?itemName=GabrielNordeborn.vscode-rescript-relay). Note: It only works with ReScript syntax.
|
|
10
10
|
|
|
11
11
|
Check out the [documentation](https://rescript-relay-documentation.vercel.app).
|
|
12
12
|
|
|
13
|
-
Also, check out the [changelog](CHANGELOG.md) - things will continue change
|
|
13
|
+
Also, check out the [changelog](CHANGELOG.md) - things will continue to change between versions (including breaking changes, although we'll try and keep them to a minimum) as we iterate and reach a stable version.
|
|
14
14
|
|
|
15
15
|
## What it looks like
|
|
16
16
|
|
|
@@ -18,15 +18,13 @@ Your components define what data they need through `%relay()`.
|
|
|
18
18
|
|
|
19
19
|
```rescript
|
|
20
20
|
/* Avatar.res */
|
|
21
|
-
module UserFragment = %relay(
|
|
22
|
-
`
|
|
21
|
+
module UserFragment = %relay(`
|
|
23
22
|
fragment Avatar_user on User {
|
|
24
23
|
firstName
|
|
25
24
|
lastName
|
|
26
25
|
avatarUrl
|
|
27
26
|
}
|
|
28
|
-
`
|
|
29
|
-
)
|
|
27
|
+
`)
|
|
30
28
|
|
|
31
29
|
@react.component
|
|
32
30
|
let make = (~user) => {
|
|
@@ -52,16 +50,14 @@ Hooks to use your fragments are autogenerated for you. The hook needs a _fragmen
|
|
|
52
50
|
|
|
53
51
|
```rescript
|
|
54
52
|
/* UserProfile.res */
|
|
55
|
-
module UserFragment = %relay(
|
|
56
|
-
`
|
|
53
|
+
module UserFragment = %relay(`
|
|
57
54
|
fragment UserProfile_user on User {
|
|
58
55
|
firstName
|
|
59
56
|
lastName
|
|
60
57
|
friendCount
|
|
61
58
|
...Avatar_user
|
|
62
59
|
}
|
|
63
|
-
`
|
|
64
|
-
)
|
|
60
|
+
`)
|
|
65
61
|
|
|
66
62
|
@react.component
|
|
67
63
|
let make = (~user) => {
|
package/cli/cli.js
CHANGED
|
@@ -475,4 +475,4 @@ var BE=OT(4293);var LE=BE.Buffer;function copyProps(pT,xT){for(var OT in pT){xT[
|
|
|
475
475
|
*
|
|
476
476
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
477
477
|
* Released under the MIT License.
|
|
478
|
-
*/const BE=OT(5680);const toRegexRange=(pT,xT,OT)=>{if(BE(pT)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(xT===void 0||pT===xT){return String(pT)}if(BE(xT)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let LE={relaxZeros:true,...OT};if(typeof LE.strictZeros==="boolean"){LE.relaxZeros=LE.strictZeros===false}let RE=String(LE.relaxZeros);let ME=String(LE.shorthand);let jE=String(LE.capture);let VE=String(LE.wrap);let UE=pT+":"+xT+"="+RE+ME+jE+VE;if(toRegexRange.cache.hasOwnProperty(UE)){return toRegexRange.cache[UE].result}let JE=Math.min(pT,xT);let qE=Math.max(pT,xT);if(Math.abs(JE-qE)===1){let OT=pT+"|"+xT;if(LE.capture){return`(${OT})`}if(LE.wrap===false){return OT}return`(?:${OT})`}let KE=hasPadding(pT)||hasPadding(xT);let zE={min:pT,max:xT,a:JE,b:qE};let GE=[];let $E=[];if(KE){zE.isPadded=KE;zE.maxLen=String(zE.max).length}if(JE<0){let pT=qE<0?Math.abs(qE):1;$E=splitToPatterns(pT,Math.abs(JE),zE,LE);JE=zE.a=0}if(qE>=0){GE=splitToPatterns(JE,qE,zE,LE)}zE.negatives=$E;zE.positives=GE;zE.result=collatePatterns($E,GE,LE);if(LE.capture===true){zE.result=`(${zE.result})`}else if(LE.wrap!==false&&GE.length+$E.length>1){zE.result=`(?:${zE.result})`}toRegexRange.cache[UE]=zE;return zE.result};function collatePatterns(pT,xT,OT){let BE=filterPatterns(pT,xT,"-",false,OT)||[];let LE=filterPatterns(xT,pT,"",false,OT)||[];let RE=filterPatterns(pT,xT,"-?",true,OT)||[];let ME=BE.concat(RE).concat(LE);return ME.join("|")}function splitToRanges(pT,xT){let OT=1;let BE=1;let LE=countNines(pT,OT);let RE=new Set([xT]);while(pT<=LE&&LE<=xT){RE.add(LE);OT+=1;LE=countNines(pT,OT)}LE=countZeros(xT+1,BE)-1;while(pT<LE&&LE<=xT){RE.add(LE);BE+=1;LE=countZeros(xT+1,BE)-1}RE=[...RE];RE.sort(compare);return RE}function rangeToPattern(pT,xT,OT){if(pT===xT){return{pattern:pT,count:[],digits:0}}let BE=zip(pT,xT);let LE=BE.length;let RE="";let ME=0;for(let pT=0;pT<LE;pT++){let[xT,LE]=BE[pT];if(xT===LE){RE+=xT}else if(xT!=="0"||LE!=="9"){RE+=toCharacterClass(xT,LE,OT)}else{ME++}}if(ME){RE+=OT.shorthand===true?"\\d":"[0-9]"}return{pattern:RE,count:[ME],digits:LE}}function splitToPatterns(pT,xT,OT,BE){let LE=splitToRanges(pT,xT);let RE=[];let ME=pT;let jE;for(let pT=0;pT<LE.length;pT++){let xT=LE[pT];let VE=rangeToPattern(String(ME),String(xT),BE);let UE="";if(!OT.isPadded&&jE&&jE.pattern===VE.pattern){if(jE.count.length>1){jE.count.pop()}jE.count.push(VE.count[0]);jE.string=jE.pattern+toQuantifier(jE.count);ME=xT+1;continue}if(OT.isPadded){UE=padZeros(xT,OT,BE)}VE.string=UE+VE.pattern+toQuantifier(VE.count);RE.push(VE);ME=xT+1;jE=VE}return RE}function filterPatterns(pT,xT,OT,BE,LE){let RE=[];for(let LE of pT){let{string:pT}=LE;if(!BE&&!contains(xT,"string",pT)){RE.push(OT+pT)}if(BE&&contains(xT,"string",pT)){RE.push(OT+pT)}}return RE}function zip(pT,xT){let OT=[];for(let BE=0;BE<pT.length;BE++)OT.push([pT[BE],xT[BE]]);return OT}function compare(pT,xT){return pT>xT?1:xT>pT?-1:0}function contains(pT,xT,OT){return pT.some((pT=>pT[xT]===OT))}function countNines(pT,xT){return Number(String(pT).slice(0,-xT)+"9".repeat(xT))}function countZeros(pT,xT){return pT-pT%Math.pow(10,xT)}function toQuantifier(pT){let[xT=0,OT=""]=pT;if(OT||xT>1){return`{${xT+(OT?","+OT:"")}}`}return""}function toCharacterClass(pT,xT,OT){return`[${pT}${xT-pT===1?"":"-"}${xT}]`}function hasPadding(pT){return/^-?(0+)\d/.test(pT)}function padZeros(pT,xT,OT){if(!xT.isPadded){return pT}let BE=Math.abs(xT.maxLen-String(pT).length);let LE=OT.relaxZeros!==false;switch(BE){case 0:return"";case 1:return LE?"0?":"0";case 2:return LE?"0{0,2}":"00";default:{return LE?`0{0,${BE}}`:`0{${BE}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};pT.exports=toRegexRange},5278:(pT,xT,OT)=>{pT.exports=OT(1669).deprecate},4383:pT=>{pT.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},5917:(pT,xT,OT)=>{"use strict";var BE=OT(732);var LE=OT(4383);var RE={nul:0,control:0};pT.exports=function wcwidth(pT){return wcswidth(pT,RE)};pT.exports.config=function(pT){pT=BE(pT||{},RE);return function wcwidth(xT){return wcswidth(xT,pT)}};function wcswidth(pT,xT){if(typeof pT!=="string")return wcwidth(pT,xT);var OT=0;for(var BE=0;BE<pT.length;BE++){var LE=wcwidth(pT.charCodeAt(BE),xT);if(LE<0)return-1;OT+=LE}return OT}function wcwidth(pT,xT){if(pT===0)return xT.nul;if(pT<32||pT>=127&&pT<160)return xT.control;if(bisearch(pT))return 0;return 1+(pT>=4352&&(pT<=4447||pT==9001||pT==9002||pT>=11904&&pT<=42191&&pT!=12351||pT>=44032&&pT<=55203||pT>=63744&&pT<=64255||pT>=65040&&pT<=65049||pT>=65072&&pT<=65135||pT>=65280&&pT<=65376||pT>=65504&&pT<=65510||pT>=131072&&pT<=196605||pT>=196608&&pT<=262141))}function bisearch(pT){var xT=0;var OT=LE.length-1;var BE;if(pT<LE[0][0]||pT>LE[OT][1])return false;while(OT>=xT){BE=Math.floor((xT+OT)/2);if(pT>LE[BE][1])xT=BE+1;else if(pT<LE[BE][0])OT=BE-1;else return true}return false}},6615:pT=>{"use strict";pT.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')},2357:pT=>{"use strict";pT.exports=require("assert")},4293:pT=>{"use strict";pT.exports=require("buffer")},3129:pT=>{"use strict";pT.exports=require("child_process")},8614:pT=>{"use strict";pT.exports=require("events")},5747:pT=>{"use strict";pT.exports=require("fs")},2282:pT=>{"use strict";pT.exports=require("module")},2087:pT=>{"use strict";pT.exports=require("os")},5622:pT=>{"use strict";pT.exports=require("path")},1058:pT=>{"use strict";pT.exports=require("readline")},2413:pT=>{"use strict";pT.exports=require("stream")},3867:pT=>{"use strict";pT.exports=require("tty")},1669:pT=>{"use strict";pT.exports=require("util")}};var xT={};function __nccwpck_require__(OT){var BE=xT[OT];if(BE!==undefined){return BE.exports}var LE=xT[OT]={id:OT,loaded:false,exports:{}};var RE=true;try{pT[OT].call(LE.exports,LE,LE.exports,__nccwpck_require__);RE=false}finally{if(RE)delete xT[OT]}LE.loaded=true;return LE.exports}(()=>{__nccwpck_require__.n=pT=>{var xT=pT&&pT.__esModule?()=>pT["default"]:()=>pT;__nccwpck_require__.d(xT,{a:xT});return xT}})();(()=>{__nccwpck_require__.d=(pT,xT)=>{for(var OT in xT){if(__nccwpck_require__.o(xT,OT)&&!__nccwpck_require__.o(pT,OT)){Object.defineProperty(pT,OT,{enumerable:true,get:xT[OT]})}}}})();(()=>{__nccwpck_require__.o=(pT,xT)=>Object.prototype.hasOwnProperty.call(pT,xT)})();(()=>{__nccwpck_require__.r=pT=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(pT,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(pT,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=pT=>{pT.paths=[];if(!pT.children)pT.children=[];return pT}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var OT={};(()=>{"use strict";__nccwpck_require__.r(OT);var pT=__nccwpck_require__(1904);var xT=__nccwpck_require__(970);var BE=__nccwpck_require__.n(xT);var LE=__nccwpck_require__(5622);var RE=__nccwpck_require__.n(LE);var ME=__nccwpck_require__(5747);var jE=__nccwpck_require__.n(ME);var VE=__nccwpck_require__(6155);var UE=__nccwpck_require__(7314);var JE=__nccwpck_require__(9882);var qE=__nccwpck_require__(5655);let makeExtractTagsFromSource=pT=>xT=>{const OT=(0,UE.getLocator)(xT);const BE=[];let LE;while((LE=pT.exec(xT))!==null){let pT=OT(LE.index);let xT=OT(LE.index+LE[0].length);BE.push({content:LE[0],start:pT.character,end:xT.character})}return BE};const KE=new RegExp(/(?<=\%relay\([\s]*`)[\s\S.]+?(?=`[\s]*\))/g);const zE=makeExtractTagsFromSource(KE);function prettify(pT){return(0,JE.format)(pT,{parser:"graphql",plugins:[qE]}).replace(/^\s+|\s+$/g,"")}const padOperation=(pT,xT)=>pT.split("\n").map((pT=>" ".repeat(xT)+pT)).join("\n");const GE=new RegExp(/^[\s]*(?=[\w])/g);const $E=new RegExp(/[\s]*$/g);const findOperationPadding=pT=>{const xT=(pT.match(GE)||[]).pop();const OT=(xT||"").split("\n").pop();return OT?OT.length:0};const restoreOperationPadding=(pT,xT)=>{const OT=(xT.match($E)||[]).join("");return"\n"+padOperation(pT,findOperationPadding(xT))+OT};const isNodeInterfaceWithSingleMember=pT=>{var xT;const OT=pT.selectionSet.selections.find((pT=>pT.kind==="Field"&&pT.name.value==="node"));if((OT===null||OT===void 0?void 0:OT.kind)==="Field"){const pT=(xT=OT.selectionSet)===null||xT===void 0?void 0:xT.selections.filter((pT=>pT.kind==="InlineFragment"));return(pT===null||pT===void 0?void 0:pT.length)===1}return false};const namedPathOfAncestors=pT=>(pT||[]).reduce(((pT,xT)=>{var OT,BE;if(Array.isArray(xT)){return pT}const LE=xT;switch(LE.kind){case"Field":return[...pT,LE.name.value];case"InlineFragment":return[...pT,(BE=(OT=LE.typeCondition)===null||OT===void 0?void 0:OT.name.value)!==null&&BE!==void 0?BE:""];default:return pT}}),[]).join("_");const getPathAssets=({unusedFieldPaths:pT,fieldName:xT,ancestors:OT})=>{const BE=namedPathOfAncestors(OT);const LE=BE===""?xT:[namedPathOfAncestors(OT),xT].join("_");const RE=`${LE}.`;const ME=pT.filter((pT=>pT.startsWith(RE))).map((pT=>pT.slice(RE.length)));return{fieldsToRemove:ME,shouldRemoveFullSelection:pT.includes(LE),path:LE,ancestorPath:BE}};const removeUnusedFieldsFromOperation=({definition:pT,unusedFieldPaths:xT})=>{let OT=false;const BE=(0,VE.Vn3)(pT,{InlineFragment(OT,BE,LE,RE,ME){if(OT.typeCondition==null)return OT;const jE=namedPathOfAncestors(ME);const VE=jE==="node"&&isNodeInterfaceWithSingleMember(pT);const UE=VE?jE:[jE,OT.typeCondition.name.value].filter((pT=>pT!=="")).join("_");const JE=`${UE}.`;const qE=xT.filter((pT=>pT.startsWith(JE))).map((pT=>pT.slice(JE.length)));if(qE.length>0){const pT=qE.includes("fragmentRefs");const xT=Object.assign(Object.assign({},OT.selectionSet),{selections:OT.selectionSet.selections.filter((xT=>{var OT,BE;if(xT.kind==="FragmentSpread"&&pT){return false}if(xT.kind==="Field"){const pT=(BE=(OT=xT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:xT.name.value;return!qE.includes(pT)}return true}))});if(xT.selections.length===0){return null}return Object.assign(Object.assign({},OT),{selectionSet:xT})}return OT},FragmentDefinition(pT){const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},OperationDefinition(pT){if(pT.operation!=="query"){return pT}const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},Field(pT,OT,BE,LE,RE){var ME,jE,VE,UE;const JE=(jE=(ME=pT.alias)===null||ME===void 0?void 0:ME.value)!==null&&jE!==void 0?jE:pT.name.value;const{fieldsToRemove:qE,shouldRemoveFullSelection:KE}=getPathAssets({unusedFieldPaths:xT,fieldName:JE,ancestors:RE});if(KE){return null}if(qE.length>0){const xT=qE.includes("fragmentRefs");const OT=(UE=(VE=pT.selectionSet)===null||VE===void 0?void 0:VE.selections)===null||UE===void 0?void 0:UE.filter((pT=>{var OT,BE;if(pT.kind==="FragmentSpread"&&xT){return false}if(pT.kind==="Field"){const xT=(BE=(OT=pT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:pT.name.value;return!qE.includes(xT)}return true}));const BE={kind:"Field",name:{kind:"Name",value:"__typename"}};return Object.assign(Object.assign({},pT),{selectionSet:{kind:"SelectionSet",selections:(OT===null||OT===void 0?void 0:OT.length)===0?[BE]:OT}})}return pT}});if(OT){return null}return BE};const WE=new RegExp(/(?<=__generated__\/)[A-Za-z_0-9]+(?=_graphql\.res)/g);const YE=new RegExp(/(?<=Types\.(fragment|response)[_.])[A-Za-z_.0-9]+(?= )/g);const HE=new RegExp(/Types\.(fragment|response)/g);const processReanalyzeOutput=pT=>{const xT=pT.split(/\n\n/g).filter((pT=>pT.match(HE))).reduce(((pT,xT)=>{var OT,BE;const LE=xT.includes("Types.fragment")?"fragment":"query";const RE=(OT=xT.match(WE))===null||OT===void 0?void 0:OT[0];const ME=RE==null?null:`${RE}_graphql.res`;const jE=(BE=xT.match(YE))===null||BE===void 0?void 0:BE[0];if(LE==="query"&&!(RE===null||RE===void 0?void 0:RE.toLowerCase().endsWith("query"))){return pT}if(jE==="id"){return pT}if(jE===null||jE===void 0?void 0:jE.endsWith("__typename")){return pT}if(RE==null||jE==null||ME==null){return pT}pT[ME]=pT[ME]||{type:LE,graphqlName:RE,unusedFieldPaths:[]};pT[ME].unusedFieldPaths.push(jE);return pT}),{});return xT};const maybePluralize=(pT,xT)=>{if(xT===1){return`${xT} ${pT}`}return`${xT} ${pT}s`};var XE=__nccwpck_require__(7519);var QE=__nccwpck_require__.n(XE);var ZE=__nccwpck_require__(6743);var eC=__nccwpck_require__.n(ZE);var tC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const loadRelayConfig=()=>{const pT=eC().loadConfig();if(!pT){console.error("Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work.");process.exit(1)}if(!pT.artifactDirectory){console.error("RescriptRelay requires you to define 'artifactDirectory' (for outputing generated files in a single directory) in your relay.config.js. Please define it and re-run this command.");process.exit(1)}return pT};const getRelayArtifactDirectoryLocation=pT=>{const xT=RE().resolve(RE().join(process.cwd(),pT.artifactDirectory));return xT};const getAllGeneratedFiles=pT=>tC(void 0,void 0,void 0,(function*(){const xT=yield QE()(`${pT}/*.res`,{absolute:true,onlyFiles:true});return xT}));const rC=new RegExp(/(?<=\/\* @sourceLoc )[A-Za-z_.0-9]+(?= \*\/)/g);const findAllSourceFilesFromGeneratedFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=yield Promise.all(pT.map((pT=>tC(void 0,void 0,void 0,(function*(){var OT;if(xT!=null){xT.text=`Checking ${RE().basename(pT)}...`}const BE=yield jE().promises.readFile(pT,{encoding:"utf-8"});return(OT=BE.match(rC))===null||OT===void 0?void 0:OT[0]})))));const BE=OT.reduce(((pT,xT)=>{if(xT!=null){const OT=xT;if(!pT.includes(OT)){pT.push(OT)}return pT}return pT}),[]);return BE}));const getSrcCwd=pT=>RE().resolve(RE().join(process.cwd(),pT));const findSourceFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=getSrcCwd(xT);const BE=yield QE()(pT.map((pT=>`**/${pT}`)),{cwd:OT,absolute:true,onlyFiles:true});return BE}));const formatOperationsInDocument=pT=>{const xT=zE(pT);if(xT.length===0){return pT}let OT="";for(let BE=0;BE<=xT.length-1;BE+=1){const LE=xT[BE];const RE=xT[BE-1];const ME=RE==null?0:RE.end;OT+=pT.slice(ME,LE.start);OT+=restoreOperationPadding(prettify(LE.content),LE.content)}const BE=xT[xT.length-1];OT+=pT.slice(BE.end);return OT};var nC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addFormatGraphQLCommands=pT=>{pT.command("format-all-graphql").option("--ci","CI mode: Exit if unformatted files are encountered.").description("Format all GraphQL operations in project.").action((({ci:pT})=>nC(void 0,void 0,void 0,(function*(){const xT=loadRelayConfig();const OT=getRelayArtifactDirectoryLocation(xT);const LE=BE()("Findings files to format").start();const ME=yield getAllGeneratedFiles(OT);const VE=yield findAllSourceFilesFromGeneratedFiles(ME,LE);LE.text=`Searching for ${maybePluralize("source file",VE.length)}.`;const UE=yield findSourceFiles(VE,xT.src);const JE=yield Promise.all(UE.map((xT=>nC(void 0,void 0,void 0,(function*(){LE.text=`${pT?"Checking":"Formatting"} "${RE().basename(xT)}".`;const OT=yield jE().promises.readFile(xT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE&&!pT){yield jE().promises.writeFile(xT,BE)}return OT!==BE})))));const qE=JE.filter((pT=>pT===true)).length;if(pT){if(qE===0){LE.succeed(`Done! None of ${maybePluralize("file",UE.length)} in need of formatting.`);process.exit(0)}else{LE.fail(`${maybePluralize("file",qE)} needs formatting.`);process.exit(1)}}else{if(qE===0){LE.succeed(`Done! None of ${maybePluralize("scanned file",UE.length)} needed formatting.`)}else{LE.succeed(`Done! Formatted ${maybePluralize("file",qE)} of ${maybePluralize("scanned file",UE.length)}.`)}}}))));pT.command("format-single-graphql").description("Format GraphQL operations in single file.").argument("<file>","Path to file to format. Must be absolute.").action((pT=>nC(void 0,void 0,void 0,(function*(){const xT=BE()("Formatting file..").start();const OT=yield jE().promises.stat(pT,{throwIfNoEntry:false});if(OT==null){xT.fail("File does not exist.");process.exit(1)}try{const OT=yield jE().promises.readFile(pT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE){yield jE().promises.writeFile(pT,BE);xT.succeed("Successfully formatted file.")}else{xT.succeed("File already formatted.")}}catch(pT){xT.fail("Could not format file.");process.exit(1)}}))))};var iC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addDebugCommand=pT=>{pT.command("debug").description("Prints debug information for the CLI.").action((()=>iC(void 0,void 0,void 0,(function*(){const pT=loadRelayConfig();const xT=getRelayArtifactDirectoryLocation(pT);console.log(`Artifact directory location: ${xT}\n`);console.log("Getting all generated files...\n");const OT=yield getAllGeneratedFiles(xT);console.log(`Number of generated files found in artifact directory: ${OT.length}\n`);console.log("Looking up source files\n");const BE=yield findAllSourceFilesFromGeneratedFiles(OT);console.log(`Found ${BE.length} source locations with explicit definitions.\n`);console.log("Looking up source files..\n");const LE=yield findSourceFiles(BE,pT.src);console.log(`Found ${LE.length} actual source files, when looking in ${getSrcCwd(pT.src)}.\n`);console.log("Done!")}))))};var aC=__nccwpck_require__(3129);var oC=__nccwpck_require__.n(aC);var sC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addRemoveUnusedFieldsCommand=pT=>{pT.command("remove-unused-fields").option("--verbose","Verbose mode").option("--debug","Debug mode").option("--ci","CI mode: Exit if unused fields exist, but don't remove them.").description("Remove unused GraphQL selections in fragments in current project.").action((({ci:pT,verbose:xT,debug:OT})=>{var LE;const ME=loadRelayConfig();const UE=getRelayArtifactDirectoryLocation(ME);const JE=BE()("Analyzing ReScript project").start();const qE=oC().spawn("npx",["reanalyze","-dce"]);if(qE.stdout==null){console.error("Something went wrong.");process.exit(1)}let KE="";qE.stdout.on("data",(pT=>{KE+=pT}));(LE=qE.stderr)===null||LE===void 0?void 0:LE.on("data",(pT=>{if(pT.includes("End_of_file")){JE.fail(`Something went wrong trying to analyze the ReScript project. Try cleaning your ReScript project and rebuilding it from scratch before trying again.`)}else{JE.fail(`Something went wrong trying to analyze the ReScript project.`)}if(OT){console.error(pT)}process.exit(1)}));qE.on("close",(()=>sC(void 0,void 0,void 0,(function*(){JE.text="Analyzing GraphQL usage";const BE=processReanalyzeOutput(KE);if(OT){console.log(`Found ${maybePluralize("file",Object.keys(BE).length)} with potentially missing fields.`)}const LE=[];JE.text="Scanning fragment files";if(OT){console.log(`Extracing source locations for ${maybePluralize("files",Object.keys(BE).length)}.`)}yield Promise.all(Object.entries(BE).map((([pT,xT])=>sC(void 0,void 0,void 0,(function*(){var OT;const BE=RE().resolve(UE,pT);try{const pT=yield jE().promises.readFile(BE,{encoding:"utf-8"});const RE=(OT=pT.match(rC))===null||OT===void 0?void 0:OT[0];if(RE!=null){LE.push(Object.assign(Object.assign({},xT),{sourceLocation:RE}))}}catch(pT){console.error(pT)}})))));if(xT&&LE.length>0){console.log(`\n\n------\nUnused fields: \n`,LE.map((pT=>`${pT.type==="fragment"?"Fragment":"Query"} "${pT.graphqlName}" in ${pT.sourceLocation}: \n ${pT.unusedFieldPaths.join("\n ")}`)).join("\n\n"),`\n------\n\n`)}if(pT){if(LE.length===0){JE.succeed("No unused fields found.");process.exit(0)}else{JE.fail(`Found ${LE.length} file(s) with unused fields.`);process.exit(1)}}JE.text=`Findings files to modify`;const qE=LE.map((pT=>({path:pT.sourceLocation,graphqlName:pT.graphqlName})));const GE=yield findSourceFiles(qE.map((pT=>pT.path)),ME.src);const $E=GE.map((pT=>{const xT=LE.find((xT=>pT.endsWith(xT.sourceLocation)));if(xT!=null){return Object.assign(Object.assign({},xT),{absoluteFilePath:pT})}}));JE.text=`Removing unused fields`;yield Promise.all($E.map((pT=>sC(void 0,void 0,void 0,(function*(){var xT;if(pT==null)return;try{const OT=yield jE().promises.readFile(pT.absoluteFilePath,{encoding:"utf-8"});const BE=zE(OT);let LE=null;let RE=null;for(const OT of BE){const BE=(0,VE.Qc3)(OT.content);const ME=BE.definitions[0];if(ME==null){continue}if((ME.kind==="OperationDefinition"||ME.kind==="FragmentDefinition")&&((xT=ME.name)===null||xT===void 0?void 0:xT.value)===pT.graphqlName){LE=BE;RE=OT;break}}if(LE==null||RE==null)return;const ME=LE.definitions[0];if(ME==null||!(ME.kind==="FragmentDefinition"||ME.kind==="OperationDefinition")){return}const UE=removeUnusedFieldsFromOperation({definition:ME,unusedFieldPaths:pT.unusedFieldPaths});const JE=UE==null?"# This module is unused and can be removed":restoreOperationPadding(prettify((0,VE.S0v)(UE)),RE.content);yield jE().promises.writeFile(pT.absoluteFilePath,`${OT.slice(0,RE.start)}${JE}${OT.slice(RE.end)}`)}catch(pT){console.error(pT)}})))));const WE=$E.reduce(((pT,xT)=>{var OT;return pT+((OT=xT===null||xT===void 0?void 0:xT.unusedFieldPaths.length)!==null&&OT!==void 0?OT:0)}),0);if(WE===0){JE.succeed("Done! No unused fields found.")}else{JE.succeed(`Done! Removed ${maybePluralize("field",WE)} from ${maybePluralize("file",$E.length)}.`)}}))))}))};pT.program.version("0.1.0");addFormatGraphQLCommands(pT.program);addDebugCommand(pT.program);addRemoveUnusedFieldsCommand(pT.program);pT.program.parse(process.argv)})();module.exports=OT})();
|
|
478
|
+
*/const BE=OT(5680);const toRegexRange=(pT,xT,OT)=>{if(BE(pT)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(xT===void 0||pT===xT){return String(pT)}if(BE(xT)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let LE={relaxZeros:true,...OT};if(typeof LE.strictZeros==="boolean"){LE.relaxZeros=LE.strictZeros===false}let RE=String(LE.relaxZeros);let ME=String(LE.shorthand);let jE=String(LE.capture);let VE=String(LE.wrap);let UE=pT+":"+xT+"="+RE+ME+jE+VE;if(toRegexRange.cache.hasOwnProperty(UE)){return toRegexRange.cache[UE].result}let JE=Math.min(pT,xT);let qE=Math.max(pT,xT);if(Math.abs(JE-qE)===1){let OT=pT+"|"+xT;if(LE.capture){return`(${OT})`}if(LE.wrap===false){return OT}return`(?:${OT})`}let KE=hasPadding(pT)||hasPadding(xT);let zE={min:pT,max:xT,a:JE,b:qE};let GE=[];let $E=[];if(KE){zE.isPadded=KE;zE.maxLen=String(zE.max).length}if(JE<0){let pT=qE<0?Math.abs(qE):1;$E=splitToPatterns(pT,Math.abs(JE),zE,LE);JE=zE.a=0}if(qE>=0){GE=splitToPatterns(JE,qE,zE,LE)}zE.negatives=$E;zE.positives=GE;zE.result=collatePatterns($E,GE,LE);if(LE.capture===true){zE.result=`(${zE.result})`}else if(LE.wrap!==false&&GE.length+$E.length>1){zE.result=`(?:${zE.result})`}toRegexRange.cache[UE]=zE;return zE.result};function collatePatterns(pT,xT,OT){let BE=filterPatterns(pT,xT,"-",false,OT)||[];let LE=filterPatterns(xT,pT,"",false,OT)||[];let RE=filterPatterns(pT,xT,"-?",true,OT)||[];let ME=BE.concat(RE).concat(LE);return ME.join("|")}function splitToRanges(pT,xT){let OT=1;let BE=1;let LE=countNines(pT,OT);let RE=new Set([xT]);while(pT<=LE&&LE<=xT){RE.add(LE);OT+=1;LE=countNines(pT,OT)}LE=countZeros(xT+1,BE)-1;while(pT<LE&&LE<=xT){RE.add(LE);BE+=1;LE=countZeros(xT+1,BE)-1}RE=[...RE];RE.sort(compare);return RE}function rangeToPattern(pT,xT,OT){if(pT===xT){return{pattern:pT,count:[],digits:0}}let BE=zip(pT,xT);let LE=BE.length;let RE="";let ME=0;for(let pT=0;pT<LE;pT++){let[xT,LE]=BE[pT];if(xT===LE){RE+=xT}else if(xT!=="0"||LE!=="9"){RE+=toCharacterClass(xT,LE,OT)}else{ME++}}if(ME){RE+=OT.shorthand===true?"\\d":"[0-9]"}return{pattern:RE,count:[ME],digits:LE}}function splitToPatterns(pT,xT,OT,BE){let LE=splitToRanges(pT,xT);let RE=[];let ME=pT;let jE;for(let pT=0;pT<LE.length;pT++){let xT=LE[pT];let VE=rangeToPattern(String(ME),String(xT),BE);let UE="";if(!OT.isPadded&&jE&&jE.pattern===VE.pattern){if(jE.count.length>1){jE.count.pop()}jE.count.push(VE.count[0]);jE.string=jE.pattern+toQuantifier(jE.count);ME=xT+1;continue}if(OT.isPadded){UE=padZeros(xT,OT,BE)}VE.string=UE+VE.pattern+toQuantifier(VE.count);RE.push(VE);ME=xT+1;jE=VE}return RE}function filterPatterns(pT,xT,OT,BE,LE){let RE=[];for(let LE of pT){let{string:pT}=LE;if(!BE&&!contains(xT,"string",pT)){RE.push(OT+pT)}if(BE&&contains(xT,"string",pT)){RE.push(OT+pT)}}return RE}function zip(pT,xT){let OT=[];for(let BE=0;BE<pT.length;BE++)OT.push([pT[BE],xT[BE]]);return OT}function compare(pT,xT){return pT>xT?1:xT>pT?-1:0}function contains(pT,xT,OT){return pT.some((pT=>pT[xT]===OT))}function countNines(pT,xT){return Number(String(pT).slice(0,-xT)+"9".repeat(xT))}function countZeros(pT,xT){return pT-pT%Math.pow(10,xT)}function toQuantifier(pT){let[xT=0,OT=""]=pT;if(OT||xT>1){return`{${xT+(OT?","+OT:"")}}`}return""}function toCharacterClass(pT,xT,OT){return`[${pT}${xT-pT===1?"":"-"}${xT}]`}function hasPadding(pT){return/^-?(0+)\d/.test(pT)}function padZeros(pT,xT,OT){if(!xT.isPadded){return pT}let BE=Math.abs(xT.maxLen-String(pT).length);let LE=OT.relaxZeros!==false;switch(BE){case 0:return"";case 1:return LE?"0?":"0";case 2:return LE?"0{0,2}":"00";default:{return LE?`0{0,${BE}}`:`0{${BE}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};pT.exports=toRegexRange},5278:(pT,xT,OT)=>{pT.exports=OT(1669).deprecate},4383:pT=>{pT.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]},5917:(pT,xT,OT)=>{"use strict";var BE=OT(732);var LE=OT(4383);var RE={nul:0,control:0};pT.exports=function wcwidth(pT){return wcswidth(pT,RE)};pT.exports.config=function(pT){pT=BE(pT||{},RE);return function wcwidth(xT){return wcswidth(xT,pT)}};function wcswidth(pT,xT){if(typeof pT!=="string")return wcwidth(pT,xT);var OT=0;for(var BE=0;BE<pT.length;BE++){var LE=wcwidth(pT.charCodeAt(BE),xT);if(LE<0)return-1;OT+=LE}return OT}function wcwidth(pT,xT){if(pT===0)return xT.nul;if(pT<32||pT>=127&&pT<160)return xT.control;if(bisearch(pT))return 0;return 1+(pT>=4352&&(pT<=4447||pT==9001||pT==9002||pT>=11904&&pT<=42191&&pT!=12351||pT>=44032&&pT<=55203||pT>=63744&&pT<=64255||pT>=65040&&pT<=65049||pT>=65072&&pT<=65135||pT>=65280&&pT<=65376||pT>=65504&&pT<=65510||pT>=131072&&pT<=196605||pT>=196608&&pT<=262141))}function bisearch(pT){var xT=0;var OT=LE.length-1;var BE;if(pT<LE[0][0]||pT>LE[OT][1])return false;while(OT>=xT){BE=Math.floor((xT+OT)/2);if(pT>LE[BE][1])xT=BE+1;else if(pT<LE[BE][0])OT=BE-1;else return true}return false}},6615:pT=>{"use strict";pT.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]},"grenade":{"interval":80,"frames":["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},"fistBump":{"interval":80,"frames":["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},"soccerHeader":{"interval":80,"frames":[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},"mindblown":{"interval":160,"frames":["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},"speaker":{"interval":160,"frames":["🔈 ","🔉 ","🔊 ","🔉 "]},"orangePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},"bluePulse":{"interval":100,"frames":["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"orangeBluePulse":{"interval":100,"frames":["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},"timeTravel":{"interval":100,"frames":["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]}}')},2357:pT=>{"use strict";pT.exports=require("assert")},4293:pT=>{"use strict";pT.exports=require("buffer")},3129:pT=>{"use strict";pT.exports=require("child_process")},8614:pT=>{"use strict";pT.exports=require("events")},5747:pT=>{"use strict";pT.exports=require("fs")},2282:pT=>{"use strict";pT.exports=require("module")},2087:pT=>{"use strict";pT.exports=require("os")},5622:pT=>{"use strict";pT.exports=require("path")},1058:pT=>{"use strict";pT.exports=require("readline")},2413:pT=>{"use strict";pT.exports=require("stream")},3867:pT=>{"use strict";pT.exports=require("tty")},1669:pT=>{"use strict";pT.exports=require("util")}};var xT={};function __nccwpck_require__(OT){var BE=xT[OT];if(BE!==undefined){return BE.exports}var LE=xT[OT]={id:OT,loaded:false,exports:{}};var RE=true;try{pT[OT].call(LE.exports,LE,LE.exports,__nccwpck_require__);RE=false}finally{if(RE)delete xT[OT]}LE.loaded=true;return LE.exports}(()=>{__nccwpck_require__.n=pT=>{var xT=pT&&pT.__esModule?()=>pT["default"]:()=>pT;__nccwpck_require__.d(xT,{a:xT});return xT}})();(()=>{__nccwpck_require__.d=(pT,xT)=>{for(var OT in xT){if(__nccwpck_require__.o(xT,OT)&&!__nccwpck_require__.o(pT,OT)){Object.defineProperty(pT,OT,{enumerable:true,get:xT[OT]})}}}})();(()=>{__nccwpck_require__.o=(pT,xT)=>Object.prototype.hasOwnProperty.call(pT,xT)})();(()=>{__nccwpck_require__.r=pT=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(pT,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(pT,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=pT=>{pT.paths=[];if(!pT.children)pT.children=[];return pT}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var OT={};(()=>{"use strict";__nccwpck_require__.r(OT);var pT=__nccwpck_require__(1904);var xT=__nccwpck_require__(970);var BE=__nccwpck_require__.n(xT);var LE=__nccwpck_require__(5622);var RE=__nccwpck_require__.n(LE);var ME=__nccwpck_require__(5747);var jE=__nccwpck_require__.n(ME);var VE=__nccwpck_require__(6155);var UE=__nccwpck_require__(7314);var JE=__nccwpck_require__(9882);var qE=__nccwpck_require__(5655);let makeExtractTagsFromSource=pT=>xT=>{const OT=(0,UE.getLocator)(xT);const BE=[];let LE;while((LE=pT.exec(xT))!==null){let pT=OT(LE.index);let xT=OT(LE.index+LE[0].length);BE.push({content:LE[0],start:pT.character,end:xT.character})}return BE};const KE=new RegExp(/(?<=\%relay\([\s]*`)[\s\S.]+?(?=`[\s]*\))/g);const zE=makeExtractTagsFromSource(KE);function prettify(pT){return(0,JE.format)(pT,{parser:"graphql",plugins:[qE]}).replace(/^\s+|\s+$/g,"")}const padOperation=(pT,xT)=>pT.split("\n").map((pT=>" ".repeat(xT)+pT)).join("\n");const GE=new RegExp(/^[\s]*(?=[\w])/g);const $E=new RegExp(/[\s]*$/g);const findOperationPadding=pT=>{const xT=(pT.match(GE)||[]).pop();const OT=(xT||"").split("\n").pop();return OT?OT.length:0};const restoreOperationPadding=(pT,xT)=>{const OT=(xT.match($E)||[]).join("");return"\n"+padOperation(pT,findOperationPadding(xT))+OT};const isNodeInterfaceWithSingleMember=pT=>{var xT;const OT=pT.selectionSet.selections.find((pT=>pT.kind==="Field"&&pT.name.value==="node"));if((OT===null||OT===void 0?void 0:OT.kind)==="Field"){const pT=(xT=OT.selectionSet)===null||xT===void 0?void 0:xT.selections.filter((pT=>pT.kind==="InlineFragment"));return(pT===null||pT===void 0?void 0:pT.length)===1}return false};const namedPathOfAncestors=pT=>(pT||[]).reduce(((pT,xT)=>{var OT,BE;if(Array.isArray(xT)){return pT}const LE=xT;switch(LE.kind){case"Field":return[...pT,LE.name.value];case"InlineFragment":return[...pT,(BE=(OT=LE.typeCondition)===null||OT===void 0?void 0:OT.name.value)!==null&&BE!==void 0?BE:""];default:return pT}}),[]).join("_");const getPathAssets=({unusedFieldPaths:pT,fieldName:xT,ancestors:OT})=>{const BE=namedPathOfAncestors(OT);const LE=BE===""?xT:[namedPathOfAncestors(OT),xT].join("_");const RE=`${LE}.`;const ME=pT.filter((pT=>pT.startsWith(RE))).map((pT=>pT.slice(RE.length)));return{fieldsToRemove:ME,shouldRemoveFullSelection:pT.includes(LE),path:LE,ancestorPath:BE}};const removeUnusedFieldsFromOperation=({definition:pT,unusedFieldPaths:xT})=>{let OT=false;const BE=(0,VE.Vn3)(pT,{InlineFragment(OT,BE,LE,RE,ME){if(OT.typeCondition==null)return OT;const jE=namedPathOfAncestors(ME);const VE=jE==="node"&&isNodeInterfaceWithSingleMember(pT);const UE=VE?jE:[jE,OT.typeCondition.name.value].filter((pT=>pT!=="")).join("_");const JE=`${UE}.`;const qE=xT.filter((pT=>pT.startsWith(JE))).map((pT=>pT.slice(JE.length)));if(qE.length>0){const pT=qE.includes("fragmentRefs");const xT=Object.assign(Object.assign({},OT.selectionSet),{selections:OT.selectionSet.selections.filter((xT=>{var OT,BE;if(xT.kind==="FragmentSpread"&&pT){return false}if(xT.kind==="Field"){const pT=(BE=(OT=xT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:xT.name.value;return!qE.includes(pT)}return true}))});if(xT.selections.length===0){return null}return Object.assign(Object.assign({},OT),{selectionSet:xT})}return OT},FragmentDefinition(pT){const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},OperationDefinition(pT){if(pT.operation!=="query"){return pT}const BE=xT.filter((pT=>!pT.includes(".")));const LE=BE.includes("fragmentRefs");if(BE.length>0){const xT=Object.assign(Object.assign({},pT.selectionSet),{selections:pT.selectionSet.selections.filter((pT=>{var xT,OT;if(pT.kind==="FragmentSpread"&&LE){return false}if(pT.kind==="Field"){const LE=(OT=(xT=pT.alias)===null||xT===void 0?void 0:xT.value)!==null&&OT!==void 0?OT:pT.name.value;return!BE.includes(LE)}return true}))});if(xT.selections.length===0){OT=true;return VE.$_X}return Object.assign(Object.assign({},pT),{selectionSet:xT})}return pT},Field(pT,OT,BE,LE,RE){var ME,jE,VE,UE;const JE=(jE=(ME=pT.alias)===null||ME===void 0?void 0:ME.value)!==null&&jE!==void 0?jE:pT.name.value;const{fieldsToRemove:qE,shouldRemoveFullSelection:KE}=getPathAssets({unusedFieldPaths:xT,fieldName:JE,ancestors:RE});if(KE){return null}if(qE.length>0){const xT=qE.includes("fragmentRefs");const OT=(UE=(VE=pT.selectionSet)===null||VE===void 0?void 0:VE.selections)===null||UE===void 0?void 0:UE.filter((pT=>{var OT,BE;if(pT.kind==="FragmentSpread"&&xT){return false}if(pT.kind==="Field"){const xT=(BE=(OT=pT.alias)===null||OT===void 0?void 0:OT.value)!==null&&BE!==void 0?BE:pT.name.value;return!qE.includes(xT)}return true}));const BE={kind:"Field",name:{kind:"Name",value:"__typename"}};return Object.assign(Object.assign({},pT),{selectionSet:{kind:"SelectionSet",selections:(OT===null||OT===void 0?void 0:OT.length)===0?[BE]:OT}})}return pT}});if(OT){return null}return BE};const WE=new RegExp(/(?<=__generated__\/)[A-Za-z_0-9]+(?=_graphql\.res)/g);const YE=new RegExp(/(?<=Types\.(fragment|response)[_.])[A-Za-z_.0-9]+(?= )/g);const HE=new RegExp(/Types\.(fragment|response)/g);const processReanalyzeOutput=pT=>{const xT=pT.split(/\n\n/g).filter((pT=>pT.match(HE))).reduce(((pT,xT)=>{var OT,BE;const LE=xT.includes("Types.fragment")?"fragment":"query";const RE=(OT=xT.match(WE))===null||OT===void 0?void 0:OT[0];const ME=RE==null?null:`${RE}_graphql.res`;const jE=(BE=xT.match(YE))===null||BE===void 0?void 0:BE[0];if(LE==="query"&&!(RE===null||RE===void 0?void 0:RE.toLowerCase().endsWith("query"))){return pT}if(jE==="id"){return pT}if(jE===null||jE===void 0?void 0:jE.endsWith("__typename")){return pT}if(RE==null||jE==null||ME==null){return pT}pT[ME]=pT[ME]||{type:LE,graphqlName:RE,unusedFieldPaths:[]};pT[ME].unusedFieldPaths.push(jE);return pT}),{});return xT};const maybePluralize=(pT,xT)=>{if(xT===1){return`${xT} ${pT}`}return`${xT} ${pT}s`};var XE=__nccwpck_require__(7519);var QE=__nccwpck_require__.n(XE);var ZE=__nccwpck_require__(6743);var eC=__nccwpck_require__.n(ZE);var tC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const loadRelayConfig=()=>{const pT=eC().loadConfig();if(!pT){console.error("Could not find relay.config.js. You must configure Relay through relay.config.js for RescriptRelay to work.");process.exit(1)}if(!pT.artifactDirectory){console.error("RescriptRelay requires you to define 'artifactDirectory' (for outputing generated files in a single directory) in your relay.config.js. Please define it and re-run this command.");process.exit(1)}return pT};const getRelayArtifactDirectoryLocation=pT=>{const xT=RE().resolve(RE().join(process.cwd(),pT.artifactDirectory));return xT};const getAllGeneratedFiles=pT=>tC(void 0,void 0,void 0,(function*(){const xT=yield QE()(`${pT}/*.res`,{absolute:true,onlyFiles:true});return xT}));const rC=new RegExp(/(?<=\/\* @sourceLoc )[A-Za-z_.0-9]+(?= \*\/)/g);const findAllSourceFilesFromGeneratedFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=yield Promise.all(pT.map((pT=>tC(void 0,void 0,void 0,(function*(){var OT;if(xT!=null){xT.text=`Checking ${RE().basename(pT)}...`}const BE=yield jE().promises.readFile(pT,{encoding:"utf-8"});return(OT=BE.match(rC))===null||OT===void 0?void 0:OT[0]})))));const BE=OT.reduce(((pT,xT)=>{if(xT!=null){const OT=xT;if(!pT.includes(OT)){pT.push(OT)}return pT}return pT}),[]);return BE}));const getSrcCwd=pT=>RE().resolve(RE().join(process.cwd(),pT));const findSourceFiles=(pT,xT)=>tC(void 0,void 0,void 0,(function*(){const OT=getSrcCwd(xT);const BE=yield QE()(pT.map((pT=>`**/${pT}`)),{cwd:OT,absolute:true,onlyFiles:true});return BE}));const formatOperationsInDocument=pT=>{const xT=zE(pT);if(xT.length===0){return pT}let OT="";for(let BE=0;BE<=xT.length-1;BE+=1){const LE=xT[BE];const RE=xT[BE-1];const ME=RE==null?0:RE.end;OT+=pT.slice(ME,LE.start);OT+=restoreOperationPadding(prettify(LE.content),LE.content)}const BE=xT[xT.length-1];OT+=pT.slice(BE.end);return OT};var nC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addFormatGraphQLCommands=pT=>{pT.command("format-all-graphql").option("--ci","CI mode: Exit if unformatted files are encountered.").description("Format all GraphQL operations in project.").action((({ci:pT})=>nC(void 0,void 0,void 0,(function*(){const xT=loadRelayConfig();const OT=getRelayArtifactDirectoryLocation(xT);const LE=BE()("Findings files to format").start();const ME=yield getAllGeneratedFiles(OT);const VE=yield findAllSourceFilesFromGeneratedFiles(ME,LE);LE.text=`Searching for ${maybePluralize("source file",VE.length)}.`;const UE=yield findSourceFiles(VE,xT.src);const JE=yield Promise.all(UE.map((xT=>nC(void 0,void 0,void 0,(function*(){LE.text=`${pT?"Checking":"Formatting"} "${RE().basename(xT)}".`;const OT=yield jE().promises.readFile(xT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE&&!pT){yield jE().promises.writeFile(xT,BE)}return OT!==BE})))));const qE=JE.filter((pT=>pT===true)).length;if(pT){if(qE===0){LE.succeed(`Done! None of ${maybePluralize("file",UE.length)} in need of formatting.`);process.exit(0)}else{LE.fail(`${maybePluralize("file",qE)} needs formatting.`);process.exit(1)}}else{if(qE===0){LE.succeed(`Done! None of ${maybePluralize("scanned file",UE.length)} needed formatting.`)}else{LE.succeed(`Done! Formatted ${maybePluralize("file",qE)} of ${maybePluralize("scanned file",UE.length)}.`)}}}))));pT.command("format-single-graphql").description("Format GraphQL operations in single file.").argument("<file>","Path to file to format. Must be absolute.").action((pT=>nC(void 0,void 0,void 0,(function*(){const xT=BE()("Formatting file..").start();const OT=yield jE().promises.stat(pT,{throwIfNoEntry:false});if(OT==null){xT.fail("File does not exist.");process.exit(1)}try{const OT=yield jE().promises.readFile(pT,{encoding:"utf-8"});const BE=formatOperationsInDocument(OT);if(OT!==BE){yield jE().promises.writeFile(pT,BE);xT.succeed("Successfully formatted file.")}else{xT.succeed("File already formatted.")}}catch(pT){xT.fail("Could not format file.");process.exit(1)}}))))};var iC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addDebugCommand=pT=>{pT.command("debug").description("Prints debug information for the CLI.").action((()=>iC(void 0,void 0,void 0,(function*(){const pT=loadRelayConfig();const xT=getRelayArtifactDirectoryLocation(pT);console.log(`Artifact directory location: ${xT}\n`);console.log("Getting all generated files...\n");const OT=yield getAllGeneratedFiles(xT);console.log(`Number of generated files found in artifact directory: ${OT.length}\n`);console.log("Looking up source files\n");const BE=yield findAllSourceFilesFromGeneratedFiles(OT);console.log(`Found ${BE.length} source locations with explicit definitions.\n`);console.log("Looking up source files..\n");const LE=yield findSourceFiles(BE,pT.src);console.log(`Found ${LE.length} actual source files, when looking in ${getSrcCwd(pT.src)}.\n`);console.log("Done!")}))))};var aC=__nccwpck_require__(3129);var oC=__nccwpck_require__.n(aC);var sC=undefined&&undefined.__awaiter||function(pT,xT,OT,BE){function adopt(pT){return pT instanceof OT?pT:new OT((function(xT){xT(pT)}))}return new(OT||(OT=Promise))((function(OT,LE){function fulfilled(pT){try{step(BE.next(pT))}catch(pT){LE(pT)}}function rejected(pT){try{step(BE["throw"](pT))}catch(pT){LE(pT)}}function step(pT){pT.done?OT(pT.value):adopt(pT.value).then(fulfilled,rejected)}step((BE=BE.apply(pT,xT||[])).next())}))};const addRemoveUnusedFieldsCommand=pT=>{pT.command("remove-unused-fields").option("--verbose","Verbose mode").option("--debug","Debug mode").option("--ci","CI mode: Exit if unused fields exist, but don't remove them.").description("Remove unused GraphQL selections in fragments in current project.").action((({ci:pT,verbose:xT,debug:OT})=>{var LE;const ME=loadRelayConfig();const UE=getRelayArtifactDirectoryLocation(ME);const JE=BE()("Analyzing ReScript project").start();const qE=oC().spawn("npx",["reanalyze","-dce"]);if(qE.stdout==null){console.error("Something went wrong.");process.exit(1)}let KE="";qE.stdout.on("data",(pT=>{KE+=pT}));(LE=qE.stderr)===null||LE===void 0?void 0:LE.on("data",(pT=>{if(pT.includes("End_of_file")){JE.fail(`Something went wrong trying to analyze the ReScript project. Try cleaning your ReScript project and rebuilding it from scratch before trying again.`)}else{JE.fail(`Something went wrong trying to analyze the ReScript project.`)}if(OT){console.error(pT)}process.exit(1)}));qE.on("close",(()=>sC(void 0,void 0,void 0,(function*(){JE.text="Analyzing GraphQL usage";const BE=processReanalyzeOutput(KE);if(OT){console.log(`Found ${maybePluralize("file",Object.keys(BE).length)} with potentially missing fields.`)}const LE=[];JE.text="Scanning fragment files";if(OT){console.log(`Extracing source locations for ${maybePluralize("files",Object.keys(BE).length)}.`)}yield Promise.all(Object.entries(BE).map((([pT,xT])=>sC(void 0,void 0,void 0,(function*(){var OT;const BE=RE().resolve(UE,pT);try{const pT=yield jE().promises.readFile(BE,{encoding:"utf-8"});const RE=(OT=pT.match(rC))===null||OT===void 0?void 0:OT[0];if(RE!=null){LE.push(Object.assign(Object.assign({},xT),{sourceLocation:RE}))}}catch(pT){console.error(pT)}})))));JE.text=`Findings files`;const qE=LE.map((pT=>({path:pT.sourceLocation,graphqlName:pT.graphqlName})));const GE=yield findSourceFiles(qE.map((pT=>pT.path)),ME.src);const $E=GE.map((pT=>{const xT=LE.find((xT=>pT.endsWith(xT.sourceLocation)));if(xT!=null){return Object.assign(Object.assign({},xT),{absoluteFilePath:pT})}}));JE.text=`Analyzing found files`;const WE=[];yield Promise.all($E.map((pT=>sC(void 0,void 0,void 0,(function*(){var xT;if(pT==null)return;try{const OT=yield jE().promises.readFile(pT.absoluteFilePath,{encoding:"utf-8"});const BE=zE(OT);let LE=null;let RE=null;for(const OT of BE){const BE=(0,VE.Qc3)(OT.content);const ME=BE.definitions[0];if(ME==null){continue}if((ME.kind==="OperationDefinition"||ME.kind==="FragmentDefinition")&&((xT=ME.name)===null||xT===void 0?void 0:xT.value)===pT.graphqlName){LE=BE;RE=OT;break}}if(LE==null||RE==null)return;const ME=LE.definitions[0];if(ME==null||!(ME.kind==="FragmentDefinition"||ME.kind==="OperationDefinition")){return}WE.push(Object.assign({targetDef:ME,fileContents:OT,targetTag:RE},pT))}catch(pT){console.error(pT)}})))));if(xT&&LE.length>0){console.log(`\n\n------\nUnused fields: \n`,WE.map((pT=>`${pT.type==="fragment"?"Fragment":"Query"} "${pT.graphqlName}" in ${pT.sourceLocation}: \n ${pT.unusedFieldPaths.join("\n ")}`)).join("\n\n"),`\n------\n\n`)}if(pT){if(WE.length===0){JE.succeed("No unused fields found.");process.exit(0)}else{JE.fail(`Found ${WE.length} file(s) with unused fields.`);process.exit(1)}}JE.text=`Removing unused fields`;yield Promise.all(WE.map((({targetDef:pT,unusedFieldPaths:xT,targetTag:OT,absoluteFilePath:BE,fileContents:LE})=>sC(void 0,void 0,void 0,(function*(){const RE=removeUnusedFieldsFromOperation({definition:pT,unusedFieldPaths:xT});const ME=RE==null?"# This module is unused and can be removed":restoreOperationPadding(prettify((0,VE.S0v)(RE)),OT.content);yield jE().promises.writeFile(BE,`${LE.slice(0,OT.start)}${ME}${LE.slice(OT.end)}`)})))));const YE=WE.reduce(((pT,xT)=>{var OT;return pT+((OT=xT===null||xT===void 0?void 0:xT.unusedFieldPaths.length)!==null&&OT!==void 0?OT:0)}),0);if(YE===0){JE.succeed("Done! No unused fields found.")}else{JE.succeed(`Done! Removed ${maybePluralize("field",YE)} from ${maybePluralize("file",WE.length)}.`)}}))))}))};pT.program.version("0.1.0");addFormatGraphQLCommands(pT.program);addDebugCommand(pT.program);addRemoveUnusedFieldsCommand(pT.program);pT.program.parse(process.argv)})();module.exports=OT})();
|
package/compiler.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var spawn = require("child_process").spawn;
|
|
5
|
+
var path = require("path");
|
|
6
|
+
|
|
7
|
+
var input = process.argv.slice(2);
|
|
8
|
+
|
|
9
|
+
spawn(path.join(__dirname, "rescript-relay-compiler.exe"), input, {
|
|
10
|
+
stdio: "inherit",
|
|
11
|
+
}).on("exit", process.exit);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rescript-relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.11",
|
|
4
4
|
"main": "src/RescriptRelay.res",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Gabriel Nordeborn",
|
|
@@ -19,13 +19,21 @@
|
|
|
19
19
|
"reasonml",
|
|
20
20
|
"rescript"
|
|
21
21
|
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./src/utils": {
|
|
24
|
+
"require": "./src/utils.js",
|
|
25
|
+
"import": "./src/utils.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./src/*": "./src/*",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
22
30
|
"bin": {
|
|
23
|
-
"rescript-relay-compiler": "compiler
|
|
31
|
+
"rescript-relay-compiler": "compiler.js",
|
|
24
32
|
"rescript-relay-cli": "cli/cli.js"
|
|
25
33
|
},
|
|
26
34
|
"scripts": {
|
|
27
35
|
"build": "rescript build -with-deps",
|
|
28
|
-
"build:test": "compiler
|
|
36
|
+
"build:test": "./build-compiler-dev.sh && ./rescript-relay-compiler",
|
|
29
37
|
"postinstall": "node postinstall.js",
|
|
30
38
|
"test": "jest",
|
|
31
39
|
"test:ci": "jest --ci --runInBand"
|
|
@@ -35,29 +43,22 @@
|
|
|
35
43
|
"@testing-library/jest-dom": "^5.16.1",
|
|
36
44
|
"@testing-library/react": "^13.0.0-alpha.5",
|
|
37
45
|
"bs-fetch": "^0.5.0",
|
|
38
|
-
"graphql": "14.5.0",
|
|
39
46
|
"graphql-query-test-mock": "^0.12.1",
|
|
40
47
|
"jest": "^27.2.4",
|
|
41
48
|
"nock": "^11.7.0",
|
|
42
49
|
"node-fetch": "^2.6.0",
|
|
43
50
|
"react": "^18.0.0-rc.0",
|
|
44
51
|
"react-dom": "^18.0.0-rc.0",
|
|
45
|
-
"react-relay": "
|
|
46
|
-
"relay-
|
|
47
|
-
"relay-config": "12.0.0",
|
|
48
|
-
"relay-runtime": "12.0.0"
|
|
52
|
+
"react-relay": "13.0.1",
|
|
53
|
+
"relay-runtime": "13.0.1"
|
|
49
54
|
},
|
|
50
55
|
"peerDependencies": {
|
|
51
56
|
"@rescript/react": "*",
|
|
52
|
-
"graphql": "*",
|
|
53
57
|
"react-relay": "*",
|
|
54
|
-
"relay-compiler": "*",
|
|
55
|
-
"relay-config": "*",
|
|
56
58
|
"relay-runtime": "*",
|
|
57
59
|
"rescript": "^9.1.2"
|
|
58
60
|
},
|
|
59
61
|
"dependencies": {
|
|
60
|
-
"mkdirp-sync": "^0.0.3",
|
|
61
62
|
"rescript": "^9.1.2"
|
|
62
63
|
},
|
|
63
64
|
"resolutions": {
|
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-x64";
|
|
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
|
|
33
|
+
function ppxArch() {
|
|
23
34
|
/**
|
|
24
35
|
* Use Rosetta for ARM on macOS
|
|
25
36
|
*/
|
|
@@ -80,39 +91,55 @@ 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(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
108
|
+
path.join(
|
|
109
|
+
__dirname,
|
|
110
|
+
"relay-compiler-" + getRelayCompilerPlatformSuffix(),
|
|
111
|
+
"relay"
|
|
112
|
+
),
|
|
113
|
+
path.join(__dirname, "rescript-relay-compiler.exe")
|
|
96
114
|
);
|
|
115
|
+
fs.chmodSync(path.join(__dirname, "rescript-relay-compiler.exe"), 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.
|
|
103
|
-
|
|
121
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-linux-x64"), {
|
|
122
|
+
recursive: true,
|
|
123
|
+
force: true,
|
|
124
|
+
});
|
|
125
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-macos-x64"), {
|
|
126
|
+
recursive: true,
|
|
127
|
+
force: true,
|
|
128
|
+
});
|
|
129
|
+
fs.rmSync(path.join(__dirname, "relay-compiler-macos-arm64"), {
|
|
130
|
+
recursive: true,
|
|
131
|
+
force: true,
|
|
132
|
+
});
|
|
104
133
|
}
|
|
105
134
|
|
|
106
135
|
switch (platform) {
|
|
107
136
|
case "win32": {
|
|
108
|
-
if (
|
|
137
|
+
if (ppxArch() !== "x64") {
|
|
109
138
|
console.warn("error: x86 is currently not supported on Windows");
|
|
110
139
|
process.exit(1);
|
|
111
140
|
}
|
|
112
141
|
|
|
113
142
|
throw new Error("Windows currently not supported.");
|
|
114
|
-
copyPlatformBinaries("windows");
|
|
115
|
-
break;
|
|
116
143
|
}
|
|
117
144
|
case "linux":
|
|
118
145
|
case "darwin":
|
package/ppx-darwin
CHANGED
|
Binary file
|
package/ppx-linux
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|