@kensio/colophon 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +139 -13
- package/dist/astro/index.d.ts +49 -0
- package/dist/astro/index.d.ts.map +1 -0
- package/dist/astro/index.js +42 -0
- package/dist/astro/index.js.map +1 -0
- package/dist/background/gradient.d.ts +12 -0
- package/dist/background/gradient.d.ts.map +1 -0
- package/dist/background/gradient.js +21 -0
- package/dist/background/gradient.js.map +1 -0
- package/dist/background/image.d.ts +14 -0
- package/dist/background/image.d.ts.map +1 -0
- package/dist/background/image.js +36 -0
- package/dist/background/image.js.map +1 -0
- package/dist/{background.d.ts → background/index.d.ts} +5 -5
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +27 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/mesh.d.ts +12 -0
- package/dist/background/mesh.d.ts.map +1 -0
- package/dist/background/mesh.js +43 -0
- package/dist/background/mesh.js.map +1 -0
- package/dist/cli/args/command.d.ts +13 -0
- package/dist/cli/args/command.d.ts.map +1 -0
- package/dist/cli/args/command.js +22 -0
- package/dist/cli/args/command.js.map +1 -0
- package/dist/cli/args/index.d.ts +28 -0
- package/dist/cli/args/index.d.ts.map +1 -0
- package/dist/cli/args/index.js +75 -0
- package/dist/cli/args/index.js.map +1 -0
- package/dist/cli/args/switches.d.ts +18 -0
- package/dist/cli/args/switches.d.ts.map +1 -0
- package/dist/cli/args/switches.js +42 -0
- package/dist/cli/args/switches.js.map +1 -0
- package/dist/cli/args/usage.d.ts +3 -0
- package/dist/cli/args/usage.d.ts.map +1 -0
- package/dist/cli/args/usage.js +34 -0
- package/dist/cli/args/usage.js.map +1 -0
- package/dist/cli/args/values.d.ts +11 -0
- package/dist/cli/args/values.d.ts.map +1 -0
- package/dist/cli/args/values.js +29 -0
- package/dist/cli/args/values.js.map +1 -0
- package/dist/cli/build.d.ts +10 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +41 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/eject/adapters.d.ts +20 -0
- package/dist/cli/eject/adapters.d.ts.map +1 -0
- package/dist/cli/eject/adapters.js +29 -0
- package/dist/cli/eject/adapters.js.map +1 -0
- package/dist/cli/eject/astro.d.ts +13 -0
- package/dist/cli/eject/astro.d.ts.map +1 -0
- package/dist/cli/eject/astro.js +35 -0
- package/dist/cli/eject/astro.js.map +1 -0
- package/dist/cli/eject/hugo.d.ts +19 -0
- package/dist/cli/eject/hugo.d.ts.map +1 -0
- package/dist/cli/eject/hugo.js +127 -0
- package/dist/cli/eject/hugo.js.map +1 -0
- package/dist/cli/eject/index.d.ts +15 -0
- package/dist/cli/eject/index.d.ts.map +1 -0
- package/dist/cli/eject/index.js +46 -0
- package/dist/cli/eject/index.js.map +1 -0
- package/dist/cli/index.js +25 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/fs.d.ts +5 -0
- package/dist/cli/init/fs.d.ts.map +1 -0
- package/dist/cli/init/fs.js +19 -0
- package/dist/cli/init/fs.js.map +1 -0
- package/dist/cli/init/guess.d.ts +9 -0
- package/dist/cli/init/guess.d.ts.map +1 -0
- package/dist/cli/init/guess.js +27 -0
- package/dist/cli/init/guess.js.map +1 -0
- package/dist/cli/init/index.d.ts +11 -0
- package/dist/cli/init/index.d.ts.map +1 -0
- package/dist/cli/init/index.js +36 -0
- package/dist/cli/init/index.js.map +1 -0
- package/dist/cli/init/module.d.ts +12 -0
- package/dist/cli/init/module.d.ts.map +1 -0
- package/dist/cli/init/module.js +45 -0
- package/dist/cli/init/module.js.map +1 -0
- package/dist/cli/init/scaffold.d.ts +10 -0
- package/dist/cli/init/scaffold.d.ts.map +1 -0
- package/dist/cli/init/scaffold.js +52 -0
- package/dist/cli/init/scaffold.js.map +1 -0
- package/dist/cli/message.d.ts +7 -0
- package/dist/cli/message.d.ts.map +1 -0
- package/dist/cli/message.js +9 -0
- package/dist/cli/message.js.map +1 -0
- package/dist/cli/preview/index.d.ts +13 -0
- package/dist/cli/preview/index.d.ts.map +1 -0
- package/dist/cli/preview/index.js +27 -0
- package/dist/cli/preview/index.js.map +1 -0
- package/dist/cli/preview/open.d.ts +10 -0
- package/dist/cli/preview/open.d.ts.map +1 -0
- package/dist/cli/preview/open.js +32 -0
- package/dist/cli/preview/open.js.map +1 -0
- package/dist/cli/preview/render.d.ts +23 -0
- package/dist/cli/preview/render.d.ts.map +1 -0
- package/dist/cli/preview/render.js +40 -0
- package/dist/cli/preview/render.js.map +1 -0
- package/dist/cli/preview/root.d.ts +17 -0
- package/dist/cli/preview/root.d.ts.map +1 -0
- package/dist/cli/preview/root.js +22 -0
- package/dist/cli/preview/root.js.map +1 -0
- package/dist/cli/preview/size.d.ts +7 -0
- package/dist/cli/preview/size.d.ts.map +1 -0
- package/dist/cli/preview/size.js +13 -0
- package/dist/cli/preview/size.js.map +1 -0
- package/dist/cli/report.d.ts +6 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +23 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/watch/filter.d.ts +14 -0
- package/dist/cli/watch/filter.d.ts.map +1 -0
- package/dist/cli/watch/filter.js +16 -0
- package/dist/cli/watch/filter.js.map +1 -0
- package/dist/cli/watch/index.d.ts +27 -0
- package/dist/cli/watch/index.d.ts.map +1 -0
- package/dist/cli/watch/index.js +38 -0
- package/dist/cli/watch/index.js.map +1 -0
- package/dist/cli/watch/queue.d.ts +24 -0
- package/dist/cli/watch/queue.d.ts.map +1 -0
- package/dist/cli/watch/queue.js +57 -0
- package/dist/cli/watch/queue.js.map +1 -0
- package/dist/config/defaults.d.ts +39 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +38 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +27 -6
- package/dist/config/index.js.map +1 -1
- package/dist/config/output.d.ts +26 -0
- package/dist/config/output.d.ts.map +1 -0
- package/dist/config/output.js +45 -0
- package/dist/config/output.js.map +1 -0
- package/dist/config/resolve.d.ts +10 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +20 -1
- package/dist/config/resolve.js.map +1 -1
- package/dist/config/size.d.ts +6 -0
- package/dist/config/size.d.ts.map +1 -1
- package/dist/config/size.js +20 -8
- package/dist/config/size.js.map +1 -1
- package/dist/content/index.d.ts +1 -0
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +1 -0
- package/dist/content/index.js.map +1 -1
- package/dist/content/read.d.ts +15 -0
- package/dist/content/read.d.ts.map +1 -0
- package/dist/content/read.js +36 -0
- package/dist/content/read.js.map +1 -0
- package/dist/content/walk.d.ts.map +1 -1
- package/dist/content/walk.js +4 -30
- package/dist/content/walk.js.map +1 -1
- package/dist/core/index.d.ts +37 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/encode/fit.d.ts +16 -0
- package/dist/encode/fit.d.ts.map +1 -0
- package/dist/encode/fit.js +23 -0
- package/dist/encode/fit.js.map +1 -0
- package/dist/encode/format.d.ts +12 -0
- package/dist/encode/format.d.ts.map +1 -0
- package/dist/encode/format.js +40 -0
- package/dist/encode/format.js.map +1 -0
- package/dist/encode/index.d.ts +14 -0
- package/dist/encode/index.d.ts.map +1 -0
- package/dist/encode/index.js +52 -0
- package/dist/encode/index.js.map +1 -0
- package/dist/encode/sharp.d.ts +19 -0
- package/dist/encode/sharp.d.ts.map +1 -0
- package/dist/encode/sharp.js +57 -0
- package/dist/encode/sharp.js.map +1 -0
- package/dist/encode/warn.d.ts +10 -0
- package/dist/encode/warn.d.ts.map +1 -0
- package/dist/encode/warn.js +31 -0
- package/dist/encode/warn.js.map +1 -0
- package/dist/fonts/resolve.d.ts.map +1 -1
- package/dist/fonts/resolve.js +2 -8
- package/dist/fonts/resolve.js.map +1 -1
- package/dist/generate/index.d.ts +4 -0
- package/dist/generate/index.d.ts.map +1 -1
- package/dist/generate/index.js +10 -4
- package/dist/generate/index.js.map +1 -1
- package/dist/generate/options.d.ts +11 -1
- package/dist/generate/options.d.ts.map +1 -1
- package/dist/generate/options.js.map +1 -1
- package/dist/generate/output-path.d.ts +6 -2
- package/dist/generate/output-path.d.ts.map +1 -1
- package/dist/generate/output-path.js +7 -2
- package/dist/generate/output-path.js.map +1 -1
- package/dist/generate/plan.d.ts.map +1 -1
- package/dist/generate/plan.js +3 -3
- package/dist/generate/plan.js.map +1 -1
- package/dist/generate/render-image.d.ts +6 -0
- package/dist/generate/render-image.d.ts.map +1 -1
- package/dist/generate/render-image.js +14 -4
- package/dist/generate/render-image.js.map +1 -1
- package/dist/image/index.d.ts +3 -1
- package/dist/image/index.d.ts.map +1 -1
- package/dist/image/index.js +4 -3
- package/dist/image/index.js.map +1 -1
- package/dist/image/jpeg.d.ts +5 -4
- package/dist/image/jpeg.d.ts.map +1 -1
- package/dist/image/jpeg.js +13 -36
- package/dist/image/jpeg.js.map +1 -1
- package/dist/image/load.d.ts.map +1 -1
- package/dist/image/load.js +4 -15
- package/dist/image/load.js.map +1 -1
- package/dist/image/resolve.d.ts.map +1 -1
- package/dist/image/resolve.js +2 -8
- package/dist/image/resolve.js.map +1 -1
- package/dist/image/uri.d.ts.map +1 -1
- package/dist/image/uri.js +2 -3
- package/dist/image/uri.js.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/jpeg/index.d.ts +10 -0
- package/dist/jpeg/index.d.ts.map +1 -0
- package/dist/jpeg/index.js +2 -0
- package/dist/jpeg/index.js.map +1 -0
- package/dist/jpeg/segments.d.ts +32 -0
- package/dist/jpeg/segments.d.ts.map +1 -0
- package/dist/jpeg/segments.js +66 -0
- package/dist/jpeg/segments.js.map +1 -0
- package/dist/layout/draw.d.ts +20 -0
- package/dist/layout/draw.d.ts.map +1 -0
- package/dist/layout/draw.js +32 -0
- package/dist/layout/draw.js.map +1 -0
- package/dist/layout/extent.d.ts +19 -0
- package/dist/layout/extent.d.ts.map +1 -0
- package/dist/layout/extent.js +24 -0
- package/dist/layout/extent.js.map +1 -0
- package/dist/layout/index.d.ts +7 -4
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +5 -3
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/lines.d.ts +0 -17
- package/dist/layout/lines.d.ts.map +1 -1
- package/dist/layout/lines.js +2 -35
- package/dist/layout/lines.js.map +1 -1
- package/dist/measure/faces.d.ts.map +1 -1
- package/dist/measure/faces.js +8 -2
- package/dist/measure/faces.js.map +1 -1
- package/dist/meta/index.d.ts +1 -0
- package/dist/meta/index.d.ts.map +1 -1
- package/dist/meta/index.js +1 -0
- package/dist/meta/index.js.map +1 -1
- package/dist/meta/path.d.ts +24 -0
- package/dist/meta/path.d.ts.map +1 -0
- package/dist/meta/path.js +41 -0
- package/dist/meta/path.js.map +1 -0
- package/dist/meta/tags.d.ts.map +1 -1
- package/dist/meta/tags.js +6 -1
- package/dist/meta/tags.js.map +1 -1
- package/dist/placement/index.d.ts +7 -2
- package/dist/placement/index.d.ts.map +1 -1
- package/dist/placement/index.js +9 -3
- package/dist/placement/index.js.map +1 -1
- package/dist/placement/relative.d.ts +8 -3
- package/dist/placement/relative.d.ts.map +1 -1
- package/dist/placement/relative.js +12 -5
- package/dist/placement/relative.js.map +1 -1
- package/dist/platform/base64.d.ts +13 -0
- package/dist/platform/base64.d.ts.map +1 -0
- package/dist/platform/base64.js +35 -0
- package/dist/platform/base64.js.map +1 -0
- package/dist/platform/rasteriser.browser.d.ts +16 -0
- package/dist/platform/rasteriser.browser.d.ts.map +1 -0
- package/dist/platform/rasteriser.browser.js +20 -0
- package/dist/platform/rasteriser.browser.js.map +1 -0
- package/dist/platform/rasteriser.node.d.ts +2 -0
- package/dist/platform/rasteriser.node.d.ts.map +1 -0
- package/dist/platform/rasteriser.node.js +2 -0
- package/dist/platform/rasteriser.node.js.map +1 -0
- package/dist/platform/read-file.browser.d.ts +17 -0
- package/dist/platform/read-file.browser.d.ts.map +1 -0
- package/dist/platform/read-file.browser.js +23 -0
- package/dist/platform/read-file.browser.js.map +1 -0
- package/dist/platform/read-file.node.d.ts +19 -0
- package/dist/platform/read-file.node.d.ts.map +1 -0
- package/dist/platform/read-file.node.js +31 -0
- package/dist/platform/read-file.node.js.map +1 -0
- package/dist/png/chunk.d.ts +23 -0
- package/dist/png/chunk.d.ts.map +1 -0
- package/dist/png/chunk.js +48 -0
- package/dist/png/chunk.js.map +1 -0
- package/dist/png/index.d.ts +13 -0
- package/dist/png/index.d.ts.map +1 -0
- package/dist/png/index.js +3 -0
- package/dist/png/index.js.map +1 -0
- package/dist/png/recompress.d.ts +23 -0
- package/dist/png/recompress.d.ts.map +1 -0
- package/dist/png/recompress.js +81 -0
- package/dist/png/recompress.js.map +1 -0
- package/dist/props.d.ts +11 -0
- package/dist/props.d.ts.map +1 -1
- package/dist/props.js +16 -0
- package/dist/props.js.map +1 -1
- package/dist/render/image.d.ts +20 -0
- package/dist/render/image.d.ts.map +1 -0
- package/dist/render/image.js +29 -0
- package/dist/render/image.js.map +1 -0
- package/dist/render/index.d.ts +2 -1
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +5 -4
- package/dist/render/index.js.map +1 -1
- package/dist/render/png.d.ts +14 -4
- package/dist/render/png.d.ts.map +1 -1
- package/dist/render/png.js +22 -23
- package/dist/render/png.js.map +1 -1
- package/dist/render/rasterise.d.ts +15 -0
- package/dist/render/rasterise.d.ts.map +1 -0
- package/dist/render/rasterise.js +34 -0
- package/dist/render/rasterise.js.map +1 -0
- package/dist/render/svg.d.ts.map +1 -1
- package/dist/render/svg.js +10 -2
- package/dist/render/svg.js.map +1 -1
- package/dist/sign/base64url.d.ts +16 -0
- package/dist/sign/base64url.d.ts.map +1 -0
- package/dist/sign/base64url.js +24 -0
- package/dist/sign/base64url.js.map +1 -0
- package/dist/sign/index.d.ts +49 -0
- package/dist/sign/index.d.ts.map +1 -0
- package/dist/sign/index.js +133 -0
- package/dist/sign/index.js.map +1 -0
- package/dist/stamp/carrier/index.d.ts +7 -0
- package/dist/stamp/carrier/index.d.ts.map +1 -0
- package/dist/stamp/carrier/index.js +27 -0
- package/dist/stamp/carrier/index.js.map +1 -0
- package/dist/stamp/carrier/isobmff.d.ts +7 -0
- package/dist/stamp/carrier/isobmff.d.ts.map +1 -0
- package/dist/stamp/carrier/isobmff.js +55 -0
- package/dist/stamp/carrier/isobmff.js.map +1 -0
- package/dist/stamp/carrier/jpeg.d.ts +4 -0
- package/dist/stamp/carrier/jpeg.d.ts.map +1 -0
- package/dist/stamp/carrier/jpeg.js +76 -0
- package/dist/stamp/carrier/jpeg.js.map +1 -0
- package/dist/stamp/carrier/png.d.ts +7 -0
- package/dist/stamp/carrier/png.d.ts.map +1 -0
- package/dist/stamp/carrier/png.js +50 -0
- package/dist/stamp/carrier/png.js.map +1 -0
- package/dist/stamp/carrier/riff.d.ts +4 -0
- package/dist/stamp/carrier/riff.d.ts.map +1 -0
- package/dist/stamp/carrier/riff.js +54 -0
- package/dist/stamp/carrier/riff.js.map +1 -0
- package/dist/stamp/carrier/types.d.ts +25 -0
- package/dist/stamp/carrier/types.d.ts.map +1 -0
- package/dist/stamp/carrier/types.js +2 -0
- package/dist/stamp/carrier/types.js.map +1 -0
- package/dist/stamp/chunk.d.ts +0 -2
- package/dist/stamp/chunk.d.ts.map +1 -1
- package/dist/stamp/chunk.js +10 -18
- package/dist/stamp/chunk.js.map +1 -1
- package/dist/stamp/config-digest.d.ts +18 -0
- package/dist/stamp/config-digest.d.ts.map +1 -1
- package/dist/stamp/config-digest.js +25 -0
- package/dist/stamp/config-digest.js.map +1 -1
- package/dist/stamp/index.d.ts +2 -2
- package/dist/stamp/index.d.ts.map +1 -1
- package/dist/stamp/index.js +2 -2
- package/dist/stamp/index.js.map +1 -1
- package/dist/stamp/payload.d.ts +28 -0
- package/dist/stamp/payload.d.ts.map +1 -0
- package/dist/stamp/payload.js +42 -0
- package/dist/stamp/payload.js.map +1 -0
- package/dist/stamp/read.d.ts +5 -4
- package/dist/stamp/read.d.ts.map +1 -1
- package/dist/stamp/read.js +26 -43
- package/dist/stamp/read.js.map +1 -1
- package/dist/stamp/window.d.ts +11 -0
- package/dist/stamp/window.d.ts.map +1 -0
- package/dist/stamp/window.js +11 -0
- package/dist/stamp/window.js.map +1 -0
- package/dist/stamp/write.d.ts +21 -0
- package/dist/stamp/write.d.ts.map +1 -0
- package/dist/stamp/write.js +31 -0
- package/dist/stamp/write.js.map +1 -0
- package/dist/templates/article/bottom.d.ts +15 -0
- package/dist/templates/article/bottom.d.ts.map +1 -0
- package/dist/templates/article/bottom.js +61 -0
- package/dist/templates/article/bottom.js.map +1 -0
- package/dist/templates/article/index.d.ts +12 -0
- package/dist/templates/article/index.d.ts.map +1 -0
- package/dist/templates/article/index.js +42 -0
- package/dist/templates/article/index.js.map +1 -0
- package/dist/templates/article/lines.d.ts +27 -0
- package/dist/templates/article/lines.d.ts.map +1 -0
- package/dist/templates/article/lines.js +53 -0
- package/dist/templates/article/lines.js.map +1 -0
- package/dist/templates/article/tags.d.ts +25 -0
- package/dist/templates/article/tags.d.ts.map +1 -0
- package/dist/templates/article/tags.js +63 -0
- package/dist/templates/article/tags.js.map +1 -0
- package/dist/templates/attribution.d.ts +2 -6
- package/dist/templates/attribution.d.ts.map +1 -1
- package/dist/templates/attribution.js +8 -22
- package/dist/templates/attribution.js.map +1 -1
- package/dist/templates/banner/badge-props.d.ts +16 -0
- package/dist/templates/banner/badge-props.d.ts.map +1 -0
- package/dist/templates/banner/badge-props.js +58 -0
- package/dist/templates/banner/badge-props.js.map +1 -0
- package/dist/templates/banner/index.d.ts.map +1 -1
- package/dist/templates/banner/index.js +6 -4
- package/dist/templates/banner/index.js.map +1 -1
- package/dist/templates/banner/version.d.ts.map +1 -1
- package/dist/templates/banner/version.js +4 -4
- package/dist/templates/banner/version.js.map +1 -1
- package/dist/templates/bottom.d.ts +23 -0
- package/dist/templates/bottom.d.ts.map +1 -0
- package/dist/templates/bottom.js +37 -0
- package/dist/templates/bottom.js.map +1 -0
- package/dist/templates/byline.d.ts +19 -0
- package/dist/templates/byline.d.ts.map +1 -0
- package/dist/templates/byline.js +45 -0
- package/dist/templates/byline.js.map +1 -0
- package/dist/templates/code/clip.js +1 -1
- package/dist/templates/code/clip.js.map +1 -1
- package/dist/templates/code/fit.js +1 -1
- package/dist/templates/code/fit.js.map +1 -1
- package/dist/templates/code/warn.d.ts +1 -1
- package/dist/templates/code/warn.d.ts.map +1 -1
- package/dist/templates/code/warn.js +2 -2
- package/dist/templates/code/warn.js.map +1 -1
- package/dist/templates/docs/chrome.d.ts +17 -0
- package/dist/templates/docs/chrome.d.ts.map +1 -0
- package/dist/templates/docs/chrome.js +44 -0
- package/dist/templates/docs/chrome.js.map +1 -0
- package/dist/templates/docs/crumbs.d.ts +14 -0
- package/dist/templates/docs/crumbs.d.ts.map +1 -0
- package/dist/templates/docs/crumbs.js +32 -0
- package/dist/templates/docs/crumbs.js.map +1 -0
- package/dist/templates/docs/index.d.ts +13 -0
- package/dist/templates/docs/index.d.ts.map +1 -0
- package/dist/templates/docs/index.js +47 -0
- package/dist/templates/docs/index.js.map +1 -0
- package/dist/templates/docs/lines.d.ts +14 -0
- package/dist/templates/docs/lines.d.ts.map +1 -0
- package/dist/templates/docs/lines.js +29 -0
- package/dist/templates/docs/lines.js.map +1 -0
- package/dist/templates/event/index.d.ts +12 -0
- package/dist/templates/event/index.d.ts.map +1 -0
- package/dist/templates/event/index.js +59 -0
- package/dist/templates/event/index.js.map +1 -0
- package/dist/templates/event/lines.d.ts +14 -0
- package/dist/templates/event/lines.d.ts.map +1 -0
- package/dist/templates/event/lines.js +29 -0
- package/dist/templates/event/lines.js.map +1 -0
- package/dist/templates/event/plate.d.ts +16 -0
- package/dist/templates/event/plate.d.ts.map +1 -0
- package/dist/templates/event/plate.js +36 -0
- package/dist/templates/event/plate.js.map +1 -0
- package/dist/templates/frame.d.ts +68 -0
- package/dist/templates/frame.d.ts.map +1 -0
- package/dist/templates/frame.js +63 -0
- package/dist/templates/frame.js.map +1 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +27 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/photo/index.d.ts +17 -0
- package/dist/templates/photo/index.d.ts.map +1 -0
- package/dist/templates/photo/index.js +51 -0
- package/dist/templates/photo/index.js.map +1 -0
- package/dist/templates/photo/lines.d.ts +21 -0
- package/dist/templates/photo/lines.d.ts.map +1 -0
- package/dist/templates/photo/lines.js +36 -0
- package/dist/templates/photo/lines.js.map +1 -0
- package/dist/templates/pill.d.ts +33 -0
- package/dist/templates/pill.d.ts.map +1 -0
- package/dist/templates/pill.js +50 -0
- package/dist/templates/pill.js.map +1 -0
- package/dist/templates/portrait.d.ts +40 -0
- package/dist/templates/portrait.d.ts.map +1 -0
- package/dist/templates/portrait.js +56 -0
- package/dist/templates/portrait.js.map +1 -0
- package/dist/templates/quote/index.d.ts +11 -0
- package/dist/templates/quote/index.d.ts.map +1 -0
- package/dist/templates/quote/index.js +60 -0
- package/dist/templates/quote/index.js.map +1 -0
- package/dist/templates/quote/lines.d.ts +24 -0
- package/dist/templates/quote/lines.d.ts.map +1 -0
- package/dist/templates/quote/lines.js +35 -0
- package/dist/templates/quote/lines.js.map +1 -0
- package/dist/templates/quote/mark.d.ts +13 -0
- package/dist/templates/quote/mark.d.ts.map +1 -0
- package/dist/templates/quote/mark.js +39 -0
- package/dist/templates/quote/mark.js.map +1 -0
- package/dist/templates/quote/speaker.d.ts +18 -0
- package/dist/templates/quote/speaker.d.ts.map +1 -0
- package/dist/templates/quote/speaker.js +41 -0
- package/dist/templates/quote/speaker.js.map +1 -0
- package/dist/templates/release/block.d.ts +8 -0
- package/dist/templates/release/block.d.ts.map +1 -0
- package/dist/templates/release/block.js +16 -0
- package/dist/templates/release/block.js.map +1 -0
- package/dist/templates/release/changes.d.ts +23 -0
- package/dist/templates/release/changes.d.ts.map +1 -0
- package/dist/templates/release/changes.js +45 -0
- package/dist/templates/release/changes.js.map +1 -0
- package/dist/templates/release/index.d.ts +11 -0
- package/dist/templates/release/index.d.ts.map +1 -0
- package/dist/templates/release/index.js +55 -0
- package/dist/templates/release/index.js.map +1 -0
- package/dist/templates/release/lines.d.ts +21 -0
- package/dist/templates/release/lines.d.ts.map +1 -0
- package/dist/templates/release/lines.js +36 -0
- package/dist/templates/release/lines.js.map +1 -0
- package/dist/templates/stat/index.d.ts +11 -0
- package/dist/templates/stat/index.d.ts.map +1 -0
- package/dist/templates/stat/index.js +43 -0
- package/dist/templates/stat/index.js.map +1 -0
- package/dist/templates/stat/lines.d.ts +23 -0
- package/dist/templates/stat/lines.d.ts.map +1 -0
- package/dist/templates/stat/lines.js +47 -0
- package/dist/templates/stat/lines.js.map +1 -0
- package/dist/templates/terminal/index.d.ts +16 -0
- package/dist/templates/terminal/index.d.ts.map +1 -0
- package/dist/templates/terminal/index.js +62 -0
- package/dist/templates/terminal/index.js.map +1 -0
- package/dist/templates/terminal/session.d.ts +17 -0
- package/dist/templates/terminal/session.d.ts.map +1 -0
- package/dist/templates/terminal/session.js +86 -0
- package/dist/templates/terminal/session.js.map +1 -0
- package/dist/templates/terminal/window.d.ts +14 -0
- package/dist/templates/terminal/window.d.ts.map +1 -0
- package/dist/templates/terminal/window.js +84 -0
- package/dist/templates/terminal/window.js.map +1 -0
- package/dist/templates/version.d.ts +16 -0
- package/dist/templates/version.d.ts.map +1 -0
- package/dist/templates/version.js +23 -0
- package/dist/templates/version.js.map +1 -0
- package/dist/templates/wordmark/index.d.ts +13 -0
- package/dist/templates/wordmark/index.d.ts.map +1 -0
- package/dist/templates/wordmark/index.js +53 -0
- package/dist/templates/wordmark/index.js.map +1 -0
- package/dist/templates/wordmark/lines.d.ts +22 -0
- package/dist/templates/wordmark/lines.d.ts.map +1 -0
- package/dist/templates/wordmark/lines.js +61 -0
- package/dist/templates/wordmark/lines.js.map +1 -0
- package/dist/templates/wordmark/mark.d.ts +16 -0
- package/dist/templates/wordmark/mark.d.ts.map +1 -0
- package/dist/templates/wordmark/mark.js +30 -0
- package/dist/templates/wordmark/mark.js.map +1 -0
- package/dist/text/clamp.d.ts +12 -0
- package/dist/text/clamp.d.ts.map +1 -0
- package/dist/text/clamp.js +41 -0
- package/dist/text/clamp.js.map +1 -0
- package/dist/text/ellipsis.d.ts +3 -0
- package/dist/text/ellipsis.d.ts.map +1 -0
- package/dist/text/ellipsis.js +3 -0
- package/dist/text/ellipsis.js.map +1 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -1
- package/dist/texture/grain.d.ts +17 -0
- package/dist/texture/grain.d.ts.map +1 -0
- package/dist/texture/grain.js +29 -0
- package/dist/texture/grain.js.map +1 -0
- package/dist/texture/index.d.ts +11 -0
- package/dist/texture/index.d.ts.map +1 -0
- package/dist/texture/index.js +20 -0
- package/dist/texture/index.js.map +1 -0
- package/dist/texture/pattern.d.ts +17 -0
- package/dist/texture/pattern.d.ts.map +1 -0
- package/dist/texture/pattern.js +45 -0
- package/dist/texture/pattern.js.map +1 -0
- package/dist/texture/resolve.d.ts +16 -0
- package/dist/texture/resolve.d.ts.map +1 -0
- package/dist/texture/resolve.js +20 -0
- package/dist/texture/resolve.js.map +1 -0
- package/dist/theme/index.d.ts +27 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +41 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/presets.d.ts +38 -0
- package/dist/theme/presets.d.ts.map +1 -0
- package/dist/theme/presets.js +150 -0
- package/dist/theme/presets.js.map +1 -0
- package/dist/types.d.ts +281 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/validate/background.d.ts +12 -0
- package/dist/validate/background.d.ts.map +1 -0
- package/dist/validate/background.js +53 -0
- package/dist/validate/background.js.map +1 -0
- package/dist/validate/collect.d.ts +9 -0
- package/dist/validate/collect.d.ts.map +1 -0
- package/dist/validate/collect.js +35 -0
- package/dist/validate/collect.js.map +1 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +2 -20
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/keys.d.ts +22 -0
- package/dist/validate/keys.d.ts.map +1 -1
- package/dist/validate/keys.js +69 -0
- package/dist/validate/keys.js.map +1 -1
- package/dist/validate/overrides.d.ts.map +1 -1
- package/dist/validate/overrides.js +5 -1
- package/dist/validate/overrides.js.map +1 -1
- package/dist/validate/texture.d.ts +11 -0
- package/dist/validate/texture.d.ts.map +1 -0
- package/dist/validate/texture.js +34 -0
- package/dist/validate/texture.js.map +1 -0
- package/dist/validate/values.d.ts +16 -10
- package/dist/validate/values.d.ts.map +1 -1
- package/dist/validate/values.js +31 -44
- package/dist/validate/values.js.map +1 -1
- package/package.json +16 -2
- package/dist/background.d.ts.map +0 -1
- package/dist/background.js +0 -65
- package/dist/background.js.map +0 -1
- package/dist/cli/args.d.ts +0 -14
- package/dist/cli/args.d.ts.map +0 -1
- package/dist/cli/args.js +0 -67
- package/dist/cli/args.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -102
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts +0 -95
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -208
- package/dist/config.js.map +0 -1
- package/dist/fonts.d.ts +0 -18
- package/dist/fonts.d.ts.map +0 -1
- package/dist/fonts.js +0 -102
- package/dist/fonts.js.map +0 -1
- package/dist/generate.d.ts +0 -63
- package/dist/generate.d.ts.map +0 -1
- package/dist/generate.js +0 -109
- package/dist/generate.js.map +0 -1
- package/dist/highlight.d.ts +0 -75
- package/dist/highlight.d.ts.map +0 -1
- package/dist/highlight.js +0 -137
- package/dist/highlight.js.map +0 -1
- package/dist/render.d.ts +0 -24
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -77
- package/dist/render.js.map +0 -1
- package/dist/stamp.d.ts +0 -29
- package/dist/stamp.d.ts.map +0 -1
- package/dist/stamp.js +0 -198
- package/dist/stamp.js.map +0 -1
- package/dist/templates/banner.d.ts +0 -9
- package/dist/templates/banner.d.ts.map +0 -1
- package/dist/templates/banner.js +0 -115
- package/dist/templates/banner.js.map +0 -1
- package/dist/templates/card.d.ts +0 -7
- package/dist/templates/card.d.ts.map +0 -1
- package/dist/templates/card.js +0 -72
- package/dist/templates/card.js.map +0 -1
- package/dist/templates/code.d.ts +0 -12
- package/dist/templates/code.d.ts.map +0 -1
- package/dist/templates/code.js +0 -275
- package/dist/templates/code.js.map +0 -1
- package/dist/templates/measure.d.ts +0 -11
- package/dist/templates/measure.d.ts.map +0 -1
- package/dist/templates/measure.js +0 -11
- package/dist/templates/measure.js.map +0 -1
- package/dist/templates/props.d.ts +0 -7
- package/dist/templates/props.d.ts.map +0 -1
- package/dist/templates/props.js +0 -17
- package/dist/templates/props.js.map +0 -1
- package/dist/templates/text.d.ts +0 -37
- package/dist/templates/text.d.ts.map +0 -1
- package/dist/templates/text.js +0 -26
- package/dist/templates/text.js.map +0 -1
- package/dist/text/stack.d.ts +0 -24
- package/dist/text/stack.d.ts.map +0 -1
- package/dist/text/stack.js +0 -18
- package/dist/text/stack.js.map +0 -1
- package/dist/text.d.ts +0 -56
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js +0 -78
- package/dist/text.js.map +0 -1
- package/dist/validate/sizes.d.ts +0 -9
- package/dist/validate/sizes.d.ts.map +0 -1
- package/dist/validate/sizes.js +0 -27
- package/dist/validate/sizes.js.map +0 -1
- package/dist/validate.d.ts +0 -15
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -300
- package/dist/validate.js.map +0 -1
package/dist/background.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { box, image as imageElement, scrim } from "./layout/index.js";
|
|
2
|
-
/** Behind a background image, and either side of one that is `contain`ed. */
|
|
3
|
-
const defaultBackdrop = "#000000";
|
|
4
|
-
/**
|
|
5
|
-
* How heavily the default scrim shades, top and bottom.
|
|
6
|
-
*
|
|
7
|
-
* It starts at a quarter rather than at nothing, because a template is free to
|
|
8
|
-
* put its text anywhere and a wash that only darkens the bottom leaves a
|
|
9
|
-
* centred title sitting on whatever the middle of the photograph happens to
|
|
10
|
-
* be. Shading the whole picture a little and the bottom a lot covers both, and
|
|
11
|
-
* a project that wants the picture untouched at the top sets `from: 0`.
|
|
12
|
-
*/
|
|
13
|
-
const defaultScrim = { from: 0.25, to: 0.65 };
|
|
14
|
-
/**
|
|
15
|
-
* A photograph behind the text: the backdrop, the picture, and the wash over
|
|
16
|
-
* it that keeps the text readable.
|
|
17
|
-
*
|
|
18
|
-
* The scrim is on by default and has to be turned off rather than on. Text
|
|
19
|
-
* over an unshaded photo is the failure this would otherwise ship with, and it
|
|
20
|
-
* is not one an author notices unless they look at every image.
|
|
21
|
-
*/
|
|
22
|
-
function imageBackground(background, area, id, asset) {
|
|
23
|
-
const backdrop = box(area, { fill: background.color ?? defaultBackdrop });
|
|
24
|
-
if (asset === undefined) {
|
|
25
|
-
return backdrop;
|
|
26
|
-
}
|
|
27
|
-
const shade = background.scrim ?? {};
|
|
28
|
-
return (backdrop +
|
|
29
|
-
imageElement(area, asset.href, { fit: background.fit ?? "cover" }) +
|
|
30
|
-
scrim(area, `${id}-scrim`, {
|
|
31
|
-
...(shade.color !== undefined && { color: shade.color }),
|
|
32
|
-
from: shade.from ?? defaultScrim.from,
|
|
33
|
-
to: shade.to ?? defaultScrim.to,
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Render a full-bleed background as SVG. For a gradient, this emits a `<defs>`
|
|
38
|
-
* block with a `<linearGradient>` (using the given `id`) followed by a filled
|
|
39
|
-
* rect; for a solid colour it emits just the rect.
|
|
40
|
-
*
|
|
41
|
-
* A background image has to be read before it can be drawn, which is the
|
|
42
|
-
* renderer's job. Called without one, an image background is the colour behind
|
|
43
|
-
* it, so a caller assembling an SVG by hand gets a plain image rather than a
|
|
44
|
-
* reference to something that is not there.
|
|
45
|
-
*/
|
|
46
|
-
export function backgroundSvg(background, dimensions, id, asset) {
|
|
47
|
-
const { width, height } = dimensions;
|
|
48
|
-
if (background.type === "solid") {
|
|
49
|
-
return `<rect width="${String(width)}" height="${String(height)}" fill="${background.color}"/>`;
|
|
50
|
-
}
|
|
51
|
-
if (background.type === "image") {
|
|
52
|
-
return imageBackground(background, { x: 0, y: 0, width, height }, id, asset);
|
|
53
|
-
}
|
|
54
|
-
const from = background.from ?? { x: 0, y: 0 };
|
|
55
|
-
const to = background.to ?? { x: 1, y: 1 };
|
|
56
|
-
const stops = background.stops
|
|
57
|
-
.map((stop) => `<stop offset="${stop.offset}" stop-color="${stop.color}"/>`)
|
|
58
|
-
.join("");
|
|
59
|
-
return (`<defs>` +
|
|
60
|
-
`<linearGradient id="${id}" x1="${String(from.x)}" y1="${String(from.y)}"` +
|
|
61
|
-
` x2="${String(to.x)}" y2="${String(to.y)}">${stops}</linearGradient>` +
|
|
62
|
-
`</defs>` +
|
|
63
|
-
`<rect width="${String(width)}" height="${String(height)}" fill="url(#${id})"/>`);
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=background.js.map
|
package/dist/background.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,KAAK,IAAI,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGtE,6EAA6E;AAC7E,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAE9C;;;;;;;GAOG;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E,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAC7B,EAAE,EACF,KAAK,CACN,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/C,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAE3C,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK;SAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,IAAI,CAAC,MAAM,iBAAiB,IAAI,CAAC,KAAK,KAAK,CAAC;SAC3E,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO,CACL,QAAQ;QACR,uBAAuB,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;QAC1E,QAAQ,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,mBAAmB;QACtE,SAAS;QACT,gBAAgB,MAAM,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CACjF,CAAC;AACJ,CAAC"}
|
package/dist/cli/args.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The parsed command line.
|
|
3
|
-
*/
|
|
4
|
-
export interface CliArgs {
|
|
5
|
-
readonly contentDir: string;
|
|
6
|
-
readonly configPath: string | undefined;
|
|
7
|
-
readonly overwrite: boolean;
|
|
8
|
-
readonly concurrency: number | undefined;
|
|
9
|
-
}
|
|
10
|
-
/** Help text for `--help`, and for a run that asks for nothing else. */
|
|
11
|
-
export declare const usage = "colophon: generate social meta images from frontmatter\n\nUsage:\n colophon [contentDir] [options]\n\nImages carry a stamp of the props, config and size they came from, so a rebuild\nrenders only the ones that have actually changed.\n\nOptions:\n -c, --config <path> Load a config module. Its default export is either a\n ColophonConfig or a function (async or not) returning\n one, for a config that has to compute something.\n -f, --force Re-render every image, ignoring the stamps\n -o, --overwrite Alias for --force\n --concurrency <n> How many images to render at once\n -h, --help Show this help\n\nDefaults:\n contentDir content\n --concurrency one per available CPU";
|
|
12
|
-
/** Read the command line into the options `generate` takes. */
|
|
13
|
-
export declare function parseCliArgs(argv: readonly string[]): CliArgs;
|
|
14
|
-
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED,wEAAwE;AACxE,eAAO,MAAM,KAAK,gxBAmB4B,CAAC;AAwB/C,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CA4B7D"}
|
package/dist/cli/args.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/** Help text for `--help`, and for a run that asks for nothing else. */
|
|
2
|
-
export const usage = `colophon: generate social meta images from frontmatter
|
|
3
|
-
|
|
4
|
-
Usage:
|
|
5
|
-
colophon [contentDir] [options]
|
|
6
|
-
|
|
7
|
-
Images carry a stamp of the props, config and size they came from, so a rebuild
|
|
8
|
-
renders only the ones that have actually changed.
|
|
9
|
-
|
|
10
|
-
Options:
|
|
11
|
-
-c, --config <path> Load a config module. Its default export is either a
|
|
12
|
-
ColophonConfig or a function (async or not) returning
|
|
13
|
-
one, for a config that has to compute something.
|
|
14
|
-
-f, --force Re-render every image, ignoring the stamps
|
|
15
|
-
-o, --overwrite Alias for --force
|
|
16
|
-
--concurrency <n> How many images to render at once
|
|
17
|
-
-h, --help Show this help
|
|
18
|
-
|
|
19
|
-
Defaults:
|
|
20
|
-
contentDir content
|
|
21
|
-
--concurrency one per available CPU`;
|
|
22
|
-
/** `--overwrite` is kept as an alias so existing build scripts keep working. */
|
|
23
|
-
const forceFlags = new Set(["-f", "--force", "-o", "--overwrite"]);
|
|
24
|
-
/** Flags that take the next argument as their value. */
|
|
25
|
-
const valueFlags = new Set(["-c", "--config", "--concurrency"]);
|
|
26
|
-
/**
|
|
27
|
-
* A mistyped count would otherwise reach `generate` as `NaN` and be reported
|
|
28
|
-
* without naming the flag it came from, so it is rejected here instead.
|
|
29
|
-
*/
|
|
30
|
-
function parseConcurrency(value) {
|
|
31
|
-
const parsed = Number(value);
|
|
32
|
-
if (!Number.isSafeInteger(parsed) || parsed < 1) {
|
|
33
|
-
throw new Error(`Invalid value for --concurrency: "${value}"; expected a positive integer.`);
|
|
34
|
-
}
|
|
35
|
-
return parsed;
|
|
36
|
-
}
|
|
37
|
-
/** Read the command line into the options `generate` takes. */
|
|
38
|
-
export function parseCliArgs(argv) {
|
|
39
|
-
let contentDir = "content";
|
|
40
|
-
let configPath;
|
|
41
|
-
let shouldOverwrite = false;
|
|
42
|
-
let concurrency;
|
|
43
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
44
|
-
const arg = argv[index];
|
|
45
|
-
if (arg !== undefined && valueFlags.has(arg)) {
|
|
46
|
-
index += 1;
|
|
47
|
-
const value = argv[index];
|
|
48
|
-
if (value === undefined) {
|
|
49
|
-
throw new Error(`Missing value for ${arg}`);
|
|
50
|
-
}
|
|
51
|
-
if (arg === "--concurrency") {
|
|
52
|
-
concurrency = parseConcurrency(value);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
configPath = value;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else if (arg !== undefined && forceFlags.has(arg)) {
|
|
59
|
-
shouldOverwrite = true;
|
|
60
|
-
}
|
|
61
|
-
else if (arg !== undefined && !arg.startsWith("-")) {
|
|
62
|
-
contentDir = arg;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return { contentDir, configPath, overwrite: shouldOverwrite, concurrency };
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=args.js.map
|
package/dist/cli/args.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAUA,wEAAwE;AACxE,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;8CAmByB,CAAC;AAE/C,gFAAgF;AAChF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;AAEnE,wDAAwD;AACxD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;AAEhE;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE7B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,qCAAqC,KAAK,iCAAiC,CAC5E,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,YAAY,CAAC,IAAuB;IAClD,IAAI,UAAU,GAAG,SAAS,CAAC;IAC3B,IAAI,UAA8B,CAAC;IACnC,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,WAA+B,CAAC;IAEpC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAExB,IAAI,GAAG,KAAK,SAAS,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7C,KAAK,IAAI,CAAC,CAAC;YACX,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;YAC9C,CAAC;YACD,IAAI,GAAG,KAAK,eAAe,EAAE,CAAC;gBAC5B,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACxC,CAAC;iBAAM,CAAC;gBACN,UAAU,GAAG,KAAK,CAAC;YACrB,CAAC;QACH,CAAC;aAAM,IAAI,GAAG,KAAK,SAAS,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACpD,eAAe,GAAG,IAAI,CAAC;QACzB,CAAC;aAAM,IAAI,GAAG,KAAK,SAAS,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACrD,UAAU,GAAG,GAAG,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;AAC7E,CAAC"}
|
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { pathToFileURL } from "node:url";
|
|
4
|
-
import { generate } from "./generate.js";
|
|
5
|
-
const usage = `colophon — generate social meta images from frontmatter
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
colophon [contentDir] [options]
|
|
9
|
-
|
|
10
|
-
Images carry a stamp of the props, config and size they came from, so a rebuild
|
|
11
|
-
renders only the ones that have actually changed.
|
|
12
|
-
|
|
13
|
-
Options:
|
|
14
|
-
-c, --config <path> Load a config module (default export = ColophonConfig)
|
|
15
|
-
-f, --force Re-render every image, ignoring the stamps
|
|
16
|
-
-o, --overwrite Alias for --force
|
|
17
|
-
--concurrency <n> How many images to render at once
|
|
18
|
-
-h, --help Show this help
|
|
19
|
-
|
|
20
|
-
Defaults:
|
|
21
|
-
contentDir content
|
|
22
|
-
--concurrency one per available CPU`;
|
|
23
|
-
/** `--overwrite` is kept as an alias so existing build scripts keep working. */
|
|
24
|
-
const forceFlags = new Set(["-f", "--force", "-o", "--overwrite"]);
|
|
25
|
-
/** Flags that take the next argument as their value. */
|
|
26
|
-
const valueFlags = new Set(["-c", "--config", "--concurrency"]);
|
|
27
|
-
/**
|
|
28
|
-
* A mistyped count would otherwise reach `generate` as `NaN` and be reported
|
|
29
|
-
* without naming the flag it came from, so it is rejected here instead.
|
|
30
|
-
*/
|
|
31
|
-
function parseConcurrency(value) {
|
|
32
|
-
const parsed = Number(value);
|
|
33
|
-
if (!Number.isSafeInteger(parsed) || parsed < 1) {
|
|
34
|
-
throw new Error(`Invalid value for --concurrency: "${value}"; expected a positive integer.`);
|
|
35
|
-
}
|
|
36
|
-
return parsed;
|
|
37
|
-
}
|
|
38
|
-
function parseCliArgs(argv) {
|
|
39
|
-
let contentDir = "content";
|
|
40
|
-
let configPath;
|
|
41
|
-
let shouldOverwrite = false;
|
|
42
|
-
let concurrency;
|
|
43
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
44
|
-
const arg = argv[index];
|
|
45
|
-
if (arg !== undefined && valueFlags.has(arg)) {
|
|
46
|
-
index += 1;
|
|
47
|
-
const value = argv[index];
|
|
48
|
-
if (value === undefined) {
|
|
49
|
-
throw new Error(`Missing value for ${arg}`);
|
|
50
|
-
}
|
|
51
|
-
if (arg === "--concurrency") {
|
|
52
|
-
concurrency = parseConcurrency(value);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
configPath = value;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else if (arg !== undefined && forceFlags.has(arg)) {
|
|
59
|
-
shouldOverwrite = true;
|
|
60
|
-
}
|
|
61
|
-
else if (arg !== undefined && !arg.startsWith("-")) {
|
|
62
|
-
contentDir = arg;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return { contentDir, configPath, overwrite: shouldOverwrite, concurrency };
|
|
66
|
-
}
|
|
67
|
-
async function loadConfig(configPath) {
|
|
68
|
-
if (configPath === undefined) {
|
|
69
|
-
return undefined;
|
|
70
|
-
}
|
|
71
|
-
const url = pathToFileURL(path.resolve(configPath)).href;
|
|
72
|
-
const module = (await import(url));
|
|
73
|
-
return module.default;
|
|
74
|
-
}
|
|
75
|
-
async function main() {
|
|
76
|
-
const argv = process.argv.slice(2);
|
|
77
|
-
if (argv.includes("-h") || argv.includes("--help")) {
|
|
78
|
-
console.log(usage);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const args = parseCliArgs(argv);
|
|
82
|
-
const config = await loadConfig(args.configPath);
|
|
83
|
-
const results = await generate({
|
|
84
|
-
contentDir: args.contentDir,
|
|
85
|
-
overwrite: args.overwrite,
|
|
86
|
-
...(config !== undefined && { config }),
|
|
87
|
-
...(args.concurrency !== undefined && { concurrency: args.concurrency }),
|
|
88
|
-
onResult: (result) => {
|
|
89
|
-
console.log(`${result.skipped ? "skip " : "wrote"} ${result.outputPath}`);
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
const written = results.filter((result) => !result.skipped).length;
|
|
93
|
-
console.log(`Done: ${String(written)} written, ${String(results.length - written)} skipped.`);
|
|
94
|
-
}
|
|
95
|
-
try {
|
|
96
|
-
await main();
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
100
|
-
process.exitCode = 1;
|
|
101
|
-
}
|
|
102
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAUzC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;8CAiBgC,CAAC;AAE/C,gFAAgF;AAChF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;AAEnE,wDAAwD;AACxD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;AAEhE;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAE7B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,qCAAqC,KAAK,iCAAiC,CAC5E,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,IAAuB;IAC3C,IAAI,UAAU,GAAG,SAAS,CAAC;IAC3B,IAAI,UAA8B,CAAC;IACnC,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,WAA+B,CAAC;IAEp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AC,WAAW,CACjF,CAAC;AACJ,CAAC;AAED,IAAI,CAAC;IACH,MAAM,IAAI,EAAE,CAAC;AACf,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/config.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { BrandColors, CodeStyle, ColophonConfig, OutputSize, ResolvedConfig } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Named output-size presets covering the common social-image standards. Each
|
|
4
|
-
* `name` becomes the filename suffix (e.g. `my-post-og.png`).
|
|
5
|
-
*
|
|
6
|
-
* - `og` — 1.91:1, the Open Graph standard (`og:image`): Facebook, LinkedIn,
|
|
7
|
-
* Slack, Discord, WhatsApp, Mastodon, and the usual `twitter:image` reuse.
|
|
8
|
-
* - `square` — 1:1, X/Twitter `summary` card and a universal fallback.
|
|
9
|
-
* - `twitter` — 2:1, X/Twitter `summary_large_image` card.
|
|
10
|
-
* - `pinterest` — 2:3 tall pin.
|
|
11
|
-
*/
|
|
12
|
-
export declare const SIZE_PRESETS: {
|
|
13
|
-
readonly og: {
|
|
14
|
-
readonly name: "og";
|
|
15
|
-
readonly width: 1200;
|
|
16
|
-
readonly height: 630;
|
|
17
|
-
};
|
|
18
|
-
readonly square: {
|
|
19
|
-
readonly name: "square";
|
|
20
|
-
readonly width: 1200;
|
|
21
|
-
readonly height: 1200;
|
|
22
|
-
};
|
|
23
|
-
readonly twitter: {
|
|
24
|
-
readonly name: "twitter";
|
|
25
|
-
readonly width: 1200;
|
|
26
|
-
readonly height: 600;
|
|
27
|
-
};
|
|
28
|
-
readonly pinterest: {
|
|
29
|
-
readonly name: "pinterest";
|
|
30
|
-
readonly width: 1000;
|
|
31
|
-
readonly height: 1500;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Default output sizes: the Open Graph landscape plus a square. Between them
|
|
36
|
-
* they satisfy `og:image` and both `twitter:image` card types.
|
|
37
|
-
*/
|
|
38
|
-
export declare const DEFAULT_SIZES: readonly OutputSize[];
|
|
39
|
-
/**
|
|
40
|
-
* Default font stack, used when no fonts are configured. It names families and
|
|
41
|
-
* hopes the machine has them, which is exactly what `config.fonts` exists to
|
|
42
|
-
* avoid: supply a font file and the output stops depending on the machine.
|
|
43
|
-
*/
|
|
44
|
-
export declare const DEFAULT_FONT_FAMILY = "Arial, Helvetica, sans-serif";
|
|
45
|
-
/** Neutral default palette, used when no `colors.brand` is supplied. */
|
|
46
|
-
export declare const DEFAULT_COLORS: Required<BrandColors>;
|
|
47
|
-
/**
|
|
48
|
-
* Default monospace stack for the `code` template. It ends in the generic
|
|
49
|
-
* `monospace` family so it always resolves to something, whatever fonts the
|
|
50
|
-
* machine running the build happens to have.
|
|
51
|
-
*/
|
|
52
|
-
export declare const DEFAULT_CODE_FONT_FAMILY = "\"JetBrains Mono\", \"Source Code Pro\", \"DejaVu Sans Mono\", Menlo, Consolas, monospace";
|
|
53
|
-
/**
|
|
54
|
-
* Default `code` template styling. `charWidthRatio` and `lineHeight` drive the
|
|
55
|
-
* monospace grid the snippet is laid out on; the font-size bounds are
|
|
56
|
-
* fractions of the image width so they hold at every output size.
|
|
57
|
-
*
|
|
58
|
-
* `minFontScale` of `0.025` is roughly 30px on a 1200px-wide image, which
|
|
59
|
-
* still reads when a feed shows that image at half size. A snippet too long to
|
|
60
|
-
* fit at that size is truncated rather than shrunk, so a long sample loses
|
|
61
|
-
* lines on the shorter landscape formats.
|
|
62
|
-
*/
|
|
63
|
-
export declare const DEFAULT_CODE_STYLE: Required<CodeStyle>;
|
|
64
|
-
/**
|
|
65
|
-
* Identity helper that returns its argument typed as {@link ColophonConfig}.
|
|
66
|
-
* Use it in a config module to get editor completion and type-checking.
|
|
67
|
-
*/
|
|
68
|
-
export declare function defineConfig(config: ColophonConfig): ColophonConfig;
|
|
69
|
-
/**
|
|
70
|
-
* Apply defaults to a user config. Safe to call with no argument.
|
|
71
|
-
*
|
|
72
|
-
* Unknown options are rejected before anything is resolved, so a config
|
|
73
|
-
* written against a different version of the package is a build error rather
|
|
74
|
-
* than a set of images quietly rendered with the defaults.
|
|
75
|
-
*/
|
|
76
|
-
export declare function resolveConfig(config?: ColophonConfig): ResolvedConfig;
|
|
77
|
-
/**
|
|
78
|
-
* Apply a size's own overrides to a config and resolve the result: the config
|
|
79
|
-
* one image is actually rendered with.
|
|
80
|
-
*
|
|
81
|
-
* The overrides are folded into the user config and the whole thing resolved
|
|
82
|
-
* again, rather than patched onto an already-resolved config, so that anything
|
|
83
|
-
* derived stays consistent — a size that overrides `colors.brand` gets the
|
|
84
|
-
* default gradient rebuilt around its brand, exactly as a config setting the
|
|
85
|
-
* same colour at the top level would.
|
|
86
|
-
*
|
|
87
|
-
* `colors` and `code` merge over their config-level counterparts, because both
|
|
88
|
-
* are bags of independent settings and the point of the feature is to change
|
|
89
|
-
* one of them. The rest replace: a `background` is a union whose variants have
|
|
90
|
-
* different keys, so half of one over half of another is not a background at
|
|
91
|
-
* all, and `badge` carries a required `text` that a partial override could not
|
|
92
|
-
* supply.
|
|
93
|
-
*/
|
|
94
|
-
export declare function resolveConfigForSize(config: ColophonConfig | undefined, size: OutputSize): ResolvedConfig;
|
|
95
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,cAAc,EAEd,UAAU,EACV,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY;;iBACjB,IAAI,EAAE,IAAI;iBAAE,KAAK,EAAE,IAAI;iBAAE,MAAM,EAAE,GAAG;;;iBAChC,IAAI,EAAE,QAAQ;iBAAE,KAAK,EAAE,IAAI;iBAAE,MAAM,EAAE,IAAI;;;iBACxC,IAAI,EAAE,SAAS;iBAAE,KAAK,EAAE,IAAI;iBAAE,MAAM,EAAE,GAAG;;;iBACvC,IAAI,EAAE,WAAW;iBAAE,KAAK,EAAE,IAAI;iBAAE,MAAM,EAAE,IAAI;;CACZ,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAG9C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iCAAiC,CAAC;AAElE,wEAAwE;AACxE,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAKhD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8FACkD,CAAC;AAExF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,SAAS,CASlD,CAAC;AAcF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAEnE;AA2ED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,cAAmB,GAAG,cAAc,CAoBzE;AAkBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc,GAAG,SAAS,EAClC,IAAI,EAAE,UAAU,GACf,cAAc,CAchB"}
|
package/dist/config.js
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { resolveFonts } from "./fonts.js";
|
|
2
|
-
import { builtinTemplates } from "./templates/index.js";
|
|
3
|
-
import { validateConfig } from "./validate.js";
|
|
4
|
-
/**
|
|
5
|
-
* Named output-size presets covering the common social-image standards. Each
|
|
6
|
-
* `name` becomes the filename suffix (e.g. `my-post-og.png`).
|
|
7
|
-
*
|
|
8
|
-
* - `og` — 1.91:1, the Open Graph standard (`og:image`): Facebook, LinkedIn,
|
|
9
|
-
* Slack, Discord, WhatsApp, Mastodon, and the usual `twitter:image` reuse.
|
|
10
|
-
* - `square` — 1:1, X/Twitter `summary` card and a universal fallback.
|
|
11
|
-
* - `twitter` — 2:1, X/Twitter `summary_large_image` card.
|
|
12
|
-
* - `pinterest` — 2:3 tall pin.
|
|
13
|
-
*/
|
|
14
|
-
export const SIZE_PRESETS = {
|
|
15
|
-
og: { name: "og", width: 1200, height: 630 },
|
|
16
|
-
square: { name: "square", width: 1200, height: 1200 },
|
|
17
|
-
twitter: { name: "twitter", width: 1200, height: 600 },
|
|
18
|
-
pinterest: { name: "pinterest", width: 1000, height: 1500 },
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Default output sizes: the Open Graph landscape plus a square. Between them
|
|
22
|
-
* they satisfy `og:image` and both `twitter:image` card types.
|
|
23
|
-
*/
|
|
24
|
-
export const DEFAULT_SIZES = [
|
|
25
|
-
SIZE_PRESETS.og,
|
|
26
|
-
SIZE_PRESETS.square,
|
|
27
|
-
];
|
|
28
|
-
/**
|
|
29
|
-
* Default font stack, used when no fonts are configured. It names families and
|
|
30
|
-
* hopes the machine has them, which is exactly what `config.fonts` exists to
|
|
31
|
-
* avoid: supply a font file and the output stops depending on the machine.
|
|
32
|
-
*/
|
|
33
|
-
export const DEFAULT_FONT_FAMILY = "Arial, Helvetica, sans-serif";
|
|
34
|
-
/** Neutral default palette, used when no `colors.brand` is supplied. */
|
|
35
|
-
export const DEFAULT_COLORS = {
|
|
36
|
-
brand: "#4f46e5",
|
|
37
|
-
brandDark: "#3730a3",
|
|
38
|
-
brandWarm: "#db2777",
|
|
39
|
-
foreground: "#ffffff",
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Default monospace stack for the `code` template. It ends in the generic
|
|
43
|
-
* `monospace` family so it always resolves to something, whatever fonts the
|
|
44
|
-
* machine running the build happens to have.
|
|
45
|
-
*/
|
|
46
|
-
export const DEFAULT_CODE_FONT_FAMILY = '"JetBrains Mono", "Source Code Pro", "DejaVu Sans Mono", Menlo, Consolas, monospace';
|
|
47
|
-
/**
|
|
48
|
-
* Default `code` template styling. `charWidthRatio` and `lineHeight` drive the
|
|
49
|
-
* monospace grid the snippet is laid out on; the font-size bounds are
|
|
50
|
-
* fractions of the image width so they hold at every output size.
|
|
51
|
-
*
|
|
52
|
-
* `minFontScale` of `0.025` is roughly 30px on a 1200px-wide image, which
|
|
53
|
-
* still reads when a feed shows that image at half size. A snippet too long to
|
|
54
|
-
* fit at that size is truncated rather than shrunk, so a long sample loses
|
|
55
|
-
* lines on the shorter landscape formats.
|
|
56
|
-
*/
|
|
57
|
-
export const DEFAULT_CODE_STYLE = {
|
|
58
|
-
theme: "github-dark",
|
|
59
|
-
fontFamily: DEFAULT_CODE_FONT_FAMILY,
|
|
60
|
-
charWidthRatio: 0.6,
|
|
61
|
-
lineHeight: 1.55,
|
|
62
|
-
tabSize: 2,
|
|
63
|
-
cornerScale: 0.025,
|
|
64
|
-
maxFontScale: 0.075,
|
|
65
|
-
minFontScale: 0.025,
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Default warning handler. Colophon runs at build time, so a compromise the
|
|
69
|
-
* renderer had to make belongs in the build log by default — silence is opt-in
|
|
70
|
-
* via `config.onWarning`.
|
|
71
|
-
*/
|
|
72
|
-
function warnToConsole(message) {
|
|
73
|
-
// The console is the point: this is the default sink, replaced wholesale by
|
|
74
|
-
// a caller-supplied `onWarning`.
|
|
75
|
-
// eslint-disable-next-line no-console
|
|
76
|
-
console.warn(`colophon: ${message}`);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Identity helper that returns its argument typed as {@link ColophonConfig}.
|
|
80
|
-
* Use it in a config module to get editor completion and type-checking.
|
|
81
|
-
*/
|
|
82
|
-
export function defineConfig(config) {
|
|
83
|
-
return config;
|
|
84
|
-
}
|
|
85
|
-
function resolveColors(colors) {
|
|
86
|
-
if (colors === undefined) {
|
|
87
|
-
return DEFAULT_COLORS;
|
|
88
|
-
}
|
|
89
|
-
// When a project supplies only `brand`, use it for the whole gradient rather
|
|
90
|
-
// than mixing in the neutral defaults, which would clash.
|
|
91
|
-
return {
|
|
92
|
-
brand: colors.brand,
|
|
93
|
-
brandDark: colors.brandDark ?? colors.brand,
|
|
94
|
-
brandWarm: colors.brandWarm ?? colors.brand,
|
|
95
|
-
foreground: colors.foreground ?? DEFAULT_COLORS.foreground,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function defaultBackground(colors) {
|
|
99
|
-
return {
|
|
100
|
-
type: "gradient",
|
|
101
|
-
stops: [
|
|
102
|
-
{ offset: "0%", color: colors.brandDark },
|
|
103
|
-
{ offset: "55%", color: colors.brand },
|
|
104
|
-
{ offset: "100%", color: colors.brandWarm },
|
|
105
|
-
],
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function resolveCode(code) {
|
|
109
|
-
return { ...DEFAULT_CODE_STYLE, ...code };
|
|
110
|
-
}
|
|
111
|
-
function resolveSizes(sizes) {
|
|
112
|
-
if (sizes === undefined || sizes.length === 0) {
|
|
113
|
-
return DEFAULT_SIZES;
|
|
114
|
-
}
|
|
115
|
-
const seen = new Set();
|
|
116
|
-
for (const size of sizes) {
|
|
117
|
-
if (seen.has(size.name)) {
|
|
118
|
-
throw new Error(`Duplicate output size name "${size.name}"; names must be unique so each image gets a distinct filename.`);
|
|
119
|
-
}
|
|
120
|
-
seen.add(size.name);
|
|
121
|
-
}
|
|
122
|
-
return sizes;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Whether to load the machine's own fonts. Configured fonts are meant to make
|
|
126
|
-
* the output the same everywhere, so supplying any turns system fonts off
|
|
127
|
-
* unless the project asks for them back.
|
|
128
|
-
*/
|
|
129
|
-
function shouldLoadSystemFonts(systemFonts, fonts) {
|
|
130
|
-
if (systemFonts === undefined) {
|
|
131
|
-
return fonts.length === 0;
|
|
132
|
-
}
|
|
133
|
-
if (!systemFonts && fonts.length === 0) {
|
|
134
|
-
throw new Error("systemFonts is false and no fonts are configured, so no text could be" +
|
|
135
|
-
" rendered. Add fonts, or leave systemFonts unset.");
|
|
136
|
-
}
|
|
137
|
-
return systemFonts;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Apply defaults to a user config. Safe to call with no argument.
|
|
141
|
-
*
|
|
142
|
-
* Unknown options are rejected before anything is resolved, so a config
|
|
143
|
-
* written against a different version of the package is a build error rather
|
|
144
|
-
* than a set of images quietly rendered with the defaults.
|
|
145
|
-
*/
|
|
146
|
-
export function resolveConfig(config = {}) {
|
|
147
|
-
validateConfig(config);
|
|
148
|
-
const colors = resolveColors(config.colors);
|
|
149
|
-
const fonts = resolveFonts(config.fonts);
|
|
150
|
-
return {
|
|
151
|
-
colors,
|
|
152
|
-
background: config.background ?? defaultBackground(colors),
|
|
153
|
-
fonts,
|
|
154
|
-
systemFonts: shouldLoadSystemFonts(config.systemFonts, fonts),
|
|
155
|
-
// A project that supplies one font should not have to name it twice.
|
|
156
|
-
fontFamily: config.fontFamily ?? fonts[0]?.family ?? DEFAULT_FONT_FAMILY,
|
|
157
|
-
footer: config.footer,
|
|
158
|
-
badge: config.badge,
|
|
159
|
-
code: resolveCode(config.code),
|
|
160
|
-
onWarning: config.onWarning ?? warnToConsole,
|
|
161
|
-
sizes: resolveSizes(config.sizes),
|
|
162
|
-
templates: { ...builtinTemplates, ...config.templates },
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Merge a size's colour overrides onto the config's.
|
|
167
|
-
*
|
|
168
|
-
* A size may name any single shade, so the merge starts from the full default
|
|
169
|
-
* palette when the config sets no colours of its own. Starting from nothing
|
|
170
|
-
* instead would hand `resolveColors` a lone `foreground`, and its rule that a
|
|
171
|
-
* bare `brand` colours the whole gradient would then flatten the default
|
|
172
|
-
* gradient — a size asking only for darker text would silently lose it.
|
|
173
|
-
*/
|
|
174
|
-
function mergeColors(base, overrides) {
|
|
175
|
-
return { ...(base ?? DEFAULT_COLORS), ...overrides };
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Apply a size's own overrides to a config and resolve the result: the config
|
|
179
|
-
* one image is actually rendered with.
|
|
180
|
-
*
|
|
181
|
-
* The overrides are folded into the user config and the whole thing resolved
|
|
182
|
-
* again, rather than patched onto an already-resolved config, so that anything
|
|
183
|
-
* derived stays consistent — a size that overrides `colors.brand` gets the
|
|
184
|
-
* default gradient rebuilt around its brand, exactly as a config setting the
|
|
185
|
-
* same colour at the top level would.
|
|
186
|
-
*
|
|
187
|
-
* `colors` and `code` merge over their config-level counterparts, because both
|
|
188
|
-
* are bags of independent settings and the point of the feature is to change
|
|
189
|
-
* one of them. The rest replace: a `background` is a union whose variants have
|
|
190
|
-
* different keys, so half of one over half of another is not a background at
|
|
191
|
-
* all, and `badge` carries a required `text` that a partial override could not
|
|
192
|
-
* supply.
|
|
193
|
-
*/
|
|
194
|
-
export function resolveConfigForSize(config, size) {
|
|
195
|
-
const base = config ?? {};
|
|
196
|
-
return resolveConfig({
|
|
197
|
-
...base,
|
|
198
|
-
...(size.colors !== undefined && {
|
|
199
|
-
colors: mergeColors(base.colors, size.colors),
|
|
200
|
-
}),
|
|
201
|
-
...(size.code !== undefined && { code: { ...base.code, ...size.code } }),
|
|
202
|
-
...(size.background !== undefined && { background: size.background }),
|
|
203
|
-
...(size.fontFamily !== undefined && { fontFamily: size.fontFamily }),
|
|
204
|
-
...(size.footer !== undefined && { footer: size.footer }),
|
|
205
|
-
...(size.badge !== undefined && { badge: size.badge }),
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAA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,CAAC;QACzD,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;KACvD,CAAC,CAAC;AACL,CAAC"}
|
package/dist/fonts.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { FontSource } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Validate the configured fonts and make their paths absolute. Safe to call
|
|
4
|
-
* with no fonts, which is the default.
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolveFonts(fonts: readonly FontSource[] | undefined): readonly FontSource[];
|
|
7
|
-
/**
|
|
8
|
-
* File paths for the configured fonts, in order, writing any supplied as
|
|
9
|
-
* bytes to a temp file first.
|
|
10
|
-
*/
|
|
11
|
-
export declare function fontFilePaths(fonts: readonly FontSource[]): Promise<string[]>;
|
|
12
|
-
/**
|
|
13
|
-
* The family the rasteriser should fall back to when a `font-family` names
|
|
14
|
-
* something it has not loaded — the first declared family, so the fallback is
|
|
15
|
-
* the same wherever the build runs rather than whichever font loaded first.
|
|
16
|
-
*/
|
|
17
|
-
export declare function fallbackFamily(fonts: readonly FontSource[]): string | undefined;
|
|
18
|
-
//# sourceMappingURL=fonts.d.ts.map
|
package/dist/fonts.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAwE7C;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,GACvC,SAAS,UAAU,EAAE,CAMvB;AA8BD;;;GAGG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,UAAU,EAAE,GAC3B,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,UAAU,EAAE,GAC3B,MAAM,GAAG,SAAS,CAEpB"}
|