Compare commits
3 Commits
f200942a52
...
a193bf5cad
| Author | SHA1 | Date | |
|---|---|---|---|
| a193bf5cad | |||
| 8d09e3017f | |||
| 32da4e220f |
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"name": "@because/sandlot",
|
"name": "@because/sandlot",
|
||||||
"version": "0.0.10",
|
"version": "0.0.11",
|
||||||
"description": "Sandboxed, branch-based development with Claude",
|
"description": "Sandboxed, branch-based development with Claude",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sandlot": "./src/cli.ts"
|
"sandlot": "src/cli.ts"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src",
|
"src",
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,25 @@ import { requireApiKey } from "../env.ts"
|
||||||
import { renderMarkdown } from "../markdown.ts"
|
import { renderMarkdown } from "../markdown.ts"
|
||||||
import { saveChanges } from "./helpers.ts"
|
import { saveChanges } from "./helpers.ts"
|
||||||
|
|
||||||
|
const ADJECTIVES = [
|
||||||
|
"calm", "bold", "warm", "cool", "keen", "soft", "fast", "wild", "fair", "rare",
|
||||||
|
"deep", "dark", "pale", "wide", "slim", "tall", "glad", "pure", "safe", "free",
|
||||||
|
"hazy", "lazy", "cozy", "tiny", "vast", "busy", "easy", "gray", "gold", "blue",
|
||||||
|
"rosy", "wavy", "mild", "loud", "firm", "flat", "crisp", "dry", "raw", "odd",
|
||||||
|
]
|
||||||
|
const NOUNS = [
|
||||||
|
"fern", "dune", "cove", "pine", "reef", "hawk", "pond", "mesa", "vale", "glen",
|
||||||
|
"haze", "moss", "peak", "tide", "dawn", "lynx", "wren", "sage", "crag", "flint",
|
||||||
|
"leaf", "reed", "cave", "star", "gust", "surf", "opal", "lark", "vale", "plum",
|
||||||
|
"birch", "clay", "jade", "ivy", "fox", "elk", "bay", "ash", "dew", "oak",
|
||||||
|
]
|
||||||
|
|
||||||
|
function randomBranchName(): string {
|
||||||
|
const adj = ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)]
|
||||||
|
const noun = NOUNS[Math.floor(Math.random() * NOUNS.length)]
|
||||||
|
return `${adj}-${noun}`
|
||||||
|
}
|
||||||
|
|
||||||
function fallbackBranchName(text: string): string {
|
function fallbackBranchName(text: string): string {
|
||||||
return text
|
return text
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
|
|
@ -63,7 +82,7 @@ export async function action(
|
||||||
if (!branch && opts.print) {
|
if (!branch && opts.print) {
|
||||||
branch = await branchFromPrompt(opts.print)
|
branch = await branchFromPrompt(opts.print)
|
||||||
} else if (!branch) {
|
} else if (!branch) {
|
||||||
die("Branch name or prompt is required.")
|
branch = randomBranchName()
|
||||||
} else if (branch.includes(" ")) {
|
} else if (branch.includes(" ")) {
|
||||||
// If the "branch" contains spaces, it's actually a prompt — derive the branch name
|
// If the "branch" contains spaces, it's actually a prompt — derive the branch name
|
||||||
prompt = branch
|
prompt = branch
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user