| author | |
| committer | |
| log | b0e85067049af72206d83b1abf8763a8cd510d18 |
| tree | 437ac8d369575347ace711f3ba262a5bf6b8d60f |
| parent | 631b7fa34235a123ba395d09d626fd5d4333cf6b |
| signature | Commit is signed but in an unrecognized format. |
10 files changed, 54 insertions(+), 45 deletions(-)
flake.nix+29-26| ... | @@ -3,31 +3,34 @@ | ... | @@ -3,31 +3,34 @@ |
| 3 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | 3 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 4 | utils.url = "github:numtide/flake-utils"; | 4 | utils.url = "github:numtide/flake-utils"; |
| 5 | }; | 5 | }; |
| 6 | outputs = inputs: inputs.utils.lib.eachDefaultSystem (system: | 6 | outputs = |
| 7 | with inputs.nixpkgs.legacyPackages.${system}; { | 7 | inputs: |
| 8 | devShells.default = pkgs.mkShell { | 8 | inputs.utils.lib.eachDefaultSystem ( |
| 9 | buildInputs = [ | 9 | system: with inputs.nixpkgs.legacyPackages.${system}; { |
| 10 | # clover sitegen v3 | 10 | devShells.default = pkgs.mkShell { |
| 11 | pkgs.nodejs_24 # runtime | 11 | buildInputs = [ |
| 12 | pkgs.deno # formatter | 12 | # clover sitegen v3 |
| 13 | pkgs.python3 # for font subsetting | 13 | pkgs.nodejs_24 # runtime |
| 14 | pkgs.deno # formatter | ||
| 15 | pkgs.python3 # for font subsetting | ||
| 14 | 16 | ||
| 15 | # paperclover.net | 17 | # paperclover.net |
| 16 | (pkgs.ffmpeg.override { | 18 | (pkgs.ffmpeg.override { |
| 17 | withOpus = true; | 19 | withOpus = true; |
| 18 | withSvtav1 = true; | 20 | withSvtav1 = true; |
| 19 | withJxl = true; | 21 | withJxl = true; |
| 20 | withWebp = true; | 22 | withWebp = true; |
| 21 | }) | 23 | }) |
| 22 | pkgs.rsync | 24 | pkgs.rsync |
| 23 | ]; | 25 | ]; |
| 24 | }; | 26 | }; |
| 25 | devShells.min = pkgs.mkShell { | 27 | devShells.min = pkgs.mkShell { |
| 26 | buildInputs = [ | 28 | buildInputs = [ |
| 27 | pkgs.nodejs_24 # runtime | 29 | pkgs.nodejs_24 # runtime |
| 28 | pkgs.deno # formatter | 30 | pkgs.deno # formatter |
| 29 | pkgs.rsync | 31 | pkgs.rsync |
| 30 | ]; | 32 | ]; |
| 31 | }; | 33 | }; |
| 32 | }); | 34 | } |
| 35 | ); | ||
| 33 | } | 36 | } |
framework/bundle.ts+1-1| ... | @@ -178,7 +178,7 @@ export async function bundleServerJavaScript({ | ... | @@ -178,7 +178,7 @@ export async function bundleServerJavaScript({ |
| 178 | `export const metaTemplate = {`, | 178 | `export const metaTemplate = {`, |
| 179 | ` base: new URL(${JSON.stringify(metaTemplate.base)}),`, | 179 | ` base: new URL(${JSON.stringify(metaTemplate.base)}),`, |
| 180 | ...Object.entries(metaTemplate) | 180 | ...Object.entries(metaTemplate) |
| 181 | .filter(([k]) => k !== 'base') | 181 | .filter(([k]) => k !== "base") |
| 182 | .map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`), | 182 | .map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`), |
| 183 | `};`, | 183 | `};`, |
| 184 | ].join("\n"), | 184 | ].join("\n"), |
framework/generate.ts+6-4| ... | @@ -237,10 +237,12 @@ export async function preparePage( | ... | @@ -237,10 +237,12 @@ export async function preparePage( |
| 237 | // -- metadata -- | 237 | // -- metadata -- |
| 238 | const renderedMetaPromise = Promise.resolve( | 238 | const renderedMetaPromise = Promise.resolve( |
| 239 | typeof metadata === "function" ? metadata({ ssr: true }) : metadata, | 239 | typeof metadata === "function" ? metadata({ ssr: true }) : metadata, |
| 240 | ).then((m) => meta.render({ | 240 | ).then((m) => |
| 241 | canonical: item.id, | 241 | meta.render({ |
| 242 | ...m, | 242 | canonical: item.id, |
| 243 | }, metaTemplate)); | 243 | ...m, |
| 244 | }, metaTemplate) | ||
| 245 | ); | ||
| 244 | 246 | ||
| 245 | // -- html -- | 247 | // -- html -- |
| 246 | let page = render.element(Page); | 248 | let page = render.element(Page); |
framework/lib/assets.ts+5-5| ... | @@ -82,7 +82,7 @@ export async function serveAsset( | ... | @@ -82,7 +82,7 @@ export async function serveAsset( |
| 82 | c: Context, | 82 | c: Context, |
| 83 | id: Key, | 83 | id: Key, |
| 84 | status: StatusCode = 200, | 84 | status: StatusCode = 200, |
| 85 | cache: CacheMode = 'auto', | 85 | cache: CacheMode = "auto", |
| 86 | ) { | 86 | ) { |
| 87 | return assetInner( | 87 | return assetInner( |
| 88 | c, | 88 | c, |
| ... | @@ -177,11 +177,11 @@ function respondWithBufferAndViews( | ... | @@ -177,11 +177,11 @@ function respondWithBufferAndViews( |
| 177 | if (!Object.keys(headers).some((x) => x.toLowerCase() === "cache-control")) { | 177 | if (!Object.keys(headers).some((x) => x.toLowerCase() === "cache-control")) { |
| 178 | if (cache === "auto") { | 178 | if (cache === "auto") { |
| 179 | if (status < 200 || status >= 300) { | 179 | if (status < 200 || status >= 300) { |
| 180 | cache = 'no-cache'; | 180 | cache = "no-cache"; |
| 181 | } else if (headers['content-type']?.includes('text/html')) { | 181 | } else if (headers["content-type"]?.includes("text/html")) { |
| 182 | cache = 'temporary'; | 182 | cache = "temporary"; |
| 183 | } else { | 183 | } else { |
| 184 | cache = 'long-term'; | 184 | cache = "long-term"; |
| 185 | } | 185 | } |
| 186 | } | 186 | } |
| 187 | if (cache === "no-cache") { | 187 | if (cache === "no-cache") { |
framework/lib/sitegen.ts+1-1| ... | @@ -48,7 +48,7 @@ export interface Font { | ... | @@ -48,7 +48,7 @@ export interface Font { |
| 48 | } | 48 | } |
| 49 | export type FontVars = Record<string, FontVariableAxis>; | 49 | export type FontVars = Record<string, FontVariableAxis>; |
| 50 | export type FontVariableAxis = number | [min: number, max: number]; | 50 | export type FontVariableAxis = number | [min: number, max: number]; |
| 51 | export type FontRange = string | number | { start: number, end: number }; | 51 | export type FontRange = string | number | { start: number; end: number }; |
| 52 | 52 | ||
| 53 | export const userData = render.userData<SitegenRender>(() => { | 53 | export const userData = render.userData<SitegenRender>(() => { |
| 54 | throw new Error("This function can only be used in a page (static or view)"); | 54 | throw new Error("This function can only be used in a page (static or view)"); |
framework/lib/subprocess.ts+2-2| ... | @@ -11,5 +11,5 @@ export const exec: typeof execFileRaw = (( | ... | @@ -11,5 +11,5 @@ export const exec: typeof execFileRaw = (( |
| 11 | throw e; | 11 | throw e; |
| 12 | })) as any; | 12 | })) as any; |
| 13 | 13 | ||
| 14 | import * as util from 'node:util'; | 14 | import * as util from "node:util"; |
| 15 | import * as child_process from 'node:child_process'; | 15 | import * as child_process from "node:child_process"; |
framework/watch.ts+1-1| ... | @@ -25,7 +25,7 @@ function serve() { | ... | @@ -25,7 +25,7 @@ function serve() { |
| 25 | "--development", | 25 | "--development", |
| 26 | ], { | 26 | ], { |
| 27 | stdio: "inherit", | 27 | stdio: "inherit", |
| 28 | execArgv: ['--no-warnings'], | 28 | execArgv: ["--no-warnings"], |
| 29 | }); | 29 | }); |
| 30 | subprocess.on("close", onSubprocessClose); | 30 | subprocess.on("close", onSubprocessClose); |
| 31 | } | 31 | } |
readme.md+2-1| ... | @@ -12,7 +12,8 @@ that assist building websites. these tools power <https://paperclover.net>. | ... | @@ -12,7 +12,8 @@ that assist building websites. these tools power <https://paperclover.net>. |
| 12 | components, `<Suspense />`, and custom extensions. | 12 | components, `<Suspense />`, and custom extensions. |
| 13 | - **Incremental static site generator and build system.** | 13 | - **Incremental static site generator and build system.** |
| 14 | - Build both development and production sites on startup start. Incremental | 14 | - Build both development and production sites on startup start. Incremental |
| 15 | generator rebuilds changed pages; Build system state survives coding sessions. | 15 | generator rebuilds changed pages; Build system state survives coding |
| 16 | sessions. | ||
| 16 | - Multiple backend support. | 17 | - Multiple backend support. |
| 17 | - (TODO) Tests, Lints, and Type-checking is run alongside, and only re-runs | 18 | - (TODO) Tests, Lints, and Type-checking is run alongside, and only re-runs |
| 18 | checks when the files change. For example, changing a component re-tests | 19 | checks when the files change. For example, changing a component re-tests |
run.js+3-3| ... | @@ -27,8 +27,8 @@ try { | ... | @@ -27,8 +27,8 @@ try { |
| 27 | const brand = process.versions.bun | 27 | const brand = process.versions.bun |
| 28 | ? `bun ${process.versions.bun}` | 28 | ? `bun ${process.versions.bun}` |
| 29 | : process.versions.deno | 29 | : process.versions.deno |
| 30 | ? `deno ${process.versions.deno}` | 30 | ? `deno ${process.versions.deno}` |
| 31 | : null; | 31 | : null; |
| 32 | const brandText = brand ? ` (${brand})` : ""; | 32 | const brandText = brand ? ` (${brand})` : ""; |
| 33 | globalThis.console.error( | 33 | globalThis.console.error( |
| 34 | `sitegen depends on a node.js v24. your runtime is missing features.\n` + | 34 | `sitegen depends on a node.js v24. your runtime is missing features.\n` + |
| ... | @@ -91,7 +91,7 @@ if (process.argv[1].startsWith(import.meta.filename.slice(0, -".js".length))) { | ... | @@ -91,7 +91,7 @@ if (process.argv[1].startsWith(import.meta.filename.slice(0, -".js".length))) { |
| 91 | ); | 91 | ); |
| 92 | } else { | 92 | } else { |
| 93 | console.warn( | 93 | console.warn( |
| 94 | hot.load("path").relative('.', found), | 94 | hot.load("path").relative(".", found), |
| 95 | 'does not export a "main" function', | 95 | 'does not export a "main" function', |
| 96 | ); | 96 | ); |
| 97 | } | 97 | } |
src/site.ts+4-1| ... | @@ -92,7 +92,10 @@ export const fonts: sg.Font[] = [ | ... | @@ -92,7 +92,10 @@ export const fonts: sg.Font[] = [ |
| 92 | name: "AT Name Sans Display Hairline", | 92 | name: "AT Name Sans Display Hairline", |
| 93 | sources: [ | 93 | sources: [ |
| 94 | "ATNameSansDisplay-Hairline.woff2", | 94 | "ATNameSansDisplay-Hairline.woff2", |
| 95 | path.join(fontRoot, "/ArrowType/AT Name Sans Display/ATNameSansDisplay-Hairline.woff2"), | 95 | path.join( |
| 96 | fontRoot, | ||
| 97 | "/ArrowType/AT Name Sans Display/ATNameSansDisplay-Hairline.woff2", | ||
| 98 | ), | ||
| 96 | ], | 99 | ], |
| 97 | subsets: [ | 100 | subsets: [ |
| 98 | { | 101 | { |