Skip to content

Commit e25652f

Browse files
authored
scripts cleanup, small tweaks and fixes (#2044)
1 parent edd863c commit e25652f

File tree

16 files changed

+122
-159
lines changed

16 files changed

+122
-159
lines changed

bun.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"es-toolkit": "^1.42.0",
1717
"expo": "54.0.27",
1818
"expo-font": "^14.0.10",
19-
"next": "^16.0.7",
19+
"next": "^16.0.8",
2020
"node-emoji": "^2.2.0",
2121
"react": "19.2.1",
2222
"react-content-loader": "^7.1.1",
@@ -36,9 +36,9 @@
3636
"devDependencies": {
3737
"@eslint/json": "^0.14.0",
3838
"@expo/next-adapter": "^6.0.0",
39-
"@next/bundle-analyzer": "^16.0.7",
39+
"@next/bundle-analyzer": "^16.0.8",
4040
"@prettier/plugin-oxc": "^0.1.3",
41-
"@types/bun": "^1.3.3",
41+
"@types/bun": "^1.3.4",
4242
"@types/crypto-js": "^4.2.2",
4343
"@types/react": "^19.2.7",
4444
"@vercel/blob": "^0.27.3",
@@ -47,7 +47,7 @@
4747
"cheerio": "^1.1.2",
4848
"dotenv": "^17.2.3",
4949
"eslint": "^9.39.1",
50-
"eslint-config-next": "^16.0.7",
50+
"eslint-config-next": "^16.0.8",
5151
"eslint-config-universe": "^15.0.3",
5252
"eslint-plugin-prettier": "^5.5.4",
5353
"lint-staged": "^16.2.7",
@@ -445,27 +445,27 @@
445445

446446
"@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" } }, "sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA=="],
447447

448-
"@next/bundle-analyzer": ["@next/[email protected].7", "", { "dependencies": { "webpack-bundle-analyzer": "4.10.1" } }, "sha512-Um2YA3TSQND+DpqlMDuPZsdjdpcgLzo1wF3zx4zcBCLecS7ucP7O9YFqvHhg000HXTgt++KIjZ9FUwyJSKk1Kw=="],
448+
"@next/bundle-analyzer": ["@next/[email protected].8", "", { "dependencies": { "webpack-bundle-analyzer": "4.10.1" } }, "sha512-LFWHAWdurTCpqLq1ZRUah1nuDK8cti6kN8vj4wqIW3yAnq3BDgJeNgMMUmeLLzR9C81AnVKfSZFBEhn+aUpe/g=="],
449449

450-
"@next/env": ["@next/[email protected].7", "", {}, "sha512-gpaNgUh5nftFKRkRQGnVi5dpcYSKGcZZkQffZ172OrG/XkrnS7UBTQ648YY+8ME92cC4IojpI2LqTC8sTDhAaw=="],
450+
"@next/env": ["@next/[email protected].8", "", {}, "sha512-xP4WrQZuj9MdmLJy3eWFHepo+R3vznsMSS8Dy3wdA7FKpjCiesQ6DxZvdGziQisj0tEtCgBKJzjcAc4yZOgLEQ=="],
451451

452-
"@next/eslint-plugin-next": ["@next/[email protected].7", "", { "dependencies": { "fast-glob": "3.3.1" } }, "sha512-hFrTNZcMEG+k7qxVxZJq3F32Kms130FAhG8lvw2zkKBgAcNOJIxlljNiCjGygvBshvaGBdf88q2CqWtnqezDHA=="],
452+
"@next/eslint-plugin-next": ["@next/[email protected].8", "", { "dependencies": { "fast-glob": "3.3.1" } }, "sha512-1miV0qXDcLUaOdHridVPCh4i39ElRIAraseVIbb3BEqyZ5ol9sPyjTP/GNTPV5rBxqxjF6/vv5zQTVbhiNaLqA=="],
453453

454-
"@next/swc-darwin-arm64": ["@next/[email protected].7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-LlDtCYOEj/rfSnEn/Idi+j1QKHxY9BJFmxx7108A6D8K0SB+bNgfYQATPk/4LqOl4C0Wo3LACg2ie6s7xqMpJg=="],
454+
"@next/swc-darwin-arm64": ["@next/[email protected].8", "", { "os": "darwin", "cpu": "arm64" }, "sha512-yjVMvTQN21ZHOclQnhSFbjBTEizle+1uo4NV6L4rtS9WO3nfjaeJYw+H91G+nEf3Ef43TaEZvY5mPWfB/De7tA=="],
455455

456-
"@next/swc-darwin-x64": ["@next/[email protected].7", "", { "os": "darwin", "cpu": "x64" }, "sha512-rtZ7BhnVvO1ICf3QzfW9H3aPz7GhBrnSIMZyr4Qy6boXF0b5E3QLs+cvJmg3PsTCG2M1PBoC+DANUi4wCOKXpA=="],
456+
"@next/swc-darwin-x64": ["@next/[email protected].8", "", { "os": "darwin", "cpu": "x64" }, "sha512-+zu2N3QQ0ZOb6RyqQKfcu/pn0UPGmg+mUDqpAAEviAcEVEYgDckemOpiMRsBP3IsEKpcoKuNzekDcPczEeEIzA=="],
457457

458-
"@next/swc-linux-arm64-gnu": ["@next/[email protected].7", "", { "os": "linux", "cpu": "arm64" }, "sha512-mloD5WcPIeIeeZqAIP5c2kdaTa6StwP4/2EGy1mUw8HiexSHGK/jcM7lFuS3u3i2zn+xH9+wXJs6njO7VrAqww=="],
458+
"@next/swc-linux-arm64-gnu": ["@next/[email protected].8", "", { "os": "linux", "cpu": "arm64" }, "sha512-LConttk+BeD0e6RG0jGEP9GfvdaBVMYsLJ5aDDweKiJVVCu6sGvo+Ohz9nQhvj7EQDVVRJMCGhl19DmJwGr6bQ=="],
459459

460-
"@next/swc-linux-arm64-musl": ["@next/[email protected].7", "", { "os": "linux", "cpu": "arm64" }, "sha512-+ksWNrZrthisXuo9gd1XnjHRowCbMtl/YgMpbRvFeDEqEBd523YHPWpBuDjomod88U8Xliw5DHhekBC3EOOd9g=="],
460+
"@next/swc-linux-arm64-musl": ["@next/[email protected].8", "", { "os": "linux", "cpu": "arm64" }, "sha512-JaXFAlqn8fJV+GhhA9lpg6da/NCN/v9ub98n3HoayoUSPOVdoxEEt86iT58jXqQCs/R3dv5ZnxGkW8aF4obMrQ=="],
461461

462-
"@next/swc-linux-x64-gnu": ["@next/[email protected].7", "", { "os": "linux", "cpu": "x64" }, "sha512-4WtJU5cRDxpEE44Ana2Xro1284hnyVpBb62lIpU5k85D8xXxatT+rXxBgPkc7C1XwkZMWpK5rXLXTh9PFipWsA=="],
462+
"@next/swc-linux-x64-gnu": ["@next/[email protected].8", "", { "os": "linux", "cpu": "x64" }, "sha512-O7M9it6HyNhsJp3HNAsJoHk5BUsfj7hRshfptpGcVsPZ1u0KQ/oVy8oxF7tlwxA5tR43VUP0yRmAGm1us514ng=="],
463463

464-
"@next/swc-linux-x64-musl": ["@next/[email protected].7", "", { "os": "linux", "cpu": "x64" }, "sha512-HYlhqIP6kBPXalW2dbMTSuB4+8fe+j9juyxwfMwCe9kQPPeiyFn7NMjNfoFOfJ2eXkeQsoUGXg+O2SE3m4Qg2w=="],
464+
"@next/swc-linux-x64-musl": ["@next/[email protected].8", "", { "os": "linux", "cpu": "x64" }, "sha512-8+KClEC/GLI2dLYcrWwHu5JyC5cZYCFnccVIvmxpo6K+XQt4qzqM5L4coofNDZYkct/VCCyJWGbZZDsg6w6LFA=="],
465465

466-
"@next/swc-win32-arm64-msvc": ["@next/[email protected].7", "", { "os": "win32", "cpu": "arm64" }, "sha512-EviG+43iOoBRZg9deGauXExjRphhuYmIOJ12b9sAPy0eQ6iwcPxfED2asb/s2/yiLYOdm37kPaiZu8uXSYPs0Q=="],
466+
"@next/swc-win32-arm64-msvc": ["@next/[email protected].8", "", { "os": "win32", "cpu": "arm64" }, "sha512-rpQ/PgTEgH68SiXmhu/cJ2hk9aZ6YgFvspzQWe2I9HufY6g7V02DXRr/xrVqOaKm2lenBFPNQ+KAaeveywqV+A=="],
467467

468-
"@next/swc-win32-x64-msvc": ["@next/[email protected].7", "", { "os": "win32", "cpu": "x64" }, "sha512-gniPjy55zp5Eg0896qSrf3yB1dw4F/3s8VK1ephdsZZ129j2n6e1WqCbE2YgcKhW9hPB9TVZENugquWJD5x0ug=="],
468+
"@next/swc-win32-x64-msvc": ["@next/[email protected].8", "", { "os": "win32", "cpu": "x64" }, "sha512-jWpWjWcMQu2iZz4pEK2IktcfR+OA9+cCG8zenyLpcW8rN4rzjfOzH4yj/b1FiEAZHKS+5Vq8+bZyHi+2yqHbFA=="],
469469

470470
"@nodelib/fs.scandir": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
471471

@@ -635,7 +635,7 @@
635635

636636
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
637637

638-
"@types/bun": ["@types/[email protected].3", "", { "dependencies": { "bun-types": "1.3.3" } }, "sha512-ogrKbJ2X5N0kWLLFKeytG0eHDleBYtngtlbu9cyBKFtNL3cnpDZkNdQj8flVf6WTZUX5ulI9AY1oa7ljhSrp+g=="],
638+
"@types/bun": ["@types/[email protected].4", "", { "dependencies": { "bun-types": "1.3.4" } }, "sha512-EEPTKXHP+zKGPkhRLv+HI0UEX8/o+65hqARxLy8Ov5rIxMBPNTjeZww00CIihrIQGEQBYg+0roO5qOnS/7boGA=="],
639639

640640
"@types/crypto-js": ["@types/[email protected]", "", {}, "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ=="],
641641

@@ -913,7 +913,7 @@
913913

914914
"buffer-from": ["[email protected]", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],
915915

916-
"bun-types": ["[email protected].3", "", { "dependencies": { "@types/node": "*" } }, "sha512-z3Xwlg7j2l9JY27x5Qn3Wlyos8YAp0kKRlrePAOjgjMGS5IG6E7Jnlx736vH9UVI4wUICwwhC9anYL++XeOgTQ=="],
916+
"bun-types": ["[email protected].4", "", { "dependencies": { "@types/node": "*" } }, "sha512-5ua817+BZPZOlNaRgGBpZJOSAQ9RQ17pkwPD0yR7CfJg+r8DgIILByFifDTa+IPDDxzf5VNhtNlcKqFzDgJvlQ=="],
917917

918918
"bytes": ["[email protected]", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
919919

@@ -1125,7 +1125,7 @@
11251125

11261126
"eslint-compat-utils": ["[email protected]", "", { "dependencies": { "semver": "^7.5.4" }, "peerDependencies": { "eslint": ">=6.0.0" } }, "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q=="],
11271127

1128-
"eslint-config-next": ["[email protected].7", "", { "dependencies": { "@next/eslint-plugin-next": "16.0.7", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^7.0.0", "globals": "16.4.0", "typescript-eslint": "^8.46.0" }, "peerDependencies": { "eslint": ">=9.0.0", "typescript": ">=3.3.1" }, "optionalPeers": ["typescript"] }, "sha512-WubFGLFHfk2KivkdRGfx6cGSFhaQqhERRfyO8BRx+qiGPGp7WLKcPvYC4mdx1z3VhVRcrfFzczjjTrbJZOpnEQ=="],
1128+
"eslint-config-next": ["[email protected].8", "", { "dependencies": { "@next/eslint-plugin-next": "16.0.8", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.0", "eslint-plugin-react-hooks": "^7.0.0", "globals": "16.4.0", "typescript-eslint": "^8.46.0" }, "peerDependencies": { "eslint": ">=9.0.0", "typescript": ">=3.3.1" }, "optionalPeers": ["typescript"] }, "sha512-8J5cOAboXIV3f8OD6BOyj7Fik6n/as7J4MboiUSExWruf/lCu1OPR3ZVSdnta6WhzebrmAATEmNSBZsLWA6kbg=="],
11291129

11301130
"eslint-config-prettier": ["[email protected]", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ=="],
11311131

@@ -1763,7 +1763,7 @@
17631763

17641764
"nested-error-stacks": ["[email protected]", "", {}, "sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A=="],
17651765

1766-
"next": ["[email protected]", "", { "dependencies": { "@next/env": "16.0.7", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.0.7", "@next/swc-darwin-x64": "16.0.7", "@next/swc-linux-arm64-gnu": "16.0.7", "@next/swc-linux-arm64-musl": "16.0.7", "@next/swc-linux-x64-gnu": "16.0.7", "@next/swc-linux-x64-musl": "16.0.7", "@next/swc-win32-arm64-msvc": "16.0.7", "@next/swc-win32-x64-msvc": "16.0.7", "sharp": "^0.34.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-3mBRJyPxT4LOxAJI6IsXeFtKfiJUbjCLgvXO02fV8Wy/lIhPvP94Fe7dGhUgHXcQy4sSuYwQNcOLhIfOm0rL0A=="],
1766+
"next": ["[email protected]", "", { "dependencies": { "@next/env": "16.0.8", "@swc/helpers": "0.5.15", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.0.8", "@next/swc-darwin-x64": "16.0.8", "@next/swc-linux-arm64-gnu": "16.0.8", "@next/swc-linux-arm64-musl": "16.0.8", "@next/swc-linux-x64-gnu": "16.0.8", "@next/swc-linux-x64-musl": "16.0.8", "@next/swc-win32-arm64-msvc": "16.0.8", "@next/swc-win32-x64-msvc": "16.0.8", "sharp": "^0.34.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-LmcZzG04JuzNXi48s5P+TnJBsTGPJunViNKV/iE4uM6kstjTQsQhvsAv+xF6MJxU2Pr26tl15eVbp0jQnsv6/g=="],
17671767

17681768
"next-compose-plugins": ["[email protected]", "", {}, "sha512-OjJ+fV15FXO2uQXQagLD4C0abYErBjyjE0I0FHpOEIB8upw0hg1ldFP6cqHTJBH1cZqy96OeR3u1dJ+Ez2D4Bg=="],
17691769

components/Filters/helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import { type Query } from '~/types';
2-
3-
type FilterParamsType = {
4-
param: keyof Query;
5-
title: string;
6-
};
1+
import { type FilterParamsType } from '~/types';
72

83
export const FILTER_PLATFORMS: FilterParamsType[] = [
94
{

components/Icons/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,9 @@ export function Module({ width = 24, height = 24, fill = colors.black }: IconPro
711711
stroke={fill}
712712
strokeLinecap="round"
713713
strokeLinejoin="round"
714-
stroke-width="20"
714+
strokeWidth="20"
715715
/>
716-
<Line x1="24" y1="120" x2="232" y2="120" fill="none" stroke={fill} stroke-width="16" />
716+
<Line x1="24" y1="120" x2="232" y2="120" fill="none" stroke={fill} strokeWidth="16" />
717717
<Line
718718
x1="72"
719719
y1="104"
@@ -723,7 +723,7 @@ export function Module({ width = 24, height = 24, fill = colors.black }: IconPro
723723
stroke={fill}
724724
strokeLinecap="round"
725725
strokeLinejoin="round"
726-
stroke-width="16"
726+
strokeWidth="16"
727727
/>
728728
<Line
729729
x1="184"
@@ -734,15 +734,15 @@ export function Module({ width = 24, height = 24, fill = colors.black }: IconPro
734734
stroke={fill}
735735
strokeLinecap="round"
736736
strokeLinejoin="round"
737-
stroke-width="16"
737+
strokeWidth="16"
738738
/>
739739
<Path
740740
d="M168,72V56a16,16,0,0,0-16-16H104A16,16,0,0,0,88,56V72"
741741
fill="none"
742742
stroke={fill}
743743
strokeLinecap="round"
744744
strokeLinejoin="round"
745-
stroke-width="20"
745+
strokeWidth="20"
746746
/>
747747
</Svg>
748748
);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"es-toolkit": "^1.42.0",
3131
"expo": "54.0.27",
3232
"expo-font": "^14.0.10",
33-
"next": "^16.0.7",
33+
"next": "^16.0.8",
3434
"node-emoji": "^2.2.0",
3535
"react": "19.2.1",
3636
"react-content-loader": "^7.1.1",
@@ -50,9 +50,9 @@
5050
"devDependencies": {
5151
"@eslint/json": "^0.14.0",
5252
"@expo/next-adapter": "^6.0.0",
53-
"@next/bundle-analyzer": "^16.0.7",
53+
"@next/bundle-analyzer": "^16.0.8",
5454
"@prettier/plugin-oxc": "^0.1.3",
55-
"@types/bun": "^1.3.3",
55+
"@types/bun": "^1.3.4",
5656
"@types/crypto-js": "^4.2.2",
5757
"@types/react": "^19.2.7",
5858
"@vercel/blob": "^0.27.3",
@@ -61,7 +61,7 @@
6161
"cheerio": "^1.1.2",
6262
"dotenv": "^17.2.3",
6363
"eslint": "^9.39.1",
64-
"eslint-config-next": "^16.0.7",
64+
"eslint-config-next": "^16.0.8",
6565
"eslint-config-universe": "^15.0.3",
6666
"eslint-plugin-prettier": "^5.5.4",
6767
"lint-staged": "^16.2.7",

pages/package/[name]/[scopedName]/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageOverviewScene from '~/scenes/PackageOverviewScene';
55
import { type PackageOverviewPageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -39,12 +39,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3939
]);
4040

4141
if (apiResponse.status !== 200 || npmResponse.status !== 200) {
42-
return {
43-
props: {
44-
packageName,
45-
...getPackagePageErrorMessage(apiResponse.status, npmResponse.status),
46-
},
47-
};
42+
return getPackagePageErrorProps(packageName, apiResponse.status, npmResponse.status);
4843
}
4944

5045
const [apiData, registryData] = await Promise.all([apiResponse.json(), npmResponse.json()]);

pages/package/[name]/[scopedName]/score.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageScoreScene from '~/scenes/PackageScoreScene';
55
import { type PackageScorePageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -31,12 +31,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3131
);
3232

3333
if (apiResponse.status !== 200) {
34-
return {
35-
props: {
36-
packageName,
37-
...getPackagePageErrorMessage(apiResponse.status, 200),
38-
},
39-
};
34+
return getPackagePageErrorProps(packageName, apiResponse.status);
4035
}
4136

4237
const apiData = await apiResponse.json();

pages/package/[name]/[scopedName]/versions.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageVersionsScene from '~/scenes/PackageVersionsScene';
55
import { type PackageVersionsPageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -39,12 +39,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3939
]);
4040

4141
if (apiResponse.status !== 200 || npmResponse.status !== 200) {
42-
return {
43-
props: {
44-
packageName,
45-
...getPackagePageErrorMessage(apiResponse.status, npmResponse.status),
46-
},
47-
};
42+
return getPackagePageErrorProps(packageName, apiResponse.status, npmResponse.status);
4843
}
4944

5045
const [apiData, registryData] = await Promise.all([apiResponse.json(), npmResponse.json()]);

pages/package/[name]/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageOverviewScene from '~/scenes/PackageOverviewScene';
55
import { type PackageOverviewPageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -39,12 +39,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3939
]);
4040

4141
if (apiResponse.status !== 200 || npmResponse.status !== 200) {
42-
return {
43-
props: {
44-
packageName,
45-
...getPackagePageErrorMessage(apiResponse.status, npmResponse.status),
46-
},
47-
};
42+
return getPackagePageErrorProps(packageName, apiResponse.status, npmResponse.status);
4843
}
4944

5045
const [apiData, registryData] = await Promise.all([apiResponse.json(), npmResponse.json()]);

pages/package/[name]/score.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageScoreScene from '~/scenes/PackageScoreScene';
55
import { type PackageScorePageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -31,12 +31,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3131
);
3232

3333
if (apiResponse.status !== 200) {
34-
return {
35-
props: {
36-
packageName,
37-
...getPackagePageErrorMessage(apiResponse.status, 200),
38-
},
39-
};
34+
return getPackagePageErrorProps(packageName, apiResponse.status);
4035
}
4136

4237
const apiData = await apiResponse.json();

pages/package/[name]/versions.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageVersionsScene from '~/scenes/PackageVersionsScene';
55
import { type PackageVersionsPageProps } from '~/types/pages';
66
import { EMPTY_PACKAGE_DATA } from '~/util/Constants';
77
import getApiUrl from '~/util/getApiUrl';
8-
import { getPackagePageErrorMessage } from '~/util/getPackagePageErrorMessage';
8+
import { getPackagePageErrorProps } from '~/util/getPackagePageErrorProps';
99
import { parseQueryParams } from '~/util/parseQueryParams';
1010
import urlWithQuery from '~/util/urlWithQuery';
1111

@@ -39,12 +39,7 @@ export async function getServerSideProps(ctx: NextPageContext) {
3939
]);
4040

4141
if (apiResponse.status !== 200 || npmResponse.status !== 200) {
42-
return {
43-
props: {
44-
packageName,
45-
...getPackagePageErrorMessage(apiResponse.status, npmResponse.status),
46-
},
47-
};
42+
return getPackagePageErrorProps(packageName, apiResponse.status, npmResponse.status);
4843
}
4944

5045
const [apiData, registryData] = await Promise.all([apiResponse.json(), npmResponse.json()]);

0 commit comments

Comments
 (0)