Skip to content

Commit

Permalink
chore: 🔨 合并master
Browse files Browse the repository at this point in the history
  • Loading branch information
G committed Jan 4, 2024
2 parents 229845a + b39f564 commit a60070a
Show file tree
Hide file tree
Showing 352 changed files with 42,998 additions and 546 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/gh-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 1. 为工作流定义名字
name: 「GitHub Pages」Build & Deploy

# 2. 触发条件修改为: 当 main 或 master 分支, 有 push 的时候, 执行任务
on:
push:
branches:
- master
- admin

# 3. 创建工作流
jobs:
build: # 工作流名称
runs-on: ubuntu-latest # 依赖环境

steps: # 工作流步骤
# step 1. 获取源码, 拉取仓库代码
- name: Chekcout 🛎️ # 步骤名
uses: actions/checkout@master # 使用插件 => https://github.com/actions/checkout

- name: Install pnpm
uses: pnpm/[email protected]

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"

- name: Install dependencies
shell: bash
run: pnpm install

# step 3. 安装依赖并打包
- name: Install and Build 🔧
run: |
pnpm config set registry https://registry.npmmirror.com
pnpm build:admin
# step 4. 项目部署, 将打包后的产物合并到指定的分支上
- name: Deploy 🚀 # 步骤名
uses: JamesIves/[email protected] # 使用插件 => https://github.com/JamesIves/github-pages-deploy-action
with:
BRANCH: gh-pages # 部署分支
FOLDER: gbeata-dist # 打包, 静态资源输出的目录

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PACKAGE }}
run: |
cd ./apps/admin
npx semantic-release
27 changes: 27 additions & 0 deletions .github/workflows/push-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Notify WeChat on Tag

on:
push:
tags:
- "*"

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Extract Release Note
id: extract_note
run: echo ::set-output name=note::$(git show -s --format=%b ${{ github.sha }})

- name: Debug Release Note
run: echo "Release Note:${{ steps.extract_note.outputs.note }}"

- name: Send notification to WeChat
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d "{\"msgtype\": \"text\", \"text\": {\"content\": \"New tag created: ${{ github.ref }}\\nRelease Note: ${{ steps.extract_note.outputs.note }}\"}}" \
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=9875c111-57b0-42c4-a301-cdaed5e215cc"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ dist-ssr
server/dist
public/dist
es
lib
lib
gbeata-dist
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
branches: ["main"], // 指定在哪个分支下要执行发布操作
branches: ["main", "admin"], // 指定在哪个分支下要执行发布操作
plugins: [
"@semantic-release/commit-analyzer", // 解析 commit 信息,默认就是 Angular 规范
"@semantic-release/release-notes-generator",
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///Users/niyonggui/multiway/learn/2024/pnpm-monorepo-mui/.github/workflows/deploy-ui.yml"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
106 changes: 106 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,109 @@
# [1.3.0](https://github.com/anyone-yuren/react-antd-admin-pnpm/compare/v1.2.5...v1.3.0) (2024-01-03)


### Bug Fixes

* :bug: 同步esbuild版本 ([6e02325](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/6e02325f328d79cceb0b0df0418acde5c55df232))


### Features

* :sparkles: ceshi ([4295d28](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/4295d28af36c4b8a4e178229305abafc65f5a6db))
* :sparkles: ceshi ([e11cd31](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/e11cd31a86606a98b36c2cd34afe82aca33e2edc))
* :sparkles: ceshi ([0d4e8f3](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/0d4e8f3267141042f247a2759353f8642d43bbf9))
* :sparkles: ceshi ([b5b4454](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/b5b4454e4512517c220f406a9a95063e4b6edbb8))
* :sparkles: ceshi ([16a5f53](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/16a5f531aa47af4e565ceb3c6368dbf200941203))
* :sparkles: ceshi ([433ad9d](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/433ad9ddbd79a90e0328dcae75b7929bdd085c17))
* :sparkles: debugger ([fdc788d](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/fdc788df8c466be8567859832f5326489cd2683a))
* :sparkles: feat: 修改动态路由数据 ([c332d69](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/c332d69f87007671df2d04c17ea1ab67ae2a825a))
* :sparkles: feature 模块改造 ([9e0e814](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9e0e81406c10fba8fabc66d0b7f9c06ae720f30e))
* :sparkles: friends组件 ([5f92ffc](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/5f92ffc1f79a1a73e09e894b0bc44dc421aa78cb))
* :sparkles: less 转 antd-style写法 ([83e5382](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/83e53825434d1abd673e58570c098769858fff0c))
* :sparkles: te ttet ([d3f7563](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/d3f7563e24cafc54496458fb5041c4c1d74b5327))
* :sparkles: tesst ([a1cf56c](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/a1cf56c8c4d2fe8bc021e2216f46b3b5d1aca41c))
* :sparkles: test ([3bbec41](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/3bbec41a96462e42bfa5794a768148be3f072ea4))
* :sparkles: test ([dfe84fd](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/dfe84fdec7950460572a8f6368d8de913f132774))
* :sparkles: test ([d6761fb](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/d6761fb71b04cba4cdeb95f08baeb40e3cf6a086))
* :sparkles: test ([78ae6cf](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/78ae6cf56dcc0466af7207968bc2fed05ba70fcb))
* :sparkles: test ([253a176](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/253a176c1a3921db207ff092a6cf5b5ea221f7c6))
* :sparkles: test ([c11bed3](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/c11bed3715805395810b8a8c192ede3684b986bb))
* :sparkles: test ([47d4b75](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/47d4b754f7b68f85c810b89c5408e01ae1e9c403))
* :sparkles: testtest ([6275dd0](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/6275dd01868531f4e55d98c21a515a0b64e3a71b))
* :sparkles: 个人中心页面设计 ([cc37e2e](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/cc37e2e114d20c0062655fa7014e69eea68d4de3))
* :sparkles: 修改ADMINvite配置bug ([2b8901f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/2b8901f627cf1ce7828de4659fd783da08f72adb))
* :sparkles: 修改ant visible=>open ([0fcd283](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/0fcd283d1a44ab56d0d526b0a00cd40a956978bc))
* :sparkles: 修改lazyload默认导出 ([d2fa236](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/d2fa236445a76481f208b621254caff1b4b1b2bd))
* :sparkles: 修改lock mock版本 ([90dbed8](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/90dbed89f436c592a9528e98dbb91afc06c4675a))
* :sparkles: 修改logo、系统名称样式 ([46aadba](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/46aadbae3fe694f51dd081bffd14f5437e7d0d58))
* :sparkles: 修改Tags组件样式 ([9f626a5](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9f626a5fe4d999ee469eec691195f10700bf331f))
* :sparkles: 修改tags颜色 ([9ec557f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9ec557f8b2ef2f3ded1ab696a2dbbc0305409d8d))
* :sparkles: 修改tag标签样式BUG ([96c5e48](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/96c5e4878950793aa811e9b3697614631134c372))
* :sparkles: 修改userCard圆角样式 ([7a1aa84](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/7a1aa84322fb6f867da77bdadc02be1b3b15965a))
* :sparkles: 修改userCard组件样式 ([d74ab37](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/d74ab37aed0003c19e6c8fbaf81f473672f1f25d))
* :sparkles: 修改VITE配置 ([1b57ebf](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/1b57ebf7bee264c9f39951831a79137e8f20545d))
* :sparkles: 修改主题色 ([f0b5dbe](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/f0b5dbe254a06abe91936c464a4d19d99f8b0c9f))
* :sparkles: 修改启动页动画效果 ([4ed0a1a](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/4ed0a1af1c3289f44c7fc12cacdb1fdf5f93fa85))
* :sparkles: 修改头像 ([b21f8c3](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/b21f8c3f71f000c074a06a195b24bbe690592c5f))
* :sparkles: 修改头部样式以及主体背景色 ([942d1fa](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/942d1fa0738561f9c0fc1a29616acc3a56f71d00))
* :sparkles: 修改弹窗comfirm样式主题不生效问题 ([9494594](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9494594683e1d0d12b64793ac7c9b10b56cfd1e1))
* :sparkles: 修改构建node版本 ([267244b](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/267244ba4e89cfe19aa15cab4b0dd4d321d705f9))
* :sparkles: 修改构建胚子 ([4a4596f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/4a4596ff5d069aefd30ebd524d9dd8b91ccd3e02))
* :sparkles: 修改系统图标与公用配置抽离 ([1137e11](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/1137e11b25234deb97c120c17edd7b976eb4687d))
* :sparkles: 修改菜单样式 ([486c668](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/486c6683df0f963626e247a32f69979259170abb))
* :sparkles: 修改路由 ([469c401](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/469c401250b1dabab11a732ef50b42034ee3e09e))
* :sparkles: 修改首页布局 ([407c6ed](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/407c6ed34e15ec7e724dac6e984b2d229f604ea0))
* :sparkles: 修改首页请求异常问题 ([9f0b3b0](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9f0b3b0565bd4c6bce84ac89fa4728c2c055fa1b))
* :sparkles: 升级版本 ([2bf6224](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/2bf62241db1f45a1143410608cde21a0612e2d3f))
* :sparkles: 去除admin短路运算符限制 ([72e3aef](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/72e3aefe922d01b3360cd56a2d38c5d34ddd0034))
* :sparkles: 去除多余样式 ([3b1fa10](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/3b1fa1074a8910908e517d58b72b18a9908dd0d3))
* :sparkles: 去除测试代码 ([bff44ee](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/bff44ee677dcac37b01048d62a94bc8a3c5e0364))
* :sparkles: 启动页设计 ([0035bb0](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/0035bb0aac676a6db0dec14adeeeb11563bc4514))
* :sparkles: 增加npm参数 ([8a0756c](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/8a0756ca5556be1b1d41817956b05224c197987e))
* :sparkles: 完成proFile面板设计 ([a198765](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/a198765b9b59bb9a0e63d63fc151ebcd2b7cae82))
* :sparkles: 完成快捷操作搜索功能 ([d86ca8b](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/d86ca8b17eb1abb47942e0aa47da37cf92a31b41))
* :sparkles: 打印错误日志 ([956b104](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/956b104c6d5f09f021890a3050c21b5c2f4fc917))
* :sparkles: 新增apis模块,首页新增github记录 ([046cc3a](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/046cc3a0b7f868730becfd587a332005f08c6aec))
* :sparkles: 新增GlobalSearch组件 ([74bb8e6](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/74bb8e649d56c5fc5ec774be4de22876e04110af))
* :sparkles: 新增loading组件 ([8d17b48](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/8d17b48410af3f35ebb51fd78ff9be6c3bacbbf4))
* :sparkles: 新增logologo ([af9457f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/af9457f35285ff90ea8d611bf2e7da7f12eb4cff))
* :sparkles: 新增Slick组件,首页新增轮播 ([8f5d7c2](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/8f5d7c285608bdcadd1cc972a75abd19b5642410))
* :sparkles: 新增UI包,新增动画组件 ([7f5a8d0](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/7f5a8d082f8e279892d11fe7b0e543ec34996011))
* :sparkles: 新增一键换肤 ([dee7f96](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/dee7f961db14bb610c41556a0f9122e0becc116d))
* :sparkles: 新增主题切换 ([219fe76](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/219fe76c4cc11a66b01f0a22012714154f9dfa3d))
* :sparkles: 新增全局配置configProvider ([bd337bf](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/bd337bfd6e89c68a40e7fd76443c2b934450ed89))
* :sparkles: 新增系统logo ([a693e26](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/a693e2666ee426f6e44b45682e56998f1336d38a))
* :sparkles: 新增设置面板,完成主题切换 ([aad62bc](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/aad62bc2c5502960ce50353a8cf9802264edd169))
* :sparkles: 新增面包屑与页签控制 ([21d92b7](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/21d92b765a6ffe7b5b8ac3a90351d816b5003931))
* :sparkles: 更换logo ([ddffe83](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/ddffe83a321206acbe9bd1862bc8251acbd79f90))
* :sparkles: 更新依赖包 ([9557c10](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9557c1007e51d0a1b600e4b57d02eb16f137db4d))
* :sparkles: 测试 ([e97e52c](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/e97e52c322d72ea9d424c392e5904c5d8d68a3be))
* :sparkles: 测试 ([0054117](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/00541173dabd7faa5db3843a84e55f73d1a96b78))
* :sparkles: 测试 ([46583e9](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/46583e94a4f4601c053084d62ee57b6e936a888e))
* :sparkles: 测试 ([fb6c1b0](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/fb6c1b07475b1a4cc7b08b4834002a7ed6416bf5))
* :sparkles: 测试 ([777d68f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/777d68f2a80c08a3f1d7ed92d7026503971bb77a))
* :sparkles: 测试 ([ca9713b](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/ca9713b646865d9381010ce15ad1f70d73782ee6))
* :sparkles: 测试打包mock ([25dfb60](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/25dfb6046250f208ddc45f4fdc731b957bedae35))
* :sparkles: 测试提前加载 ([f5360d4](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/f5360d4723b6b1c68a02149560bde32ef11c5414))
* :sparkles: 测试生产环境mock ([76df4c8](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/76df4c8dcd28ae8a08c6a7bcb08364449feb407d))
* :sparkles: 测试路由 ([889a971](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/889a971991832bb000853dde85866050cacfc581))
* :sparkles: 测试路由bug ([f389274](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/f389274f32c6184c30135c030ebfc7f278b37355))
* :sparkles: 添加主题选择器 ([04cda0f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/04cda0fbbed090a4ee9b11d9d4c6393a2cda4d10))
* :sparkles: 添加全局Card 类名,添加按钮wave动效 ([e39a668](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/e39a668833b7b317dad3166d3371efc85eb65913))
* :sparkles: 添加全局Paper样式 ([7c49824](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/7c498248e3c49b1f7bc14216a012b4d438c1d0a7))
* :sparkles: 添加异步测试 ([bd18dda](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/bd18dda1ddcc0224f02dc2781e097b667a52ce71))
* :sparkles: 添加用户管理模块,修改meta参数,支持自定义图标大小 ([57401c1](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/57401c195126623defd074297a5c50f3861a5c70))
* :sparkles: 添加登录页标题, 错误页面icon ([67d356c](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/67d356cbdd0aa0bcd588022055f7a643691f1adb))
* :sparkles: 添加自定义token类型定义,完成登录页设计 ([1124c0d](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/1124c0d481f4702680a7490e3963bb4d40fa6d55))
* :sparkles: 添加首页欢迎面板 ([9727b16](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/9727b16e91bb3f5b16e67deec3284730b60c7d66))
* :sparkles: 登录页修改 ([12f1295](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/12f129555525ef49f83544dcc47707e4d9c3b196))
* :sparkles: 自动更新版本 ([eccde83](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/eccde830e931c60cfaef84029be95ff3621fbbaa))
* :sparkles: 设计用户Card ([0f97588](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/0f975886c64c49cea25f6914f00a9c94cdd98748))
* :sparkles: 请求admin分支提交记录 ([292dbd8](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/292dbd85f4e144687de344f3e7a94f0b0d65e06c))
* :sparkles: 还原 ([433111a](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/433111a3953ce4694814c2be83e3e6c0a56b7249))
* :sparkles: 降低react-router-dom版本 ([b8e234f](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/b8e234f4044389f9293ea0c7b3a15330c669704b))
* :sparkles: 首页统计 ([3b42a98](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/3b42a9867ab15809fc7c94e7ff582ffc2ef153fe))
* 还原路由 ([a0efb2e](https://github.com/anyone-yuren/react-antd-admin-pnpm/commit/a0efb2e2d791cac6d6d9586a68a95e44fc20f8ab))

# [1.1.0](https://github.com/anyone-yuren/pnpm-monorepo-mui/compare/v1.0.0...v1.1.0) (2023-12-15)


Expand Down
5 changes: 5 additions & 0 deletions apps/admin/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VITE_APP_BASE_API:

VITE_APP_BASE_URL: './'

VITE_PORT: 3100
3 changes: 3 additions & 0 deletions apps/admin/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_APP_BASE_API:

VITE_APP_BASE_URL: '/react-antd-admin-pnpm/'
1 change: 1 addition & 0 deletions apps/admin/.eslintcache

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions apps/admin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ['gbeata-eslint'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
};
Empty file added apps/admin/README.en-US.md
Empty file.
1 change: 1 addition & 0 deletions apps/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Gbeata Admin
39 changes: 39 additions & 0 deletions apps/admin/build/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
declare type Recordable<T = any> = Record<string, T>;

interface ViteEnv {
VITE_PORT: number
VITE_PROXY: [string, string][]
VITE_DROP_CONSOLE: boolean
}

// read all environment variable configuration files to process.env
export function wrapperEnv(envConf: Recordable): ViteEnv {
const result: any = {};

for (const envName of Object.keys(envConf)) {
let realName = envConf[envName].replace(/\\n/g, '\n');
realName = realName === 'true' ? true : realName === 'false' ? false : realName;

if (envName === 'VITE_PORT') {
realName = Number(realName);
}

if (envName === 'VITE_PROXY' && realName) {
try {
realName = JSON.parse(realName.replace(/'/g, '"'));
} catch (error) {
realName = '';
}
}

result[envName] = realName;

if (typeof realName === 'string') {
process.env[envName] = realName;
} else if (typeof realName === 'object') {
process.env[envName] = JSON.stringify(realName);
}
}

return result;
}
24 changes: 24 additions & 0 deletions apps/admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>react-admin-design</title>
<link
rel="stylesheet"
type="text/css"
charset="UTF-8"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
/>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit a60070a

Please sign in to comment.