Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/app/universal-testing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"rimraf": "^6.0.1",
"typescript": "5.9.3",
"vitest": "^3.2.4",
"wretch": "^2.11.0",
"wretch": "^3.0.2",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | πŸ”΄ Critical

🧩 Analysis chain

Verify Node.js 22+ compatibility and breaking API changes before merging.

Wretch 3.x requires Node.js >= 22, while wretch@^2 supports older Node.js versions. This major version bump introduces several breaking changes that require verification:

  1. Node.js version requirement: Confirm the project targets Node.js 22+. If the project supports earlier versions, this will break the build.
  2. API changes: Wretch 3.0.0 replaces .errorType() with .customError(). Any usage of the deprecated method in the codebase will fail at runtime.
  3. Native Web API dependency: Node.js 22+ includes native fetch and Web APIs out of the box with no polyfills needed.

Run the following scripts to verify compatibility:

Additionally, ensure that:

  • CI/tests pass with Node.js 22+ before merge
  • No deprecated .errorType() calls are present that need migration to .customError()
  • The project's deployment/infrastructure targets Node.js 22+

🏁 Script executed:

#!/bin/bash
# Description: Check Node.js version requirements and search for wretch usage.

# 1. Check if package.json or .nvmrc specifies Node.js version
echo "=== Checking Node.js version requirements ==="
if [ -f ".nvmrc" ]; then
  echo ".nvmrc content:"
  cat .nvmrc
fi

grep -A 2 '"engines"' package.json 2>/dev/null || echo "No engines field in root package.json"

# 2. Search for deprecated wretch.errorType() calls
echo ""
echo "=== Searching for deprecated wretch.errorType() usage ==="
rg -n --type=ts --type=js 'errorType\s*\(' --no-heading || echo "No errorType() calls found"

# 3. Search for any wretch imports/usage in the codebase to understand scope
echo ""
echo "=== Searching for wretch imports and usage ==="
rg -n 'from.*wretch|import.*wretch|require.*wretch' --type=ts --type=js -C 2 || echo "No wretch imports found"

Length of output: 3086


I need to verify the project's Node.js version requirements by checking CI configurations and sub-package configurations.

I need to check CI configurations and sub-package configurations to determine if the Node.js 22+ requirement is already satisfied by the project's setup.


🏁 Script executed:

#!/bin/bash
# Check for Node.js version specifications in various places

echo "=== Checking GitHub Actions workflows for Node.js version ==="
fd -t f 'workflow|\.yml|\.yaml' .github/workflows/ 2>/dev/null | head -20

echo ""
echo "=== Searching for node-version in GitHub Actions ==="
rg -n 'node-version|node_version' .github/ 2>/dev/null || echo "No node-version config found in .github"

echo ""
echo "=== Checking engines field in sub-package.json files ==="
fd -t f 'package.json' packages/ | xargs grep -l '"engines"' 2>/dev/null || echo "No engines field found in sub-packages"

echo ""
echo "=== Checking Dockerfile for Node.js version ==="
fd -t f 'Dockerfile|\.dockerfile' | head -10

echo ""
echo "=== Checking universal-testing-utils/package.json for engines ==="
cat packages/app/universal-testing-utils/package.json | grep -A 3 '"engines"' || echo "No engines field in universal-testing-utils/package.json"

Length of output: 824


🏁 Script executed:

#!/bin/bash
# Check for Node.js version specifications in various places

echo "=== Checking GitHub Actions workflows for Node.js version ==="
fd -t f '\.(yml|yaml)$' .github/workflows/ 2>/dev/null | head -20

echo ""
echo "=== Searching for node-version in workflow files ==="
rg -n 'node-version|node_version' .github/workflows/ 2>/dev/null || echo "No node-version config found in workflows"

echo ""
echo "=== Checking engines field in all package.json files ==="
fd -t f 'package.json' | xargs grep -l '"engines"' 2>/dev/null | head -20

echo ""
echo "=== Checking root .nvmrc alternatives (common patterns) ==="
ls -la | grep -E 'nvmrc|tool-versions|\.node-version' || echo "No version manager files found at root"

echo ""
echo "=== Listing GitHub workflows directory ==="
ls -la .github/workflows/ 2>/dev/null | head -20

Length of output: 1166


I need to check the CI workflow details to understand which tests will fail.


🏁 Script executed:

#!/bin/bash
# Get CI workflow details

echo "=== ci.yml content ==="
cat .github/workflows/ci.yml

echo ""
echo "=== Check if universal-testing-utils tests are included in CI ==="
grep -r "universal-testing-utils" .github/workflows/ || echo "No explicit universal-testing-utils reference in workflows"

Length of output: 1522


Tests will fail on Node.js 20.x β€” CI must be updated or wretch must be downgraded.

Wretch 3.x requires Node.js >= 22, but the CI workflow runs tests on Node.js [20.x, 22.x, 24.x]. Since wretch is imported directly in test files (MswHelper.spec.ts and MockttpHelper.spec.ts in universal-testing-utils), the npm run test:ci step will fail on the 20.x matrix run.

To resolve:

  • Update CI to remove Node.js 20.x from the test matrix if the project no longer supports it, OR
  • Revert wretch to ^2.x if Node.js 20.x support is required

No breaking API changes (.errorType() calls) were found in the codebase.

"zod": "^4.1.5"
},
"dependencies": {}
Expand Down
Loading