diff options
Diffstat (limited to '')
-rw-r--r-- | src/packages/svelte/.gitignore | 22 | ||||
-rw-r--r-- | src/packages/svelte/.npmrc | 1 | ||||
-rw-r--r-- | src/packages/svelte/.prettierignore | 4 | ||||
-rw-r--r-- | src/packages/svelte/.prettierrc | 15 | ||||
-rw-r--r-- | src/packages/svelte/README.md | 26 | ||||
-rw-r--r-- | src/packages/svelte/eslint.config.mjs | 23 | ||||
-rw-r--r-- | src/packages/svelte/package.json | 74 | ||||
-rw-r--r-- | src/packages/svelte/src/app.d.ts | 13 | ||||
-rw-r--r-- | src/packages/svelte/src/app.html | 12 | ||||
-rw-r--r-- | src/packages/svelte/src/demo.spec.ts | 7 | ||||
-rw-r--r-- | src/packages/svelte/src/lib/Locusts.svelte | 1 | ||||
-rw-r--r-- | src/packages/svelte/src/lib/index.ts | 1 | ||||
-rw-r--r-- | src/packages/svelte/src/routes/+page.svelte | 9 | ||||
-rw-r--r-- | src/packages/svelte/static/favicon.png | bin | 0 -> 1571 bytes | |||
-rw-r--r-- | src/packages/svelte/svelte.config.js | 18 | ||||
-rw-r--r-- | src/packages/svelte/tsconfig.json | 15 | ||||
-rw-r--r-- | src/packages/svelte/vite.config.ts | 10 |
17 files changed, 251 insertions, 0 deletions
diff --git a/src/packages/svelte/.gitignore b/src/packages/svelte/.gitignore new file mode 100644 index 0000000..715b548 --- /dev/null +++ b/src/packages/svelte/.gitignore @@ -0,0 +1,22 @@ +node_modules + +# Output +.output +.vercel +/.svelte-kit +/build +/dist + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/src/packages/svelte/.npmrc b/src/packages/svelte/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/src/packages/svelte/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/src/packages/svelte/.prettierignore b/src/packages/svelte/.prettierignore new file mode 100644 index 0000000..ab78a95 --- /dev/null +++ b/src/packages/svelte/.prettierignore @@ -0,0 +1,4 @@ +# Package Managers +package-lock.json +pnpm-lock.yaml +yarn.lock diff --git a/src/packages/svelte/.prettierrc b/src/packages/svelte/.prettierrc new file mode 100644 index 0000000..3f7802c --- /dev/null +++ b/src/packages/svelte/.prettierrc @@ -0,0 +1,15 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} diff --git a/src/packages/svelte/README.md b/src/packages/svelte/README.md new file mode 100644 index 0000000..47901b3 --- /dev/null +++ b/src/packages/svelte/README.md @@ -0,0 +1,26 @@ +# @locusts/svelte + +[![CI](https://github.com/locusts-r-us/locusts/actions/workflows/node.yml/badge.svg)](https://github.com/locusts-r-us/locusts/actions/workflows/node.yml) +[![NPM Version](https://img.shields.io/npm/v/%40locusts%2Fsvelte?logo=svelte)](https://www.npmjs.com/package/@locusts/svelte) + +## Description + +@locusts/svelte is a member of a [series of components](https://github.com/locusts-r-us/locusts) that allows you to introduce locusts into your website. + +Why would you want to do that? I don't know. + +## Installation + +```sh +npm add -D @locusts/svelte +``` + +## Example + +```svelte +<script> + import Locusts from '@locusts/svelte'; +</script> + +<Locusts /> +``` diff --git a/src/packages/svelte/eslint.config.mjs b/src/packages/svelte/eslint.config.mjs new file mode 100644 index 0000000..7a1890c --- /dev/null +++ b/src/packages/svelte/eslint.config.mjs @@ -0,0 +1,23 @@ +import svelte from 'eslint-plugin-svelte'; +import ts from 'typescript-eslint'; +import library from '@repo/eslint-config/eslint.library.config.js'; + +const svelteConfig = ts.config( + ...svelte.configs['flat/recommended'], + ...svelte.configs['flat/prettier'], + { + files: ['**/*.svelte'], + + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + }, + { + ignores: ['build/', '.svelte-kit/', 'dist/'] + } +); + +/** @type {import("eslint").Linter.Config[]} */ +export default [...library, ...svelteConfig]; diff --git a/src/packages/svelte/package.json b/src/packages/svelte/package.json new file mode 100644 index 0000000..c8940a3 --- /dev/null +++ b/src/packages/svelte/package.json @@ -0,0 +1,74 @@ +{ + "name": "@locusts/svelte", + "description": "A svelte component that introduces locusts into your website.", + "version": "0.0.0", + "author": "Matt Strapp <matt+locusts@mattstrapp.net> (https://mattstrapp.net)", + "bugs": "https://github.com/locusts-r-us/locusts/issues", + "scripts": { + "dev": "vite dev", + "build": "vite build && npm run package", + "clean": "rm -rf dist && rm -rf node_modules", + "preview": "vite preview", + "package": "svelte-kit sync && svelte-package && publint", + "prepublishOnly": "npm run package", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "format": "prettier --write .", + "lint": "prettier --check . && eslint --fix .", + "test:unit": "vitest", + "test": "npm run test:unit -- --run" + }, + "keywords": [ + "svelte", + "component", + "why", + "joke" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/locusts-r-us/locusts.git", + "directory": "packages/svelte" + }, + "license": "0BSD", + "files": [ + "dist", + "!dist/**/*.test.*", + "!dist/**/*.spec.*" + ], + "sideEffects": [ + "**/*.css" + ], + "svelte": "./dist/index.js", + "types": "./dist/index.d.ts", + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" + } + }, + "peerDependencies": { + "svelte": "^5.0.0" + }, + "devDependencies": { + "@repo/eslint-config": "workspace:*", + "@repo/typescript-config": "workspace:*", + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/kit": "^2.8.1", + "@sveltejs/package": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "prettier-plugin-svelte": "^3.2.8", + "publint": "^0.2.0", + "svelte": "^5.1.16", + "svelte-check": "^4.0.7", + "typescript": "^5.6.3", + "typescript-eslint": "^8.14.0", + "vite": "^5.4.11", + "vitest": "^2.1.5" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/src/packages/svelte/src/app.d.ts b/src/packages/svelte/src/app.d.ts new file mode 100644 index 0000000..da08e6d --- /dev/null +++ b/src/packages/svelte/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://svelte.dev/docs/kit/types#app.d.ts +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/src/packages/svelte/src/app.html b/src/packages/svelte/src/app.html new file mode 100644 index 0000000..f22aeaa --- /dev/null +++ b/src/packages/svelte/src/app.html @@ -0,0 +1,12 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <link rel="icon" href="%sveltekit.assets%/favicon.png" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + %sveltekit.head% + </head> + <body data-sveltekit-preload-data="hover"> + <div>%sveltekit.body%</div> + </body> +</html> diff --git a/src/packages/svelte/src/demo.spec.ts b/src/packages/svelte/src/demo.spec.ts new file mode 100644 index 0000000..d2c1a85 --- /dev/null +++ b/src/packages/svelte/src/demo.spec.ts @@ -0,0 +1,7 @@ +import { describe, expect, it } from 'vitest'; + +describe('Locusts should exist', () => { + it('Locusts should exist', () => { + expect(true); + }); +}); diff --git a/src/packages/svelte/src/lib/Locusts.svelte b/src/packages/svelte/src/lib/Locusts.svelte new file mode 100644 index 0000000..1a8f875 --- /dev/null +++ b/src/packages/svelte/src/lib/Locusts.svelte @@ -0,0 +1 @@ +<!--Locusts!!--> diff --git a/src/packages/svelte/src/lib/index.ts b/src/packages/svelte/src/lib/index.ts new file mode 100644 index 0000000..4303746 --- /dev/null +++ b/src/packages/svelte/src/lib/index.ts @@ -0,0 +1 @@ +export { default as Locusts } from './Locusts.svelte'; diff --git a/src/packages/svelte/src/routes/+page.svelte b/src/packages/svelte/src/routes/+page.svelte new file mode 100644 index 0000000..7c027d4 --- /dev/null +++ b/src/packages/svelte/src/routes/+page.svelte @@ -0,0 +1,9 @@ +<script lang="ts"> + import Locusts from '$lib/Locusts.svelte'; +</script> + +<Locusts /> + +<h1>Welcome to your library project</h1> +<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p> +<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p> diff --git a/src/packages/svelte/static/favicon.png b/src/packages/svelte/static/favicon.png Binary files differnew file mode 100644 index 0000000..825b9e6 --- /dev/null +++ b/src/packages/svelte/static/favicon.png diff --git a/src/packages/svelte/svelte.config.js b/src/packages/svelte/svelte.config.js new file mode 100644 index 0000000..1295460 --- /dev/null +++ b/src/packages/svelte/svelte.config.js @@ -0,0 +1,18 @@ +import adapter from '@sveltejs/adapter-auto'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://svelte.dev/docs/kit/integrations + // for more information about preprocessors + preprocess: vitePreprocess(), + + kit: { + // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://svelte.dev/docs/kit/adapters for more information about adapters. + adapter: adapter() + } +}; + +export default config; diff --git a/src/packages/svelte/tsconfig.json b/src/packages/svelte/tsconfig.json new file mode 100644 index 0000000..cc1d5e0 --- /dev/null +++ b/src/packages/svelte/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": ["@repo/typescript-config/base.json", "./.svelte-kit/tsconfig.json"], + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "module": "NodeNext", + "moduleResolution": "NodeNext" + } +} diff --git a/src/packages/svelte/vite.config.ts b/src/packages/svelte/vite.config.ts new file mode 100644 index 0000000..d76fc8a --- /dev/null +++ b/src/packages/svelte/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vitest/config'; +import { sveltekit } from '@sveltejs/kit/vite'; + +export default defineConfig({ + plugins: [sveltekit()], + + test: { + include: ['src/**/*.{test,spec}.{js,ts}'] + } +}); |