typst-community / typst.js Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Typst for JavaScript
Home Page: https://typst.community/typst.js
License: Apache License 2.0
๐ฆ Typst for JavaScript
Home Page: https://typst.community/typst.js
License: Apache License 2.0
Right now I'm trying to match versions with the latest Typst version (currently 0.10.0 -- current npm package is [email protected])
https://github.com/typst/typst/releases
https://www.npmjs.com/package/typst?activeTab=versions
note that there's a X.Y.Z-N where N goes up. idk if that's the "right" way to do it or not? are there other projects that do it better/differently? is there a convention to this? basically I want a four-part semver specific not a three part specifier lol.
Sidenote: should the first 0.11.0 release be [email protected] or [email protected] or [email protected] ?
@huwaireb can you enable GitHub Pages on this repository and set it to publish from the GitHub Actions source? I dont have permissions to do that. Thx! ๐
Hello again ๐,
I'm curious in regards to your plans for typst.js
@jcbhmr. From my understanding, currently it's only a wrapper around the typst binary distributed in npm. Are there any plans to go any further for e.g JS bindings? Like what is done by the typst.ts project. Or do your goals end here?
@huwaireb Instead of using typst-community.github.io CNAME'ed to typst.community so that typst.community/typst.js/ points to https://github.com/typst-community/typst.js, typst.community is CNAME-linked to https://github.com/typst-community/typst.community only lol
Make this work just like jcbhmr.me does with https://jcbhmr.me/ghmd.css/ <=> https://github.com/jcbhmr/ghmd.css pls thx ๐
site is live https://typst-community.github.io/typst.js/
but not https://typst.community/typst.js/
old title: publish npm package with binaries embedded in it instead of using postinstall script
basically:
.
โโโ src/
โ โโโ main.ts
โโโ dist/
โ โโโ main.js
โ โโโ main.d.ts
โโโ bin/
โ โโโ typst.win32-x64.exe
โ โโโ typst.darwin-x64
โ โโโ typst.darwin-arm64
โ โโโ typst.linux-x64
โ โโโ typst.linux-arm64
โโโ package.json
then main.ts/js would run: typst.${process.platform}-${process.arch}
exe instead of downloading it and then running it. basically skip the download step.
why this might be good:
ensureInstalled()
downloads and extracts the binarythe main win is startup/install time. that's it. HOWEVER this would add considerable size to the published npm package...
28M typst-aarch64-apple-darwin/typst
28M typst-aarch64-unknown-linux-musl/typst
29M typst-armv7-unknown-linux-musleabi/typst
30M typst-x86_64-apple-darwin/typst
32M typst-x86_64-pc-windows-msvc/typst.exe
32M typst-x86_64-unknown-linux-musl/typst
total ~178M ish
do what https://napi.rs/ does by default and splinter off things into optionalDependencies that only work on a single OS/CPU combo: https://napi.rs/docs/deep-dive/release#3-the-native-addon-for-different-platforms-is-distributed-through-different-npm-packages
ex:
// for Windows Intel/AMD x86-64
{
"name": "@node-rs/bcrypt-win32-x64",
"version": "0.5.0",
"os": ["win32"],
"cpu": ["x64"]
}
// for macOS ARM64
{
"name": "@node-rs/bcrypt-darwin-arm64",
"version": "0.5.0",
"os": ["darwin"],
"cpu": ["arm64"]
}
there appears to be a project that is designed to tackle this issue actually and it uses this second approach!
https://github.com/christophwitzko/npm-binary-releaser
after writing all that text and seeing how large the binaries are when spread across 6x architectures (almost 200mb! when a single platform is only 30mb!) i think the best way to avoid postinstall and speed up install is to use npm-binary-releaser or similar
This project should lean on "check out the official typst cli readme" but should also provide info on the JS-api and install instructions to use npm install typst --save-dev
or npm install typst --global
or whatever
@huwaireb i dont have permissions to edit this repository's secrets lol. if you could, please navigate to
https://www.npmjs.com/settings/huwaireb/tokens/ and create a new token with these perms
and then add that to the NPM_TOKEN secret of this github repo. that way when you create a new release on github https://github.com/typst-community/typst.js/releases it triggers npm publish
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.