feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
80
frontend/packages/arch/tea/README.md
Normal file
80
frontend/packages/arch/tea/README.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# @coze-arch/tea
|
||||
|
||||
Tea package for monorepo
|
||||
|
||||
## Overview
|
||||
|
||||
This package is part of the Coze Studio monorepo and provides architecture functionality. It includes adapter, store, plugin.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Installation
|
||||
|
||||
Add this package to your `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"dependencies": {
|
||||
"@coze-arch/tea": "workspace:*"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
rush update
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```typescript
|
||||
import { /* exported functions/components */ } from '@coze-arch/tea';
|
||||
|
||||
// Example usage
|
||||
// TODO: Add specific usage examples
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Adapter
|
||||
- Store
|
||||
- Plugin
|
||||
|
||||
## API Reference
|
||||
|
||||
### Exports
|
||||
|
||||
- `EVENT_NAMES,
|
||||
AddPluginToStoreEntry,
|
||||
AddWorkflowToStoreEntry,
|
||||
PublishAction,
|
||||
AddBotToStoreEntry,
|
||||
BotDetailPageAction,
|
||||
PluginPrivacyAction,
|
||||
PluginMockDataGenerateMode,
|
||||
BotShareConversationClick,
|
||||
FlowStoreType,
|
||||
FlowResourceFrom,
|
||||
FlowDuplicateType,`
|
||||
- `default Tea;`
|
||||
|
||||
|
||||
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
|
||||
12
frontend/packages/arch/tea/config/rush-project.json
Normal file
12
frontend/packages/arch/tea/config/rush-project.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"operationSettings": [
|
||||
{
|
||||
"operationName": "test:cov",
|
||||
"outputFolderNames": ["coverage"]
|
||||
},
|
||||
{
|
||||
"operationName": "ts-check",
|
||||
"outputFolderNames": ["./dist"]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
frontend/packages/arch/tea/eslint.config.js
Normal file
9
frontend/packages/arch/tea/eslint.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const { defineConfig } = require('@coze-arch/eslint-config');
|
||||
|
||||
module.exports = defineConfig({
|
||||
packageRoot: __dirname,
|
||||
preset: 'web',
|
||||
rules: {
|
||||
'@typescript-eslint/naming-convention': 'off',
|
||||
},
|
||||
});
|
||||
35
frontend/packages/arch/tea/package.json
Normal file
35
frontend/packages/arch/tea/package.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@coze-arch/tea",
|
||||
"version": "0.0.1",
|
||||
"description": "Tea package for monorepo",
|
||||
"license": "Apache-2.0",
|
||||
"author": "tanjizhen@bytedance.com",
|
||||
"maintainers": [],
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "exit 0",
|
||||
"lint": "eslint ./ --cache",
|
||||
"test": "vitest --run --passWithNoTests",
|
||||
"test:cov": "npm run test -- --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coze-arch/bot-typings": "workspace:*",
|
||||
"@coze-studio/tea-adapter": "workspace:*",
|
||||
"@coze-studio/tea-interface": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@coze-arch/eslint-config": "workspace:*",
|
||||
"@coze-arch/ts-config": "workspace:*",
|
||||
"@coze-arch/vitest-config": "workspace:*",
|
||||
"@testing-library/jest-dom": "^6.1.5",
|
||||
"@testing-library/react": "^14.1.2",
|
||||
"@testing-library/react-hooks": "^8.0.1",
|
||||
"@types/react": "18.2.37",
|
||||
"@types/react-dom": "18.2.15",
|
||||
"@vitest/coverage-v8": "~3.0.5",
|
||||
"react": "~18.2.0",
|
||||
"react-dom": "~18.2.0",
|
||||
"vitest": "~3.0.5"
|
||||
}
|
||||
}
|
||||
|
||||
17
frontend/packages/arch/tea/src/global.d.ts
vendored
Normal file
17
frontend/packages/arch/tea/src/global.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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' />
|
||||
50
frontend/packages/arch/tea/src/index.ts
Normal file
50
frontend/packages/arch/tea/src/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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 Tea from '@coze-studio/tea-adapter';
|
||||
|
||||
export {
|
||||
EVENT_NAMES,
|
||||
AddPluginToStoreEntry,
|
||||
AddWorkflowToStoreEntry,
|
||||
PublishAction,
|
||||
AddBotToStoreEntry,
|
||||
BotDetailPageAction,
|
||||
PluginPrivacyAction,
|
||||
PluginMockDataGenerateMode,
|
||||
BotShareConversationClick,
|
||||
FlowStoreType,
|
||||
FlowResourceFrom,
|
||||
FlowDuplicateType,
|
||||
} from '@coze-studio/tea-interface/events';
|
||||
|
||||
export type {
|
||||
ExploreBotCardCommonParams,
|
||||
ShareRecallPageFrom,
|
||||
PluginMockSetCommonParams,
|
||||
SideNavClickCommonParams,
|
||||
UserGrowthEventParams,
|
||||
ParamsTypeDefine,
|
||||
|
||||
/** product event types */
|
||||
ProductEventSource,
|
||||
ProductEventFilterTag,
|
||||
ProductEventEntityType,
|
||||
ProductShowFrontParams,
|
||||
DocClickCommonParams,
|
||||
} from '@coze-studio/tea-interface/events';
|
||||
|
||||
export default Tea;
|
||||
36
frontend/packages/arch/tea/tsconfig.build.json
Normal file
36
frontend/packages/arch/tea/tsconfig.build.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "@coze-arch/ts-config/tsconfig.web.json",
|
||||
"compilerOptions": {
|
||||
"types": [],
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"paths": {
|
||||
"byted-tea-sdk": ["./node_modules/byted-tea-sdk"]
|
||||
},
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.build.tsbuildinfo"
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../bot-typings/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../../../config/eslint-config/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../../../config/ts-config/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../../../config/vitest-config/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../tea-adapter/tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "../tea-interface/tsconfig.build.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
15
frontend/packages/arch/tea/tsconfig.json
Normal file
15
frontend/packages/arch/tea/tsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.build.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.misc.json"
|
||||
}
|
||||
],
|
||||
"exclude": ["**/*"]
|
||||
}
|
||||
21
frontend/packages/arch/tea/tsconfig.misc.json
Normal file
21
frontend/packages/arch/tea/tsconfig.misc.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "@coze-arch/ts-config/tsconfig.web.json",
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"include": ["__tests__", "stories", "vitest.config.ts", "tailwind.config.ts"],
|
||||
"exclude": ["./dist"],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.build.json"
|
||||
}
|
||||
],
|
||||
"compilerOptions": {
|
||||
"rootDir": "./",
|
||||
"outDir": "./dist",
|
||||
"types": ["vitest/globals"],
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"paths": {
|
||||
"byted-tea-sdk": ["./node_modules/byted-tea-sdk"]
|
||||
}
|
||||
}
|
||||
}
|
||||
22
frontend/packages/arch/tea/vitest.config.ts
Normal file
22
frontend/packages/arch/tea/vitest.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 { defineConfig } from '@coze-arch/vitest-config';
|
||||
|
||||
export default defineConfig({
|
||||
dirname: __dirname,
|
||||
preset: 'web',
|
||||
});
|
||||
Reference in New Issue
Block a user