Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01602257de | ||
|
|
cb1e1698f3 | ||
|
|
3bdaa6e100 | ||
|
|
b7b00bfb9d | ||
|
|
ae2b523503 | ||
|
|
75b3b3c48a |
No files matched your search
@@ -99,6 +99,7 @@ export const layer = Layer.effect(
|
||||
width: 12,
|
||||
height: 12,
|
||||
});
|
||||
icon.setTemplateImage(true);
|
||||
destructiveMenuIconCache = icon.isEmpty() ? Option.none() : Option.some(icon);
|
||||
} catch {
|
||||
destructiveMenuIconCache = Option.none();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
---
|
||||
import { GITHUB_REPOSITORY_URL, MARKETING_STATS } from "../lib/site";
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
@@ -36,17 +38,17 @@ const {
|
||||
</a>
|
||||
<div class="nav-right">
|
||||
<a
|
||||
class="nav-gh"
|
||||
href="https://github.com/pingdotgg/t3code"
|
||||
class="nav-stars"
|
||||
href={GITHUB_REPOSITORY_URL}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label={`Star T3 Code on GitHub — ${MARKETING_STATS.githubStars} stars`}
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
||||
<path d="M12 .5C5.65.5.5 5.65.5 12a11.5 11.5 0 007.86 10.93c.58.1.79-.25.79-.56v-2c-3.2.69-3.88-1.37-3.88-1.37-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.33.96.1-.75.4-1.25.72-1.54-2.55-.29-5.24-1.27-5.24-5.67 0-1.25.45-2.28 1.18-3.08-.12-.29-.51-1.45.11-3.02 0 0 .96-.31 3.15 1.18a10.96 10.96 0 015.74 0c2.19-1.49 3.15-1.18 3.15-1.18.62 1.57.23 2.73.11 3.02.74.8 1.18 1.83 1.18 3.08 0 4.41-2.7 5.38-5.27 5.66.41.36.78 1.06.78 2.13v3.16c0 .31.21.67.8.56A11.5 11.5 0 0023.5 12C23.5 5.65 18.35.5 12 .5z"/>
|
||||
<path d="M12 2.3l2.9 5.88 6.49.94-4.7 4.58 1.11 6.47L12 17.12l-5.8 3.05 1.11-6.47-4.7-4.58 6.49-.94L12 2.3z"/>
|
||||
</svg>
|
||||
<span>GitHub</span>
|
||||
<span><strong>{MARKETING_STATS.githubStars}</strong> GitHub stars</span>
|
||||
</a>
|
||||
<a class="btn btn-primary" href="/#download">Download</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -62,7 +64,7 @@ const {
|
||||
<span>© {new Date().getFullYear()} T3 Tools Inc · MIT licensed</span>
|
||||
</div>
|
||||
<div class="footer-links">
|
||||
<a href="https://github.com/pingdotgg/t3code" target="_blank" rel="noopener noreferrer">GitHub</a>
|
||||
<a href={GITHUB_REPOSITORY_URL} target="_blank" rel="noopener noreferrer">GitHub</a>
|
||||
<a href="https://discord.gg/jn4EGJjrvv" target="_blank" rel="noopener noreferrer">Discord</a>
|
||||
<a href="/download">Download</a>
|
||||
</div>
|
||||
@@ -329,23 +331,36 @@ const {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.nav-gh {
|
||||
.nav-stars {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 7px 12px;
|
||||
gap: 7px;
|
||||
height: 36px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 8px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
color: var(--fg-muted);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 12px;
|
||||
transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
|
||||
font-size: 13px;
|
||||
letter-spacing: -0.01em;
|
||||
white-space: nowrap;
|
||||
transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
|
||||
}
|
||||
|
||||
.nav-gh:hover {
|
||||
.nav-stars:hover {
|
||||
color: var(--fg);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border-color: var(--border-strong);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.nav-stars strong {
|
||||
color: var(--fg);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.nav-stars svg {
|
||||
color: var(--warn);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.main {
|
||||
@@ -407,4 +422,17 @@ const {
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.nav-inner {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.nav-stars {
|
||||
height: 34px;
|
||||
gap: 6px;
|
||||
padding: 0 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,6 @@
|
||||
export const GITHUB_REPOSITORY_URL = "https://github.com/pingdotgg/t3code";
|
||||
|
||||
export const MARKETING_STATS = {
|
||||
githubStars: "12k+",
|
||||
users: "100,000",
|
||||
} as const;
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import { GITHUB_REPOSITORY_URL, MARKETING_STATS } from "../lib/site";
|
||||
import { tweets } from "../lib/tweets";
|
||||
|
||||
const desktopEndorsementRows = [
|
||||
@@ -55,11 +56,12 @@ const mobileEndorsementRows = [
|
||||
<svg class="dl-icon dl-icon--linux" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489a.424.424 0 00-.11.135c-.26.268-.45.6-.663.839-.199.199-.485.267-.797.4-.313.136-.658.269-.864.68-.09.189-.136.394-.132.602 0 .199.027.4.055.536.058.399.116.728.04.97-.249.68-.28 1.145-.106 1.484.174.334.535.47.94.601.81.2 1.91.135 2.774.6.926.466 1.866.67 2.616.47.526-.116.97-.464 1.208-.946.587-.003 1.23-.269 2.26-.334.699-.058 1.574.267 2.577.2.025.134.063.198.114.333l.003.003c.391.778 1.113 1.132 1.884 1.071.771-.06 1.592-.536 2.257-1.306.631-.765 1.683-1.084 2.378-1.503.348-.199.629-.469.649-.853.023-.4-.2-.811-.714-1.376v-.097l-.003-.003c-.17-.2-.25-.535-.338-.926-.085-.401-.182-.786-.492-1.046h-.003c-.059-.054-.123-.067-.188-.135a.357.357 0 00-.19-.064c.431-1.278.264-2.55-.173-3.694-.533-1.41-1.465-2.638-2.175-3.483-.796-1.005-1.576-1.957-1.56-3.368.026-2.152.236-6.133-3.544-6.139zm.529 3.405h.013c.213 0 .396.062.584.198.19.135.33.332.438.533.105.259.158.459.166.724 0-.02.006-.04.006-.06v.105a.086.086 0 01-.004-.021l-.004-.024a1.807 1.807 0 01-.15.706.953.953 0 01-.213.335.71.71 0 00-.088-.042c-.104-.045-.198-.064-.284-.133a1.312 1.312 0 00-.22-.066c.05-.06.146-.133.183-.198.053-.128.082-.264.088-.402v-.02a1.21 1.21 0 00-.061-.4c-.045-.134-.101-.2-.183-.333-.084-.066-.167-.132-.267-.132h-.016c-.093 0-.176.03-.262.132a.8.8 0 00-.205.334 1.18 1.18 0 00-.09.4v.019c.002.089.008.179.02.267-.193-.067-.438-.135-.607-.202a1.635 1.635 0 01-.018-.2v-.02a1.772 1.772 0 01.15-.768c.082-.22.232-.406.43-.533a.985.985 0 01.594-.2zm-2.962.059h.036c.142 0 .27.048.399.135.146.129.264.288.344.465.09.199.14.4.153.667v.004c.007.134.006.2-.002.266v.08c-.03.007-.056.018-.083.024-.152.055-.274.135-.393.2.012-.09.013-.18.003-.267v-.015c-.012-.133-.04-.2-.082-.333a.613.613 0 00-.166-.267.248.248 0 00-.183-.064h-.021c-.071.006-.13.04-.186.132a.552.552 0 00-.12.27.944.944 0 00-.023.33v.015c.012.135.037.2.08.334.046.134.098.2.166.268.01.009.02.018.034.024-.07.057-.117.07-.176.136a.304.304 0 01-.131.068 2.62 2.62 0 01-.275-.402 1.772 1.772 0 01-.155-.667 1.759 1.759 0 01.08-.668 1.43 1.43 0 01.283-.535c.128-.133.26-.2.418-.2zm1.37 1.706c.332 0 .733.065 1.216.399.293.2.523.269 1.052.468h.003c.255.136.405.266.478.399v-.131a.571.571 0 01.016.47c-.123.31-.516.643-1.063.842v.002c-.268.135-.501.333-.775.465-.276.135-.588.292-1.012.267a1.139 1.139 0 01-.448-.067 3.566 3.566 0 01-.322-.198c-.195-.135-.363-.332-.612-.465v-.005h-.005c-.4-.246-.616-.512-.686-.71-.07-.268-.005-.47.193-.6.224-.135.38-.271.483-.336.104-.074.143-.102.176-.131h.002v-.003c.169-.202.436-.47.839-.601.139-.036.294-.065.466-.065zm2.8 2.142c.358 1.417 1.196 3.475 1.735 4.473.286.534.855 1.659 1.102 3.024.156-.005.33.018.513.064.646-1.671-.546-3.467-1.089-3.966-.22-.2-.232-.335-.123-.335.59.534 1.365 1.572 1.646 2.757.13.535.16 1.104.021 1.67.067.028.135.06.205.067 1.032.534 1.413.938 1.23 1.537v-.043c-.06-.003-.12 0-.18 0h-.016c.151-.467-.182-.825-1.065-1.224-.915-.4-1.646-.336-1.77.465-.008.043-.013.066-.018.135-.068.023-.139.053-.209.064-.43.268-.662.669-.793 1.187-.13.533-.17 1.156-.205 1.869v.003c-.02.334-.17.838-.319 1.35-1.5 1.072-3.58 1.538-5.348.334a2.645 2.645 0 00-.402-.533 1.45 1.45 0 00-.275-.333c.182 0 .338-.03.465-.067a.615.615 0 00.314-.334c.108-.267 0-.697-.345-1.163-.345-.467-.931-.995-1.788-1.521-.63-.4-.986-.87-1.15-1.396-.165-.534-.143-1.085-.015-1.645.245-1.07.873-2.11 1.274-2.763.107-.065.037.135-.408.974-.396.751-1.14 2.497-.122 3.854a8.123 8.123 0 01.647-2.876c.564-1.278 1.743-3.504 1.836-5.268.048.036.217.135.289.202.218.133.38.333.59.465.21.201.477.335.876.335.039.003.075.006.11.006.412 0 .73-.134.997-.268.29-.134.52-.334.74-.4h.005c.467-.135.835-.402 1.044-.7zm2.185 8.958c.037.6.343 1.245.882 1.377.588.134 1.434-.333 1.791-.765l.211-.01c.315-.007.577.01.847.268l.003.003c.208.199.305.53.391.876.085.4.154.78.409 1.066.486.527.645.906.636 1.14l.003-.007v.018l-.003-.012c-.015.262-.185.396-.498.595-.63.401-1.746.712-2.457 1.57-.618.737-1.37 1.14-2.036 1.191-.664.053-1.237-.2-1.574-.898l-.005-.003c-.21-.4-.12-1.025.056-1.69.176-.668.428-1.344.463-1.897.037-.714.076-1.335.195-1.814.12-.465.308-.797.641-.984l.045-.022zm-10.814.049h.01c.053 0 .105.005.157.014.376.055.706.333 1.023.752l.91 1.664.003.003c.243.533.754 1.064 1.189 1.637.434.598.77 1.131.729 1.57v.006c-.057.744-.48 1.148-1.125 1.294-.645.135-1.52.002-2.395-.464-.968-.536-2.118-.469-2.857-.602-.369-.066-.61-.2-.723-.4-.11-.2-.113-.602.123-1.23v-.004l.002-.003c.117-.334.03-.752-.027-1.118-.055-.401-.083-.71.043-.94.16-.334.396-.4.69-.533.294-.135.64-.202.915-.47h.002v-.002c.256-.268.445-.601.668-.838.19-.201.38-.336.663-.336zm7.159-9.074c-.435.201-.945.535-1.488.535-.542 0-.97-.267-1.28-.466-.154-.134-.28-.268-.373-.335-.164-.134-.144-.333-.074-.333.109.016.129.134.199.2.096.066.215.2.3Line truncated
|
||||
<span id="download-label">Download for macOS</span>
|
||||
</a>
|
||||
<a href="https://github.com/pingdotgg/t3code" target="_blank" rel="noopener noreferrer" class="btn btn-ghost btn-lg">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
||||
<a class="hero-source-link" href={GITHUB_REPOSITORY_URL} target="_blank" rel="noopener noreferrer">
|
||||
<svg class="hero-source-mark" width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
||||
<path d="M12 .5C5.65.5.5 5.65.5 12a11.5 11.5 0 007.86 10.93c.58.1.79-.25.79-.56v-2c-3.2.69-3.88-1.37-3.88-1.37-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.33.96.1-.75.4-1.25.72-1.54-2.55-.29-5.24-1.27-5.24-5.67 0-1.25.45-2.28 1.18-3.08-.12-.29-.51-1.45.11-3.02 0 0 .96-.31 3.15 1.18a10.96 10.96 0 015.74 0c2.19-1.49 3.15-1.18 3.15-1.18.62 1.57.23 2.73.11 3.02.74.8 1.18 1.83 1.18 3.08 0 4.41-2.7 5.38-5.27 5.66.41.36.78 1.06.78 2.13v3.16c0 .31.21.67.8.56A11.5 11.5 0 0023.5 12C23.5 5.65 18.35.5 12 .5z"/>
|
||||
</svg>
|
||||
Star on GitHub
|
||||
<span>Steal our code (legally)</span>
|
||||
<svg class="hero-source-arrow" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17L17 7M8 7h9v9"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -82,8 +84,8 @@ const mobileEndorsementRows = [
|
||||
<section id="endorsements" class="sec-endorsements" aria-labelledby="endorsements-title">
|
||||
<div class="container">
|
||||
<div class="endorsements-head">
|
||||
<h2 id="endorsements-title">Developers love T3 Code</h2>
|
||||
<p>Real reactions from people building with T3 Code today.</p>
|
||||
<h2 id="endorsements-title">Tolerated by over <span class="endorsements-count">{MARKETING_STATS.users}</span> devs</h2>
|
||||
<p>Some of them even tweeted about it.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -282,10 +284,6 @@ const mobileEndorsementRows = [
|
||||
<div class="section-head open-head">
|
||||
<div class="eyebrow">Open source</div>
|
||||
<h2>If you don't like something, fork it.</h2>
|
||||
<p>
|
||||
T3 Code is as open as they come. We built this app to be modifiable,
|
||||
customizable, and forkable. Go nuts - that's the whole point.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="open-grid">
|
||||
@@ -305,43 +303,44 @@ const mobileEndorsementRows = [
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="open-stats">
|
||||
<div class="tile open-stat">
|
||||
<div class="open-stat-val">MIT</div>
|
||||
<div class="open-stat-lbl">License · commercial-friendly</div>
|
||||
<div class="tile open-pitch">
|
||||
<div class="open-pitch-copy">
|
||||
<ul class="open-pitch-list">
|
||||
<li>
|
||||
<span class="open-pitch-mark" aria-hidden="true"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
|
||||
<span><strong>Change the UI.</strong> Restyle every surface to match your taste.</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="open-pitch-mark" aria-hidden="true"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
|
||||
<span><strong>Add an agent.</strong> Wire in your own tools, models, and flows.</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="open-pitch-mark" aria-hidden="true"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg></span>
|
||||
<span><strong>Ship your own build.</strong> Self-host it or distribute it as your own.</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tile open-stat">
|
||||
<div class="open-stat-val">TypeScript</div>
|
||||
<div class="open-stat-lbl">End-to-end, strictly typed</div>
|
||||
</div>
|
||||
<div class="tile open-stat">
|
||||
<div class="open-stat-val">1 monorepo</div>
|
||||
<div class="open-stat-lbl">Desktop · web · server · harnesses</div>
|
||||
</div>
|
||||
<div class="tile open-stat">
|
||||
<div class="open-stat-val">No telemetry</div>
|
||||
<div class="open-stat-lbl">Unless you opt in. Full stop.</div>
|
||||
|
||||
<div class="open-pitch-footer">
|
||||
<div class="open-pitch-meta">
|
||||
<span>MIT licensed</span>
|
||||
<span aria-hidden="true">·</span>
|
||||
<span>{MARKETING_STATS.githubStars} stars</span>
|
||||
</div>
|
||||
|
||||
<div class="open-pitch-actions">
|
||||
<a class="btn btn-primary" href="https://github.com/pingdotgg/t3code/fork" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="6" cy="5" r="2.2"/><circle cx="18" cy="5" r="2.2"/><circle cx="12" cy="19" r="2.2"/><path d="M6 7.2v2A3 3 0 009 12.2h6A3 3 0 0018 9.2v-2M12 14v2.8"/></svg>
|
||||
Fork on GitHub
|
||||
</a>
|
||||
<a class="open-source-link" href={GITHUB_REPOSITORY_URL} target="_blank" rel="noopener noreferrer">
|
||||
Browse source
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17L17 7M8 7h9v9"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="open-ctas">
|
||||
<a class="btn btn-ghost" href="https://github.com/pingdotgg/t3code" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 .5C5.65.5.5 5.65.5 12a11.5 11.5 0 007.86 10.93c.58.1.79-.25.79-.56v-2c-3.2.69-3.88-1.37-3.88-1.37-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.33.96.1-.75.4-1.25.72-1.54-2.55-.29-5.24-1.27-5.24-5.67 0-1.25.45-2.28 1.18-3.08-.12-.29-.51-1.45.11-3.02 0 0 .96-.31 3.15 1.18a10.96 10.96 0 015.74 0c2.19-1.49 3.15-1.18 3.15-1.18.62 1.57.23 2.73.11 3.02.74.8 1.18 1.83 1.18 3.08 0 4.41-2.7 5.38-5.27 5.66.41.36.78 1.06.78 2.13v3.16c0 .31.21.67.8.56A11.5 11.5 0 0023.5 12C23.5 5.65 18.35.5 12 .5z"/></svg>
|
||||
Star on GitHub
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M8 7h9v9"/></svg>
|
||||
</a>
|
||||
<a class="btn btn-ghost" href="https://github.com/pingdotgg/t3code/fork" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="5" r="2.2"/><circle cx="18" cy="5" r="2.2"/><circle cx="12" cy="19" r="2.2"/><path d="M6 7.2v2A3 3 0 009 12.2h6A3 3 0 0018 9.2v-2M12 14v2.8"/></svg>
|
||||
Fork the repo
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M8 7h9v9"/></svg>
|
||||
</a>
|
||||
<a class="btn btn-ghost" href="https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md" target="_blank" rel="noopener noreferrer">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="2.5" y="4.5" width="19" height="15" rx="2"/><path d="M7 10l3 2-3 2M12 16h5"/></svg>
|
||||
Read CONTRIBUTING.md
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M8 7h9v9"/></svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -515,7 +514,7 @@ const mobileEndorsementRows = [
|
||||
|
||||
.hero-title {
|
||||
font-size: clamp(38px, 5.6vw, 76px);
|
||||
margin: 28px auto 22px;
|
||||
margin: 48px auto 22px;
|
||||
max-width: 20ch;
|
||||
text-wrap: balance;
|
||||
}
|
||||
@@ -531,12 +530,42 @@ const mobileEndorsementRows = [
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 56px;
|
||||
}
|
||||
|
||||
.hero-source-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: var(--fg-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -0.01em;
|
||||
transition: color 0.18s ease;
|
||||
}
|
||||
|
||||
.hero-source-link:hover {
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.hero-source-mark {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.hero-source-arrow {
|
||||
flex-shrink: 0;
|
||||
opacity: 0.6;
|
||||
transition: transform 0.18s ease, opacity 0.18s ease;
|
||||
}
|
||||
|
||||
.hero-source-link:hover .hero-source-arrow {
|
||||
transform: translate(2px, -2px);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Download button icons (platform-aware) */
|
||||
.dl-icon {
|
||||
display: none;
|
||||
@@ -656,6 +685,30 @@ const mobileEndorsementRows = [
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 340px) {
|
||||
.hero-float-mark.hf-opencode,
|
||||
.hero-float-mark.hf-cursor {
|
||||
top: 580px;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.hero-float-mark.hf-opencode {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.hero-float-mark.hf-cursor {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.hero-float-mark.hf-opencode img,
|
||||
.hero-float-mark.hf-cursor img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-preview {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
@@ -759,6 +812,11 @@ const mobileEndorsementRows = [
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.endorsements-count {
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.endorsements-head p {
|
||||
color: var(--fg-muted);
|
||||
font-size: 18px;
|
||||
@@ -962,12 +1020,11 @@ const mobileEndorsementRows = [
|
||||
text-align: center;
|
||||
margin: 0 auto 56px;
|
||||
}
|
||||
.open-head p { margin: 0 auto; }
|
||||
|
||||
.open-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1.25fr 1fr;
|
||||
gap: 20px; margin-bottom: 32px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.open-term { padding: 0; overflow: hidden; }
|
||||
@@ -1009,27 +1066,85 @@ const mobileEndorsementRows = [
|
||||
animation: blink 1s steps(2) infinite;
|
||||
}
|
||||
|
||||
.open-stats {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
.open-stat {
|
||||
padding: 22px;
|
||||
display: flex; flex-direction: column; gap: 6px;
|
||||
}
|
||||
.open-stat-val {
|
||||
font-size: 22px; font-weight: 500;
|
||||
letter-spacing: -0.015em;
|
||||
}
|
||||
.open-stat-lbl {
|
||||
font-family: var(--font-mono); font-size: 10.5px;
|
||||
color: var(--fg-dim); letter-spacing: 0.04em;
|
||||
.open-pitch {
|
||||
padding: 32px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 32px;
|
||||
background:
|
||||
radial-gradient(110% 75% at 100% 0%, var(--accent-dim), transparent 60%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
|
||||
}
|
||||
|
||||
.open-ctas {
|
||||
display: flex; gap: 10px;
|
||||
justify-content: center; flex-wrap: wrap;
|
||||
.open-pitch-list {
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.open-pitch-list li {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
|
||||
.open-pitch-list strong {
|
||||
color: var(--fg);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.open-pitch-mark {
|
||||
flex: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
margin-top: 1px;
|
||||
border-radius: 7px;
|
||||
color: var(--accent);
|
||||
background: var(--accent-dim);
|
||||
border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
|
||||
}
|
||||
|
||||
.open-pitch-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.open-pitch-meta {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: var(--fg-dim);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.open-pitch-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.open-source-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
color: var(--fg-muted);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
transition: color 0.18s ease;
|
||||
}
|
||||
|
||||
.open-source-link:hover {
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
/* ── Final CTA ────────────────────────────────────────── */
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
"@noble/hashes": "catalog:",
|
||||
"@pierre/diffs": "catalog:",
|
||||
"@react-native-menu/menu": "^2.0.0",
|
||||
"@shikijs/core": "3.23.0",
|
||||
"@shikijs/engine-javascript": "3.23.0",
|
||||
"@shikijs/langs": "3.23.0",
|
||||
"@shikijs/themes": "3.23.0",
|
||||
"@shikijs/core": "4.2.0",
|
||||
"@shikijs/engine-javascript": "4.2.0",
|
||||
"@shikijs/langs": "4.2.0",
|
||||
"@shikijs/themes": "4.2.0",
|
||||
"@t3tools/client-runtime": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/mobile-markdown-text": "file:./modules/t3-markdown-text",
|
||||
@@ -98,10 +98,10 @@
|
||||
"react-native-reanimated": "4.3.1",
|
||||
"react-native-safe-area-context": "~5.7.0",
|
||||
"react-native-screens": "4.25.2",
|
||||
"react-native-shiki-engine": "^0.3.9",
|
||||
"react-native-shiki-engine": "^0.3.12",
|
||||
"react-native-svg": "15.15.4",
|
||||
"react-native-worklets": "0.8.3",
|
||||
"shiki": "3.23.0",
|
||||
"shiki": "4.2.0",
|
||||
"tailwind-merge": "^3.5.0",
|
||||
"uniwind": "^1.6.2"
|
||||
},
|
||||
|
||||
@@ -216,7 +216,7 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("disables SSH askpass for background upstream status fetches", () =>
|
||||
it.effect("makes background upstream status fetches non-interactive", () =>
|
||||
Effect.gen(function* () {
|
||||
const cwd = yield* makeTmpDir();
|
||||
const tempDir = yield* makeTmpDir("git-vcs-driver-ssh-env-");
|
||||
@@ -225,15 +225,26 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
|
||||
const pathService = yield* Path.Path;
|
||||
const sshLogPath = pathService.join(tempDir, "ssh-env.txt");
|
||||
const sshWrapperPath = pathService.join(tempDir, "ssh-wrapper.sh");
|
||||
const previousGitSsh = process.env.GIT_SSH;
|
||||
const previousAskpassRequire = process.env.SSH_ASKPASS_REQUIRE;
|
||||
const previousAskpassLog = process.env.T3_TEST_SSH_ASKPASS_LOG;
|
||||
const envKeys = [
|
||||
"GCM_INTERACTIVE",
|
||||
"GIT_ASKPASS",
|
||||
"GIT_SSH",
|
||||
"GIT_TERMINAL_PROMPT",
|
||||
"SSH_ASKPASS",
|
||||
"SSH_ASKPASS_REQUIRE",
|
||||
"T3_TEST_SSH_ASKPASS_LOG",
|
||||
] as const;
|
||||
const previousEnv = new Map(envKeys.map((key) => [key, process.env[key]]));
|
||||
|
||||
yield* fileSystem.writeFileString(
|
||||
sshWrapperPath,
|
||||
[
|
||||
"#!/bin/sh",
|
||||
'printf "%s\\n" "${SSH_ASKPASS_REQUIRE:-}" > "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
'printf "GCM_INTERACTIVE=%s\\n" "${GCM_INTERACTIVE:-}" > "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
'printf "GIT_ASKPASS=%s\\n" "${GIT_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
'printf "GIT_TERMINAL_PROMPT=%s\\n" "${GIT_TERMINAL_PROMPT:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
'printf "SSH_ASKPASS=%s\\n" "${SSH_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
'printf "SSH_ASKPASS_REQUIRE=%s\\n" "${SSH_ASKPASS_REQUIRE:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
|
||||
"exit 1",
|
||||
"",
|
||||
].join("\n"),
|
||||
@@ -245,29 +256,32 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
|
||||
|
||||
yield* Effect.gen(function* () {
|
||||
process.env.GIT_SSH = sshWrapperPath;
|
||||
process.env.GCM_INTERACTIVE = "always";
|
||||
process.env.GIT_ASKPASS = "git-askpass";
|
||||
process.env.GIT_TERMINAL_PROMPT = "1";
|
||||
process.env.SSH_ASKPASS = "ssh-askpass";
|
||||
process.env.SSH_ASKPASS_REQUIRE = "force";
|
||||
process.env.T3_TEST_SSH_ASKPASS_LOG = sshLogPath;
|
||||
|
||||
yield* (yield* GitVcsDriver.GitVcsDriver).statusDetails(cwd);
|
||||
|
||||
assert.equal((yield* fileSystem.readFileString(sshLogPath)).trim(), "never");
|
||||
assert.deepEqual((yield* fileSystem.readFileString(sshLogPath)).trim().split(/\r?\n/), [
|
||||
"GCM_INTERACTIVE=never",
|
||||
"GIT_ASKPASS=",
|
||||
"GIT_TERMINAL_PROMPT=0",
|
||||
"SSH_ASKPASS=",
|
||||
"SSH_ASKPASS_REQUIRE=never",
|
||||
]);
|
||||
}).pipe(
|
||||
Effect.ensuring(
|
||||
Effect.sync(() => {
|
||||
if (previousGitSsh === undefined) {
|
||||
delete process.env.GIT_SSH;
|
||||
} else {
|
||||
process.env.GIT_SSH = previousGitSsh;
|
||||
}
|
||||
if (previousAskpassRequire === undefined) {
|
||||
delete process.env.SSH_ASKPASS_REQUIRE;
|
||||
} else {
|
||||
process.env.SSH_ASKPASS_REQUIRE = previousAskpassRequire;
|
||||
}
|
||||
if (previousAskpassLog === undefined) {
|
||||
delete process.env.T3_TEST_SSH_ASKPASS_LOG;
|
||||
} else {
|
||||
process.env.T3_TEST_SSH_ASKPASS_LOG = previousAskpassLog;
|
||||
for (const key of envKeys) {
|
||||
const previous = previousEnv.get(key);
|
||||
if (previous === undefined) {
|
||||
delete process.env[key];
|
||||
} else {
|
||||
process.env[key] = previous;
|
||||
}
|
||||
}
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -54,6 +54,10 @@ const STATUS_UPSTREAM_REFRESH_TIMEOUT = Duration.seconds(5);
|
||||
const STATUS_UPSTREAM_REFRESH_FAILURE_COOLDOWN = Duration.seconds(5);
|
||||
const STATUS_UPSTREAM_REFRESH_CACHE_CAPACITY = 2_048;
|
||||
const STATUS_UPSTREAM_REFRESH_ENV = Object.freeze({
|
||||
GCM_INTERACTIVE: "never",
|
||||
GIT_ASKPASS: "",
|
||||
GIT_TERMINAL_PROMPT: "0",
|
||||
SSH_ASKPASS: "",
|
||||
SSH_ASKPASS_REQUIRE: "never",
|
||||
} satisfies NodeJS.ProcessEnv);
|
||||
const DEFAULT_BASE_BRANCH_CANDIDATES = ["main", "master"] as const;
|
||||
|
||||
@@ -53,6 +53,48 @@ describe("VcsProjectConfig", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.layer(TestLayer)("ignores invalid project config files", (it) => {
|
||||
it.effect("returns auto for malformed JSON", () =>
|
||||
Effect.gen(function* () {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const root = yield* fileSystem.makeTempDirectoryScoped({
|
||||
prefix: "t3-vcs-config-test-",
|
||||
});
|
||||
const configDir = path.join(root, ".t3code");
|
||||
yield* fileSystem.makeDirectory(configDir, { recursive: true });
|
||||
yield* fileSystem.writeFileString(path.join(configDir, "vcs.json"), "{ not json");
|
||||
|
||||
const config = yield* VcsProjectConfig.VcsProjectConfig;
|
||||
const kind = yield* config.resolveKind({ cwd: root });
|
||||
|
||||
assert.equal(kind, "auto");
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("returns auto for schema-invalid JSON", () =>
|
||||
Effect.gen(function* () {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const root = yield* fileSystem.makeTempDirectoryScoped({
|
||||
prefix: "t3-vcs-config-test-",
|
||||
});
|
||||
const configDir = path.join(root, ".t3code");
|
||||
yield* fileSystem.makeDirectory(configDir, { recursive: true });
|
||||
yield* fileSystem.writeFileString(
|
||||
path.join(configDir, "vcs.json"),
|
||||
// @effect-diagnostics-next-line preferSchemaOverJson:off
|
||||
JSON.stringify({ vcs: { kind: "svn" } }),
|
||||
);
|
||||
|
||||
const config = yield* VcsProjectConfig.VcsProjectConfig;
|
||||
const kind = yield* config.resolveKind({ cwd: root });
|
||||
|
||||
assert.equal(kind, "auto");
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it.layer(TestLayer)("falls back to auto when no config exists", (it) => {
|
||||
it.effect("returns auto", () =>
|
||||
Effect.gen(function* () {
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as Context from "effect/Context";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as FileSystem from "effect/FileSystem";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Path from "effect/Path";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
@@ -15,16 +16,10 @@ const ProjectVcsConfig = Schema.Struct({
|
||||
),
|
||||
vcsKind: Schema.optional(VcsDriverKind),
|
||||
});
|
||||
const isProjectVcsConfig = Schema.is(ProjectVcsConfig);
|
||||
|
||||
interface ProjectVcsConfigFile {
|
||||
readonly vcs?:
|
||||
| {
|
||||
readonly kind?: VcsDriverKindType | undefined;
|
||||
}
|
||||
| undefined;
|
||||
readonly vcsKind?: VcsDriverKindType | undefined;
|
||||
}
|
||||
const decodeProjectVcsConfigJson = Schema.decodeUnknownOption(
|
||||
Schema.fromJsonString(ProjectVcsConfig),
|
||||
);
|
||||
type ProjectVcsConfigFile = typeof ProjectVcsConfig.Type;
|
||||
|
||||
export interface VcsProjectConfigResolveInput {
|
||||
readonly cwd: string;
|
||||
@@ -45,15 +40,6 @@ function configuredKind(config: ProjectVcsConfigFile): VcsDriverKindType | "auto
|
||||
return config.vcs?.kind ?? config.vcsKind ?? "auto";
|
||||
}
|
||||
|
||||
function parseConfig(raw: string): ProjectVcsConfigFile | null {
|
||||
try {
|
||||
const parsed = JSON.parse(raw) as unknown;
|
||||
return isProjectVcsConfig(parsed) ? parsed : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export const make = Effect.fn("makeVcsProjectConfig")(function* () {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
@@ -89,15 +75,15 @@ export const make = Effect.fn("makeVcsProjectConfig")(function* () {
|
||||
return "auto" as const;
|
||||
}
|
||||
|
||||
const parsed = parseConfig(raw);
|
||||
if (parsed === null) {
|
||||
const parsed = decodeProjectVcsConfigJson(raw);
|
||||
if (Option.isNone(parsed)) {
|
||||
yield* Effect.logWarning("invalid VCS project config", {
|
||||
configPath,
|
||||
});
|
||||
return "auto" as const;
|
||||
}
|
||||
|
||||
return configuredKind(parsed);
|
||||
return configuredKind(parsed.value);
|
||||
});
|
||||
|
||||
const resolveKind: VcsProjectConfigShape["resolveKind"] = Effect.fn(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { it, describe, expect } from "@effect/vitest";
|
||||
import { assert, it, describe } from "@effect/vitest";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as FileSystem from "effect/FileSystem";
|
||||
import * as Layer from "effect/Layer";
|
||||
@@ -18,6 +18,8 @@ const ProjectLayer = WorkspaceFileSystemLive.pipe(
|
||||
Layer.provide(WorkspaceEntries.layer.pipe(Layer.provide(WorkspacePathsLive))),
|
||||
);
|
||||
|
||||
const PROJECT_READ_FILE_MAX_BYTES = 1024 * 1024;
|
||||
|
||||
const TestLayer = Layer.empty.pipe(
|
||||
Layer.provideMerge(ProjectLayer),
|
||||
Layer.provideMerge(WorkspaceEntries.layer.pipe(Layer.provide(WorkspacePathsLive))),
|
||||
@@ -52,6 +54,20 @@ const writeTextFile = Effect.fn("writeTextFile")(function* (
|
||||
yield* fileSystem.writeFileString(absolutePath, contents).pipe(Effect.orDie);
|
||||
});
|
||||
|
||||
const writeBinaryFile = Effect.fn("writeBinaryFile")(function* (
|
||||
cwd: string,
|
||||
relativePath: string,
|
||||
contents: Uint8Array,
|
||||
) {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const absolutePath = path.join(cwd, relativePath);
|
||||
yield* fileSystem
|
||||
.makeDirectory(path.dirname(absolutePath), { recursive: true })
|
||||
.pipe(Effect.orDie);
|
||||
yield* fileSystem.writeFile(absolutePath, contents).pipe(Effect.orDie);
|
||||
});
|
||||
|
||||
it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (it) => {
|
||||
describe("readFile", () => {
|
||||
it.effect("reads UTF-8 files relative to the workspace root", () =>
|
||||
@@ -65,7 +81,7 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
relativePath: "src/index.ts",
|
||||
});
|
||||
|
||||
expect(result).toEqual({
|
||||
assert.deepStrictEqual(result, {
|
||||
relativePath: "src/index.ts",
|
||||
contents: "export const answer = 42;\n",
|
||||
byteLength: 26,
|
||||
@@ -83,7 +99,8 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
.readFile({ cwd, relativePath: "../escape.md" })
|
||||
.pipe(Effect.flip);
|
||||
|
||||
expect(error.message).toContain(
|
||||
assert.include(
|
||||
error.message,
|
||||
"Workspace file path must be relative to the project root: ../escape.md",
|
||||
);
|
||||
}),
|
||||
@@ -106,7 +123,56 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
.readFile({ cwd, relativePath: "linked-secret.txt" })
|
||||
.pipe(Effect.flip);
|
||||
|
||||
expect(error.message).toContain("resolves outside the project root");
|
||||
assert.include(error.message, "resolves outside the project root");
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("truncates files larger than the preview byte limit", () =>
|
||||
Effect.gen(function* () {
|
||||
const workspaceFileSystem = yield* WorkspaceFileSystem;
|
||||
const cwd = yield* makeTempDir;
|
||||
const contents = `${"a".repeat(PROJECT_READ_FILE_MAX_BYTES)}tail`;
|
||||
yield* writeTextFile(cwd, "large.txt", contents);
|
||||
|
||||
const result = yield* workspaceFileSystem.readFile({
|
||||
cwd,
|
||||
relativePath: "large.txt",
|
||||
});
|
||||
|
||||
assert.equal(result.contents.length, PROJECT_READ_FILE_MAX_BYTES);
|
||||
assert.equal(result.contents, "a".repeat(PROJECT_READ_FILE_MAX_BYTES));
|
||||
assert.equal(result.byteLength, PROJECT_READ_FILE_MAX_BYTES + 4);
|
||||
assert.isTrue(result.truncated);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("rejects binary files", () =>
|
||||
Effect.gen(function* () {
|
||||
const workspaceFileSystem = yield* WorkspaceFileSystem;
|
||||
const cwd = yield* makeTempDir;
|
||||
yield* writeBinaryFile(cwd, "binary.bin", new Uint8Array([65, 0, 66]));
|
||||
|
||||
const error = yield* workspaceFileSystem
|
||||
.readFile({ cwd, relativePath: "binary.bin" })
|
||||
.pipe(Effect.flip);
|
||||
|
||||
assert.include(error.message, "Binary files cannot be previewed as text.");
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("rejects directories", () =>
|
||||
Effect.gen(function* () {
|
||||
const workspaceFileSystem = yield* WorkspaceFileSystem;
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const cwd = yield* makeTempDir;
|
||||
yield* fileSystem.makeDirectory(path.join(cwd, "src"), { recursive: true });
|
||||
|
||||
const error = yield* workspaceFileSystem
|
||||
.readFile({ cwd, relativePath: "src" })
|
||||
.pipe(Effect.flip);
|
||||
|
||||
assert.include(error.message, "Workspace path is not a file.");
|
||||
}),
|
||||
);
|
||||
});
|
||||
@@ -127,8 +193,8 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
.readFileString(path.join(cwd, "plans/effect-rpc.md"))
|
||||
.pipe(Effect.orDie);
|
||||
|
||||
expect(result).toEqual({ relativePath: "plans/effect-rpc.md" });
|
||||
expect(saved).toBe("# Plan\n");
|
||||
assert.deepStrictEqual(result, { relativePath: "plans/effect-rpc.md" });
|
||||
assert.equal(saved, "# Plan\n");
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -140,9 +206,7 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
yield* writeTextFile(cwd, "src/existing.ts", "export {};\n");
|
||||
|
||||
const beforeWrite = yield* workspaceEntries.list({ cwd });
|
||||
expect(beforeWrite.entries.some((entry) => entry.path === "plans/effect-rpc.md")).toBe(
|
||||
false,
|
||||
);
|
||||
assert.isFalse(beforeWrite.entries.some((entry) => entry.path === "plans/effect-rpc.md"));
|
||||
|
||||
yield* workspaceFileSystem.writeFile({
|
||||
cwd,
|
||||
@@ -151,10 +215,8 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
});
|
||||
|
||||
const afterWrite = yield* workspaceEntries.list({ cwd });
|
||||
expect(afterWrite.entries).toEqual(
|
||||
expect.arrayContaining([expect.objectContaining({ path: "plans/effect-rpc.md" })]),
|
||||
);
|
||||
expect(afterWrite.truncated).toBe(false);
|
||||
assert.isTrue(afterWrite.entries.some((entry) => entry.path === "plans/effect-rpc.md"));
|
||||
assert.isFalse(afterWrite.truncated);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -173,7 +235,8 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
})
|
||||
.pipe(Effect.flip);
|
||||
|
||||
expect(error.message).toContain(
|
||||
assert.include(
|
||||
error.message,
|
||||
"Workspace file path must be relative to the project root: ../escape.md",
|
||||
);
|
||||
|
||||
@@ -181,7 +244,7 @@ it.layer(TestLayer, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
|
||||
const escapedStat = yield* fileSystem
|
||||
.stat(escapedPath)
|
||||
.pipe(Effect.orElseSucceed(() => null));
|
||||
expect(escapedStat).toBeNull();
|
||||
assert.isNull(escapedStat);
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// @effect-diagnostics nodeBuiltinImport:off
|
||||
import fsPromises from "node:fs/promises";
|
||||
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as FileSystem from "effect/FileSystem";
|
||||
import * as Layer from "effect/Layer";
|
||||
@@ -16,6 +13,25 @@ import { WorkspacePaths } from "../Services/WorkspacePaths.ts";
|
||||
|
||||
const PROJECT_READ_FILE_MAX_BYTES = 1024 * 1024;
|
||||
|
||||
function makeReadFileError(input: {
|
||||
readonly cwd: string;
|
||||
readonly relativePath: string;
|
||||
readonly detail: string;
|
||||
readonly cause?: unknown;
|
||||
}) {
|
||||
return new WorkspaceFileSystemError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
operation: "workspaceFileSystem.readFile",
|
||||
detail: input.detail,
|
||||
...(input.cause === undefined ? {} : { cause: input.cause }),
|
||||
});
|
||||
}
|
||||
|
||||
function causeMessage(cause: { readonly message: string }) {
|
||||
return cause.message;
|
||||
}
|
||||
|
||||
export const makeWorkspaceFileSystem = Effect.gen(function* () {
|
||||
const fileSystem = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
@@ -29,54 +45,92 @@ export const makeWorkspaceFileSystem = Effect.gen(function* () {
|
||||
relativePath: input.relativePath,
|
||||
});
|
||||
|
||||
const result = yield* Effect.tryPromise({
|
||||
try: async () => {
|
||||
const [realWorkspaceRoot, realTargetPath] = await Promise.all([
|
||||
fsPromises.realpath(input.cwd),
|
||||
fsPromises.realpath(target.absolutePath),
|
||||
]);
|
||||
const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
|
||||
if (
|
||||
relativeRealPath.startsWith(`..${path.sep}`) ||
|
||||
relativeRealPath === ".." ||
|
||||
path.isAbsolute(relativeRealPath)
|
||||
) {
|
||||
throw new Error("Workspace file path resolves outside the project root.");
|
||||
}
|
||||
|
||||
const handle = await fsPromises.open(realTargetPath, "r");
|
||||
try {
|
||||
const stat = await handle.stat();
|
||||
if (!stat.isFile()) {
|
||||
throw new Error("Workspace path is not a file.");
|
||||
}
|
||||
const bytesToRead = Math.min(stat.size, PROJECT_READ_FILE_MAX_BYTES);
|
||||
const buffer = Buffer.alloc(bytesToRead);
|
||||
const { bytesRead } = await handle.read(buffer, 0, bytesToRead, 0);
|
||||
const fileBytes = buffer.subarray(0, bytesRead);
|
||||
if (fileBytes.includes(0)) {
|
||||
throw new Error("Binary files cannot be previewed as text.");
|
||||
}
|
||||
const contents = new TextDecoder("utf-8").decode(fileBytes);
|
||||
return {
|
||||
relativePath: target.relativePath,
|
||||
contents,
|
||||
byteLength: stat.size,
|
||||
truncated: stat.size > PROJECT_READ_FILE_MAX_BYTES,
|
||||
};
|
||||
} finally {
|
||||
await handle.close();
|
||||
}
|
||||
},
|
||||
catch: (cause) =>
|
||||
new WorkspaceFileSystemError({
|
||||
const [realWorkspaceRoot, realTargetPath] = yield* Effect.all([
|
||||
fileSystem.realPath(input.cwd),
|
||||
fileSystem.realPath(target.absolutePath),
|
||||
]).pipe(
|
||||
Effect.mapError((cause) =>
|
||||
makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
operation: "workspaceFileSystem.readFile",
|
||||
detail: cause instanceof Error ? cause.message : String(cause),
|
||||
detail: causeMessage(cause),
|
||||
cause,
|
||||
}),
|
||||
});
|
||||
),
|
||||
);
|
||||
|
||||
const relativeRealPath = path.relative(realWorkspaceRoot, realTargetPath);
|
||||
if (
|
||||
relativeRealPath.startsWith(`..${path.sep}`) ||
|
||||
relativeRealPath === ".." ||
|
||||
path.isAbsolute(relativeRealPath)
|
||||
) {
|
||||
return yield* makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: "Workspace file path resolves outside the project root.",
|
||||
});
|
||||
}
|
||||
|
||||
const result = yield* Effect.scoped(
|
||||
Effect.gen(function* () {
|
||||
const handle = yield* fileSystem.open(realTargetPath, { flag: "r" }).pipe(
|
||||
Effect.mapError((cause) =>
|
||||
makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: causeMessage(cause),
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
);
|
||||
const stat = yield* handle.stat.pipe(
|
||||
Effect.mapError((cause) =>
|
||||
makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: causeMessage(cause),
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
);
|
||||
if (stat.type !== "File") {
|
||||
return yield* makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: "Workspace path is not a file.",
|
||||
});
|
||||
}
|
||||
const truncated = stat.size > FileSystem.Size(PROJECT_READ_FILE_MAX_BYTES);
|
||||
const bytesToRead = truncated ? PROJECT_READ_FILE_MAX_BYTES : Number(stat.size);
|
||||
const buffer = new Uint8Array(bytesToRead);
|
||||
const bytesRead = yield* handle.read(buffer).pipe(
|
||||
Effect.mapError((cause) =>
|
||||
makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: causeMessage(cause),
|
||||
cause,
|
||||
}),
|
||||
),
|
||||
);
|
||||
const fileBytes = buffer.subarray(0, Number(bytesRead));
|
||||
if (fileBytes.includes(0)) {
|
||||
return yield* makeReadFileError({
|
||||
cwd: input.cwd,
|
||||
relativePath: input.relativePath,
|
||||
detail: "Binary files cannot be previewed as text.",
|
||||
});
|
||||
}
|
||||
const contents = new TextDecoder("utf-8").decode(fileBytes);
|
||||
return {
|
||||
relativePath: target.relativePath,
|
||||
contents,
|
||||
byteLength: Number(stat.size),
|
||||
truncated,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
diff --git a/dist/editor/editor.js b/dist/editor/editor.js
|
||||
index 4346c77a4e43a98c8524ea5186559fdee7433174..bb2a7ecd1d7f497916a5f220215d5191b095575b 100644
|
||||
index e8013fc6eb6f243a6c912facf3fc0319ac66a8d0..80c82df4cdeb828bd331f5ec2f443d216bedc304 100644
|
||||
--- a/dist/editor/editor.js
|
||||
+++ b/dist/editor/editor.js
|
||||
@@ -77,16 +77,13 @@ var Editor = class {
|
||||
@@ -77,15 +77,12 @@ var Editor = class {
|
||||
this.#options = options;
|
||||
}
|
||||
edit(component) {
|
||||
- const { useTokenTransformer, enableGutterUtility, enableLineSelection, expandUnchanged, diffStyle, lineHoverHighlight,...rest } = component.options;
|
||||
- if (useTokenTransformer !== true || enableGutterUtility === true || enableLineSelection === true || expandUnchanged !== true && Object.hasOwn(component, "fileDiff") || diffStyle === "unified" || lineHoverHighlight !== "disabled") {
|
||||
+ const { useTokenTransformer, expandUnchanged, diffStyle,...rest } = component.options;
|
||||
+ if (useTokenTransformer !== true || expandUnchanged !== true && Object.hasOwn(component, "fileDiff") || diffStyle === "unified") {
|
||||
const isDiff = component.type === "file-diff";
|
||||
- if (useTokenTransformer !== true || enableGutterUtility === true || enableLineSelection === true || lineHoverHighlight !== "disabled" || expandUnchanged !== true && isDiff || diffStyle === "unified" && isDiff) {
|
||||
+ if (useTokenTransformer !== true || expandUnchanged !== true && isDiff || diffStyle === "unified" && isDiff) {
|
||||
component.setOptions({
|
||||
...rest,
|
||||
useTokenTransformer: true,
|
||||
- enableGutterUtility: false,
|
||||
- enableLineSelection: false,
|
||||
- lineHoverHighlight: "disabled",
|
||||
expandUnchanged: true,
|
||||
- diffStyle: "split",
|
||||
- lineHoverHighlight: "disabled"
|
||||
+ diffStyle: "split"
|
||||
diffStyle: "split"
|
||||
});
|
||||
component.rerender();
|
||||
}
|
||||
@@ -481,6 +478,7 @@ var Editor = class {
|
||||
@@ -511,6 +508,7 @@ var Editor = class {
|
||||
return lineNumber - 1;
|
||||
};
|
||||
this.#editorEventDisposes.push(addEventListener(gutterEl, "pointerdown", (e) => {
|
||||
@@ -47,7 +45,7 @@ index cb8e2026fb5d7a19f489c0a2402efbcb7dff3322..510fad6364d4a2214c7dd65fe2b114f1
|
||||
return merged;
|
||||
}
|
||||
diff --git a/package.json b/package.json
|
||||
index cff9c6b2a955e7568f44279a5b706da164c4f142..3d1f25f8bd1be682549677718d9ed8433872c854 100644
|
||||
index d1558633de87044b7aa96cff09443db11f163cec..c0b16f0a0bec6fba2026f24f38b2c0a8fa06af7c 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -55,6 +55,18 @@
|
||||
Generated
+354
-336
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -17,7 +17,7 @@ catalog:
|
||||
"@effect/vitest": 4.0.0-beta.78
|
||||
"@noble/curves": 1.9.1
|
||||
"@noble/hashes": 1.8.0
|
||||
"@pierre/diffs": 1.3.0-beta.4
|
||||
"@pierre/diffs": 1.3.0-beta.5
|
||||
"@types/node": 24.12.4
|
||||
"@typescript/native-preview": 7.0.0-dev.20260604.1
|
||||
"@vitest/runner": 4.1.8
|
||||
@@ -56,6 +56,7 @@ overrides:
|
||||
"@effect/vitest>@vitest/runner": "-"
|
||||
"@effect/vitest>vitest": "-"
|
||||
"@expo/metro-config": 56.0.13
|
||||
"@pierre/diffs>@shikijs/transformers": ^4.2.0
|
||||
"@types/node": "catalog:"
|
||||
effect: "catalog:"
|
||||
vite: "catalog:"
|
||||
@@ -77,7 +78,7 @@ patchedDependencies:
|
||||
"@effect/[email protected]": patches/@[email protected]
|
||||
"@expo/[email protected]": patches/@expo%[email protected]
|
||||
"@ff-labs/[email protected]": patches/@[email protected]
|
||||
"@pierre/[email protected].4": patches/@pierre%[email protected].4.patch
|
||||
"@pierre/[email protected].5": patches/@pierre%[email protected].5.patch
|
||||
[email protected]: patches/[email protected]
|
||||
[email protected]: patches/[email protected]
|
||||
|
||||
|
||||
Reference in new issue
Block a user