diff --git a/README.md b/README.md index abf56d7..41754b8 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,11 @@ > Tooling and unified configuration for managing a bunch of repositories and packages. -## Stack & Standards +## TODO -- Bun -- TypeScript -- Oxlint & Oxfmt -- Commitlint -- Conventional Commit -- Semantic Release -- Forgejo Actions +- `check` action + - `check` bun script + - `test` bun script +- `release` action + - build with bun? + - run semantic release diff --git a/actions/release/action.yml b/actions/release/action.yml index 5bd065a..63e1403 100644 --- a/actions/release/action.yml +++ b/actions/release/action.yml @@ -1,5 +1,5 @@ name: Semantic Release -description: Run semantic-release (multi for monorepos, standard for solo packages) +description: Run multi-semantic-release for per-package versioning inputs: gitea-token: @@ -39,9 +39,4 @@ runs: GITEA_TOKEN: ${{ inputs.gitea-token }} GITEA_URL: ${{ inputs.gitea-url }} NPM_TOKEN: ${{ inputs.npm-token }} - run: | - if node -e "const p=require('./package.json'); process.exit(p.workspaces ? 0 : 1)"; then - bunx multi-semantic-release - else - bunx semantic-release - fi + run: bunx multi-semantic-release diff --git a/bin/regime b/bin/regime index 7732db1..794f23c 100755 --- a/bin/regime +++ b/bin/regime @@ -3,7 +3,6 @@ import { resolve } from "path" import { check } from "../src/check" import { sync } from "../src/sync" import { promote } from "../src/promote" -import { templates } from "../src/templates" const [command, ...rawArgs] = process.argv.slice(2) const hasYes = rawArgs.includes("--yes") @@ -20,10 +19,7 @@ switch (command) { case "promote": await promote(targetDir, hasYes) break - case "templates": - templates(rawArgs.includes("--full")) - break default: - console.error("Usage: regime [path] [--yes] [--full]") + console.error("Usage: regime [path] [--yes]") process.exit(1) } diff --git a/src/sync.ts b/src/sync.ts index 5c0a87f..5c9c444 100644 --- a/src/sync.ts +++ b/src/sync.ts @@ -14,6 +14,7 @@ import { } from "./shared" const green = Bun.color("green", "ansi") +const yellow = Bun.color("orange", "ansi") const red = Bun.color("red", "ansi") const purple = Bun.color("purple", "ansi") const reset = "\x1b[0m" diff --git a/src/templates.ts b/src/templates.ts deleted file mode 100644 index dbbe7c4..0000000 --- a/src/templates.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { readdirSync } from "node:fs" -import { join } from "node:path" -import { templatesDir, resolveTemplateConfig, readdirSyncRecursive } from "./shared" - -const purple = Bun.color("green", "ansi") -const reset = "\x1b[0m" - -interface TreeNode { - name: string - children: TreeNode[] - files: string[] -} - -function buildTree(name: string, visited = new Set()): TreeNode { - if (visited.has(name)) return { name, children: [], files: [] } - visited.add(name) - - const config = resolveTemplateConfig(name) - const children = (config.inherits ?? []).map(p => buildTree(p, visited)) - - const dir = join(templatesDir, name) - const files = readdirSyncRecursive(dir).filter(f => f !== ".regime-template.json") - - return { name, children, files } -} - -function printTree(node: TreeNode, full: boolean, prefix = "", isLast = true, isRoot = true) { - const connector = isRoot ? "" : isLast ? "└── " : "├── " - const line = isRoot ? node.name : `${prefix}${connector}${node.name}` - console.log(line) - - const childPrefix = isRoot ? "" : prefix + (isLast ? " " : "│ ") - - if (full && node.files.length > 0) { - const hasChildren = node.children.length > 0 - for (let i = 0; i < node.files.length; i++) { - const fileConnector = hasChildren || i < node.files.length - 1 ? "│ " : " " - const bullet = "·" - console.log(`${childPrefix}${fileConnector}${purple}${bullet} ${node.files[i]}${reset}`) - } - } - - for (let i = 0; i < node.children.length; i++) { - const child = node.children[i] - const last = i === node.children.length - 1 - printTree(child, full, childPrefix, last, false) - } -} - -export function templates(full: boolean) { - const entries = readdirSync(templatesDir, { withFileTypes: true }) - .filter(e => e.isDirectory()) - .map(e => e.name) - .sort() - - for (let i = 0; i < entries.length; i++) { - const tree = buildTree(entries[i]) - printTree(tree, full) - if (i < entries.length - 1) console.log() - } -} diff --git a/templates/tools-oxc/oxlint.config.ts b/templates/tools-oxc/oxlint.config.ts index 5e0cab7..d00053a 100644 --- a/templates/tools-oxc/oxlint.config.ts +++ b/templates/tools-oxc/oxlint.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "oxlint" export default defineConfig({ plugins: ["typescript", "unicorn", "oxc"], - ignorePatterns: ["**/*.gen.ts", "node_modules/**/*"], + ignorePatterns: ["**/*.gen.ts"], categories: { correctness: "error", suspicious: "warn",