Skip to content

TypeScript 7 - #214

Open
bartholomej wants to merge 2 commits into
masterfrom
typescript7
Open

TypeScript 7#214
bartholomej wants to merge 2 commits into
masterfrom
typescript7

Conversation

@bartholomej

@bartholomej bartholomej commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Description

Typescript 7 migration

Type of change

  • Bug fix
  • New feature
  • Refactoring (no functional changes)
  • Code style update
  • Build / CI related changes
  • Documentation update
  • Tests
  • Other

Checklist

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Summary by CodeRabbit

  • Refactor

    • Improved TypeScript build configuration and modernized compilation settings.
    • Reduced unnecessary runtime loading for type-only code, improving package efficiency and compatibility.
    • Added clearer environment handling for browser and server-side fetch support.
  • Chores

    • Updated development tooling configuration and local editor support.
    • No changes to exported APIs or application behavior.

@bartholomej bartholomej changed the title Typescript 7 TypeScript 7 Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bartholomej, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fb729839-ded3-4218-a81d-4f0f2510e4d2

📥 Commits

Reviewing files that changed from the base of the PR and between a9343bf and 4c95090.

📒 Files selected for processing (28)
  • .vscode/extensions.json
  • .vscode/settings.json
  • .yarnrc.yml
  • src/bin/export-ratings.ts
  • src/bin/export-reviews.ts
  • src/bin/server.ts
  • src/dto/cinema.ts
  • src/dto/creator.ts
  • src/dto/movie.ts
  • src/dto/search.ts
  • src/dto/user-ratings.ts
  • src/dto/user-reviews.ts
  • src/fetchers/fetch.polyfill.ts
  • src/helpers/cinema.helper.ts
  • src/helpers/creator.helper.ts
  • src/helpers/global.helper.ts
  • src/helpers/search.helper.ts
  • src/helpers/user-ratings.helper.ts
  • src/helpers/user-reviews.helper.ts
  • src/index.ts
  • src/services/cinema.service.ts
  • src/services/creator.service.ts
  • src/services/movie.service.ts
  • src/services/search.service.ts
  • src/services/user-ratings.service.ts
  • src/services/user-reviews.service.ts
  • src/vars.ts
  • tsconfig.json
📝 Walkthrough

Walkthrough

The PR updates TypeScript and Yarn tooling, modernizes compiler settings, converts type-only dependencies across the source tree to import type, and adds an ambient window declaration for fetch fallback typing.

Changes

TypeScript toolchain modernization

Layer / File(s) Summary
Toolchain and compiler configuration
.vscode/settings.json, .yarnrc.yml, package.json, tsconfig.json
TypeScript, Yarn, editor settings, compiler targets, library selection, emit behavior, and include/exclude patterns are updated.
Type-only import migration
src/bin/*, src/dto/*, src/helpers/*, src/services/*, src/index.ts, src/vars.ts
DTO and option dependencies are converted from runtime imports to import type without changing interfaces or runtime logic.
Fetch global typing compatibility
src/fetchers/fetch.polyfill.ts
An ambient window declaration is added while preserving the existing fetch selection behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: a TypeScript 7 migration.
Description check ✅ Passed The description covers the migration, change type, and checklist; only the optional Related Issues section is omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch typescript7

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
tsconfig.json (1)

3-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Plan re-enabling strictNullChecks soon.

strict: true with strictNullChecks: false leaves a gap where null/undefined assignments won't be caught at compile time. The inline comment acknowledges this is temporary — consider tracking it as a follow-up issue to avoid it becoming permanent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.json` around lines 3 - 20, Create a follow-up issue to re-enable
strictNullChecks in the TypeScript compiler options and track the required
null/undefined fixes, ensuring the temporary inline exception does not become
permanent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.yarnrc.yml:
- Around line 7-8: Change the npmMinimalAgeGate setting from 0 to a non-zero
duration, preferably restoring Yarn’s default 1d minimum-age window, unless
intentionally documenting and approving the security trade-off.

In `@package.json`:
- Line 51: Revert the TypeScript 7 upgrade in the package manifest and lockfile,
keeping TypeScript within tsdown@0.22.4’s supported ^5.0.0 || ^6.0.0 range;
leave the `@types/node` update unchanged.

In `@src/fetchers/fetch.polyfill.ts`:
- Line 1: Replace the broad ambient declaration `declare const window: any` with
a minimal type describing only the required `fetch` property, preserving the
existing fetch usage in this module.

---

Nitpick comments:
In `@tsconfig.json`:
- Around line 3-20: Create a follow-up issue to re-enable strictNullChecks in
the TypeScript compiler options and track the required null/undefined fixes,
ensuring the temporary inline exception does not become permanent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2530f6d1-4834-4768-a6e1-5d7f1091bd3e

📥 Commits

Reviewing files that changed from the base of the PR and between 8fe98f8 and a9343bf.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (28)
  • .vscode/settings.json
  • .yarnrc.yml
  • package.json
  • src/bin/export-ratings.ts
  • src/bin/export-reviews.ts
  • src/bin/server.ts
  • src/dto/cinema.ts
  • src/dto/creator.ts
  • src/dto/movie.ts
  • src/dto/search.ts
  • src/dto/user-ratings.ts
  • src/dto/user-reviews.ts
  • src/fetchers/fetch.polyfill.ts
  • src/helpers/cinema.helper.ts
  • src/helpers/creator.helper.ts
  • src/helpers/global.helper.ts
  • src/helpers/search.helper.ts
  • src/helpers/user-ratings.helper.ts
  • src/helpers/user-reviews.helper.ts
  • src/index.ts
  • src/services/cinema.service.ts
  • src/services/creator.service.ts
  • src/services/movie.service.ts
  • src/services/search.service.ts
  • src/services/user-ratings.service.ts
  • src/services/user-reviews.service.ts
  • src/vars.ts
  • tsconfig.json

Comment thread .yarnrc.yml Outdated
Comment thread package.json Outdated
"@eslint/js": "^10.0.1",
"@types/express": "^5.0.6",
"@types/node": "^26.1.0",
"@types/node": "^26.1.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the specified package versions exist on npm
curl -s https://registry.npmjs.org/typescript/7.0.2 | jq -r '.version // "NOT FOUND"'
curl -s https://registry.npmjs.org/tsdown/0.22.4 | jq -r '.version // "NOT FOUND"'
curl -s https://registry.npmjs.org/@types/node/26.1.1 | jq -r '.version // "NOT FOUND"'

Repository: bartholomej/node-csfd-api

Length of output: 183


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, urllib.request

pkgs = [
    ("typescript", "7.0.2"),
    ("tsdown", "0.22.4"),
    ("`@types/node`", "26.1.1"),
]
for name, ver in pkgs:
    url = f"https://registry.npmjs.org/{name.replace('/', '%2F')}/{ver}"
    with urllib.request.urlopen(url) as r:
        data = json.load(r)
    print(f"\n== {name}@{ver} ==")
    print("version:", data.get("version"))
    print("deprecated:", data.get("deprecated"))
    for k in ("engines", "peerDependencies", "dependencies", "devDependencies", "peerDependenciesMeta"):
        if k in data:
            print(f"{k}:", json.dumps(data[k], sort_keys=True))
PY

Repository: bartholomej/node-csfd-api

Length of output: 2758


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, urllib.request

# Pull the latest metadata for the packages as a quick compatibility check.
names = ["typescript", "tsdown", "`@types/node`"]
for name in names:
    url = f"https://registry.npmjs.org/{name.replace('/', '%2F')}"
    with urllib.request.urlopen(url) as r:
        data = json.load(r)
    latest = data.get("dist-tags", {}).get("latest")
    print(f"\n== {name} ==")
    print("latest:", latest)
    if latest and latest in data.get("versions", {}):
        v = data["versions"][latest]
        print("latest_version:", v.get("version"))
        for k in ("engines", "peerDependencies", "dependencies", "deprecated"):
            if k in v:
                print(f"{k}:", json.dumps(v[k], sort_keys=True))
PY

Repository: bartholomej/node-csfd-api

Length of output: 2757


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, urllib.request

pkgs = [
    ("typescript", "7.0.2"),
    ("tsdown", "0.22.4"),
    ("`@types/node`", "26.1.1"),
]

for name, ver in pkgs:
    url = f"https://registry.npmjs.org/{name.replace('/', '%2F')}/{ver}"
    with urllib.request.urlopen(url) as r:
        data = json.load(r)
    print(f"\n== {name}@{ver} ==")
    for key in ("version", "deprecated", "engines", "peerDependencies", "dependencies", "peerDependenciesMeta"):
        if key in data:
            print(f"{key}: {json.dumps(data[key], sort_keys=True)}")
PY

Repository: bartholomej/node-csfd-api

Length of output: 2758


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for spec in \
  "typescript/7.0.2" \
  "tsdown/0.22.4" \
  "`@types`%2Fnode/26.1.1"
do
  echo "== $spec =="
  curl -ks "https://registry.npmjs.org/$spec" | jq -r '
    {
      version,
      deprecated,
      engines,
      peerDependencies,
      dependencies,
      peerDependenciesMeta
    }'
done

Repository: bartholomej/node-csfd-api

Length of output: 2920


Hold the TypeScript 7 bump until tsdown supports it. typescript@7.0.2 exists, but tsdown@0.22.4 still declares typescript: ^5.0.0 || ^6.0.0, so this moves the project outside its supported range. @types/node@26.1.1 has no peer constraint here.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 51, Revert the TypeScript 7 upgrade in the package
manifest and lockfile, keeping TypeScript within tsdown@0.22.4’s supported
^5.0.0 || ^6.0.0 range; leave the `@types/node` update unchanged.

Comment thread src/fetchers/fetch.polyfill.ts Outdated
@codecov-commenter

codecov-commenter commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (4e9623e) to head (4c95090).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #214   +/-   ##
=======================================
  Coverage   98.46%   98.46%           
=======================================
  Files          39       39           
  Lines        1045     1045           
  Branches      244      244           
=======================================
  Hits         1029     1029           
  Misses         16       16           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants