Skip to content

Commit 878617a

Browse files
authored
feat: run prettier in parallel in generate-clients (#1949)
1 parent b4b6fad commit 878617a

File tree

3 files changed

+130
-9
lines changed

3 files changed

+130
-9
lines changed

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"devDependencies": {
4545
"@commitlint/cli": "^11.0.0",
4646
"@commitlint/config-conventional": "^11.0.0",
47+
"@mixer/parallel-prettier": "^2.0.1",
4748
"@types/chai-as-promised": "^7.1.2",
4849
"@types/fs-extra": "^8.0.1",
4950
"@types/jest": "^26.0.4",
@@ -115,4 +116,4 @@
115116
],
116117
"**/*.{ts,js,md,json}": "prettier --write"
117118
}
118-
}
119+
}

Diff for: scripts/generate-clients/code-prettify.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
const { spawnProcess } = require("../utils/spawn-process");
33
const path = require("path");
44

5-
const prettifyCode = async (dir) => {
6-
await spawnProcess(path.join(__dirname, "..", "..", "node_modules", ".bin", "prettier"), [
5+
const prettifyCode = async (dir) =>
6+
spawnProcess(path.join(__dirname, "..", "..", "node_modules", ".bin", "pprettier"), [
77
"--write",
8-
`${dir}/**/*.{ts,js,md,json}`,
8+
`${dir}/*/typescript-codegen/**/*.{ts,js,md,json}`,
99
]);
10-
};
1110

1211
module.exports = {
1312
prettifyCode,

Diff for: yarn.lock

+125-4
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,19 @@
14341434
npmlog "^4.1.2"
14351435
write-file-atomic "^2.3.0"
14361436

1437+
"@mixer/parallel-prettier@^2.0.1":
1438+
version "2.0.1"
1439+
resolved "https://registry.yarnpkg.com/@mixer/parallel-prettier/-/parallel-prettier-2.0.1.tgz#fd69bb55e38b3c1dbb2f1a534ea1a0cd3fe34946"
1440+
integrity sha512-bx/rdOhJ2EOxQTm4cQQBsdbg+IwaQHh/ugIZMsWNEILXLJWQukCv+6fDUBZkoIk/zEoW45uIrCugARCuuDwrWw==
1441+
dependencies:
1442+
chalk "^4.1.0"
1443+
commander "^7.0.0"
1444+
glob-stream "^6.1.0"
1445+
ignore "^5.1.8"
1446+
ora "^5.3.0"
1447+
prettier "^2.0.4"
1448+
rxjs "^6.6.3"
1449+
14371450
"@mrmlnc/readdir-enhanced@^2.2.1":
14381451
version "2.2.1"
14391452
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
@@ -3237,6 +3250,11 @@ cli-cursor@^3.1.0:
32373250
dependencies:
32383251
restore-cursor "^3.1.0"
32393252

3253+
cli-spinners@^2.5.0:
3254+
version "2.5.0"
3255+
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.5.0.tgz#12763e47251bf951cb75c201dfa58ff1bcb2d047"
3256+
integrity sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==
3257+
32403258
cli-table3@^0.5.1:
32413259
version "0.5.1"
32423260
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202"
@@ -3395,6 +3413,11 @@ commander@^6.2.0:
33953413
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
33963414
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
33973415

3416+
commander@^7.0.0:
3417+
version "7.0.0"
3418+
resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2"
3419+
integrity sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA==
3420+
33983421
commondir@^1.0.1:
33993422
version "1.0.1"
34003423
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
@@ -5447,6 +5470,22 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
54475470
dependencies:
54485471
is-glob "^4.0.1"
54495472

5473+
glob-stream@^6.1.0:
5474+
version "6.1.0"
5475+
resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4"
5476+
integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=
5477+
dependencies:
5478+
extend "^3.0.0"
5479+
glob "^7.1.1"
5480+
glob-parent "^3.1.0"
5481+
is-negated-glob "^1.0.0"
5482+
ordered-read-streams "^1.0.0"
5483+
pumpify "^1.3.5"
5484+
readable-stream "^2.1.5"
5485+
remove-trailing-separator "^1.0.1"
5486+
to-absolute-glob "^2.0.0"
5487+
unique-stream "^2.0.2"
5488+
54505489
glob-to-regexp@^0.3.0:
54515490
version "0.3.0"
54525491
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
@@ -5913,7 +5952,7 @@ ignore@^4.0.3, ignore@^4.0.6:
59135952
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
59145953
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
59155954

5916-
ignore@^5.1.4:
5955+
ignore@^5.1.4, ignore@^5.1.8:
59175956
version "5.1.8"
59185957
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
59195958
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
@@ -6080,6 +6119,14 @@ [email protected]:
60806119
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
60816120
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
60826121

6122+
is-absolute@^1.0.0:
6123+
version "1.0.0"
6124+
resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576"
6125+
integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==
6126+
dependencies:
6127+
is-relative "^1.0.0"
6128+
is-windows "^1.0.1"
6129+
60836130
is-accessor-descriptor@^0.1.6:
60846131
version "0.1.6"
60856132
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
@@ -6259,6 +6306,11 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1:
62596306
dependencies:
62606307
is-extglob "^2.1.1"
62616308

6309+
is-interactive@^1.0.0:
6310+
version "1.0.0"
6311+
resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e"
6312+
integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==
6313+
62626314
is-nan@^1.2.1:
62636315
version "1.3.2"
62646316
resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d"
@@ -6267,6 +6319,11 @@ is-nan@^1.2.1:
62676319
call-bind "^1.0.0"
62686320
define-properties "^1.1.3"
62696321

6322+
is-negated-glob@^1.0.0:
6323+
version "1.0.0"
6324+
resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2"
6325+
integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=
6326+
62706327
is-negative-zero@^2.0.0:
62716328
version "2.0.1"
62726329
resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24"
@@ -6333,6 +6390,13 @@ is-regexp@^1.0.0:
63336390
resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
63346391
integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk=
63356392

6393+
is-relative@^1.0.0:
6394+
version "1.0.0"
6395+
resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d"
6396+
integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==
6397+
dependencies:
6398+
is-unc-path "^1.0.0"
6399+
63366400
is-ssh@^1.3.0:
63376401
version "1.3.2"
63386402
resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.2.tgz#a4b82ab63d73976fd8263cceee27f99a88bdae2b"
@@ -6380,6 +6444,13 @@ is-typedarray@^1.0.0, is-typedarray@~1.0.0:
63806444
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
63816445
integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
63826446

6447+
is-unc-path@^1.0.0:
6448+
version "1.0.0"
6449+
resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d"
6450+
integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==
6451+
dependencies:
6452+
unc-path-regex "^0.1.2"
6453+
63836454
is-utf8@^0.2.0:
63846455
version "0.2.1"
63856456
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
@@ -8633,6 +8704,27 @@ optionator@^0.9.1:
86338704
type-check "^0.4.0"
86348705
word-wrap "^1.2.3"
86358706

8707+
ora@^5.3.0:
8708+
version "5.3.0"
8709+
resolved "https://registry.yarnpkg.com/ora/-/ora-5.3.0.tgz#fb832899d3a1372fe71c8b2c534bbfe74961bb6f"
8710+
integrity sha512-zAKMgGXUim0Jyd6CXK9lraBnD3H5yPGBPPOkC23a2BG6hsm4Zu6OQSjQuEtV0BHDf4aKHcUFvJiGRrFuW3MG8g==
8711+
dependencies:
8712+
bl "^4.0.3"
8713+
chalk "^4.1.0"
8714+
cli-cursor "^3.1.0"
8715+
cli-spinners "^2.5.0"
8716+
is-interactive "^1.0.0"
8717+
log-symbols "^4.0.0"
8718+
strip-ansi "^6.0.0"
8719+
wcwidth "^1.0.1"
8720+
8721+
ordered-read-streams@^1.0.0:
8722+
version "1.0.1"
8723+
resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e"
8724+
integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=
8725+
dependencies:
8726+
readable-stream "^2.0.1"
8727+
86368728
os-browserify@^0.3.0:
86378729
version "0.3.0"
86388730
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
@@ -9110,7 +9202,7 @@ prettier-linter-helpers@^1.0.0:
91109202
dependencies:
91119203
fast-diff "^1.1.2"
91129204

9113-
9205+
[email protected], prettier@^2.0.4:
91149206
version "2.2.1"
91159207
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
91169208
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
@@ -9241,7 +9333,7 @@ pump@^3.0.0:
92419333
end-of-stream "^1.1.0"
92429334
once "^1.3.1"
92439335

9244-
pumpify@^1.3.3:
9336+
pumpify@^1.3.3, pumpify@^1.3.5:
92459337
version "1.5.1"
92469338
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce"
92479339
integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==
@@ -10853,7 +10945,15 @@ throat@^5.0.0:
1085310945
resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b"
1085410946
integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==
1085510947

10856-
through2@^2.0.0, through2@^2.0.2:
10948+
through2-filter@^3.0.0:
10949+
version "3.0.0"
10950+
resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254"
10951+
integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==
10952+
dependencies:
10953+
through2 "~2.0.0"
10954+
xtend "~4.0.0"
10955+
10956+
through2@^2.0.0, through2@^2.0.2, through2@~2.0.0:
1085710957
version "2.0.5"
1085810958
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"
1085910959
integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==
@@ -10915,6 +11015,14 @@ [email protected]:
1091511015
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
1091611016
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
1091711017

11018+
to-absolute-glob@^2.0.0:
11019+
version "2.0.2"
11020+
resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b"
11021+
integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=
11022+
dependencies:
11023+
is-absolute "^1.0.0"
11024+
is-negated-glob "^1.0.0"
11025+
1091811026
1091911027
version "0.1.4"
1092011028
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
@@ -11232,6 +11340,11 @@ unbzip2-stream@^1.3.3:
1123211340
buffer "^5.2.1"
1123311341
through "^2.3.8"
1123411342

11343+
unc-path-regex@^0.1.2:
11344+
version "0.1.2"
11345+
resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa"
11346+
integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo=
11347+
1123511348
union-value@^1.0.0:
1123611349
version "1.0.1"
1123711350
resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"
@@ -11256,6 +11369,14 @@ unique-slug@^2.0.0:
1125611369
dependencies:
1125711370
imurmurhash "^0.1.4"
1125811371

11372+
unique-stream@^2.0.2:
11373+
version "2.3.1"
11374+
resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac"
11375+
integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==
11376+
dependencies:
11377+
json-stable-stringify-without-jsonify "^1.0.1"
11378+
through2-filter "^3.0.0"
11379+
1125911380
universal-user-agent@^4.0.0:
1126011381
version "4.0.1"
1126111382
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.1.tgz#fd8d6cb773a679a709e967ef8288a31fcc03e557"

0 commit comments

Comments
 (0)