]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
remove unnecessary tests and interface
authorCameron Otsuka <cameron@otsuka.haus>
Mon, 13 Apr 2026 02:04:13 +0000 (19:04 -0700)
committerCameron Otsuka <cameron@otsuka.haus>
Mon, 13 Apr 2026 02:04:13 +0000 (19:04 -0700)
astro.config.mjs
bun.lock
content/articles/bitcoin-mempools-cleared-is-nobody-using-bitcoin/index.mdx
content/podcasts/mine-print-hash-2026-14.mdx
content/podcasts/mine-print-hash-2026-15.mdx
src/components/ui/figure.astro
src/utils/__tests__/formatDate.test.ts [deleted file]
src/utils/__tests__/generateStarRating.test.ts [deleted file]
src/utils/__tests__/sortByDate.test.ts [deleted file]
src/utils/sortByDate.ts

index a6e9125be81bcfe6bd2601cbd39876905f5fe9fe..5b8466c99d59c9220c37c7ce59423fcf4eba3fa8 100644 (file)
@@ -72,8 +72,8 @@ export default defineConfig({
         jpeg: { mozjpeg: true, progressive: true, quality: 75 },
         webp: { quality: 75, effort: 4, alphaQuality: 80 },
         avif: { quality: 50, effort: 2 },
-      }
-    }
+      },
+    },
   },
   vite: {
     build: {
index 61a6ba193340e138df3669f2515f81bc05b2bcfd..3ca69073c3610efafa81ab1af3abce5990974e7a 100644 (file)
--- a/bun.lock
+++ b/bun.lock
@@ -9,11 +9,11 @@
         "@astrojs/rss": "4.0.18",
         "@astrojs/sitemap": "3.7.2",
         "@iconify-json/mdi": "^1.2.3",
-        "@pagefind/component-ui": "^1.5.0",
+        "@pagefind/component-ui": "^1.5.2",
         "@vercel/og": "^0.8.6",
         "astro": "6.1.5",
         "astro-icon": "^1.1.5",
-        "pagefind": "^1.5.0",
+        "pagefind": "^1.5.2",
       },
       "devDependencies": {
         "@astrojs/check": "0.9.8",
index 8906c76039be76258093ceebcaba64c198e979e2..e71ef363d825dbf188984d840b698df361287463 100644 (file)
@@ -107,10 +107,7 @@ We haven't seen a significant decline in total hashrate, despite hashprice decre
   Index](https://data.hashrateindex.com/network-data/bitcoin-hashprice-index).
 </Figure>
 
-<Figure
-  image={hashrate2yr}
-  alt="Bitcoin hashrate over the last 2 years"
->
+<Figure image={hashrate2yr} alt="Bitcoin hashrate over the last 2 years">
   Bitcoin hashrate over the last 2 years. Data from 2023-02-08 through
   2025-02-07. Source:
   [mempool.space](https://mempool.space/graphs/mining/hashrate-difficulty#2y).
index 65d9666f2dbb3ad4c30f82139eba14d8314be573..4903c7542621a4aef9de0da0ae361d27be3520f7 100644 (file)
@@ -1,6 +1,6 @@
 ---
 type: video
-title: "The Return of Productive American Growth: Artemis, Oil Flippening, and Credit Expansion"
+title: 'The Return of Productive American Growth: Artemis, Oil Flippening, and Credit Expansion'
 date: 2026-04-02
 modified: 2026-04-02
 description: 'Mine, Print, Hash - 2026 Week #14'
index cb1c7edb8465559b6992a02363b10a2a1224cd00..cd1a87894e7febd063063843634c7b89b1fec98f 100644 (file)
@@ -1,6 +1,6 @@
 ---
 type: video
-title: "Ceasefire and Contagion: Factions Against Iran Peace & FX, Sovereign Debt, and Commodity Spillovers"
+title: 'Ceasefire and Contagion: Factions Against Iran Peace & FX, Sovereign Debt, and Commodity Spillovers'
 date: 2026-04-09
 modified: 2026-04-09
 description: 'Mine, Print, Hash - 2026 Week #15'
index 0ed2c0709bd6e7772e6b3e8d08ab425a771469ab..e90794e51975328e43b66bcab73a5a4729746d59 100644 (file)
@@ -1,12 +1,12 @@
 ---
 import { Picture } from 'astro:assets';
-import type { ImageLayout, ImageMetadata } from 'astro';
+import type { ImageMetadata } from 'astro';
 
 interface Props {
   image: ImageMetadata;
   alt: string;
   formats?: string[];
-  layout?: ImageLayout;
+  layout?: 'constrained' | 'full-width' | 'fixed' | 'none';
 }
 
 const { image, alt, formats = ['avif', 'webp'], layout } = Astro.props;
diff --git a/src/utils/__tests__/formatDate.test.ts b/src/utils/__tests__/formatDate.test.ts
deleted file mode 100644 (file)
index 0473915..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-import { describe, it, expect } from 'bun:test';
-import formatDate from '../formatDate';
-
-describe('formatDate', () => {
-  it('formats date as YYYY-MM-DD', () => {
-    const date = new Date(Date.UTC(2024, 2, 15)); // March 15, 2024
-    expect(formatDate(date)).toBe('2024-03-15');
-  });
-
-  it('pads single-digit months with zero', () => {
-    const date = new Date(Date.UTC(2024, 0, 1)); // January 1, 2024
-    expect(formatDate(date)).toBe('2024-01-01');
-  });
-
-  it('pads single-digit days with zero', () => {
-    const date = new Date(Date.UTC(2024, 11, 5)); // December 5, 2024
-    expect(formatDate(date)).toBe('2024-12-05');
-  });
-
-  it('handles year boundaries correctly', () => {
-    const date = new Date(Date.UTC(2023, 11, 31)); // December 31, 2023
-    expect(formatDate(date)).toBe('2023-12-31');
-  });
-});
diff --git a/src/utils/__tests__/generateStarRating.test.ts b/src/utils/__tests__/generateStarRating.test.ts
deleted file mode 100644 (file)
index f2df478..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-import { describe, it, expect } from 'bun:test';
-import generateStarRating from '../generateStarRating';
-
-describe('generateStarRating', () => {
-  it('returns 5 filled stars for rating 5', () => {
-    expect(generateStarRating(5)).toBe('★★★★★');
-  });
-
-  it('returns 1 filled and 4 empty stars for rating 1', () => {
-    expect(generateStarRating(1)).toBe('★☆☆☆☆');
-  });
-
-  it('returns 3 filled and 2 empty stars for rating 3', () => {
-    expect(generateStarRating(3)).toBe('★★★☆☆');
-  });
-
-  it('throws for rating 0', () => {
-    expect(() => generateStarRating(0)).toThrow(
-      'Invalid rating: 0. Must be an integer between 1 and 5.',
-    );
-  });
-
-  it('throws for rating 6', () => {
-    expect(() => generateStarRating(6)).toThrow(
-      'Invalid rating: 6. Must be an integer between 1 and 5.',
-    );
-  });
-
-  it('throws for non-integer rating', () => {
-    expect(() => generateStarRating(3.5)).toThrow(
-      'Invalid rating: 3.5. Must be an integer between 1 and 5.',
-    );
-  });
-
-  it('throws for negative rating', () => {
-    expect(() => generateStarRating(-1)).toThrow(
-      'Invalid rating: -1. Must be an integer between 1 and 5.',
-    );
-  });
-});
diff --git a/src/utils/__tests__/sortByDate.test.ts b/src/utils/__tests__/sortByDate.test.ts
deleted file mode 100644 (file)
index 146af37..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-import { describe, it, expect } from 'bun:test';
-import sortByDate from '../sortByDate';
-
-// Mock type for testing - matches the HasDate interface expected by sortByDate
-interface MockEntry {
-  data: { date: Date };
-}
-
-describe('sortByDate', () => {
-  it('sorts items by date in descending order (newest first)', () => {
-    const items: MockEntry[] = [
-      { data: { date: new Date('2024-01-15') } },
-      { data: { date: new Date('2024-03-20') } },
-      { data: { date: new Date('2024-02-10') } },
-    ];
-
-    const sorted = sortByDate(items);
-
-    expect(sorted[0].data.date.getTime()).toBe(
-      new Date('2024-03-20').getTime(),
-    );
-    expect(sorted[1].data.date.getTime()).toBe(
-      new Date('2024-02-10').getTime(),
-    );
-    expect(sorted[2].data.date.getTime()).toBe(
-      new Date('2024-01-15').getTime(),
-    );
-  });
-
-  it('handles items with same date', () => {
-    const items: MockEntry[] = [
-      { data: { date: new Date('2024-01-15') } },
-      { data: { date: new Date('2024-01-15') } },
-    ];
-
-    const sorted = sortByDate(items);
-
-    expect(sorted).toHaveLength(2);
-  });
-
-  it('returns empty array for empty input', () => {
-    const sorted = sortByDate([]);
-    expect(sorted).toEqual([]);
-  });
-
-  it('handles single item array', () => {
-    const items: MockEntry[] = [{ data: { date: new Date('2024-01-15') } }];
-
-    const sorted = sortByDate(items);
-
-    expect(sorted).toHaveLength(1);
-  });
-
-  it('does not mutate original array', () => {
-    const items: MockEntry[] = [
-      { data: { date: new Date('2024-01-01') } },
-      { data: { date: new Date('2024-03-01') } },
-    ];
-    const originalFirst = items[0];
-
-    sortByDate(items);
-
-    expect(items[0]).toBe(originalFirst);
-  });
-});
index 2dd18dd9b062e44a08fbd5395300b22ab569a1d1..7eb91e6b0ecefbba906f86574c793234432e1388 100644 (file)
@@ -1,8 +1,8 @@
-interface HasDate {
-  data: { date: Date };
-}
+import { type SiteCollectionEntry } from '@utils/globals';
 
-export default function sortByDate<T extends HasDate>(items: T[]): T[] {
+export default function sortByDate<T extends SiteCollectionEntry>(
+  items: T[],
+): T[] {
   return [...items].sort(
     (a, b) => b.data.date.getTime() - a.data.date.getTime(),
   );