feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
const { defineConfig } = require('@coze-arch/stylelint-config');
module.exports = defineConfig({
extends: [],
});

View File

@@ -0,0 +1,6 @@
# [🦀️ Rsbuild](https://rsbuild.dev/zh/guide/start/index) & React App
Web项目初始化模板已包含功能
* react + react-router
* slardar
* less(module), [tailwindcss](https://tailwindcss.com/docs)
* vitest

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -0,0 +1,17 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json",
"operationSettings": [
{
"operationName": "build",
"outputFolderNames": ["output"]
},
{
"operationName": "test:cov",
"outputFolderNames": ["coverage"]
},
{
"operationName": "ts-check",
"outputFolderNames": ["dist"]
}
]
}

View File

@@ -0,0 +1,6 @@
const { defineConfig } = require('@coze-arch/eslint-config');
module.exports = defineConfig({
preset: 'web',
packageRoot: __dirname,
});

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@coze-studio/app</title>
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@@ -0,0 +1,82 @@
{
"name": "@coze-studio/app",
"version": "0.0.1",
"private": true,
"description": "coze studio app",
"keywords": [],
"license": "Apache-2.0",
"author": "fanwenjie.fe@bytedance.com",
"maintainers": [],
"sideEffects": false,
"scripts": {
"build": "IS_OPEN_SOURCE=true rsbuild build",
"dev": "IS_OPEN_SOURCE=true CUSTOM_VERSION=release rsbuild dev",
"lint": "eslint ./ --cache --quiet",
"preview": "rsbuild preview",
"test": "vitest --run --passWithNoTests",
"test:cov": "vitest --run --passWithNoTests --coverage"
},
"dependencies": {
"@coze-agent-ide/agent-publish": "workspace:*",
"@coze-agent-ide/entry-adapter": "workspace:*",
"@coze-agent-ide/layout-adapter": "workspace:*",
"@coze-arch/bot-flags": "workspace:*",
"@coze-arch/bot-md-box-adapter": "workspace:*",
"@coze-arch/coze-design": "0.0.6-alpha.346d77",
"@coze-arch/foundation-sdk": "workspace:*",
"@coze-arch/i18n": "workspace:*",
"@coze-arch/logger": "workspace:*",
"@coze-arch/web-context": "workspace:*",
"@coze-foundation/account-adapter": "workspace:*",
"@coze-foundation/account-ui-adapter": "workspace:*",
"@coze-foundation/foundation-sdk": "workspace:*",
"@coze-foundation/global": "workspace:*",
"@coze-foundation/global-adapter": "workspace:*",
"@coze-foundation/layout": "workspace:*",
"@coze-foundation/space-ui-adapter": "workspace:*",
"@coze-foundation/space-ui-base": "workspace:*",
"@coze-project-ide/main": "workspace:*",
"@coze-studio/api-schema": "workspace:*",
"@coze-studio/default-slardar": "workspace:*",
"@coze-studio/project-publish": "workspace:*",
"@coze-studio/workspace-adapter": "workspace:*",
"@coze-studio/workspace-base": "workspace:*",
"@coze-workflow/playground-adapter": "workspace:*",
"path-browserify": "^1.0.1",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-error-boundary": "^4.0.9",
"react-router-dom": "^6.11.1",
"zustand": "^4.4.7"
},
"devDependencies": {
"@coze-arch/bot-env": "workspace:*",
"@coze-arch/bot-typings": "workspace:*",
"@coze-arch/eslint-config": "workspace:*",
"@coze-arch/import-watch-loader": "workspace:*",
"@coze-arch/pkg-root-webpack-plugin": "workspace:*",
"@coze-arch/postcss-config": "workspace:*",
"@coze-arch/responsive-kit": "workspace:*",
"@coze-arch/rsbuild-config": "workspace:*",
"@coze-arch/semi-theme-hand01": "0.0.6-alpha.346d77",
"@coze-arch/stylelint-config": "workspace:*",
"@coze-arch/tailwind-config": "workspace:*",
"@coze-arch/ts-config": "workspace:*",
"@coze-arch/vitest-config": "workspace:*",
"@coze-community/explore": "workspace:*",
"@coze-studio/bot-plugin-store": "workspace:*",
"@rsbuild/core": "~1.1.0",
"@rsdoctor/rspack-plugin": "1.0.0-rc.0",
"@rspack/core": ">=0.7",
"@types/node": "18.18.9",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@vitest/coverage-v8": "~3.0.5",
"sucrase": "^3.32.0",
"tailwindcss": "~3.3.3",
"typescript": "~5.8.2",
"vitest": "~3.0.5",
"webpack": "~5.91.0"
}
}

View File

@@ -0,0 +1 @@
module.exports = require('@coze-arch/postcss-config');

View File

@@ -0,0 +1,122 @@
/*
* 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 path from 'path';
import { defineConfig } from '@coze-arch/rsbuild-config';
import { GLOBAL_ENVS } from '@coze-arch/bot-env';
const API_PROXY_TARGET = `http://localhost:${process.env.WEB_SERVER_PORT || 8888}/`;
const mergedConfig = defineConfig({
server: {
strictPort: true,
proxy: [
{
context: ['/api'],
target: API_PROXY_TARGET,
secure: false,
changeOrigin: true,
},
],
},
html: {
title: '扣子 Studio',
favicon: './assets/favicon.png',
template: './index.html',
crossorigin: 'anonymous',
},
tools: {
postcss: (opts, { addPlugins }) => {
// eslint-disable-next-line @typescript-eslint/no-require-imports
addPlugins([require('tailwindcss')('./tailwind.config.ts')]);
},
rspack(config, { appendPlugins, addRules, mergeConfig }) {
addRules([
{
test: /\.(css|less|jsx|tsx|ts|js)/,
exclude: [
new RegExp('apps/coze-studio/src/index.css'),
/node_modules/,
new RegExp('packages/arch/i18n'),
],
use: '@coze-arch/import-watch-loader',
},
]);
return mergeConfig(config, {
module: {
parser: {
javascript: {
exportsPresence: false,
},
},
},
resolve: {
fallback: {
path: require.resolve('path-browserify'),
},
},
watchOptions: {
poll: true,
},
ignoreWarnings: [
/Critical dependency: the request of a dependency is an expression/,
warning => true,
],
});
},
},
source: {
define: {
'process.env.IS_REACT18': JSON.stringify(true),
// arcosite editor sdk 内部使用
'process.env.ARCOSITE_SDK_REGION': JSON.stringify(
GLOBAL_ENVS.IS_OVERSEA ? 'VA' : 'CN',
),
'process.env.ARCOSITE_SDK_SCOPE': JSON.stringify(
GLOBAL_ENVS.IS_RELEASE_VERSION ? 'PUBLIC' : 'INSIDE',
),
'process.env.TARO_PLATFORM': JSON.stringify('web'),
'process.env.SUPPORT_TARO_POLYFILL': JSON.stringify('disabled'),
'process.env.RUNTIME_ENTRY': JSON.stringify('@coze-dev/runtime'),
'process.env.TARO_ENV': JSON.stringify('h5'),
ENABLE_COVERAGE: JSON.stringify(false),
},
include: [
path.resolve(__dirname, '../../packages'),
path.resolve(__dirname, '../../infra/flags-devtool'),
// 以下几个包包含未降级的 ES 2022 语法private methods需要参与打包
/\/node_modules\/(marked|@dagrejs|@tanstack)\//,
],
alias: {
// TODO: fixme late开源之前需要干掉这个
'@slardar/web/client': '@slardar/web/cn',
'@coze-arch/foundation-sdk': require.resolve(
'@coze-foundation/foundation-sdk',
),
'react-router-dom': require.resolve('react-router-dom'),
},
/**
* support inversify @injectable() and @inject decorators
*/
decorators: {
version: 'legacy',
},
},
});
export default mergedConfig;

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -ex
# Switch cwd to the project folder
cd $(dirname "$0")
# Import the utilities functions
source ../../scripts/scm_base.sh
# Clean up the build directory
rm -rf dist
rm -rf "${ROOT_DIR}"/output
# Prepare
prepare_environment
# Install the dependencies
CUSTOM_SKIP_POST_INSTALL=true rushx --debug install -t . -t tag:phase-prebuild -t @coze-arch/rush-x -t tag:rush-tools
NO_STARLING=true bash $ROOT_DIR/scripts/post-rush-install.sh
NODE_OPTIONS='--max-old-space-size=8192' NODE_ENV=production npm run build
mkdir -p ${ROOT_DIR}/output
mkdir -p ${ROOT_DIR}/output_resource/static
cp -r ./dist/index.html ${ROOT_DIR}/output/
cp -r ./dist/static/* ${ROOT_DIR}/output_resource/static

View File

@@ -0,0 +1,3 @@
require('sucrase/register');
require('./scripts/serve.ts');

View File

@@ -0,0 +1,36 @@
/*
* 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 { RouterProvider } from 'react-router-dom';
import { Suspense } from 'react';
import { Spin } from '@coze-arch/coze-design';
import { router } from './routes';
export function App() {
return (
<Suspense
fallback={
<div className="w-full h-full flex items-center justify-center">
<Spin spinning style={{ height: '100%', width: '100%' }} />
</div>
}
>
<RouterProvider router={router} fallbackElement={<div>loading...</div>} />
</Suspense>
);
}

View File

@@ -0,0 +1,19 @@
/*
* 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="@rsbuild/core/types" />
declare const IS_OVERSEA: boolean;

View File

@@ -0,0 +1,234 @@
// !NOTE: 全局样式代码,不要随便修改!!!
html,
body {
width: 100%;
min-width: 1200px;
height: 100%;
min-height: 600px;
margin: 0;
padding: 0;
// 原来的版本是 冬青(Hiragino) > 苹方;但是项目里大量使用 semi 组件自带 font family没有暴露出来
// 这里修复一下顺序 PingFang > Hiragino
font-family: 'PingFang SC', 'Noto Sans SC', sans-serif;
background: linear-gradient(to bottom, transparent, #fff) #eceeef;
}
body {
// @flowpd/card-web-runtime 依赖 arco design
// arco-design 的 reset css, 搞了 body line-height 1.5
// 没设置 line-height 的元素可能会因为按需加载 arco 产生瞬时抖动
line-height: 1.5;
}
#root {
width: 100%;
height: 100%;
}
p {
margin: 0;
}
* {
box-sizing: border-box;
font-family: 'PingFang SC', 'Noto Sans SC', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// 去除 safari 浏览器按钮 focus 状态的蓝色框
a:focus,
input:focus,
p:focus,
li:focus,
div:focus,
svg:focus,
a:focus-visible,
input:focus-visible,
p:focus-visible,
li:focus-visible,
div:focus-visible {
outline: none;
-webkit-tap-highlight-color: rgb(0 0 0 / 0% / 0);
}
// TODO: 底层库依赖了这个 class暂时不移除
.operation-admin-base-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
height: 56px;
line-height: 56px;
background-color: #fff;
border-bottom: 1px solid rgb(46 50 56 / 5%);
.semi-tabs-content {
display: none;
}
}
.operation-admin-base-header-title {
display: flex;
align-items: center;
margin: 12px 24px;
font-size: 18px;
line-height: 24px;
color: var(--light-color-grey-grey-9, #1c1f23);
* {
user-select: none;
}
.universe-icon {
margin-right: 6px;
}
}
.operation-admin-base-header-user-avatar {
width: 24px;
height: 24px;
}
.operation-admin-base-header-avatar-method-block {
display: flex;
justify-content: center;
width: 100%;
padding: 8px;
}
.operation-admin-base-header-avatar-sign-out {
text-align: center;
}
.operation-admin-base-aside {
border-right: 1px solid rgb(229 231 235);
// 非本期改动但阻塞了ci的构建
/* stylelint-disable-next-line selector-class-pattern */
.ud__layout__sider-trigger {
border-right: 1px solid rgb(229 231 235);
}
}
.operation-admin-base-app {
height: 100%;
}
.operation-admin-base-module-content {
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.operation-admin-base-module-content[app-name='playground_prompt'] {
background-color: #fff;
}
.operation-admin-base-module-content[app-name='build_bot'] {
background-color: #fff;
}
.operation-admin-base-module-content[app-name='discover'] {
background-color: #fff;
}
.operation-admin-base-404 {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.no-permission {
height: calc(100vh - 64px);
border: 20px solid #f2f3f5;
}
.error-wrapper {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
.operation-admin-no-permission {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.operation-admin-base-main-content {
overflow: hidden;
}
.operation-admin-base-header-name {
padding: 8px;
padding-bottom: 0;
font-size: 14px;
font-weight: bold;
line-height: 22px;
}
.bp5-overflow-list {
display: flex;
flex-wrap: nowrap;
min-width: 0;
}
.bp5-overflow-list-spacer {
flex-shrink: 1;
width: 1px;
}
// styled-scrollbar 给需要滚动的元素添加的滚动条样式 增加这个 class 即可
.styled-scrollbar::-webkit-scrollbar-thumb {
background-color: rgba(31, 35, 41, 30%);
background-clip: padding-box;
border: 2px solid transparent;
border-radius: 9999px;
transition: background 0.2s cubic-bezier(0.34, 0.69, 0.1, 1);
}
.styled-scrollbar::-webkit-scrollbar {
display: inline-block;
width: 11px;
height: 11px;
background-color: transparent;
}
.styled-scrollbar::-webkit-scrollbar-thumb:hover {
background-color: rgba(31, 35, 41, 60%);
}
.styled-scrollbar::-webkit-scrollbar:hover {
width: 11px;
height: 11px;
}
.styled-scrollbar::-webkit-scrollbar-button {
display: none;
}
.styled-scrollbar::-webkit-scrollbar-track {
background-color: transparent;
}
.styled-scrollbar::-webkit-scrollbar-corner {
background-color: transparent;
}

View File

@@ -0,0 +1,8 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
#root {
width: 100%;
height: 100%;
}

View File

@@ -0,0 +1,54 @@
/*
* 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 { createRoot } from 'react-dom/client';
import { initI18nInstance } from '@coze-arch/i18n/raw';
import { dynamicImportMdBoxStyle } from '@coze-arch/bot-md-box-adapter/style';
import { pullFeatureFlags, type FEATURE_FLAGS } from '@coze-arch/bot-flags';
import { App } from './app';
import './global.less';
import './index.less';
const initFlags = () => {
pullFeatureFlags({
timeout: 1000 * 4,
fetchFeatureGating: () => Promise.resolve({} as unknown as FEATURE_FLAGS),
});
};
const main = () => {
// 初始化功能开关的值
initFlags();
// 初始化i18n
initI18nInstance({
lng: (localStorage.getItem('i18next') ?? (IS_OVERSEA ? 'en' : 'zh-CN')) as
| 'en'
| 'zh-CN',
});
// 动态导入mdbox 样式
dynamicImportMdBoxStyle();
const $root = document.getElementById('root');
if (!$root) {
throw new Error('root element not found');
}
const root = createRoot($root);
root.render(<App />);
};
main();

View File

@@ -0,0 +1,23 @@
/*
* 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 { GlobalLayout, useAppInit } from '@coze-foundation/global-adapter';
export const Layout = () => {
useAppInit();
return <GlobalLayout />;
};

View 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.
*/
import { useParams } from 'react-router-dom';
import { Develop } from '@coze-studio/workspace-adapter/develop';
const Page = () => {
const { space_id } = useParams();
return space_id ? <Develop spaceId={space_id} /> : null;
};
export default Page;

View 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.
*/
import { useEffect } from 'react';
const DocsRedirect = () => {
useEffect(() => {
location.href = `https://www.coze.cn${location.pathname}`;
}, []);
return null;
};
export default DocsRedirect;

View File

@@ -0,0 +1,66 @@
/*
* 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 { Navigate, type RouteObject } from 'react-router-dom';
import { lazy } from 'react';
import { BaseEnum } from '@coze-arch/web-context';
const subMenu = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.ExploreSubMenu,
})),
);
const TemplatePage = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.TemplatePage,
})),
);
const PluginPage = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.PluginPage,
})),
);
export const exploreRouter: RouteObject = {
path: 'explore',
Component: null,
loader: () => ({
hasSider: true,
requireAuth: true,
subMenu,
menuKey: BaseEnum.Explore,
}),
children: [
{
index: true,
element: <Navigate to="plugin" replace />,
},
{
path: 'plugin',
element: <PluginPage />,
loader: () => ({
type: 'plugin',
}),
},
{
path: 'template',
element: <TemplatePage />,
loader: () => ({
type: 'template',
}),
},
],
};

View 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.
*/
import { useParams } from 'react-router-dom';
import { LibraryPage } from '@coze-studio/workspace-adapter/library';
const Page = () => {
const { space_id } = useParams();
return space_id ? <LibraryPage spaceId={space_id} /> : null;
};
export default Page;

View File

@@ -0,0 +1,40 @@
/*
* 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 { Outlet, useNavigate, useParams } from 'react-router-dom';
import { pluginResourceNavigate } from '@coze-studio/workspace-base';
import { BotPluginStoreProvider } from '@coze-studio/bot-plugin-store';
const SpaceLayout = () => {
const { plugin_id, space_id } = useParams();
const navBase = `/space/${space_id}`;
const navigate = useNavigate();
if (!plugin_id || !space_id) {
throw Error('[plugin render error]: need plugin id and space id');
}
return (
<BotPluginStoreProvider
pluginID={plugin_id}
spaceID={space_id}
resourceNavigate={pluginResourceNavigate(navBase, plugin_id, navigate)}
>
<Outlet />
</BotPluginStoreProvider>
);
};
export default SpaceLayout;

View File

@@ -0,0 +1,35 @@
/*
* 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 { useParams } from 'react-router-dom';
import { useEffect } from 'react';
import { Plugin } from '@coze-studio/workspace-base';
import { usePluginStoreInstance } from '@coze-studio/bot-plugin-store';
const Page = () => {
const { plugin_id, space_id } = useParams();
const pluginStore = usePluginStoreInstance();
if (!plugin_id || !space_id) {
throw Error('[plugin render error]: need plugin id and space id');
}
useEffect(() => {
pluginStore?.getState().init();
}, []);
return <Plugin />;
};
export default Page;

View File

@@ -0,0 +1,34 @@
/*
* 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 { useParams } from 'react-router-dom';
import { useEffect } from 'react';
import { Tool } from '@coze-studio/workspace-base';
import { usePluginStoreInstance } from '@coze-studio/bot-plugin-store';
const Page = () => {
const { plugin_id, space_id, tool_id } = useParams();
const pluginStore = usePluginStoreInstance();
if (!plugin_id || !space_id || !tool_id) {
throw Error('[plugin render error]: need plugin id and space id');
}
useEffect(() => {
pluginStore?.getState().init();
}, []);
return <Tool toolID={tool_id} />;
};
export default Page;

View File

@@ -0,0 +1,38 @@
/*
* 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 { useParams } from 'react-router-dom';
import { MocksetDetail } from '@coze-studio/workspace-base';
const Page = () => {
const { plugin_id, space_id, tool_id, mock_set_id } = useParams();
if (!plugin_id || !space_id || !tool_id || !mock_set_id) {
throw Error('[plugin render error]: need plugin id and space id');
}
return (
<MocksetDetail
pluginID={plugin_id}
toolID={tool_id}
spaceID={space_id}
mocksetID={mock_set_id}
/>
);
};
export default Page;

View File

@@ -0,0 +1,36 @@
/*
* 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 { useParams } from 'react-router-dom';
import { useEffect } from 'react';
import { MocksetList } from '@coze-studio/workspace-base';
import { usePluginStoreInstance } from '@coze-studio/bot-plugin-store';
const Page = () => {
const { plugin_id, space_id, tool_id } = useParams();
const pluginStore = usePluginStoreInstance();
if (!plugin_id || !space_id || !tool_id) {
throw Error('[plugin render error]: need plugin id and space id');
}
useEffect(() => {
pluginStore?.getState().init();
}, []);
return (
<MocksetList pluginID={plugin_id} toolID={tool_id} spaceID={space_id} />
);
};
export default Page;

View 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.
*/
import { useEffect } from 'react';
const Redirect = () => {
useEffect(() => {
location.href = `https://www.coze.cn${location.pathname}`;
}, []);
return null;
};
export default Redirect;

View File

@@ -0,0 +1,312 @@
/*
* 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 { createBrowserRouter, Navigate } from 'react-router-dom';
import { lazy } from 'react';
import { SpaceSubModuleEnum } from '@coze-foundation/space-ui-adapter';
import { GlobalError } from '@coze-foundation/layout';
import { BaseEnum } from '@coze-arch/web-context';
import { exploreRouter } from './pages/explore';
import { Layout } from './layout';
const subMenu = lazy(() =>
import('@coze-foundation/space-ui-adapter').then(exps => ({
default: exps.WorkspaceSubMenu,
})),
);
const SpaceLayout = lazy(() =>
import('@coze-foundation/space-ui-adapter').then(exps => ({
default: exps.SpaceLayout,
})),
);
const SpaceIdLayout = lazy(() =>
import('@coze-foundation/space-ui-base').then(exps => ({
default: exps.SpaceIdLayout,
})),
);
const KnowledgePreview = lazy(() =>
import('@coze-studio/workspace-base/knowledge-preview').then(exps => ({
default: exps.KnowledgePreviewPage,
})),
);
const KnowledgeUpload = lazy(() =>
import('@coze-studio/workspace-base/knowledge-upload').then(exps => ({
default: exps.KnowledgeUploadPage,
})),
);
const DatabaseDetail = lazy(() =>
import('@coze-studio/workspace-base').then(exps => ({
default: exps.DatabaseDetailPage,
})),
);
const AgentIDELayout = lazy(() => import('@coze-agent-ide/layout-adapter'));
const AgentIDE = lazy(() =>
import('@coze-agent-ide/entry-adapter').then(res => ({
default: res.BotEditor,
})),
);
const IDELayout = lazy(() =>
import('@coze-project-ide/main').then(exps => ({
default: exps.IDELayout,
})),
);
const IDEPublish = lazy(() =>
import('@coze-studio/project-publish').then(exps => ({
default: exps.ProjectPublish,
})),
);
const Develop = lazy(() => import('./pages/develop'));
const Library = lazy(() => import('./pages/library'));
const WorkflowPage = lazy(() =>
import('@coze-workflow/playground-adapter').then(res => ({
default: res.WorkflowPage,
})),
);
const PluginPageLayout = lazy(() => import('./pages/plugin/layout'));
const PluginPage = lazy(() => import('./pages/plugin/page'));
const PluginToolPage = lazy(() => import('./pages/plugin/tool/page'));
const PluginMocksetPage = lazy(
() => import('./pages/plugin/tool/plugin-mock-set/page'),
);
const PluginMocksetDetailPage = lazy(
() => import('./pages/plugin/tool/plugin-mock-set/detail/page'),
);
const LoginPage = lazy(() =>
import('@coze-foundation/account-ui-adapter').then(res => ({
default: res.LoginPage,
})),
);
const AgentPublishPage = lazy(() =>
import('@coze-agent-ide/agent-publish').then(exps => ({
default: exps.AgentPublishPage,
})),
);
const DocsRedirect = lazy(() => import('./pages/docs'));
export const router: ReturnType<typeof createBrowserRouter> =
createBrowserRouter([
{
path: '/open/docs/*',
Component: DocsRedirect,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
{
path: '/docs/*',
Component: DocsRedirect,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
{
path: '/',
Component: Layout,
errorElement: <GlobalError />,
children: [
{
index: true,
element: <Navigate to="/space" replace />,
},
exploreRouter,
{
path: 'sign',
Component: LoginPage,
errorElement: <GlobalError />,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
{
path: 'space',
Component: SpaceLayout,
loader: () => ({
hasSider: true,
requireAuth: true,
subMenu,
menuKey: BaseEnum.Space,
}),
children: [
{
path: ':space_id',
Component: SpaceIdLayout,
children: [
{
index: true,
element: <Navigate to="develop" replace />,
},
{
path: 'develop',
Component: Develop,
loader: () => ({
subMenuKey: SpaceSubModuleEnum.DEVELOP,
}),
},
{
path: 'project-ide/:project_id/publish',
loader: () => ({
hasSider: false,
}),
Component: IDEPublish,
},
{
path: 'project-ide/:project_id/*',
Component: IDELayout,
loader: () => ({
hasSider: false,
}),
},
{
path: 'library',
Component: Library,
loader: () => ({
subMenuKey: SpaceSubModuleEnum.LIBRARY,
}),
},
{
path: 'project-ide/:project_id/*',
Component: IDELayout,
loader: () => ({
hasSider: false,
}),
},
{
path: 'knowledge',
children: [
{
path: ':dataset_id',
element: <KnowledgePreview />,
},
{
path: ':dataset_id/upload',
element: <KnowledgeUpload />,
},
],
loader: () => ({
pageModeByQuery: true,
}),
},
{
path: 'database',
children: [
{
path: ':table_id',
element: <DatabaseDetail />,
},
],
loader: () => ({
showMobileTips: true,
pageModeByQuery: true,
}),
},
{
path: 'bot/:bot_id',
Component: AgentIDELayout,
children: [
{
index: true,
Component: AgentIDE,
},
{
path: 'publish',
children: [
{
index: true,
Component: AgentPublishPage,
loader: () => ({
hasSider: false,
requireBotEditorInit: false,
pageName: 'publish',
}),
},
],
},
],
loader: () => ({
hasSider: false,
showMobileTips: true,
requireBotEditorInit: true,
pageName: 'bot',
}),
},
{
path: 'plugin/:plugin_id',
Component: PluginPageLayout,
children: [
{
index: true,
Component: PluginPage,
},
{
path: 'tool/:tool_id',
children: [
{
index: true,
Component: PluginToolPage,
},
{
path: 'plugin-mock-set',
Component: PluginMocksetPage,
children: [
{
path: ':mock_set_id',
children: [
{
index: true,
Component: PluginMocksetDetailPage,
},
],
},
],
},
],
},
],
},
],
},
],
},
{
path: 'work_flow',
Component: WorkflowPage,
loader: () => ({
hasSider: false,
requireAuth: true,
}),
},
],
},
]);

View File

@@ -0,0 +1,145 @@
/*
* 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 { lazy } from 'react';
// 登录页面
export const LoginPage = lazy(() =>
import('@coze-foundation/account-ui-adapter').then(res => ({
default: res.LoginPage,
})),
);
// 文档页面
export const Redirect = lazy(() => import('../pages/redirect'));
// 工作空间侧边栏组件
export const spaceSubMenu = lazy(() =>
import('@coze-foundation/space-ui-adapter').then(exps => ({
default: exps.WorkspaceSubMenu,
})),
);
// 工作空间布局组件
export const SpaceLayout = lazy(() =>
import('@coze-foundation/space-ui-adapter').then(exps => ({
default: exps.SpaceLayout,
})),
);
// 某个具体的工作空间布局组件
export const SpaceIdLayout = lazy(() =>
import('@coze-foundation/space-ui-base').then(exps => ({
default: exps.SpaceIdLayout,
})),
);
// 项目开发页面
export const Develop = lazy(() => import('../pages/develop'));
// 资源库页面
export const Library = lazy(() => import('../pages/library'));
// Agent IDE布局组件
export const AgentIDELayout = lazy(
() => import('@coze-agent-ide/layout-adapter'),
);
// Agent IDE页面
export const AgentIDE = lazy(() =>
import('@coze-agent-ide/entry-adapter').then(res => ({
default: res.BotEditor,
})),
);
// Agent IDE发布页面
export const AgentPublishPage = lazy(() =>
import('@coze-agent-ide/agent-publish').then(exps => ({
default: exps.AgentPublishPage,
})),
);
// Project IDE页面
export const ProjectIDE = lazy(() =>
import('@coze-project-ide/main').then(exps => ({
default: exps.IDELayout,
})),
);
// Project IDE发布页面
export const ProjectIDEPublish = lazy(() =>
import('@coze-studio/project-publish').then(exps => ({
default: exps.ProjectPublish,
})),
);
// 知识库预览页面
export const KnowledgePreview = lazy(() =>
import('@coze-studio/workspace-base/knowledge-preview').then(exps => ({
default: exps.KnowledgePreviewPage,
})),
);
// 知识库上传页面
export const KnowledgeUpload = lazy(() =>
import('@coze-studio/workspace-base/knowledge-upload').then(exps => ({
default: exps.KnowledgeUploadPage,
})),
);
// 数据库资源页面
export const DatabaseDetail = lazy(() =>
import('@coze-studio/workspace-base').then(exps => ({
default: exps.DatabaseDetailPage,
})),
);
// 工作流页面
export const WorkflowPage = lazy(() =>
import('@coze-workflow/playground-adapter').then(res => ({
default: res.WorkflowPage,
})),
);
// 插件资源页面布局组件
export const PluginLayout = lazy(() => import('../pages/plugin/layout'));
// 插件资源页面
export const PluginPage = lazy(() => import('../pages/plugin/page'));
// 插件工具页面
export const PluginToolPage = lazy(() => import('../pages/plugin/tool/page'));
// 探索体验页面二级导航组件
export const exploreSubMenu = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.ExploreSubMenu,
})),
);
// 模版页面
export const ExploreTemplatePage = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.TemplatePage,
})),
);
// 插件商店页面
export const ExplorePluginPage = lazy(() =>
import('@coze-community/explore').then(exps => ({
default: exps.PluginPage,
})),
);

View File

@@ -0,0 +1,286 @@
/*
* 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 { createBrowserRouter, Navigate } from 'react-router-dom';
import { SpaceSubModuleEnum } from '@coze-foundation/space-ui-adapter';
import { GlobalError } from '@coze-foundation/layout';
import { BaseEnum } from '@coze-arch/web-context';
import { Layout } from '../layout';
import {
LoginPage,
SpaceLayout,
SpaceIdLayout,
Develop,
AgentIDELayout,
AgentIDE,
AgentPublishPage,
Redirect,
spaceSubMenu,
exploreSubMenu,
WorkflowPage,
ProjectIDE,
ProjectIDEPublish,
Library,
PluginLayout,
PluginToolPage,
PluginPage,
KnowledgePreview,
KnowledgeUpload,
DatabaseDetail,
ExplorePluginPage,
ExploreTemplatePage,
} from './async-components';
export const router: ReturnType<typeof createBrowserRouter> =
createBrowserRouter([
// 文档路由
{
path: '/open/docs/*',
Component: Redirect,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
{
path: '/docs/*',
Component: Redirect,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
{
path: '/information/auth/success',
Component: Redirect,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
// 主应用路由
{
path: '/',
Component: Layout,
errorElement: <GlobalError />,
children: [
{
index: true,
element: <Navigate to="/space" replace />,
},
// 登录页路由
{
path: 'sign',
Component: LoginPage,
errorElement: <GlobalError />,
loader: () => ({
hasSider: false,
requireAuth: false,
}),
},
// 工作空间路由
{
path: 'space',
Component: SpaceLayout,
loader: () => ({
hasSider: true,
requireAuth: true,
subMenu: spaceSubMenu,
menuKey: BaseEnum.Space,
}),
children: [
{
path: ':space_id',
Component: SpaceIdLayout,
children: [
{
index: true,
element: <Navigate to="develop" replace />,
},
// 项目开发
{
path: 'develop',
Component: Develop,
loader: () => ({
subMenuKey: SpaceSubModuleEnum.DEVELOP,
}),
},
// Agent IDE
{
path: 'bot/:bot_id',
Component: AgentIDELayout,
children: [
{
index: true,
Component: AgentIDE,
},
{
path: 'publish',
children: [
{
index: true,
Component: AgentPublishPage,
loader: () => ({
hasSider: false,
requireBotEditorInit: false,
pageName: 'publish',
}),
},
],
},
],
loader: () => ({
hasSider: false,
showMobileTips: true,
requireBotEditorInit: true,
pageName: 'bot',
}),
},
// Project IDE
{
path: 'project-ide/:project_id/publish',
loader: () => ({
hasSider: false,
}),
Component: ProjectIDEPublish,
},
{
path: 'project-ide/:project_id/*',
Component: ProjectIDE,
loader: () => ({
hasSider: false,
}),
},
// 资源库
{
path: 'library',
Component: Library,
loader: () => ({
subMenuKey: SpaceSubModuleEnum.LIBRARY,
}),
},
// 知识库资源
{
path: 'knowledge',
children: [
{
path: ':dataset_id',
element: <KnowledgePreview />,
},
{
path: ':dataset_id/upload',
element: <KnowledgeUpload />,
},
],
loader: () => ({
pageModeByQuery: true,
}),
},
// 数据库资源
{
path: 'database',
children: [
{
path: ':table_id',
element: <DatabaseDetail />,
},
],
loader: () => ({
showMobileTips: true,
pageModeByQuery: true,
}),
},
// 插件资源
{
path: 'plugin/:plugin_id',
Component: PluginLayout,
children: [
{
index: true,
Component: PluginPage,
},
{
path: 'tool/:tool_id',
children: [
{
index: true,
Component: PluginToolPage,
},
],
},
],
},
],
},
],
},
// 工作流路由
{
path: 'work_flow',
Component: WorkflowPage,
loader: () => ({
hasSider: false,
requireAuth: true,
}),
},
// 探索
{
path: 'explore',
Component: null,
loader: () => ({
hasSider: true,
requireAuth: true,
subMenu: exploreSubMenu,
menuKey: BaseEnum.Explore,
}),
children: [
{
index: true,
element: <Navigate to="plugin" replace />,
},
// 插件商店
{
path: 'plugin',
element: <ExplorePluginPage />,
loader: () => ({
type: 'plugin',
}),
},
// 模版
{
path: 'template',
element: <ExploreTemplatePage />,
loader: () => ({
type: 'template',
}),
},
],
},
],
},
]);

View File

@@ -0,0 +1,54 @@
/*
* 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 type { Config } from 'tailwindcss';
import {
designTokenToTailwindConfig,
getTailwindContents,
} from '@coze-arch/tailwind-config/design-token';
import json from '@coze-arch/semi-theme-hand01/raw.json';
import { SCREENS_TOKENS } from '@coze-arch/responsive-kit/constant';
const contents = getTailwindContents('@coze-studio/app');
console.log(`Got ${contents.length} contents for tailwind`);
export default {
content: contents,
// safelist的内容可以允许动态生成tailwind className
safelist: [
{
pattern: /(gap-|grid-).+/,
variants: ['sm', 'md', 'lg', 'xl', '2xl'],
},
],
important: '',
// eslint-disable-next-line @typescript-eslint/no-require-imports
presets: [require('@coze-arch/tailwind-config')],
theme: {
screens: {
mobile: { max: '1200px' },
},
extend: {
screens: SCREENS_TOKENS,
...designTokenToTailwindConfig(json),
},
},
corePlugins: {
preflight: false, // 关闭@tailwind base默认样式避免对现有样式影响
},
// eslint-disable-next-line @typescript-eslint/no-require-imports
plugins: [require('@coze-arch/tailwind-config/coze')],
} satisfies Config;

View File

@@ -0,0 +1,133 @@
{
"extends": "@coze-arch/ts-config/tsconfig.web.json",
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"jsx": "react-jsx",
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"isolatedModules": true,
"target": "ES2020",
"moduleResolution": "bundler",
"tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo"
},
"include": ["src"],
"exclude": ["node_modules", "dist"],
"references": [
{
"path": "../../config/eslint-config/tsconfig.build.json"
},
{
"path": "../../config/postcss-config/tsconfig.build.json"
},
{
"path": "../../config/rsbuild-config/tsconfig.build.json"
},
{
"path": "../../config/stylelint-config/tsconfig.build.json"
},
{
"path": "../../config/tailwind-config/tsconfig.build.json"
},
{
"path": "../../config/ts-config/tsconfig.build.json"
},
{
"path": "../../config/vitest-config/tsconfig.build.json"
},
{
"path": "../../infra/plugins/import-watch-loader/tsconfig.build.json"
},
{
"path": "../../infra/plugins/pkg-root-webpack-plugin/tsconfig.build.json"
},
{
"path": "../../packages/agent-ide/agent-publish/tsconfig.build.json"
},
{
"path": "../../packages/agent-ide/entry-adapter/tsconfig.build.json"
},
{
"path": "../../packages/agent-ide/layout-adapter/tsconfig.build.json"
},
{
"path": "../../packages/arch/api-schema/tsconfig.build.json"
},
{
"path": "../../packages/arch/bot-env/tsconfig.build.json"
},
{
"path": "../../packages/arch/bot-flags/tsconfig.build.json"
},
{
"path": "../../packages/arch/bot-md-box-adapter/tsconfig.build.json"
},
{
"path": "../../packages/arch/bot-typings/tsconfig.build.json"
},
{
"path": "../../packages/arch/default-slardar/tsconfig.build.json"
},
{
"path": "../../packages/arch/foundation-sdk/tsconfig.build.json"
},
{
"path": "../../packages/arch/i18n/tsconfig.build.json"
},
{
"path": "../../packages/arch/logger/tsconfig.build.json"
},
{
"path": "../../packages/arch/responsive-kit/tsconfig.build.json"
},
{
"path": "../../packages/arch/web-context/tsconfig.build.json"
},
{
"path": "../../packages/community/explore/tsconfig.build.json"
},
{
"path": "../../packages/foundation/account-adapter/tsconfig.build.json"
},
{
"path": "../../packages/foundation/account-ui-adapter/tsconfig.build.json"
},
{
"path": "../../packages/foundation/foundation-sdk/tsconfig.build.json"
},
{
"path": "../../packages/foundation/global-adapter/tsconfig.build.json"
},
{
"path": "../../packages/foundation/global/tsconfig.build.json"
},
{
"path": "../../packages/foundation/layout/tsconfig.build.json"
},
{
"path": "../../packages/foundation/space-ui-adapter/tsconfig.build.json"
},
{
"path": "../../packages/foundation/space-ui-base/tsconfig.build.json"
},
{
"path": "../../packages/project-ide/main/tsconfig.build.json"
},
{
"path": "../../packages/studio/stores/bot-plugin/tsconfig.build.json"
},
{
"path": "../../packages/studio/workspace/entry-adapter/tsconfig.build.json"
},
{
"path": "../../packages/studio/workspace/entry-base/tsconfig.build.json"
},
{
"path": "../../packages/studio/workspace/project-publish/tsconfig.build.json"
},
{
"path": "../../packages/workflow/adapter/playground/tsconfig.build.json"
}
]
}

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"exclude": ["**/*"],
"compilerOptions": {
"composite": true
},
"references": [
{
"path": "./tsconfig.build.json"
},
{
"path": "./tsconfig.misc.json"
}
]
}

View File

@@ -0,0 +1,27 @@
{
"extends": "@coze-arch/ts-config/tsconfig.web.json",
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"rootDir": "./",
"outDir": "./dist",
"jsx": "react-jsx",
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"target": "ES2020",
"moduleResolution": "bundler",
"types": ["vitest/globals", "node"]
},
"include": [
"__tests__",
"vitest.config.ts",
"tailwind.config.ts",
"rsbuild.config.ts",
"scripts/**/*.ts"
],
"exclude": ["./dist"],
"references": [
{
"path": "./tsconfig.build.json"
}
]
}

View 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',
});