Skip to content

Commit 755aa9a

Browse files
author
sw-yx
committed
use patch package to overwrite terser option
1 parent 388580b commit 755aa9a

File tree

5 files changed

+88
-8
lines changed

5 files changed

+88
-8
lines changed

.size-snapshot.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.cjs.development.js": {
3-
"bundled": 10972,
3+
"bundled": 10793,
44
"minified": 5037,
55
"gzipped": 1648
66
},
77
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.cjs.production.js": {
8-
"bundled": 10972,
8+
"bundled": 10793,
99
"minified": 5037,
1010
"gzipped": 1648
1111
},
1212
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.umd.development.js": {
13-
"bundled": 11954,
13+
"bundled": 11765,
1414
"minified": 4641,
1515
"gzipped": 1644
1616
},
1717
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.umd.production.js": {
18-
"bundled": 11954,
18+
"bundled": 11765,
1919
"minified": 4641,
2020
"gzipped": 1644
2121
},
2222
"/Users/swyx/Netlify/react-netlify-identity-widget/dist/reactNetlifyIdentityWidget.es.production.js": {
23-
"bundled": 10768,
23+
"bundled": 10589,
2424
"minified": 4832,
2525
"gzipped": 1586,
2626
"treeshaked": {

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# React Netlify Identity Widget
22

33
This is a React port of https://github.com/netlify/netlify-identity-widget (48kb) taking the lightweight functionality https://github.com/sw-yx/react-netlify-identity (4kb) and adding back the nicer UI with a focus on accessibility (with @reach UI) and bundle size.
4+
5+
# tsdx bug
6+
7+
we use https://github.com/ds300/patch-package to patch this bug https://github.com/jaredpalmer/tsdx/issues/36

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"build": "tsdx build",
1616
"test": "tsdx test",
1717
"version": "tsdx build && auto-changelog -p --template keepachangelog && git add .",
18-
"prepublishOnly": "git push && git push --tags && gh-release"
18+
"prepublishOnly": "git push && git push --tags && gh-release",
19+
"postinstall": "patch-package"
1920
},
2021
"devDependencies": {
2122
"@types/jest": "^24.0.11",
@@ -26,6 +27,8 @@
2627
"cz-conventional-changelog": "2.1.0",
2728
"gh-release": "^3.5.0",
2829
"husky": "^1.3.1",
30+
"patch-package": "^6.1.2",
31+
"postinstall-postinstall": "^2.0.0",
2932
"semantic-release": "^15.13.3",
3033
"tsdx": "^0.3.4",
3134
"typescript": "^3.4.4"

patches/tsdx+0.3.4.patch

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/node_modules/tsdx/dist/createRollupConfig.js b/node_modules/tsdx/dist/createRollupConfig.js
2+
index d97884e..872a117 100644
3+
--- a/node_modules/tsdx/dist/createRollupConfig.js
4+
+++ b/node_modules/tsdx/dist/createRollupConfig.js
5+
@@ -105,10 +105,11 @@ function createRollupConfig(format, env, opts) {
6+
rollup_plugin_terser_1.terser({
7+
sourcemap: true,
8+
output: { comments: false },
9+
- compress: {
10+
- keep_infinity: true,
11+
- pure_getters: true,
12+
- },
13+
+ // compress: {
14+
+ // keep_infinity: true,
15+
+ // pure_getters: true,
16+
+ // },
17+
+ compress: false,
18+
ecma: 5,
19+
toplevel: format === 'es' || format === 'cjs',
20+
warnings: true,

yarn.lock

+55-2
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@
530530
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
531531
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
532532

533+
"@yarnpkg/lockfile@^1.1.0":
534+
version "1.1.0"
535+
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
536+
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
537+
533538
JSONStream@^1.0.4, JSONStream@^1.3.4:
534539
version "1.3.5"
535540
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
@@ -1978,7 +1983,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
19781983
shebang-command "^1.2.0"
19791984
which "^1.2.9"
19801985

1981-
cross-spawn@^6.0.0:
1986+
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
19821987
version "6.0.5"
19831988
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
19841989
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
@@ -2805,6 +2810,14 @@ find-versions@^3.0.0:
28052810
array-uniq "^2.1.0"
28062811
semver-regex "^2.0.0"
28072812

2813+
find-yarn-workspace-root@^1.2.1:
2814+
version "1.2.1"
2815+
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db"
2816+
integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q==
2817+
dependencies:
2818+
fs-extra "^4.0.3"
2819+
micromatch "^3.1.4"
2820+
28082821
findup-sync@^3.0.0:
28092822
version "3.0.0"
28102823
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1"
@@ -2886,6 +2899,15 @@ [email protected], fs-extra@^7.0.0, fs-extra@^7.0.1:
28862899
jsonfile "^4.0.0"
28872900
universalify "^0.1.0"
28882901

2902+
fs-extra@^4.0.3:
2903+
version "4.0.3"
2904+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
2905+
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==
2906+
dependencies:
2907+
graceful-fs "^4.1.2"
2908+
jsonfile "^4.0.0"
2909+
universalify "^0.1.0"
2910+
28892911
fs-minipass@^1.2.5:
28902912
version "1.2.5"
28912913
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d"
@@ -4549,6 +4571,13 @@ kind-of@^6.0.0, kind-of@^6.0.2:
45494571
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
45504572
integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==
45514573

4574+
klaw-sync@^6.0.0:
4575+
version "6.0.0"
4576+
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
4577+
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
4578+
dependencies:
4579+
graceful-fs "^4.1.11"
4580+
45524581
kleur@^2.0.1:
45534582
version "2.0.2"
45544583
resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300"
@@ -6113,6 +6142,25 @@ pascalcase@^0.1.1:
61136142
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
61146143
integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=
61156144

6145+
patch-package@^6.1.2:
6146+
version "6.1.2"
6147+
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.1.2.tgz#9ed0b3defb5c34ecbef3f334ddfb13e01b3d3ff6"
6148+
integrity sha512-5GnzR8lEyeleeariG+hGabUnD2b1yL7AIGFjlLo95zMGRWhZCel58IpeKD46wwPb7i+uNhUI8unV56ogk8Bgqg==
6149+
dependencies:
6150+
"@yarnpkg/lockfile" "^1.1.0"
6151+
chalk "^2.4.2"
6152+
cross-spawn "^6.0.5"
6153+
find-yarn-workspace-root "^1.2.1"
6154+
fs-extra "^7.0.1"
6155+
is-ci "^2.0.0"
6156+
klaw-sync "^6.0.0"
6157+
minimist "^1.2.0"
6158+
rimraf "^2.6.3"
6159+
semver "^5.6.0"
6160+
slash "^2.0.0"
6161+
tmp "^0.0.33"
6162+
update-notifier "^2.5.0"
6163+
61166164
61176165
version "0.0.0"
61186166
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a"
@@ -6253,6 +6301,11 @@ posix-character-classes@^0.1.0:
62536301
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
62546302
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
62556303

6304+
postinstall-postinstall@^2.0.0:
6305+
version "2.0.0"
6306+
resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.0.0.tgz#7ba6711b4420575c4f561638836a81faad47f43f"
6307+
integrity sha512-3f6qWexsHiT4WKtZc5DRb0FPLilHtARi5KpY4fqban/DJNn8/YhZH8U7dVKVz51WbOxEnR31gV+qYQhvEdHtdQ==
6308+
62566309
prelude-ls@~1.1.2:
62576310
version "1.1.2"
62586311
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
@@ -6953,7 +7006,7 @@ right-pad@^1.0.1:
69537006
resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0"
69547007
integrity sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA=
69557008

6956-
rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2:
7009+
rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2:
69577010
version "2.6.3"
69587011
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
69597012
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==

0 commit comments

Comments
 (0)