Compare commits

..

No commits in common. "bd354fb57d75cc9fe95128fd7d77e065ea4040a4" and "56524450dc5a944380cbb9aba037a8d7a551a0e3" have entirely different histories.

6 changed files with 12 additions and 82 deletions

View file

@ -2,12 +2,11 @@
> Tooling and unified configuration for managing a bunch of repositories and packages. > Tooling and unified configuration for managing a bunch of repositories and packages.
## Stack & Standards ## TODO
- Bun - `check` action
- TypeScript - `check` bun script
- Oxlint & Oxfmt - `test` bun script
- Commitlint - `release` action
- Conventional Commit - build with bun?
- Semantic Release - run semantic release
- Forgejo Actions

View file

@ -1,5 +1,5 @@
name: Semantic Release name: Semantic Release
description: Run semantic-release (multi for monorepos, standard for solo packages) description: Run multi-semantic-release for per-package versioning
inputs: inputs:
gitea-token: gitea-token:
@ -39,9 +39,4 @@ runs:
GITEA_TOKEN: ${{ inputs.gitea-token }} GITEA_TOKEN: ${{ inputs.gitea-token }}
GITEA_URL: ${{ inputs.gitea-url }} GITEA_URL: ${{ inputs.gitea-url }}
NPM_TOKEN: ${{ inputs.npm-token }} NPM_TOKEN: ${{ inputs.npm-token }}
run: | run: bunx multi-semantic-release
if node -e "const p=require('./package.json'); process.exit(p.workspaces ? 0 : 1)"; then
bunx multi-semantic-release
else
bunx semantic-release
fi

View file

@ -3,7 +3,6 @@ import { resolve } from "path"
import { check } from "../src/check" import { check } from "../src/check"
import { sync } from "../src/sync" import { sync } from "../src/sync"
import { promote } from "../src/promote" import { promote } from "../src/promote"
import { templates } from "../src/templates"
const [command, ...rawArgs] = process.argv.slice(2) const [command, ...rawArgs] = process.argv.slice(2)
const hasYes = rawArgs.includes("--yes") const hasYes = rawArgs.includes("--yes")
@ -20,10 +19,7 @@ switch (command) {
case "promote": case "promote":
await promote(targetDir, hasYes) await promote(targetDir, hasYes)
break break
case "templates":
templates(rawArgs.includes("--full"))
break
default: default:
console.error("Usage: regime <check|sync|promote|templates> [path] [--yes] [--full]") console.error("Usage: regime <check|sync|promote> [path] [--yes]")
process.exit(1) process.exit(1)
} }

View file

@ -14,6 +14,7 @@ import {
} from "./shared" } from "./shared"
const green = Bun.color("green", "ansi") const green = Bun.color("green", "ansi")
const yellow = Bun.color("orange", "ansi")
const red = Bun.color("red", "ansi") const red = Bun.color("red", "ansi")
const purple = Bun.color("purple", "ansi") const purple = Bun.color("purple", "ansi")
const reset = "\x1b[0m" const reset = "\x1b[0m"

View file

@ -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<string>()): 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()
}
}

View file

@ -2,7 +2,7 @@ import { defineConfig } from "oxlint"
export default defineConfig({ export default defineConfig({
plugins: ["typescript", "unicorn", "oxc"], plugins: ["typescript", "unicorn", "oxc"],
ignorePatterns: ["**/*.gen.ts", "node_modules/**/*"], ignorePatterns: ["**/*.gen.ts"],
categories: { categories: {
correctness: "error", correctness: "error",
suspicious: "warn", suspicious: "warn",