chore: setup increment ci env (#109)

This commit is contained in:
tecvan
2025-07-28 17:51:31 +08:00
committed by GitHub
parent 4a44c0ddbd
commit 9dcdb70508
22 changed files with 516 additions and 55 deletions

View File

@ -1,19 +1,3 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import OriginPkgRootWebpackPlugin from '@coze-arch/pkg-root-webpack-plugin-origin';
type PkgRootWebpackPluginOptions = Record<string, unknown>;
declare class PkgRootWebpackPlugin extends OriginPkgRootWebpackPlugin {

View File

@ -1,4 +1,19 @@
"use strict";
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};

View File

@ -13,25 +13,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useState, type FC } from 'react';
import { groupBy } from 'lodash-es';
import { ToolGroupKey, ToolKey } from '@coze-agent-ide/tool-config';
import {
type useRegisteredToolKeyConfigList,
abilityKey2ModelFunctionConfigType,
} from '@coze-agent-ide/tool';
import { useBotSkillStore } from '@coze-studio/bot-detail-store/bot-skill';
import { I18n } from '@coze-arch/i18n';
import { IconCozCross } from '@coze-arch/coze-design/icons';
import {
Button,
Checkbox,
Modal,
IconButton,
Space,
} from '@coze-arch/coze-design';
import {
type Model,
ModelFuncConfigStatus,
ModelFuncConfigType,
} from '@coze-arch/bot-api/developer_api';
import { useBotSkillStore } from '@coze-studio/bot-detail-store/bot-skill';
import { ToolGroupKey, ToolKey } from '@coze-agent-ide/tool-config';
import {
type useRegisteredToolKeyConfigList,
abilityKey2ModelFunctionConfigType,
} from '@coze-agent-ide/tool';
import { mergeModelFuncConfigStatus } from '@coze-agent-ide/bot-editor-context-store';
import { IconCozCross } from '@coze-arch/coze-design/icons';
import { Button, Checkbox, Modal, IconButton, Space } from '@coze-arch/coze-design';
type IRegisteredToolKeyConfig = ReturnType<
typeof useRegisteredToolKeyConfigList
@ -196,6 +202,7 @@ export const checkModelAbility = (
: ModelFuncConfigType.KnowledgeOnDemandCall
];
modelFunctionConfigStatus = mergeModelFuncConfigStatus(
// @ts-expect-error fix me late
autoConfigStatus,
modelFunctionConfigStatus,
);
@ -263,6 +270,7 @@ export const confirm = ({
};
const getGroupTittleByConfigType = (type: ModelFuncConfigType): string =>
// @ts-expect-error fix me late
({
[ModelFuncConfigType.Plugin]: I18n.t('bot_edit_type_skills'),
[ModelFuncConfigType.Workflow]: I18n.t('bot_edit_type_skills'),
@ -291,6 +299,7 @@ const getGroupTittleByConfigType = (type: ModelFuncConfigType): string =>
})[type];
const getTitleByConfigType = (type: ModelFuncConfigType): string =>
// @ts-expect-error fix me late
({
[ModelFuncConfigType.Plugin]: I18n.t('Plugins'),
[ModelFuncConfigType.Workflow]: I18n.t('Workflows'),

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import path from 'path';
import {
@ -65,7 +65,22 @@ const updateDTS = ({
// 创建一个新的文件,用来保存生成的类型定义
const typeDefs = project.createSourceFile(
outputFileName,
`/* eslint-disable */
`/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* prettier-ignore */
// 基于${path.relative(baseDir, inputFileName)}自动生成,请勿手动修改`,
{

View File

@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* prettier-ignore */
// 基于src/index.ts自动生成请勿手动修改

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import dayjs from 'dayjs';
import { I18n } from '@coze-arch/i18n';
@ -56,8 +56,16 @@ describe('Date', () => {
expect(getCurrentTZ().utcOffset()).toBe(60 * 8);
});
it('#formatDate', () => {
const date = formatDate(1718782764);
expect(date).toBe('2024/06/19 15:39:24');
// 使用固定的时间戳,但验证格式而不是具体的时区值
const timestamp = 1718782764;
const date = formatDate(timestamp);
// 验证格式是否正确YYYY/MM/DD HH:mm:ss
expect(date).toMatch(/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/);
// 验证时间戳转换的一致性格式化后再解析应该得到相同的dayjs对象的日期部分
const formattedDayjs = dayjs(date, 'YYYY/MM/DD HH:mm:ss');
const originalDayjs = dayjs.unix(timestamp);
expect(formattedDayjs.unix()).toBe(originalDayjs.unix());
});
it('#getRemainTime', () => {
vi.useFakeTimers();
@ -80,7 +88,7 @@ describe('Date', () => {
describe('format timestamp', () => {
beforeEach(() => {
const MOCK_NOW = dayjs('2024-09-24 20:00:00');
vi.setSystemTime(MOCK_NOW);
vi.setSystemTime(MOCK_NOW.toDate());
});
it('just now', () => {

View File

@ -18,4 +18,12 @@ module.exports = defineConfig({
},
],
},
overrides: [
{
files: ['src/**/namespaces/*.ts'],
rules: {
'unicorn/filename-case': 'off',
},
},
],
});

View File

@ -1,3 +1,4 @@
// eslint-disable unicorn/filename-case
/*
* Copyright 2025 coze-dev Authors
*
@ -13,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import { type TableMemoryItem } from '@coze-studio/bot-detail-store';
import {
@ -22,7 +22,6 @@ import {
} from '@coze-data/database-v2-base/constants';
import { DatabaseFieldTitle } from '@coze-data/database-v2-base/components/database-field-title';
import { I18n } from '@coze-arch/i18n';
import { FieldItemType } from '@coze-arch/bot-api/memory';
import { IconCozEdit, IconCozTrashCan } from '@coze-arch/coze-design/icons';
import {
type ColumnProps,
@ -31,12 +30,14 @@ import {
Space,
Typography,
} from '@coze-arch/coze-design';
import { FieldItemType } from '@coze-arch/bot-api/memory';
import { type TableRow, type TableField, type TableFieldData } from './type';
export function formatTableStructList(
structList: TableMemoryItem[],
): TableFieldData[] {
// @ts-expect-error fix me late
return structList.map(item => ({
fieldName: item.name ?? '',
fieldDescription: item.desc ?? '',
@ -173,6 +174,7 @@ export const getTableColumns = ({
title: () => (
<DatabaseFieldTitle
field={item.name}
// @ts-expect-error fix me late
type={item.type}
tip={item.desc}
required

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useEffect, useRef, useState } from 'react';
import dayjs from 'dayjs';
@ -25,7 +25,6 @@ import {
} from '@coze-data/database-v2-base/constants';
import { DatabaseFieldTitle } from '@coze-data/database-v2-base/components/database-field-title';
import { I18n } from '@coze-arch/i18n';
import { FieldItemType, TableType } from '@coze-arch/bot-api/memory';
import {
CozInputNumber,
type DatePickerProps,
@ -37,6 +36,7 @@ import {
withField,
type CommonFieldProps,
} from '@coze-arch/coze-design';
import { FieldItemType, TableType } from '@coze-arch/bot-api/memory';
import {
type TableRow,
@ -250,6 +250,7 @@ function getSystemFieldCommonProps(field: TableMemoryItem): FieldCommonProps {
<DatabaseFieldTitle
field={field.name}
textType="primary"
// @ts-expect-error fix me late
type={field.type}
tip={field.desc}
required

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useMemo } from 'react';
import {
@ -79,6 +79,7 @@ export const SpanInfoArea = (props: SpanInfoAreaProps) => {
const { rootSpan, spans } = useSpanTransform({
orgSpans: orgDetailSpans ?? [],
traceAdvanceInfo,
// @ts-expect-error fix me late
spanCategoryMeta: spanCategory,
});

View File

@ -5,7 +5,8 @@
"stories",
"./src/**/*.test.ts",
"vitest.config.ts",
"setup-vitest.ts"
"setup-vitest.ts",
"__mocks__/*.ts"
],
"exclude": ["./dist"],
"references": [

View File

@ -13,5 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export function useInitOpenPremiumManage(_props: { open: () => void }) {}
export function useInitOpenPremiumManage(_props: { open: () => void }) {
// allow empty function
}

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { merge } from 'lodash-es';
import {
REPORT_EVENTS as ReportEventNames,
@ -87,6 +87,7 @@ export const getBotDetailDtoInfo = () => {
onboarding_info: botSkill.transformVo2Dto.onboarding(onboardingContent),
background_image_info_list: backgroundImageInfoList,
shortcut_sort: botSkill.transformVo2Dto.shortcut(shortcut),
// @ts-expect-error fix me late
voices_info: merge(
{},
botSkill.transformVo2Dto.tts(tts),

View File

@ -13,10 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { nanoid } from 'nanoid';
import { isNumber, mapValues } from 'lodash-es';
import { type ShortCutStruct } from '@coze-agent-ide/tool-config';
import {
type PluginStatus,
type PluginType,
@ -50,6 +49,7 @@ import {
DisablePromptCalling,
} from '@coze-arch/bot-api/playground_api';
import { SuggestReplyMode } from '@coze-arch/bot-api/developer_api';
import { type ShortCutStruct } from '@coze-agent-ide/tool-config';
import {
type WorkFlowItemType,
@ -369,6 +369,7 @@ export const transformVo2Dto = {
databaseList: (
databaseList: DatabaseList,
): BotInfoForUpdate['database_list'] =>
// @ts-expect-error fix me late
databaseList.map(d => ({
table_id: d.tableId,
table_name: d.name,

View File

@ -13,21 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type PropsWithChildren } from 'react';
import {
PictureUpload,
type RenderAutoGenerateParams,
} from '@coze-common/biz-components/picture-upload';
import {
type DraftProjectCopyRequest,
type DraftProjectUpdateRequest,
type DraftProjectCreateRequest,
} from '@coze-arch/idl/intelligence_api';
import { I18n } from '@coze-arch/i18n';
import { FileBizType, IconType } from '@coze-arch/bot-api/developer_api';
import {
PictureUpload,
type RenderAutoGenerateParams,
} from '@coze-common/biz-components/picture-upload';
import { botInputLengthService } from '@coze-agent-ide/bot-input-length-limit';
import { IconCozUpload } from '@coze-arch/coze-design/icons';
import {
type BaseFormProps,
@ -37,6 +35,8 @@ import {
useFormApi,
withField,
} from '@coze-arch/coze-design';
import { FileBizType, IconType } from '@coze-arch/bot-api/developer_api';
import { botInputLengthService } from '@coze-agent-ide/bot-input-length-limit';
import { SwitchWithDesc } from '../switch-with-desc';
import { type ModifyUploadValueType } from '../../type';
@ -66,6 +66,7 @@ export const ProjectForm: React.FC<PropsWithChildren<ProjectFormProps>> = ({
...formProps
}) => <Form<ProjectFormValues> {...formProps}>{children}</Form>;
// @ts-expect-error fix me late
export const filedKeyMap: Record<
keyof ProjectFormValues,
keyof ProjectFormValues

View File

@ -1,3 +1,4 @@
/* eslint-disable unicorn/filename-case */
/*
* Copyright 2025 coze-dev Authors
*
@ -13,8 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable unicorn/filename-case */
import { type ViewVariableType } from '@coze-workflow/base';
import { useNodeAvailableVariablesWithNode } from '../../hooks/use-node-available-variables';

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useShallow } from 'zustand/react/shallow';
import { type WorkflowDatabase, ViewVariableType } from '@coze-workflow/base';
import { FieldItemType, type DatabaseInfo } from '@coze-arch/bot-api/memory';
@ -54,6 +54,7 @@ function transformRawDatabaseToDatabase(
fields: rawDatabase.field_list?.map(field => ({
id: field.alterId as number,
name: field.name,
// @ts-expect-error fix me late
type: fieldItemTypeToViewVariableType(field.type),
required: field.must_required,
description: field.desc,