aibox-custom-component-packages 0.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/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # aibox-custom-component-packages
2
+
3
+ Aibox 自定义组件库,可直接被外部项目引用。
4
+
5
+ ## 📦 安装
6
+
7
+ ```bash
8
+ pnpm add aibox-custom-component-packages
9
+ # 或
10
+ npm install aibox-custom-component-packages
11
+ # 或
12
+ yarn add aibox-custom-component-packages
13
+ ```
14
+
15
+ ## 🚀 快速开始
16
+
17
+ ### 全局注册(推荐)
18
+
19
+ ```javascript
20
+ // main.js
21
+ import { createApp } from 'vue'
22
+ import AiboxComponents from 'aibox-custom-component-packages'
23
+ import App from './App.vue'
24
+
25
+ // 引入样式
26
+ import 'aibox-custom-component-packages/index.css'
27
+
28
+ const app = createApp(App)
29
+ app.use(AiboxComponents)
30
+ app.mount('#app')
31
+ ```
32
+
33
+ ### 按需引入
34
+
35
+ ```vue
36
+ <template>
37
+ <ExampleComponent title="Hello" message="这是 Aibox 组件库" />
38
+ </template>
39
+
40
+ <script setup>
41
+ import { ExampleComponent } from 'aibox-custom-component-packages'
42
+ </script>
43
+ ```
44
+
45
+ ## 📚 组件列表
46
+
47
+ - `ExampleComponent` - 示例组件
48
+
49
+ ## 🔧 开发
50
+
51
+ ```bash
52
+ # 安装依赖
53
+ pnpm install
54
+
55
+ # 构建
56
+ pnpm run build
57
+
58
+ # 发布
59
+ pnpm run release
60
+ ```
61
+
62
+ ## 📄 License
63
+
64
+ [MIT](../../../LICENSE) License
@@ -0,0 +1,35 @@
1
+ import { createElementBlock as r, openBlock as c, createElementVNode as a, renderSlot as m, toDisplayString as o } from "vue";
2
+ import './assets/ExampleComponent.css';const u = (e) => (e.install = (t) => {
3
+ const n = e.name || e.__name;
4
+ t.component(n, e);
5
+ }, e), i = (e, t) => {
6
+ const n = e.__vccOpts || e;
7
+ for (const [l, s] of t)
8
+ n[l] = s;
9
+ return n;
10
+ }, p = { class: "example-component" }, _ = /* @__PURE__ */ Object.assign({
11
+ name: "ExampleComponent"
12
+ }, {
13
+ __name: "layout",
14
+ props: {
15
+ title: {
16
+ type: String,
17
+ default: "示例组件"
18
+ },
19
+ message: {
20
+ type: String,
21
+ default: "这是一个示例组件"
22
+ }
23
+ },
24
+ setup(e) {
25
+ return (t, n) => (c(), r("div", p, [
26
+ a("h3", null, o(e.title), 1),
27
+ a("p", null, o(e.message), 1),
28
+ m(t.$slots, "default", {}, void 0, !0)
29
+ ]));
30
+ }
31
+ }), d = /* @__PURE__ */ i(_, [["__scopeId", "data-v-28b17e43"]]), g = u(d);
32
+ export {
33
+ g as ExampleComponent,
34
+ g as default
35
+ };
@@ -0,0 +1 @@
1
+ .example-component[data-v-28b17e43]{padding:20px;border:1px solid #ddd;border-radius:4px;background-color:#fff}.example-component h3[data-v-28b17e43]{margin:0 0 10px;color:#333;font-size:16px;font-weight:500}.example-component p[data-v-28b17e43]{margin:0;color:#666;font-size:14px}
File without changes
package/es/index.mjs ADDED
@@ -0,0 +1,14 @@
1
+ import { ExampleComponent as n } from "./ExampleComponent.mjs";
2
+ const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
+ __proto__: null,
4
+ ExampleComponent: n
5
+ }, Symbol.toStringTag, { value: "Module" })), l = (t) => {
6
+ for (const e in o)
7
+ o[e].install && t.use(o[e]);
8
+ }, s = {
9
+ install: l
10
+ };
11
+ export {
12
+ n as ExampleComponent,
13
+ s as default
14
+ };
package/index.css ADDED
File without changes
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/ExampleComponent.css');const t=require("vue"),r=e=>(e.install=n=>{const o=e.name||e.__name;n.component(o,e)},e),c=(e,n)=>{const o=e.__vccOpts||e;for(const[a,s]of n)o[a]=s;return o},u={class:"example-component"},i=Object.assign({name:"ExampleComponent"},{__name:"layout",props:{title:{type:String,default:"示例组件"},message:{type:String,default:"这是一个示例组件"}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",u,[t.createElementVNode("h3",null,t.toDisplayString(e.title),1),t.createElementVNode("p",null,t.toDisplayString(e.message),1),t.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),m=c(i,[["__scopeId","data-v-28b17e43"]]),l=r(m);exports.ExampleComponent=l;exports.default=l;
@@ -0,0 +1 @@
1
+ .example-component[data-v-28b17e43]{padding:20px;border:1px solid #ddd;border-radius:4px;background-color:#fff}.example-component h3[data-v-28b17e43]{margin:0 0 10px;color:#333;font-size:16px;font-weight:500}.example-component p[data-v-28b17e43]{margin:0;color:#666;font-size:14px}
File without changes
package/lib/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./ExampleComponent.js"),e=Object.freeze(Object.defineProperty({__proto__:null,ExampleComponent:t.ExampleComponent},Symbol.toStringTag,{value:"Module"})),l=n=>{for(const o in e)e[o].install&&n.use(e[o])},p={install:l};exports.ExampleComponent=t.ExampleComponent;exports.default=p;
package/package.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "name": "aibox-custom-component-packages",
3
+ "version": "0.0.2",
4
+ "keywords": [
5
+ "components",
6
+ "vue",
7
+ "ui",
8
+ "aibox"
9
+ ],
10
+ "homepage": "https://github.com/your-org/aibox-custom-component-packages#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/your-org/aibox-custom-component-packages.git"
14
+ },
15
+ "license": "MIT",
16
+ "author": "Aibox Team",
17
+ "sideEffects": [
18
+ "**/*.css"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "import": "./es/index.mjs",
23
+ "require": "./lib/index.js"
24
+ },
25
+ "./es": {
26
+ "import": "./es/index.mjs"
27
+ },
28
+ "./lib": {
29
+ "require": "./lib/index.js"
30
+ },
31
+ "./es/*": {
32
+ "import": "./es/*.mjs"
33
+ },
34
+ "./es/*.mjs": {
35
+ "import": "./es/*.mjs"
36
+ },
37
+ "./lib/*.js": {
38
+ "require": "./lib/*.js"
39
+ },
40
+ "./lib/*": {
41
+ "require": "./lib/*.js"
42
+ },
43
+ "./index.css": "./index.css"
44
+ },
45
+ "main": "lib/index.js",
46
+ "import": "./es/index.mjs",
47
+ "module": "lib/index.js",
48
+ "files": [
49
+ "es",
50
+ "lib",
51
+ "index.css"
52
+ ],
53
+ "devDependencies": {
54
+ "@commitlint/cli": "^20.1.0",
55
+ "@rushstack/eslint-patch": "^1.12.0",
56
+ "@tsconfig/node18": "^18.2.4",
57
+ "@types/node": "^24.9.1",
58
+ "@vitejs/plugin-vue": "^6.0.3",
59
+ "@vue/tsconfig": "^0.8.1",
60
+ "axios": "^1.12.2",
61
+ "commitlint-config-ali": "^1.3.0",
62
+ "eslint": "^9.38.0",
63
+ "eslint-config-ali": "^16.5.0",
64
+ "eslint-config-prettier": "^10.1.8",
65
+ "eslint-import-resolver-alias": "^1.1.2",
66
+ "eslint-import-resolver-node": "^0.3.9",
67
+ "eslint-plugin-import": "^2.32.0",
68
+ "eslint-plugin-prettier": "^5.5.4",
69
+ "lint-staged": "^16.2.5",
70
+ "patch-package": "^8.0.0",
71
+ "postcss": "^8.5.6",
72
+ "prettier": "^3.6.2",
73
+ "prettier-config-ali": "^1.5.0",
74
+ "sass": "^1.93.2",
75
+ "stylelint": "^16.23.1",
76
+ "stylelint-config-ali": "^2.3.0",
77
+ "stylelint-prettier": "^5.0.3",
78
+ "typescript": "~5.9.3",
79
+ "vite": "^7.3.0",
80
+ "vite-plugin-lib-inject-css": "^2.2.2",
81
+ "vue": "^3.5.25"
82
+ },
83
+ "dependencies": {
84
+ "@vueuse/core": "^14.0.0",
85
+ "element-plus": "^2.13.1",
86
+ "vue": "^3.5.26"
87
+ },
88
+ "peerDependencies": {
89
+ "vue": "^3.5.26",
90
+ "element-plus": "^2.13.1"
91
+ },
92
+ "engines": {
93
+ "node": ">=18"
94
+ },
95
+ "scripts": {
96
+ "build": "vite build && pnpm run postbuild",
97
+ "postbuild": "node -e \"const fs = require('fs'); const path = require('path'); const src = path.join(__dirname, 'es', 'assets', 'index.css'); const dest = path.join(__dirname, 'index.css'); if (fs.existsSync(src)) { fs.copyFileSync(src, dest); console.log('组件库样式文件已复制到根目录'); } else { console.log('警告: 组件库样式文件不存在'); }\"",
98
+ "build:clean": "rimraf lib es",
99
+ "dev": "vite --config ./play/vite.config.js",
100
+ "lint": "eslint . && stylelint \"**/*.{css,less,scss}\"",
101
+ "lint:fix": "prettier --write . && eslint --fix . && stylelint --fix \"**/*.{css,less,scss}\" ",
102
+ "release": "node ../../scripts/publish-package.js aibox-custom-component-packages",
103
+ "release:patch": "node ../../scripts/publish-package.js aibox-custom-component-packages --patch",
104
+ "version": "bumpp --no-tag --no-commit"
105
+ }
106
+ }