From 8e2e22dae1fb47cb4146a31c8d2735ad1ec81bce Mon Sep 17 00:00:00 2001 From: 1ncounter <1ncounter.100@gmail.com> Date: Wed, 27 Mar 2024 13:51:43 +0800 Subject: [PATCH] chore: delete useless files --- .github/workflows/ci.yml | 10 ++--- .github/workflows/publish docs.yml | 16 ++++---- docs/docs/faq/faq001.md | 6 --- docs/docs/participate/index.md | 15 ++++---- package.json | 16 +++----- packages/engine/README-zh_CN.md | 23 ++++++------ packages/engine/README.md | 24 ++++++------ .../workspace/src/context/base-context.ts | 37 +++++++++++++------ scripts/create.sh | 21 ----------- scripts/setup-skip-build.sh | 10 ----- scripts/setup.sh | 7 ---- scripts/start-server.sh | 5 --- scripts/start.sh | 9 ----- scripts/sync.sh | 17 --------- 14 files changed, 74 insertions(+), 142 deletions(-) delete mode 100644 docs/docs/faq/faq001.md delete mode 100755 scripts/create.sh delete mode 100755 scripts/setup-skip-build.sh delete mode 100755 scripts/setup.sh delete mode 100644 scripts/start-server.sh delete mode 100755 scripts/start.sh delete mode 100755 scripts/sync.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4636a1bdd..50f3357fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ name: Node CI on: - push: + push: branches: - main - pull_request: + pull_request: branches: - main @@ -18,10 +18,10 @@ jobs: - uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '18' - name: install - run: npm i && npm run setup:skip-build + run: pnpm install - name: test designer run: cd packages/designer && npm run test:cov && cd ../.. @@ -113,4 +113,4 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} name: code-generator fail_ci_if_error: true - verbose: true \ No newline at end of file + verbose: true diff --git a/.github/workflows/publish docs.yml b/.github/workflows/publish docs.yml index 139b70239..4dc1d5172 100644 --- a/.github/workflows/publish docs.yml +++ b/.github/workflows/publish docs.yml @@ -6,6 +6,8 @@ on: - develop paths: - 'docs/docs/**' + pull_request: + types: [closed] workflow_dispatch: jobs: @@ -16,19 +18,17 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v2 with: - ref: 'develop' - node-version: '16' + node-version: '18' registry-url: 'https://registry.npmjs.org' - - run: cd docs && npm install + - run: pnpm install - run: | - cd docs npm version patch git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add package.json git commit -m "chore(docs): publish documentation" git push - - run: cd docs && npm run build && npm publish + - run: pnpm build env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Get version @@ -40,8 +40,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Comment on PR - if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true - uses: actions/github-script@v4 + if: github.event_name == 'pull_request' && github.action == 'closed' && github.event.pull_request.merged == true + uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -49,5 +49,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '🚀 New version has been released: ' + '${{ needs.publish-docs.outputs.version }}' + body: '🚀 New version has been released: ' + '${{ needs.publish-docs.outputs }}' }) diff --git a/docs/docs/faq/faq001.md b/docs/docs/faq/faq001.md deleted file mode 100644 index 56305cf2d..000000000 --- a/docs/docs/faq/faq001.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: build-scripts 的使用文档 -sidebar_position: 1 -tags: [FAQ] ---- -build-scripts 是一个开源项目,详见 [https://github.com/ice-lab/build-scripts](https://github.com/ice-lab/build-scripts) diff --git a/docs/docs/participate/index.md b/docs/docs/participate/index.md index 7f6452fb1..5bab28bef 100644 --- a/docs/docs/participate/index.md +++ b/docs/docs/participate/index.md @@ -5,7 +5,7 @@ sidebar_position: 0 ### 环境准备 -开发 LowcodeEngine 需要 Node.js 16+。 +开发 LowcodeEngine 需要 Node.js 18+。 推荐使用 nvm 管理 Node.js,避免权限问题的同时,还能够随时切换当前使用的 Node.js 的版本。 @@ -21,7 +21,7 @@ cd lowcode-engine #### 安装依赖并构建 ``` -npm install && npm run setup +pnpm install ``` #### 调试环境配置 @@ -29,6 +29,7 @@ npm install && npm run setup 本质上是将 demo 页面引入的几个 js/css 代理到 engine 项目,可以使用趁手的代理工具,这里推荐 [XSwitch](https://chrome.google.com/webstore/detail/xswitch/idkjhjggpffolpidfkikidcokdkdaogg?hl=en-US)。 本地开发代理规则如下: + ```json { "proxy": [ @@ -62,19 +63,19 @@ npm start 开启代理之后,就可以进行开发调试了。 - ### 贡献低代码引擎文档 #### 开发文档 在 lowcode-engine 目录下执行下面命令 + ``` cd docs -npm install -npm start +pnpm start ``` #### 维护方式 + - 官方文档通过 github 管理文档源,官网文档与[主仓库 develop 分支](https://github.com/alibaba/lowcode-engine/tree/develop/docs)保持同步。 - 点击每篇文档下发的 `编辑此页` 可直接定位到 github 中位置。 - 欢迎 PR,文档 PR 也会作为贡献者贡献,会用于贡献度统计。 @@ -87,7 +88,6 @@ npm start 使用 vscode 进行编辑的朋友可以安装 vscode 插件 [huacnlee.autocorrect](https://github.com/huacnlee/autocorrect) 辅助文档 lint。 - ### 贡献低代码引擎生态 相关源码详见[NPM 包对应源码位置汇总](/site/docs/guide/appendix/npms) @@ -99,6 +99,7 @@ npm start PR 被合并之后,我们会尽快发布相关的正式版本或者 beta 版本。 ### 加入 Contributor 群 + 提交过 Bugfix 或 Feature 类 PR 的同学,如果有兴趣一起参与维护 LowcodeEngine,我们提供了一个核心贡献者交流群。 1. 可以通过[填写问卷](https://survey.taobao.com/apps/zhiliao/4YEtu9gHF)的方式,参与到其中。 @@ -115,4 +116,4 @@ PR 被合并之后,我们会尽快发布相关的正式版本或者 beta 版 - 如果你修复了 bug 或者添加了代码,而这些内容需要测试,请添加测试! - 确保通过测试套件(yarn test)。 - 请签订贡献者许可证协议(Contributor License Agreement)。 - > 如已签署 CLA 仍被提示需要签署,[解决办法](/site/docs/faq/faq021) \ No newline at end of file + > 如已签署 CLA 仍被提示需要签署,[解决办法](/site/docs/faq/faq021) diff --git a/package.json b/package.json index cc54203b3..5b97bd6f6 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,14 @@ { + "name": "lowcode-engine-repo", "private": true, "scripts": { "playground": "pnpm --filter playground dev", - "build": "./scripts/build.sh", - "build:npm": "lerna run build --stream", - "build:umd": "lerna run build:umd --stream", - "clean": "rimraf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build", - "clean:lib": "rimraf ./node_modules", + "test": "pnpm -r test", + "build": "pnpm -r build", + "clean": "rimraf ./packages/*/dist", + "clean:lib": "rimraf ./node_modules ./packages/*/node_modules", "lint": "f2elint scan -q -i ./packages/*/src", "lint:fix": "f2elint fix -i ./packages/*/src", - "lint:modules": "f2elint scan -q -i ./modules/*/src", - "lint:modules:fix": "f2elint fix -i ./modules/*/src", "pub": "npm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog", "pub:minor": "npm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog", "pub:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog", @@ -18,10 +16,6 @@ "pub:preminor": "npm run watchdog:build && lerna publish preminor --force-publish --exact --dist-tag beta --preid beta --no-changelog", "pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog", "pub:prerelease": "npm run watchdog:build && lerna publish prerelease --yes --force-publish --exact --dist-tag beta --preid beta --no-changelog", - "setup:skip-build": "./scripts/setup-skip-build.sh", - "test": "lerna run test --stream", - "test:snapshot": "lerna run test:snapshot", - "sync": "./scripts/sync.sh", "syncOss": "node ./scripts/sync-oss.js" }, "husky": { diff --git a/packages/engine/README-zh_CN.md b/packages/engine/README-zh_CN.md index 5442aa58b..097fa7ac7 100644 --- a/packages/engine/README-zh_CN.md +++ b/packages/engine/README-zh_CN.md @@ -20,15 +20,12 @@ [npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square [npm-url]: http://npmjs.org/package/@alilc/lowcode-engine - [download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square [download-url]: https://npmjs.org/package/@alilc/lowcode-engine [help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open [help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22 - [issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square [issues-helper-url]: https://github.com/actions-cool/issues-helper - [codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg [codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine @@ -73,8 +70,7 @@ skeleton.add({ name: 'logo', content: YourFantasticLogo, contentProps: { - logo: - 'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png', + logo: 'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png', href: '/', }, props: { @@ -87,6 +83,7 @@ init(document.getElementById('lce')); ``` ### 工程化配置: + ```json { "externals": { @@ -97,35 +94,37 @@ init(document.getElementById('lce')); ``` ### cdn 可选方式: + #### 方式 1(推荐):alifd cdn + ```html https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### 方式 2(推荐):uipaas cdn + ```html https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js - https://uipaas-assets.com/prod/npm/@alilc/lowcode-react-simulator-renderer/1.0.18/dist/js/react-simulator-renderer.js ``` #### 方式 3:unpkg + ```html https://unpkg.com/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### 方式 4:jsdelivr + ```html https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### 方式 5:使用自有 cdn + 将源码中 packages/engine/dist 和 packages/react-simulator-renderer/dist 下的文件传至你的 cdn 提供商 ## 🔗 相关链接 @@ -146,9 +145,8 @@ https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.18/dist ```bash $ git clone git@github.com:alibaba/lowcode-engine.git $ cd lowcode-engine -$ npm install -$ npm run setup -$ npm start +$ pnpm install +$ pnpm playground ``` > 📢 npm 访问速度较慢,阿里员工可以使用 tnpm,其他同学建议使用 cnpm 或者指定镜像 registry。 @@ -160,6 +158,7 @@ lowcode-engine 启动后,提供了几个 umd 文件,可以结合 [lowcode-de ## 🤝 参与共建 请先阅读: + 1. [如何配置引擎调试环境?](https://lowcode-engine.cn/site/docs/participate/prepare) 2. [关于引擎的研发协作流程](https://lowcode-engine.cn/site/docs/participate/flow) 3. [引擎的工程化配置](https://lowcode-engine.cn/site/docs/participate/config) diff --git a/packages/engine/README.md b/packages/engine/README.md index ae4e7fd43..184be3685 100644 --- a/packages/engine/README.md +++ b/packages/engine/README.md @@ -20,15 +20,12 @@ An enterprise-class low-code technology stack with scale-out design [npm-image]: https://img.shields.io/npm/v/@alilc/lowcode-engine.svg?style=flat-square [npm-url]: http://npmjs.org/package/@alilc/lowcode-engine - [download-image]: https://img.shields.io/npm/dm/@alilc/lowcode-engine.svg?style=flat-square [download-url]: https://npmjs.org/package/@alilc/lowcode-engine [help-wanted-image]: https://flat.badgen.net/github/label-issues/alibaba/lowcode-engine/help%20wanted/open [help-wanted-url]: https://github.com/alibaba/lowcode-engine/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22 - [issues-helper-image]: https://img.shields.io/badge/using-issues--helper-orange?style=flat-square [issues-helper-url]: https://github.com/actions-cool/issues-helper - [codecov-image-url]: https://codecov.io/gh/alibaba/lowcode-engine/branch/main/graph/badge.svg [codecov-url]: https://codecov.io/gh/alibaba/lowcode-engine @@ -73,8 +70,7 @@ skeleton.add({ name: 'logo', content: YourFantasticLogo, contentProps: { - logo: - 'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png', + logo: 'https://img.alicdn.com/tfs/TB1_SocGkT2gK0jSZFkXXcIQFXa-66-66.png', href: '/', }, props: { @@ -87,6 +83,7 @@ init(document.getElementById('lce')); ``` ### Engineering configuration: + ```json { "externals": { @@ -97,35 +94,37 @@ init(document.getElementById('lce')); ``` ### cdn optional method: + #### Method 1: alifd cdn + ```html https://alifd.alicdn.com/npm/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://alifd.alicdn.com/npm/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### Method 2: uipaas cdn + ```html https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.0.18/dist/js/engine-core.js - https://uipaas-assets.com/prod/npm/@alilc/lowcode-react-simulator-renderer/1.0.18/dist/js/react-simulator-renderer.js ``` #### Method 3: unpkg + ```html https://unpkg.com/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://unpkg.com/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### Method 4: jsdelivr + ```html https://cdn.jsdelivr.net/npm/@alilc/lowcode-engine@1.0.18/dist/js/engine-core.js - https://cdn.jsdelivr.net/npm/@alilc/lowcode-react-simulator-renderer@1.0.18/dist/js/react-simulator-renderer.js ``` #### Method 5: Use your own cdn + Pass the files under packages/engine/dist and packages/react-simulator-renderer/dist in the source code to your cdn provider ## 🔗 Related Links @@ -146,9 +145,8 @@ This [awesome-lowcode-engine](https://github.com/lowcode-workspace/awesome-lowco ```bash $ git clone git@github.com:alibaba/lowcode-engine.git $ cd lowcode-engine -$ npm install -$ npm run setup -$ npm start +$ pnpm install +$ pnpm playground ``` > 📢 npm access speed is slow, Alibaba employees can use tnpm, other students recommend using cnpm or specifying a mirror registry. @@ -160,6 +158,7 @@ After lowcode-engine is started, several umd files are provided, which can be de ## 🤝 Participation Please read first: + 1. [How to configure the engine debugging environment? ](https://lowcode-engine.cn/site/docs/participate/prepare) 2. [About the R&D collaboration process of the engine](https://lowcode-engine.cn/site/docs/participate/flow) 3. [Engineering Configuration of Engine](https://lowcode-engine.cn/site/docs/participate/config) @@ -167,6 +166,7 @@ Please read first: > Strongly recommend reading ["The Wisdom of Asking Questions"](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way), ["How to Ask Questions to the Open Source Community"](https: //github.com/seajs/seajs/issues/545) and [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html), [ "How to Submit Unanswerable Questions to Open Source Projects"](https://zhuanlan.zhihu.com/p/25795393), better questions are easier to get help. (This paragraph refers to [antd](https://github.com/ant-design/ant-design)) About Pull Request: + - set the target branch to **develop** other than **main** ## ❤️ Contributors diff --git a/packages/workspace/src/context/base-context.ts b/packages/workspace/src/context/base-context.ts index 3e6063e53..7a84619c8 100644 --- a/packages/workspace/src/context/base-context.ts +++ b/packages/workspace/src/context/base-context.ts @@ -1,6 +1,7 @@ import { Editor, - engineConfig, Setters as InnerSetters, + engineConfig, + Setters as InnerSetters, Hotkey as InnerHotkey, commonEvent, IEngineConfig, @@ -16,10 +17,7 @@ import { IDesigner, ILowCodePluginManager, } from '@alilc/lowcode-designer'; -import { - ISkeleton, - Skeleton as InnerSkeleton, -} from '@alilc/lowcode-editor-skeleton'; +import { ISkeleton, Skeleton as InnerSkeleton } from '@alilc/lowcode-editor-skeleton'; import { Hotkey, Plugins, @@ -55,10 +53,15 @@ import { getLogger, Logger as InnerLogger } from '@alilc/lowcode-utils'; import { IWorkspace } from '../workspace'; import { IEditorWindow } from '../window'; -export interface IBasicContext extends BasicContext { -} +export interface IBasicContext extends BasicContext {} -export class BasicContext implements Omit { +export class BasicContext + implements + Omit< + IPublicModelPluginContext, + 'workspace' | 'commonUI' | 'command' | 'isPluginRegisteredInWorkspace' | 'editorWindow' + > +{ skeleton: IPublicApiSkeleton; plugins: IPublicApiPlugins; project: IPublicApiProject; @@ -82,7 +85,12 @@ export class BasicContext implements Omit { + assembleApis: ( + context: ILowCodePluginContextPrivate, + pluginName: string, + meta: IPublicTypePluginMeta, + ) => { context.workspace = workspace; context.hotkey = hotkey; context.project = project; @@ -158,7 +170,8 @@ export class BasicContext implements Omit' - exit 0 -fi - -if [ -d packages/$DIR_NAME ];then - echo 'Folder is existing!' - exit 0 -fi - -mkdir packages/$DIR_NAME - -cp -r templates/* packages/$DIR_NAME - -mv packages/$DIR_NAME/_tsconfig.json packages/$DIR_NAME/tsconfig.json - -echo 'Add package successfully.' diff --git a/scripts/setup-skip-build.sh b/scripts/setup-skip-build.sh deleted file mode 100755 index 7c0ff6a27..000000000 --- a/scripts/setup-skip-build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -rm -rf node_modules package-lock.json yarn.lock - -npm i lerna@4.0.0 - -lerna clean -y -find ./packages -type f -name "package-lock.json" -exec rm -f {} \; - -lerna bootstrap diff --git a/scripts/setup.sh b/scripts/setup.sh deleted file mode 100755 index d57f71011..000000000 --- a/scripts/setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -rm -rf package-lock.json yarn.lock -lerna clean -y -find ./packages -type f -name "package-lock.json" -exec rm -f {} \; - -lerna bootstrap --force-local diff --git a/scripts/start-server.sh b/scripts/start-server.sh deleted file mode 100644 index a595843d1..000000000 --- a/scripts/start-server.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# FIXME! do not run build -lerna exec --scope @ali/lowcode-code-generator -- npm run build -# lerna exec --scope @ali/lowcode-demo-server -- npm start diff --git a/scripts/start.sh b/scripts/start.sh deleted file mode 100755 index 88593ebe0..000000000 --- a/scripts/start.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -pkgName="@alilc/lowcode-ignitor" - -if [ "$1" ]; then - pkgName="$1" -fi - -lerna exec --scope $pkgName -- npm start diff --git a/scripts/sync.sh b/scripts/sync.sh deleted file mode 100755 index 3edac0384..000000000 --- a/scripts/sync.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -# sync all packages to alibaba intranet registry -tnpm sync @alilc/lowcode-types -tnpm sync @alilc/lowcode-utils -tnpm sync @alilc/lowcode-shell -tnpm sync @alilc/lowcode-editor-core -tnpm sync @alilc/lowcode-editor-skeleton -tnpm sync @alilc/lowcode-designer -tnpm sync @alilc/lowcode-plugin-designer -tnpm sync @alilc/lowcode-plugin-outline-pane -tnpm sync @alilc/lowcode-renderer-core -tnpm sync @alilc/lowcode-react-renderer -tnpm sync @alilc/lowcode-react-simulator-renderer -tnpm sync @alilc/lowcode-engine -tnpm sync @alilc/lowcode-workspace -tnpm sync @alilc/lowcode-plugin-command \ No newline at end of file