diff --git a/.dumi/global.less b/.dumi/global.less deleted file mode 100644 index 75f241ae0..000000000 --- a/.dumi/global.less +++ /dev/null @@ -1 +0,0 @@ -@import 'antd/dist/antd.css'; diff --git a/.eslintrc b/.eslintrc index d23c6be12..3ad109eb3 100755 --- a/.eslintrc +++ b/.eslintrc @@ -14,7 +14,9 @@ "react", "react-hooks", "prettier", - "promise" + "promise", + "jest-dom", + "testing-library" //"import" ], "globals": { diff --git a/README.md b/README.md index c35254822..a3a89d65a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ English | [中文](./README.zh-CN.md) | [Türkçe](./README.tr-TR.md) NocoBase is in early stage of development and is subject to frequent changes, please use caution in production environments. -NocoBase v0.10 has been released, see [v0.10: update instructions](http://docs.nocobase.com/welcome/release/v10-changelog) for details. +## Recent major updates + +- [v0.11: New client application, plugin and router - 2023/07/08](http://docs.nocobase.com/welcome/release/v11-changelog) +- [v0.10: Update instructions - 2023/06/23](http://docs.nocobase.com/welcome/release/v10-changelog) ## We are hiring diff --git a/README.tr-TR.md b/README.tr-TR.md index 01d17c903..cf152eb87 100644 --- a/README.tr-TR.md +++ b/README.tr-TR.md @@ -8,6 +8,11 @@ NocoBase, geliştirmenin ilk aşamasındadır ve sık sık değişiklik yaparak NocoBase v0.10 has been released, see [v0.10: update instructions](http://docs.nocobase.com/welcome/release/v10-changelog) for details. +## Recent major updates + +- [v0.11: New client application, plugin and router - 2023/07/08](http://docs.nocobase.com/welcome/release/v11-changelog) +- [v0.10: Update instructions - 2023/06/23](http://docs.nocobase.com/welcome/release/v10-changelog) + ## Çalışma arkadaşımız olabilirsiniz Takıma katılacak tam zamanlı, uzaktan ürün tasarımı ve geliştirme arkadaşları arıyoruz. NocoBase'e güçlü bir ilginiz varsa, lütfen bize hello@nocobase.com adresinden e-posta göndermekten çekinmeyin. diff --git a/README.zh-CN.md b/README.zh-CN.md index 035ee4c56..7bb8b73e6 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -6,7 +6,10 @@ NocoBase 正处在早期开发阶段,可能变动频繁,请谨慎用于生产环境。 -NocoBase v0.10 已发布,详情查看 [v0.10 更新说明](http://docs-cn.nocobase.com/welcome/release/v10-changelog)。 +## 最近重要更新 + +- [v0.11: New client application, plugin and router - 2023/07/08](http://docs-cn.nocobase.com/welcome/release/v11-changelog) +- [v0.10: Update instructions - 2023/06/23](http://docs-cn.nocobase.com/welcome/release/v10-changelog) ## 我们在招聘 diff --git a/docs/en-US/development/client/ui-schema-designer/collection-manager.md b/docs/en-US/development/client/ui-schema-designer/collection-manager.md index ff813ad87..e4154eb14 100644 --- a/docs/en-US/development/client/ui-schema-designer/collection-manager.md +++ b/docs/en-US/development/client/ui-schema-designer/collection-manager.md @@ -11,8 +11,7 @@ import { CollectionProvider, CollectionField, } from '@nocobase/client'; -import 'antd/dist/antd.css'; -import { FormItem, Input } from '@formily/antd'; +import { FormItem, Input } from '@formily/antd-v5'; export default observer(() => { const collection = { diff --git a/docs/en-US/welcome/release/v11-changelog.md b/docs/en-US/welcome/release/v11-changelog.md index 928faef47..7fec00b00 100644 --- a/docs/en-US/welcome/release/v11-changelog.md +++ b/docs/en-US/welcome/release/v11-changelog.md @@ -1,6 +1,19 @@ # v0.11: Update instructions -## Plugin registration and use +## New features + +- New client application, plugin and router +- Ant design upgrade to v5 +- New plugin + - Data visualization + - API keys + - Google map + +## Incompatible changes + +### New client application, plugin and router + +#### Plugin changes before you had to pass a component and the component needed to pass `props.children`, for example: @@ -45,6 +58,8 @@ plugins are very powerful and can do a lot of things in the `load` phase: - add Scopes - load other plugins +#### Routing changes + if you used `RouteSwitchContext` to modify the route before, you now need to replace it with a plugin: ```tsx | pure @@ -97,4 +112,9 @@ const HelloProvider = (props) => { + export default HelloPlugin; ``` -more details can be found in [plugin development](/development/client). +more details can be found in [packages/core/client/src/application/index.md](https://github.com/nocobase/nocobase/blob/main/packages/core/client/src/application/index.md) + +### antd upgrade to v5 + +- antd related details view the official website [V4 to V5](https://ant.design/docs/react/migration-v5) +- `@formily/antd` replace with `@formily/antd-v5` diff --git a/docs/tr-TR/development/client/ui-schema-designer/collection-manager.md b/docs/tr-TR/development/client/ui-schema-designer/collection-manager.md index ff813ad87..e4154eb14 100644 --- a/docs/tr-TR/development/client/ui-schema-designer/collection-manager.md +++ b/docs/tr-TR/development/client/ui-schema-designer/collection-manager.md @@ -11,8 +11,7 @@ import { CollectionProvider, CollectionField, } from '@nocobase/client'; -import 'antd/dist/antd.css'; -import { FormItem, Input } from '@formily/antd'; +import { FormItem, Input } from '@formily/antd-v5'; export default observer(() => { const collection = { diff --git a/docs/zh-CN/development/client/ui-schema-designer/collection-manager.md b/docs/zh-CN/development/client/ui-schema-designer/collection-manager.md index ff813ad87..e4154eb14 100644 --- a/docs/zh-CN/development/client/ui-schema-designer/collection-manager.md +++ b/docs/zh-CN/development/client/ui-schema-designer/collection-manager.md @@ -11,8 +11,7 @@ import { CollectionProvider, CollectionField, } from '@nocobase/client'; -import 'antd/dist/antd.css'; -import { FormItem, Input } from '@formily/antd'; +import { FormItem, Input } from '@formily/antd-v5'; export default observer(() => { const collection = { diff --git a/package.json b/package.json index ec6667d5e..b4e07acc1 100644 --- a/package.json +++ b/package.json @@ -45,27 +45,30 @@ }, "devDependencies": { "commander": "^9.2.0", - "@types/react": "^17.0.0", - "@types/react-dom": "^17.0.0", - "react": "^18.0.0", - "react-dom": "^18.0.0", "@commitlint/cli": "^16.1.0", "@commitlint/config-conventional": "^16.0.0", "@commitlint/prompt-cli": "^16.1.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^12.1.5", "@testing-library/user-event": "^14.4.3", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", "@vitejs/plugin-react": "^4.0.0", "auto-changelog": "^2.4.0", "dumi": "^2.2.0", "dumi-theme-nocobase": "^0.2.14", + "eslint-plugin-jest-dom": "^5.0.1", + "eslint-plugin-testing-library": "^5.11.0", "ghooks": "^2.0.4", "jsdom-worker": "^0.3.0", "prettier": "^2.2.1", "pretty-format": "^24.0.0", "pretty-quick": "^3.1.0", - "vite": "^4.3.9", - "vitest": "^0.32.0" + "react": "^18.0.0", + "react-dom": "^18.0.0", + "typescript": "5.1.3", + "vite": "^4.4.1", + "vitest": "^0.33.0" }, "volta": { "node": "18.14.2", diff --git a/packages/app/client/src/pages/index.tsx b/packages/app/client/src/pages/index.tsx index 98a45bf37..2d4c6ff32 100644 --- a/packages/app/client/src/pages/index.tsx +++ b/packages/app/client/src/pages/index.tsx @@ -1,4 +1,3 @@ -import '@/theme'; import { Application } from '@nocobase/client'; import { NocoBaseClientPresetPlugin } from '@nocobase/preset-nocobase/client'; diff --git a/packages/app/client/src/theme.ts b/packages/app/client/src/theme.ts deleted file mode 100644 index 3c45d31b3..000000000 --- a/packages/app/client/src/theme.ts +++ /dev/null @@ -1,6 +0,0 @@ -if (localStorage.getItem('NOCOBASE_THEME') === 'compact') { - import('antd/dist/antd.compact.css'); -} else { - import('antd/dist/antd.css'); -} -window.document.documentElement.classList.add('theme-' + (localStorage.getItem('NOCOBASE_THEME') || 'default')); diff --git a/packages/core/build/package.json b/packages/core/build/package.json index 714cd2914..41c23d6a3 100755 --- a/packages/core/build/package.json +++ b/packages/core/build/package.json @@ -8,31 +8,31 @@ }, "typings": "./index.d.ts", "dependencies": { - "@babel/core": "7.12.3", - "@babel/plugin-proposal-class-properties": "7.12.1", - "@babel/plugin-proposal-decorators": "7.12.1", - "@babel/plugin-proposal-do-expressions": "7.12.1", - "@babel/plugin-proposal-export-default-from": "7.12.1", - "@babel/plugin-proposal-export-namespace-from": "7.12.1", - "@babel/plugin-proposal-nullish-coalescing-operator": "7.12.1", - "@babel/plugin-proposal-optional-chaining": "7.12.1", + "@babel/core": "7.22.5", + "@babel/plugin-proposal-class-properties": "7.18.6", + "@babel/plugin-proposal-decorators": "7.22.5", + "@babel/plugin-proposal-do-expressions": "7.22.5", + "@babel/plugin-proposal-export-default-from": "7.22.5", + "@babel/plugin-proposal-export-namespace-from": "7.18.9", + "@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6", + "@babel/plugin-proposal-optional-chaining": "7.21.0", "@babel/plugin-syntax-dynamic-import": "7.8.3", - "@babel/plugin-transform-modules-commonjs": "7.12.1", - "@babel/plugin-transform-runtime": "7.12.1", + "@babel/plugin-transform-modules-commonjs": "7.22.5", + "@babel/plugin-transform-runtime": "7.22.5", "@babel/preset-env": "7.12.1", - "@babel/preset-react": "7.12.1", - "@babel/preset-typescript": "7.12.1", - "@babel/register": "7.12.1", + "@babel/preset-react": "7.22.5", + "@babel/preset-typescript": "7.22.5", + "@babel/register": "7.22.5", "@lerna/filter-packages": "4.0.0", "@lerna/project": "4.0.0", "@lerna/query-graph": "4.0.0", - "@rollup/plugin-babel": "5.3.1", - "@rollup/plugin-commonjs": "16.0.0", - "@rollup/plugin-inject": "4.0.2", - "@rollup/plugin-json": "4.1.0", - "@rollup/plugin-node-resolve": "10.0.0", - "@rollup/plugin-replace": "2.3.4", - "@rollup/plugin-url": "5.0.1", + "@rollup/plugin-babel": "6.0.3", + "@rollup/plugin-commonjs": "25.0.1", + "@rollup/plugin-inject": "5.0.3", + "@rollup/plugin-json": "6.0.0", + "@rollup/plugin-node-resolve": "15.1.0", + "@rollup/plugin-replace": "5.0.2", + "@rollup/plugin-url": "8.0.1", "@svgr/rollup": "5.5.0", "ajv": "6.12.6", "autoprefixer": "9.6.0", @@ -45,23 +45,23 @@ "gulp-if": "2.0.2", "gulp-less": "^5.0.0", "gulp-plumber": "^1.2.1", - "gulp-typescript": "5.0.1", + "gulp-typescript": "6.0.0-alpha.1", "less": "4.1.3", "less-plugin-npm-import": "2.1.0", "lodash": "4.17.21", "pkg-up": "3.1.0", "rimraf": "2.6.3", - "rollup": "2.33.3", - "rollup-plugin-postcss": "3.1.8", + "rollup": "3.25.1", + "rollup-plugin-postcss": "4.0.2", "rollup-plugin-terser": "7.0.2", - "rollup-plugin-typescript2": "0.29.0", + "rollup-plugin-typescript2": "0.34.1", "semver": "6.1.1", "signale": "1.4.0", "slash2": "2.0.0", "temp-dir": "2.0.0", "through2": "3.0.1", - "ts-loader": "^8.0.7", - "typescript": "4.5.5", + "ts-loader": "^9.4.3", + "typescript": "5.1.3", "update-notifier": "3.0.0", "vinyl-fs": "3.0.3", "yargs-parser": "13.1.2" diff --git a/packages/core/client/.dumi/global.less b/packages/core/client/.dumi/global.less deleted file mode 100644 index 75f241ae0..000000000 --- a/packages/core/client/.dumi/global.less +++ /dev/null @@ -1 +0,0 @@ -@import 'antd/dist/antd.css'; diff --git a/packages/core/client/package.json b/packages/core/client/package.json index 31965ff65..3c205ff6e 100644 --- a/packages/core/client/package.json +++ b/packages/core/client/package.json @@ -11,14 +11,15 @@ "@dnd-kit/core": "^5.0.1", "@dnd-kit/sortable": "^6.0.0", "@emotion/css": "^11.7.1", - "@formily/antd": "2.2.26", + "@formily/antd-v5": "^1.1.0-beta.4", "@formily/core": "2.2.26", "@formily/react": "2.2.26", "@nocobase/evaluators": "0.10.1-alpha.1", "@nocobase/sdk": "0.10.1-alpha.1", "@nocobase/utils": "0.10.1-alpha.1", "ahooks": "^3.7.2", - "antd": "^4.24.8", + "antd": "^5.6.4", + "antd-style": "^3.3.0", "axios": "^0.26.1", "classnames": "^2.3.1", "cron-parser": "^4.6.0", @@ -31,16 +32,16 @@ "mathjs": "^10.6.0", "mermaid": "9.4.3", "react-beautiful-dnd": "^13.1.0", - "react-big-calendar": "^0.38.7", + "react-big-calendar": "^1.8.1", "react-drag-listview": "^0.1.9", - "react-error-boundary": "^4.0.3", + "react-error-boundary": "^4.0.10", "react-helmet": "^6.1.0", "react-hotkeys-hook": "^3.4.7", "react-i18next": "^11.15.1", "react-iframe": "~1.8.5", "react-image-lightbox": "^5.1.4", "react-js-cron": "^3.1.0", - "react-quill": "^1.3.5", + "react-quill": "^2.0.0", "react-router-dom": "^6.11.2", "react-to-print": "^2.14.7", "sanitize-html": "2.10.0", @@ -55,9 +56,10 @@ "devDependencies": { "dumi": "^2.2.0", "dumi-theme-nocobase": "^0.2.14", - "@testing-library/react": "^12.1.2", + "@testing-library/react": "^12.1.5", "@types/markdown-it": "12.2.3", "@types/markdown-it-highlightjs": "3.3.1", + "@types/react-big-calendar": "^1.6.4", "axios-mock-adapter": "^1.20.0" }, "gitHead": "ce588eefb0bfc50f7d5bbee575e0b5e843bf6644" diff --git a/packages/core/client/src/acl/Configuration/ConfigureCenter.tsx b/packages/core/client/src/acl/Configuration/ConfigureCenter.tsx index 69b102f86..4b0676ffe 100644 --- a/packages/core/client/src/acl/Configuration/ConfigureCenter.tsx +++ b/packages/core/client/src/acl/Configuration/ConfigureCenter.tsx @@ -5,6 +5,7 @@ import { useAPIClient, useRequest } from '../../api-client'; import { SettingsCenterContext } from '../../pm'; import { useRecord } from '../../record-provider'; import { useCompile } from '../../schema-component'; +import { useStyles } from '../style'; const getParentKeys = (tree, func, path = []) => { if (!tree) return []; @@ -69,6 +70,7 @@ const formatPluginTabs = (data) => { }; export const SettingsCenterConfigure = () => { + const { styles } = useStyles(); const record = useRecord(); const api = useAPIClient(); const pluginTags = useContext(SettingMenuContext); @@ -104,6 +106,7 @@ export const SettingsCenterConfigure = () => { return ( items?.length && (