From 5e570201bdc24e8d45ff03ec9a8c7140980ecfc1 Mon Sep 17 00:00:00 2001 From: Alix von Schirp Date: Wed, 22 Oct 2025 05:26:09 +0200 Subject: [PATCH] wip: template Signed-off-by: Alix von Schirp --- templates/package/README.md | 0 templates/package/eslint.config.mjs | 7 +++ templates/package/jest.config.js | 3 + templates/package/package.json | 87 +++++++++++++++++++++++++++++ templates/package/src/index.ts | 0 templates/package/tsconfig.json | 12 ++++ turbo/generators/config.ts | 46 +++++++++++++++ 7 files changed, 155 insertions(+) create mode 100644 templates/package/README.md create mode 100644 templates/package/eslint.config.mjs create mode 100644 templates/package/jest.config.js create mode 100644 templates/package/package.json create mode 100644 templates/package/src/index.ts create mode 100644 templates/package/tsconfig.json create mode 100644 turbo/generators/config.ts diff --git a/templates/package/README.md b/templates/package/README.md new file mode 100644 index 0000000..e69de29 diff --git a/templates/package/eslint.config.mjs b/templates/package/eslint.config.mjs new file mode 100644 index 0000000..d9f3a76 --- /dev/null +++ b/templates/package/eslint.config.mjs @@ -0,0 +1,7 @@ +import repoConfig from "@repo/configs/eslint"; + +export default [ + ...repoConfig, + { ignores: ["dist/**", "docs/**"] }, + { files: ["**/*.{ts}"] }, +]; \ No newline at end of file diff --git a/templates/package/jest.config.js b/templates/package/jest.config.js new file mode 100644 index 0000000..6b910f2 --- /dev/null +++ b/templates/package/jest.config.js @@ -0,0 +1,3 @@ +import repoCofig from "@repo/configs/jest"; + +export default [...repoCofig]; diff --git a/templates/package/package.json b/templates/package/package.json new file mode 100644 index 0000000..a5644d7 --- /dev/null +++ b/templates/package/package.json @@ -0,0 +1,87 @@ +{ + "name": "{{name}}", + "description": "{{description}}", + "homepage": "https://cis-oss.github.io/notify", + "version": "0.0.10", + "main": "src/index.ts", + "author": { + "email": "hi@b00tload.space", + "name": "Alix von Schirp", + "url": "https://b00tload.space" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/cis-oss/pushover.git" + }, + "bugs": { + "url": "https://github.com/cis-oss/pushover/issues" + }, + "keywords": [ + "notification", + "notify" + ], + "dependencies": { + "zod": "^3.24.2" + }, + "devDependencies": { + "@eslint/js": "^9.22.0", + "@repo/configs": "workspace:", + "@shipgirl/typedoc-plugin-versions": "^0.3.0", + "@types/jest": "^29.5.14", + "@types/node": "^22.13.10", + "eslint": "^9.22.0", + "eslint-config-prettier": "^10.1.1", + "eslint-plugin-only-warn": "^1.1.0", + "globals": "^16.0.0", + "jest": "^29.7.0", + "shx": "^0.4.0", + "ts-jest": "^29.2.6", + "tsx": "^4.19.3", + "typedoc": "^0.27.9", + "typedoc-github-theme": "^0.2.1", + "typedoc-plugin-coverage": "^3.4.1", + "typedoc-plugin-extras": "^4.0.0", + "typedoc-plugin-include-example": "^2.0.2", + "typedoc-plugin-inline-sources": "^1.2.1", + "typedoc-plugin-mdn-links": "^5.0.1", + "typedoc-plugin-zod": "^1.4.0", + "typescript": "^5.5.3", + "typescript-eslint": "^8.26.0" + }, + "files": [ + "dist/**/*.{js,ts,map}" + ], + "scripts": { + "build": "tsc", + "build:watch": "tsc --watch", + "check": "pnpm run lint:ci && pnpm run typecheck", + "clean": "shx rm -rf dist/", + "docs:generate": "typedoc", + "format:check": "prettier --check .", + "lint": "eslint .", + "lint:ci": "eslint --max-warnings 0", + "prepublishOnly": "pnpm run clean && pnpm run build", + "test": "jest", + "typecheck": "tsc --noEmit" + }, + "private": true, + "license": "MIT", + "maintainers": [ + { + "name": "Alix von Schirp", + "email": "hi@b00tload.space", + "url": "https://b00tload.space" + }, + { + "name": "Ole", + "email": "jateute123@gmail.com", + "url": "https://github.com/jateute" + } + ], + "packageManager": "pnpm@10.6.5", + "publishConfig": { + "main": "dist/index.js", + "types": "dist/index.d.ts" + }, + "type": "module" +} diff --git a/templates/package/src/index.ts b/templates/package/src/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/templates/package/tsconfig.json b/templates/package/tsconfig.json new file mode 100644 index 0000000..3d1f584 --- /dev/null +++ b/templates/package/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@repo/configs/tsconfig.json", + "compilerOptions": { + /* Path Aliases */ + "baseUrl": "./src", + "paths": { + "~/*": ["./src/*"] + } + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules/**/*", "docs/**/*", "dist/**/*"] +} diff --git a/turbo/generators/config.ts b/turbo/generators/config.ts new file mode 100644 index 0000000..588b347 --- /dev/null +++ b/turbo/generators/config.ts @@ -0,0 +1,46 @@ +import type { PlopTypes } from "@turbo/gen"; + +export default function generator(plop: PlopTypes.NodePlopAPI): void { + // create a generator + plop.setGenerator("package", { + description: "Generator description", + // gather information from the user + prompts: [ + { + type: "input", + name: "name", + message: "Package name", + }, + { + type: "input", + name: "description", + message: "Package description", + }, + { + type: "input", + name: "author.name", + message: "Author name", + }, + { + type: "input", + name: "author.email", + message: "Author email", + }, + { + type: "input", + name: "author.url", + message: "Author URL", + }, + ], + // perform actions based on the prompts + actions: [ + { + type: "addMany", + destination: "packages/{{name}}", + base: "templates/package", + templateFiles: "templates/package/**/*", + abortOnFail: true, + }, + ], + }); +}