| author | |
| committer | |
| log | 3caa2f2be2dca66f2a3f44d3a85a4bf7c7270534 |
| tree | b624485e6b46ab0684a61b3aa00be40209928e74 |
| parent | 6d7576c0766ee4fd023aae3db1fc4ca9f35e9791 |
| signature | Signed by SSH key SHA256:xbd+BjjhyBfwk7GVoURf9Yx0gzDerHbvYv7SddNWmAs |
- `@/file.ts` -> `#src/file.ts` matching Node.js standards
- `lib` -> `@clo/lib` matching what i publish it as65 files changed, 169 insertions(+), 209 deletions(-)
framework/backend/entry-node.ts+1-1| ... | ... | @@ -42,4 +42,4 @@ import * as os from "os"; |
| 42 | 42 | import * as url from "node:url"; |
| 43 | 43 | import { serve } from "@hono/node-server"; |
| 44 | 44 | import process from "node:process"; |
| 45 | import * as console from "lib/log.ts"; | |
| 45 | import * as console from "@clo/lib/log.ts"; |
framework/bundle.ts+4-7| ... | ... | @@ -37,7 +37,6 @@ export async function bundleClientJavaScript( |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | const clientPlugins: esbuild.Plugin[] = [ |
| 40 | projectRelativeResolution(), | |
| 41 | 40 | markoViaBuildCache(), |
| 42 | 41 | { |
| 43 | 42 | name: "mark css external", |
| ... | ... | @@ -250,7 +249,6 @@ export async function bundleServerJavaScript({ |
| 250 | 249 | return view.file; |
| 251 | 250 | }, |
| 252 | 251 | }), |
| 253 | projectRelativeResolution(), | |
| 254 | 252 | markoViaBuildCache(), |
| 255 | 253 | { |
| 256 | 254 | name: "replace client references", |
| ... | ... | @@ -301,7 +299,7 @@ export async function bundleServerJavaScript({ |
| 301 | 299 | "globalThis.CLOVER_SERVER_ENTRY": JSON.stringify(entry), |
| 302 | 300 | }, |
| 303 | 301 | external: Object.keys(pkg.dependencies).filter( |
| 304 | (x) => x !== "lib", | |
| 302 | (x) => x !== "@clo/lib", | |
| 305 | 303 | ), |
| 306 | 304 | }); |
| 307 | 305 | await trackEsbuild(io, metafile); |
| ... | ... | @@ -391,7 +389,6 @@ import * as hot from "./hot.ts"; |
| 391 | 389 | import { |
| 392 | 390 | isIgnoredSource, |
| 393 | 391 | markoViaBuildCache, |
| 394 | projectRelativeResolution, | |
| 395 | 392 | virtualFiles, |
| 396 | 393 | } from "./esbuild-support.ts"; |
| 397 | 394 | import { Io, toAbs } from "./incremental.ts"; |
| ... | ... | @@ -400,6 +397,6 @@ import * as incr from "./incremental.ts"; |
| 400 | 397 | import * as sg from "#sitegen"; |
| 401 | 398 | import type { PageOrView } from "./generate.ts"; |
| 402 | 399 | import type * as view from "#sitegen/view"; |
| 403 | import * as meta from "lib/render/meta.ts"; | |
| 404 | import * as progress from "lib/progress.ts"; | |
| 405 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 400 | import * as meta from "@clo/lib/render/meta.ts"; | |
| 401 | import * as progress from "@clo/lib/progress.ts"; | |
| 402 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
framework/css.ts+1-1| ... | ... | @@ -116,4 +116,4 @@ import * as hot from "./hot.ts"; |
| 116 | 116 | import * as path from "node:path"; |
| 117 | 117 | import { virtualFiles } from "./esbuild-support.ts"; |
| 118 | 118 | import type { Io } from "./incremental.ts"; |
| 119 | import { UNWRAP } from "lib/assert.ts"; | |
| 119 | import { UNWRAP } from "@clo/lib/assert.ts"; |
framework/esbuild-support.ts+1-19| ... | ... | @@ -61,24 +61,6 @@ export function banFiles( |
| 61 | 61 | } satisfies esbuild.Plugin; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | export function projectRelativeResolution(root = process.cwd() + "/src") { | |
| 65 | return { | |
| 66 | name: "project relative resolution ('@/' prefix)", | |
| 67 | setup(b) { | |
| 68 | b.onResolve({ filter: /^@\// }, ({ path: id }) => { | |
| 69 | return { | |
| 70 | path: path.resolve(root, id.slice(2)), | |
| 71 | }; | |
| 72 | }); | |
| 73 | b.onResolve({ filter: /^#/ }, ({ path: id, importer }) => { | |
| 74 | return { | |
| 75 | path: hot.resolveFrom(importer, id), | |
| 76 | }; | |
| 77 | }); | |
| 78 | }, | |
| 79 | } satisfies esbuild.Plugin; | |
| 80 | } | |
| 81 | ||
| 82 | 64 | export function markoViaBuildCache(): esbuild.Plugin { |
| 83 | 65 | return { |
| 84 | 66 | name: "marko via build cache", |
| ... | ... | @@ -112,7 +94,7 @@ export function isIgnoredSource(source: string) { |
| 112 | 94 | } |
| 113 | 95 | |
| 114 | 96 | import * as esbuild from "esbuild"; |
| 115 | import * as string from "lib/string.ts"; | |
| 97 | import * as string from "@clo/lib/string.ts"; | |
| 116 | 98 | import * as path from "node:path"; |
| 117 | 99 | import * as fs from "#sitegen/fs"; |
| 118 | 100 | import * as hot from "./hot.ts"; |
framework/font.ts+5-5| ... | ... | @@ -143,7 +143,7 @@ export async function fetchFont(name: string, sources: string[]) { |
| 143 | 143 | : process.platform === "darwin" |
| 144 | 144 | ? [ |
| 145 | 145 | "/Library/Fonts", |
| 146 | path.posix.join(home, "Library/Fonts"), | |
| 146 | path.posix.join(home, "@clo/library/Fonts"), | |
| 147 | 147 | ] |
| 148 | 148 | : [ |
| 149 | 149 | "/usr/share/fonts", |
| ... | ... | @@ -211,10 +211,10 @@ import * as fs from "#sitegen/fs"; |
| 211 | 211 | import * as os from "node:os"; |
| 212 | 212 | import * as path from "node:path"; |
| 213 | 213 | import * as sg from "#sitegen"; |
| 214 | import * as subprocess from "lib/subprocess.ts"; | |
| 214 | import * as subprocess from "@clo/lib/subprocess.ts"; | |
| 215 | 215 | import * as incr from "./incremental.ts"; |
| 216 | 216 | import * as crypto from "node:crypto"; |
| 217 | import * as async from "lib/async.ts"; | |
| 218 | import * as error from "lib/error.ts"; | |
| 217 | import * as async from "@clo/lib/async.ts"; | |
| 218 | import * as error from "@clo/lib/error.ts"; | |
| 219 | 219 | import * as progress from "../lib/progress.ts"; |
| 220 | import { ASSERT } from "lib/assert.ts"; | |
| 220 | import { ASSERT } from "@clo/lib/assert.ts"; |
framework/generate.ts+4-4| ... | ... | @@ -414,12 +414,12 @@ export type PageOrView = PreparedPage | PreparedView; |
| 414 | 414 | import * as path from "node:path"; |
| 415 | 415 | |
| 416 | 416 | import * as fs from "#sitegen/fs"; |
| 417 | import * as meta from "lib/render/meta.ts"; | |
| 418 | import * as render from "lib/render.ts"; | |
| 417 | import * as meta from "@clo/lib/render/meta.ts"; | |
| 418 | import * as render from "@clo/lib/render.ts"; | |
| 419 | 419 | import * as sg from "#sitegen"; |
| 420 | 420 | import type { FileItem } from "#sitegen"; |
| 421 | 421 | import * as progress from "../lib/progress.ts"; |
| 422 | import * as error from "lib/error.ts"; | |
| 422 | import * as error from "@clo/lib/error.ts"; | |
| 423 | 423 | |
| 424 | 424 | import SitegenWrap from "./sitegen-wrap.marko"; |
| 425 | 425 | |
| ... | ... | @@ -429,4 +429,4 @@ import * as fonts from "./font.ts"; |
| 429 | 429 | import * as hot from "./hot.ts"; |
| 430 | 430 | import * as incr from "./incremental.ts"; |
| 431 | 431 | import { Io } from "./incremental.ts"; |
| 432 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 432 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
framework/hot.ts+1-20| ... | ... | @@ -90,25 +90,6 @@ Module.prototype._compile = function ( |
| 90 | 90 | return result; |
| 91 | 91 | }; |
| 92 | 92 | |
| 93 | // Implement @/ prefix | |
| 94 | const ModuleUnderscoreResolveFilename = Module._resolveFilename; | |
| 95 | Module._resolveFilename = (...args) => { | |
| 96 | if (args[0].startsWith("@/")) { | |
| 97 | const replacedPath = "." + args[0].slice(1); | |
| 98 | try { | |
| 99 | return require.resolve(replacedPath, { paths: [projectSrc] }); | |
| 100 | } catch (err: any) { | |
| 101 | if ( | |
| 102 | err.code === "MODULE_NOT_FOUND" && | |
| 103 | (err?.requireStack?.length ?? 0) <= 1 | |
| 104 | ) { | |
| 105 | err.message.replace(replacedPath, args[0]); | |
| 106 | } | |
| 107 | } | |
| 108 | } | |
| 109 | return ModuleUnderscoreResolveFilename(...args); | |
| 110 | }; | |
| 111 | ||
| 112 | 93 | function loadEsbuild(module: NodeJS.Module, filepath: string) { |
| 113 | 94 | return loadEsbuildCode(module, filepath, fs.readFileSync(filepath, "utf8")); |
| 114 | 95 | } |
| ... | ... | @@ -323,4 +304,4 @@ import * as esbuild from "esbuild"; |
| 323 | 304 | import { createRequire } from "node:module"; |
| 324 | 305 | import * as self from "./hot.ts"; |
| 325 | 306 | import { Buffer } from "node:buffer"; |
| 326 | import { UNWRAP } from "lib/assert.ts"; | |
| 307 | import { UNWRAP } from "@clo/lib/assert.ts"; |
framework/incremental.ts+5-5| ... | ... | @@ -728,7 +728,7 @@ const zstdCompress = util.promisify(zlib.zstdCompress); |
| 728 | 728 | import * as hot from "./hot.ts"; |
| 729 | 729 | |
| 730 | 730 | import * as fs from "#sitegen/fs"; |
| 731 | import * as mime from "lib/mime.ts"; | |
| 731 | import * as mime from "@clo/lib/mime.ts"; | |
| 732 | 732 | import * as manifest from "#sitegen/assets"; |
| 733 | 733 | |
| 734 | 734 | import * as path from "node:path"; |
| ... | ... | @@ -736,9 +736,9 @@ import * as util from "node:util"; |
| 736 | 736 | import * as crypto from "node:crypto"; |
| 737 | 737 | import * as zlib from "node:zlib"; |
| 738 | 738 | |
| 739 | import * as progress from "lib/progress.ts"; | |
| 740 | import * as stack from "lib/log/stack.ts"; | |
| 741 | import { formatSize } from "@/file-viewer/format.ts"; | |
| 739 | import * as progress from "@clo/lib/progress.ts"; | |
| 740 | import * as stack from "@clo/lib/log/stack.ts"; | |
| 741 | import { formatSize } from "#src/file-viewer/format.ts"; | |
| 742 | 742 | |
| 743 | 743 | import * as msgpackr from "msgpackr"; |
| 744 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 744 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
framework/lib/assets.ts+2-2| ... | ... | @@ -285,5 +285,5 @@ import type { AssetKey as Key } from "../../.clover/ts/asset.d.ts"; |
| 285 | 285 | import * as crypto from "node:crypto"; |
| 286 | 286 | import * as zlib from "node:zlib"; |
| 287 | 287 | import * as util from "node:util"; |
| 288 | import * as log from "lib/log.ts"; | |
| 289 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 288 | import * as log from "@clo/lib/log.ts"; | |
| 289 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
framework/lib/path.ts+2-2| ... | ... | @@ -211,6 +211,6 @@ export class Path { |
| 211 | 211 | import * as path from "node:path"; |
| 212 | 212 | import * as fs from "./fs.ts"; |
| 213 | 213 | import * as util from "node:util"; |
| 214 | import * as error from "lib/error.ts"; | |
| 214 | import * as error from "@clo/lib/error.ts"; | |
| 215 | 215 | import type { RmOptions } from "node:fs"; |
| 216 | import { ASSERT } from "lib/assert.ts"; | |
| 216 | import { ASSERT } from "@clo/lib/assert.ts"; |
framework/lib/sitegen.ts+3-3| ... | ... | @@ -100,7 +100,7 @@ export function joinScripts(scriptSources: string[]) { |
| 100 | 100 | |
| 101 | 101 | export { default as CloverScriptInclude } from "./add-script.marko"; |
| 102 | 102 | |
| 103 | import * as render from "lib/render.ts"; | |
| 104 | import type * as meta from "lib/render/meta.ts"; | |
| 103 | import * as render from "@clo/lib/render.ts"; | |
| 104 | import type * as meta from "@clo/lib/render/meta.ts"; | |
| 105 | 105 | import type * as css from "../css.ts"; |
| 106 | import { UNWRAP } from "lib/assert.ts"; | |
| 106 | import { UNWRAP } from "@clo/lib/assert.ts"; |
framework/lib/view.ts+3-3| ... | ... | @@ -117,14 +117,14 @@ export function regenerate(tag: RegenKey) { |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | import * as meta from "lib/render/meta.ts"; | |
| 120 | import * as meta from "@clo/lib/render/meta.ts"; | |
| 121 | 121 | import type * as hono from "#hono"; |
| 122 | import * as render from "lib/render.ts"; | |
| 122 | import * as render from "@clo/lib/render.ts"; | |
| 123 | 123 | import * as sg from "./sitegen.ts"; |
| 124 | 124 | import * as asset from "./assets.ts"; |
| 125 | 125 | import type { |
| 126 | 126 | RegenKey, |
| 127 | 127 | RegisteredViews as ViewMap, |
| 128 | 128 | } from "../../.clover/ts/view.d.ts"; |
| 129 | import { UNWRAP } from "lib/assert.ts"; | |
| 129 | import { UNWRAP } from "@clo/lib/assert.ts"; | |
| 130 | 130 | import SitegenWrap from "../sitegen-wrap.marko"; |
framework/watch.ts+1-1| ... | ... | @@ -170,4 +170,4 @@ import * as generate from "./generate.ts"; |
| 170 | 170 | import * as incr from "./incremental.ts"; |
| 171 | 171 | import * as path from "node:path"; |
| 172 | 172 | import * as util from "node:util"; |
| 173 | import * as subprocess from "lib/subprocess.ts"; | |
| 173 | import * as subprocess from "@clo/lib/subprocess.ts"; |
lib/deno.json+3-3| ... | ... | @@ -29,11 +29,11 @@ |
| 29 | 29 | }, |
| 30 | 30 | "compilerOptions": { |
| 31 | 31 | "jsx": "react-jsx", |
| 32 | "jsxImportSource": "lib/render" | |
| 32 | "jsxImportSource": "@clo/lib/render" | |
| 33 | 33 | }, |
| 34 | 34 | "imports": { |
| 35 | "lib/render/jsx-runtime": "./render/jsx-runtime.ts", | |
| 36 | "lib/render/jsx-dev-runtime": "./render/jsx-runtime.ts" | |
| 35 | "@clo/lib/render/jsx-runtime": "./render/jsx-runtime.ts", | |
| 36 | "@clo/lib/render/jsx-dev-runtime": "./render/jsx-runtime.ts" | |
| 37 | 37 | }, |
| 38 | 38 | "exclude": [ |
| 39 | 39 | "readme.npm.md", |
lib/log/stack.ts+1-1| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | * } |
| 20 | 20 | * |
| 21 | 21 | * import * as fs from "node:fs"; |
| 22 | * import * as stack from "lib/log/stack.ts"; | |
| 22 | * import * as stack from "@clo/lib/log/stack.ts"; | |
| 23 | 23 | * ``` |
| 24 | 24 | * |
| 25 | 25 | * @module |
lib/mime.test.ts+1-1| ... | ... | @@ -25,4 +25,4 @@ test("for", () => { |
| 25 | 25 | |
| 26 | 26 | import { test } from "node:test"; |
| 27 | 27 | import assert from "node:assert"; |
| 28 | import * as mime from "lib/mime.ts"; | |
| 28 | import * as mime from "@clo/lib/mime.ts"; |
lib/progress.ts+1-1| ... | ... | @@ -74,7 +74,7 @@ export function start(text: string, opts?: StartOptions): Node { |
| 74 | 74 | * |
| 75 | 75 | * ```ts |
| 76 | 76 | * await ffmpeg.spawn({ |
| 77 | * cmd: ["-i", "hello.mov", "-c:v", "libsvtav1", "hello.mp4"], | |
| 77 | * cmd: ["-i", "hello.mov", "-c:v", "@clo/libsvtav1", "hello.mp4"], | |
| 78 | 78 | * progress: progress.start("encode hello.mov"), |
| 79 | 79 | * }); |
| 80 | 80 | * ``` |
lib/string/ansi.test.ts+1-1| ... | ... | @@ -21,4 +21,4 @@ test("trimToWidth", () => { |
| 21 | 21 | |
| 22 | 22 | import { test } from "node:test"; |
| 23 | 23 | import assert from "node:assert"; |
| 24 | import * as ansi from "lib/string/ansi.ts"; | |
| 24 | import * as ansi from "@clo/lib/string/ansi.ts"; |
lib/subprocess/ffmpeg.ts+1-1| ... | ... | @@ -13,7 +13,7 @@ export interface SpawnOptions { |
| 13 | 13 | * |
| 14 | 14 | * ```ts |
| 15 | 15 | * await ffmpeg.spawn({ |
| 16 | * cmd: ["-i", "hello.mov", "-c:v", "libsvtav1", "hello.mp4"], | |
| 16 | * cmd: ["-i", "hello.mov", "-c:v", "@clo/libsvtav1", "hello.mp4"], | |
| 17 | 17 | * progress: progress.start("encode hello.mov"), |
| 18 | 18 | * }); |
| 19 | 19 | * ``` |
package-lock.json+6-6| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | "packages": { |
| 6 | 6 | "": { |
| 7 | 7 | "dependencies": { |
| 8 | "@clo/lib": "file:lib", | |
| 8 | 9 | "@clo/markodown": "npm:@paperclover/markodown@rc", |
| 9 | 10 | "@hono/node-server": "1.14.3", |
| 10 | 11 | "@marko/compiler": "^5.39.55", |
| ... | ... | @@ -15,7 +16,6 @@ |
| 15 | 16 | "esbuild": "0.25.5", |
| 16 | 17 | "hls.js": "1.6.5", |
| 17 | 18 | "hono": "4.11.9", |
| 18 | "lib": "file:lib", | |
| 19 | 19 | "marko": "^5.38.24", |
| 20 | 20 | "msgpackr": "1.11.5", |
| 21 | 21 | "playwright": "1.58.2", |
| ... | ... | @@ -26,7 +26,11 @@ |
| 26 | 26 | "vscode-textmate": "9.2.0" |
| 27 | 27 | } |
| 28 | 28 | }, |
| 29 | "lib": {}, | |
| 29 | "@clo/lib": {}, | |
| 30 | "node_modules/@clo/lib": { | |
| 31 | "resolved": "@clo/lib", | |
| 32 | "link": true | |
| 33 | }, | |
| 30 | 34 | "node_modules/@clo/markodown": { |
| 31 | 35 | "name": "@paperclover/markodown", |
| 32 | 36 | "version": "1.0.0-rc.15", |
| ... | ... | @@ -1077,10 +1081,6 @@ |
| 1077 | 1081 | "lasso-caching-fs": "^1.0.0" |
| 1078 | 1082 | } |
| 1079 | 1083 | }, |
| 1080 | "node_modules/lib": { | |
| 1081 | "resolved": "lib", | |
| 1082 | "link": true | |
| 1083 | }, | |
| 1084 | 1084 | "node_modules/lie": { |
| 1085 | 1085 | "version": "3.1.1", |
| 1086 | 1086 | "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", |
package.json+2-1| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | "esbuild": "0.25.5", |
| 12 | 12 | "hls.js": "1.6.5", |
| 13 | 13 | "hono": "4.11.9", |
| 14 | "lib": "file:lib", | |
| 14 | "@clo/lib": "file:lib", | |
| 15 | 15 | "marko": "^5.38.24", |
| 16 | 16 | "msgpackr": "1.11.5", |
| 17 | 17 | "playwright": "1.58.2", |
| ... | ... | @@ -22,6 +22,7 @@ |
| 22 | 22 | "vscode-textmate": "9.2.0" |
| 23 | 23 | }, |
| 24 | 24 | "imports": { |
| 25 | "#src/*": "./src/*", | |
| 25 | 26 | "#sitegen": "./framework/lib/sitegen.ts", |
| 26 | 27 | "#sitegen/*": "./framework/lib/*.ts", |
| 27 | 28 | "#jsx/jsx-runtime": "./lib/render/jsx-runtime.ts", |
src/backend.ts+1-1| ... | ... | @@ -64,4 +64,4 @@ import { logger } from "hono/logger"; |
| 64 | 64 | import { trimTrailingSlash } from "hono/trailing-slash"; |
| 65 | 65 | import * as assets from "#sitegen/assets"; |
| 66 | 66 | import * as admin from "./admin.ts"; |
| 67 | import * as log from "lib/log.ts"; | |
| 67 | import * as log from "@clo/lib/log.ts"; |
src/bin/deploy.ts+2-2| ... | ... | @@ -55,7 +55,7 @@ export async function main() { |
| 55 | 55 | |
| 56 | 56 | import * as incr from "../../framework/incremental.ts"; |
| 57 | 57 | import { generate } from "../../framework/generate.ts"; |
| 58 | import * as progress from "lib/progress.ts"; | |
| 59 | import * as subprocess from "lib/subprocess.ts"; | |
| 58 | import * as progress from "@clo/lib/progress.ts"; | |
| 59 | import * as subprocess from "@clo/lib/subprocess.ts"; | |
| 60 | 60 | import * as rsync from "../file-viewer/rsync.ts"; |
| 61 | 61 | import { Path } from "#sitegen/path"; |
src/bin/download-db.ts+1-1| ... | ... | @@ -21,6 +21,6 @@ export async function main() { |
| 21 | 21 | }); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | import * as progress from "lib/progress.ts"; | |
| 24 | import * as progress from "@clo/lib/progress.ts"; | |
| 25 | 25 | import * as rsync from "../file-viewer/rsync.ts"; |
| 26 | 26 | import { Path } from "#sitegen/path"; |
src/bin/package-lib.ts+2-2| ... | ... | @@ -21,10 +21,10 @@ export async function updateJsrPackageExportsToAll( |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | export async function main() { |
| 24 | const main = path.resolve("lib"); | |
| 24 | const main = path.resolve("@clo/lib"); | |
| 25 | 25 | await updateJsrPackageExportsToAll(main, progress); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | import * as progress from "lib/progress.ts"; | |
| 28 | import * as progress from "@clo/lib/progress.ts"; | |
| 29 | 29 | import * as path from "node:path"; |
| 30 | 30 | import * as fs from "node:fs/promises"; |
src/blog/drafts/webdev/marko-intro.markodown+7-7| ... | ... | @@ -5,7 +5,7 @@ export const blog: BlogMeta = { |
| 5 | 5 | draft: true, |
| 6 | 6 | }; |
| 7 | 7 | export const meta = formatBlogMeta(blob); |
| 8 | export * as layout from "@/blog/layout.tsx"; | |
| 8 | export * as layout from "#src/blog/layout.tsx"; | |
| 9 | 9 | |
| 10 | 10 | I've been recently playing around [Marko], and after adding limited support |
| 11 | 11 | for it in my website generator, [sitegen], I instantly fell in love with how |
| ... | ... | @@ -287,8 +287,8 @@ function Page() { |
| 287 | 287 | console.info(render.sync(<Page />).text); |
| 288 | 288 | |
| 289 | 289 | import * as render from "#engine/render"; |
| 290 | import QuestionRender from "@/q+a/tags/question.marko"; | |
| 291 | import { Question } from "@/q+a/models/Question.ts"; | |
| 290 | import QuestionRender from "#src/q+a/tags/question.marko"; | |
| 291 | import { Question } from "#src/q+a/models/Question.ts"; | |
| 292 | 292 | ``` |
| 293 | 293 | |
| 294 | 294 | Here is the `question.marko` tag used to render [questions on the clover q+a](/q+a). |
| ... | ... | @@ -328,12 +328,12 @@ export const transitionDate = 1735639200000; |
| 328 | 328 | // this singleton script will make all the '<time>' tags clickable. |
| 329 | 329 | client import "./clickable-links.client.ts"; |
| 330 | 330 | |
| 331 | import type { Question } from "@/q+a/models/Question.ts"; | |
| 332 | import { formatQuestionTimestamp, formatQuestionISOTimestamp } from "@/q+a/format.ts"; | |
| 333 | import { QuestionMarkdown } from "@/q+a/markdown.tsx"; | |
| 331 | import type { Question } from "#src/q+a/models/Question.ts"; | |
| 332 | import { formatQuestionTimestamp, formatQuestionISOTimestamp } from "#src/q+a/format.ts"; | |
| 333 | import { QuestionMarkdown } from "#src/q+a/markdown.tsx"; | |
| 334 | 334 | ``` |
| 335 | 335 | |
| 336 | 336 | The integration is great, `client import` is quite a magical concept, and I've |
| 337 | 337 | tuned it to do the expected thing in my framework. |
| 338 | 338 | |
| 339 | import { type BlogMeta, formatBlogMeta } from '@/blog/helpers.ts'; | |
| 339 | import { type BlogMeta, formatBlogMeta } from '#src/blog/helpers.ts'; |
src/blog/localization.tsx+1-1| ... | ... | @@ -31,4 +31,4 @@ export const languages: LanguageMap = { |
| 31 | 31 | }, |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | import * as render from "lib/render.ts"; | |
| 34 | import * as render from "@clo/lib/render.ts"; |
src/blog/pages/webdev/one-year-next-app-router/en.mdo+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | --- |
| 2 | layout: "@/blog/tags/blog-layout.marko" | |
| 2 | layout: "#src/blog/tags/blog-layout.marko" | |
| 3 | 3 | meta: |
| 4 | 4 | title: One Year with Next.js App Router — Why We're Moving On |
| 5 | 5 | description: A critique of React Server Components and Next.js 15. |
src/blog/pages/webdev/one-year-next-app-router/es.mdo+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | --- |
| 2 | layout: "@/blog/tags/blog-layout.marko" | |
| 2 | layout: "#src/blog/tags/blog-layout.marko" | |
| 3 | 3 | meta: |
| 4 | 4 | title: Un año con el enrutador de aplicación (App Router) de Next.js — por qué decidimos cambiar |
| 5 | 5 | description: Una crítica de los componentes de servidor de React y Next.js 15. |
src/blog/pages/webdev/one-year-next-app-router/ko.mdo+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | --- |
| 2 | layout: "@/blog/tags/blog-layout.marko" | |
| 2 | layout: "#src/blog/tags/blog-layout.marko" | |
| 3 | 3 | meta: |
| 4 | 4 | title: Next.js 앱 라우터와 함께한 1년 — 우리가 떠나기로 한 이유 |
| 5 | 5 | description: 리액트 서버 컴포넌트와 Next.js 15에 대한 비판 |
src/blog/tags/blog-layout.marko+1-1| ... | ... | @@ -104,4 +104,4 @@ import * as markodown from "@clo/markodown"; |
| 104 | 104 | import Heading from "./heading.marko"; |
| 105 | 105 | import CodeBlock from "./code-block.marko"; |
| 106 | 106 | import { Path } from "#sitegen/path"; |
| 107 | import { UNWRAP } from "lib/assert.ts"; | |
| 107 | import { UNWRAP } from "@clo/lib/assert.ts"; |
src/blog/tags/code-block.marko+1-1| ... | ... | @@ -12,4 +12,4 @@ |
| 12 | 12 | </> |
| 13 | 13 | </figure> |
| 14 | 14 | |
| 15 | import * as highlight from "@/file-viewer/highlight.ts"; | |
| 15 | import * as highlight from "#src/file-viewer/highlight.ts"; |
src/file-viewer/backend.tsx+11-11| ... | ... | @@ -313,17 +313,17 @@ function getPartialPage(c: Context, rawFilePath: string) { |
| 313 | 313 | |
| 314 | 314 | import { type Context, Hono } from "hono"; |
| 315 | 315 | |
| 316 | import * as render from "lib/render.ts"; | |
| 316 | import * as render from "@clo/lib/render.ts"; | |
| 317 | 317 | import { etagMatches, serveAsset } from "#sitegen/assets"; |
| 318 | 318 | import * as view from "#sitegen/view"; |
| 319 | import * as mime from "lib/mime.ts"; | |
| 320 | ||
| 321 | import { getForFile, requireFriendAuth } from "@/friend-auth.ts"; | |
| 322 | import { MediaFile, MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 323 | import { FilePermissions } from "@/file-viewer/models/FilePermissions.ts"; | |
| 324 | import { MediaPanel } from "@/file-viewer/views/clofi.tsx"; | |
| 325 | import { Speedbump } from "@/file-viewer/cotyledon.tsx"; | |
| 326 | import * as cache from "@/file-viewer/cache.ts"; | |
| 327 | import * as derived from "@/file-viewer/models/derived.ts"; | |
| 328 | import { UNWRAP } from "lib/assert.ts"; | |
| 319 | import * as mime from "@clo/lib/mime.ts"; | |
| 320 | ||
| 321 | import { getForFile, requireFriendAuth } from "#src/friend-auth.ts"; | |
| 322 | import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 323 | import { FilePermissions } from "#src/file-viewer/models/FilePermissions.ts"; | |
| 324 | import { MediaPanel } from "#src/file-viewer/views/clofi.tsx"; | |
| 325 | import { Speedbump } from "#src/file-viewer/cotyledon.tsx"; | |
| 326 | import * as cache from "#src/file-viewer/cache.ts"; | |
| 327 | import * as derived from "#src/file-viewer/models/derived.ts"; | |
| 328 | import { UNWRAP } from "@clo/lib/assert.ts"; | |
| 329 | 329 | import { escapeUri } from "./format.ts"; |
src/file-viewer/bin/file-scan.ts+13-13| ... | ... | @@ -1024,13 +1024,13 @@ async function scrubLocationMetadata( |
| 1024 | 1024 | |
| 1025 | 1025 | const monthMilliseconds = 30 * 24 * 60 * 60 * 1000; |
| 1026 | 1026 | |
| 1027 | import * as async from "lib/async.ts"; | |
| 1027 | import * as async from "@clo/lib/async.ts"; | |
| 1028 | 1028 | import * as fs from "#sitegen/fs"; |
| 1029 | import * as subprocess from "lib/subprocess.ts"; | |
| 1029 | import * as subprocess from "@clo/lib/subprocess.ts"; | |
| 1030 | 1030 | import { Path } from "#sitegen/path"; |
| 1031 | 1031 | import * as queue from "../../../lib/queue.ts"; |
| 1032 | 1032 | import * as log from "../../../lib/log.ts"; |
| 1033 | import * as progress from "lib/progress.ts"; | |
| 1033 | import * as progress from "@clo/lib/progress.ts"; | |
| 1034 | 1034 | import * as ts from "../../../lib/ts.ts"; |
| 1035 | 1035 | |
| 1036 | 1036 | import * as child_process from "node:child_process"; |
| ... | ... | @@ -1040,19 +1040,19 @@ import * as path from "node:path"; |
| 1040 | 1040 | import * as stream from "node:stream"; |
| 1041 | 1041 | import * as zlib from "node:zlib"; |
| 1042 | 1042 | |
| 1043 | import { MediaFile, MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 1044 | import { FilePermissions } from "@/file-viewer/models/FilePermissions.ts"; | |
| 1043 | import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 1044 | import { FilePermissions } from "#src/file-viewer/models/FilePermissions.ts"; | |
| 1045 | 1045 | import { |
| 1046 | 1046 | formatDate, |
| 1047 | 1047 | formatDurationLong, |
| 1048 | 1048 | formatSize, |
| 1049 | } from "@/file-viewer/format.ts"; | |
| 1050 | import * as rules from "@/file-viewer/rules.ts"; | |
| 1051 | import * as highlight from "@/file-viewer/highlight.ts"; | |
| 1052 | import * as ffmpeg from "lib/subprocess/ffmpeg.ts"; | |
| 1053 | import * as rsync from "@/file-viewer/rsync.ts"; | |
| 1054 | import * as derived from "@/file-viewer/models/derived.ts"; | |
| 1055 | import * as transcodeRules from "@/file-viewer/transcode-rules.ts"; | |
| 1049 | } from "#src/file-viewer/format.ts"; | |
| 1050 | import * as rules from "#src/file-viewer/rules.ts"; | |
| 1051 | import * as highlight from "#src/file-viewer/highlight.ts"; | |
| 1052 | import * as ffmpeg from "@clo/lib/subprocess/ffmpeg.ts"; | |
| 1053 | import * as rsync from "#src/file-viewer/rsync.ts"; | |
| 1054 | import * as derived from "#src/file-viewer/models/derived.ts"; | |
| 1055 | import * as transcodeRules from "#src/file-viewer/transcode-rules.ts"; | |
| 1056 | 1056 | |
| 1057 | 1057 | import { rawFileRoot as root } from "../paths.ts"; |
| 1058 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 1058 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
src/file-viewer/bin/file-trim.ts+1-1| ... | ... | @@ -14,5 +14,5 @@ export async function main() { |
| 14 | 14 | // TODO: delete unreferenced files |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | import * as log from "lib/log.ts"; | |
| 17 | import * as log from "@clo/lib/log.ts"; | |
| 18 | 18 | import * as derived from "../models/derived.ts"; |
src/file-viewer/cache.ts+6-6| ... | ... | @@ -600,17 +600,17 @@ async function writeStream( |
| 600 | 600 | import * as util from "node:util"; |
| 601 | 601 | import * as fsCallbacks from "node:fs"; |
| 602 | 602 | import * as fs from "#sitegen/fs"; |
| 603 | import * as async from "lib/async.ts"; | |
| 604 | import * as error from "lib/error.ts"; | |
| 603 | import * as async from "@clo/lib/async.ts"; | |
| 604 | import * as error from "@clo/lib/error.ts"; | |
| 605 | 605 | import * as stream from "node:stream"; |
| 606 | 606 | import * as crypto from "node:crypto"; |
| 607 | 607 | import * as http from "node:http"; |
| 608 | 608 | import * as https from "node:https"; |
| 609 | 609 | import * as paths from "./paths.ts"; |
| 610 | import * as log from "lib/log.ts"; | |
| 610 | import * as log from "@clo/lib/log.ts"; | |
| 611 | 611 | import { MediaFile } from "./models/MediaFile.ts"; |
| 612 | 612 | import type { ReadableStream } from "node:stream/web"; |
| 613 | import { Lru } from "lib/Lru.ts"; | |
| 613 | import { Lru } from "@clo/lib/Lru.ts"; | |
| 614 | 614 | import { Path } from "#sitegen/path"; |
| 615 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 616 | import * as ts from "lib/ts.ts"; | |
| 615 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; | |
| 616 | import * as ts from "@clo/lib/ts.ts"; |
src/file-viewer/format.ts+2-2| ... | ... | @@ -287,5 +287,5 @@ export function formatDate(dateTime: Date) { |
| 287 | 287 | }.${dateTime.getFullYear().toString().slice(2)}`; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | import type { MediaFile } from "@/file-viewer/models/MediaFile.ts"; | |
| 291 | import { escapeHtml } from "lib/render.ts"; | |
| 290 | import type { MediaFile } from "#src/file-viewer/models/MediaFile.ts"; | |
| 291 | import { escapeHtml } from "@clo/lib/render.ts"; |
src/file-viewer/highlight.ts+2-2| ... | ... | @@ -215,9 +215,9 @@ export async function highlightCode(code: string, language: Language) { |
| 215 | 215 | // "tsx", |
| 216 | 216 | // ); |
| 217 | 217 | // |
| 218 | import * as async from "lib/async.ts"; | |
| 218 | import * as async from "@clo/lib/async.ts"; | |
| 219 | 219 | import * as fs from "#sitegen/fs"; |
| 220 | 220 | import * as path from "node:path"; |
| 221 | 221 | import * as oniguruma from "vscode-oniguruma"; |
| 222 | 222 | import * as textmate from "vscode-textmate"; |
| 223 | import * as render from "lib/render.ts"; | |
| 223 | import * as render from "@clo/lib/render.ts"; |
src/file-viewer/models/MediaFile.ts+1-1| ... | ... | @@ -464,4 +464,4 @@ const getDirectoriesToReindexQuery = db.prepare(` |
| 464 | 464 | import { getDb } from "#sitegen/sqlite"; |
| 465 | 465 | import * as path from "node:path/posix"; |
| 466 | 466 | import { FilePermissions } from "./FilePermissions.ts"; |
| 467 | import { ASSERT } from "lib/assert.ts"; | |
| 467 | import { ASSERT } from "@clo/lib/assert.ts"; |
src/file-viewer/models/derived.ts+3-3| ... | ... | @@ -217,6 +217,6 @@ import type { MediaFile } from "./MediaFile.ts"; |
| 217 | 217 | import { Path } from "#sitegen/path"; |
| 218 | 218 | import * as fs from "node:fs"; |
| 219 | 219 | import * as crypto from "node:crypto"; |
| 220 | import * as queue from "lib/queue.ts"; | |
| 221 | import * as progress from "lib/progress.ts"; | |
| 222 | import { ASSERT } from "lib/assert.ts"; | |
| 220 | import * as queue from "@clo/lib/queue.ts"; | |
| 221 | import * as progress from "@clo/lib/progress.ts"; | |
| 222 | import { ASSERT } from "@clo/lib/assert.ts"; |
src/file-viewer/pages/file.cotyledon-enterance.tsx+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | import { MediaFile } from "@/file-viewer/models/MediaFile.ts"; | |
| 1 | import { MediaFile } from "#src/file-viewer/models/MediaFile.ts"; | |
| 2 | 2 | import { addScript } from "#sitegen"; |
| 3 | import { Readme } from "@/file-viewer/cotyledon.tsx"; | |
| 3 | import { Readme } from "#src/file-viewer/cotyledon.tsx"; | |
| 4 | 4 | import { MediaPanel } from "../views/clofi.tsx"; |
| 5 | 5 | |
| 6 | 6 | export const theme = { |
src/file-viewer/rsync.ts+3-3| ... | ... | @@ -183,7 +183,7 @@ export class Parse { |
| 183 | 183 | import * as child_process from "node:child_process"; |
| 184 | 184 | import * as readline from "node:readline"; |
| 185 | 185 | import events from "node:events"; |
| 186 | import * as progress from "lib/progress.ts"; | |
| 187 | import { formatSize } from "@/file-viewer/format.ts"; | |
| 188 | import { UNWRAP } from "lib/assert.ts"; | |
| 186 | import * as progress from "@clo/lib/progress.ts"; | |
| 187 | import { formatSize } from "#src/file-viewer/format.ts"; | |
| 188 | import { UNWRAP } from "@clo/lib/assert.ts"; | |
| 189 | 189 | import { Path } from "#sitegen/path"; |
src/file-viewer/rules.ts+1-1| ... | ... | @@ -153,5 +153,5 @@ const pathToCanvas = new Map<string, string>(Object.entries({ |
| 153 | 153 | })); |
| 154 | 154 | |
| 155 | 155 | import type * as highlight from "./highlight.ts"; |
| 156 | import { MediaFile, MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 156 | import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 157 | 157 | import * as path from "node:path"; |
src/file-viewer/transcode-rules.ts+7-7| ... | ... | @@ -73,7 +73,7 @@ export const imagePresets = [ |
| 73 | 73 | ext: ".avif", |
| 74 | 74 | args: [ |
| 75 | 75 | "-c:v", |
| 76 | "libaom-av1", | |
| 76 | "@clo/libaom-av1", | |
| 77 | 77 | "-crf", |
| 78 | 78 | "30", |
| 79 | 79 | "-pix_fmt", |
| ... | ... | @@ -84,7 +84,7 @@ export const imagePresets = [ |
| 84 | 84 | ext: ".jxl", |
| 85 | 85 | args: [ |
| 86 | 86 | "-c:v", |
| 87 | "libjxl", | |
| 87 | "@clo/libjxl", | |
| 88 | 88 | "-distance", |
| 89 | 89 | "0.8", |
| 90 | 90 | "-effort", |
| ... | ... | @@ -148,7 +148,7 @@ export function getAv1VideoArgs( |
| 148 | 148 | const { preset, mbitMax, crf, maxHeight, depth } = av1; |
| 149 | 149 | const cmd = [...videoInputArgs]; |
| 150 | 150 | |
| 151 | cmd.push("-c:v", "libsvtav1"); | |
| 151 | cmd.push("-c:v", "@clo/libsvtav1"); | |
| 152 | 152 | cmd.push( |
| 153 | 153 | "-svtav1-params", |
| 154 | 154 | [ |
| ... | ... | @@ -183,7 +183,7 @@ export function getOpusAudioArgs( |
| 183 | 183 | |
| 184 | 184 | cmd.push("-vn"); |
| 185 | 185 | |
| 186 | cmd.push("-c:a", "libopus"); | |
| 186 | cmd.push("-c:a", "@clo/libopus"); | |
| 187 | 187 | cmd.push("-b:a", audioKbit + "k"); |
| 188 | 188 | |
| 189 | 189 | cmd.push("-y"); |
| ... | ... | @@ -264,7 +264,7 @@ export function getH264HlsArgs( |
| 264 | 264 | const aIdx = i * 2 + 1; |
| 265 | 265 | // deno-fmt-ignore |
| 266 | 266 | cmd.push( |
| 267 | `-c:${vIdx}`, "libx264", | |
| 267 | `-c:${vIdx}`, "@clo/libx264", | |
| 268 | 268 | `-b:v:${vIdx}`, preset.videoBitrate, |
| 269 | 269 | `-filter:${vIdx}`, `scale=-2:min(${preset.maxHeight}\\,ih)`, |
| 270 | 270 | `-c:${aIdx}`, "aac", |
| ... | ... | @@ -285,7 +285,7 @@ export function getH264HlsArgs( |
| 285 | 285 | hlsPresets.forEach((preset, i) => { |
| 286 | 286 | // deno-fmt-ignore |
| 287 | 287 | cmd.push( |
| 288 | `-c:v:${i}`, "libx264", | |
| 288 | `-c:v:${i}`, "@clo/libx264", | |
| 289 | 289 | `-b:v:${i}`, preset.videoBitrate, |
| 290 | 290 | `-filter:v:${i}`, `scale=-2:min(${preset.maxHeight}\\,ih)`, |
| 291 | 291 | ); |
| ... | ... | @@ -314,4 +314,4 @@ export function getH264HlsArgs( |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | import type { Path } from "#sitegen/path"; |
| 317 | import * as ffmpeg from "lib/subprocess/ffmpeg.ts"; | |
| 317 | import * as ffmpeg from "@clo/lib/subprocess/ffmpeg.ts"; |
src/file-viewer/views/clofi.tsx+8-8| ... | ... | @@ -925,7 +925,7 @@ CodeView.class = "code"; |
| 925 | 925 | import "./clofi.css"; |
| 926 | 926 | import assert from "node:assert"; |
| 927 | 927 | import path, { dirname } from "node:path"; |
| 928 | import { MediaFile, MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 928 | import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 929 | 929 | import { addScript } from "#sitegen"; |
| 930 | 930 | import { |
| 931 | 931 | escapeUri, |
| ... | ... | @@ -934,11 +934,11 @@ import { |
| 934 | 934 | highlightConvo, |
| 935 | 935 | highlightHashComments, |
| 936 | 936 | highlightLinksInTextView, |
| 937 | } from "@/file-viewer/format.ts"; | |
| 938 | import { ForEveryone } from "@/file-viewer/cotyledon.tsx"; | |
| 939 | import * as mime from "lib/mime.ts"; | |
| 937 | } from "#src/file-viewer/format.ts"; | |
| 938 | import { ForEveryone } from "#src/file-viewer/cotyledon.tsx"; | |
| 939 | import * as mime from "@clo/lib/mime.ts"; | |
| 940 | 940 | import * as sort from "../sort.ts"; |
| 941 | import CloverVideo from "@/tags/clover-video.marko"; | |
| 942 | import Image from "@/tags/image.tsx"; | |
| 943 | import * as render from "lib/render.ts"; | |
| 944 | import { UNWRAP } from "lib/assert.ts"; | |
| 941 | import CloverVideo from "#src/tags/clover-video.marko"; | |
| 942 | import Image from "#src/tags/image.tsx"; | |
| 943 | import * as render from "@clo/lib/render.ts"; | |
| 944 | import { UNWRAP } from "@clo/lib/assert.ts"; |
src/file-viewer/views/lofi.marko+3-3| ... | ... | @@ -66,6 +66,6 @@ export { meta, theme } from "./clofi.tsx"; |
| 66 | 66 | </div> |
| 67 | 67 | |
| 68 | 68 | import * as path from "node:path"; |
| 69 | import { escapeUri, formatDuration, formatSize, formatDate } from "@/file-viewer/format.ts"; | |
| 70 | import { MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 71 | import * as sort from "@/file-viewer/sort.ts"; | |
| 69 | import { escapeUri, formatDuration, formatSize, formatDate } from "#src/file-viewer/format.ts"; | |
| 70 | import { MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 71 | import * as sort from "#src/file-viewer/sort.ts"; |
src/q+a/image.tsx+2-2| ... | ... | @@ -73,7 +73,7 @@ export async function getQuestionImage( |
| 73 | 73 | import * as crypto from "node:crypto"; |
| 74 | 74 | import * as fs from "#sitegen/fs"; |
| 75 | 75 | import * as path from "node:path"; |
| 76 | import { Question } from "@/q+a/models/Question.ts"; | |
| 77 | import { RefCountedExpirable } from "lib/async.ts"; | |
| 76 | import { Question } from "#src/q+a/models/Question.ts"; | |
| 77 | import { RefCountedExpirable } from "@clo/lib/async.ts"; | |
| 78 | 78 | import * as view from "#sitegen/view"; |
| 79 | 79 | import * as playwright from "playwright"; |
src/q+a/markdown.tsx+1-1| ... | ... | @@ -76,6 +76,6 @@ export function renderMarkdown(source: string) { |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | import * as markodown from "@clo/markodown"; |
| 79 | import * as render from "lib/render.ts"; | |
| 79 | import * as render from "@clo/lib/render.ts"; | |
| 80 | 80 | import { artifactMap } from "./artifacts.ts"; |
| 81 | 81 | import { formatQuestionTimestamp, questionIdToTimestamp } from "./format.ts"; |
src/q+a/pages/admin.q+a.marko+1-1| ... | ... | @@ -23,4 +23,4 @@ export const regenerate = { |
| 23 | 23 | <MainPage admin /> |
| 24 | 24 | |
| 25 | 25 | import MainPage from "./q+a.marko"; |
| 26 | import { PendingQuestion } from "@/q+a/models/PendingQuestion.ts"; | |
| 26 | import { PendingQuestion } from "#src/q+a/models/PendingQuestion.ts"; |
src/q+a/pages/q+a.marko+1-1| ... | ... | @@ -24,4 +24,4 @@ export const meta: Metadata = { |
| 24 | 24 | </footer> |
| 25 | 25 | </question-layout> |
| 26 | 26 | |
| 27 | import { Question } from "@/q+a/models/Question.ts"; | |
| 27 | import { Question } from "#src/q+a/models/Question.ts"; |
src/q+a/scripts/editor.client.tsx+2-2| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | import type { ScriptPayload } from "@/q+a/views/editor.marko"; | |
| 2 | import QuestionRender from "@/q+a/tags/question.marko"; | |
| 1 | import type { ScriptPayload } from "#src/q+a/views/editor.marko"; | |
| 2 | import QuestionRender from "#src/q+a/tags/question.marko"; | |
| 3 | 3 | |
| 4 | 4 | declare const payload: ScriptPayload; |
| 5 | 5 | const date = new Date(payload.date); |
src/q+a/tags/question-layout.marko+1-1| ... | ... | @@ -19,4 +19,4 @@ export const theme = { |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | import { addScript } from "#sitegen"; |
| 22 | import * as render from "lib/render.ts"; | |
| 22 | import * as render from "@clo/lib/render.ts"; |
src/q+a/tags/question.marko+3-3| ... | ... | @@ -37,7 +37,7 @@ export const transitionDate = 1735639200000; |
| 37 | 37 | client import "./clickable-links.client.ts"; |
| 38 | 38 | </> |
| 39 | 39 | |
| 40 | import type { Question } from "@/q+a/models/Question.ts"; | |
| 41 | import { formatQuestionTimestamp, formatQuestionISOTimestamp } from "@/q+a/format.ts"; | |
| 42 | import * as markdown from "@/q+a/markdown.tsx"; | |
| 40 | import type { Question } from "#src/q+a/models/Question.ts"; | |
| 41 | import { formatQuestionTimestamp, formatQuestionISOTimestamp } from "#src/q+a/format.ts"; | |
| 42 | import * as markdown from "#src/q+a/markdown.tsx"; | |
| 43 | 43 | import { addScript as Script } from "#sitegen" |
src/q+a/views/backend-inbox.marko+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | export { theme } from "../tags/question-layout.marko"; |
| 2 | import { PendingQuestion } from "@/q+a/models/PendingQuestion.ts"; | |
| 2 | import { PendingQuestion } from "#src/q+a/models/PendingQuestion.ts"; | |
| 3 | 3 | import { |
| 4 | 4 | formatQuestionISOTimestamp, |
| 5 | 5 | formatQuestionTimestamp, |
| 6 | } from "@/q+a/format.ts"; | |
| 6 | } from "#src/q+a/format.ts"; | |
| 7 | 7 | export const meta = { title: 'question answer inbox' }; |
| 8 | 8 | |
| 9 | 9 | <const/questions = PendingQuestion.getAll() /> |
src/q+a/views/editor.marko+2-2| ... | ... | @@ -63,5 +63,5 @@ export interface ScriptPayload { |
| 63 | 63 | <html-script src="/js/q+a/scripts/editor.js" type="module" /> |
| 64 | 64 | |
| 65 | 65 | import * as devalue from 'devalue'; |
| 66 | import { type PendingQuestion } from "@/q+a/models/PendingQuestion.ts"; | |
| 67 | import { Question, QuestionType } from "@/q+a/models/Question.ts"; | |
| 66 | import { type PendingQuestion } from "#src/q+a/models/PendingQuestion.ts"; | |
| 67 | import { Question, QuestionType } from "#src/q+a/models/Question.ts"; |
src/q+a/views/image-embed.marko+1-1| ... | ... | @@ -13,4 +13,4 @@ export interface Input { |
| 13 | 13 | <question question=input.question /> |
| 14 | 14 | </main> |
| 15 | 15 | |
| 16 | import { Question } from '@/q+a/models/Question.ts'; | |
| 16 | import { Question } from '#src/q+a/models/Question.ts'; |
src/q+a/views/permalink.marko+3-3| ... | ... | @@ -52,6 +52,6 @@ server export function meta({ context, question }) { |
| 52 | 52 | <a href="/q+a">view more questions</a> |
| 53 | 53 | </question-layout> |
| 54 | 54 | |
| 55 | import { Question, QuestionType } from '@/q+a/models/Question.ts'; | |
| 56 | import { transitionDate } from "@/q+a/tags/question.marko"; | |
| 57 | import { formatQuestionTimestamp } from "@/q+a/format.ts"; | |
| 55 | import { Question, QuestionType } from '#src/q+a/models/Question.ts'; | |
| 56 | import { transitionDate } from "#src/q+a/tags/question.marko"; | |
| 57 | import { formatQuestionTimestamp } from "#src/q+a/format.ts"; |
src/site.ts+1-1| ... | ... | @@ -123,6 +123,6 @@ export const fonts: sg.Font[] = [ |
| 123 | 123 | ]; |
| 124 | 124 | |
| 125 | 125 | import * as path from "node:path"; |
| 126 | import type { Template as MetaTemplate } from "lib/render/meta.ts"; | |
| 126 | import type { Template as MetaTemplate } from "@clo/lib/render/meta.ts"; | |
| 127 | 127 | import type * as sg from "#sitegen"; |
| 128 | 128 | import { nasRoot } from "./file-viewer/paths.ts"; |
src/source-of-truth.dockerfile+1-1| ... | ... | @@ -10,7 +10,7 @@ run npx esbuild --bundle \ |
| 10 | 10 | framework/backend/entry-node.ts \ |
| 11 | 11 | --platform=node \ |
| 12 | 12 | --format=esm \ |
| 13 | --define:globalThis.CLOVER_SERVER_ENTRY='"@/source-of-truth.ts"' \ | |
| 13 | --define:globalThis.CLOVER_SERVER_ENTRY='"#src/source-of-truth.ts"' \ | |
| 14 | 14 | --minify \ |
| 15 | 15 | --sourcemap=linked \ |
| 16 | 16 | --entry-names=index \ |
src/source-of-truth.ts+4-4| ... | ... | @@ -104,13 +104,13 @@ const closeFile = util.promisify(fsCallbacks.close); |
| 104 | 104 | const fstat = util.promisify(fsCallbacks.fstat); |
| 105 | 105 | |
| 106 | 106 | import { Hono } from "#hono"; |
| 107 | import { MediaFile, MediaFileKind } from "@/file-viewer/models/MediaFile.ts"; | |
| 108 | import { FilePermissions } from "@/file-viewer/models/FilePermissions.ts"; | |
| 107 | import { MediaFile, MediaFileKind } from "#src/file-viewer/models/MediaFile.ts"; | |
| 108 | import { FilePermissions } from "#src/file-viewer/models/FilePermissions.ts"; | |
| 109 | 109 | import * as path from "node:path"; |
| 110 | 110 | import * as fs from "#sitegen/fs"; |
| 111 | 111 | import * as fsCallbacks from "node:fs"; |
| 112 | 112 | import * as util from "node:util"; |
| 113 | 113 | import * as stream from "node:stream"; |
| 114 | import * as mime from "lib/mime.ts"; | |
| 114 | import * as mime from "@clo/lib/mime.ts"; | |
| 115 | 115 | import { derivedFileRoot, rawFileRoot } from "./file-viewer/paths.ts"; |
| 116 | import { ASSERT, UNWRAP } from "lib/assert.ts"; | |
| 116 | import { ASSERT, UNWRAP } from "@clo/lib/assert.ts"; |
src/tags/clover-video.marko+2-2| ... | ... | @@ -69,5 +69,5 @@ export interface Input { |
| 69 | 69 | |
| 70 | 70 | client import "./clover-video.client.ts"; |
| 71 | 71 | |
| 72 | import { MediaFile } from "@/file-viewer/models/MediaFile.ts"; | |
| 73 | import { UNWRAP, ASSERT } from "lib/assert.ts"; | |
| 72 | import { MediaFile } from "#src/file-viewer/models/MediaFile.ts"; | |
| 73 | import { UNWRAP, ASSERT } from "@clo/lib/assert.ts"; |
src/tags/image.tsx+5-5| ... | ... | @@ -57,9 +57,9 @@ export default function Image( |
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | import * as transcodeRules from "@/file-viewer/transcode-rules.ts"; | |
| 61 | import { MediaFile } from "@/file-viewer/models/MediaFile.ts"; | |
| 62 | import { escapeUri } from "@/file-viewer/format.ts"; | |
| 63 | import { UNWRAP } from "lib/assert.ts"; | |
| 64 | import { extsVideo } from "@/file-viewer/rules.ts"; | |
| 60 | import * as transcodeRules from "#src/file-viewer/transcode-rules.ts"; | |
| 61 | import { MediaFile } from "#src/file-viewer/models/MediaFile.ts"; | |
| 62 | import { escapeUri } from "#src/file-viewer/format.ts"; | |
| 63 | import { UNWRAP } from "@clo/lib/assert.ts"; | |
| 64 | import { extsVideo } from "#src/file-viewer/rules.ts"; | |
| 65 | 65 | import CloverVideo from "./clover-video.marko"; |
src/tags/photo-grid.tsx+2-2| ... | ... | @@ -136,7 +136,7 @@ function mapSize(size: string | number) { |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | import "./photo-grid.css"; |
| 139 | import { MediaFile } from "@/file-viewer/models/MediaFile.ts"; | |
| 139 | import { MediaFile } from "#src/file-viewer/models/MediaFile.ts"; | |
| 140 | 140 | import Image from "./image.tsx"; |
| 141 | 141 | import * as path from "node:path"; |
| 142 | import { ASSERT } from "lib/assert.ts"; | |
| 142 | import { ASSERT } from "@clo/lib/assert.ts"; |
src/tags/questions-embed.marko+2-2| ... | ... | @@ -12,5 +12,5 @@ export interface Input { |
| 12 | 12 | </> |
| 13 | 13 | </div> |
| 14 | 14 | |
| 15 | import QuestionRender from "@/q+a/tags/question.marko"; | |
| 16 | import { Question } from "@/q+a/models/Question.ts"; | |
| 15 | import QuestionRender from "#src/q+a/tags/question.marko"; | |
| 16 | import { Question } from "#src/q+a/models/Question.ts"; |
tsconfig.json+2-3| ... | ... | @@ -5,11 +5,10 @@ |
| 5 | 5 | "incremental": true, |
| 6 | 6 | "jsx": "react-jsxdev", |
| 7 | 7 | "jsxImportSource": "#jsx", |
| 8 | "lib": ["esnext", "es2024", "dom", "dom.iterable"], | |
| 8 | "@clo/lib": ["esnext", "es2024", "dom", "dom.iterable"], | |
| 9 | 9 | "module": "nodenext", |
| 10 | 10 | "noEmit": true, |
| 11 | 11 | "outDir": ".clover/ts", |
| 12 | "paths": { "@/*": ["src/*"] }, | |
| 13 | 12 | "rootDir": ".", |
| 14 | 13 | "skipLibCheck": true, |
| 15 | 14 | "strict": true, |
| ... | ... | @@ -19,5 +18,5 @@ |
| 19 | 18 | "resolveJsonModule": true, |
| 20 | 19 | "types": ["marko"] |
| 21 | 20 | }, |
| 22 | "include": ["lib/**/*", "src/**/*", "framework/**/*"] | |
| 21 | "include": ["@clo/lib/**/*", "src/**/*", "framework/**/*"] | |
| 23 | 22 | } |