feat: 初始化meta包

This commit is contained in:
NICE CODE BY DEV 2023-12-27 13:40:07 +08:00
parent e1b186aa60
commit abe2127cbb
100 changed files with 11424 additions and 80 deletions

View File

@ -10,19 +10,31 @@ export default defineConfig({
},
alias: {
'@zhst/hooks': path.join(__dirname, 'packages/hooks/src'),
'@zhst/func': path.join(__dirname, 'packages/utils/src'),
'@zhst/func': path.join(__dirname, 'packages/func/src'),
'@zhst/biz': path.join(__dirname, 'packages/biz/src'),
'@zhst/meta': path.join(__dirname, 'packages/meta/src'),
},
resolve: {
docDirs: ['docs'],
atomDirs: [
{ type: 'hooks', dir: 'packages/hooks/src' },
{ type: 'utils', dir: 'packages/utils/src' },
{ type: 'utils', dir: 'packages/func/src' },
{ type: 'biz', dir: 'packages/biz/src' },
{ type: 'meta', dir: 'packages/meta/src' },
],
},
monorepoRedirect: {
srcDir: ['packages', 'src'],
peerDeps: true,
},
extraBabelPlugins: [
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
],
],
});

View File

@ -3,4 +3,14 @@ import { defineConfig } from 'father';
export default defineConfig({
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
esm: { output: 'dist' },
extraBabelPlugins: [
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
},
],
],
});

2
.gitignore vendored
View File

@ -5,3 +5,5 @@ node_modules
.dumi/tmp-production
.DS_Store
/docs-dist
vueuse
/temp

3
.npmrc Normal file
View File

@ -0,0 +1,3 @@
@zhst:registry="http://10.0.0.77:4874"
strict-peer-dependencies=false
ignore-workspace-root-check=true

View File

@ -1,16 +0,0 @@
{
"version": "independent",
"packages": ["packages/*"],
"useWorkspaces": true,
"npmClient": "pnpm",
"command": {
"publish": {
"registry": "https://registry.npmjs.org/",
"@zhst:registry": "http://10.0.0.77:4874"
},
"version": {
"conventionalCommits": true,
"message": "chore(release): publish"
}
}
}

View File

@ -47,6 +47,7 @@
"prettier --parser=typescript --write"
]
},
"dependencies": {},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@commitlint/cli": "^17.1.2",
@ -54,6 +55,7 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@umijs/lint": "^4.0.0",
"babel-plugin-import": "^1.13.8",
"dumi": "^2.2.13",
"eslint": "^8.23.0",
"father": "^4.1.0",

View File

@ -5,3 +5,12 @@
## 安装
> pnpm install @zhst/biz
## 使用
```jsx
import React from 'react';
import { Demo } from '@zhst/biz'
export default () => <Demo />
```

3
packages/biz/es/Demo/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import React from 'react';
declare const _default: () => React.JSX.Element;
export default _default;

View File

@ -0,0 +1,15 @@
import React from 'react';
import { Button } from '@zhst/meta';
import { useThrottleFn } from '@zhst/hooks';
export default (function () {
var ok = function ok() {
return useThrottleFn(function () {
return console.log('123');
});
};
return /*#__PURE__*/React.createElement(Button, {
onClick: function onClick() {
return ok();
}
}, "\u6D4B\u8BD5");
});

View File

@ -0,0 +1 @@
export { default as Demo } from './Demo';

View File

@ -0,0 +1 @@
export { default as Demo } from "./Demo";

3
packages/biz/lib/Demo/index.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
import React from 'react';
declare const _default: () => React.JSX.Element;
export default _default;

View File

@ -0,0 +1,41 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/Demo/index.tsx
var Demo_exports = {};
__export(Demo_exports, {
default: () => Demo_default
});
module.exports = __toCommonJS(Demo_exports);
var import_react = __toESM(require("react"));
var import_meta = require("@zhst/meta");
var import_hooks = require("@zhst/hooks");
var Demo_default = () => {
const ok = () => (0, import_hooks.useThrottleFn)(() => console.log("123"));
return /* @__PURE__ */ import_react.default.createElement(import_meta.Button, { onClick: () => ok() }, "测试");
};

View File

@ -0,0 +1 @@
export { default as Demo } from './Demo';

View File

@ -0,0 +1,39 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.tsx
var src_exports = {};
__export(src_exports, {
Demo: () => import_Demo.default
});
module.exports = __toCommonJS(src_exports);
var import_Demo = __toESM(require("./Demo"));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Demo
});

View File

@ -30,6 +30,8 @@
"registry": "http://10.0.0.77:4874"
},
"dependencies": {
"@zhst/hooks": "workspace:^"
"@zhst/hooks": "workspace:^",
"@zhst/meta": "workspace:^",
"@zhst/func": "workspace:^"
}
}

View File

@ -0,0 +1,12 @@
import React from 'react'
import { Button } from '@zhst/meta'
import { useThrottleFn } from '@zhst/hooks'
export default () => {
const ok = () => useThrottleFn(() => console.log('123'))
return (
<Button onClick={() => ok()} ></Button>
)
}

View File

@ -0,0 +1,8 @@
---
nav:
title: 元组件
title: 版本更新日志
order: 99
---
<embed src="../../CHANGELOG.md" ></embed>

View File

@ -1,10 +1,8 @@
---
nav:
title: biz
title: 业务组件
order: 1
title: 快速上手
---
<embed src="../README.md" ></embed>
<embed src="../CHANGELOG.md" ></embed>

View File

@ -0,0 +1 @@
export { default as Demo } from './Demo';

View File

@ -4,4 +4,7 @@ export default defineConfig({
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
esm: { output: 'es' },
cjs: { output: 'lib' },
umd: {
name: 'zhst-func',
},
});

1
packages/func/dist/umd/func.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,8 @@
"typings": "es/index.d.ts",
"files": [
"es",
"lib"
"lib",
"dist"
],
"scripts": {
"build": "father build"

View File

@ -0,0 +1,8 @@
---
nav:
title: 元组件
title: 版本更新日志
order: 99
---
<embed src="../../CHANGELOG.md" ></embed>

View File

@ -6,5 +6,3 @@ title: 快速上手
---
<embed src="../README.md" ></embed>
<embed src="../CHANGELOG.md" ></embed>

View File

@ -4,4 +4,7 @@ export default defineConfig({
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
esm: { output: 'es' },
cjs: { output: 'lib' },
umd: {
name: 'zhst-hooks',
},
});

1
packages/hooks/dist/umd/hooks.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,8 @@
"typings": "es/index.d.ts",
"files": [
"es",
"lib"
"lib",
"dist"
],
"scripts": {
"build": "father build"

View File

@ -0,0 +1,8 @@
---
nav:
title: 元组件
title: 版本更新日志
order: 99
---
<embed src="../../CHANGELOG.md" ></embed>

View File

@ -7,8 +7,6 @@ title: 快速上手
<embed src="../README.md" ></embed>
<embed src="../CHANGELOG.md" ></embed>
## 参考文档
[ahooks](https://ahooks.js.org/zh-CN)

View File

@ -0,0 +1,10 @@
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' },
umd: {
name: 'zhst-meta',
},
});

View File

@ -0,0 +1,19 @@
# @zhst/utils
## 0.2.3
### Patch Changes
- fix: 调试包 link
## 0.2.2
### Patch Changes
- fix: 修改源
## 0.2.1
### Patch Changes
- fix: 修改版本号

16
packages/meta/README.md Normal file
View File

@ -0,0 +1,16 @@
## 介绍
原子组件
## 安装
> pnpm install @zhst/meta
## 使用
```jsx
import React from 'react';
import { Button } from '@zhst/meta'
export default () => <Button>测试</Button>
```

1
packages/meta/dist/umd/meta.min.js vendored Normal file

File diff suppressed because one or more lines are too long

6
packages/meta/es/Button/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import { FC } from 'react';
import type { ButtonProps } from 'antd/lib/button';
interface IButtonDemo extends ButtonProps {
}
declare const ButtonDemo: FC<IButtonDemo>;
export default ButtonDemo;

View File

@ -0,0 +1,7 @@
import React from 'react';
import { Button } from 'antd';
var ButtonDemo = function ButtonDemo(props) {
var children = props.children;
return /*#__PURE__*/React.createElement(Button, props, children);
};
export default ButtonDemo;

1
packages/meta/es/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export { default as Button } from './Button';

View File

@ -0,0 +1 @@
export { default as Button } from "./Button";

6
packages/meta/lib/Button/index.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
import { FC } from 'react';
import type { ButtonProps } from 'antd/lib/button';
interface IButtonDemo extends ButtonProps {
}
declare const ButtonDemo: FC<IButtonDemo>;
export default ButtonDemo;

View File

@ -0,0 +1,41 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/Button/index.tsx
var Button_exports = {};
__export(Button_exports, {
default: () => Button_default
});
module.exports = __toCommonJS(Button_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var ButtonDemo = (props) => {
const { children } = props;
return /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...props }, children);
};
var Button_default = ButtonDemo;

1
packages/meta/lib/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export { default as Button } from './Button';

View File

@ -0,0 +1,39 @@
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.tsx
var src_exports = {};
__export(src_exports, {
Button: () => import_Button.default
});
module.exports = __toCommonJS(src_exports);
var import_Button = __toESM(require("./Button"));
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Button
});

View File

@ -0,0 +1,35 @@
{
"name": "@zhst/meta",
"version": "0.2.3",
"description": "原子组件",
"keywords": [
"meta",
"component"
],
"license": "ISC",
"author": "dev",
"sideEffects": [
"dist/*",
"es/**/style/*",
"lib/**/style/*",
"*.less"
],
"main": "lib/index.tsx",
"module": "es/index.js",
"typings": "es/index.d.ts",
"files": [
"es",
"lib",
"dist"
],
"scripts": {
"build": "father build"
},
"publishConfig": {
"access": "public",
"registry": "http://10.0.0.77:4874"
},
"dependencies": {
"antd": "^5.12.5"
}
}

View File

@ -0,0 +1,19 @@
---
nav:
title: 元组件
title: 按钮
order: 2
---
## 基本按钮
```jsx
import React from 'react';
import { Button } from '@zhst/meta'
export default () => {
return (
<Button type="primary" >按我啊!</Button>
)
}
```

View File

@ -0,0 +1,17 @@
import React, { FC } from 'react'
import { Button } from 'antd'
import type { ButtonProps } from 'antd/lib/button'
interface IButtonDemo extends ButtonProps {
}
const ButtonDemo: FC<IButtonDemo> = (props) => {
const { children } = props
return (
<Button {...props} >{children}</Button>
)
}
export default ButtonDemo

View File

@ -0,0 +1,8 @@
---
nav:
title: 元组件
title: 版本更新日志
order: 99
---
<embed src="../../CHANGELOG.md" ></embed>

View File

@ -0,0 +1,8 @@
---
nav:
title: 元组件
title: 快速上手
order: 1
---
<embed src="../README.md" ></embed>

View File

@ -0,0 +1 @@
export { default as Button } from './Button';

File diff suppressed because it is too large Load Diff

1
vueuse

@ -1 +0,0 @@
Subproject commit dd00d926856e8c208d0d569c17f67d9653f2451d