diff options
author | Matt Strapp <matt@mattstrapp.net> | 2024-08-09 09:05:18 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2024-08-09 09:05:18 -0500 |
commit | f7e13f5917e176fd44a80479ab06eb61e34dd138 (patch) | |
tree | dc5ebed287c123b4e572371074ffcd59a8a76334 /packages | |
parent | ci: Rename things better (diff) | |
download | locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar.gz locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar.bz2 locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar.lz locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar.xz locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.tar.zst locusts-f7e13f5917e176fd44a80479ab06eb61e34dd138.zip |
feat: Add Node.js
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/eslint-config/README.md | 3 | ||||
-rw-r--r-- | packages/eslint-config/library.js | 34 | ||||
-rw-r--r-- | packages/eslint-config/package.json | 17 | ||||
-rw-r--r-- | packages/locusts/.eslintrc.js | 9 | ||||
-rw-r--r-- | packages/locusts/package.json | 33 | ||||
-rw-r--r-- | packages/locusts/src/index.ts | 15 | ||||
-rw-r--r-- | packages/locusts/tests/locusts.test.ts | 7 | ||||
-rw-r--r-- | packages/locusts/tsconfig.json | 13 | ||||
-rw-r--r-- | packages/typescript-config/base.json | 20 | ||||
-rw-r--r-- | packages/typescript-config/package.json | 9 |
10 files changed, 160 insertions, 0 deletions
diff --git a/packages/eslint-config/README.md b/packages/eslint-config/README.md new file mode 100644 index 0000000..8b42d90 --- /dev/null +++ b/packages/eslint-config/README.md @@ -0,0 +1,3 @@ +# `@turbo/eslint-config` + +Collection of internal eslint configurations. diff --git a/packages/eslint-config/library.js b/packages/eslint-config/library.js new file mode 100644 index 0000000..9b59cc0 --- /dev/null +++ b/packages/eslint-config/library.js @@ -0,0 +1,34 @@ +const { resolve } = require("node:path"); + +const project = resolve(process.cwd(), "tsconfig.json"); + +/** @type {import("eslint").Linter.Config} */ +module.exports = { + extends: ["eslint:recommended", "prettier", "turbo"], + plugins: ["only-warn"], + globals: { + React: true, + JSX: true, + }, + env: { + node: true, + }, + settings: { + "import/resolver": { + typescript: { + project, + }, + }, + }, + ignorePatterns: [ + // Ignore dotfiles + ".*.js", + "node_modules/", + "dist/", + ], + overrides: [ + { + files: ["*.js?(x)", "*.ts?(x)"], + }, + ], +}; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json new file mode 100644 index 0000000..d6a436a --- /dev/null +++ b/packages/eslint-config/package.json @@ -0,0 +1,17 @@ +{ + "name": "@repo/eslint-config", + "version": "0.0.0", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "8.0.1", + "@typescript-eslint/parser": "8.0.1", + "@vercel/style-guide": "6.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-turbo": "^2.0.0", + "eslint-plugin-only-warn": "^1.1.0", + "typescript": "^5.4.5" + }, + "files": [ + "library.js" + ], + "private": true +} diff --git a/packages/locusts/.eslintrc.js b/packages/locusts/.eslintrc.js new file mode 100644 index 0000000..1de713c --- /dev/null +++ b/packages/locusts/.eslintrc.js @@ -0,0 +1,9 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ["@repo/eslint-config/library.js"], + parser: "@typescript-eslint/parser", + parserOptions: { + project: true, + }, +};
\ No newline at end of file diff --git a/packages/locusts/package.json b/packages/locusts/package.json new file mode 100644 index 0000000..65a669c --- /dev/null +++ b/packages/locusts/package.json @@ -0,0 +1,33 @@ +{ + "name": "locusts", + "description": "An npm package that introduces locusts into your codebase.", + "version": "1.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.1.0", + "tsup": "^8.2.4", + "tsx": "^4.16.5", + "typescript": "^5.4.5" + }, + "keywords": [], + "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", + "dev": "tsup src/index.ts --format cjs,esm --dts --watch", + "lint": "eslint src --fix", + "lint:ci": "eslint src", + "test": "node --test --import tsx ./tests/locusts.test.ts" + }, + "types": "./dist/index.d.ts" +}
\ No newline at end of file diff --git a/packages/locusts/src/index.ts b/packages/locusts/src/index.ts new file mode 100644 index 0000000..de25d64 --- /dev/null +++ b/packages/locusts/src/index.ts @@ -0,0 +1,15 @@ +/** + * Introduce locusts into your codebase. + * @remarks + * Locusts are not included in this package. You must provide your own locusts. + * @public + * @example + * ```js + * import introduce_locusts from 'locusts'; + * introduce_locusts(); + * ``` + * @returns void + */ +export default function introduceLocusts() { + // This space intentionally left blank +}
\ No newline at end of file diff --git a/packages/locusts/tests/locusts.test.ts b/packages/locusts/tests/locusts.test.ts new file mode 100644 index 0000000..f5a126d --- /dev/null +++ b/packages/locusts/tests/locusts.test.ts @@ -0,0 +1,7 @@ +import { describe, it } from "node:test"; + +describe("Locusts", () => { + it("should be able to be introduced to the environment", () => { + // Test code here + }); +}); diff --git a/packages/locusts/tsconfig.json b/packages/locusts/tsconfig.json new file mode 100644 index 0000000..0a5c316 --- /dev/null +++ b/packages/locusts/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "dist" + ] +}
\ No newline at end of file diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json new file mode 100644 index 0000000..0f80cfd --- /dev/null +++ b/packages/typescript-config/base.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Default", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "incremental": false, + "isolatedModules": true, + "lib": ["es2022", "DOM", "DOM.Iterable"], + "module": "NodeNext", + "moduleDetection": "force", + "moduleResolution": "NodeNext", + "noUncheckedIndexedAccess": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "target": "ES2022" + } +} diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json new file mode 100644 index 0000000..d658269 --- /dev/null +++ b/packages/typescript-config/package.json @@ -0,0 +1,9 @@ +{ + "name": "@repo/typescript-config", + "version": "0.0.0", + "license": "MIT", + "private": true, + "publishConfig": { + "access": "public" + } +} |