feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
94
frontend/packages/workflow/test-run-next/main/README.md
Normal file
94
frontend/packages/workflow/test-run-next/main/README.md
Normal file
@@ -0,0 +1,94 @@
|
||||
# @coze-workflow/test-run-next
|
||||
|
||||
Workflow TestRun 入口包
|
||||
|
||||
## Overview
|
||||
|
||||
This package is part of the Coze Studio monorepo and provides workflow functionality. It includes component, hook, store.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Installation
|
||||
|
||||
Add this package to your `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"dependencies": {
|
||||
"@coze-workflow/test-run-next": "workspace:*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
rush update
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```typescript
|
||||
import { /* exported functions/components */ } from '@coze-workflow/test-run-next';
|
||||
|
||||
// Example usage
|
||||
// TODO: Add specific usage examples
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Component
|
||||
- Hook
|
||||
- Store
|
||||
|
||||
## API Reference
|
||||
|
||||
### Exports
|
||||
|
||||
- `/** components */
|
||||
TestRunForm,
|
||||
FormBaseFieldItem,
|
||||
FormBaseInputJson,
|
||||
FormBaseGroupCollapse,
|
||||
TestRunFormProvider,
|
||||
/** hooks */
|
||||
useForm,
|
||||
useTestRunFormStore,
|
||||
useFormSchema,
|
||||
useCurrentFieldState,
|
||||
/** functions */
|
||||
createSchemaField,
|
||||
generateField,
|
||||
generateFieldValidator,
|
||||
isFormSchemaPropertyEmpty,
|
||||
stringifyFormValuesFromBacked,
|
||||
FormSchema,
|
||||
/** constants */
|
||||
TestFormFieldName,
|
||||
/** types */
|
||||
type FormModel,
|
||||
type TestRunFormState,
|
||||
type IFormSchema,`
|
||||
- `safeJsonParse`
|
||||
- `TraceListPanel,
|
||||
TraceDetailPanel,`
|
||||
|
||||
|
||||
For detailed API documentation, please refer to the TypeScript definitions.
|
||||
|
||||
## Development
|
||||
|
||||
This package is built with:
|
||||
|
||||
- TypeScript
|
||||
- Modern JavaScript
|
||||
- Vitest for testing
|
||||
- ESLint for code quality
|
||||
|
||||
## Contributing
|
||||
|
||||
This package is part of the Coze Studio monorepo. Please follow the monorepo contribution guidelines.
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"operationSettings": [
|
||||
{
|
||||
"operationName": "ts-check",
|
||||
"outputFolderNames": ["./dist"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
const { defineConfig } = require('@coze-arch/eslint-config');
|
||||
|
||||
module.exports = defineConfig({
|
||||
packageRoot: __dirname,
|
||||
preset: 'web',
|
||||
rules: {
|
||||
'@coze-arch/max-line-per-function': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
'@coze-arch/zustand/prefer-shallow': 'off',
|
||||
'@coze-arch/no-deep-relative-import': 'off',
|
||||
'@typescript-eslint/naming-convention': 'off',
|
||||
},
|
||||
});
|
||||
28
frontend/packages/workflow/test-run-next/main/package.json
Normal file
28
frontend/packages/workflow/test-run-next/main/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@coze-workflow/test-run-next",
|
||||
"version": "0.0.1",
|
||||
"description": "Workflow TestRun 入口包",
|
||||
"author": "jiangxujin@bytedance.com",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"main": "./src/index.ts",
|
||||
"scripts": {
|
||||
"build": "exit 0",
|
||||
"lint": "eslint ./ --cache",
|
||||
"test": "exit 0",
|
||||
"test:cov": "exit 0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coze-workflow/test-run-form": "workspace:*",
|
||||
"@coze-workflow/test-run-shared": "workspace:*",
|
||||
"@coze-workflow/test-run-trace": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@coze-arch/bot-typings": "workspace:*",
|
||||
"@coze-arch/eslint-config": "workspace:*",
|
||||
"@coze-arch/ts-config": "workspace:*",
|
||||
"typescript": "~5.8.2"
|
||||
}
|
||||
}
|
||||
|
||||
26
frontend/packages/workflow/test-run-next/main/src/global.d.ts
vendored
Normal file
26
frontend/packages/workflow/test-run-next/main/src/global.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/// <reference types='@coze-arch/bot-typings' />
|
||||
declare module '*.otf' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.ttf' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
61
frontend/packages/workflow/test-run-next/main/src/index.ts
Normal file
61
frontend/packages/workflow/test-run-next/main/src/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* TestRun Main
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* TestRun Form
|
||||
*/
|
||||
export {
|
||||
/** components */
|
||||
TestRunForm,
|
||||
FormBaseFieldItem,
|
||||
FormBaseInputJson,
|
||||
FormBaseGroupCollapse,
|
||||
TestRunFormProvider,
|
||||
/** hooks */
|
||||
useForm,
|
||||
useTestRunFormStore,
|
||||
useFormSchema,
|
||||
useCurrentFieldState,
|
||||
/** functions */
|
||||
createSchemaField,
|
||||
generateField,
|
||||
generateFieldValidator,
|
||||
isFormSchemaPropertyEmpty,
|
||||
stringifyFormValuesFromBacked,
|
||||
FormSchema,
|
||||
/** constants */
|
||||
TestFormFieldName,
|
||||
/** types */
|
||||
type FormModel,
|
||||
type TestRunFormState,
|
||||
type IFormSchema,
|
||||
} from '@coze-workflow/test-run-form';
|
||||
|
||||
/*******************************************************************************
|
||||
* TestRun Shared
|
||||
*/
|
||||
export { safeJsonParse } from '@coze-workflow/test-run-shared';
|
||||
/**
|
||||
* TestRun Trace
|
||||
*/
|
||||
export {
|
||||
TraceListPanel,
|
||||
TraceDetailPanel,
|
||||
} from '@coze-workflow/test-run-trace';
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@coze-arch/ts-config/tsconfig.web.json",
|
||||
"compilerOptions": {
|
||||
"types": [],
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib-ts",
|
||||
"tsBuildInfoFile": "./lib-ts/tsconfig.build.tsbuildinfo"
|
||||
},
|
||||
"include": ["./src", "./src/**/*.json"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../arch/bot-typings/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../../../../config/eslint-config/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../../../../config/ts-config/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../form/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../shared/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../trace/tsconfig.build.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
frontend/packages/workflow/test-run-next/main/tsconfig.json
Normal file
15
frontend/packages/workflow/test-run-next/main/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"exclude": ["**/*"],
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.misc.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user