anbeime/skill / skills/hairline/hairline
hairline
Flagged一句话生成跟随鼠标的交互式等轴测线框图(单文件、零依赖、双击即开),或把已有 SVG/Logo 重建为可交互线框。
scripts/base-url.mjs
View on GitHub/**
* Where this build thinks it lives.
*
* Two things need an absolute URL in their output and may not have one in
* their source: the shadcn registry item, which `shadcn add` fetches by URL,
* and the Open Graph tags, which crawlers do not resolve relatively. Both ask
* here, so localhost, a preview and production differ only by environment.
*
* The ladder goes from the most specific answer to the least. An explicit
* override wins; production names itself; anything else on Vercel is a preview
* and names itself too, which is what makes a preview testable: its registry
* item installs from that preview.
*/
export const FALLBACK = "http://localhost:3000";
export function resolveBase() {
const explicit = process.env.HAIRLINE_REGISTRY_URL?.trim();
if (explicit) return { url: explicit, source: "HAIRLINE_REGISTRY_URL" };
const productionHost = process.env.VERCEL_PROJECT_PRODUCTION_URL?.trim();
if (process.env.VERCEL_ENV === "production" && productionHost) {
return { url: `https://${productionHost}`, source: "VERCEL_PROJECT_PRODUCTION_URL" };
}
const deploymentHost = process.env.VERCEL_URL?.trim();
if (deploymentHost) return { url: `https://${deploymentHost}`, source: "VERCEL_URL" };
return { url: FALLBACK, source: "fallback" };
}
/** The same answer without trailing slashes, ready to have a path added. */
export function resolveBaseUrl() {
return resolveBase().url.replace(/\/+$/, "");
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |