aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Strapp <matt@mattstrapp.net>2024-10-31 13:28:18 -0500
committerGitHub <noreply@github.com>2024-10-31 13:28:18 -0500
commit9172bb74d2c03c92902136c1831874337ab394dd (patch)
tree56f73bed76bba4b55ad622a7a0a6af7713899c7f /src
parentrefactor: Update eslint configuration (diff)
downloadlocusts-9172bb74d2c03c92902136c1831874337ab394dd.tar
locusts-9172bb74d2c03c92902136c1831874337ab394dd.tar.gz
locusts-9172bb74d2c03c92902136c1831874337ab394dd.tar.bz2
locusts-9172bb74d2c03c92902136c1831874337ab394dd.tar.lz
locusts-9172bb74d2c03c92902136c1831874337ab394dd.tar.xz
locusts-9172bb74d2c03c92902136c1831874337ab394dd.tar.zst
locusts-9172bb74d2c03c92902136c1831874337ab394dd.zip
feat: Vue (#37)
--------- Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'src')
-rw-r--r--src/packages/eslint-config/eslint.library.config.d.ts2
-rw-r--r--src/packages/typescript-config/base.json12
-rw-r--r--src/packages/vue/.gitignore24
-rw-r--r--src/packages/vue/README.md5
-rw-r--r--src/packages/vue/eslint.config.mjs11
-rw-r--r--src/packages/vue/index.html13
-rw-r--r--src/packages/vue/package.json55
-rw-r--r--src/packages/vue/src/components/Locusts.vue6
-rw-r--r--src/packages/vue/src/index.ts3
-rw-r--r--src/packages/vue/src/vite-env.d.ts1
-rw-r--r--src/packages/vue/tsconfig.json19
-rw-r--r--src/packages/vue/vite.config.ts23
12 files changed, 172 insertions, 2 deletions
diff --git a/src/packages/eslint-config/eslint.library.config.d.ts b/src/packages/eslint-config/eslint.library.config.d.ts
new file mode 100644
index 0000000..56addbf
--- /dev/null
+++ b/src/packages/eslint-config/eslint.library.config.d.ts
@@ -0,0 +1,2 @@
+declare const _default: import(".pnpm/@typescript-eslint+utils@8.12.2_eslint@9.13.0_typescript@5.6.3/node_modules/@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
+export default _default;
diff --git a/src/packages/typescript-config/base.json b/src/packages/typescript-config/base.json
index d5ac453..7a30961 100644
--- a/src/packages/typescript-config/base.json
+++ b/src/packages/typescript-config/base.json
@@ -10,15 +10,23 @@
"forceConsistentCasingInFileNames": true,
"incremental": false,
"isolatedModules": true,
- "lib": ["es2022", "DOM", "DOM.Iterable"],
+ "lib": [
+ "es2022",
+ "DOM",
+ "DOM.Iterable"
+ ],
"module": "NodeNext",
"moduleDetection": "force",
"moduleResolution": "NodeNext",
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
+ "noUncheckedSideEffectImports": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2022"
}
-}
+} \ No newline at end of file
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",
+ },
+ },
+ },
+ },
+});