feat: 初始化icon、map包
This commit is contained in:
parent
bc5a281a50
commit
42513c21cf
@ -18,6 +18,8 @@ export default defineConfig({
|
|||||||
'@zhst/request': path.join(__dirname, 'packages/request/src'),
|
'@zhst/request': path.join(__dirname, 'packages/request/src'),
|
||||||
'@zhst/slave': path.join(__dirname, 'packages/slave/src'),
|
'@zhst/slave': path.join(__dirname, 'packages/slave/src'),
|
||||||
'@zhst/material': path.join(__dirname, 'packages/material/src'),
|
'@zhst/material': path.join(__dirname, 'packages/material/src'),
|
||||||
|
'@zhst/icon': path.join(__dirname, 'packages/icon/src'),
|
||||||
|
'@zhst/map': path.join(__dirname, 'packages/map/src'),
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
docDirs: ['docs'],
|
docDirs: ['docs'],
|
||||||
@ -31,6 +33,8 @@ export default defineConfig({
|
|||||||
{ type: 'other', subType: 'types', dir: 'packages/types/src' },
|
{ type: 'other', subType: 'types', dir: 'packages/types/src' },
|
||||||
{ type: 'slave', dir: 'packages/slave/src' },
|
{ type: 'slave', dir: 'packages/slave/src' },
|
||||||
{ type: 'material', dir: 'packages/material/src' },
|
{ type: 'material', dir: 'packages/material/src' },
|
||||||
|
{ type: 'icon', dir: 'packages/icon/src' },
|
||||||
|
{ type: 'map', dir: 'packages/map/src' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
monorepoRedirect: {
|
monorepoRedirect: {
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ packages/**/es
|
|||||||
packages/**/lib
|
packages/**/lib
|
||||||
/es
|
/es
|
||||||
/lib
|
/lib
|
||||||
|
pnpm-lock.yaml
|
||||||
|
7
packages/icon/.fatherrc.ts
Normal file
7
packages/icon/.fatherrc.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { defineConfig } from 'father';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
||||||
|
esm: { output: 'es' },
|
||||||
|
cjs: { output: 'lib' },
|
||||||
|
});
|
20
packages/icon/README.md
Normal file
20
packages/icon/README.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# @zhst/icon
|
||||||
|
|
||||||
|
:::info{title=开发中}
|
||||||
|
稍等...
|
||||||
|
:::
|
||||||
|
|
||||||
|
## 介绍
|
||||||
|
|
||||||
|
静态变量库
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
> pnpm install @zhst/icon
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
```js
|
||||||
|
import React from 'react';
|
||||||
|
import { Arrow } from '@zhst/icon'
|
||||||
|
```
|
40
packages/icon/package.json
Normal file
40
packages/icon/package.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@zhst/icon",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "图标库",
|
||||||
|
"keywords": [
|
||||||
|
"icon",
|
||||||
|
"zhst",
|
||||||
|
"图标库"
|
||||||
|
],
|
||||||
|
"license": "ISC",
|
||||||
|
"author": "dev",
|
||||||
|
"sideEffects": [
|
||||||
|
"dist/*",
|
||||||
|
"es/**/style/*",
|
||||||
|
"lib/**/style/*",
|
||||||
|
"*.less"
|
||||||
|
],
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"module": "es/index.js",
|
||||||
|
"typings": "es/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"require": "./lib/index.js",
|
||||||
|
"import": "./es/index.js",
|
||||||
|
"default": "./es/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"es",
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "father build"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public",
|
||||||
|
"registry": "http://10.0.0.77:4874"
|
||||||
|
},
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
13
packages/icon/src/demo/basic.tsx
Normal file
13
packages/icon/src/demo/basic.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Heart } from '@zhst/icon';
|
||||||
|
|
||||||
|
const demo = () => {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Heart size={20} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default demo;
|
17
packages/icon/src/heart.tsx
Normal file
17
packages/icon/src/heart.tsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Created by jiangzhixiong on 2024/03/22
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React, { FC } from 'react'
|
||||||
|
|
||||||
|
interface Iheart {
|
||||||
|
size?: string | number
|
||||||
|
}
|
||||||
|
|
||||||
|
const Heart: FC<Iheart> = (props) => {
|
||||||
|
return (
|
||||||
|
<svg style={{ width: `${props.size}px`, height: '100%' }} t="1711074821835" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13154" width="200" height="200"><path d="M322.56 164.266667c-113.152 0-205.226667 92.16-205.226667 206.506666 0 138.666667 64 249.813333 144.64 332.373334 80.938667 82.944 176.64 134.912 233.898667 154.453333l0.341333 0.128c2.730667 0.981333 8.490667 2.005333 15.786667 2.005333 7.296 0 13.056-1.024 15.786667-2.005333l0.341333-0.128c57.258667-19.541333 152.96-71.509333 233.941333-154.453333 80.554667-82.56 144.597333-193.706667 144.597334-332.373334 0-114.346667-92.074667-206.506667-205.226667-206.506666a203.946667 203.946667 0 0 0-163.754667 82.645333 32 32 0 0 1-51.370666 0A203.349333 203.349333 0 0 0 322.56 164.266667zM53.333333 370.773333c0-149.333333 120.405333-270.506667 269.226667-270.506666 74.112 0 141.013333 30.122667 189.44 78.72a267.349333 267.349333 0 0 1 189.44-78.72c148.821333 0 269.226667 121.173333 269.226667 270.506666 0 160-74.24 286.293333-162.816 377.088-88.149333 90.282667-192.426667 147.541333-258.901334 170.24a114.986667 114.986667 0 0 1-36.949333 5.632c-11.818667 0-25.216-1.493333-36.949333-5.589333-66.432-22.741333-170.752-80-258.901334-170.282667C127.530667 657.066667 53.333333 530.773333 53.333333 370.773333z" p-id="13155"></path></svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Heart
|
11
packages/icon/src/index.md
Normal file
11
packages/icon/src/index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
nav:
|
||||||
|
title: Icon
|
||||||
|
order: 1
|
||||||
|
toc: content
|
||||||
|
title: 快速上手
|
||||||
|
---
|
||||||
|
|
||||||
|
<embed src="../README.md" ></embed>
|
||||||
|
|
||||||
|
<code src="./demo/basic.tsx">基本用法</code>
|
1
packages/icon/src/index.ts
Normal file
1
packages/icon/src/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export { default as Heart } from './heart';
|
13
packages/map/.fatherrc.ts
Normal file
13
packages/map/.fatherrc.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from 'father';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
||||||
|
esm: {
|
||||||
|
output: 'es',
|
||||||
|
ignores: ['**/demo/*', 'src/**/demo/*']
|
||||||
|
},
|
||||||
|
cjs: {
|
||||||
|
output: 'lib',
|
||||||
|
ignores: ['**/demo/*', 'src/**/demo/*']
|
||||||
|
},
|
||||||
|
});
|
0
packages/map/CHANGELOG.md
Normal file
0
packages/map/CHANGELOG.md
Normal file
20
packages/map/README.md
Normal file
20
packages/map/README.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# @zhst/map
|
||||||
|
|
||||||
|
:::info{title=开发中}
|
||||||
|
稍等...
|
||||||
|
:::
|
||||||
|
|
||||||
|
## 介绍
|
||||||
|
|
||||||
|
静态变量库
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
> pnpm install @zhst/map
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
```js
|
||||||
|
import React from 'react';
|
||||||
|
import { TYPE } from '@zhst/map'
|
||||||
|
```
|
40
packages/map/package.json
Normal file
40
packages/map/package.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "@zhst/map",
|
||||||
|
"version": "0.1.1",
|
||||||
|
"description": "地图库",
|
||||||
|
"keywords": [
|
||||||
|
"map",
|
||||||
|
"zhst",
|
||||||
|
"地图库"
|
||||||
|
],
|
||||||
|
"license": "ISC",
|
||||||
|
"author": "dev",
|
||||||
|
"sideEffects": [
|
||||||
|
"dist/*",
|
||||||
|
"es/**/style/*",
|
||||||
|
"lib/**/style/*",
|
||||||
|
"*.less"
|
||||||
|
],
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"module": "es/index.js",
|
||||||
|
"typings": "es/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"require": "./lib/index.js",
|
||||||
|
"import": "./es/index.js",
|
||||||
|
"default": "./es/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"es",
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "father build"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public",
|
||||||
|
"registry": "http://10.0.0.77:4874"
|
||||||
|
},
|
||||||
|
"dependencies": {}
|
||||||
|
}
|
11
packages/map/src/changelog/index.md
Normal file
11
packages/map/src/changelog/index.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
nav:
|
||||||
|
title: 其它
|
||||||
|
title: 静态变量库
|
||||||
|
toc: content
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
<embed src="../../README.md" ></embed>
|
||||||
|
|
||||||
|
<embed src="../../CHANGELOG.md" ></embed>
|
9
packages/map/src/index.md
Normal file
9
packages/map/src/index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
nav:
|
||||||
|
title: Map
|
||||||
|
order: 1
|
||||||
|
toc: content
|
||||||
|
title: 快速上手
|
||||||
|
---
|
||||||
|
|
||||||
|
<embed src="../README.md" ></embed>
|
1
packages/map/src/index.ts
Normal file
1
packages/map/src/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './user'
|
1
packages/map/src/user/index.ts
Normal file
1
packages/map/src/user/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export default {}
|
@ -1,21 +1,41 @@
|
|||||||
# @types/zhst
|
# @zhst/slave
|
||||||
|
|
||||||
:::info{title=开发中}
|
|
||||||
可能会被弃用...
|
|
||||||
:::
|
|
||||||
|
|
||||||
## 介绍
|
## 介绍
|
||||||
|
|
||||||
业务库
|
供微前端应用使用的公共方法
|
||||||
|
|
||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
> pnpm install @zhst/types
|
> pnpm install @zhst/slave
|
||||||
|
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type { User } from '@types/zhst'
|
import from '@zhst/slave'
|
||||||
|
|
||||||
|
slave.init({
|
||||||
|
jumpUrl: `http://10.0.0.222:30058/metarial/login`,
|
||||||
|
jumpToLogin: false,
|
||||||
|
tokenKey: 'token',
|
||||||
|
showMsg: false,
|
||||||
|
msgText: '你能不能先登录?'
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| jumpToLogin | 是否打开登录校验跳转 | boolean | true | - |
|
||||||
|
| jumpUrl | 登录跳转页面 | string | - | - |
|
||||||
|
| tokenKey | 从链接获取的登录校验字段 | string | token | - |
|
||||||
|
| showMsg | 是否显示“请先登录”提示框 | boolean | true | - |
|
||||||
|
| msgText | 提示框自定义文案 | string | 请先登录 | - |
|
||||||
|
|
||||||
|
## slave 实例方法
|
||||||
|
|
||||||
|
| 方法 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| init | 初始化实例 | function | (data: SlaveProps) => void | - |
|
||||||
|
| logOut | 退出登录 | function | () => void | - |
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
nav:
|
nav:
|
||||||
title: 微前端库
|
title: slave
|
||||||
order: 99
|
order: 99
|
||||||
toc: content
|
toc: content
|
||||||
title: 快速上手
|
title: 快速上手
|
||||||
|
Loading…
Reference in New Issue
Block a user