diff options
Diffstat (limited to 'src/packages/vue')
-rw-r--r-- | src/packages/vue/.gitignore | 24 | ||||
-rw-r--r-- | src/packages/vue/README.md | 5 | ||||
-rw-r--r-- | src/packages/vue/eslint.config.mjs | 11 | ||||
-rw-r--r-- | src/packages/vue/index.html | 13 | ||||
-rw-r--r-- | src/packages/vue/package.json | 55 | ||||
-rw-r--r-- | src/packages/vue/src/components/Locusts.vue | 6 | ||||
-rw-r--r-- | src/packages/vue/src/index.ts | 3 | ||||
-rw-r--r-- | src/packages/vue/src/vite-env.d.ts | 1 | ||||
-rw-r--r-- | src/packages/vue/tsconfig.json | 19 | ||||
-rw-r--r-- | src/packages/vue/vite.config.ts | 23 |
10 files changed, 160 insertions, 0 deletions
diff --git a/src/packages/vue/.gitignore b/src/packages/vue/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/src/packages/vue/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/src/packages/vue/README.md b/src/packages/vue/README.md new file mode 100644 index 0000000..33895ab --- /dev/null +++ b/src/packages/vue/README.md @@ -0,0 +1,5 @@ +# Vue 3 + TypeScript + Vite + +This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. + +Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup). diff --git a/src/packages/vue/eslint.config.mjs b/src/packages/vue/eslint.config.mjs new file mode 100644 index 0000000..439d403 --- /dev/null +++ b/src/packages/vue/eslint.config.mjs @@ -0,0 +1,11 @@ +import library from "@repo/eslint-config/eslint.library.config.js"; +import pluginVue from "eslint-plugin-vue"; + +/** @type {import("eslint").Linter.Config[]} */ +export default [ + ...library, + ...pluginVue.configs["flat/recommended"], + { + ignores: ["dist/"], + }, +]; diff --git a/src/packages/vue/index.html b/src/packages/vue/index.html new file mode 100644 index 0000000..a6ef3a8 --- /dev/null +++ b/src/packages/vue/index.html @@ -0,0 +1,13 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <link rel="icon" type="image/svg+xml" href="/vite.svg" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Vite + Vue + TS</title> + </head> + <body> + <div id="app"></div> + <script type="module" src="/src/index.ts"></script> + </body> +</html> diff --git a/src/packages/vue/package.json b/src/packages/vue/package.json new file mode 100644 index 0000000..f706e3d --- /dev/null +++ b/src/packages/vue/package.json @@ -0,0 +1,55 @@ +{ + "name": "@locusts/vue", + "description": "A Vue 3 component that introduces locusts into your website.", + "author": "Matt Strapp <matt+locusts@mattstrapp.net> (https://mattstrapp.net)", + "bugs": "https://github.com/locusts-r-us/locusts/issues", + "license": "0BSD", + "repository": { + "type": "git", + "url": "git+https://github.com/locusts-r-us/locusts.git", + "directory": "packages/vue" + }, + "version": "0.0.0", + "type": "module", + "files": [ + "dist" + ], + "main": "./dist/locusts.umd.cjs", + "module": "./dist/locusts.js", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/locusts.js", + "require": "./dist/locusts.umd.cjs" + } + }, + "types": "./dist/index.d.ts", + "scripts": { + "dev": "vite dev", + "build": "vite build && vue-tsc --declaration --emitDeclarationOnly && publint", + "check": "vue-tsc --noEmit", + "format": "prettier --write .", + "lint": "prettier --check . && eslint --fix .", + "preview": "vite preview" + }, + "keywords": [ + "vue", + "vue3", + "component", + "why", + "joke" + ], + "peerDependencies": { + "vue": "^3.0.0" + }, + "devDependencies": { + "@repo/eslint-config": "workspace:*", + "@repo/typescript-config": "workspace:*", + "@vitejs/plugin-vue": "^5.1.4", + "eslint-plugin-vue": "^9.30.0", + "publint": "^0.2.0", + "typescript": "^5.6.3", + "vite": "^5.4.10", + "vue-tsc": "^2.1.8" + } +} diff --git a/src/packages/vue/src/components/Locusts.vue b/src/packages/vue/src/components/Locusts.vue new file mode 100644 index 0000000..a01014e --- /dev/null +++ b/src/packages/vue/src/components/Locusts.vue @@ -0,0 +1,6 @@ +<!-- eslint-disable vue/multi-word-component-names --> +<script setup lang="ts"></script> + +<template> + <div /> +</template> diff --git a/src/packages/vue/src/index.ts b/src/packages/vue/src/index.ts new file mode 100644 index 0000000..5158db7 --- /dev/null +++ b/src/packages/vue/src/index.ts @@ -0,0 +1,3 @@ +import Locusts from "./components/Locusts.vue"; + +export { Locusts }; diff --git a/src/packages/vue/src/vite-env.d.ts b/src/packages/vue/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/packages/vue/src/vite-env.d.ts @@ -0,0 +1 @@ +/// <reference types="vite/client" /> diff --git a/src/packages/vue/tsconfig.json b/src/packages/vue/tsconfig.json new file mode 100644 index 0000000..b8e300a --- /dev/null +++ b/src/packages/vue/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist", + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "useDefineForClassFields": true + }, + "exclude": [ + "node_modules", + "dist", + "src/main.ts", + "src/components/Locusts.vue" + ], + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/src/packages/vue/vite.config.ts b/src/packages/vue/vite.config.ts new file mode 100644 index 0000000..c1b4415 --- /dev/null +++ b/src/packages/vue/vite.config.ts @@ -0,0 +1,23 @@ +import { resolve } from "node:path"; +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [vue()], + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "Locusts", + fileName: "locusts", + }, + rollupOptions: { + external: ["vue"], + output: { + globals: { + vue: "Vue", + }, + }, + }, + }, +}); |