Skip to content

Commit e442c76

Browse files
justin808claude
andcommitted
Revert all changes except test file to match master exactly
Isolating whether the test file itself is causing issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7d4f9fa commit e442c76

File tree

3 files changed

+117
-11
lines changed

3 files changed

+117
-11
lines changed

babel.config.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
// Babel config is only used by Jest (babel-jest) and ESLint (@babel/eslint-parser)
2-
// Production webpack builds use SWC instead (see config/swc.config.js)
31
module.exports = function (api) {
42
const defaultConfigFunc = require('shakapacker/package/babel/preset.js');
53
const resultConfig = defaultConfigFunc(api);
4+
const isProductionEnv = api.env('production');
65

7-
// Add React preset for Jest testing
8-
// Note: @babel/preset-react is provided by Shakapacker's dependencies
96
const changesOnDefault = {
107
presets: [
118
[
129
'@babel/preset-react',
1310
{
1411
runtime: 'automatic',
15-
development: true, // Always use development mode for better test error messages
12+
development: !isProductionEnv,
1613
useBuiltIns: true,
1714
},
1815
],
19-
],
16+
].filter(Boolean),
17+
plugins: [
18+
process.env.WEBPACK_SERVE && 'react-refresh/babel',
19+
isProductionEnv && [
20+
'babel-plugin-transform-react-remove-prop-types',
21+
{
22+
removeImport: true,
23+
},
24+
],
25+
].filter(Boolean),
2026
};
2127

2228
resultConfig.presets = [...resultConfig.presets, ...changesOnDefault.presets];
29+
resultConfig.plugins = [...resultConfig.plugins, ...changesOnDefault.plugins];
2330

2431
return resultConfig;
2532
};

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"ajv": "^8.17.1",
5050
"autoprefixer": "^10.4.14",
5151
"axios": "^0.21.1",
52+
"babel-loader": "^9.1.2",
53+
"babel-plugin-macros": "^3.1.0",
5254
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
5355
"classnames": "^2.3.2",
5456
"compression-webpack-plugin": "10.0.0",
@@ -152,9 +154,9 @@
152154
"\\.scss$": "identity-obj-proxy"
153155
},
154156
"setupFiles": [
155-
"./client/app/libs/testHelper.js"
157+
"./app/libs/testHelper.js"
156158
],
157-
"testRegex": "./client/app/.*.spec\\.jsx?$",
159+
"testRegex": "./app/.*.spec\\.jsx?$",
158160
"transform": {
159161
"^.+\\.jsx?$": "babel-jest"
160162
}

yarn.lock

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@
953953
"@babel/plugin-transform-react-jsx-development" "^7.27.1"
954954
"@babel/plugin-transform-react-pure-annotations" "^7.27.1"
955955

956-
"@babel/runtime@^7.12.1", "@babel/runtime@^7.17.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
956+
"@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
957957
version "7.28.4"
958958
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz"
959959
integrity sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==
@@ -2186,6 +2186,11 @@
21862186
dependencies:
21872187
undici-types "~7.12.0"
21882188

2189+
"@types/parse-json@^4.0.0":
2190+
version "4.0.2"
2191+
resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239"
2192+
integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==
2193+
21892194
"@types/prettier@^2.6.0":
21902195
version "2.7.3"
21912196
resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz"
@@ -2857,6 +2862,14 @@ babel-jest@^29.5.0, babel-jest@^29.7.0:
28572862
graceful-fs "^4.2.9"
28582863
slash "^3.0.0"
28592864

2865+
babel-loader@^9.1.2:
2866+
version "9.2.1"
2867+
resolved "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz#04c7835db16c246dd19ba0914418f3937797587b"
2868+
integrity sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==
2869+
dependencies:
2870+
find-cache-dir "^4.0.0"
2871+
schema-utils "^4.0.0"
2872+
28602873
babel-plugin-istanbul@^6.1.1:
28612874
version "6.1.1"
28622875
resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz"
@@ -2878,6 +2891,15 @@ babel-plugin-jest-hoist@^29.6.3:
28782891
"@types/babel__core" "^7.1.14"
28792892
"@types/babel__traverse" "^7.0.6"
28802893

2894+
babel-plugin-macros@^3.1.0:
2895+
version "3.1.0"
2896+
resolved "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1"
2897+
integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==
2898+
dependencies:
2899+
"@babel/runtime" "^7.12.5"
2900+
cosmiconfig "^7.0.0"
2901+
resolve "^1.19.0"
2902+
28812903
babel-plugin-polyfill-corejs2@^0.4.14:
28822904
version "0.4.14"
28832905
resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.14.tgz"
@@ -3310,6 +3332,11 @@ commander@^8.3.0:
33103332
resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz"
33113333
integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==
33123334

3335+
common-path-prefix@^3.0.0:
3336+
version "3.0.0"
3337+
resolved "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz#7d007a7e07c58c4b4d5f433131a19141b29f11e0"
3338+
integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==
3339+
33133340
common-tags@^1.4.0, common-tags@^1.8.2:
33143341
version "1.8.2"
33153342
resolved "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz"
@@ -3417,6 +3444,17 @@ core-util-is@~1.0.0:
34173444
resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz"
34183445
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
34193446

3447+
cosmiconfig@^7.0.0:
3448+
version "7.1.0"
3449+
resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6"
3450+
integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==
3451+
dependencies:
3452+
"@types/parse-json" "^4.0.0"
3453+
import-fresh "^3.2.1"
3454+
parse-json "^5.0.0"
3455+
path-type "^4.0.0"
3456+
yaml "^1.10.0"
3457+
34203458
cosmiconfig@^8.2.0:
34213459
version "8.3.6"
34223460
resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz"
@@ -4612,6 +4650,14 @@ finalhandler@1.3.1:
46124650
statuses "2.0.1"
46134651
unpipe "~1.0.0"
46144652

4653+
find-cache-dir@^4.0.0:
4654+
version "4.0.0"
4655+
resolved "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2"
4656+
integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==
4657+
dependencies:
4658+
common-path-prefix "^3.0.0"
4659+
pkg-dir "^7.0.0"
4660+
46154661
find-root@^1.1.0:
46164662
version "1.1.0"
46174663
resolved "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz"
@@ -4640,6 +4686,14 @@ find-up@^5.0.0:
46404686
locate-path "^6.0.0"
46414687
path-exists "^4.0.0"
46424688

4689+
find-up@^6.3.0:
4690+
version "6.3.0"
4691+
resolved "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790"
4692+
integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==
4693+
dependencies:
4694+
locate-path "^7.1.0"
4695+
path-exists "^5.0.0"
4696+
46434697
flat-cache@^3.0.4:
46444698
version "3.2.0"
46454699
resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz"
@@ -6115,6 +6169,13 @@ locate-path@^6.0.0:
61156169
dependencies:
61166170
p-locate "^5.0.0"
61176171

6172+
locate-path@^7.1.0:
6173+
version "7.2.0"
6174+
resolved "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a"
6175+
integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==
6176+
dependencies:
6177+
p-locate "^6.0.0"
6178+
61186179
lockfile@^1.0.4:
61196180
version "1.0.4"
61206181
resolved "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz"
@@ -6724,6 +6785,13 @@ p-limit@^3.0.2, p-limit@^3.1.0:
67246785
dependencies:
67256786
yocto-queue "^0.1.0"
67266787

6788+
p-limit@^4.0.0:
6789+
version "4.0.0"
6790+
resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644"
6791+
integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==
6792+
dependencies:
6793+
yocto-queue "^1.0.0"
6794+
67276795
p-locate@^3.0.0:
67286796
version "3.0.0"
67296797
resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz"
@@ -6745,6 +6813,13 @@ p-locate@^5.0.0:
67456813
dependencies:
67466814
p-limit "^3.0.2"
67476815

6816+
p-locate@^6.0.0:
6817+
version "6.0.0"
6818+
resolved "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f"
6819+
integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==
6820+
dependencies:
6821+
p-limit "^4.0.0"
6822+
67486823
p-retry@^4.5.0:
67496824
version "4.6.2"
67506825
resolved "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz"
@@ -6778,7 +6853,7 @@ parent-module@^1.0.0:
67786853
dependencies:
67796854
callsites "^3.0.0"
67806855

6781-
parse-json@^5.2.0:
6856+
parse-json@^5.0.0, parse-json@^5.2.0:
67826857
version "5.2.0"
67836858
resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd"
67846859
integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==
@@ -6821,6 +6896,11 @@ path-exists@^4.0.0:
68216896
resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz"
68226897
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
68236898

6899+
path-exists@^5.0.0:
6900+
version "5.0.0"
6901+
resolved "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7"
6902+
integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==
6903+
68246904
path-is-absolute@^1.0.0:
68256905
version "1.0.1"
68266906
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
@@ -6886,6 +6966,13 @@ pkg-dir@^4.2.0:
68866966
dependencies:
68876967
find-up "^4.0.0"
68886968

6969+
pkg-dir@^7.0.0:
6970+
version "7.0.0"
6971+
resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11"
6972+
integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==
6973+
dependencies:
6974+
find-up "^6.3.0"
6975+
68896976
possible-typed-array-names@^1.0.0:
68906977
version "1.1.0"
68916978
resolved "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz"
@@ -7932,7 +8019,7 @@ resolve.exports@^2.0.0:
79328019
resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz"
79338020
integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==
79348021

7935-
resolve@^1.1.7, resolve@^1.20.0, resolve@^1.22.10, resolve@^1.22.4, resolve@^1.22.8:
8022+
resolve@^1.1.7, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.10, resolve@^1.22.4, resolve@^1.22.8:
79368023
version "1.22.10"
79378024
resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz"
79388025
integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==
@@ -9386,6 +9473,11 @@ yallist@^3.0.2:
93869473
resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz"
93879474
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
93889475

9476+
yaml@^1.10.0:
9477+
version "1.10.2"
9478+
resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
9479+
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
9480+
93899481
yargs-parser@^13.1.2:
93909482
version "13.1.2"
93919483
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz"
@@ -9432,3 +9524,8 @@ yocto-queue@^0.1.0:
94329524
version "0.1.0"
94339525
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz"
94349526
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
9527+
9528+
yocto-queue@^1.0.0:
9529+
version "1.2.1"
9530+
resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz#36d7c4739f775b3cbc28e6136e21aa057adec418"
9531+
integrity sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==

0 commit comments

Comments
 (0)