Skip to content

Commit

Permalink
refactor(admin): 修正翻译内容未导出的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Dec 9, 2024
1 parent 058611e commit bcb9602
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 29 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
.PHONY: gen build-cmd build install init watch-server watch-admin watch test

ROOT = .
DOCS = $(ROOT)/docs
CMD = $(ROOT)/cmd
CMFX = $(ROOT)/cmfx
ADMIN = $(ROOT)/admin

DOC_API = $(DOCS)/api
CMD_SERVER = $(CMD)/server
SERVER_BIN = server

Expand All @@ -33,7 +31,7 @@ install:
npm install

# 安装基本数据,依赖 build 生成的测试项目
init:
init: build
cd $(CMD_SERVER) && ./server -a=install

watch-server:
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# cmfx

[![Go](https://github.com/issue9/cmfx/actions/workflows/go.yml/badge.svg)](https://github.com/issue9/cmfx/actions/workflows/go.yml)
[![vitest](https://github.com/issue9/cmfx/actions/workflows/vitest.yml/badge.svg)](https://github.com/issue9/cmfx/actions/workflows/vitest.yml)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/issue9/cmfx)](https://pkg.go.dev/github.com/issue9/cmfx)
![NPM Version](https://img.shields.io/npm/v/%40cmfx%2Fadmin)

![Go version](https://img.shields.io/github/go-mod/go-version/issue9/cmfx)
[![codecov](https://codecov.io/gh/issue9/cmfx/graph/badge.svg?token=D5y3FOJk8A)](https://codecov.io/gh/issue9/cmfx)

[![npm](https://github.com/issue9/cmfx/actions/workflows/npm.yml/badge.svg)](https://github.com/issue9/cmfx/actions/workflows/npm.yml)

![License](https://img.shields.io/github/license/issue9/cmfx)

[![PkgGoDev](https://pkg.go.dev/badge/github.com/issue9/cmfx)](https://pkg.go.dev/github.com/issue9/cmfx)
![NPM Version](https://img.shields.io/npm/v/%40cmfx%2Fadmin)

## 目录结构

- admin 前端管理后台的主目录
Expand Down
2 changes: 1 addition & 1 deletion admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmfx/admin",
"version": "0.7.8",
"version": "0.7.9",
"type": "module",
"description": "适用于 cmfx 的后台管理框架",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion admin/src/app/options/options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('build', async () => {
const locales: Locales = {
messages: {
'en': [async () => { return (await import('@/messages/en')).default; }],
'cmn-Hans': [async () => { return (await import('@/messages/cmn-Hans')).default; }],
'zh-Hans': [async () => { return (await import('@/messages/zh-Hans.ts')).default; }],
},
locales: ['en', 'cmn-Hans'],
fallback: 'en'
Expand Down
5 changes: 0 additions & 5 deletions admin/src/messages/README.md

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions admin/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default defineConfig({
'components': './src/components/index.ts',
'pages': './src/pages/index.ts',
'core': './src/core/index.ts',
'messages/en': './src/messages/en.ts',
'messages/zh-Hans': './src/messages/zh-Hans.ts',
},
formats: ['es', 'cjs'],
fileName: (format, name) => `${name}.${format}.js`
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmfx/admin-demo",
"version": "0.7.8",
"version": "0.7.9",
"type": "module",
"author": {
"name": "caixw",
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@solidjs/router": "^0.15.1",
"@cmfx/admin": "0.7.8",
"@cmfx/admin": "0.7.9",
"solid-js": "^1.9.3"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions cmd/admin/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const routes: Routes = {
routes: [
{ path: '/login', component: ()=><pages.current.Login footer={[
{title: '&copy; 2024 by Example .Inc', link: 'https://example.com'},
{title: 'aaaabbbcccdddeeefff'},
{title: 'text'},
{title: 'repo', link: 'https://github.com/issue/cmfx'},
]} /> },
]
Expand Down Expand Up @@ -100,13 +100,13 @@ const o: Options = {
async () => { return (await import('@cmfx/admin/dev/messages/en.ts')).default; },
async () => { return (await import('./locales/en')).default; },
],
'cmn-Hans': [
async () => { return (await import('@cmfx/admin/dev/messages/cmn-Hans.ts')).default; },
'zh-Hans': [
async () => { return (await import('@cmfx/admin/dev/messages/zh-Hans.ts')).default; },
async () => { return (await import('./locales/cmn-Hans')).default; },
],
},
fallback: 'en',
locales: ['en', 'cmn-Hans']
locales: ['en', 'zh-Hans']
},

api: {
Expand All @@ -123,4 +123,4 @@ const o: Options = {
userMenus: current.menus()
};

createApp('app', o);
await createApp('app', o);
2 changes: 1 addition & 1 deletion cmfx/cmfx.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// Version 表示当前框架的版本
const Version = "0.7.8"
const Version = "0.7.9"

// 400
const (
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cmfx/admin-eslint",
"version": "0.7.8",
"version": "0.7.9",
"type": "module",
"private": true,
"author": {
Expand Down

0 comments on commit bcb9602

Please sign in to comment.