Skip to content

Commit a54e336

Browse files
committed
chore: ready for publish to npm
1 parent 30fdec1 commit a54e336

16 files changed

+111
-15
lines changed

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": true,
5+
"semi": false,
6+
"trailingComma": "none",
7+
"printWidth": 80
8+
}

src/App.vue app/App.vue

File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main.ts app/main.ts

File renamed without changes.

src/style.css app/style.css

File renamed without changes.
File renamed without changes.

index.html

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + Vue + TS</title>
8-
</head>
9-
<body>
10-
<div id="app"></div>
11-
<script type="module" src="/src/main.ts"></script>
12-
</body>
13-
</html>
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Vite + Vue + TS</title>
9+
</head>
10+
11+
<body>
12+
<div id="app"></div>
13+
<script type="module" src="/app/main.ts"></script>
14+
</body>
15+
16+
</html>

lib/vite.svg

+1
Loading

lib/vue-cmdk-palette.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineComponent as e, h as m } from "vue";
2+
const o = e({
3+
name: "Cmdk",
4+
setup(n, { attrs: r, slots: t }) {
5+
return () => m(
6+
"div",
7+
{
8+
"cmdk-root": ""
9+
},
10+
t
11+
);
12+
}
13+
}), p = Object.assign(o, {
14+
Root: o
15+
});
16+
export {
17+
p as Cmdk
18+
};

lib/vue-cmdk-palette.umd.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.VueCmdkPalette={},e.Vue))})(this,function(e,t){"use strict";const n=t.defineComponent({name:"Cmdk",setup(i,{attrs:u,slots:d}){return()=>t.h("div",{"cmdk-root":""},d)}}),o=Object.assign(n,{Root:n});e.Cmdk=o,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

package.json

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
{
22
"name": "vue-cmdk-palette",
3-
"private": true,
4-
"version": "0.0.0",
3+
"version": "0.0.1",
54
"type": "module",
5+
"author": {
6+
"name": "xiaoluoboding",
7+
"email": "[email protected]"
8+
},
69
"scripts": {
710
"dev": "vite",
11+
"build:types": "vue-tsc --declaration --emitDeclarationOnly",
812
"build": "vue-tsc --noEmit && vite build",
913
"preview": "vite preview"
1014
},
15+
"files": [
16+
"lib"
17+
],
18+
"main": "./lib/vue-cmdk-palette.umd.cjs",
19+
"module": "./lib/vue-cmdk-palette.js",
20+
"exports": {
21+
".": {
22+
"import": "./lib/vue-cmdk-palette.js",
23+
"require": "./lib/vue-cmdk-palette.umd.cjs"
24+
}
25+
},
1126
"dependencies": {
1227
"vue": "^3.2.37"
1328
},
1429
"devDependencies": {
30+
"@types/node": "^18.7.14",
1531
"@vitejs/plugin-vue": "^3.0.3",
1632
"typescript": "^4.6.4",
1733
"vite": "^3.0.7",

pnpm-lock.yaml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineComponent, h } from 'vue'
2+
3+
/**
4+
* Cmdk Root Node
5+
*/
6+
const Cmdk = defineComponent({
7+
name: 'Cmdk',
8+
setup(props, { attrs, slots }) {
9+
return () =>
10+
h(
11+
'div',
12+
{
13+
'cmdk-root': ''
14+
},
15+
slots
16+
)
17+
}
18+
})
19+
20+
const pkg = Object.assign(Cmdk, {
21+
Root: Cmdk
22+
})
23+
24+
export { pkg as Cmdk }

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"lib": ["ESNext", "DOM"],
1414
"skipLibCheck": true
1515
},
16-
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
16+
"include": ["app/**/*.ts", "app/**/*.d.ts", "app/**/*.tsx", "app/**/*.vue"],
1717
"references": [{ "path": "./tsconfig.node.json" }]
1818
}

vite.config.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
import { defineConfig } from 'vite'
2+
import { resolve } from 'path'
23
import vue from '@vitejs/plugin-vue'
34

45
// https://vitejs.dev/config/
56
export default defineConfig({
6-
plugins: [vue()]
7+
plugins: [vue()],
8+
build: {
9+
lib: {
10+
entry: resolve(__dirname, 'src/index.ts'),
11+
name: 'VueCmdkPalette',
12+
fileName: 'vue-cmdk-palette'
13+
},
14+
outDir: 'lib',
15+
emptyOutDir: true,
16+
sourcemap: false,
17+
rollupOptions: {
18+
external: ['vue'],
19+
output: {
20+
globals: {
21+
vue: 'Vue'
22+
}
23+
}
24+
}
25+
}
726
})

0 commit comments

Comments
 (0)