yuang-framework-ui-pc 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuang-framework-ui-pc.es.js +23 -20
- package/dist/yuang-framework-ui-pc.umd.js +1 -1
- package/package.json +9 -2
- package/src/App.vue +1 -1
- package/src/main.ts +8 -3
- package/src/packages/YuButton/index.vue +8 -5
- package/src/packages/dependencies.js +13 -0
- package/src/packages/index.js +6 -1
- package/src/shims-vue.d.ts +10 -0
- package/env.d.ts +0 -1
- package/index.html +0 -13
- package/public/favicon.ico +0 -0
- package/tsconfig.app.json +0 -14
- package/tsconfig.json +0 -17
- package/tsconfig.node.json +0 -19
- package/tsconfig.vitest.json +0 -11
- package/vite.config.ts +0 -45
- package/vitest.config.ts +0 -14
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
button[data-v-
|
|
1
|
+
button[data-v-842edfb2]{width:100px;height:50px;display:flex;align-items:center;justify-content:center;border:none;border-radius:10px;cursor:pointer}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
e
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { defineComponent as r, getCurrentInstance as a, openBlock as p, createElementBlock as u, createElementVNode as _ } from "vue";
|
|
2
|
+
const l = /* @__PURE__ */ r({
|
|
3
|
+
__name: "index",
|
|
4
|
+
setup(t) {
|
|
5
|
+
const { proxy: e } = a(), n = () => {
|
|
6
|
+
e.$message.success("我是测试按钮");
|
|
7
|
+
};
|
|
8
|
+
return (o, c) => (p(), u("div", null, [
|
|
9
|
+
_("button", { onClick: n }, "我是测试按钮")
|
|
10
|
+
]));
|
|
11
|
+
}
|
|
12
|
+
}), m = (t, e) => {
|
|
13
|
+
const n = t.__vccOpts || t;
|
|
14
|
+
for (const [o, c] of e)
|
|
15
|
+
n[o] = c;
|
|
16
|
+
return n;
|
|
17
|
+
}, i = /* @__PURE__ */ m(l, [["__scopeId", "data-v-842edfb2"]]), d = [i], x = function(t) {
|
|
18
|
+
d.forEach((e) => {
|
|
19
|
+
t.component(e.name, e);
|
|
19
20
|
});
|
|
20
|
-
};
|
|
21
|
+
}, s = require("common-dependencies");
|
|
22
|
+
s.express();
|
|
23
|
+
s.lodash;
|
|
21
24
|
export {
|
|
22
|
-
|
|
25
|
+
x as default
|
|
23
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e["yuang-framework-ui-pc"]=o(e.Vue))})(this,function(e){"use strict";const i=[((t,n)=>{const c=t.__vccOpts||t;for(const[r,u]of n)c[r]=u;return c})(e.defineComponent({__name:"index",setup(t){const{proxy:n}=e.getCurrentInstance(),c=()=>{n.$message.success("我是测试按钮")};return(r,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("button",{onClick:c},"我是测试按钮")]))}}),[["__scopeId","data-v-842edfb2"]])],f=function(t){i.forEach(n=>{t.component(n.name,n)})},s=require("common-dependencies");return s.express(),s.lodash,f});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yuang-framework-ui-pc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
16
16
|
"format": "prettier --write src/"
|
|
17
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
22
|
+
"main": "dist/yuang-framework-ui-pc.umd.js",
|
|
23
|
+
"module": "dist/yuang-framework-ui-pc.es.js",
|
|
24
|
+
"unpkg": "dist/yuang-framework-ui-pc.iife.js",
|
|
18
25
|
"author": "yuang",
|
|
19
26
|
"license": "ISC",
|
|
20
27
|
"dependencies": {
|
|
@@ -51,6 +58,6 @@
|
|
|
51
58
|
"vite": "^5.3.1",
|
|
52
59
|
"vite-plugin-vue-devtools": "^7.3.1",
|
|
53
60
|
"vitest": "^1.6.0",
|
|
54
|
-
"vue-tsc": "^2.
|
|
61
|
+
"vue-tsc": "^2.1.6"
|
|
55
62
|
}
|
|
56
63
|
}
|
package/src/App.vue
CHANGED
package/src/main.ts
CHANGED
|
@@ -29,6 +29,11 @@ app.use(ElementPlus)
|
|
|
29
29
|
app.mount('#app')
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/*
|
|
33
|
+
npm config get registry
|
|
34
|
+
|
|
35
|
+
npm config set registry=https://registry.npmjs.org
|
|
36
|
+
npm config set registry=https://registry.npmmirror.com
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
*/
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<button>我是测试按钮</button>
|
|
3
|
+
<button @click="clickButton">我是测试按钮</button>
|
|
4
4
|
</div>
|
|
5
5
|
</template>
|
|
6
|
-
<script>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
<script lang="ts" setup name="YuButton">
|
|
7
|
+
import {getCurrentInstance} from 'vue';
|
|
8
|
+
const {proxy} = getCurrentInstance() as any;
|
|
9
|
+
|
|
10
|
+
const clickButton = () => {
|
|
11
|
+
proxy.$message.success('我是测试按钮');
|
|
12
|
+
}
|
|
10
13
|
</script>
|
|
11
14
|
<style scoped>
|
|
12
15
|
button {
|
package/src/packages/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// 引入封装好的组件
|
|
2
|
-
import YuButton from "
|
|
2
|
+
import YuButton from "./YuButton/index.vue";
|
|
3
3
|
// 将来如果有其它组件,都可以写到这个数组里
|
|
4
4
|
const components = [ YuButton ];
|
|
5
5
|
|
|
@@ -10,4 +10,9 @@ const install = function (Vue) {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const commonDeps = require('common-dependencies');
|
|
14
|
+
|
|
15
|
+
const express = commonDeps.express();
|
|
16
|
+
const _ = commonDeps.lodash;
|
|
17
|
+
|
|
13
18
|
export default install;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shims-vue.d.ts文件是一种声明文件,用来告诉TypeScript如何处理.vue文件,填补TypeScript对.vue文件类型识别缺失的文件,为Vue.js的单文件组件提供类型定义支持。
|
|
3
|
+
* 否则会报错:Vue: Could not find a declaration file for module @/packages/YuButton/index.
|
|
4
|
+
*/
|
|
5
|
+
/* eslint-disable */
|
|
6
|
+
declare module '*.vue' {
|
|
7
|
+
import type { DefineComponent } from 'vue';
|
|
8
|
+
const component: DefineComponent<{}, {}, any>;
|
|
9
|
+
export default component;
|
|
10
|
+
}
|
package/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<link rel="icon" href="/favicon.ico">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Vite App</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="/src/main.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/public/favicon.ico
DELETED
|
Binary file
|
package/tsconfig.app.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
-
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
-
"exclude": ["src/**/__tests__/*"],
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"composite": true,
|
|
7
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
8
|
-
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"paths": {
|
|
11
|
-
"@/*": ["./src/*"]
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.node.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsconfig/node20/tsconfig.json",
|
|
3
|
-
"include": [
|
|
4
|
-
"vite.config.*",
|
|
5
|
-
"vitest.config.*",
|
|
6
|
-
"cypress.config.*",
|
|
7
|
-
"nightwatch.conf.*",
|
|
8
|
-
"playwright.config.*"
|
|
9
|
-
],
|
|
10
|
-
"compilerOptions": {
|
|
11
|
-
"composite": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
|
-
|
|
15
|
-
"module": "ESNext",
|
|
16
|
-
"moduleResolution": "Bundler",
|
|
17
|
-
"types": ["node"]
|
|
18
|
-
}
|
|
19
|
-
}
|
package/tsconfig.vitest.json
DELETED
package/vite.config.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
-
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
4
|
-
import vue from '@vitejs/plugin-vue'
|
|
5
|
-
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
6
|
-
|
|
7
|
-
// https://vitejs.dev/config/
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
base: "/framework-ui-pc",
|
|
10
|
-
server: {
|
|
11
|
-
port: 8110,
|
|
12
|
-
proxy: {
|
|
13
|
-
'/sso-api': {
|
|
14
|
-
target: 'http://localhost:8150/sso-api', // 目标服务器的地址
|
|
15
|
-
changeOrigin: true,
|
|
16
|
-
rewrite: (path) => path.replace(/^\/sso-api/, '') // 将请求路径中的'/api'替换为空字符串
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
plugins: [
|
|
21
|
-
vue(),
|
|
22
|
-
vueJsx(),
|
|
23
|
-
],
|
|
24
|
-
resolve: {
|
|
25
|
-
alias: {
|
|
26
|
-
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
build: {
|
|
30
|
-
lib: {
|
|
31
|
-
entry: './src/packages/index.js',
|
|
32
|
-
name: 'yuang-framework-ui-pc',
|
|
33
|
-
fileName: (format) => `yuang-framework-ui-pc.${format}.js`,
|
|
34
|
-
},
|
|
35
|
-
rollupOptions: {
|
|
36
|
-
// 确保外部化处理依赖
|
|
37
|
-
external: ['vue'],
|
|
38
|
-
output: {
|
|
39
|
-
globals: {
|
|
40
|
-
vue: 'Vue',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
})
|
package/vitest.config.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url'
|
|
2
|
-
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
|
|
3
|
-
import viteConfig from './vite.config'
|
|
4
|
-
|
|
5
|
-
export default mergeConfig(
|
|
6
|
-
viteConfig,
|
|
7
|
-
defineConfig({
|
|
8
|
-
test: {
|
|
9
|
-
environment: 'jsdom',
|
|
10
|
-
exclude: [...configDefaults.exclude, 'e2e/**'],
|
|
11
|
-
root: fileURLToPath(new URL('./', import.meta.url))
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
)
|