| 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 | 3 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
| 4 | 4 | utils.url = "github:numtide/flake-utils"; |
| 5 | 5 | }; |
| 6 | outputs = inputs: inputs.utils.lib.eachDefaultSystem (system: | |
| 7 | with inputs.nixpkgs.legacyPackages.${system}; { | |
| 8 | devShells.default = pkgs.mkShell { | |
| 9 | buildInputs = [ | |
| 10 | # clover sitegen v3 | |
| 11 | pkgs.nodejs_24 # runtime | |
| 12 | pkgs.deno # formatter | |
| 13 | pkgs.python3 # for font subsetting | |
| 6 | outputs = | |
| 7 | inputs: | |
| 8 | inputs.utils.lib.eachDefaultSystem ( | |
| 9 | system: with inputs.nixpkgs.legacyPackages.${system}; { | |
| 10 | devShells.default = pkgs.mkShell { | |
| 11 | buildInputs = [ | |
| 12 | # clover sitegen v3 | |
| 13 | pkgs.nodejs_24 # runtime | |
| 14 | pkgs.deno # formatter | |
| 15 | pkgs.python3 # for font subsetting | |
| 14 | 16 | |
| 15 | # paperclover.net | |
| 16 | (pkgs.ffmpeg.override { | |
| 17 | withOpus = true; | |
| 18 | withSvtav1 = true; | |
| 19 | withJxl = true; | |
| 20 | withWebp = true; | |
| 21 | }) | |
| 22 | pkgs.rsync | |
| 23 | ]; | |
| 24 | }; | |
| 25 | devShells.min = pkgs.mkShell { | |
| 26 | buildInputs = [ | |
| 27 | pkgs.nodejs_24 # runtime | |
| 28 | pkgs.deno # formatter | |
| 29 | pkgs.rsync | |
| 30 | ]; | |
| 31 | }; | |
| 32 | }); | |
| 17 | # paperclover.net | |
| 18 | (pkgs.ffmpeg.override { | |
| 19 | withOpus = true; | |
| 20 | withSvtav1 = true; | |
| 21 | withJxl = true; | |
| 22 | withWebp = true; | |
| 23 | }) | |
| 24 | pkgs.rsync | |
| 25 | ]; | |
| 26 | }; | |
| 27 | devShells.min = pkgs.mkShell { | |
| 28 | buildInputs = [ | |
| 29 | pkgs.nodejs_24 # runtime | |
| 30 | pkgs.deno # formatter | |
| 31 | pkgs.rsync | |
| 32 | ]; | |
| 33 | }; | |
| 34 | } | |
| 35 | ); | |
| 33 | 36 | } |
framework/bundle.ts+1-1| ... | ... | @@ -178,7 +178,7 @@ export async function bundleServerJavaScript({ |
| 178 | 178 | `export const metaTemplate = {`, |
| 179 | 179 | ` base: new URL(${JSON.stringify(metaTemplate.base)}),`, |
| 180 | 180 | ...Object.entries(metaTemplate) |
| 181 | .filter(([k]) => k !== 'base') | |
| 181 | .filter(([k]) => k !== "base") | |
| 182 | 182 | .map(([k, v]) => ` ${JSON.stringify(k)}: ${JSON.stringify(v)},`), |
| 183 | 183 | `};`, |
| 184 | 184 | ].join("\n"), |
framework/generate.ts+6-4| ... | ... | @@ -237,10 +237,12 @@ export async function preparePage( |
| 237 | 237 | // -- metadata -- |
| 238 | 238 | const renderedMetaPromise = Promise.resolve( |
| 239 | 239 | typeof metadata === "function" ? metadata({ ssr: true }) : metadata, |
| 240 | ).then((m) => meta.render({ | |
| 241 | canonical: item.id, | |
| 242 | ...m, | |
| 243 | }, metaTemplate)); | |
| 240 | ).then((m) => | |
| 241 | meta.render({ | |
| 242 | canonical: item.id, | |
| 243 | ...m, | |
| 244 | }, metaTemplate) | |
| 245 | ); | |
| 244 | 246 | |
| 245 | 247 | // -- html -- |
| 246 | 248 | let page = render.element(Page); |
framework/lib/assets.ts+5-5| ... | ... | @@ -82,7 +82,7 @@ export async function serveAsset( |
| 82 | 82 | c: Context, |
| 83 | 83 | id: Key, |
| 84 | 84 | status: StatusCode = 200, |
| 85 | cache: CacheMode = 'auto', | |
| 85 | cache: CacheMode = "auto", | |
| 86 | 86 | ) { |
| 87 | 87 | return assetInner( |
| 88 | 88 | c, |
| ... | ... | @@ -177,11 +177,11 @@ function respondWithBufferAndViews( |
| 177 | 177 | if (!Object.keys(headers).some((x) => x.toLowerCase() === "cache-control")) { |
| 178 | 178 | if (cache === "auto") { |
| 179 | 179 | if (status < 200 || status >= 300) { |
| 180 | cache = 'no-cache'; | |
| 181 | } else if (headers['content-type']?.includes('text/html')) { | |
| 182 | cache = 'temporary'; | |
| 180 | cache = "no-cache"; | |
| 181 | } else if (headers["content-type"]?.includes("text/html")) { | |
| 182 | cache = "temporary"; | |
| 183 | 183 | } else { |
| 184 | cache = 'long-term'; | |
| 184 | cache = "long-term"; | |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | if (cache === "no-cache") { |
framework/lib/sitegen.ts+1-1| ... | ... | @@ -48,7 +48,7 @@ export interface Font { |
| 48 | 48 | } |
| 49 | 49 | export type FontVars = Record<string, FontVariableAxis>; |
| 50 | 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 | 53 | export const userData = render.userData<SitegenRender>(() => { |
| 54 | 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 | 11 | throw e; |
| 12 | 12 | })) as any; |
| 13 | 13 | |
| 14 | import * as util from 'node:util'; | |
| 15 | import * as child_process from 'node:child_process'; | |
| 14 | import * as util from "node:util"; | |
| 15 | import * as child_process from "node:child_process"; |
framework/watch.ts+1-1| ... | ... | @@ -25,7 +25,7 @@ function serve() { |
| 25 | 25 | "--development", |
| 26 | 26 | ], { |
| 27 | 27 | stdio: "inherit", |
| 28 | execArgv: ['--no-warnings'], | |
| 28 | execArgv: ["--no-warnings"], | |
| 29 | 29 | }); |
| 30 | 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 | 12 | components, `<Suspense />`, and custom extensions. |
| 13 | 13 | - **Incremental static site generator and build system.** |
| 14 | 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 | 17 | - Multiple backend support. |
| 17 | 18 | - (TODO) Tests, Lints, and Type-checking is run alongside, and only re-runs |
| 18 | 19 | checks when the files change. For example, changing a component re-tests |
run.js+3-3| ... | ... | @@ -27,8 +27,8 @@ try { |
| 27 | 27 | const brand = process.versions.bun |
| 28 | 28 | ? `bun ${process.versions.bun}` |
| 29 | 29 | : process.versions.deno |
| 30 | ? `deno ${process.versions.deno}` | |
| 31 | : null; | |
| 30 | ? `deno ${process.versions.deno}` | |
| 31 | : null; | |
| 32 | 32 | const brandText = brand ? ` (${brand})` : ""; |
| 33 | 33 | globalThis.console.error( |
| 34 | 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 | 91 | ); |
| 92 | 92 | } else { |
| 93 | 93 | console.warn( |
| 94 | hot.load("path").relative('.', found), | |
| 94 | hot.load("path").relative(".", found), | |
| 95 | 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 | 92 | name: "AT Name Sans Display Hairline", |
| 93 | 93 | sources: [ |
| 94 | 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 | 100 | subsets: [ |
| 98 | 101 | { |