Compare commits
No commits in common. "bd354fb57d75cc9fe95128fd7d77e065ea4040a4" and "56524450dc5a944380cbb9aba037a8d7a551a0e3" have entirely different histories.
bd354fb57d
...
56524450dc
6 changed files with 12 additions and 82 deletions
15
README.md
15
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <check|sync|promote|templates> [path] [--yes] [--full]")
|
||||
console.error("Usage: regime <check|sync|promote> [path] [--yes]")
|
||||
process.exit(1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue