Skip to content

Commit a779d20

Browse files
committed
Update dependencies and improve configuration for development environment
- Added @types/[email protected] to package.json and bun.lock for enhanced type definitions. - Introduced a new script "dev:prod" in package.json for production environment setup. - Modified request service to conditionally set the API endpoint based on the NODE_ENV variable, allowing for local development and production configurations. - Corrected a typo in the ContentProps interface definition in types.d.ts for clarity.
1 parent b2bdff3 commit a779d20

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

bun.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@biomejs/biome": "2.3.4",
2727
"@tailwindcss/postcss": "^4.1.17",
2828
"@types/git-url-parse": "^16.0.2",
29+
"@types/node": "^24.10.0",
2930
"@types/react": "^19",
3031
"@types/react-dom": "^19",
3132
"@types/react-router-dom": "^5.3.3",
@@ -314,6 +315,8 @@
314315

315316
"@types/history": ["@types/[email protected]", "", {}, "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA=="],
316317

318+
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A=="],
319+
317320
"@types/parse-path": ["@types/[email protected]", "", { "dependencies": { "parse-path": "*" } }, "sha512-EULJ8LApcVEPbrfND0cRQqutIOdiIgJ1Mgrhpy755r14xMohPTEpkV/k28SJvuOs9bHRFW8x+KeDAEPiGQPB9Q=="],
318321

319322
"@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-WBM/nDbEZmDUORKnh5i1bTnAz6vTohUf9b8esSMu+b24+srbaxa04UbJgWx78CVfNXA20sNu0odEIluZDFdCog=="],
@@ -712,6 +715,8 @@
712715

713716
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
714717

718+
"undici-types": ["[email protected]", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
719+
715720
"uniq": ["[email protected]", "", {}, "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA=="],
716721

717722
"update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="],

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"private": true,
44
"scripts": {
55
"dev": "rsbuild dev",
6+
"dev:prod": "NODE_ENV=production rsbuild dev",
67
"build": "NODE_ENV=production rsbuild build",
78
"preview": "rsbuild preview",
89
"lint": "tsc --noEmit & biome check --write ."
@@ -29,6 +30,7 @@
2930
"@biomejs/biome": "2.3.4",
3031
"@tailwindcss/postcss": "^4.1.17",
3132
"@types/git-url-parse": "^16.0.2",
33+
"@types/node": "^24.10.0",
3234
"@types/react": "^19",
3335
"@types/react-dom": "^19",
3436
"@types/react-router-dom": "^5.3.3",

src/services/request.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ export const setToken = (token: string) => {
1313
export const getToken = () => _token;
1414

1515
const SERVER = {
16-
main: [
17-
// "http://localhost:9000",
18-
'https://update.react-native.cn/api',
19-
'https://update.reactnative.cn/api',
20-
// "https://5.rnupdate.online/api",
21-
],
16+
main:
17+
process.env.NODE_ENV === 'production'
18+
? [
19+
'https://update.react-native.cn/api',
20+
'https://update.reactnative.cn/api',
21+
// "https://5.rnupdate.online/api",
22+
]
23+
: ['http://localhost:9000'],
2224
};
2325

2426
// const baseUrl = `http://localhost:9000`;

src/types.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
type Style = { [name: string]: import('react').CSSProperties };
2-
31
declare module '*.svg' {
42
export const ReactComponent: React.FunctionComponent<
53
React.SVGProps<SVGSVGElement>
@@ -86,7 +84,7 @@ interface SiderMenuProps {
8684
selectedKeys?: string[];
8785
}
8886

89-
interface CotentProps {
87+
interface ContentProps {
9088
app: App;
9189
}
9290

0 commit comments

Comments
 (0)