From 39e222fa551e5ea96271d2cd8d9eef8ccd214afd Mon Sep 17 00:00:00 2001 From: Alix von Schirp Date: Sun, 21 Dec 2025 23:30:31 +0100 Subject: [PATCH] wip: template Template will likely not be worked on for now Signed-off-by: Alix von Schirp --- package.json | 11 ++-- pnpm-lock.yaml | 104 ++++++++++--------------------------- turbo/generators/config.ts | 41 +++++++++++++-- 3 files changed, 71 insertions(+), 85 deletions(-) diff --git a/package.json b/package.json index ddf70cc..56ebaa2 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,7 @@ { "name": "@repo/root", "description": "", - "files": [], - "private": true, - "license": "MIT", + "version": "0.0.0", "author": { "email": "hi@b00tload.space", "name": "Alix von Schirp", @@ -17,11 +15,15 @@ "husky": "^9.1.7", "lint-staged": "^15.4.3", "prettier": "3.5.3", + "simple-git": "^3.30.0", "turbo": "^2.5.6" }, + "files": [], "scripts": { "prepare": "husky" }, + "private": true, + "license": "MIT", "husky": { "shell": "bash" }, @@ -29,6 +31,5 @@ "package.json": "finepack", "*.{js,ts,jsx,tsx}": "eslint --fix .", "*.{js,ts,jsx,tsx,json,css,md}": "prettier --write" - }, - "version": "0.0.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0562d6..eb6a9d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: prettier: specifier: 3.5.3 version: 3.5.3 + simple-git: + specifier: ^3.30.0 + version: 3.30.0 turbo: specifier: ^2.5.6 version: 2.5.6 @@ -107,76 +110,6 @@ importers: '@cis-oss/pushover': specifier: 'workspace:' version: link:../../packages/pushover - devDependencies: - '@eslint/js': - specifier: ^9.22.0 - version: 9.22.0 - '@repo/configs': - specifier: 'workspace:' - version: link:../../config - '@shipgirl/typedoc-plugin-versions': - specifier: ^0.3.0 - version: 0.3.0(typedoc@0.27.9(typescript@5.8.2)) - '@types/jest': - specifier: ^29.5.14 - version: 29.5.14 - '@types/node': - specifier: ^22.13.10 - version: 22.13.10 - eslint: - specifier: ^9.22.0 - version: 9.22.0 - eslint-config-prettier: - specifier: ^10.1.1 - version: 10.1.1(eslint@9.22.0) - eslint-plugin-only-warn: - specifier: ^1.1.0 - version: 1.1.0 - globals: - specifier: ^16.0.0 - version: 16.0.0 - jest: - specifier: ^29.7.0 - version: 29.7.0(@types/node@22.13.10)(ts-node@10.9.2(@types/node@22.13.10)(typescript@5.8.2)) - shx: - specifier: ^0.4.0 - version: 0.4.0 - ts-jest: - specifier: ^29.2.6 - version: 29.3.2(@babel/core@7.26.10)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.26.10))(jest@29.7.0(@types/node@22.13.10)(ts-node@10.9.2(@types/node@22.13.10)(typescript@5.8.2)))(typescript@5.8.2) - tsx: - specifier: ^4.19.3 - version: 4.19.3 - typedoc: - specifier: ^0.27.9 - version: 0.27.9(typescript@5.8.2) - typedoc-github-theme: - specifier: ^0.2.1 - version: 0.2.1(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-coverage: - specifier: ^3.4.1 - version: 3.4.1(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-extras: - specifier: ^4.0.0 - version: 4.0.0(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-include-example: - specifier: ^2.0.2 - version: 2.0.2(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-inline-sources: - specifier: ^1.2.1 - version: 1.2.1(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-mdn-links: - specifier: ^5.0.1 - version: 5.0.1(typedoc@0.27.9(typescript@5.8.2)) - typedoc-plugin-zod: - specifier: ^1.4.0 - version: 1.4.0(typedoc@0.27.9(typescript@5.8.2)) - typescript: - specifier: ^5.5.3 - version: 5.8.2 - typescript-eslint: - specifier: ^8.26.0 - version: 8.26.0(eslint@9.22.0)(typescript@5.8.2) packages/pushover: dependencies: @@ -690,6 +623,12 @@ packages: '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + '@kwsites/file-exists@1.1.1': + resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} + + '@kwsites/promise-deferred@1.1.1': + resolution: {integrity: sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1568,10 +1507,6 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - globals@16.0.0: - resolution: {integrity: sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==} - engines: {node: '>=18'} - globals@16.4.0: resolution: {integrity: sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==} engines: {node: '>=18'} @@ -2621,6 +2556,9 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-git@3.30.0: + resolution: {integrity: sha512-q6lxyDsCmEal/MEGhP1aVyQ3oxnagGlBDOVSIB4XUVLl1iZh0Pah6ebC9V4xBap/RfgP2WlI8EKs0WS0rMEJHg==} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -3647,6 +3585,14 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@kwsites/file-exists@1.1.1': + dependencies: + debug: 4.4.0 + transitivePeerDependencies: + - supports-color + + '@kwsites/promise-deferred@1.1.1': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -4674,8 +4620,6 @@ snapshots: globals@14.0.0: {} - globals@16.0.0: {} - globals@16.4.0: {} globby@10.0.2: @@ -5910,6 +5854,14 @@ snapshots: signal-exit@4.1.0: {} + simple-git@3.30.0: + dependencies: + '@kwsites/file-exists': 1.1.1 + '@kwsites/promise-deferred': 1.1.1 + debug: 4.4.0 + transitivePeerDependencies: + - supports-color + sisteransi@1.0.5: {} slash@3.0.0: {} diff --git a/turbo/generators/config.ts b/turbo/generators/config.ts index 588b347..940ba91 100644 --- a/turbo/generators/config.ts +++ b/turbo/generators/config.ts @@ -1,9 +1,39 @@ +// THIS IS FOR NOW UNLIKELY TO BE CONTINUED TO BE WORKED ON + import type { PlopTypes } from "@turbo/gen"; +import * as fs from "node:fs"; +import { simpleGit } from "simple-git"; export default function generator(plop: PlopTypes.NodePlopAPI): void { + const git = simpleGit(); + const metaPackages = fs.readdirSync("meta").map((value) => { + const packageJson = JSON.parse( + fs.readFileSync(`meta/${value}/package.json`, "utf-8"), + ); + return { + name: packageJson.name, + value: value, + }; + }); + // get git author info + const gitAuthor = { + name: git + .getConfig("user.name") + .then((res) => res.value) + .catch(() => ""), + email: git + .getConfig("user.email") + .then((res) => res.value) + .catch(() => ""), + }; + // const gitAuthor = { + // name: (await git.getConfig("user.name")).value, + // email: (await git.getConfig("user.email")).value, + // }; + // create a generator plop.setGenerator("package", { - description: "Generator description", + description: "Create a new notify package", // gather information from the user prompts: [ { @@ -19,17 +49,20 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void { { type: "input", name: "author.name", + default: gitAuthor.name, message: "Author name", }, { type: "input", name: "author.email", + default: gitAuthor.email, message: "Author email", }, { - type: "input", - name: "author.url", - message: "Author URL", + type: "checkbox", + name: "import.meta", + message: "In which meta packages should this package be included?", + choices: metaPackages, }, ], // perform actions based on the prompts