diff --git a/common/_templates/_plugins/SelectTeamPlugin.ts b/common/_templates/_plugins/SelectTeamPlugin.ts index aafe21a4..b70d7ec3 100644 --- a/common/_templates/_plugins/SelectTeamPlugin.ts +++ b/common/_templates/_plugins/SelectTeamPlugin.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import type { IPlugin, IHooks, @@ -56,7 +56,7 @@ export default class SelectTeamPlugin implements IPlugin { projectFolderPrompt.default = (answers) => { // 文件夹名去除scope,如 @coze-arch/foo -> foo const folderDir = answers.packageName.split('/').slice(-1)[0]; - return `packages/${answers.team}/${folderDir}` + return `frontend/packages/${answers.team}/${folderDir}`; } }); } diff --git a/common/_templates/_plugins/SetDefaultAuthorPlugin.ts b/common/_templates/_plugins/SetDefaultAuthorPlugin.ts index b045701e..e0b5730a 100644 --- a/common/_templates/_plugins/SetDefaultAuthorPlugin.ts +++ b/common/_templates/_plugins/SetDefaultAuthorPlugin.ts @@ -13,8 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import type { IPlugin, IHooks, IPromptsHookParams } from 'rush-init-project-plugin'; + +import type { + IPlugin, + IHooks, + IPromptsHookParams, +} from 'rush-init-project-plugin'; // FIXME: // 按照 https://github.com/bytemate/rush-plugins/blob/main/rush-plugins/rush-init-project-plugin/docs/init_project_configuration.md // 一文的指引,无法正确 resolve 到对应模块,暂时没找到解决方案,故此处先用相对路径引用 @@ -24,27 +28,34 @@ import { exec } from './utils'; export default class SetDefaultAuthorPlugin implements IPlugin { private readonly logger = createLog({ - prefix: SetDefaultAuthorPlugin.name + prefix: SetDefaultAuthorPlugin.name, }); apply(hooks: IHooks): void { - hooks.prompts.tap(SetDefaultAuthorPlugin.name, async (prompts: IPromptsHookParams) => { - const prompAuthorEmail = prompts.promptQueue.find((r) => r.name === 'authorName'); - if (prompAuthorEmail) { - const userEmail = String(await exec(this.logger, 'git', ['config', '--get', 'user.email'])); - Object.assign(prompAuthorEmail, { - default() { - return userEmail; - }, - validate(author: string) { - return /@bytedance\.com$/.test(author); - } - }); + hooks.prompts.tap( + SetDefaultAuthorPlugin.name, + async (prompts: IPromptsHookParams) => { + const prompAuthorEmail = prompts.promptQueue.find( + r => r.name === 'authorName', + ); + if (prompAuthorEmail) { + const userEmail = String( + await exec(this.logger, 'git', ['config', '--get', 'user.email']), + ); + Object.assign(prompAuthorEmail, { + default() { + return userEmail; + }, + validate(author: string) { + return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(author); + }, + }); - hooks.answers.tap("authorPrefix", (answers) => { - answers.authorPrefix = userEmail.split('@')?.[0] ?? ''; - }); - } - }); + hooks.answers.tap('authorPrefix', answers => { + answers.authorPrefix = userEmail.split('@')?.[0] ?? ''; + }); + } + }, + ); } } diff --git a/common/_templates/_plugins/SetFornaxChildAppPlugin.ts b/common/_templates/_plugins/SetFornaxChildAppPlugin.ts deleted file mode 100644 index 61dfd449..00000000 --- a/common/_templates/_plugins/SetFornaxChildAppPlugin.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 { IHooks, IPlugin, IPromptsHookParams } from 'rush-init-project-plugin'; -import { parseCommandLineArguments } from './utils/parse-args'; - -export default class FornaxPlugin implements IPlugin { - apply(hooks: IHooks): void { - hooks.answers.tap('FornaxPlugin', (answers) => { - if(answers.template === 'fornax-child-app') { - if(answers.packageName.startsWith('@flow-devops/fornax-')) { - answers.childAppName = answers.packageName.replace('@flow-devops/fornax-',''); - } else { - throw new Error('The initialization of field childAppName failed because the packageName is invalid. Please use "@flow-devops/fornax-xxx."'); - } - } - }) - } -} diff --git a/common/_templates/_plugins/ShowChatAreaTemplatePlugin.ts b/common/_templates/_plugins/ShowTemplatePlugin.ts similarity index 65% rename from common/_templates/_plugins/ShowChatAreaTemplatePlugin.ts rename to common/_templates/_plugins/ShowTemplatePlugin.ts index 38e0f341..c6b638eb 100644 --- a/common/_templates/_plugins/ShowChatAreaTemplatePlugin.ts +++ b/common/_templates/_plugins/ShowTemplatePlugin.ts @@ -13,29 +13,43 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import type { IPlugin, IHooks, ITemplatesHook, IPromptsHookParams } from 'rush-init-project-plugin'; + +import type { + IPlugin, + IHooks, + ITemplatesHook, + IPromptsHookParams, +} from 'rush-init-project-plugin'; // FIXME: // 按照 https://github.com/bytemate/rush-plugins/blob/main/rush-plugins/rush-init-project-plugin/docs/init_project_configuration.md // 一文的指引,无法正确 resolve 到对应模块,暂时没找到解决方案,故此处先用相对路径引用 // 未来需要调整为正常的 node_modules 引用方式 -import { getTemplatesFolder, getTemplateNameList } from '../../autoinstallers/plugins/node_modules/rush-init-project-plugin/lib/logic/templateFolder'; +import { + getTemplatesFolder, + getTemplateNameList, +} from '../../autoinstallers/plugins/node_modules/rush-init-project-plugin/lib/logic/templateFolder'; import { parseCommandLineArguments } from './utils/parse-args'; -export default class ShowChatAreaTemplatePlugin implements IPlugin { +export default class ShowTemplatePlugin implements IPlugin { apply(hooks: IHooks): void { const args = parseCommandLineArguments(); const answer = JSON.parse(args.answer ?? '{}'); - const isShowChatAreaTemplate = answer['showChatAreaTemplate']; + const isShowChatAreaTemplate = answer['showTemplate']; - hooks.templates.tap("ShowChatAreaTemplatePlugin", (templates: ITemplatesHook) => { + hooks.templates.tap('ShowTemplatePlugin', (templates: ITemplatesHook) => { const templateFolder: string = getTemplatesFolder(); - const templateNameList = getTemplateNameList(templateFolder) + const templateNameList = getTemplateNameList(templateFolder); - const filteredNormalTemplateNameList = templateNameList.filter(item => !item.templateFolder?.includes('chat-')); + const filteredNormalTemplateNameList = templateNameList.filter( + item => !item.templateFolder?.includes('chat-'), + ); - templates.templates.push(...(isShowChatAreaTemplate ? templateNameList : filteredNormalTemplateNameList )); + templates.templates.push( + ...(isShowChatAreaTemplate + ? templateNameList + : filteredNormalTemplateNameList), + ); }); } } diff --git a/common/_templates/_plugins/global.config.ts b/common/_templates/_plugins/global.config.ts index 53bbaa97..42701367 100644 --- a/common/_templates/_plugins/global.config.ts +++ b/common/_templates/_plugins/global.config.ts @@ -13,13 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import type { IConfig } from '../../autoinstallers/plugins/node_modules/rush-init-project-plugin'; -import ShowChatAreaTemplatePlugin from './ShowChatAreaTemplatePlugin'; -import SetFornaxChildAppPlugin from './SetFornaxChildAppPlugin'; +import ShowTemplatePlugin from './ShowTemplatePlugin'; const config: IConfig = { - plugins: [new ShowChatAreaTemplatePlugin(), new SetFornaxChildAppPlugin()] + plugins: [new ShowTemplatePlugin()], }; export default config; diff --git a/common/_templates/chat-plugin-readonly-standard/.storybook/main.js b/common/_templates/chat-plugin-readonly-standard/.storybook/main.js deleted file mode 100644 index d5c408cb..00000000 --- a/common/_templates/chat-plugin-readonly-standard/.storybook/main.js +++ /dev/null @@ -1,31 +0,0 @@ -import { mergeConfig } from 'vite'; -import svgr from 'vite-plugin-svgr'; - -/** @type { import('@storybook/react-vite').StorybookConfig } */ -const config = { - stories: ['../stories/**/*.mdx', '../stories/**/*.stories.tsx'], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - '@storybook/addon-onboarding', - '@storybook/addon-interactions', - ], - framework: { - name: '@storybook/react-vite', - options: {}, - }, - docs: { - autodocs: 'tag', - }, - viteFinal: config => - mergeConfig(config, { - plugins: [ - svgr({ - svgrOptions: { - native: false, - }, - }), - ], - }), -}; -export default config; diff --git a/common/_templates/chat-plugin-readonly-standard/.storybook/preview.js b/common/_templates/chat-plugin-readonly-standard/.storybook/preview.js deleted file mode 100644 index 1f07be96..00000000 --- a/common/_templates/chat-plugin-readonly-standard/.storybook/preview.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type { import('@storybook/react').Preview } */ -const preview = { - parameters: { - actions: { argTypesRegex: "^on[A-Z].*" }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/i, - }, - }, - }, -}; - -export default preview; diff --git a/common/_templates/chat-plugin-readonly-standard/.stylelintrc.js b/common/_templates/chat-plugin-readonly-standard/.stylelintrc.js deleted file mode 100644 index 11e8dc00..00000000 --- a/common/_templates/chat-plugin-readonly-standard/.stylelintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const { defineConfig } = require('@coze-arch/stylelint-config'); - -module.exports = defineConfig({ - extends: [], -}); diff --git a/common/_templates/chat-plugin-readonly-standard/README.md b/common/_templates/chat-plugin-readonly-standard/README.md deleted file mode 100644 index 01655db9..00000000 --- a/common/_templates/chat-plugin-readonly-standard/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# {{ packageName }} - -> Project template for react component with storybook. - -## Features - -- [x] eslint & ts -- [x] esm bundle -- [x] umd bundle -- [x] storybook - -## Commands - -- init: `rush update` -- dev: `npm run dev` -- build: `npm run build` diff --git a/common/_templates/chat-plugin-readonly-standard/__tests__/.gitkeep b/common/_templates/chat-plugin-readonly-standard/__tests__/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/common/_templates/chat-plugin-readonly-standard/config/rush-project.json b/common/_templates/chat-plugin-readonly-standard/config/rush-project.json deleted file mode 100644 index 1c23b14b..00000000 --- a/common/_templates/chat-plugin-readonly-standard/config/rush-project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "operationSettings": [ - { - "operationName": "test:cov", - "outputFolderNames": ["coverage"] - }, - { - "operationName": "ts-check", - "outputFolderNames": ["dist"] - } - ] -} diff --git a/common/_templates/chat-plugin-readonly-standard/eslint.config.js b/common/_templates/chat-plugin-readonly-standard/eslint.config.js deleted file mode 100644 index c272da55..00000000 --- a/common/_templates/chat-plugin-readonly-standard/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const { defineConfig } = require('@coze-arch/eslint-config'); - -module.exports = defineConfig({ - packageRoot: __dirname, - preset: 'web', - rules: {}, -}); diff --git a/common/_templates/chat-plugin-readonly-standard/init.config.ts b/common/_templates/chat-plugin-readonly-standard/init.config.ts deleted file mode 100644 index 12f3d3da..00000000 --- a/common/_templates/chat-plugin-readonly-standard/init.config.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 SelectTeamPlugin from '../_plugins/SelectTeamPlugin'; -import SetDefaultAuthorPlugin from '../_plugins/SetDefaultAuthorPlugin'; -import type { IConfig } from '../../autoinstallers/plugins/node_modules/rush-init-project-plugin'; - -const config: IConfig = { - plugins: [new SetDefaultAuthorPlugin(), new SelectTeamPlugin()], - defaultProjectConfiguration: { - tags:['level-3'] - } -}; - -export default config; diff --git a/common/_templates/chat-plugin-readonly-standard/package.json b/common/_templates/chat-plugin-readonly-standard/package.json deleted file mode 100644 index 1962fa66..00000000 --- a/common/_templates/chat-plugin-readonly-standard/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "{{ packageName }}", - "version": "0.0.1", - "description": "{{ description }}", - "license": "Apache-2.0", - "author": "{{ authorName }}", - "maintainers": [], - "main": "src/index.tsx", - "scripts": { - "build": "exit 0", - "dev": "storybook dev -p 6006", - "lint": "eslint ./ --cache", - "test": "vitest --run --passWithNoTests", - "test:cov": "npm run test -- --coverage" - }, - "dependencies": { - "@coze-common/chat-area": "workspace:*", - "classnames": "^2.3.2" - }, - "devDependencies": { - "@coze-arch/bot-typings": "workspace:*", - "@coze-arch/eslint-config": "workspace:*", - "@coze-arch/stylelint-config": "workspace:*", - "@coze-arch/ts-config": "workspace:*", - "@coze-arch/vitest-config": "workspace:*", - "@storybook/addon-essentials": "^7.6.7", - "@storybook/addon-interactions": "^7.6.7", - "@storybook/addon-links": "^7.6.7", - "@storybook/addon-onboarding": "^1.0.10", - "@storybook/blocks": "^7.6.7", - "@storybook/react": "^7.6.7", - "@storybook/react-vite": "^7.6.7", - "@storybook/test": "^7.6.7", - "@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", - "storybook": "^7.6.7", - "stylelint": "^15.11.0", - - "vite-plugin-svgr": "~3.3.0", - "vitest": "~3.0.5" - }, - "peerDependencies": { - "react": ">=18.2.0", - "react-dom": ">=18.2.0" - } -} diff --git a/common/_templates/chat-plugin-readonly-standard/src/custom-components/message-inner-addon-bottom/index.tsx b/common/_templates/chat-plugin-readonly-standard/src/custom-components/message-inner-addon-bottom/index.tsx deleted file mode 100644 index 29f95a10..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/custom-components/message-inner-addon-bottom/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 FC } from 'react'; - -type IProps = Record; - -export const BizMessageInnerAddonBottom: FC = () => ( -
hello world
-); diff --git a/common/_templates/chat-plugin-readonly-standard/src/index.ts b/common/_templates/chat-plugin-readonly-standard/src/index.ts deleted file mode 100644 index 6cebdb66..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 PluginRegistryEntry } from '@coze-common/chat-area'; - -import { type PluginBizContext } from './types/biz-context'; -import { BizPlugin } from './plugin'; - -// eslint-disable-next-line @typescript-eslint/naming-convention -- 插件命名大写开头符合预期 -export const BizPluginRegistry: PluginRegistryEntry = { - /** - * 贯穿插件生命周期、组件的上下文 - */ - createPluginBizContext() { - return {}; - }, - /** - * 插件本体 - */ - Plugin: BizPlugin, -}; diff --git a/common/_templates/chat-plugin-readonly-standard/src/plugin.ts b/common/_templates/chat-plugin-readonly-standard/src/plugin.ts deleted file mode 100644 index 13a8d161..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/plugin.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 { - PluginMode, - PluginName, - ReadonlyChatAreaPlugin, - createReadonlyLifeCycleServices, - createCustomComponents, -} from '@coze-common/chat-area'; - -import { type PluginBizContext } from './types/biz-context'; -import { bizLifeCycleServiceGenerator } from './services/life-cycle'; -import { BizMessageInnerAddonBottom } from './custom-components/message-inner-addon-bottom'; - -export class BizPlugin extends ReadonlyChatAreaPlugin { - /** - * 插件类型 - * PluginMode.Readonly = 只读模式 - * PluginMode.Writeable = 可写模式 - */ - public pluginMode = PluginMode.Readonly; - /** - * 插件名称 - * 请点 PluginName 里面去定义 - */ - public pluginName = PluginName.Demo; - - /** - * 生命周期服务 - */ - public lifeCycleServices = createReadonlyLifeCycleServices( - this, - bizLifeCycleServiceGenerator, - ); - - /** - * 自定义组件 - */ - public customComponents = createCustomComponents({ - MessageInnerBottomSlot: BizMessageInnerAddonBottom, - }); -} diff --git a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/app.ts b/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/app.ts deleted file mode 100644 index 3180a1b1..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/app.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 ReadonlyAppLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const appLifeCycleServiceGenerator: ReadonlyAppLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/command.ts b/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/command.ts deleted file mode 100644 index 472d3255..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/command.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 ReadonlyCommandLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const commandLifeCycleServiceGenerator: ReadonlyCommandLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/index.ts b/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/index.ts deleted file mode 100644 index 374fc4a8..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 ReadonlyLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; -import { renderLifeCycleServiceGenerator } from './render'; -import { messageLifeCycleServiceGenerator } from './message'; -import { commandLifeCycleServiceGenerator } from './command'; -import { appLifeCycleServiceGenerator } from './app'; - -export const bizLifeCycleServiceGenerator: ReadonlyLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({ - appLifeCycleService: appLifeCycleServiceGenerator(plugin), - messageLifeCycleService: messageLifeCycleServiceGenerator(plugin), - commandLifeCycleService: commandLifeCycleServiceGenerator(plugin), - renderLifeCycleService: renderLifeCycleServiceGenerator(plugin), -}); diff --git a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/message.ts b/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/message.ts deleted file mode 100644 index 149bb28b..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/message.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 ReadonlyMessageLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const messageLifeCycleServiceGenerator: ReadonlyMessageLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/render.ts b/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/render.ts deleted file mode 100644 index cdeecc50..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/services/life-cycle/render.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 ReadonlyRenderLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const renderLifeCycleServiceGenerator: ReadonlyRenderLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-readonly-standard/src/types/biz-context.ts b/common/_templates/chat-plugin-readonly-standard/src/types/biz-context.ts deleted file mode 100644 index 1135a4cc..00000000 --- a/common/_templates/chat-plugin-readonly-standard/src/types/biz-context.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -export type PluginBizContext = Record; diff --git a/common/_templates/chat-plugin-readonly-standard/stories/demo.stories.tsx b/common/_templates/chat-plugin-readonly-standard/stories/demo.stories.tsx deleted file mode 100644 index 05def05e..00000000 --- a/common/_templates/chat-plugin-readonly-standard/stories/demo.stories.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { DemoComponent } from '../src'; - -export default { - title: 'Example/Demo', - component: DemoComponent, - parameters: { - // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout - layout: 'centered', - }, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs - tags: ['autodocs'], - // More on argTypes: https://storybook.js.org/docs/api/argtypes - argTypes: {}, -}; - -// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args -export const Base = { - args: { - name: 'tecvan', - }, -}; diff --git a/common/_templates/chat-plugin-readonly-standard/stories/hello.mdx b/common/_templates/chat-plugin-readonly-standard/stories/hello.mdx deleted file mode 100644 index 66edadc6..00000000 --- a/common/_templates/chat-plugin-readonly-standard/stories/hello.mdx +++ /dev/null @@ -1,34 +0,0 @@ -import { Meta } from "@storybook/blocks"; - - - -
-
- # Hello world - - Hello world -
-
- - diff --git a/common/_templates/chat-plugin-readonly-standard/tsconfig.build.json b/common/_templates/chat-plugin-readonly-standard/tsconfig.build.json deleted file mode 100644 index fb4a73c2..00000000 --- a/common/_templates/chat-plugin-readonly-standard/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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", - "target": "ES2020", - "moduleResolution": "bundler" - }, - "include": ["src"], - "exclude": ["node_modules", "dist"] -} diff --git a/common/_templates/chat-plugin-readonly-standard/tsconfig.json b/common/_templates/chat-plugin-readonly-standard/tsconfig.json deleted file mode 100644 index b3951a30..00000000 --- a/common/_templates/chat-plugin-readonly-standard/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "exclude": ["**/*"], - "compilerOptions": { - "composite": true - }, - "references": [ - { - "path": "./tsconfig.build.json" - }, - { - "path": "./tsconfig.misc.json" - } - ] -} diff --git a/common/_templates/chat-plugin-readonly-standard/tsconfig.misc.json b/common/_templates/chat-plugin-readonly-standard/tsconfig.misc.json deleted file mode 100644 index 31cbc680..00000000 --- a/common/_templates/chat-plugin-readonly-standard/tsconfig.misc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "@coze-arch/ts-config/tsconfig.base.json", - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "rootDir": "./", - "outDir": "./dist", - "jsx": "react-jsx", - "lib": ["DOM", "ESNext"], - "module": "ESNext", - "target": "ES2020", - "moduleResolution": "bundler" - }, - "include": ["__tests__", "vitest.config.ts", "stories"], - "exclude": ["./dist"], - "references": [ - { - "path": "./tsconfig.build.json" - } - ] -} diff --git a/common/_templates/chat-plugin-readonly-standard/vitest.config.ts b/common/_templates/chat-plugin-readonly-standard/vitest.config.ts deleted file mode 100644 index 36ca1de6..00000000 --- a/common/_templates/chat-plugin-readonly-standard/vitest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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', -}); diff --git a/common/_templates/chat-plugin-writeable-standard/.storybook/main.js b/common/_templates/chat-plugin-writeable-standard/.storybook/main.js deleted file mode 100644 index d5c408cb..00000000 --- a/common/_templates/chat-plugin-writeable-standard/.storybook/main.js +++ /dev/null @@ -1,31 +0,0 @@ -import { mergeConfig } from 'vite'; -import svgr from 'vite-plugin-svgr'; - -/** @type { import('@storybook/react-vite').StorybookConfig } */ -const config = { - stories: ['../stories/**/*.mdx', '../stories/**/*.stories.tsx'], - addons: [ - '@storybook/addon-links', - '@storybook/addon-essentials', - '@storybook/addon-onboarding', - '@storybook/addon-interactions', - ], - framework: { - name: '@storybook/react-vite', - options: {}, - }, - docs: { - autodocs: 'tag', - }, - viteFinal: config => - mergeConfig(config, { - plugins: [ - svgr({ - svgrOptions: { - native: false, - }, - }), - ], - }), -}; -export default config; diff --git a/common/_templates/chat-plugin-writeable-standard/.storybook/preview.js b/common/_templates/chat-plugin-writeable-standard/.storybook/preview.js deleted file mode 100644 index 1f07be96..00000000 --- a/common/_templates/chat-plugin-writeable-standard/.storybook/preview.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @type { import('@storybook/react').Preview } */ -const preview = { - parameters: { - actions: { argTypesRegex: "^on[A-Z].*" }, - controls: { - matchers: { - color: /(background|color)$/i, - date: /Date$/i, - }, - }, - }, -}; - -export default preview; diff --git a/common/_templates/chat-plugin-writeable-standard/.stylelintrc.js b/common/_templates/chat-plugin-writeable-standard/.stylelintrc.js deleted file mode 100644 index 11e8dc00..00000000 --- a/common/_templates/chat-plugin-writeable-standard/.stylelintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const { defineConfig } = require('@coze-arch/stylelint-config'); - -module.exports = defineConfig({ - extends: [], -}); diff --git a/common/_templates/chat-plugin-writeable-standard/README.md b/common/_templates/chat-plugin-writeable-standard/README.md deleted file mode 100644 index 01655db9..00000000 --- a/common/_templates/chat-plugin-writeable-standard/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# {{ packageName }} - -> Project template for react component with storybook. - -## Features - -- [x] eslint & ts -- [x] esm bundle -- [x] umd bundle -- [x] storybook - -## Commands - -- init: `rush update` -- dev: `npm run dev` -- build: `npm run build` diff --git a/common/_templates/chat-plugin-writeable-standard/__tests__/.gitkeep b/common/_templates/chat-plugin-writeable-standard/__tests__/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/common/_templates/chat-plugin-writeable-standard/config/rush-project.json b/common/_templates/chat-plugin-writeable-standard/config/rush-project.json deleted file mode 100644 index 1c23b14b..00000000 --- a/common/_templates/chat-plugin-writeable-standard/config/rush-project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "operationSettings": [ - { - "operationName": "test:cov", - "outputFolderNames": ["coverage"] - }, - { - "operationName": "ts-check", - "outputFolderNames": ["dist"] - } - ] -} diff --git a/common/_templates/chat-plugin-writeable-standard/eslint.config.js b/common/_templates/chat-plugin-writeable-standard/eslint.config.js deleted file mode 100644 index c272da55..00000000 --- a/common/_templates/chat-plugin-writeable-standard/eslint.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const { defineConfig } = require('@coze-arch/eslint-config'); - -module.exports = defineConfig({ - packageRoot: __dirname, - preset: 'web', - rules: {}, -}); diff --git a/common/_templates/chat-plugin-writeable-standard/init.config.ts b/common/_templates/chat-plugin-writeable-standard/init.config.ts deleted file mode 100644 index 12f3d3da..00000000 --- a/common/_templates/chat-plugin-writeable-standard/init.config.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 SelectTeamPlugin from '../_plugins/SelectTeamPlugin'; -import SetDefaultAuthorPlugin from '../_plugins/SetDefaultAuthorPlugin'; -import type { IConfig } from '../../autoinstallers/plugins/node_modules/rush-init-project-plugin'; - -const config: IConfig = { - plugins: [new SetDefaultAuthorPlugin(), new SelectTeamPlugin()], - defaultProjectConfiguration: { - tags:['level-3'] - } -}; - -export default config; diff --git a/common/_templates/chat-plugin-writeable-standard/package.json b/common/_templates/chat-plugin-writeable-standard/package.json deleted file mode 100644 index 1962fa66..00000000 --- a/common/_templates/chat-plugin-writeable-standard/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "{{ packageName }}", - "version": "0.0.1", - "description": "{{ description }}", - "license": "Apache-2.0", - "author": "{{ authorName }}", - "maintainers": [], - "main": "src/index.tsx", - "scripts": { - "build": "exit 0", - "dev": "storybook dev -p 6006", - "lint": "eslint ./ --cache", - "test": "vitest --run --passWithNoTests", - "test:cov": "npm run test -- --coverage" - }, - "dependencies": { - "@coze-common/chat-area": "workspace:*", - "classnames": "^2.3.2" - }, - "devDependencies": { - "@coze-arch/bot-typings": "workspace:*", - "@coze-arch/eslint-config": "workspace:*", - "@coze-arch/stylelint-config": "workspace:*", - "@coze-arch/ts-config": "workspace:*", - "@coze-arch/vitest-config": "workspace:*", - "@storybook/addon-essentials": "^7.6.7", - "@storybook/addon-interactions": "^7.6.7", - "@storybook/addon-links": "^7.6.7", - "@storybook/addon-onboarding": "^1.0.10", - "@storybook/blocks": "^7.6.7", - "@storybook/react": "^7.6.7", - "@storybook/react-vite": "^7.6.7", - "@storybook/test": "^7.6.7", - "@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", - "storybook": "^7.6.7", - "stylelint": "^15.11.0", - - "vite-plugin-svgr": "~3.3.0", - "vitest": "~3.0.5" - }, - "peerDependencies": { - "react": ">=18.2.0", - "react-dom": ">=18.2.0" - } -} diff --git a/common/_templates/chat-plugin-writeable-standard/src/custom-components/message-inner-addon-bottom/index.tsx b/common/_templates/chat-plugin-writeable-standard/src/custom-components/message-inner-addon-bottom/index.tsx deleted file mode 100644 index 29f95a10..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/custom-components/message-inner-addon-bottom/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 FC } from 'react'; - -type IProps = Record; - -export const BizMessageInnerAddonBottom: FC = () => ( -
hello world
-); diff --git a/common/_templates/chat-plugin-writeable-standard/src/index.ts b/common/_templates/chat-plugin-writeable-standard/src/index.ts deleted file mode 100644 index 6cebdb66..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 PluginRegistryEntry } from '@coze-common/chat-area'; - -import { type PluginBizContext } from './types/biz-context'; -import { BizPlugin } from './plugin'; - -// eslint-disable-next-line @typescript-eslint/naming-convention -- 插件命名大写开头符合预期 -export const BizPluginRegistry: PluginRegistryEntry = { - /** - * 贯穿插件生命周期、组件的上下文 - */ - createPluginBizContext() { - return {}; - }, - /** - * 插件本体 - */ - Plugin: BizPlugin, -}; diff --git a/common/_templates/chat-plugin-writeable-standard/src/plugin.ts b/common/_templates/chat-plugin-writeable-standard/src/plugin.ts deleted file mode 100644 index 2771b1e3..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/plugin.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 { - PluginMode, - PluginName, - WriteableChatAreaPlugin, - createCustomComponents, - createWriteableLifeCycleServices, -} from '@coze-common/chat-area'; - -import { type PluginBizContext } from './types/biz-context'; -import { bizLifeCycleServiceGenerator } from './services/life-cycle'; -import { BizMessageInnerAddonBottom } from './custom-components/message-inner-addon-bottom'; - -export class BizPlugin extends WriteableChatAreaPlugin { - /** - * 插件类型 - * PluginMode.Readonly = 只读模式 - * PluginMode.Writeable = 可写模式 - */ - public pluginMode = PluginMode.Writeable; - /** - * 插件名称 - * 请点 PluginName 里面去定义 - */ - public pluginName = PluginName.Demo; - - /** - * 生命周期服务 - */ - public lifeCycleServices = createWriteableLifeCycleServices( - this, - bizLifeCycleServiceGenerator, - ); - - /** - * 自定义组件 - */ - public customComponents = createCustomComponents({ - MessageInnerBottomSlot: BizMessageInnerAddonBottom, - }); -} diff --git a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/app.ts b/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/app.ts deleted file mode 100644 index 93c230ff..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/app.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 WriteableAppLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const appLifeCycleServiceGenerator: WriteableAppLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/command.ts b/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/command.ts deleted file mode 100644 index 46f84fb6..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/command.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 WriteableCommandLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const commandLifeCycleServiceGenerator: WriteableCommandLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/index.ts b/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/index.ts deleted file mode 100644 index 634fe9f4..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 WriteableLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; -import { renderLifeCycleServiceGenerator } from './render'; -import { messageLifeCycleServiceGenerator } from './message'; -import { commandLifeCycleServiceGenerator } from './command'; -import { appLifeCycleServiceGenerator } from './app'; - -export const bizLifeCycleServiceGenerator: WriteableLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({ - appLifeCycleService: appLifeCycleServiceGenerator(plugin), - messageLifeCycleService: messageLifeCycleServiceGenerator(plugin), - commandLifeCycleService: commandLifeCycleServiceGenerator(plugin), - renderLifeCycleService: renderLifeCycleServiceGenerator(plugin), -}); diff --git a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/message.ts b/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/message.ts deleted file mode 100644 index 7698253c..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/message.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 WriteableMessageLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const messageLifeCycleServiceGenerator: WriteableMessageLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/render.ts b/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/render.ts deleted file mode 100644 index 63a9370d..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/services/life-cycle/render.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 WriteableRenderLifeCycleServiceGenerator } from '@coze-common/chat-area'; - -import { type PluginBizContext } from '../../types/biz-context'; - -export const renderLifeCycleServiceGenerator: WriteableRenderLifeCycleServiceGenerator< - PluginBizContext -> = plugin => ({}); diff --git a/common/_templates/chat-plugin-writeable-standard/src/types/biz-context.ts b/common/_templates/chat-plugin-writeable-standard/src/types/biz-context.ts deleted file mode 100644 index 1135a4cc..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/types/biz-context.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -export type PluginBizContext = Record; diff --git a/common/_templates/chat-plugin-writeable-standard/src/typings.d.ts b/common/_templates/chat-plugin-writeable-standard/src/typings.d.ts deleted file mode 100644 index 4ae6594a..00000000 --- a/common/_templates/chat-plugin-writeable-standard/src/typings.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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. - */ - -/// diff --git a/common/_templates/chat-plugin-writeable-standard/stories/demo.stories.tsx b/common/_templates/chat-plugin-writeable-standard/stories/demo.stories.tsx deleted file mode 100644 index 05def05e..00000000 --- a/common/_templates/chat-plugin-writeable-standard/stories/demo.stories.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { DemoComponent } from '../src'; - -export default { - title: 'Example/Demo', - component: DemoComponent, - parameters: { - // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout - layout: 'centered', - }, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs - tags: ['autodocs'], - // More on argTypes: https://storybook.js.org/docs/api/argtypes - argTypes: {}, -}; - -// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args -export const Base = { - args: { - name: 'tecvan', - }, -}; diff --git a/common/_templates/chat-plugin-writeable-standard/stories/hello.mdx b/common/_templates/chat-plugin-writeable-standard/stories/hello.mdx deleted file mode 100644 index 66edadc6..00000000 --- a/common/_templates/chat-plugin-writeable-standard/stories/hello.mdx +++ /dev/null @@ -1,34 +0,0 @@ -import { Meta } from "@storybook/blocks"; - - - -
-
- # Hello world - - Hello world -
-
- - diff --git a/common/_templates/chat-plugin-writeable-standard/tsconfig.build.json b/common/_templates/chat-plugin-writeable-standard/tsconfig.build.json deleted file mode 100644 index fb4a73c2..00000000 --- a/common/_templates/chat-plugin-writeable-standard/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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", - "target": "ES2020", - "moduleResolution": "bundler" - }, - "include": ["src"], - "exclude": ["node_modules", "dist"] -} diff --git a/common/_templates/chat-plugin-writeable-standard/tsconfig.json b/common/_templates/chat-plugin-writeable-standard/tsconfig.json deleted file mode 100644 index b3951a30..00000000 --- a/common/_templates/chat-plugin-writeable-standard/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "exclude": ["**/*"], - "compilerOptions": { - "composite": true - }, - "references": [ - { - "path": "./tsconfig.build.json" - }, - { - "path": "./tsconfig.misc.json" - } - ] -} diff --git a/common/_templates/chat-plugin-writeable-standard/tsconfig.misc.json b/common/_templates/chat-plugin-writeable-standard/tsconfig.misc.json deleted file mode 100644 index 7bc9c63e..00000000 --- a/common/_templates/chat-plugin-writeable-standard/tsconfig.misc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "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" - }, - "include": ["__tests__", "vitest.config.ts", "stories"], - "exclude": ["./dist"], - "references": [ - { - "path": "./tsconfig.build.json" - } - ] -} diff --git a/common/_templates/chat-plugin-writeable-standard/vitest.config.ts b/common/_templates/chat-plugin-writeable-standard/vitest.config.ts deleted file mode 100644 index 36ca1de6..00000000 --- a/common/_templates/chat-plugin-writeable-standard/vitest.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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', -});