Skip to content

Commit

Permalink
[Feature][scaleph-ui-react] add scaleph-ui-react2 module to upgrade w…
Browse files Browse the repository at this point in the history
…eb dependencies (#680)

feature: add scaleph-ui-react2 module

Co-authored-by: wangqi <wangqi@xinxuan.net>
  • Loading branch information
kalencaya and wangqi authored Jan 3, 2024
1 parent bc24b3b commit a3db2c1
Show file tree
Hide file tree
Showing 496 changed files with 47,570 additions and 0 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@

<modules>
<module>scaleph-ui-react</module>
<module>scaleph-ui-react2</module>

<module>scaleph-common</module>
<module>scaleph-dao</module>
Expand Down
16 changes: 16 additions & 0 deletions scaleph-ui-react2/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions scaleph-ui-react2/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=8001
8 changes: 8 additions & 0 deletions scaleph-ui-react2/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/lambda/
/scripts
/config
.history
public
dist
.umi
mock
8 changes: 8 additions & 0 deletions scaleph-ui-react2/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
};
41 changes: 41 additions & 0 deletions scaleph-ui-react2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc

# production
/dist
/dist-bin

# misc
.DS_Store
npm-debug.log*
yarn-error.log

/coverage
.idea
yarn.lock
package-lock.json
pnpm-lock.yaml
*bak


# visual studio code
.history
*.log
functions/*
.temp/**

# umi
.umi
.umi-production

# screenshot
screenshot
.firebase
.eslintcache

build
15 changes: 15 additions & 0 deletions scaleph-ui-react2/.hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"development"
],
"hints": {
"no-inline-styles": "off",
"typescript-config/consistent-casing": "off",
"axe/forms": [
"default",
{
"label": "off"
}
]
}
}
2 changes: 2 additions & 0 deletions scaleph-ui-react2/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# registry=https://registry.npmjs.org/
registry=https://registry.npm.taobao.org/
23 changes: 23 additions & 0 deletions scaleph-ui-react2/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**/*.svg
package.json
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
/public
5 changes: 5 additions & 0 deletions scaleph-ui-react2/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.prettier,
};
120 changes: 120 additions & 0 deletions scaleph-ui-react2/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
// https://umijs.org/config/
import { defineConfig } from "@umijs/max";
import defaultSettings from "./defaultSettings";
import proxy from "./proxy";
import routes from "./routes";

const { REACT_APP_ENV = "dev" } = process.env;

export default defineConfig({
/**
* @name 开启 hash 模式
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
* @doc https://umijs.org/docs/api/config#hash
*/
hash: true,

/**
* @name 兼容性设置
* @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
* @doc https://umijs.org/docs/api/config#targets
*/
// targets: {
// ie: 11,
// },
/**
* @name 路由的配置,不在路由中引入的文件不会编译
* @description 只支持 path,component,routes,redirect,wrappers,title 的配置
* @doc https://umijs.org/docs/guides/routes
*/
// umi routes: https://umijs.org/docs/routing
routes,
/**
* @name 主题的配置
* @description 虽然叫主题,但是其实只是 less 的变量设置
* @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn
* @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme
*/
theme: {
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
"root-entry-name": "variable",
},
/**
* @name moment 的国际化配置
* @description 如果对国际化没有要求,打开之后能减少js的包大小
* @doc https://umijs.org/docs/api/config#ignoremomentlocale
*/
ignoreMomentLocale: true,
/**
* @name 代理配置
* @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
* @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。
* @doc 代理介绍 https://umijs.org/docs/guides/proxy
* @doc 代理配置 https://umijs.org/docs/api/config#proxy
*/
proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
/**
* @name 快速热更新配置
* @description 一个不错的热更新组件,更新时可以保留 state
*/
fastRefresh: true,
//============== 以下都是max的插件配置 ===============
/**
* @name 数据流插件
* @@doc https://umijs.org/docs/max/data-flow
*/
model: {},
dva: {},
/**
* 一个全局的初始数据流,可以用它在插件之间共享数据
* @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。
* @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81
*/
initialState: {},
/**
* @name layout 插件
* @doc https://umijs.org/docs/max/layout-menu
*/
layout: {
locale: true,
...defaultSettings,
},
/**
* @name 国际化插件
* @doc https://umijs.org/docs/max/i18n
*/
locale: {
// default zh-CN
default: "zh-CN",
antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
},
/**
* @name antd 插件
* @description 内置了 babel import 插件
* @doc https://umijs.org/docs/max/antd#antd
*/
antd: {},
/**
* @name 网络请求配置
* @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
* @doc https://umijs.org/docs/max/request
*/
request: {},
/**
* @name 权限插件
* @description 基于 initialState 的权限插件,必须先打开 initialState
* @doc https://umijs.org/docs/max/access
*/
access: {},
icons: {},
//================ pro 插件配置 =================
presets: ["umi-presets-pro"],
mfsu: {
strategy: "normal",
},
requestRecord: {},
esbuildMinifyIIFE: true,
});
30 changes: 30 additions & 0 deletions scaleph-ui-react2/config/defaultSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Settings as LayoutSettings } from "@ant-design/pro-components";

const {PUBLIC_PATH} = process.env;
const baseURL = PUBLIC_PATH ?
(PUBLIC_PATH.endsWith("/") ? PUBLIC_PATH.substring(0, PUBLIC_PATH.length - 1) : PUBLIC_PATH)
: ''

/**
* @name
*/
const Settings: LayoutSettings & {
pwa?: boolean;
logo?: string;
} = {
navTheme: "light",
colorPrimary: "#1890ff",
layout: "mix",
contentWidth: "Fluid",
fixedHeader: true,
fixSiderbar: true,
colorWeak: false,
title: "Scaleph",
pwa: false,
logo: `${baseURL}/scaleph.svg`,
iconfontUrl: "",
splitMenus: true,
siderMenuType: "sub",
};

export default Settings;
25 changes: 25 additions & 0 deletions scaleph-ui-react2/config/proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @name 代理的配置
* @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* -------------------------------
* The agent cannot take effect in the production environment
* so there is no configuration of the production environment
* For details, please see
* https://pro.ant.design/docs/deploy
*
* @doc https://umijs.org/docs/guides/proxy
*/
export default {
dev: {
'/api/': {
target: 'http://localhost:8080/scaleph',
changeOrigin: true,
},
},
pre: {
'/api/': {
target: 'http://localhost:8080/scaleph',
changeOrigin: true,
},
},
};
Loading

0 comments on commit a3db2c1

Please sign in to comment.