aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2024-09-20 08:54:29 -0500
committerMatt Strapp <matt@mattstrapp.net>2024-09-20 08:56:11 -0500
commit9c2a87616026e36542ee6cb18584cc747ef3099d (patch)
tree99c998be4726edbac50f9c6845a77438d14186ac /src
parentBump tsup from 8.2.4 to 8.3.0 in the nodejs-dependencies group (diff)
downloadlocusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar.gz
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar.bz2
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar.lz
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar.xz
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.tar.zst
locusts-9c2a87616026e36542ee6cb18584cc747ef3099d.zip
Move node packages to src/
At least pretend to make it clean Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'src')
-rw-r--r--src/packages/eslint-config/README.md3
-rw-r--r--src/packages/eslint-config/library.js34
-rw-r--r--src/packages/eslint-config/package.json17
-rw-r--r--src/packages/locusts/.eslintrc.js9
-rw-r--r--src/packages/locusts/package.json32
-rw-r--r--src/packages/locusts/src/index.ts15
-rw-r--r--src/packages/locusts/tests/locusts.test.ts9
-rw-r--r--src/packages/locusts/tsconfig.json13
-rw-r--r--src/packages/typescript-config/base.json20
-rw-r--r--src/packages/typescript-config/package.json9
10 files changed, 161 insertions, 0 deletions
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/library.js b/src/packages/eslint-config/library.js
new file mode 100644
index 0000000..9b59cc0
--- /dev/null
+++ b/src/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/src/packages/eslint-config/package.json b/src/packages/eslint-config/package.json
new file mode 100644
index 0000000..395c345
--- /dev/null
+++ b/src/packages/eslint-config/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "@repo/eslint-config",
+ "version": "0.0.0",
+ "devDependencies": {
+ "@typescript-eslint/eslint-plugin": "8.6.0",
+ "@typescript-eslint/parser": "8.6.0",
+ "@vercel/style-guide": "6.0.0",
+ "eslint-config-prettier": "^9.1.0",
+ "eslint-config-turbo": "^2.1.2",
+ "eslint-plugin-only-warn": "^1.1.0",
+ "typescript": "^5.6.2"
+ },
+ "files": [
+ "library.js"
+ ],
+ "private": true
+}
diff --git a/src/packages/locusts/.eslintrc.js b/src/packages/locusts/.eslintrc.js
new file mode 100644
index 0000000..1de713c
--- /dev/null
+++ b/src/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/src/packages/locusts/package.json b/src/packages/locusts/package.json
new file mode 100644
index 0000000..5a3a75d
--- /dev/null
+++ b/src/packages/locusts/package.json
@@ -0,0 +1,32 @@
+{
+ "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.5.5",
+ "tsup": "^8.3.0",
+ "tsx": "^4.19.1",
+ "typescript": "^5.6.2"
+ },
+ "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"
+}
diff --git a/src/packages/locusts/src/index.ts b/src/packages/locusts/src/index.ts
new file mode 100644
index 0000000..d78bab8
--- /dev/null
+++ b/src/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 introduceLocusts from 'locusts';
+ * introduceLocusts();
+ * ```
+ * @returns void
+ */
+export default function introduceLocusts() {
+ // This space intentionally left blank
+} \ No newline at end of file
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..0a5c316
--- /dev/null
+++ b/src/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/src/packages/typescript-config/base.json b/src/packages/typescript-config/base.json
new file mode 100644
index 0000000..0f80cfd
--- /dev/null
+++ b/src/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/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"
+ }
+}