Skip to content

Commit 942b164

Browse files
committed
[fix] [frontend] ts ref and wrong i18n types (#162)
* fix(cozeloop): ts ref * fix(cozeloop): missing idl type
1 parent a0d6f63 commit 942b164

19 files changed

Lines changed: 125 additions & 52 deletions

File tree

frontend/apps/cozeloop/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"scripts": {
1212
"analyze": "BUNDLE_ANALYZE=true rsbuild build",
1313
"build": "REGION=cn npm run build:prod",
14-
"build:prod": "NODE_OPTIONS=--max_old_space_size=16384 rsbuild build",
15-
"build:ts": "NODE_OPTIONS=--max-old-space-size=16384 tsc -b tsconfig.build.json",
14+
"build:prod": "rsbuild build",
15+
"build:ts": "tsc -b tsconfig.build.json",
1616
"dev": "npm run dev:cn-boe",
1717
"dev:base": "rsbuild dev",
1818
"dev:cn": "REGION=cn npm run dev",
@@ -70,4 +70,3 @@
7070
"vitest": "~3.0.5"
7171
}
7272
}
73-

frontend/packages/cozeloop/adapter/tsconfig.build.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
{
1616
"path": "../api-schema/tsconfig.build.json"
1717
},
18-
{
19-
"path": "../../../apps/fornax/libraries/api/tsconfig.build.json"
20-
},
2118
{
2219
"path": "../../../config/eslint-config/tsconfig.build.json"
2320
},

frontend/packages/cozeloop/api-schema/src/api/idl/prompt/domain/prompt.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,18 @@ export interface VariableVal {
136136
placeholder_messages?: Message[],
137137
}
138138
export enum VariableType {
139-
String = "string",
140-
Boolean = "boolean",
141-
Integer = "integer",
142-
Float = "float",
143-
Object = "object",
144-
Array_String = "array<string>",
145-
Array_Boolean = "array<boolean>",
146-
Array_Integer = "array<integer>",
147-
Array_Float = "array<float>",
148-
Array_Object = "array<object>",
149-
Placeholder = "placeholder",
139+
String = 'string',
140+
Boolean = 'boolean',
141+
Integer = 'integer',
142+
Float = 'float',
143+
Object = 'object',
144+
Array_String = 'array<string>',
145+
Array_Boolean = 'array<boolean>',
146+
Array_Integer = 'array<integer>',
147+
Array_Float = 'array<float>',
148+
Array_Object = 'array<object>',
149+
Placeholder = 'placeholder',
150+
MultiPart = 'multi_part',
150151
}
151152
export interface TokenUsage {
152153
input_tokens?: string,

frontend/packages/cozeloop/api-schema/src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ export * from './api/idl';
77
export { $notification } from './notification';
88

99
import {
10+
dataDataset,
11+
dataTag,
1012
evaluationEvalSet,
1113
evaluationEvalTarget,
1214
evaluationEvaluator,
1315
evaluationExpt,
14-
dataDataset,
15-
llmManage,
16-
foundationUpload,
17-
promptManage,
18-
promptDebug,
1916
foundationAuthn,
20-
foundationUser,
2117
foundationSpace,
18+
foundationUpload,
19+
foundationUser,
20+
llmManage,
21+
promptDebug,
22+
promptManage,
2223
} from './api/idl';
2324

2425
export const StoneEvaluationApi = {
@@ -30,6 +31,7 @@ export const StoneEvaluationApi = {
3031

3132
export const DataApi = {
3233
...dataDataset,
34+
...dataTag,
3335
};
3436

3537
export const LlmManageApi = {

frontend/packages/cozeloop/auth-pages/tsconfig.build.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
},
3535
{
3636
"path": "../i18n/tsconfig.build.json"
37+
},
38+
{
39+
"path": "../stores/tsconfig.build.json"
3740
}
3841
]
3942
}

frontend/packages/cozeloop/biz-components/tsconfig.build.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
},
3232
{
3333
"path": "../../../config/vitest-config/tsconfig.build.json"
34+
},
35+
{
36+
"path": "../i18n/tsconfig.build.json"
3437
}
3538
]
3639
}

frontend/packages/cozeloop/evaluate-components/tsconfig.build.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
{
2424
"path": "../api-schema/tsconfig.build.json"
2525
},
26-
{
27-
"path": "../../arch/bot-api/tsconfig.build.json"
28-
},
2926
{
3027
"path": "../../arch/bot-md-box-adapter/tsconfig.build.json"
3128
},

frontend/packages/cozeloop/evaluate-pages/tsconfig.build.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@
1717
"include": ["./src", "./src/**/*.json"],
1818
"exclude": ["node_modules", "dist"],
1919
"references": [
20+
{
21+
"path": "../../arch/bot-typings/tsconfig.build.json"
22+
},
23+
{
24+
"path": "../../../config/eslint-config/tsconfig.build.json"
25+
},
26+
{
27+
"path": "../../../config/stylelint-config/tsconfig.build.json"
28+
},
29+
{
30+
"path": "../../../config/ts-config/tsconfig.build.json"
31+
},
32+
{
33+
"path": "../../../config/vitest-config/tsconfig.build.json"
34+
},
2035
{
2136
"path": "../evaluate-components/tsconfig.build.json"
2237
},

frontend/packages/cozeloop/i18n/scripts/gen-i18n-types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ async function main() {
4141
const functionTypes = generateOptionsMap(localeEnUS, ' ');
4242
const localeTypes = `// Copyright (c) 2025 coze-dev Authors
4343
// SPDX-License-Identifier: Apache-2.0
44-
/* eslint-disable max-lines, prettier/prettier, @typescript-eslint/unified-signatures -- skip */
44+
/* eslint-disable
45+
max-lines,
46+
prettier/prettier,
47+
@typescript-eslint/naming-convention,
48+
@typescript-eslint/unified-signatures
49+
-- skip */
4550
/** Generated by rushx gen-i18n-types */
4651
import { type ReactNode } from 'react';
4752
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
// Copyright (c) 2025 coze-dev Authors
22
// SPDX-License-Identifier: Apache-2.0
33
export { initIntl, I18n } from './i18n';
4+
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- workaround now
6+
export type I18nKeysNoOptionsType = any;

0 commit comments

Comments
 (0)