Skip to content

Commit

Permalink
feat: using @umi/max
Browse files Browse the repository at this point in the history
commit a402afc
Author: Jingchao Di <[email protected]>
Date:   Sun May 12 00:33:56 2024 +0800

    feat: update

commit 9f48a0b
Author: Jingchao Di <[email protected]>
Date:   Sat May 11 23:58:07 2024 +0800

    feat: reenable

commit a876318
Author: Jingchao Di <[email protected]>
Date:   Sat May 11 23:48:43 2024 +0800

    feat: init with umi/max

commit 4c9dd59
Author: Jingchao Di <[email protected]>
Date:   Sat May 11 23:24:19 2024 +0800

    feat: enable umi@max
  • Loading branch information
alswl committed May 11, 2024
1 parent 2ec5814 commit 973536a
Show file tree
Hide file tree
Showing 24 changed files with 4,601 additions and 6,026 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/eslint'),
};
1 change: 1 addition & 0 deletions .husky.todo/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install max verify-commit $1
1 change: 1 addition & 0 deletions .husky.todo/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install lint-staged --quiet
17 changes: 17 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"*.{md,json}": [
"prettier --cache --write"
],
"*.{js,jsx}": [
"max lint --fix --eslint-only",
"prettier --cache --write"
],
"*.{css,less}": [
"max lint --fix --stylelint-only",
"prettier --cache --write"
],
"*.ts?(x)": [
"max lint --fix --eslint-only",
"prettier --cache --parser=typescript --write"
]
}
3 changes: 3 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: require.resolve('@umijs/max/stylelint'),
};
35 changes: 32 additions & 3 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
import { defineConfig } from 'umi';
import { defineConfig } from '@umijs/max';

export default defineConfig({
routes: [{ path: '/', component: 'index' }],
antd: {},
access: {},
model: {},
initialState: {},
request: {},
layout: {
title: 'dbml-editor',
locale: false,
},
routes: [
{
path: '/',
component: './Home',
},
{
name: 'Source',
path: 'https://github.com/alswl/dbml-editor',
external: true,
},
{
name: 'How to use DBML',
path: 'https://dbml.dbdiagram.io/home',
external: true,
},
{
name: '@alswl',
path: 'https://twitter.com/alswl',
external: true,
},

],
npmClient: 'pnpm',
title: 'dbml-editor by @alswl',
esbuildMinifyIIFE: true,
});
20 changes: 20 additions & 0 deletions mock/userAPI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const users = [
{ id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
{ id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
];

export default {
'GET /api/v1/queryUserList': (req: any, res: any) => {
res.json({
success: true,
data: { list: users },
errorCode: 0,
});
},
'PUT /api/v1/user/': (req: any, res: any) => {
res.json({
success: true,
errorCode: 0,
});
},
};
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,35 @@
"version": "0.1.0",
"author": "Jingchao Di <[email protected]>",
"scripts": {
"build": "umi build",
"dev": "umi dev",
"postinstall": "umi setup",
"setup": "umi setup",
"build": "max build",
"dev": "max dev",
"format": "prettier --cache --write .",
"postinstall": "max setup",
"prepare": "husky",
"setup": "max setup",
"start": "npm run dev"
},
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@ant-design/pro-components": "^2.4.4",
"@antv/layout": "^0.3.25",
"@antv/x6": "^2.18.1",
"@antv/x6-plugin-snapline": "^2.1.7",
"@antv/x6-react-shape": "^2.2.3",
"@dbml/core": "^3.4.3",
"@umijs/max": "^4.2.2",
"antd": "^5.16.5",
"axios": "^1.6.8",
"lodash-es": "^4.17.21",
"monaco-editor": "^0.48.0",
"react-monaco-editor": "^0.55.0",
"umi": "^4.1.10"
"react-monaco-editor": "^0.55.0"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"husky": "^9",
"lint-staged": "^13.2.0",
"@umijs/plugins": "^4.1.10",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.2",
Expand Down
Loading

0 comments on commit 973536a

Please sign in to comment.