diff options
Diffstat (limited to 'src')
62 files changed, 975 insertions, 23 deletions
diff --git a/src/Locusts.cs b/src/Locusts.cs index c35a38c..354ee85 100644 --- a/src/Locusts.cs +++ b/src/Locusts.cs @@ -5,16 +5,16 @@ /// </summary>
public static class Locusts
{
- /// <summary>
- /// Introduce locusts into your codebase.
- /// </summary>
- /// <remarks>
- /// This method will introduce locusts into your codebase.
+ /// <summary>
+ /// Introduce locusts into your codebase.
+ /// </summary>
+ /// <remarks>
+ /// This method will introduce locusts into your codebase.
///
/// Locusts are not included with this library, you must provide your own.
- /// </remarks>
- public static void IntroduceLocusts()
+ /// </remarks>
+ public static void IntroduceLocusts()
{
// Method intentionally left empty.
}
-}
+}
\ No newline at end of file diff --git a/src/locusts-r-us/__init__.py b/src/__init__.py index e69de29..e69de29 100644 --- a/src/locusts-r-us/__init__.py +++ b/src/__init__.py diff --git a/src/locusts-r-us/locusts.py b/src/locusts-r-us/locusts.py deleted file mode 100644 index f050133..0000000 --- a/src/locusts-r-us/locusts.py +++ /dev/null @@ -1,6 +0,0 @@ -def introduce_locusts(): - """ - Introduce locusts into your codebase. - - Note that locusts are not included with this package, you must provide your own. - """ diff --git a/src/locusts-r-us/test_locusts.py b/src/locusts-r-us/test_locusts.py deleted file mode 100644 index 68e6df7..0000000 --- a/src/locusts-r-us/test_locusts.py +++ /dev/null @@ -1,9 +0,0 @@ -import unittest -from locusts import introduce_locusts - -class TestLocusts(unittest.TestCase): - def test_introduce_locusts(self): - self.assertIsNone(introduce_locusts()) - -if __name__ == '__main__': - unittest.main()
\ No newline at end of file diff --git a/src/locusts.ex b/src/locusts.ex new file mode 100644 index 0000000..fdcbc0f --- /dev/null +++ b/src/locusts.ex @@ -0,0 +1,19 @@ +defmodule Locusts do + @moduledoc """ + Documentation for `Locusts`. + """ + + @doc """ + Introduce locusts into your codebase. + + Note that locusts are not included with this package, you must provide your own. + + ## Examples + + iex> Locusts.introduce_locusts() + nil + + """ + def introduce_locusts do + end +end diff --git a/src/locusts.py b/src/locusts.py new file mode 100644 index 0000000..c3d10ca --- /dev/null +++ b/src/locusts.py @@ -0,0 +1,8 @@ +"""Here be locusts.""" + +def introduce_locusts(): + """ + Introduce locusts into your codebase. + + Note that locusts are not included with this package, you must provide your own. + """ diff --git a/src/locusts.rb b/src/locusts.rb new file mode 100644 index 0000000..f4bcbd9 --- /dev/null +++ b/src/locusts.rb @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +module Locusts + class Locusts + # Add locusts into your codebase. + # Note that locusts are not included with this package, you must provide your own. + # + # @return [nil] + def self.introduceLocusts + nil + end + end +end diff --git a/src/main/kotlin/io/github/Locusts.kt b/src/main/kotlin/io/github/Locusts.kt new file mode 100644 index 0000000..1e31b0e --- /dev/null +++ b/src/main/kotlin/io/github/Locusts.kt @@ -0,0 +1,12 @@ +/* + * This source file was generated by the Gradle 'init' task + */ +package io.github.locustsRUs.locusts + +class Locusts { + companion object { + fun introduceLocusts() { + return + } + } +} diff --git a/src/packages/eslint-config/README.md b/src/packages/eslint-config/README.md new file mode 100644 index 0000000..8b42d90 --- /dev/null +++ b/src/packages/eslint-config/README.md @@ -0,0 +1,3 @@ +# `@turbo/eslint-config` + +Collection of internal eslint configurations. 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/eslint-config/eslint.library.config.js b/src/packages/eslint-config/eslint.library.config.js new file mode 100644 index 0000000..8154244 --- /dev/null +++ b/src/packages/eslint-config/eslint.library.config.js @@ -0,0 +1,35 @@ +// @ts-check + +import globals from "globals"; +import eslint from "@eslint/js"; +import ts from "typescript-eslint"; +import prettier from "eslint-config-prettier"; +import turboPlugin from "eslint-plugin-turbo"; + +export default ts.config( + eslint.configs.recommended, + ...ts.configs.recommended, + { + name: "eslint-config-turbo (recreated flat)", + plugins: { + turbo: { rules: turboPlugin.rules }, + }, + rules: { + "turbo/no-undeclared-env-vars": "error", + }, + }, + { + name: "library", + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + React: true, + JSX: true, + Svelte: true + }, + }, + ignores: ["**/build/", "**/.svelte-kit/", "**/dist/"], + }, + prettier, +); diff --git a/src/packages/eslint-config/package.json b/src/packages/eslint-config/package.json new file mode 100644 index 0000000..41d79ce --- /dev/null +++ b/src/packages/eslint-config/package.json @@ -0,0 +1,18 @@ +{ + "name": "@repo/eslint-config", + "version": "0.0.0", + "devDependencies": { + "@types/eslint": "^9.6.0", + "eslint": "^9.14.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-turbo": "^2.2.3", + "globals": "^15.12.0", + "typescript": "^5.6.3", + "typescript-eslint": "^8.13.0" + }, + "files": [ + "library.mjs" + ], + "type": "module", + "private": true +} diff --git a/src/packages/locusts/.prettierignore b/src/packages/locusts/.prettierignore new file mode 100644 index 0000000..a0cc08c --- /dev/null +++ b/src/packages/locusts/.prettierignore @@ -0,0 +1,2 @@ +mod.ts +mod_test.ts
\ No newline at end of file diff --git a/src/packages/locusts/README.md b/src/packages/locusts/README.md new file mode 100644 index 0000000..3f9d787 --- /dev/null +++ b/src/packages/locusts/README.md @@ -0,0 +1,32 @@ +# Locusts + +[![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/locusts?logo=npm&label=NPM%20Package)](https://www.npmjs.com/package/locusts) + +[![Deno](https://github.com/locusts-r-us/locusts/actions/workflows/deno.yml/badge.svg)](https://github.com/locusts-r-us/locusts/actions/workflows/deno.yml) +[![JSR](https://jsr.io/badges/@locusts-r-us/locusts)](https://jsr.io/@locusts-r-us/locusts) + +## Description + +locusts is a member of a [series of libraries](https://github.com/locusts-r-us/locusts) that allows you to introduce locusts into your codebase. + +## Installation + +```sh +npm add locusts +``` + +## Example + +```javascript +import introduceLocusts from "locusts"; + +function main() { + introduceLocusts(); + // Locusts are now in your codebase! +} +``` + +## License + +This project is licensed under the BSD Zero Clause License. See the [LICENSE](https://github.com/locusts-r-us/locusts/blob/master/LICENSE) file for details. diff --git a/src/packages/locusts/deno.json b/src/packages/locusts/deno.json new file mode 100644 index 0000000..74cdbea --- /dev/null +++ b/src/packages/locusts/deno.json @@ -0,0 +1,19 @@ +{ + "name": "@locusts-r-us/locusts", + "version": "0.0.0", + "exports": "./mod.ts", + "tasks": { + "dev": "deno test --watch mod.ts" + }, + "license": "0BSD", + "imports": { + "@std/testing": "jsr:@std/testing@1", + "@std/expect": "jsr:@std/expect@1" + }, + "lint": { + "include": ["mod.ts", "mod_test.ts"] + }, + "fmt": { + "include": ["mod.ts", "mod_test.ts"] + } +} diff --git a/src/packages/locusts/eslint.config.mjs b/src/packages/locusts/eslint.config.mjs new file mode 100644 index 0000000..eab1d3a --- /dev/null +++ b/src/packages/locusts/eslint.config.mjs @@ -0,0 +1,10 @@ +// import ts from 'typescript-eslint'; +import library from "@repo/eslint-config/eslint.library.config.js"; + +/** @type {import("eslint").Linter.Config[]} */ +export default [ + ...library, + { + ignores: ["dist/"], + }, +]; diff --git a/src/packages/locusts/mod.ts b/src/packages/locusts/mod.ts new file mode 100644 index 0000000..f003203 --- /dev/null +++ b/src/packages/locusts/mod.ts @@ -0,0 +1,15 @@ +/** + * This module introduces locusts to your application. + * + * Why would you want to do that? I don't know, but you can. + * + * @example + * ```typescript + * import { introduceLocusts } from "@locusts-r-us/locusts" + * + * introduceLocusts() + * ``` + * @module + */ + +export * from "./src/index.ts"; diff --git a/src/packages/locusts/mod_test.ts b/src/packages/locusts/mod_test.ts new file mode 100644 index 0000000..470dd40 --- /dev/null +++ b/src/packages/locusts/mod_test.ts @@ -0,0 +1,11 @@ +import { describe, it } from "jsr:@std/testing/bdd"; +import { expect } from "jsr:@std/expect"; + +import { introduceLocusts } from "./mod.ts"; + +describe("Locusts", () => { + it("should be introduced", () => { + const result = introduceLocusts(); + expect(result).toBe(undefined); + }); +}); diff --git a/src/packages/locusts/package.json b/src/packages/locusts/package.json new file mode 100644 index 0000000..4d1319f --- /dev/null +++ b/src/packages/locusts/package.json @@ -0,0 +1,44 @@ +{ + "name": "locusts", + "description": "An npm package that introduces locusts into your codebase.", + "version": "0.0.0", + "author": "Matt Strapp <matt+locusts@mattstrapp.net> (https://mattstrapp.net)", + "bugs": "https://github.com/locusts-r-us/locusts/issues", + "devDependencies": { + "@repo/eslint-config": "workspace:*", + "@repo/typescript-config": "workspace:*", + "@types/node": "^22.9.0", + "globals": "^15.12.0", + "publint": "^0.2.0", + "tsup": "^8.3.5", + "tsx": "^4.19.2", + "typescript": "^5.6.3" + }, + "keywords": [ + "why", + "joke" + ], + "files": [ + "dist" + ], + "license": "0BSD", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "repository": { + "type": "git", + "url": "git+https://github.com/locusts-r-us/locusts.git", + "directory": "packages/locusts" + }, + "scripts": { + "build": "tsup src/index.ts --format cjs,esm --dts && publint", + "clean": "rm -rf dist && rm -rf node_modules", + "dev": "tsup src/index.ts --format cjs,esm --dts --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write . && eslint --fix .", + "test": "node --test --import tsx ./tests/locusts.test.ts" + }, + "publishConfig": { + "access": "public" + }, + "types": "./dist/index.d.ts" +} diff --git a/src/packages/locusts/src/index.ts b/src/packages/locusts/src/index.ts new file mode 100644 index 0000000..68f894d --- /dev/null +++ b/src/packages/locusts/src/index.ts @@ -0,0 +1,17 @@ +/** + * Introduce locusts into your codebase. + * @remarks + * Locusts are not included in this package. You must provide your own locusts. + * @public + * @example + * ```js + * import introduceLocusts from 'locusts'; + * introduceLocusts(); + * ``` + * @returns void + */ +export function introduceLocusts() { + // This space intentionally left blank +} + +export default introduceLocusts; diff --git a/src/packages/locusts/tests/locusts.test.ts b/src/packages/locusts/tests/locusts.test.ts new file mode 100644 index 0000000..7875cbd --- /dev/null +++ b/src/packages/locusts/tests/locusts.test.ts @@ -0,0 +1,9 @@ +import { describe, it } from "node:test"; +import introduceLocusts from "../src/index.ts"; + +describe("Locusts", () => { + it("should be able to be introduced to the environment", () => { + introduceLocusts(); + // Test code here + }); +}); diff --git a/src/packages/locusts/tsconfig.json b/src/packages/locusts/tsconfig.json new file mode 100644 index 0000000..5e3db2b --- /dev/null +++ b/src/packages/locusts/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": ["src"], + "exclude": ["node_modules", "dist"] +} diff --git a/src/packages/react/.gitignore b/src/packages/react/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/src/packages/react/.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/react/README.md b/src/packages/react/README.md new file mode 100644 index 0000000..39a04eb --- /dev/null +++ b/src/packages/react/README.md @@ -0,0 +1,26 @@ +# @locusts/react + +[![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%2Freact?logo=react)](https://www.npmjs.com/package/@locusts/react) + +## Description + +@locusts/react 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 + +```bash +npm install -D @locusts/react +``` + +## Usage + +```tsx +import { Locusts } from "@locusts/react"; + +export default function App() { + return <Locusts />; +} +``` diff --git a/src/packages/react/eslint.config.mjs b/src/packages/react/eslint.config.mjs new file mode 100644 index 0000000..f49f020 --- /dev/null +++ b/src/packages/react/eslint.config.mjs @@ -0,0 +1,33 @@ +import library from "@repo/eslint-config/eslint.library.config.js"; + +import globals from "globals"; +import react from "eslint-plugin-react"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { ignores: ["dist"] }, + { + extends: [...library], + files: ["**/*.{ts,tsx}"], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh, + react, + }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true }, + ], + ...react.configs.recommended.rules, + ...react.configs["jsx-runtime"].rules, + }, + }, +); diff --git a/src/packages/react/package.json b/src/packages/react/package.json new file mode 100644 index 0000000..7be7572 --- /dev/null +++ b/src/packages/react/package.json @@ -0,0 +1,61 @@ +{ + "name": "@locusts/react", + "version": "0.0.0", + "description": "A React 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" + }, + "files": [ + "dist" + ], + "main": "./dist/locusts.umd.cjs", + "module": "./dist/locusts.js", + "type": "module", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/locusts.js", + "require": "./dist/locusts.umd.cjs" + } + }, + "keywords": [ + "react", + "component", + "why", + "joke" + ], + "types": "./dist/index.d.ts", + "scripts": { + "dev": "vite", + "build": "vite build && tsc --declaration --emitDeclarationOnly && publint", + "format": "prettier --write . && eslint --fix .", + "lint": "prettier --check . && eslint .", + "preview": "vite preview" + }, + "peerDependencies": { + "react": ">=18.0.0" + }, + "devDependencies": { + "@repo/eslint-config": "workspace:*", + "@repo/typescript-config": "workspace:*", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react-swc": "^3.5.0", + "eslint-plugin-react": "^7.37.2", + "eslint-plugin-react-hooks": "^5.0.0", + "eslint-plugin-react-refresh": "^0.4.14", + "globals": "^15.12.0", + "publint": "^0.2.0", + "typescript": "^5.6.2", + "typescript-eslint": "^8.13.0", + "vite": "^5.4.10" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/src/packages/react/src/components/Locusts.tsx b/src/packages/react/src/components/Locusts.tsx new file mode 100644 index 0000000..37aff97 --- /dev/null +++ b/src/packages/react/src/components/Locusts.tsx @@ -0,0 +1,5 @@ +export const Locusts = () => { + return <></>; +}; + +export default Locusts; diff --git a/src/packages/react/src/index.ts b/src/packages/react/src/index.ts new file mode 100644 index 0000000..10e55c7 --- /dev/null +++ b/src/packages/react/src/index.ts @@ -0,0 +1,3 @@ +import Locusts from "./components/Locusts"; + +export { Locusts }; diff --git a/src/packages/react/src/vite-env.d.ts b/src/packages/react/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/packages/react/src/vite-env.d.ts @@ -0,0 +1 @@ +/// <reference types="vite/client" /> diff --git a/src/packages/react/tsconfig.json b/src/packages/react/tsconfig.json new file mode 100644 index 0000000..4928d20 --- /dev/null +++ b/src/packages/react/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "allowImportingTsExtensions": true, + "outDir": "dist", + "declaration": true, + "declarationDir": "dist", + "emitDeclarationOnly": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "skipLibCheck": true, + "jsx": "react-jsx", + "useDefineForClassFields": true + }, + "exclude": ["node_modules", "dist"], + "include": ["src"] +} diff --git a/src/packages/react/vite.config.ts b/src/packages/react/vite.config.ts new file mode 100644 index 0000000..d43457e --- /dev/null +++ b/src/packages/react/vite.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react-swc"; + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react()], + build: { + lib: { + entry: "src/index.ts", + name: "Locusts", + fileName: "locusts", + }, + rollupOptions: { + external: ["react"], + output: { + globals: { + react: "React", + }, + }, + }, + }, +}); 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..3200018 --- /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.0", + "@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.6", + "publint": "^0.2.0", + "svelte": "^5.1.13", + "svelte-check": "^4.0.6", + "typescript": "^5.6.3", + "typescript-eslint": "^8.13.0", + "vite": "^5.4.10", + "vitest": "^2.0.4" + }, + "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}'] + } +}); diff --git a/src/packages/typescript-config/base.json b/src/packages/typescript-config/base.json new file mode 100644 index 0000000..7a30961 --- /dev/null +++ b/src/packages/typescript-config/base.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Default", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "incremental": false, + "isolatedModules": true, + "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/typescript-config/package.json b/src/packages/typescript-config/package.json new file mode 100644 index 0000000..d658269 --- /dev/null +++ b/src/packages/typescript-config/package.json @@ -0,0 +1,9 @@ +{ + "name": "@repo/typescript-config", + "version": "0.0.0", + "license": "MIT", + "private": true, + "publishConfig": { + "access": "public" + } +} 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..4d41eb3 --- /dev/null +++ b/src/packages/vue/README.md @@ -0,0 +1,28 @@ +# @locusts/vue + +[![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%2Fvue?logo=vuedotjs)](https://www.npmjs.com/package/@locusts/vue) + +## Description + +@locusts/vue 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 + +```bash +npm install -D @locusts/vue +``` + +## Usage + +```vue +<script setup> +import { Locusts } from "@locusts/vue"; +</script> + +<template> + <Locusts /> +</template> +``` diff --git a/src/packages/vue/eslint.config.mjs b/src/packages/vue/eslint.config.mjs new file mode 100644 index 0000000..eb0d6d0 --- /dev/null +++ b/src/packages/vue/eslint.config.mjs @@ -0,0 +1,11 @@ +import library from "@repo/eslint-config/eslint.library.config.js"; +import vue from "eslint-plugin-vue"; + +/** @type {import("eslint").Linter.Config[]} */ +export default [ + ...library, + ...vue.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..4932a01 --- /dev/null +++ b/src/packages/vue/package.json @@ -0,0 +1,58 @@ +{ + "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 . && eslint --fix .", + "lint": "prettier --check . && eslint .", + "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" + }, + "publishConfig": { + "access": "public" + } +} 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..23ddef4 --- /dev/null +++ b/src/packages/vue/tsconfig.json @@ -0,0 +1,14 @@ +{ + "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"], + "include": ["src"] +} 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", + }, + }, + }, + }, +}); diff --git a/src/test/kotlin/io/github/LocustsTest.kt b/src/test/kotlin/io/github/LocustsTest.kt new file mode 100644 index 0000000..39999e5 --- /dev/null +++ b/src/test/kotlin/io/github/LocustsTest.kt @@ -0,0 +1,14 @@ +/* + * This source file was generated by the Gradle 'init' task + */ +package io.github.locustsRUs.locusts + +import kotlin.test.Test +import kotlin.test.assertEquals + +class LibraryTest { + @Test + fun locustsShouldGetIntroduced() { + assertEquals(Locusts.introduceLocusts(), Unit, "Locusts should be introduced") + } +} diff --git a/src/test_locusts.py b/src/test_locusts.py new file mode 100644 index 0000000..8026315 --- /dev/null +++ b/src/test_locusts.py @@ -0,0 +1,10 @@ +""""Run tests for locusts.py.""" +import unittest +from locusts import introduce_locusts + +class TestLocusts(unittest.TestCase): + def test_introduce_locusts(self): + self.assertIsNone(introduce_locusts()) + +if __name__ == '__main__': + unittest.main() |