Skip to content

Commit 2570ab6

Browse files
committed
build: switch to exports
1 parent a9613ec commit 2570ab6

File tree

5 files changed

+61
-38
lines changed

5 files changed

+61
-38
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
lib/
2-
esm/
2+
cjs/
33

44
# Logs
55
logs

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
"bootstrap": "yarn && yarn --cwd www",
3434
"test": "jest --coverage",
3535
"tdd": "jest --watch",
36-
"build:pick": "cherry-pick --name=@restart/hooks --cwd=lib --input-dir=../src --cjs-dir=cjs --esm-dir=esm",
37-
"build": "rimraf lib && 4c build src && yarn build:pick",
36+
"build": "rimraf lib cjs && concurrently --names 'esm,cjs' 'yarn build:esm' 'yarn build:cjs' && concurrently --names 'esm types,cjs types' 'yarn build:esm:types' 'yarn build:cjs:types'",
37+
"build:esm": "babel src --env-name esm --out-dir lib --extensions '.ts,.tsx' --ignore='**/*.d.ts'",
38+
"build:esm:types": "tsc -p . --emitDeclarationOnly --declaration --outDir lib",
39+
"build:cjs": "babel src --out-dir cjs --extensions '.ts,.tsx' --ignore='**/*.d.ts'",
40+
"build:cjs:types": "tsc -p . --emitDeclarationOnly --declaration --outDir cjs --module commonjs --moduleResolution node",
3841
"deploy-docs": "yarn --cwd www build --prefix-paths && gh-pages -d www/public",
3942
"prepublishOnly": "yarn build",
4043
"release": "rollout"
@@ -79,6 +82,7 @@
7982
"babel-plugin-transform-rename-import": "^2.3.0",
8083
"cherry-pick": "^0.5.0",
8184
"codecov": "^3.8.3",
85+
"concurrently": "^9.1.2",
8286
"eslint": "^8.44.0",
8387
"gh-pages": "^3.1.0",
8488
"husky": "^4.3.6",

scripts/build.mjs

Whitespace-only changes.

src/index.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

yarn.lock

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,6 +3196,19 @@ concat-stream@^2.0.0:
31963196
readable-stream "^3.0.2"
31973197
typedarray "^0.0.6"
31983198

3199+
concurrently@^9.1.2:
3200+
version "9.1.2"
3201+
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-9.1.2.tgz#22d9109296961eaee773e12bfb1ce9a66bc9836c"
3202+
integrity sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==
3203+
dependencies:
3204+
chalk "^4.1.2"
3205+
lodash "^4.17.21"
3206+
rxjs "^7.8.1"
3207+
shell-quote "^1.8.1"
3208+
supports-color "^8.1.1"
3209+
tree-kill "^1.2.2"
3210+
yargs "^17.7.2"
3211+
31993212
connect-history-api-fallback@^1.6.0:
32003213
version "1.6.0"
32013214
resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc"
@@ -8599,7 +8612,7 @@ rxjs@^6.3.3, rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.6.0:
85998612
dependencies:
86008613
tslib "^1.9.0"
86018614

8602-
rxjs@^7.2.0, rxjs@^7.3.0, rxjs@^7.5.5, rxjs@^7.8.0:
8615+
rxjs@^7.2.0, rxjs@^7.3.0, rxjs@^7.5.5, rxjs@^7.8.0, rxjs@^7.8.1:
86038616
version "7.8.1"
86048617
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
86058618
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
@@ -8805,6 +8818,11 @@ shell-quote@^1.7.3:
88058818
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680"
88068819
integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==
88078820

8821+
shell-quote@^1.8.1:
8822+
version "1.8.2"
8823+
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.2.tgz#d2d83e057959d53ec261311e9e9b8f51dcb2934a"
8824+
integrity sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==
8825+
88088826
shelljs@^0.8.3:
88098827
version "0.8.4"
88108828
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
@@ -9133,7 +9151,7 @@ string-length@^4.0.1:
91339151
char-regex "^1.0.2"
91349152
strip-ansi "^6.0.0"
91359153

9136-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
9154+
"string-width-cjs@npm:string-width@^4.2.0":
91379155
version "4.2.3"
91389156
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
91399157
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -9168,6 +9186,15 @@ string-width@^3.0.0, string-width@^3.1.0:
91689186
is-fullwidth-code-point "^2.0.0"
91699187
strip-ansi "^5.1.0"
91709188

9189+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
9190+
version "4.2.3"
9191+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
9192+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
9193+
dependencies:
9194+
emoji-regex "^8.0.0"
9195+
is-fullwidth-code-point "^3.0.0"
9196+
strip-ansi "^6.0.1"
9197+
91719198
string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2:
91729199
version "5.1.2"
91739200
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
@@ -9191,7 +9218,7 @@ string_decoder@~1.1.1:
91919218
dependencies:
91929219
safe-buffer "~5.1.0"
91939220

9194-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
9221+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
91959222
version "6.0.1"
91969223
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
91979224
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -9219,6 +9246,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
92199246
dependencies:
92209247
ansi-regex "^4.1.0"
92219248

9249+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
9250+
version "6.0.1"
9251+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
9252+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
9253+
dependencies:
9254+
ansi-regex "^5.0.1"
9255+
92229256
strip-ansi@^7.0.1:
92239257
version "7.1.0"
92249258
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -9333,7 +9367,7 @@ supports-color@^7.1.0:
93339367
dependencies:
93349368
has-flag "^4.0.0"
93359369

9336-
supports-color@^8.0.0:
9370+
supports-color@^8.0.0, supports-color@^8.1.1:
93379371
version "8.1.1"
93389372
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
93399373
integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
@@ -9544,6 +9578,11 @@ tr46@~0.0.3:
95449578
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
95459579
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
95469580

9581+
tree-kill@^1.2.2:
9582+
version "1.2.2"
9583+
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
9584+
integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==
9585+
95479586
trim-newlines@^1.0.0:
95489587
version "1.0.0"
95499588
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
@@ -10079,7 +10118,7 @@ wordwrap@^1.0.0:
1007910118
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
1008010119
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=
1008110120

10082-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
10121+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
1008310122
version "7.0.0"
1008410123
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
1008510124
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -10114,6 +10153,15 @@ wrap-ansi@^6.2.0:
1011410153
string-width "^4.1.0"
1011510154
strip-ansi "^6.0.0"
1011610155

10156+
wrap-ansi@^7.0.0:
10157+
version "7.0.0"
10158+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
10159+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
10160+
dependencies:
10161+
ansi-styles "^4.0.0"
10162+
string-width "^4.1.0"
10163+
strip-ansi "^6.0.0"
10164+
1011710165
wrap-ansi@^8.1.0:
1011810166
version "8.1.0"
1011910167
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
@@ -10227,7 +10275,7 @@ yargs@^13.2.4, yargs@^13.3.2:
1022710275
y18n "^4.0.0"
1022810276
yargs-parser "^13.1.2"
1022910277

10230-
yargs@^17.3.0, yargs@^17.3.1:
10278+
yargs@^17.3.0, yargs@^17.3.1, yargs@^17.7.2:
1023110279
version "17.7.2"
1023210280
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
1023310281
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==

0 commit comments

Comments
 (0)