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 CHANGED
@@ -1 +1 @@
1
- button[data-v-a6bc3172]{width:100px;height:50px;display:flex;align-items:center;justify-content:center;border:none;border-radius:10px;cursor:pointer}
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 { openBlock as s, createElementBlock as a, pushScopeId as r, popScopeId as p, createElementVNode as _ } from "vue";
2
- const d = (t, o) => {
3
- const e = t.__vccOpts || t;
4
- for (const [c, n] of o)
5
- e[c] = n;
6
- return e;
7
- }, u = {
8
- name: "YuButton"
9
- //组件名
10
- }, l = (t) => (r("data-v-a6bc3172"), t = t(), p(), t), i = /* @__PURE__ */ l(() => /* @__PURE__ */ _("button", null, "我是测试按钮", -1)), f = [
11
- i
12
- ];
13
- function m(t, o, e, c, n, B) {
14
- return s(), a("div", null, f);
15
- }
16
- const h = /* @__PURE__ */ d(u, [["render", m], ["__scopeId", "data-v-a6bc3172"]]), v = [h], $ = function(t) {
17
- v.forEach((o) => {
18
- t.component(o.name, o);
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
- $ as default
25
+ x as default
23
26
  };
@@ -1 +1 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e["yuang-framework-ui-pc"]=n(e.Vue))})(this,function(e){"use strict";const n=(t,o)=>{const c=t.__vccOpts||t;for(const[s,i]of o)c[s]=i;return c},u={name:"YuButton"},d=[(t=>(e.pushScopeId("data-v-a6bc3172"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("button",null,"我是测试按钮",-1))];function p(t,o,c,s,i,h){return e.openBlock(),e.createElementBlock("div",null,d)}const r=[n(u,[["render",p],["__scopeId","data-v-a6bc3172"]])];return function(t){r.forEach(o=>{t.component(o.name,o)})}});
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.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.0.21"
61
+ "vue-tsc": "^2.1.6"
55
62
  }
56
63
  }
package/src/App.vue CHANGED
@@ -5,7 +5,7 @@
5
5
  <script setup lang="ts">
6
6
  import {RouterView} from 'vue-router'
7
7
 
8
- import YuButton from '@/packages/YuButton/index.vue'
8
+ import YuButton from '@/packages/YuButton/index.vue';
9
9
 
10
10
  </script>
11
11
 
package/src/main.ts CHANGED
@@ -29,6 +29,11 @@ app.use(ElementPlus)
29
29
  app.mount('#app')
30
30
 
31
31
 
32
- // https://blog.csdn.net/qq_34569497/article/details/133643863
33
- // npm config set registry=https://registry.npmjs.org
34
- // npm config set registry=https://registry.npmmirror.com
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
- export default {
8
- name: "YuButton", //组件名
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 {
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+
3
+ express: require('vue'),
4
+ express: require('vue-router'),
5
+ express: require('pinia'),
6
+
7
+
8
+ express: require('js-cookie'),
9
+
10
+ express: require('element-plus'),
11
+ lodash: require('axios'),
12
+ // 添加更多你想要封装的依赖
13
+ };
@@ -1,5 +1,5 @@
1
1
  // 引入封装好的组件
2
- import YuButton from "../packages/YuButton/index.vue";
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>
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
@@ -1,17 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.node.json"
6
- },
7
- {
8
- "path": "./tsconfig.app.json"
9
- },
10
- {
11
- "path": "./tsconfig.vitest.json"
12
- }
13
- ],
14
- "compilerOptions": {
15
- "module": "NodeNext"
16
- }
17
- }
@@ -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
- }
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "./tsconfig.app.json",
3
- "exclude": [],
4
- "compilerOptions": {
5
- "composite": true,
6
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
7
-
8
- "lib": [],
9
- "types": ["node", "jsdom"]
10
- }
11
- }
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
- )