Skip to content

Commit

Permalink
feat: vue-cli-plugin-h-run-devtools 插件新增
Browse files Browse the repository at this point in the history
vue-cli-plugin-h-run-devtools 插件新增
  • Loading branch information
hewx815 committed Apr 29, 2023
1 parent b7bec74 commit 15573a8
Show file tree
Hide file tree
Showing 36 changed files with 2,439 additions and 1,914 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/node_modules
/.vitepress/cache
/dist

/for-vue2/babel.config.js
/for-vue2/postcss.config.js
/for-vue2/shime-uni.d.ts
/for-vue2/shime-vue.d.ts
/for-vue2/src/static

/for-vue3/dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dist/npm/*

cli/storage/index.json
.vitepress/cache

yarn-error.log
98 changes: 98 additions & 0 deletions .vitepress/components/SupportTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<template>
<table class="table">
<tr>
<td>平台</td>
<td>APP</td>
<td>H5</td>
<td>微信</td>
<td>支付宝</td>
<td>百度</td>
<td>头条</td>
<td>QQ</td>
<td>快手</td>
<td>京东</td>
</tr>
<tr>
<td>支持性</td>
<td>{{ dd('APP') }}</td>
<td>{{ dd('H5') }}</td>
<td>{{ dd('WEIXIN') }}</td>
<td>{{ dd('ALIPAY') }}</td>
<td>{{ dd('BAIDU') }}</td>
<td>{{ dd('TOUTIAO') }}</td>
<td>{{ dd('QQ') }}</td>
<td>{{ dd('KUAISHOU') }}</td>
<td>{{ dd('JD') }}</td>
</tr>
<tr>
<td colspan="5">for-vue2</td>
<td colspan="5">for-vue3</td>
</tr>
<tr>
<td colspan="5">{{ dd('VUE2') }}</td>
<td colspan="5">{{ dd('VUE3') }}</td>
</tr>
</table>
<div class="info ">
<div class="warning custom-block" v-if="typeof props.APP==='string'">APP:{{ ddd('APP') }}</div>
<div class="warning custom-block" v-if="typeof props.H5==='string'">H5:{{ ddd('H5') }}</div>
<div class="warning custom-block" v-if="typeof props.WEIXIN==='string'">微信:{{ ddd('WEIXIN') }}</div>
<div class="warning custom-block" v-if="typeof props.ALIPAY==='string'">支付宝:{{ ddd('ALIPAY') }}</div>
<div class="warning custom-block" v-if="typeof props.BAIDU==='string'">百度:{{ ddd('BAIDU') }}</div>
<div class="warning custom-block" v-if="typeof props.TOUTIAO==='string'">头条:{{ ddd('TOUTIAO') }}</div>
<div class="warning custom-block" v-if="typeof props.QQ==='string'">QQ:{{ ddd('QQ') }}</div>
<div class="warning custom-block" v-if="typeof props.KUAISHOU==='string'">快手:{{ ddd('KUAISHOU') }}</div>
<div class="warning custom-block" v-if="typeof props.JD==='string'">京东:{{ ddd('JD') }}</div>
</div>
</template>

<script setup>
/**
* @description 兼容性展示表格
* @property {Boolean||String} APP
* @value {Boolean} true 支持
* @value {Boolean} false 未知、不支持
* @value {String} 不完全支持,底部会显示此描述
* @event
* @slot
*/
import { onMounted } from 'vue'
const props = defineProps({
APP: [Boolean, String],
H5: [Boolean, String],
WEIXIN: [Boolean, String],
ALIPAY: [Boolean, String],
BAIDU: [Boolean, String],
TOUTIAO: [Boolean, String],
QQ: [Boolean, String],
KUAISHOU: [Boolean, String],
JD: [Boolean, String],
VUE2: [Boolean, String],
VUE3: [Boolean, String],
});
const dd = (platForm) => {
const state = props[platForm]
if (state === false) {
return ''
}
if (state === true) {
return ''
}
return ''
}
const ddd=(platForm) => {
return props[platForm];
}
</script>

<style scoped>
.table {
text-align: center;
}
.info .custom-block{
padding-top: 8px;
}
</style>
1 change: 1 addition & 0 deletions .vitepress/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as SupportTable } from './SupportTable.vue'
97 changes: 44 additions & 53 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,85 +1,76 @@
import path from "path";
import { defineConfig } from "vitepress";
import { fileURLToPath } from "url";
import components from "./sidebar/components";
import utils from "./sidebar/utils";

const CurrentPath = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
lang: 'zh-CN',
outDir: path.resolve(CurrentPath, '../dist/doc'),
srcExclude: ['dist/npm/**/*'],
lang: "zh-CN",
outDir: path.resolve(CurrentPath, "../dist/doc"),
srcExclude: ["dist/npm/**/*"],
title: "h-uni",
lastUpdated: true,
// Vite config options
vite: {
resolve: {
alias: {
"@": path.resolve(CurrentPath),
},
},
},
// 路径重写
rewrites: {
':for/src/packages/:type/:dd/:dd.md': ':for/:type/:dd.md',
":for/src/packages/:type/:dd/:dd.md": ":for/:type/:dd.md",
},
themeConfig: {
search: {
provider: 'local'
},
//顶部导航栏
nav: [
{ text: "主页", link: "/" },
{ text: "开始", link: "/README" },
{ text: "组件", link: "/for-vue2/components/HButton" },
{ text: "工具", link: "/for-vue2/utils/Hhttp" },
{ text: "组件", link: "/for-vue2/components/HButton",activeMatch:'/components' },
{ text: "工具", link: "/for-vue2/utils/Hhttp",activeMatch:'/utils' },
{ text: "更新记录", link: "/CHANGELOG" },
{
text: "切换文档",
items: [
{ text: "for-vue2", link: "/for-vue2/components/HButton" },
{ text: "for-vue3", link: "/for-vue3/components/HButton" },
],
},
{
text: "网站导航",
items: [
{ text: "暂无!", link: "/item-1" },
{ text: "暂无!!", link: "/item-2" },
{ text: "暂无!!!", link: "/item-3" },
{ text: "uniapp 官网", link: "https://uniapp.dcloud.net.cn/" },
{ text: "hewxing.cn", link: "http://hewxing.cn" },
{ text: "3D 示例", link: "http://3d.hewxing.cn" },
],
},
],
// 侧边栏
sidebar: {
'/for-vue2/': [
"/for-vue2/components/": [
{
text: "for-vue2",
items: [
{
text: "组件",
collapsed: false,
items: [
{ text: '按钮 button', link: '/for-vue2/components/HButton' },
]
},
{
text: "工具",
collapsed: false,
items: [
{ text: '网络请求 Hhttp', link: '/for-vue2/utils/Hhttp' }
]
},
],
text: "组件库",
items: components,
},
],
'/for-vue3/': [
"/for-vue3/components/": [
{
text: "for-vue3",
items: [
{
text: "组件",
collapsed: false,
items: [
{ text: '按钮 HButton', link: '/for-vue3/components/HButton' }
]
},
{
text: "工具",
collapsed: false,
items: [
{ text: '网络请求 Hhttp', link: '/for-vue3/utils/Hhttp' }
]
},
],
text: "组件库",
items: components,
},
]
],
"/for-vue2/utils/": [
{
text: "工具库",
items: utils,
},
],
"/for-vue3/utils/": [
{
text: "工具库",
items: utils,
},
],
},
// 链接图标
socialLinks: [{ icon: "github", link: "https://github.com/hewx815/h-uni" }],
},
});
16 changes: 16 additions & 0 deletions .vitepress/sidebar/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default [
{
text: "for-vue2",
collapsed: false,
items: [
{ text: '按钮 button', link: '/for-vue2/components/HButton' },
]
},
{
text: "for-vue3",
collapsed: false,
items: [
{ text: '按钮 button', link: '/for-vue3/components/HButton' },
]
},
]
17 changes: 17 additions & 0 deletions .vitepress/sidebar/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default [
{
text: "for-vue2",
collapsed: false,
items: [
{ text: '网络请求 Hhttp', link: '/for-vue2/utils/Hhttp' },
{ text: '开发者工具启动 h-run-devtools', link: '/for-vue2/utils/vue-cli-plugin-h-run-devtools' },
]
},
{
text: "for-vue3",
collapsed: false,
items: [
{ text: '网络请求 Hhttp', link: '/for-vue3/utils/Hhttp' }
]
},
]
4 changes: 0 additions & 4 deletions .vitepress/theme/index.js

This file was deleted.

13 changes: 13 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import DefaultTheme from "vitepress/theme";
import "./custom.css";
import * as components from "../components";

export default {
extends: DefaultTheme,
enhanceApp(ctx) {
// register global components
Object.keys(components).forEach((key) => {
ctx.app.component(key, components[key]);
});
},
};
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
h-uni
### [1.0.4](https://github.com/hewx815/h-uni/compare/v1.0.3...v1.0.4) (2023-04-27)


### 👷 Continuous Integration | CI 配置

* 调整 调整项目结构 ([54f8c55](https://github.com/hewx815/h-uni/commit/54f8c556602e280dafb9b20858992d5e10b1efab))

### [1.0.3](https://github.com/hewx815/h-uni/compare/v1.0.2...v1.0.3) (2023-04-23)


Expand Down
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
---
aside: false
---

# h-uni

暂无
## 介绍

内含各种 uniapp的组件库、工具库,您可以根据需要按需导入,或者直接去[github](https://github.com/hewx815/h-uni)复制代码

## 安装

运行以下命令:

::: code-group
```shell[yarn]
yarn add h-uni
```
```shell[npm]
npm install h-uni
```
:::

安装成功后运行以下命令来查看版本以查看是否安装成功:

::: code-group
```shell[yarn]
yarn h-uni
```
```shell[npm]
npm run h-uni
```
:::

如果您看到了正确的版本号证明已经成功安装

## 使用

### `vue2` + `vue-cli` + `javascript` 项目 [查看详情]()

### `vue3` + `vite` + `typescript` 项目 [查看详情]()
2 changes: 2 additions & 0 deletions bin/argvs/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line import/prefer-default-export
export { default as initHOpenDevtools } from './init-h-open-devtools.js';
9 changes: 9 additions & 0 deletions bin/argvs/init-h-open-devtools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { execSync } from 'child_process';

export default {
description: '初始化h-open-devtools',
fn: () => {
execSync('yarn add file:node_modules/h-uni/dist/npm/for-vue2/utils/vue-cli-plugin-h-run-devtools');
console.log('[h-uni]:vue-cli-plugin-h-run-devtools 初始化成功!');
},
};

0 comments on commit 15573a8

Please sign in to comment.