Skip to content

Commit a779d20

Browse files
committed
Update dependencies and improve configuration for development environment
- Added @types/node@24.10.0 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

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

bun.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)