houwenjian 1.0.10 → 1.0.11

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.
@@ -1,27 +1,27 @@
1
- import { ref as _, openBlock as r, createElementBlock as a, createElementVNode as o, toDisplayString as c } from "vue";
2
- const u = (e, n) => {
1
+ import { ref as _, openBlock as c, createElementBlock as r, createElementVNode as o, toDisplayString as d } from "vue";
2
+ const a = (e, n) => {
3
3
  const s = e.__vccOpts || e;
4
4
  for (const [t, l] of n)
5
5
  s[t] = l;
6
6
  return s;
7
- }, d = { class: "buttons" }, i = {
7
+ }, i = { class: "buttons" }, u = {
8
8
  __name: "test",
9
9
  setup(e) {
10
10
  const n = _("hello world");
11
- return (s, t) => (r(), a("div", null, [
11
+ return (s, t) => (c(), r("div", null, [
12
12
  t[0] || (t[0] = o("h2", null, "npm module test", -1)),
13
13
  t[1] || (t[1] = o("h2", null, "作者 侯文建", -1)),
14
14
  o("div", null, [
15
- o("button", d, c(n.value), 1)
15
+ o("button", i, d(n.value), 1)
16
16
  ])
17
17
  ]));
18
18
  }
19
- }, p = /* @__PURE__ */ u(i, [["__scopeId", "data-v-4a4b3aff"]]), m = {
19
+ }, p = /* @__PURE__ */ a(u, [["__scopeId", "data-v-fbac503d"]]), f = {
20
20
  install(e) {
21
21
  e.component("RichEditor", p);
22
22
  }
23
23
  };
24
24
  export {
25
25
  p as RichEditor,
26
- m as default
26
+ f as default
27
27
  };
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.houwenjian={},t.Vue))})(this,function(t,e){"use strict";const _="",d=(o,s)=>{const i=o.__vccOpts||o;for(const[n,u]of s)i[n]=u;return i},r={class:"buttons"},l=d({__name:"test",setup(o){const s=e.ref("hello world");return(i,n)=>(e.openBlock(),e.createElementBlock("div",null,[n[0]||(n[0]=e.createElementVNode("h2",null,"npm module test",-1)),n[1]||(n[1]=e.createElementVNode("h2",null,"作者 侯文建",-1)),e.createElementVNode("div",null,[e.createElementVNode("button",r,e.toDisplayString(s.value),1)])]))}},[["__scopeId","data-v-4a4b3aff"]]),c={install(o){o.component("RichEditor",l)}};t.RichEditor=l,t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.houwenjian={},t.Vue))})(this,function(t,e){"use strict";const _="",a="",l=(o,s)=>{const i=o.__vccOpts||o;for(const[n,u]of s)i[n]=u;return i},c={class:"buttons"},d=l({__name:"test",setup(o){const s=e.ref("hello world");return(i,n)=>(e.openBlock(),e.createElementBlock("div",null,[n[0]||(n[0]=e.createElementVNode("h2",null,"npm module test",-1)),n[1]||(n[1]=e.createElementVNode("h2",null,"作者 侯文建",-1)),e.createElementVNode("div",null,[e.createElementVNode("button",c,e.toDisplayString(s.value),1)])]))}},[["__scopeId","data-v-fbac503d"]]),r={install(o){o.component("RichEditor",d)}};t.RichEditor=d,t.default=r,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .buttons[data-v-4a4b3aff]{color:red}
1
+ .main{color:#323133,}.buttons[data-v-fbac503d]{color:red}
package/package.json CHANGED
@@ -1,10 +1,21 @@
1
1
  {
2
2
  "name": "houwenjian",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Vue-based npm package built with Vite (JavaScript version)",
5
5
  "main": "dist/houwenjian.umd.js",
6
6
  "module": "dist/houwenjian.es.js",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "type": "module",
7
11
  "types": "dist/houwenjian.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/houwenjian.es.js",
15
+ "require": "./dist/houwenjian.umd.js"
16
+ },
17
+ "./style.css": "./dist/style.css"
18
+ },
8
19
  "scripts": {
9
20
  "dev": "vite build --watch",
10
21
  "build": "vite build",
@@ -14,6 +25,9 @@
14
25
  "dependencies": {
15
26
  "vue": "^3.2.0"
16
27
  },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
17
31
  "devDependencies": {
18
32
  "@vitejs/plugin-vue": "^4.0.0",
19
33
  "@vue/test-utils": "^2.4.6",
package/src/index.js DELETED
@@ -1,12 +0,0 @@
1
- import RichEditor from './test.vue';
2
-
3
- // 定义插件安装方法(Vue3标准方式)
4
- export default {
5
- install(app) {
6
- // 注册全局组件
7
- app.component('RichEditor', RichEditor);
8
- }
9
- };
10
-
11
- // 兼容直接导入组件(按需引入)
12
- export { RichEditor };
package/src/test.vue DELETED
@@ -1,19 +0,0 @@
1
- <template>
2
- <div>
3
- <h2>npm module test</h2>
4
- <h2>作者 侯文建</h2>
5
- <div>
6
- <button class="buttons">{{ message }}</button>
7
- </div>
8
- </div>
9
- </template>
10
- <script setup>
11
- import { ref } from 'vue';
12
- const message = ref("hello world")
13
- </script>
14
-
15
- <style scoped>
16
- .buttons{
17
- color:red;
18
- }
19
- </style>
@@ -1,29 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { mount } from '@vue/test-utils';
3
- import { RichEditor } from '../src/index';
4
-
5
- describe('RichEditor', () => {
6
- // 基础渲染测试
7
- it('renders correctly', () => {
8
- const wrapper = mount(RichEditor);
9
-
10
- // 获取所有h2元素
11
- const h2Elements = wrapper.findAll('h2');
12
-
13
- // 验证组件渲染的DOM结构
14
- expect(h2Elements[0].text()).toContain('npm module test');
15
- expect(h2Elements[1].text()).toContain('作者 侯文建');
16
- });
17
-
18
- // 组件属性测试
19
- it('handles props correctly', async () => {
20
- // 如果有需要测试的props,在这里添加具体用例
21
- const wrapper = mount(RichEditor);
22
- });
23
-
24
- // 组件事件测试
25
- it('emits events correctly', async () => {
26
- // 如果有需要测试的事件,在这里添加具体用例
27
- const wrapper = mount(RichEditor);
28
- });
29
- });
package/vite.config.js DELETED
@@ -1,25 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import vue from '@vitejs/plugin-vue';
3
-
4
- export default defineConfig({
5
- plugins: [vue()],
6
- build: {
7
- lib: {
8
- entry: './src/index.js',
9
- name: 'houwenjian',
10
- fileName: (format) => `houwenjian.${format}.js`
11
- },
12
- rollupOptions: {
13
- external: ['vue'],
14
- output: {
15
- globals: {
16
- vue: 'Vue'
17
- }
18
- }
19
- }
20
- },
21
- test: {
22
- environment: 'jsdom', // 配置测试环境为JSDOM
23
- globals: true
24
- }
25
- });