diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ae8643c30c..9c5dddb66c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,17 @@ name: Node CI on: - push: + push: branches: - formily_next - pull_request: + pull_request: branches: - formily_next jobs: build: runs-on: ${{ matrix.os }} - if: !contains(github.event.head_commit.message, 'chore(versions)') + if: contains(github.event.head_commit.message, 'chore(versions)') == false strategy: matrix: node_version: [10.x, 11.x] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1e6096d0fe..2a289476268 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,21 +9,32 @@ jobs: runs-on: ubuntu-latest if: contains(github.event.head_commit.message, 'chore(versions)') steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 with: - node-version: 11 + node-version: 12 registry-url: https://registry.npmjs.org/ - run: | yarn -v yarn --ignore-engines yarn build + yarn test:prod yarn run release:force env: + CI: true HEADLESS: false PROGRESS: none + NODE_ENV: test + NODE_OPTIONS: --max_old_space_size=4096 NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }} REGISTRY: https://registry.npmjs.org + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true diff --git a/.gitignore b/.gitignore index 6390c5cca47..dc9b17d113c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ examples/test TODO.md tsconfig.tsbuildinfo package/ -benchmark package.zip .umi .umi-production diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c3743ff27f..6a62f80867e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,65 @@ # Changelog +## v2.0.0-rc.10(2021-09-21) + +### :beetle: Bug Fixes + +1. [fix(core): fix initialValues patch values with wrong type (#2214)](https://github.com/alibaba/formily/commit/334ff1bc) :point_right: ( [Janry](https://github.com/Janry) ) + +1. [fix(element): fix select label error (#2202)](https://github.com/alibaba/formily/commit/c8b513e0) :point_right: ( [Muyao](https://github.com/Muyao) ) + +### :memo: Documents Changes + +1. [docs(vue/element): add codesandbox support (#2206)](https://github.com/alibaba/formily/commit/07739bb9) :point_right: ( [Muyao](https://github.com/Muyao) ) + +### :rocket: Improve Performance + +1. [perf(path): use Map replace LRUMap](https://github.com/alibaba/formily/commit/1141e580) :point_right: ( [janrywang](https://github.com/janrywang) ) + +### :blush: Other Changes + +1. [chore(workflow): update ci actions](https://github.com/alibaba/formily/commit/aba1e3f0) :point_right: ( [janrywang](https://github.com/janrywang) ) + +1. [chore(deps-dev): bump semver-regex from 2.0.0 to 3.1.3 (#2209)](https://github.com/alibaba/formily/commit/94a6ffcc) :point_right: ( [dependabot[bot]](https://github.com/dependabot[bot]) ) + +1. [chore(desingbale): move designable-antd/next to designable repo](https://github.com/alibaba/formily/commit/84327d2d) :point_right: ( [janrywang](https://github.com/janrywang) ) + +## v2.0.0-rc.9(2021-09-18) + +### :tada: Enhancements + +1. [feat(element): support element-ui slot (#2162)](https://github.com/alibaba/formily/commit/205e164c) :point_right: ( [Muyao](https://github.com/Muyao) ) + +### :beetle: Bug Fixes + +1. [fix(core): fix assign initialValue will overwrite value](https://github.com/alibaba/formily/commit/3fbb8697) :point_right: ( [janrywang](https://github.com/janrywang) ) + +## v2.0.0-rc.8(2021-09-17) + +### :tada: Enhancements + +1. [feat(react): fix schema x-component-props children invalid (#2160)](https://github.com/alibaba/formily/commit/7dc9d9ff) :point_right: ( [Lyca](https://github.com/Lyca) ) + +### :memo: Documents Changes + +1. [docs(reactive): update toJS/markRaw docs](https://github.com/alibaba/formily/commit/77cb7b7b) :point_right: ( [janrywang](https://github.com/janrywang) ) + +### :rocket: Improve Performance + +1. [perf(schema): improve performance](https://github.com/alibaba/formily/commit/184884ca) :point_right: ( [janrywang](https://github.com/janrywang) ) + +### :blush: Other Changes + +1. [chore(workflow): fix actions](https://github.com/alibaba/formily/commit/12dacdcc) :point_right: ( [Janry](https://github.com/Janry) ) + +1. [chore(designable): lock version](https://github.com/alibaba/formily/commit/b61ad907) :point_right: ( [janrywang](https://github.com/janrywang) ) + +## v2.0.0-rc.7(2021-09-15) + +### :beetle: Bug Fixes + +1. [fix(json-schema/reactive): fix circular reference check logic](https://github.com/alibaba/formily/commit/b356dad3) :point_right: ( [janrywang](https://github.com/janrywang) ) + ## v2.0.0-rc.6(2021-09-14) ### :beetle: Bug Fixes @@ -733,145 +793,3 @@ ### :rose: Improve code quality 1. [refactor(core): controlled ==> designable](https://github.com/alibaba/formily/commit/ac79c196) :point_right: ( [janrywang](https://github.com/janrywang) ) - -## v2.0.0-beta.60(2021-06-02) - -### :tada: Enhancements - -1. [feat(json-schema): add silent static method](https://github.com/alibaba/formily/commit/f1277ba2) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(antd/next): support data props to FormItem](https://github.com/alibaba/formily/commit/a3750ec5) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(designable): add SchemaRenderWidget](https://github.com/alibaba/formily/commit/ef49b45f) :point_right: ( [janrywang](https://github.com/janrywang) ) - -### :beetle: Bug Fixes - -1. [fix(react): fix ci](https://github.com/alibaba/formily/commit/f7fdbcd3) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(antd): fix typings](https://github.com/alibaba/formily/commit/6d8b1f22) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(core): fix array path calculation #1533](https://github.com/alibaba/formily/commit/29249000) :point_right: ( [janrywang](https://github.com/janrywang) ) - -### :blush: Other Changes - -1. [chore(pkg): add workspaces](https://github.com/alibaba/formily/commit/d8af530e) :point_right: ( [janrywang](https://github.com/janrywang) ) - -## v2.0.0-beta.59(2021-06-01) - -### :beetle: Bug Fixes - -1. [fix(react): fix useFormEffects not support StrictMode #1491](https://github.com/alibaba/formily/commit/0198b0c4) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(core): fix field value restored incorrectly when hidden toggled (#1529)](https://github.com/alibaba/formily/commit/047c98af) :point_right: ( [JustDs](https://github.com/JustDs) ) - -1. [fix(core): fix array field path calculation](https://github.com/alibaba/formily/commit/cdae914c) :point_right: ( [janrywang](https://github.com/janrywang) ) - -### :rose: Improve code quality - -1. [refactor(designable): update directory structure](https://github.com/alibaba/formily/commit/bb300a00) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [refactor(reactive-react): refactor observer function (#1523)](https://github.com/alibaba/formily/commit/55b93420) :point_right: ( [liuwei](https://github.com/liuwei) ) - -### :blush: Other Changes - -1. [chore(readme): update readme](https://github.com/alibaba/formily/commit/96140630) :point_right: ( [janrywang](https://github.com/janrywang) ) - -## v2.0.0-beta.58(2021-05-27) - -### :tada: Enhancements - -1. [feat(next): add ArrayCollapse (#1513)](https://github.com/alibaba/formily/commit/ebddc015) :point_right: ( [Lind](https://github.com/Lind) ) - -### :beetle: Bug Fixes - -1. [fix(vue): remove empty default slots of fields (#1517)](https://github.com/alibaba/formily/commit/00a80b4b) :point_right: ( [月落音阑](https://github.com/月落音阑) ) - -### :memo: Documents Changes - -1. [docs(json-schema): add definitions and doc](https://github.com/alibaba/formily/commit/e729e007) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [docs(core): fix typo (#1512)](https://github.com/alibaba/formily/commit/c568de99) :point_right: ( [后浪](https://github.com/后浪) ) - -### :blush: Other Changes - -1. [chore(workflow): update ci action](https://github.com/alibaba/formily/commit/d3dd91ca) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(github): update pr template](https://github.com/alibaba/formily/commit/b3149307) :point_right: ( [janrywang](https://github.com/janrywang) ) - -## v2.0.0-beta.57(2021-05-27) - -### :tada: Enhancements - -1. [feat(json-schema): support definitions and #1147](https://github.com/alibaba/formily/commit/87339c70) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(core): support more types for dataSource](https://github.com/alibaba/formily/commit/6715555e) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(react): support x-component-props.children](https://github.com/alibaba/formily/commit/c8176380) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(next): support form drawer get context from fusion (#1511)](https://github.com/alibaba/formily/commit/7fce306c) :point_right: ( [王大白](https://github.com/王大白) ) - -1. [feat(next): add fusion multiple lang of validator (#1504)](https://github.com/alibaba/formily/commit/2ca07e7a) :point_right: ( [王大白](https://github.com/王大白) ) - -1. [feat(antd): support defaultOpenPanelCount for ArrayCollapse (#1505)](https://github.com/alibaba/formily/commit/e9e3f74e) :point_right: ( [Lind](https://github.com/Lind) ) - -1. [feat(next): add stopPropagation to array-base events](https://github.com/alibaba/formily/commit/276a5fbb) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [feat(core): remove property of form values with undefined value (#1495)](https://github.com/alibaba/formily/commit/296eae47) :point_right: ( [小黄黄](https://github.com/小黄黄) ) - -### :beetle: Bug Fixes - -1. [fix(antd): fix ArrayCollapse items calculation](https://github.com/alibaba/formily/commit/1d10ac81) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(react): fix ci](https://github.com/alibaba/formily/commit/9826425c) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(core): remove @types/react peerDependencies](https://github.com/alibaba/formily/commit/2ad43225) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(react): fix ReactComponentPropsByPathValue type return error result (#1507)](https://github.com/alibaba/formily/commit/fb7654eb) :point_right: ( [liuwei](https://github.com/liuwei) ) - -1. [fix(json-schema): fix single function x-reactions not work #1497](https://github.com/alibaba/formily/commit/ae5019df) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(core): fix reactive query #1494](https://github.com/alibaba/formily/commit/a0ca5b2b) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(validator): fix typo](https://github.com/alibaba/formily/commit/b1a83d2b) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [fix(path): fix realative path for sibling in array (#1492)](https://github.com/alibaba/formily/commit/860264d6) :point_right: ( [JustDs](https://github.com/JustDs) ) - -1. [fix(antd/next): fix FormItem typings (#1486)](https://github.com/alibaba/formily/commit/91b4b617) :point_right: ( [Nokecy](https://github.com/Nokecy) ) - -### :memo: Documents Changes - -1. [docs(readme): add download stats](https://github.com/alibaba/formily/commit/09ec8e52) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [docs(all): add inject global styles](https://github.com/alibaba/formily/commit/70852e91) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [docs(issue-helper): improve issue-helper](https://github.com/alibaba/formily/commit/e4d10d13) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [docs(guide): update issue helper](https://github.com/alibaba/formily/commit/76b58651) :point_right: ( [janrywang](https://github.com/janrywang) ) - -### :rose: Improve code quality - -1. [refactor(antd/next): rewrite PreviewText to JSXComponent (#1509)](https://github.com/alibaba/formily/commit/3f6c34d2) :point_right: ( [liuwei](https://github.com/liuwei) ) - -1. [refactor(json-schema): refactor stringify type to fix literal type is erased (#1508)](https://github.com/alibaba/formily/commit/43e79a61) :point_right: ( [liuwei](https://github.com/liuwei) ) - -### :blush: Other Changes - -1. [chore(dumi): update next css link](https://github.com/alibaba/formily/commit/6843d946) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(pkg): update lint-staged scripts](https://github.com/alibaba/formily/commit/ddd8fc9a) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(project): prettier all code and change style behavior](https://github.com/alibaba/formily/commit/3792c221) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(github): update git commit specific](https://github.com/alibaba/formily/commit/af58562c) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(scripts): remove mapCoverage.js](https://github.com/alibaba/formily/commit/3b3c3134) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(designable): add setters package](https://github.com/alibaba/formily/commit/d3bbca3b) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(workflow): Update check-pr-title.yml (#1490)](https://github.com/alibaba/formily/commit/9243908d) :point_right: ( [xrkffgg](https://github.com/xrkffgg) ) - -1. [chore(project): update pr template](https://github.com/alibaba/formily/commit/30d39dd1) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(workflow): add issue helper action](https://github.com/alibaba/formily/commit/e2d7c0ad) :point_right: ( [janrywang](https://github.com/janrywang) ) - -1. [chore(workflow): rename main.yml ==>commitlint.yml](https://github.com/alibaba/formily/commit/45734661) :point_right: ( [Janry](https://github.com/Janry) ) diff --git a/designable/.eslintrc b/designable/.eslintrc deleted file mode 100644 index 018630faf56..00000000000 --- a/designable/.eslintrc +++ /dev/null @@ -1,74 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "extends": [ - "plugin:react/recommended", - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint", - "plugin:markdown/recommended" - ], - "env": { - "node": true - }, - "plugins": ["@typescript-eslint", "react", "prettier", "markdown"], - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 10, - "ecmaFeatures": { - "jsx": true - } - }, - "settings": { - "react": { - "version": "detect" - } - }, - "rules": { - "prettier/prettier": 0, - // don't force es6 functions to include space before paren - "space-before-function-paren": 0, - "react/prop-types": 0, - "react/no-find-dom-node": 0, - "react/display-name": 0, - // allow specifying true explicitly for boolean props - "react/jsx-boolean-value": 0, - "react/no-did-update-set-state": 0, - // maybe we should no-public - "@typescript-eslint/explicit-member-accessibility": 0, - "@typescript-eslint/interface-name-prefix": 0, - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/explicit-function-return-type": 0, - "@typescript-eslint/no-parameter-properties": 0, - "@typescript-eslint/array-type": 0, - "@typescript-eslint/no-object-literal-type-assertion": 0, - "@typescript-eslint/no-use-before-define": 0, - "@typescript-eslint/no-unused-vars": 1, - "@typescript-eslint/no-namespace": 0, - "@typescript-eslint/ban-types": 0, - "@typescript-eslint/adjacent-overload-signatures": 0, - "@typescript-eslint/explicit-module-boundary-types": 0, - "@typescript-eslint/no-empty-function": 0, - "no-console": [ - "error", - { - "allow": ["warn", "error", "info"] - } - ], - "prefer-const": 0, - "no-var": 1, - "prefer-rest-params": 0 - }, - "overrides": [ - { - "files": ["**/*.md"], - "processor": "markdown/markdown" - }, - { - "files": ["**/*.md/*.{jsx,tsx}"], - "rules": { - "@typescript-eslint/no-unused-vars": "error", - "no-unused-vars": "error", - "no-console": "off" - } - } - ] -} diff --git a/designable/antd/.umirc.js b/designable/antd/.umirc.js deleted file mode 100644 index 1362b3c43c6..00000000000 --- a/designable/antd/.umirc.js +++ /dev/null @@ -1,44 +0,0 @@ -import { resolve } from 'path' -export default { - mode: 'site', - logo: '//img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg', - title: 'Formily', - hash: true, - favicon: - '//img.alicdn.com/imgextra/i3/O1CN01XtT3Tv1Wd1b5hNVKy_!!6000000002810-55-tps-360-360.svg', - outputPath: './doc-site', - navs: [ - { - title: 'Ant Design', - path: '/components', - }, - { - title: '主站', - path: 'https://v2.formilyjs.org', - }, - { - title: 'GITHUB', - path: 'https://github.com/alibaba/formily', - }, - ], - styles: [ - `.__dumi-default-navbar-logo{ - height: 60px !important; - width: 150px !important; - padding-left:0 !important; - color: transparent !important; - } - .__dumi-default-navbar{ - padding: 0 28px !important; - } - .__dumi-default-layout-hero{ - background-image: url(//img.alicdn.com/imgextra/i4/O1CN01ZcvS4e26XMsdsCkf9_!!6000000007671-2-tps-6001-4001.png); - background-size: cover; - background-repeat: no-repeat; - } - nav a{ - text-decoration: none !important; - } - `, - ], -} diff --git a/designable/antd/README.md b/designable/antd/README.md deleted file mode 100644 index 84103eebdc5..00000000000 --- a/designable/antd/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# @formily/designable-antd - -### Install - -```bash -npm install --save @formily/designable-antd -``` diff --git a/designable/antd/copy.ts b/designable/antd/copy.ts deleted file mode 100644 index d451fc48651..00000000000 --- a/designable/antd/copy.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { runCopy } from '../../scripts/build-style' - -runCopy({ - esStr: 'antd/es/', - libStr: 'antd/lib/', -}) diff --git a/designable/antd/package.json b/designable/antd/package.json deleted file mode 100644 index e0bc10e1dbc..00000000000 --- a/designable/antd/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "@formily/designable-antd", - "version": "2.0.0-rc.7", - "license": "MIT", - "main": "lib", - "module": "esm", - "umd:main": "dist/formily.designable.antd.umd.production.js", - "unpkg": "dist/formily.designable.umd.production.js", - "jsdelivr": "dist/formily.designable.umd.production.js", - "jsnext:main": "esm", - "repository": { - "type": "git", - "url": "git+https://github.com/alibaba/formily.git" - }, - "types": "esm/index.d.ts", - "bugs": { - "url": "https://github.com/alibaba/formily/issues" - }, - "homepage": "https://github.com/alibaba/formily#readme", - "engines": { - "npm": ">=3.0.0" - }, - "scripts": { - "build": "rimraf -rf lib esm dist && npm run build:cjs && npm run build:esm && npm run build:umd && ts-node copy", - "build:cjs": "tsc --project tsconfig.build.json", - "build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm", - "build:umd": "rollup --config", - "build:playground": "webpack-cli --config playground/webpack.prod.ts", - "start": "webpack-dev-server --config playground/webpack.dev.ts" - }, - "devDependencies": { - "@designable/react-settings-form": "^0.x", - "autoprefixer": "^9.0", - "file-loader": "^5.0.2", - "fs-extra": "^8.1.0", - "html-webpack-plugin": "^3.2.0", - "mini-css-extract-plugin": "^1.6.0", - "monaco-editor-webpack-plugin": "^4.0.0", - "raw-loader": "^4.0.0", - "react-monaco-editor": "^0.43.0", - "style-loader": "^1.1.3", - "ts-loader": "^7.0.4", - "typescript": "4.1.5", - "webpack": "^4.41.5", - "webpack-bundle-analyzer": "^3.9.0", - "webpack-cli": "^3.3.10", - "webpack-dev-server": "^3.10.1" - }, - "peerDependencies": { - "@types/react": ">=16.8.0 || >=17.0.0", - "@types/react-dom": ">=16.8.0 || >=17.0.0", - "antd": "^4.0.0", - "react": ">=16.8.0 || >=17.0.0", - "react-dom": ">=16.8.0", - "react-is": ">=16.8.0 || >=17.0.0" - }, - "dependencies": { - "@designable/core": "^0.x", - "@designable/formily": "^0.x", - "@designable/react": "^0.x", - "@formily/antd": "2.0.0-rc.7", - "@formily/core": "2.0.0-rc.7", - "@formily/designable-setters": "2.0.0-rc.7", - "@formily/react": "2.0.0-rc.7", - "@formily/shared": "2.0.0-rc.7" - }, - "publishConfig": { - "access": "public" - }, - "gitHead": "2c44ae410a73f02735c63c6430e021a50e21f3ec" -} diff --git a/designable/antd/playground/main.tsx b/designable/antd/playground/main.tsx deleted file mode 100644 index df5f255f327..00000000000 --- a/designable/antd/playground/main.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import { - Designer, - DesignerToolsWidget, - ViewToolsWidget, - Workspace, - OutlineTreeWidget, - DragSourceWidget, - HistoryWidget, - MainPanel, - CompositePanel, - WorkspacePanel, - ToolbarPanel, - ViewportPanel, - ViewPanel, - SettingsPanel, - ComponentTreeWidget, -} from '@designable/react' -import { SettingsForm } from '@designable/react-settings-form' -import { - createDesigner, - GlobalRegistry, - Shortcut, - KeyCode, -} from '@designable/core' -import { createDesignableField, createDesignableForm } from '../src' -import { - LogoWidget, - ActionsWidget, - PreviewWidget, - SchemaEditorWidget, - MarkupSchemaWidget, -} from './widgets' -import { saveSchema } from './service' -import 'antd/dist/antd.less' -GlobalRegistry.registerDesignerLocales({ - 'zh-CN': { - sources: { - Inputs: '输入控件', - Layouts: '布局组件', - Arrays: '自增组件', - Displays: '展示组件', - }, - }, - 'en-US': { - sources: { - Inputs: 'Inputs', - Layouts: 'Layouts', - Arrays: 'Arrays', - Displays: 'Displays', - }, - }, -}) - -const Root = createDesignableForm({ - registryName: 'Root', -}) - -const DesignableField = createDesignableField({ - registryName: 'DesignableField', -}) - -const SaveShortCut = new Shortcut({ - codes: [ - [KeyCode.Meta, KeyCode.S], - [KeyCode.Control, KeyCode.S], - ], - handler(ctx) { - saveSchema(ctx.engine) - }, -}) - -const engine = createDesigner({ - shortcuts: [SaveShortCut], -}) - -const App = () => { - return ( - - } actions={}> - - - - - - - - - - - - - - - - - - - - - - - {() => ( - - )} - - - {(tree, onChange) => ( - - )} - - - {(tree) => } - - - {(tree) => } - - - - - - - - - - ) -} - -ReactDOM.render(, document.getElementById('root')) diff --git a/designable/antd/playground/service/index.ts b/designable/antd/playground/service/index.ts deleted file mode 100644 index cb7cdd48bd0..00000000000 --- a/designable/antd/playground/service/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './schema' diff --git a/designable/antd/playground/service/schema.ts b/designable/antd/playground/service/schema.ts deleted file mode 100644 index 1c7b2c63996..00000000000 --- a/designable/antd/playground/service/schema.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Engine } from '@designable/core' -import { transformToSchema, transformToTreeNode } from '@designable/formily' -import { message } from 'antd' - -export const saveSchema = (designer: Engine) => { - localStorage.setItem( - 'formily-schema', - JSON.stringify( - transformToSchema(designer.getCurrentTree(), { - designableFieldName: 'DesignableField', - designableFormName: 'Root', - }) - ) - ) - message.success('Save Success') -} - -export const loadInitialSchema = (designer: Engine) => { - try { - designer.setCurrentTree( - transformToTreeNode(JSON.parse(localStorage.getItem('formily-schema')), { - designableFieldName: 'DesignableField', - designableFormName: 'Root', - }) - ) - } catch {} -} diff --git a/designable/antd/playground/webpack.dev.ts b/designable/antd/playground/webpack.dev.ts deleted file mode 100644 index 710c0570dae..00000000000 --- a/designable/antd/playground/webpack.dev.ts +++ /dev/null @@ -1,56 +0,0 @@ -import baseConfig from './webpack.base' -import HtmlWebpackPlugin from 'html-webpack-plugin' -import MiniCssExtractPlugin from 'mini-css-extract-plugin' -import MonacoPlugin from 'monaco-editor-webpack-plugin' -//import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' -import webpack from 'webpack' -import path from 'path' - -const PORT = 3000 - -const createPages = (pages) => { - return pages.map(({ filename, template, chunk }) => { - return new HtmlWebpackPlugin({ - filename, - template, - inject: 'body', - chunks: chunk, - }) - }) -} - -for (const key in baseConfig.entry) { - if (Array.isArray(baseConfig.entry[key])) { - baseConfig.entry[key].push( - require.resolve('webpack/hot/dev-server'), - `${require.resolve('webpack-dev-server/client')}?http://localhost:${PORT}` - ) - } -} - -export default { - ...baseConfig, - plugins: [ - new MiniCssExtractPlugin({ - filename: '[name].[hash].css', - chunkFilename: '[id].[hash].css', - }), - ...createPages([ - { - filename: 'index.html', - template: path.resolve(__dirname, './template.ejs'), - chunk: ['playground'], - }, - ]), - new webpack.HotModuleReplacementPlugin(), - new MonacoPlugin({ - languages: ['json'], - }), - // new BundleAnalyzerPlugin() - ], - devServer: { - host: '127.0.0.1', - open: true, - port: PORT, - }, -} diff --git a/designable/antd/playground/webpack.prod.ts b/designable/antd/playground/webpack.prod.ts deleted file mode 100644 index 520f909e4f0..00000000000 --- a/designable/antd/playground/webpack.prod.ts +++ /dev/null @@ -1,40 +0,0 @@ -import baseConfig from './webpack.base' -import HtmlWebpackPlugin from 'html-webpack-plugin' -import MiniCssExtractPlugin from 'mini-css-extract-plugin' -import MonacoPlugin from 'monaco-editor-webpack-plugin' -import path from 'path' - -const createPages = (pages) => { - return pages.map(({ filename, template, chunk }) => { - return new HtmlWebpackPlugin({ - filename, - template, - inject: 'body', - chunks: chunk, - }) - }) -} - -export default { - ...baseConfig, - mode: 'production', - plugins: [ - new MiniCssExtractPlugin({ - filename: '[name].[hash].css', - chunkFilename: '[id].[hash].css', - }), - ...createPages([ - { - filename: 'index.html', - template: path.resolve(__dirname, './template.ejs'), - chunk: ['playground'], - }, - ]), - new MonacoPlugin({ - languages: ['json'], - }), - ], - optimization: { - minimize: true, - }, -} diff --git a/designable/antd/playground/widgets/ActionsWidget.tsx b/designable/antd/playground/widgets/ActionsWidget.tsx deleted file mode 100644 index e9cc15e1341..00000000000 --- a/designable/antd/playground/widgets/ActionsWidget.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import React, { useEffect } from 'react' -import { Space, Button, Radio } from 'antd' -import { GithubOutlined } from '@ant-design/icons' -import { useDesigner, TextWidget } from '@designable/react' -import { GlobalRegistry } from '@designable/core' -import { observer } from '@formily/react' -import { loadInitialSchema, saveSchema } from '../service' - -export const ActionsWidget = observer(() => { - const designer = useDesigner() - useEffect(() => { - loadInitialSchema(designer) - }, []) - return ( - - - Alibaba Fusion - - { - GlobalRegistry.setDesignerLanguage(e.target.value) - }} - /> - - - Github - - { - saveSchema(designer) - }} - > - Save - - { - saveSchema(designer) - }} - > - Publish - - - ) -}) diff --git a/designable/antd/playground/widgets/LogoWidget.tsx b/designable/antd/playground/widgets/LogoWidget.tsx deleted file mode 100644 index a6b86de416c..00000000000 --- a/designable/antd/playground/widgets/LogoWidget.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react' -import { useTheme } from '@designable/react' - -const logo = { - dark: '//img.alicdn.com/imgextra/i2/O1CN01NTUDi81fHLQvZCPnc_!!6000000003981-55-tps-1141-150.svg', - light: - '//img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg', -} - -export const LogoWidget: React.FC = () => { - const url = logo[useTheme()] - return ( -
- - {text} - -
- {text} -