From 308677d959fafcb2121216381dfd84e564ba3307 Mon Sep 17 00:00:00 2001 From: Rouni Date: Wed, 20 Sep 2023 15:39:22 +0800 Subject: [PATCH 1/3] repo-sync-2023-09-20T15:39:02+0800 --- .github/workflows/build-and-release.yml | 4 +- .gitignore | 2 +- CONTRIBUTING.md | 115 ++++++++++++++---- CONTRIBUTING.zh-Hans.md | 101 +++++++++++++++ README.md | 98 +-------------- README.zh-Hans.md | 98 +-------------- apps/docs/LICENSE | 21 ++++ apps/docs/README.md | 7 +- apps/docs/docs/dev-doc/vue.md | 2 + .../modal-manger-protocol.ts | 4 +- .../src/modules/dag-result/index.less | 17 +++ .../src/modules/dag-result/result-table.tsx | 6 +- .../platform/src/modules/main-dag/toolbar.tsx | 16 ++- apps/platform/src/modules/pipeline/index.ts | 3 +- packages/dag/src/actions/copy.ts | 24 +++- packages/dag/src/actions/paste.ts | 10 +- packages/dag/src/index.ts | 7 +- packages/dag/src/protocol.ts | 6 +- packages/dag/src/shapes/descriptions.tsx | 2 +- packages/dag/src/shapes/index.less | 10 +- packages/dag/src/shapes/node.tsx | 4 +- packages/dag/src/types/index.ts | 1 + 22 files changed, 306 insertions(+), 252 deletions(-) create mode 100644 apps/docs/LICENSE diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 8a73608..2d65f44 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -54,11 +54,11 @@ jobs: id: create_tar shell: bash run: | - tar -cvf ./apps/platform/${{ github.ref_name }}.tar ./apps/platform/dist + tar -cvf ./packages/dag/${{ github.ref }}.tar ./packages/dag/dist - name: Release uses: softprops/action-gh-release@v1 with: prerelease: true generate_release_notes: true - files: ./apps/platform/${{ github.ref_name }}.tar + files: ./packages/dag/${{ github.ref }}.tar diff --git a/.gitignore b/.gitignore index 413408e..07db79f 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,4 @@ yarn-error.log* .env -repo_sync/* +repo_sync diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ab3c39..62809b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,42 +2,105 @@ English (US) | [简体中文](CONTRIBUTING.zh-Hans.md) # Contributing -## collaboration +## Development -### Submit Information +Make sure you have [pnpm](https://pnpm.io/installation) and +[Turborepo](https://turbo.build/repo/docs/installing) installed globally. -We use -[Angular's Commit Specification](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commit-message-format). +```bash +npm -g install pnpm nx +npm -g exec pnpm setup +``` + +### First time setup -The format of the title is `type: subject`: +```bash +pnpm bootstrap +``` -- `type` a label indicating what kind of commit this is (what changes are involved) -- A one-sentence description of the `subject` submission - - Use English imperative sentences (what this commit will do); lowercase initials; do not use periods -- (We don't use `scope` for now) +> This will install deps with `pnpm install`, ant then setup all packages with +> `nx run-many setup`. -Commonly used `type`: +### Starting the dev server -- `fix` This is a commit that fixes a bug -- `feat` This is a commit that adds a new feature -- `refactor` This is a commit that refactors an existing feature -- `docs` This commit updates the docs (README/comments/…) -- `ci` commits changes to CI (changed ESLint rules/updated testing tools/updated GitHub - Actions...) -- `chore` Other changes that do not meet the above description (such as regular dependency updates) +```bash +pnpm dev +``` -**If you find that your commit satisfies multiple tags at the same time, your commit needs to be split into multiple. ** +The example app will be available at http://localhost:8000 by default. -Example: +### Formatting +```bash +pnpm fix +# run ESLint/Stylelint/Prettier and attempt to fix found issues ``` -feat: add ahooks -ci: update tooling config -refactor: remove useless ide-scql -docs: make issues/PR templates bilingual + +### Linting and testing + +```bash +pnpm lint +pnpm test ``` -### source branch +### Building + +```bash +pnpm build +``` -Branch naming follows a similar convention to commit messages. The format is `type/subject`, where `subject` uses -`kebab-case` (all lower case, use - as hyphen), **branch name does not need to add your name. ** +You may then serve the built app with `pnpm serve`. + +### Per-package operations + +[https://pnpm.io/filtering](https://pnpm.io/filtering) + +Use either the package name (the `"name"` field in `package.json`) or the **relative** +path to the package's folder (must be prefixed with `./`) to specify the package(s) on +which the command should be run. + +```bash +pnpm --filter [...] + +pnpm --filter web add react react-dom +pnpm --filter ./apps/web add react react-dom +# add react and react-dom as dependencies to the package named "web" +# whose folder is located at ./apps/web + +pnpm --filter "@scope/*" run clean +pnpm --filter "./packages/*" run clean +# use glob to select multiple packages, the pattern must be quoted +``` + +#### Adding dependencies + +[https://pnpm.io/cli/add](https://pnpm.io/cli/add) + +`add` for normal dependencies `dependencies` + +```bash +pnpm --filter add [dependency ...] +# pnpm --filter web add react react-dom +``` + +`add -D` for development dependencies `devDependencies` + +```bash +pnpm --filter add -D [dependency ...] +# pnpm --filter web add -D jest +``` + +`add --save-peer` for peer dependencies `peerDependencies` + +```bash +pnpm --filter add --save-peer [dependency ...] +# pnpm --filter ui add --save-peer react "monaco-editor@^0.31.0" +``` + +💡 for adding workspace packages as dependencies, use the same command as above, but +append `--workspace` + +```bash +pnpm --filter add [--save-dev|--save-peer] [dependency ...] --workspace +# pnpm --filter web add -D eslint-config-project --workspace +``` diff --git a/CONTRIBUTING.zh-Hans.md b/CONTRIBUTING.zh-Hans.md index 86c59d3..fde08a1 100644 --- a/CONTRIBUTING.zh-Hans.md +++ b/CONTRIBUTING.zh-Hans.md @@ -2,6 +2,107 @@ # 贡献指南 +## 开发 + +请确保有安装 [pnpm](https://pnpm.io/installation) 和 +[Nx](https://turbo.build/repo/docs/installing) + +```bash +npm -g install pnpm nx +npm -g exec pnpm setup +``` + +### 首次运行 + +```bash +pnpm bootstrap +``` + +> 这会 `pnpm install` 安装依赖,然后 `nx run-many --target=setup` 初始化所有包。 + +### 启动开发服务器 + +```bash +pnpm dev +``` + +默认在 http://localhost:8000 启动 + +### 代码格式化 + +```bash +pnpm fix +# 运行 ESLint/Stylelint/Prettier 并且尝试自动修正问题 +``` + +### 检查及测试 + +```bash +pnpm lint +pnpm test +``` + +### 构建 + +```bash +pnpm build +``` + +构建产物可以通过 `pnpm serve` 命令进行预览。 + +### 对单个 package 进行操作 + +[https://pnpm.io/filtering](https://pnpm.io/filtering) + +使用 package 的名称(`package.json` 中的 `"name"` 字段)或者 **相对路径**(必须以 `./` +开头)来指定要操作的 package. + +```bash +pnpm --filter [...] + +pnpm --filter web add react react-dom +pnpm --filter ./apps/web add react react-dom +# 将 react 和 react-dom 作为 dependencies 加到名为 web 的 package 中,其路径为 ./apps/web + +pnpm --filter "@scope/*" run clean +pnpm --filter "./packages/*" run clean +# 使用 glob 来选择多个 package,表达式必须使用双引号包裹 +``` + +#### 安装新依赖 + +[https://pnpm.io/cli/add](https://pnpm.io/cli/add) + +使用以下命令: + +`add` 安装普通依赖 `dependencies` + +```bash +pnpm --filter add [dependency ...] +# pnpm --filter web add react react-dom +``` + +`add -D` 安装开发依赖 `devDependencies` + +```bash +pnpm --filter add -D [dependency ...] +# pnpm --filter web add -D jest +``` + +`add --save-peer` 安装同伴依赖 `peerDependencies` + +```bash +pnpm --filter add --save-peer [dependency ...] +# pnpm --filter ui add --save-peer react "monaco-editor@^0.31.0" +``` + +💡 将内部 package 作为依赖,请使用与上面相同的命令并在命令末尾加上 `--workspace` + +```bash +pnpm --filter add [--save-dev|--save-peer] [dependency ...] --workspace +# pnpm --filter web add -D eslint-config-project --workspace +``` + ## 协作 ### 提交信息 diff --git a/README.md b/README.md index b27f753..bd13194 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,12 @@ English (US) | [简体中文](README.zh-Hans.md) -# SecretFlow Frontend +# SecretFlow Platform ## Development -Make sure you have [pnpm](https://pnpm.io/installation) and -[Turborepo](https://turbo.build/repo/docs/installing) installed globally. - -```bash -npm -g install pnpm nx -npm -g exec pnpm setup -``` - -### First time setup - ```bash pnpm bootstrap -``` - -> This will install deps with `pnpm install`, ant then setup all packages with -> `nx run-many setup`. - -### Starting the dev server - -```bash pnpm dev ``` -The example app will be available at http://localhost:8000 by default. - -### Formatting - -```bash -pnpm fix -# run ESLint/Stylelint/Prettier and attempt to fix found issues -``` - -### Linting and testing - -```bash -pnpm lint -pnpm test -``` - -### Building - -```bash -pnpm build -``` - -You may then serve the built app with `pnpm serve`. - -### Per-package operations - -[https://pnpm.io/filtering](https://pnpm.io/filtering) - -Use either the package name (the `"name"` field in `package.json`) or the **relative** -path to the package's folder (must be prefixed with `./`) to specify the package(s) on -which the command should be run. - -```bash -pnpm --filter [...] - -pnpm --filter web add react react-dom -pnpm --filter ./apps/web add react react-dom -# add react and react-dom as dependencies to the package named "web" -# whose folder is located at ./apps/web - -pnpm --filter "@scope/*" run clean -pnpm --filter "./packages/*" run clean -# use glob to select multiple packages, the pattern must be quoted -``` - -#### Adding dependencies - -[https://pnpm.io/cli/add](https://pnpm.io/cli/add) - -`add` for normal dependencies `dependencies` - -```bash -pnpm --filter add [dependency ...] -# pnpm --filter web add react react-dom -``` - -`add -D` for development dependencies `devDependencies` - -```bash -pnpm --filter add -D [dependency ...] -# pnpm --filter web add -D jest -``` - -`add --save-peer` for peer dependencies `peerDependencies` - -```bash -pnpm --filter add --save-peer [dependency ...] -# pnpm --filter ui add --save-peer react "monaco-editor@^0.31.0" -``` - -💡 for adding workspace packages as dependencies, use the same command as above, but -append `--workspace` - -```bash -pnpm --filter add [--save-dev|--save-peer] [dependency ...] --workspace -# pnpm --filter web add -D eslint-config-project --workspace -``` - See [CONTRIBUTING.md](CONTRIBUTING.md) for more info. diff --git a/README.zh-Hans.md b/README.zh-Hans.md index 7cb4996..17974ae 100644 --- a/README.zh-Hans.md +++ b/README.zh-Hans.md @@ -1,106 +1,12 @@ [English (US)](README.md) | 简体中文 -# 隐语平台前端 +# 隐语平台 ## 开发 -请确保有安装 [pnpm](https://pnpm.io/installation) 和 -[Nx](https://turbo.build/repo/docs/installing) - -```bash -npm -g install pnpm nx -npm -g exec pnpm setup -``` - -### 首次运行 - ```bash pnpm bootstrap -``` - -> 这会 `pnpm install` 安装依赖,然后 `nx run-many --target=setup` 初始化所有包。 - -### 启动开发服务器 - -```bash pnpm dev ``` -默认在 http://localhost:8000 启动 - -### 代码格式化 - -```bash -pnpm fix -# 运行 ESLint/Stylelint/Prettier 并且尝试自动修正问题 -``` - -### 检查及测试 - -```bash -pnpm lint -pnpm test -``` - -### 构建 - -```bash -pnpm build -``` - -构建产物可以通过 `pnpm serve` 命令进行预览。 - -### 对单个 package 进行操作 - -[https://pnpm.io/filtering](https://pnpm.io/filtering) - -使用 package 的名称(`package.json` 中的 `"name"` 字段)或者 **相对路径**(必须以 `./` -开头)来指定要操作的 package. - -```bash -pnpm --filter [...] - -pnpm --filter web add react react-dom -pnpm --filter ./apps/web add react react-dom -# 将 react 和 react-dom 作为 dependencies 加到名为 web 的 package 中,其路径为 ./apps/web - -pnpm --filter "@scope/*" run clean -pnpm --filter "./packages/*" run clean -# 使用 glob 来选择多个 package,表达式必须使用双引号包裹 -``` - -#### 安装新依赖 - -[https://pnpm.io/cli/add](https://pnpm.io/cli/add) - -使用以下命令: - -`add` 安装普通依赖 `dependencies` - -```bash -pnpm --filter add [dependency ...] -# pnpm --filter web add react react-dom -``` - -`add -D` 安装开发依赖 `devDependencies` - -```bash -pnpm --filter add -D [dependency ...] -# pnpm --filter web add -D jest -``` - -`add --save-peer` 安装同伴依赖 `peerDependencies` - -```bash -pnpm --filter add --save-peer [dependency ...] -# pnpm --filter ui add --save-peer react "monaco-editor@^0.31.0" -``` - -💡 将内部 package 作为依赖,请使用与上面相同的命令并在命令末尾加上 `--workspace` - -```bash -pnpm --filter add [--save-dev|--save-peer] [dependency ...] --workspace -# pnpm --filter web add -D eslint-config-project --workspace -``` - -贡献指南见 [CONTRIBUTING.md](CONTRIBUTING.zh-Hans.md). +见 [CONTRIBUTING.md](CONTRIBUTING.zh-Hans.md). diff --git a/apps/docs/LICENSE b/apps/docs/LICENSE new file mode 100644 index 0000000..244229e --- /dev/null +++ b/apps/docs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/apps/docs/README.md b/apps/docs/README.md index d920488..436ed5d 100644 --- a/apps/docs/README.md +++ b/apps/docs/README.md @@ -1,5 +1,6 @@ # sceretpad-doc -The development document for sceretpad-fe + +A static site base on [dumi](https://d.umijs.org). ## Development @@ -13,3 +14,7 @@ $ pnpm start # build docs $ pnpm run build ``` + +## LICENSE + +MIT diff --git a/apps/docs/docs/dev-doc/vue.md b/apps/docs/docs/dev-doc/vue.md index dccd65b..40d16ab 100644 --- a/apps/docs/docs/dev-doc/vue.md +++ b/apps/docs/docs/dev-doc/vue.md @@ -60,6 +60,7 @@ class Model { onViewUnMount() { return; } +} ``` 可以看到,在 DemoModel 实例化的时候,通过 valtio 的 proxy 就自动拥有了响应式的能力。 @@ -83,6 +84,7 @@ class Model { onViewUnMount() { return; } +} ``` 把`import {proxy} from 'valtio;` 修改为 `import { reactive } from 'vue';`,然后所有的非 UI 代码就能复用了。 diff --git a/apps/platform/src/modules/dag-modal-manager/modal-manger-protocol.ts b/apps/platform/src/modules/dag-modal-manager/modal-manger-protocol.ts index 8250009..8fffb91 100644 --- a/apps/platform/src/modules/dag-modal-manager/modal-manger-protocol.ts +++ b/apps/platform/src/modules/dag-modal-manager/modal-manger-protocol.ts @@ -1,9 +1,9 @@ -import type { Emitter } from '@secretflow/utils'; - import { componentConfigDrawer } from '@/modules/component-config/config-modal'; import { resultDrawer } from '@/modules/dag-result/result-modal'; import { RecordListDrawerItem } from '@/modules/pipeline-record-list/record-list-drawer-view'; +import type { Emitter } from '@secretflow/utils'; + export interface ModalItem { id: string; visible: boolean; diff --git a/apps/platform/src/modules/dag-result/index.less b/apps/platform/src/modules/dag-result/index.less index 8353433..d05e304 100644 --- a/apps/platform/src/modules/dag-result/index.less +++ b/apps/platform/src/modules/dag-result/index.less @@ -30,6 +30,7 @@ } .report { + font-size: 12px; padding: 11px 12px 4px 11px; margin-bottom: 16px; background-color: rgb(0 0 0 / 2%); @@ -39,6 +40,13 @@ margin-bottom: 0; } + :global{ + .ant-table-thead, + .ant-table-tbody{ + font-size: 12px; + } + } + .item { display: flex; align-items: center; @@ -82,3 +90,12 @@ } } } + +.result{ + :global{ + .ant-table-thead, + .ant-table-tbody{ + font-size: 12px; + } + } +} diff --git a/apps/platform/src/modules/dag-result/result-table.tsx b/apps/platform/src/modules/dag-result/result-table.tsx index 245954c..b69030e 100644 --- a/apps/platform/src/modules/dag-result/result-table.tsx +++ b/apps/platform/src/modules/dag-result/result-table.tsx @@ -170,7 +170,7 @@ export const ResultTableComponent = (props: ResultComponentProps<'table'>) => { }); }; return ( - <> +
{id} @@ -213,7 +213,7 @@ export const ResultTableComponent = (props: ResultComponentProps<'table'>) => {
表字段