feat: 初始化

This commit is contained in:
CoderLambert
2024-08-14 10:16:38 +08:00
commit fc33266080
18 changed files with 2948 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
node_modules/
test/*/
+1
View File
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Example</title>
</head>
<body>
<div id="app"></div>
<script src="./src/main.ts" type="module"></script>
</body>
</html>
+16
View File
@@ -0,0 +1,16 @@
{
"name": "@lz-space/example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "vite"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@lz-space/components": "workspace:^"
}
}
+7
View File
@@ -0,0 +1,7 @@
<template>
<div class="">hello example</div>
<LzButton>LzButton🍊</LzButton>
<JsxButton>JsxButton🍊</JsxButton>
pnpm add @lz-space/components --workspace
</template>
<script lang="ts" setup name="App"></script>
+8
View File
@@ -0,0 +1,8 @@
import { createApp } from "vue";
import App from "./App.vue";
import LzUI from "@lz-space/components";
// createApp(App).mount("#app");
const app = createApp(App);
app.use(LzUI);
app.mount("#app");
+7
View File
@@ -0,0 +1,7 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
export default defineConfig({
plugins: [vue(), vueJsx()],
});
+32
View File
@@ -0,0 +1,32 @@
{
"name": "lz-space",
"version": "1.0.0",
"description": "",
"main": "index.js",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"preinstall": "npx only-allow pnpm",
"postinstall": "husky install",
"commit": "cz"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"vue": "^3.4.37"
},
"devDependencies": {
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"husky": "^9.1.4",
"vite": "^5.4.0"
}
}
+2
View File
@@ -0,0 +1,2 @@
import LzButton from "./src/Button.vue";
export default LzButton;
@@ -0,0 +1,8 @@
<template>
<button>
<slot>Lz按钮</slot>
</button>
</template>
<script lang="ts" setup>
defineOptions({ name: "LzButton" });
</script>
+11
View File
@@ -0,0 +1,11 @@
import { App } from "vue";
import JsxButton from "./jsxButton";
import LzButton from "./LzButton";
export { JsxButton, LzButton };
export default {
install(app: App) {
app.component(JsxButton.name, JsxButton);
app.component(LzButton.name, LzButton);
},
};
+2
View File
@@ -0,0 +1,2 @@
import JsxButton from "./src/Button";
export default JsxButton;
@@ -0,0 +1,8 @@
import { defineComponent } from "vue";
export default defineComponent({
name: "JsxButton",
setup(props, context) {
return () => <button>{context.slots.default?.()}</button>;
},
});
+13
View File
@@ -0,0 +1,13 @@
{
"name": "@lz-space/components",
"version": "1.0.0",
"description": "",
"main": "index.js",
"private": "true",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
+2801
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
packages:
# packages 目录下的所有次级目录
- "packages/**"
# 测试文件夹
- "example"
# 文档目录
- "docs"
+5
View File
@@ -0,0 +1,5 @@
declare module "*.vue" {
import { DefineComponent } from "vue";
const component: DefineComponent<{}, {}, any>;
export default component;
}
+5
View File
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"jsx": "preserve"
}
}