add typst.ts
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -32,3 +32,4 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
output.pdf
|
||||
|
||||
35
bun.lock
35
bun.lock
@@ -2,9 +2,10 @@
|
||||
"lockfileVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "testy",
|
||||
"name": "testpdf",
|
||||
"dependencies": {
|
||||
"@myriaddreamin/typst-ts-node-compiler": "^0.7.0-rc1",
|
||||
"@myriaddreamin/typst-ts-node-compiler": "^0.6.1-rc5",
|
||||
"@myriaddreamin/typst.ts": "^0.6.1-rc5",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
@@ -15,29 +16,33 @@
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@myriaddreamin/typst-ts-node-compiler": ["@myriaddreamin/typst-ts-node-compiler@0.7.0-rc1", "", { "optionalDependencies": { "@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-android-arm64": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-darwin-arm64": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-darwin-x64": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": "0.7.0-rc1", "@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": "0.7.0-rc1" } }, "sha512-SKtuAXsQAhYOThDVj8jaWMKrVUcSumgOisGjlCChAQYGKQQQ3T0Ks6O34td8tPxBlaqfEzKRidNxYT+20yVKpA=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler": ["@myriaddreamin/typst-ts-node-compiler@0.6.1-rc5", "", { "optionalDependencies": { "@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-android-arm64": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-darwin-arm64": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-darwin-x64": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": "0.6.1-rc5", "@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": "0.6.1-rc5" } }, "sha512-C5J41b3pWyY+UrOpzHYeR4F4hcyrtdIlFFd6KbbPULWQTPlZB/HwaNC0MyCodqSVVjSgNyg8C4y4QzMBHDo+qw=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": ["@myriaddreamin/typst-ts-node-compiler-android-arm-eabi@0.7.0-rc1", "", { "os": "android", "cpu": "arm" }, "sha512-RCQIrcvEow+n5FZRBUDBgXFJEH23/l2sm4ODsAVKDuyT0HARfHHJtxjbnYriVF4oLp3q2n9Vst/DkbOGczzHiQ=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-android-arm-eabi": ["@myriaddreamin/typst-ts-node-compiler-android-arm-eabi@0.6.1-rc5", "", { "os": "android", "cpu": "arm" }, "sha512-LGk9Iz3GLbVp7vMFsepaHV18tIdz506822k/64Mhmsuko4ratK2Jd9ocILAye24Uh2u0qyjttE33wwm/hVv28g=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-android-arm64": ["@myriaddreamin/typst-ts-node-compiler-android-arm64@0.7.0-rc1", "", { "os": "android", "cpu": "arm64" }, "sha512-CGnwtw2KAP5VoKrqjHAy7setrPMm4mtUmqDCbQih7wyBIvL4al6lGK6zJIoRamLqFBX+eLAuBQcEcT6kTrvP4w=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-android-arm64": ["@myriaddreamin/typst-ts-node-compiler-android-arm64@0.6.1-rc5", "", { "os": "android", "cpu": "arm64" }, "sha512-mRm0ceNGAwgR+ta9tcMyYqBFfxSrtnMUGCAjDwaCnaMiFYjMODKF6/CLZyasMMiPNOVEdx9aBq522WSKzSnT1g=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-darwin-arm64": ["@myriaddreamin/typst-ts-node-compiler-darwin-arm64@0.7.0-rc1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-iE9jJY7X9Dbyf5ONhAlqIAo1hLA6cDj0VMjmdTRjzLWoCEhDqQQk37yUZbyRkCvqtSM7zqGz4QXsvphx7Qg1yg=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-darwin-arm64": ["@myriaddreamin/typst-ts-node-compiler-darwin-arm64@0.6.1-rc5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-7JpwKiSx+TUY6y1qZTQC2kGtH84SbSdkSwFLNystDZbAjpHa8aTgFHC+tJmBDoeDh0kM3DWvd3PsrbjCrPD9Kw=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-darwin-x64": ["@myriaddreamin/typst-ts-node-compiler-darwin-x64@0.7.0-rc1", "", { "os": "darwin", "cpu": "x64" }, "sha512-DLu8yZCLSJQFvzHh9Kjd4ZzNazEYv/J6wOVZPiTgWv7GncOj0C6KLjIfemNhSHbXeoXwiBvo81CCXt5d2BinwA=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-darwin-x64": ["@myriaddreamin/typst-ts-node-compiler-darwin-x64@0.6.1-rc5", "", { "os": "darwin", "cpu": "x64" }, "sha512-3q+bsNSInfsc3VCUhjUJ+nSi01H7/mad+Fs4gERjnMvjfDyl/J549rzoyD2dQOswL7i9j5mww4GvDijrh7NtYw=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": ["@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf@0.7.0-rc1", "", { "os": "linux", "cpu": "arm" }, "sha512-C110dpw0UG0O6bN2ASK4aQUnprT1NU5gRSUHQ3GcmiyrY2doD/6Mhy/rhYdgQ/jx/XahrZON+iFIDNm17rqbfg=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf": ["@myriaddreamin/typst-ts-node-compiler-linux-arm-gnueabihf@0.6.1-rc5", "", { "os": "linux", "cpu": "arm" }, "sha512-8/52NgCf1283BHHFJlmwWuBdh9Aih2UvZNfXZEL7JNjwsqA6vPsAuiqZXSTn1k7HkDjigRHp0MORA83XR/jwvQ=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": ["@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu@0.7.0-rc1", "", { "os": "linux", "cpu": "arm64" }, "sha512-TwlYVhyvpXgG06S/iABKLKEHekQAjjwgs3TUd6mbvGb+K+B8BQcOIPZlixoViUBPCKKr2HpEJTaFrC8NPJ+UNw=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu": ["@myriaddreamin/typst-ts-node-compiler-linux-arm64-gnu@0.6.1-rc5", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y7RX9CJ289M3agC6HC4sUbDnzDRZpPXVQEeZvy/+wJh5Y/G9Nzlh8hLGyt4DtM64t9K1glUtGX+hA0ZFNIQvVw=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": ["@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl@0.7.0-rc1", "", { "os": "linux", "cpu": "arm64" }, "sha512-ka4BXZSDvbTMLQ/4IxsWUzAyOJrAmMKAg1ZbEGHwVBwSY+etRyH8nSKAu3tKKTd5Ncf/Vr20fj5sHj+SCgENHA=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl": ["@myriaddreamin/typst-ts-node-compiler-linux-arm64-musl@0.6.1-rc5", "", { "os": "linux", "cpu": "arm64" }, "sha512-+fcejszyGuLH6IC8qBFCM9Gzs5yOWSNfH7e9E+Yr8TFg7FsyeJ5QUAx7ySpnZxkR2MiiVBoEWL6A9+eL4WSgTQ=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": ["@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu@0.7.0-rc1", "", { "os": "linux", "cpu": "x64" }, "sha512-OMYB6gLpi6DJ4mcjQ0AJM7h2J9cT3R6DjllX+DtrNRHhJ9QeSkMOrkRuWuUDW+OmZdMUHCV/AVnv0nRkvl7HXQ=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu": ["@myriaddreamin/typst-ts-node-compiler-linux-x64-gnu@0.6.1-rc5", "", { "os": "linux", "cpu": "x64" }, "sha512-cC8L3fWAjMqFEtRoSS0uk12UC98uIyPBqVPW/5Nf2n4ZREOB5yabXlO8uy6KPV04REJbWx/HfxaT7MmFwEvIlw=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": ["@myriaddreamin/typst-ts-node-compiler-linux-x64-musl@0.7.0-rc1", "", { "os": "linux", "cpu": "x64" }, "sha512-InTVBZpX3SEKA/0ReEwsdX8c5Jg5XuUgCM4K5Vh6bB25pgXxa+Tc/IT0LwzLBwSJ20Jl1DELi3W1VOC5F/+TNQ=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-linux-x64-musl": ["@myriaddreamin/typst-ts-node-compiler-linux-x64-musl@0.6.1-rc5", "", { "os": "linux", "cpu": "x64" }, "sha512-epJzzzYGdsBGENk27GyliuzWOHdeTW+jtX0niMS6/0tKUvKJ8jbD1wpU5x5SpTAmQmzoyxctWaw5rLkRhrCXjQ=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": ["@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc@0.7.0-rc1", "", { "os": "win32", "cpu": "arm64" }, "sha512-TKPMIk0nGZAhC5z5LocOfigYqBhw0IWZXinKUHLJ9POZUIdr/68F9KOBam2cjVya7HCgshjBSPJ9DDx0dSFyrQ=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc": ["@myriaddreamin/typst-ts-node-compiler-win32-arm64-msvc@0.6.1-rc5", "", { "os": "win32", "cpu": "arm64" }, "sha512-xwiJm7czxg/aZw5WiDgzb7fTukAte9MsM8qQOZcWs593SVfSrv9O14dfeSo9D4v7f6RrDOfQyQQ39AFVIxe8rA=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": ["@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc@0.7.0-rc1", "", { "os": "win32", "cpu": "x64" }, "sha512-NuwuVyNWWSDbQXyhnMOZCp5fSI5mQT9/DESUB7lkLEqt+wH6x3EIpKq5dIyYPe7LDms4/xxz+aI0r/RgkXkgTA=="],
|
||||
"@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc": ["@myriaddreamin/typst-ts-node-compiler-win32-x64-msvc@0.6.1-rc5", "", { "os": "win32", "cpu": "x64" }, "sha512-7jZ1DKoO0as6RdeaD7W0/wZwUtun8FRr1bW1UFanJ6C5vJCCnS/aCcHR7aYGA7bvxM4min04fUYvTk/hpERzcQ=="],
|
||||
|
||||
"@myriaddreamin/typst-ts-web-compiler": ["@myriaddreamin/typst-ts-web-compiler@0.6.1-rc5", "", {}, "sha512-jQDBIw3RAHcB40YQYGgaPkzjbCiFcElkFR9u6yHWBGwZo2TNz/xtHspJ82IeSxtisjeA25azEJCbl254Aq2HGg=="],
|
||||
|
||||
"@myriaddreamin/typst.ts": ["@myriaddreamin/typst.ts@0.6.1-rc5", "", { "dependencies": { "idb": "^7.1.1" }, "peerDependencies": { "@myriaddreamin/typst-ts-renderer": "^0.6.1-rc5", "@myriaddreamin/typst-ts-web-compiler": "^0.6.1-rc5" }, "optionalPeers": ["@myriaddreamin/typst-ts-renderer", "@myriaddreamin/typst-ts-web-compiler"] }, "sha512-FuVMuBTdfFZfIHLVShZ30qEdqzVGKM26k62OVC5UhoB2DSMi6D4o5tIgoCY4PzYcT8/dRgHcbmqA4Ep96VFvAQ=="],
|
||||
|
||||
"@types/bun": ["@types/bun@1.3.2", "", { "dependencies": { "bun-types": "1.3.2" } }, "sha512-t15P7k5UIgHKkxwnMNkJbWlh/617rkDGEdSsDbu+qNHTaz9SKf7aC8fiIlUdD5RPpH6GEkP0cK7WlvmrEBRtWg=="],
|
||||
|
||||
@@ -49,6 +54,8 @@
|
||||
|
||||
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
|
||||
|
||||
"idb": ["idb@7.1.1", "", {}, "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ=="],
|
||||
|
||||
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
||||
|
||||
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
||||
|
||||
15
index.ts
15
index.ts
@@ -1 +1,14 @@
|
||||
console.log("Hello via Bun!");
|
||||
import { $typst } from "@myriaddreamin/typst.ts";
|
||||
import fs from "fs";
|
||||
const typstSource = `
|
||||
= Hello
|
||||
|
||||
My name is Typst!
|
||||
`;
|
||||
const pdfBuffer = await $typst.pdf({ mainContent: typstSource });
|
||||
|
||||
if (!pdfBuffer) {
|
||||
throw new Error("Failed to generate PDF");
|
||||
}
|
||||
|
||||
fs.writeFileSync("output.pdf", pdfBuffer);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "testy",
|
||||
"name": "testpdf",
|
||||
"module": "index.ts",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
@@ -7,9 +7,10 @@
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@myriaddreamin/typst-ts-node-compiler": "^0.7.0-rc1"
|
||||
"@myriaddreamin/typst-ts-node-compiler": "^0.6.1-rc5",
|
||||
"@myriaddreamin/typst.ts": "^0.6.1-rc5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user