Skip to content

Commit

Permalink
umi4
Browse files Browse the repository at this point in the history
  • Loading branch information
LY1806620741 committed Sep 22, 2023
1 parent 3af9a0d commit fca4bc3
Show file tree
Hide file tree
Showing 20 changed files with 9,078 additions and 171 deletions.
16 changes: 0 additions & 16 deletions .editorconfig

This file was deleted.

32 changes: 11 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,17 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: fast
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
- name: build-win
run: |
npm install yarn
yarn install
yarn build
go generate
go env -w GOOS=windows
go build --tags withsource -ldflags "-H windowsgui"
npm install pnpm
pnpm install
pnpm build
pnpm go:build:win
mv jieshao.loract-umi-demo.exe loract-umi-demo_win_x64.exe
- name: Upload windows artifact
uses: actions/upload-release-asset@v1
with:
uoload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: jieshao.loract-umi-demo.exe
asset_name: jieshao.loract-umi-demo.exe
asset_content_tpye: application/vnd.microsoft.porttable-executable
uses: actions/github-action-publish-binaries@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- args: 'loract-umi-demo_win_x64.exe'

24 changes: 5 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/npm-debug.log*
/yarn-error.log
/yarn.lock
/package-lock.json

# production
/dist

# misc
.DS_Store

# umi
/.env.local
/.umirc.local.ts
/config/config.local.ts
/src/.umi
/src/.umi-production
/src/.umi-test
/.env.local

*.exe
assets.go
/dist
.swc
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmmirror.com/

8 changes: 0 additions & 8 deletions .prettierignore

This file was deleted.

11 changes: 0 additions & 11 deletions .prettierrc

This file was deleted.

14 changes: 5 additions & 9 deletions .umirc.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { defineConfig } from 'umi';
import { defineConfig } from "umi";

export default defineConfig({
nodeModulesTransform: {
type: 'none',
},
history: { type: 'hash' }, //单页路由问题
routes: [
{ path: '/', component: '@/pages/index' },
{ path: '/about', component: '@/pages/about' },
{ path: "/", component: "index" },
{ path: "/docs", component: "docs" },
{ path: "/about", component: "about" },
],
title: 'Demo',
fastRefresh: {},
npmClient: 'pnpm',
});
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
## version
```
os: win10
umi 3.5.26
node v16.20.2
Umi v4.0.81
node v20.6.1
go1.21.1
chrome 117.**
```
Expand All @@ -17,13 +17,13 @@ nodejs always has unexpected version problem. please note.
Install dependencies,

```bash
$ yarn
$ pnpm install
```

Start the dev server, bind 8000 port.

```bash
$ yarn start
$ pnpm dev
```

Start the go dev server, use shell, show localhost:8000
Expand All @@ -38,8 +38,7 @@ or vscode Shortcut key `F5` when open any go file
# By hand create this project
```bash
# create umi link to https://umijs.org/docs/getting-started
yarn create @umijs/umi-app
yarn
pnpm dlx create-umi@latest

# go init
go mod init jieshao.loract-umi-demo
Expand Down
39 changes: 10 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
{
"private": true,
"author": "",
"scripts": {
"start": "umi dev",
"dev": "umi dev",
"build": "umi build",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
"test:coverage": "umi-test --coverage",
"go:build:win":"go generate && go build --tags withsource -ldflags \"-H windowsgui\""
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,less,md,json}": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
"postinstall": "umi setup",
"setup": "umi setup",
"start": "npm run dev",
"go:build:win": "go env -u GOOS && go run gen.go && go env -w GOOS=windows && go build --tags withsource -ldflags \"-H windowsgui\""
},
"dependencies": {
"@ant-design/pro-layout": "^6.5.0",
"react": "17.x",
"react-dom": "17.x",
"umi": "^3.5.26"
"umi": "^4.0.81"
},
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@umijs/preset-react": "1.x",
"@umijs/test": "^3.5.26",
"lint-staged": "^10.0.7",
"prettier": "^2.2.0",
"typescript": "^4.1.2",
"yorkie": "^2.0.0"
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit fca4bc3

Please sign in to comment.