@tin.so/core 0.0.0-stage → 0.1.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.
Files changed (45) hide show
  1. package/README.md +32 -2
  2. package/dist/index-CtUX1lFe.d.mts +1076 -0
  3. package/dist/index.d.mts +2 -0
  4. package/dist/index.mjs +1 -0
  5. package/dist/node.d.mts +21 -0
  6. package/dist/node.mjs +31 -0
  7. package/dist/src-BdXa6abO.mjs +8546 -0
  8. package/fonts/commit-mono/LICENSE.txt +90 -0
  9. package/fonts/commit-mono/commit-mono-400-italic.ttf +0 -0
  10. package/fonts/commit-mono/commit-mono-400.ttf +0 -0
  11. package/fonts/commit-mono/commit-mono-700.ttf +0 -0
  12. package/fonts/fira-code/LICENSE.txt +93 -0
  13. package/fonts/fira-code/fira-code-400.ttf +0 -0
  14. package/fonts/fira-code/fira-code-700.ttf +0 -0
  15. package/fonts/geist-mono/LICENSE.txt +93 -0
  16. package/fonts/geist-mono/geist-mono-400.ttf +0 -0
  17. package/fonts/geist-mono/geist-mono-700.ttf +0 -0
  18. package/fonts/google-sans-code/LICENSE.txt +93 -0
  19. package/fonts/google-sans-code/google-sans-code-400-italic.ttf +0 -0
  20. package/fonts/google-sans-code/google-sans-code-400.ttf +0 -0
  21. package/fonts/google-sans-code/google-sans-code-700.ttf +0 -0
  22. package/fonts/ibm-plex-mono/LICENSE.txt +93 -0
  23. package/fonts/ibm-plex-mono/ibm-plex-mono-500-italic.ttf +0 -0
  24. package/fonts/ibm-plex-mono/ibm-plex-mono-500.ttf +0 -0
  25. package/fonts/ibm-plex-mono/ibm-plex-mono-700.ttf +0 -0
  26. package/fonts/inter/LICENSE.txt +93 -0
  27. package/fonts/inter/inter-400.ttf +0 -0
  28. package/fonts/inter/inter-500.ttf +0 -0
  29. package/fonts/jetbrains-mono/LICENSE.txt +93 -0
  30. package/fonts/jetbrains-mono/jetbrains-mono-500-italic.ttf +0 -0
  31. package/fonts/jetbrains-mono/jetbrains-mono-500.ttf +0 -0
  32. package/fonts/jetbrains-mono/jetbrains-mono-700.ttf +0 -0
  33. package/fonts/roboto-mono/LICENSE.txt +93 -0
  34. package/fonts/roboto-mono/roboto-mono-400-italic.ttf +0 -0
  35. package/fonts/roboto-mono/roboto-mono-400.ttf +0 -0
  36. package/fonts/roboto-mono/roboto-mono-700.ttf +0 -0
  37. package/fonts/source-code-pro/LICENSE.txt +93 -0
  38. package/fonts/source-code-pro/source-code-pro-400-italic.ttf +0 -0
  39. package/fonts/source-code-pro/source-code-pro-400.ttf +0 -0
  40. package/fonts/source-code-pro/source-code-pro-700.ttf +0 -0
  41. package/fonts/space-mono/LICENSE.txt +93 -0
  42. package/fonts/space-mono/space-mono-400-italic.ttf +0 -0
  43. package/fonts/space-mono/space-mono-400.ttf +0 -0
  44. package/fonts/space-mono/space-mono-700.ttf +0 -0
  45. package/package.json +57 -3
package/README.md CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @tin.so/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Renders code images from a JSON spec. The pipeline is `spec → Shiki tokens → layout → SVG → PNG` and needs no browser: the layout places every character on a monospace grid with the metrics of the bundled fonts, and [resvg](https://github.com/linebender/resvg) (WebAssembly) rasterizes the SVG. The same code runs in Node and in the browser.
4
+
5
+ ```ts
6
+ import { render } from "@tin.so/core/node";
7
+
8
+ const png = await render({
9
+ theme: "vercel",
10
+ windows: [
11
+ {
12
+ titleBar: false,
13
+ tabs: true,
14
+ split: "row",
15
+ panes: [
16
+ { title: "main.ts", code: 'import plans from "./plans.toml";' },
17
+ { title: "plans.toml", code: "[free]\nprice = 0" },
18
+ ],
19
+ },
20
+ ],
21
+ });
22
+ ```
23
+
24
+ ## Scripts
25
+
26
+ - `pnpm port-themes` fetches the ray.so themes at a pinned commit and writes `src/themes/*.json`.
27
+ - `pnpm download-fonts` downloads the fonts to `fonts/` and writes their metrics to `src/fonts/fonts.generated.json`.
28
+
29
+ ## Attribution
30
+
31
+ - The themes, the token colors and the frame styles come from [ray.so](https://github.com/raycast/ray-so) (MIT).
32
+ - The fonts are under the SIL Open Font License, except Commit Mono (MIT). Each font directory contains its license.
33
+ - The file icon is from [Lucide](https://lucide.dev) (ISC), the language icons from [Simple Icons](https://simpleicons.org) (CC0).