From 671210acad29d7639fc94613b9afd1f7116e4cda Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 15:31:40 -0500 Subject: [PATCH 1/7] Convert Webpack configuration to TypeScript --- package.json | 6 +- tsconfig.json | 5 + webpack.config.js => webpack.config.ts | Bin 338 -> 485 bytes .../{configuration.js => configuration.ts} | Bin 789 -> 797 bytes webpack/{development.js => development.ts} | Bin 2423 -> 2686 bytes webpack/{production.js => production.ts} | Bin 4444 -> 4582 bytes webpack/{shared.js => shared.ts} | Bin 4474 -> 4619 bytes webpack/test.js | Bin 302 -> 0 bytes webpack/test.ts | 14 + yarn.lock | 259 ++++++++++++++++-- 10 files changed, 262 insertions(+), 22 deletions(-) rename webpack.config.js => webpack.config.ts (51%) rename webpack/{configuration.js => configuration.ts} (82%) rename webpack/{development.js => development.ts} (60%) rename webpack/{production.js => production.ts} (88%) rename webpack/{shared.js => shared.ts} (78%) delete mode 100644 webpack/test.js create mode 100644 webpack/test.ts diff --git a/package.json b/package.json index 1ba60028be..0e528b5313 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,9 @@ "@types/seedrandom": "^3.0.2", "@types/semver": "^7.3.9", "@types/uuid": "^8.3.4", + "@types/webpack-assets-manifest": "^5.1.0", + "@types/webpack-bundle-analyzer": "^4.6.0", + "@types/webpack-deadcode-plugin": "^0.1.2", "array-includes": "^3.1.5", "autoprefixer": "^10.4.2", "axios": "^1.0.0-alpha.1", @@ -107,7 +110,7 @@ "browserslist": "^4.16.6", "cheerio": "^1.0.0-rc.10", "clsx": "^1.2.1", - "copy-webpack-plugin": "^9.0.1", + "copy-webpack-plugin": "^11.0.0", "core-js": "^3.15.2", "cryptocurrency-icons": "^0.18.0", "css-loader": "^6.7.1", @@ -192,6 +195,7 @@ "terser-webpack-plugin": "^5.2.3", "tiny-queue": "^0.2.1", "ts-loader": "^9.3.0", + "ts-node": "^10.9.1", "tslib": "^2.3.1", "twemoji": "https://github.com/twitter/twemoji#v14.0.2", "typescript": "^4.4.4", diff --git a/tsconfig.json b/tsconfig.json index dba721d723..04ec4a4701 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,5 +14,10 @@ "experimentalDecorators": true, "esModuleInterop": true, "typeRoots": [ "./types", "./node_modules/@types"] + }, + "ts-node": { + "compilerOptions": { + "module": "CommonJS" + } } } diff --git a/webpack.config.js b/webpack.config.ts similarity index 51% rename from webpack.config.js rename to webpack.config.ts index ea367479e85af8a81bdbe18cfbe7fe3fe11a8093..271dca7fe547de9f37b75bffea39959573224a08 100644 GIT binary patch delta 197 zcmcb_^prU`Gq)hWs6-(pza%xUOd+i(KUYB=!cn*8;)2SSR2HNvR4X{==cQ$)mlh?K zWaj57)IwF4rzRC7CTD|`Lo`kl)K|?(Em25DR&Ir++g72vcA{-4FN&gx3zT{FQc}|r bOLI!BxfB!>CLZaN<4Uc7I1wU_YOFN?tKCQE delta 53 zcmaFLe2Gc0D7COOvnW+VJte;+HLpxvb7HXm#8p9jx%nxjIjMT76$SZ4CB>6D8I>8W JCtEW10RR-!6374m diff --git a/webpack/configuration.js b/webpack/configuration.ts similarity index 82% rename from webpack/configuration.js rename to webpack/configuration.ts index f2cc0c7fb736f385daa9563508300ffc5c3d9737..9596cf8e3e283da8e98b75735193be98d96a00ef 100644 GIT binary patch delta 172 zcmbQrHkZvRGq)hWs6?S!AuB&KPoY*JttdZNLA@ZcBtzYr3oe_>@ zQq7c+oS#=*qL5kvGQ<_A$X216OF_ZU-^DfF)i2CS0jNY(rm)=nl+v73z0`_={GyU#ph4AK3JS%kB_)}8>BTxgHc-D6SWrR1&)>y0 d-qkP63M8lp?et>&F!<}E?PMu8J8Y*sPaqhY2oVoYDjlWOcKeoMqQ7+*U&Zrkc3o4ujP+&y5 zg|cDvs{!&V_RAM|%7}el(rAh&T*A@Wq+!LYc9s4wCSZysn+%nqrnRdzPNYY_th?HZ z-!)Iu`)nd$3+qS7>&O$ou8s)@oHm*Xwnx~v%nsH|LifdymTVdd2^U1#?mmly2rEg} zvpO!Mi-nU;F*7s delta 463 zcmY+By-or_6orF-yO2m>z=B}B8j}Ts&{$zCj7TIgG5#gC!|sJ0U3S))K}dk;BWR|? zx8Ncaqbf#Xe^a?Du)k*<~B zNhBsn3waa&Gaal4#J=7Nr3frs!qM4heuFlnp2gCSGDVXTIz-y;aUiK~GJ1|BXVly5 ziK@-LFG9Z$m4oWu#nJg$ab(Ru#nkIUb)&_cwueRR28>Ig?Zfn3G_x>D#n)q*GV~Il zkIh;EM0Xe1VKyx6bIOHU!6zJzeWONI_ zQb1GTRyvjDNv7naI_4$jR92-HLG?o2Fj*=jWwmrbAt!rw}4+xTGjE zFFiVTGCz~LN^*W)aft$u1lj=AYK3N!?dB*Z6K+;3h0q|M&3(M5nO%WqrB;9gIwdtN Zu{5Vd0qk%a6c^ZOAiG`%)ecQ-E&vQOn0NpH delta 321 zcmaE+d`D@*tor2qyy6mtYK5%)%sho!1zUxp)WXutqErp_g2a*xbxmt7E{GEUw6vVe zywrf4(sZCoBy|os$teZ;`4DN{04>~AWRon3dyC#8Hq)yDbD$MX_@KB4%O3#$RH`Lo_vw9 ud~y(zx=L<-N@-52UTQ@_eo;v=P#f4(4P>))HqT`;;of|W_cSvz(0>3Zp>YiW diff --git a/webpack/shared.js b/webpack/shared.ts similarity index 78% rename from webpack/shared.js rename to webpack/shared.ts index 8d1d1fcf5e67fa1d51b04529a5d27c7357c8e9ee..dfcf9b2aaab26ef1bdecf02b02e9486a339a95cf 100644 GIT binary patch delta 723 zcmaJ)T#da;jwGj*A|j41N@hPr z7bkJ?L+I!?aCI{F?)nG8Ddgq%et+J}_v-!H!`=zv&KaRa z;8-y40>gET36MO~s03DH!PUMOwg`>i9bG70;?n>*?NZQx8Isl+Zy$=<8Ft#3A3uI% zC;P&WUof2rtCQ?vCgM_C#xf*z*pGt*LKkX` zx}+6yBnhK~P%&U&RK1#W)i_X+1qp$rDEWvI7YjMS!VX5w8f)TFS2=}d=Vvq~nv=Ro zEp0?IwrpqA!jOiC9!?fv+5KBiy{EdVLO~r(Sa}NywyArC)H^}VI`J@6A@AywA|IDQ zNKR;LT|G_QHOha-Wi^7|%mS)g&@}-fswQ?(=t=Q!1N5rtPvbzR0j(`VPN8vnjvZ;~ zp^z5MCoDw>5J$dPub9^w9Z8JkEst-Yx0$(3XKfp{^=LH{<5)eLZ{w9-XEv2tF>$B= NTVt(X|HDmI%pdo>`t$$* delta 569 zcmZuuK}y3w6eVpHNpM-D)ygPhT4>S(NQ+V_ZbUcYdfHCfsmV;7nN+0|l{AmjPy|Xgb_1?ddaQ z0D2UYvI04E`v?q^L?4Rogc@?|)W11(gAOJM($h6=XDwHr4-F*=LuS~DfWJSN7+6*LTu8J=rll(e~+LxKt|$@kB`pbON|Ho z=!RuWhR9?-8oD6vm)+|7Q#~1J(sharedConfig, configuration); diff --git a/yarn.lock b/yarn.lock index a3cbcff2ec..eee0379718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1377,6 +1377,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@discoveryjs/json-ext@^0.5.0": version "0.5.5" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz#9283c9ce5b289a3c4f61c12757469e59377f81f3" @@ -1833,6 +1840,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.0": version "0.3.4" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" @@ -2371,6 +2386,26 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + "@types/aria-query@^4.2.0": version "4.2.2" resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" @@ -2873,11 +2908,21 @@ dependencies: "@types/node" "*" +"@types/source-list-map@*": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" + integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== + "@types/stack-utils@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== +"@types/tapable@^1": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.8.tgz#b94a4391c85666c7b73299fd3ad79d4faa435310" + integrity sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ== + "@types/testing-library__jest-dom@^5.9.1": version "5.14.3" resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.3.tgz#ee6c7ffe9f8595882ee7bda8af33ae7b8789ef17" @@ -2890,6 +2935,13 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397" integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw== +"@types/uglify-js@*": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.17.0.tgz#95271e7abe0bf7094c60284f76ee43232aef43b9" + integrity sha512-3HO6rm0y+/cqvOyA8xcYLweF0TKXlAxmQASjbOi49Co51A1N4nR4bEwBgRoD9kNM+rqFGArjKr654SLp2CoGmQ== + dependencies: + source-map "^0.6.1" + "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" @@ -2905,6 +2957,52 @@ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== +"@types/webpack-assets-manifest@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/webpack-assets-manifest/-/webpack-assets-manifest-5.1.0.tgz#82ae3f8fb5ca306319d58b9cdfc4ad72afbdc6c6" + integrity sha512-XfqZOVP6n220SXYAVyFdPX+6DCGdejVQ/mj2l+eI5D0QL6+GaRTo4rBcmePDDQmVefpKq5Q7Gd4jiYQEjUwntA== + dependencies: + "@types/node" "*" + tapable "^2.2.0" + webpack "^5" + +"@types/webpack-bundle-analyzer@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@types/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.6.0.tgz#8863d62d2432126c2b3a9239cafa469215981c24" + integrity sha512-XeQmQCCXdZdap+A/60UKmxW5Mz31Vp9uieGlHB3T4z/o2OLVLtTI3bvTuS6A2OWd/rbAAQiGGWIEFQACu16szA== + dependencies: + "@types/node" "*" + tapable "^2.2.0" + webpack "^5" + +"@types/webpack-deadcode-plugin@^0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@types/webpack-deadcode-plugin/-/webpack-deadcode-plugin-0.1.2.tgz#0a9ae8d85ee7e6bd2f14f03085aee632aaa077b3" + integrity sha512-Zxy7Hhi0palMlMtashNAEyp7PsQFcv7bi2sCH2p5uYaYzlv7K29+w3tDZNFdBu1EPedjPU0VYzfK143nozZgVQ== + dependencies: + "@types/webpack" "^4" + +"@types/webpack-sources@*": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-3.2.0.tgz#16d759ba096c289034b26553d2df1bf45248d38b" + integrity sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg== + dependencies: + "@types/node" "*" + "@types/source-list-map" "*" + source-map "^0.7.3" + +"@types/webpack@^4": + version "4.41.32" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.32.tgz#a7bab03b72904070162b2f169415492209e94212" + integrity sha512-cb+0ioil/7oz5//7tZUSwbrSAN/NWHrQylz5cW8G0dWTcF/g+/dSdMlKVZspBYuMAN1+WnwHrkxiRrLcwd0Heg== + dependencies: + "@types/node" "*" + "@types/tapable" "^1" + "@types/uglify-js" "*" + "@types/webpack-sources" "*" + anymatch "^3.0.0" + source-map "^0.6.0" + "@types/ws@^8.5.1": version "8.5.3" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.3.tgz#7d25a1ffbecd3c4f2d35068d0b283c037003274d" @@ -3229,7 +3327,7 @@ acorn-walk@^7.0.0, acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.0.0: +acorn-walk@^8.0.0, acorn-walk@^8.1.1: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -3249,6 +3347,11 @@ acorn@^8.5.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== +acorn@^8.7.1: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + agent-base@4, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" @@ -3371,7 +3474,7 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -anymatch@^3.0.3, anymatch@~3.1.2: +anymatch@^3.0.0, anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== @@ -3379,6 +3482,11 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + arg@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb" @@ -4368,17 +4476,16 @@ cookie@0.5.0: resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== -copy-webpack-plugin@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-9.0.1.tgz#b71d21991599f61a4ee00ba79087b8ba279bbb59" - integrity sha512-14gHKKdYIxF84jCEgPgYXCPpldbwpxxLbCmA7LReY7gvbaT555DgeBWBgBZM116tv/fO6RRJrsivBqRyRlukhw== +copy-webpack-plugin@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-11.0.0.tgz#96d4dbdb5f73d02dd72d0528d1958721ab72e04a" + integrity sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ== dependencies: - fast-glob "^3.2.5" - glob-parent "^6.0.0" - globby "^11.0.3" + fast-glob "^3.2.11" + glob-parent "^6.0.1" + globby "^13.1.1" normalize-path "^3.0.0" - p-limit "^3.1.0" - schema-utils "^3.0.0" + schema-utils "^4.0.0" serialize-javascript "^6.0.0" core-js-compat@^3.21.0, core-js-compat@^3.22.1: @@ -4430,6 +4537,11 @@ cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: path-type "^4.0.0" yaml "^1.10.0" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-env@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -4884,6 +4996,11 @@ diff-sequences@^28.1.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -5132,6 +5249,14 @@ enhanced-resolve@^5.0.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.10.0: + version "5.10.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" + integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + enhanced-resolve@^5.9.3: version "5.9.3" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz#44a342c012cbc473254af5cc6ae20ebd0aae5d88" @@ -5754,6 +5879,17 @@ fast-glob@^3.1.1, fast-glob@^3.2.5: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.2.11: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-glob@^3.2.7, fast-glob@^3.2.9: version "3.2.11" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" @@ -6115,14 +6251,7 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.1.tgz#42054f685eb6a44e7a7d189a96efa40a54971aa7" - integrity sha512-kEVjS71mQazDBHKcsq4E9u/vUzaLcw1A8EtUeydawvIWQCJM0qQ08G1H7/XTjFUulla6XQiDOG6MXSaG0HDKog== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: +glob-parent@^6.0.1, glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -6210,6 +6339,17 @@ globby@^11.0.4: merge2 "^1.4.1" slash "^3.0.0" +globby@^13.1.1: + version "13.1.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.2.tgz#29047105582427ab6eca4f905200667b056da515" + integrity sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ== + dependencies: + dir-glob "^3.0.1" + fast-glob "^3.2.11" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^4.0.0" + globjoin@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43" @@ -8157,7 +8297,7 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: dependencies: semver "^6.0.0" -make-error@1.x: +make-error@1.x, make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -10430,7 +10570,7 @@ scheduler@^0.20.2: loose-envify "^1.1.0" object-assign "^4.1.1" -schema-utils@*, schema-utils@^3.0, schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: +schema-utils@*, schema-utils@^3.0, schema-utils@^3.1.0, schema-utils@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== @@ -10643,6 +10783,11 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +slash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" + integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== + slice-ansi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" @@ -10709,6 +10854,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@^0.7.3: + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + source-map@~0.7.2: version "0.7.3" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" @@ -11396,6 +11546,25 @@ ts-loader@^9.3.0: micromatch "^4.0.0" semver "^7.3.4" +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + tsconfig-paths@^3.12.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" @@ -11716,6 +11885,11 @@ uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" @@ -11809,6 +11983,14 @@ watchpack@^2.3.1: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + wbuf@^1.1.0, wbuf@^1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df" @@ -11967,6 +12149,36 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== +webpack@^5: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^0.0.51" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.7.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.10.0" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.9" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.4.0" + webpack-sources "^3.2.3" + webpack@^5.72.1: version "5.72.1" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.72.1.tgz#3500fc834b4e9ba573b9f430b2c0a61e1bb57d13" @@ -12249,6 +12461,11 @@ yargs@^17.3.1: y18n "^5.0.5" yargs-parser "^21.0.0" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" From b770cbb175dd6047d9b7066cd4fed27184d7821a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 15:43:32 -0500 Subject: [PATCH 2/7] Webpack: convert rules to TypeScript --- webpack/rules/{assets.js => assets.ts} | Bin 2077 -> 2152 bytes ...-build-config.js => babel-build-config.ts} | Bin 521 -> 587 bytes webpack/rules/{babel-git.js => babel-git.ts} | Bin 517 -> 582 bytes webpack/rules/{babel.js => babel.ts} | Bin 694 -> 759 bytes webpack/rules/{css.js => css.ts} | Bin 504 -> 574 bytes webpack/rules/git-refresh.js | Bin 239 -> 0 bytes webpack/rules/git-refresh.ts | 13 ++++++++++ webpack/rules/index.js | Bin 494 -> 0 bytes webpack/rules/index.ts | 23 ++++++++++++++++++ webpack/rules/mark.js | Bin 151 -> 0 bytes webpack/rules/mark.ts | 14 +++++++++++ .../{node_modules.js => node_modules.ts} | Bin 635 -> 700 bytes 12 files changed, 50 insertions(+) rename webpack/rules/{assets.js => assets.ts} (93%) rename webpack/rules/{babel-build-config.js => babel-build-config.ts} (71%) rename webpack/rules/{babel-git.js => babel-git.ts} (71%) rename webpack/rules/{babel.js => babel.ts} (76%) rename webpack/rules/{css.js => css.ts} (73%) delete mode 100644 webpack/rules/git-refresh.js create mode 100644 webpack/rules/git-refresh.ts delete mode 100644 webpack/rules/index.js create mode 100644 webpack/rules/index.ts delete mode 100644 webpack/rules/mark.js create mode 100644 webpack/rules/mark.ts rename webpack/rules/{node_modules.js => node_modules.ts} (75%) diff --git a/webpack/rules/assets.js b/webpack/rules/assets.ts similarity index 93% rename from webpack/rules/assets.js rename to webpack/rules/assets.ts index e0a14c250075f09472581871973a7510ae4c1c83..d8c8e3e18b8e41f17d491bb09ac0daeda6269019 100644 GIT binary patch delta 140 zcmbO$@IqjMlXqrrL4Hw*LbXCsYH@x}S*k*B1=zZj)U?FX J9H>HTE&%^wGR^=1 delta 65 zcmaDMFjruLlX7x?UU7*+wL(#9aehu&szR-TEs$MUnpu>ppEB^1y_)oR|c2V)6-AR z&r8cpFD*(e$;{6~Qdm-1kP0*|s5B=vIJE>s!F83VCKV(mXM+^$>nnt0WELw-jHwm} jnp9k(Py|$Ig{*DkQx!%ruG9*!`%+TV5=(O+s;s#HkS;)l delta 109 zcmX@j(#aB-oS#=*qEM|+lvEB^1y_)oR|c2V)6-AR z&r8cpFD*(e$;{6~Qdm-1kP0*|s5B=vIJE>s!F83VCKV(mXM+^$>nnt0WELw-jHwg{ inp9k(Py|$Ig{*DkVR6uJ0 delta 109 zcmX@c(#jH;oS#=*qEM|+lv`Tu^CFYH(@^h=Lndo|;sUn4Aq#4Afm* fqEG~swL(_9vB-rRiReF7RW9v%`8gQP%lU<$xzp{=Hh~> zP0cIQQ7BF=Dap)BFGf|Xr>758m6n-aT9jClnV$#Nmz$qbnv<%RT2YW+R8kByx|&Nt Pp(M4q#7be~YI7z4vpg?vQ{Ji24g(9G=6+$Uf aPU^;h6^x=>sTE*%q@<=LmgYc|Spxv$4mxQ7 delta 68 zcmdnT@`G75IX|zsM8P*RFVnfW*tMdhC^5MtAg44vGf%-*p(wSmG_xpGW1^y@kft>k XS8jevX-=wMYDGbQQAzQ}#ubbJTud0n diff --git a/webpack/rules/git-refresh.js b/webpack/rules/git-refresh.js deleted file mode 100644 index 0b708b74627b9de5725bdc7970e754c7fdbd858f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 239 zcmZ{eK?;K~6h!wq#otB2CVQoq=mjK=A5Dq*X@0bVc=v|dE(^0580O7b3Y=kwgiL-# zIN)0Rb8!hP8BLyK-3g&J+|be-oky@Vpn5R8CJeY@g3)ELlL;fTm}yu%D%>Ka%mua! zfQ+2m-$d2-gG<58*nm_@7nv9}lZkiQ^pc%t{oRmtQ|b$2`{4k1G6SZ+tTSd^9$ijf Lj-HUC5l1K9@}f@1 diff --git a/webpack/rules/git-refresh.ts b/webpack/rules/git-refresh.ts new file mode 100644 index 0000000000..aa16c5bcbd --- /dev/null +++ b/webpack/rules/git-refresh.ts @@ -0,0 +1,13 @@ +import { resolve } from 'path'; + +import type { RuleSetRule } from 'webpack'; + +/** Recompile code.js whenever git changes. */ +const rule: RuleSetRule = { + test: resolve(__dirname, '../../app/soapbox/utils/code.js'), + use: { + loader: resolve(__dirname, '../loaders/git-loader.js'), + }, +}; + +export default rule; \ No newline at end of file diff --git a/webpack/rules/index.js b/webpack/rules/index.js deleted file mode 100644 index bdf850c6d13c030a1d1faf5bfbc78683e0746b8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 494 zcmZvZu};J=42JhSg(Zdq>6+}En3!2u7!X2f;`R!q33duRK2B08cc+`;{QqYswp~~_ zfn~qL0F)23>>yMuCt>1~hmIZ~t(Vx4CH7?xoguW((T?M{k`-;%~DU4un# zjN^;HiO^g@pK&1M<9Q*`JE}&5m*DX!_;tpMlG%9ws!qn0G4O(YwC)q;U_BCpC4@-9 zp^VGJw8*%AL`MiDe$F_i6#3qm-}ZHd`fgQ-f|mn^yU{sxNE&i-F1} kUKN1Wx^7`F7wI`4Ck^ClSwRk@+wItfQQWqXy?Q&Se|$itJ^%m! diff --git a/webpack/rules/index.ts b/webpack/rules/index.ts new file mode 100644 index 0000000000..dac8763ca6 --- /dev/null +++ b/webpack/rules/index.ts @@ -0,0 +1,23 @@ +import assets from './assets'; +import babel from './babel'; +import buildConfig from './babel-build-config'; +import git from './babel-git'; +import css from './css'; +import gitRefresh from './git-refresh'; +import nodeModules from './node_modules'; + +import type { RuleSetRule } from 'webpack'; + +// Webpack loaders are processed in reverse order +// https://webpack.js.org/concepts/loaders/#loader-features +const rules: RuleSetRule[] = [ + ...assets, + css, + nodeModules, + babel, + git, + gitRefresh, + buildConfig, +]; + +export default rules; diff --git a/webpack/rules/mark.js b/webpack/rules/mark.js deleted file mode 100644 index e62a526b02a4a90beab27e517b7774dea72235ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 151 zcmc~yQ_v_V%1=%$F4jxUE7SAycX5q(^$Sz5wY61H2g;@#i=;tftnN)N>YnUtQ7QP^sbZ$U*}4#(I!Fp+AQu2@pDv>S diff --git a/webpack/rules/mark.ts b/webpack/rules/mark.ts new file mode 100644 index 0000000000..322dabc1b7 --- /dev/null +++ b/webpack/rules/mark.ts @@ -0,0 +1,14 @@ +import { env } from 'process'; + +import type { RuleSetRule } from 'webpack'; + +let rule: RuleSetRule = {}; + +if (env.NODE_ENV !== 'production') { + rule = { + test: /\.js$/, + loader: 'mark-loader', + }; +} + +export default rule; \ No newline at end of file diff --git a/webpack/rules/node_modules.js b/webpack/rules/node_modules.ts similarity index 75% rename from webpack/rules/node_modules.js rename to webpack/rules/node_modules.ts index aa46fe59668cc69e48d36cafea65271be1fe0dce..f6f11b041da257bb79b87c264a6191b91f60430b 100644 GIT binary patch delta 181 zcmey(vWK-kGq)hWs6?S!AuB&KPoY*JttdZNLA@ZcBtzYriwiEBnpdWyP@Gy)l9`uY z3|FS7r=OgkmzJ4cT9jClnV*NGrKGYT6=-TuX-;ZzY6*yf>ncx8Do9Mu1}RP!%g-w= fQ78gRTOq66m?^|0%9UCHc3VnnT4HGqM3prFlR!To delta 136 zcmdnP`kSRbIX|zsM4?(CD?c+&p;p0Gp(wSmG_xpGL%kreBtu=(nu`mjq&T&tBr`9) zSVti>uMAbKo}NBXRa$0xX;ETHW_})6Uv7R%X-=wMYDGbQQAsh-=xQzng_6|b5-SD$ R7(I=w;+ov7jjR7K0sxgaF9QGo From 239ccb807af77d29e898adbedf4c59d164ead3c6 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 15:52:02 -0500 Subject: [PATCH 3/7] Webpack: convert git-loader to TypeScript --- webpack/loaders/git-loader.js | Bin 292 -> 0 bytes webpack/loaders/git-loader.ts | 14 ++++++++++++++ webpack/rules/git-refresh.ts | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) delete mode 100644 webpack/loaders/git-loader.js create mode 100644 webpack/loaders/git-loader.ts diff --git a/webpack/loaders/git-loader.js b/webpack/loaders/git-loader.js deleted file mode 100644 index 5f003ffeca793a2eba42262a6e6427b1350b9dd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 292 zcmYk1L23gr3`O@og?8hCFh0Q0MIkNi0kRIRtr?qoWY@Bjl#shu30V{b64HN?zRSc7 zu27M4Iw9QPMe3g(E9#-x7KU+F${2Xh)gjBw<*meoa1Ka#!U`=QxLzw#0~u~nQn0il z-?;~_9=*e-+OqEnC%lwg8_PROC)Y%%Id}PC2b(P; zTonird9vQ`u^@RQ_p6^i^zrCpCA*1ym?m?NH8zv-%I4$kbw7;a>$$<%l)kL{*3?tl L!T&R}y3OhjSkPm& diff --git a/webpack/loaders/git-loader.ts b/webpack/loaders/git-loader.ts new file mode 100644 index 0000000000..51530b704e --- /dev/null +++ b/webpack/loaders/git-loader.ts @@ -0,0 +1,14 @@ +import { resolve } from 'path'; + +import { LoaderContext } from 'webpack'; + +/** + * Forces recompile whenever the current commit changes. + * Useful for generating the version hash in the UI. + */ +function loader(this: LoaderContext<{}>, content: string) { + this.addDependency(resolve(__dirname, '../../.git/logs/HEAD')); + this.callback(undefined, content); +} + +export default loader; \ No newline at end of file diff --git a/webpack/rules/git-refresh.ts b/webpack/rules/git-refresh.ts index aa16c5bcbd..2633eaded1 100644 --- a/webpack/rules/git-refresh.ts +++ b/webpack/rules/git-refresh.ts @@ -6,7 +6,7 @@ import type { RuleSetRule } from 'webpack'; const rule: RuleSetRule = { test: resolve(__dirname, '../../app/soapbox/utils/code.js'), use: { - loader: resolve(__dirname, '../loaders/git-loader.js'), + loader: resolve(__dirname, '../loaders/git-loader.ts'), }, }; From 56b1515d5e3e650a0a40a7778a5d1a5b991d6783 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 15:54:37 -0500 Subject: [PATCH 4/7] Move translationRunner.js out of /webpack directory --- package.json | 2 +- .../translationRunner.js => translationRunner.js | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename webpack/translationRunner.js => translationRunner.js (100%) diff --git a/package.json b/package.json index 0e528b5313..898897cdea 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "dev": "${npm_execpath} run start", "build": "npx webpack", "jsdoc": "npx jsdoc -c jsdoc.conf.js", - "manage:translations": "node ./webpack/translationRunner.js", + "manage:translations": "node ./translationRunner.js", "test": "npx cross-env NODE_ENV=test npx jest", "test:coverage": "${npm_execpath} run test --coverage", "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint", diff --git a/webpack/translationRunner.js b/translationRunner.js similarity index 100% rename from webpack/translationRunner.js rename to translationRunner.js From bd4734b24f1516b670e0cfec5c9a88ace5abb994 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 15:55:31 -0500 Subject: [PATCH 5/7] rules/node_modules --> rules/node-modules --- webpack/rules/index.ts | 2 +- webpack/rules/{node_modules.ts => node-modules.ts} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename webpack/rules/{node_modules.ts => node-modules.ts} (100%) diff --git a/webpack/rules/index.ts b/webpack/rules/index.ts index dac8763ca6..cc8f93c0a2 100644 --- a/webpack/rules/index.ts +++ b/webpack/rules/index.ts @@ -4,7 +4,7 @@ import buildConfig from './babel-build-config'; import git from './babel-git'; import css from './css'; import gitRefresh from './git-refresh'; -import nodeModules from './node_modules'; +import nodeModules from './node-modules'; import type { RuleSetRule } from 'webpack'; diff --git a/webpack/rules/node_modules.ts b/webpack/rules/node-modules.ts similarity index 100% rename from webpack/rules/node_modules.ts rename to webpack/rules/node-modules.ts From 55c0cfe20546fd96ad3aaf35d5bed745140e593a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 16:00:18 -0500 Subject: [PATCH 6/7] git-loader: import type --- webpack/loaders/git-loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack/loaders/git-loader.ts b/webpack/loaders/git-loader.ts index 51530b704e..67593d9357 100644 --- a/webpack/loaders/git-loader.ts +++ b/webpack/loaders/git-loader.ts @@ -1,6 +1,6 @@ import { resolve } from 'path'; -import { LoaderContext } from 'webpack'; +import type { LoaderContext } from 'webpack'; /** * Forces recompile whenever the current commit changes. From a156c399a9df73abec00235d6f5e3348d67ee8af Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 14 Oct 2022 16:45:10 -0500 Subject: [PATCH 7/7] VideoModal: pass visible=true --- app/soapbox/features/ui/components/video_modal.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/soapbox/features/ui/components/video_modal.tsx b/app/soapbox/features/ui/components/video_modal.tsx index 71a9d4e811..58ddea245d 100644 --- a/app/soapbox/features/ui/components/video_modal.tsx +++ b/app/soapbox/features/ui/components/video_modal.tsx @@ -41,6 +41,7 @@ const VideoModal: React.FC = ({ status, account, media, time, onClo link={link} detailed alt={media.description} + visible /> );