Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {
files: ["*.ts", "*.tsx"],
excludedFiles: ["*.d.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint/eslint-plugin"],
parserOptions: {
project: "./tsconfig.json",
project: ["./tsconfig.json", "./scripts/tsconfig.json"],
},
plugins: ["@typescript-eslint/eslint-plugin"],
rules: {
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-tslint-comment": "error",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "22"
Comment on lines 28 to +30
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

actions/setup-node@v3 is an older major; for newer Node versions (and to stay aligned with current GitHub Actions runtime expectations), it’s safer to upgrade to actions/setup-node@v4. This change appears in multiple workflows (ci.yml, deploy.yml, update-history.yml) and should be updated consistently.

Copilot uses AI. Check for mistakes.

- name: Enable Corepack
run: corepack enable
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "22"

- name: Enable Corepack
run: corepack enable
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "22"

- name: Enable Corepack
run: corepack enable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "22"

- name: Enable Corepack
run: corepack enable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-history.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "22"

- name: Enable Corepack
run: corepack enable
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"postinstall": "husky install",
"prettier": "prettier --check .",
"prettier:fix": "prettier --write .",
"fetch-wayback-machine-history": "node --loader=ts-node/esm ./scripts/fetchWaybackMachineHistory.js",
"generate-assets": "node --loader=ts-node/esm ./scripts/generateAssets.js",
"update-history": "node --loader=ts-node/esm ./scripts/updateHistory.js",
"tsc": "tsc --noEmit",
"fetch-wayback-machine-history": "node ./scripts/fetchWaybackMachineHistory.ts",
"generate-assets": "node ./scripts/generateAssets.ts",
"update-history": "node ./scripts/updateHistory.ts",
"tsc": "tsc --noEmit && cd ./scripts && tsc --noEmit",
"test": "yarn lint && yarn prettier && yarn tsc"
},
"dependencies": {
Expand Down Expand Up @@ -59,8 +59,7 @@
"lint-staged": "^14.0.0",
"prettier": "^2.0.0",
"sass": "^1.45.2",
"ts-node": "^10.9.0",
"typescript": "^4.1.2",
"typescript": "^5.8.3",
"vite": "^4.4.0"
},
"packageManager": "yarn@4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions scripts/fetchWaybackMachineHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import path from "path";

import { promises as fs } from "fs";

import createAxiosInstance from "./helper/createAxiosInstance.js";
import { PackageIdentifier, packages } from "../src/PackageDescription.js";
import createAxiosInstance from "./helper/createAxiosInstance.ts";
import { packages, type PackageIdentifier } from "../src/PackageDescription.ts";

type WaybackMachineStats = {
archived_snapshots?: {
Expand Down
4 changes: 2 additions & 2 deletions scripts/generateAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { promises as fs } from "fs";

import createAxiosInstance from "./helper/createAxiosInstance.js";
import { PackageIdentifier, packages } from "../src/PackageDescription.js";
import createAxiosInstance from "./helper/createAxiosInstance.ts";
import { packages, type PackageIdentifier } from "../src/PackageDescription.ts";

type VersionIndex = string;

Expand Down Expand Up @@ -111,7 +111,7 @@
versionCounts: {},
};

if (keyedPoints[keyedPoints.length - 1]?.date == newPoint.date) {

Check warning on line 114 in scripts/generateAssets.ts

View workflow job for this annotation

GitHub Actions / Static code analysis

Expected '===' and instead saw '=='
keyedPoints.pop();
}

Expand Down
18 changes: 12 additions & 6 deletions scripts/helper/createAxiosInstance.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios from "axios";
import axios, { type AxiosStatic } from "axios";
import rateLimit, {
RateLimitedAxiosInstance,
rateLimitOptions as RateLimitOptions,
type RateLimitedAxiosInstance,
type rateLimitOptions as RateLimitOptions,
} from "axios-rate-limit";
import axiosRetry, {
isNetworkOrIdempotentRequestError,
IAxiosRetryConfig,
type IAxiosRetryConfig,
} from "axios-retry";

/**
Expand Down Expand Up @@ -36,11 +36,17 @@ export default function createAxiosInstance(): RateLimitedAxiosInstance {
maxRPS: 2,
};

const axiosClient = axios.create();
// @FIXME: Legacy version of axios does not play well with verbatim types
const axiosClient = (axios as unknown as AxiosStatic).create();
Comment on lines +39 to +40
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The unknown as ... casts remove type safety and can hide real integration issues. Prefer addressing this by updating the dependency typings (or the dependencies themselves) and/or applying narrower typing locally (e.g., type the returned instance/function signature) rather than casting the imported module values to unknown.

Copilot uses AI. Check for mistakes.

axiosClient.defaults.headers.common["User-Agent"] =
"React Native Version Tracker";

axiosRetry(axiosClient, axiosRetryConfig);
return rateLimit(axiosClient, axiosRateLimitOptions);

// @FIXME: Legacy version of axios-rate-limit does not play well with verbatim types
return (rateLimit as unknown as typeof import("axios-rate-limit").default)(
axiosClient,
axiosRateLimitOptions
);
Comment on lines +47 to +51
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

The unknown as ... casts remove type safety and can hide real integration issues. Prefer addressing this by updating the dependency typings (or the dependencies themselves) and/or applying narrower typing locally (e.g., type the returned instance/function signature) rather than casting the imported module values to unknown.

Copilot uses AI. Check for mistakes.
}
7 changes: 5 additions & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"allowImportingTsExtensions": true,
"lib": ["esnext"],
"module": "nodenext",
"moduleResolution": "nodenext",
"target": "esnext"
}
"target": "esnext",
"verbatimModuleSyntax": true
},
"exclude": []
Comment on lines +9 to +11
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

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

allowImportingTsExtensions commonly requires noEmit to be set (otherwise the config can error in editors/tsserver even if CI uses tsc --noEmit). Instead of relying on the CLI flag, set compilerOptions.noEmit: true in this config; also consider avoiding exclude: [] by explicitly excluding generated folders (if any) to prevent accidental project-wide typechecking creep.

Suggested change
"verbatimModuleSyntax": true
},
"exclude": []
"verbatimModuleSyntax": true,
"noEmit": true
},
"exclude": ["dist", "build"]

Copilot uses AI. Check for mistakes.
}
6 changes: 3 additions & 3 deletions scripts/updateHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import semver from "semver";

import { promises as fs } from "fs";

import createAxiosInstance from "./helper/createAxiosInstance.js";
import { PackageIdentifier, packages } from "../src/PackageDescription.js";
import createAxiosInstance from "./helper/createAxiosInstance.ts";
import { packages, type PackageIdentifier } from "../src/PackageDescription.ts";

type NpmApiStats = {
package: string;
Expand Down Expand Up @@ -55,7 +55,7 @@ const axiosInstance = createAxiosInstance();
}
}

await import("./generateAssets.js");
await import("./generateAssets.ts");
})();

/**
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"strictNullChecks": true,
"target": "esnext"
},
"exclude": ["build"]
"exclude": ["build", "scripts"]
}
Loading
Loading