Skip to content

Commit

Permalink
chore: update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Sep 22, 2023
1 parent ace1cec commit 09bb84b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ Visualized Feature:

### Installation

Download the latest release from [GitHub Releases](https://github.com/Myriad-Dreamin/typst.ts/releases).
Install latest precompiler via cargo:

```shell
cargo install --locked --git https://github.com/Myriad-Dreamin/typst.ts typst-ts-cli
```

Or Download the latest release from [GitHub Releases](https://github.com/Myriad-Dreamin/typst.ts/releases).

### CLI

Expand Down Expand Up @@ -120,7 +126,8 @@ $ cargo run --bin typst-ts-dev-server -- run http --corpus ./fuzzers/corpora/

And open your browser to `http://localhost:20810/`.

You can also run `yarn run build-wrapper` instead of `yarn run build && yarn run link:local` to avoid building the WASM modules from source.
You can also run `yarn run build:core` instead of `npx turbo run build` to build
core library (`@myriaddreamin/typst.ts`) and avoid building the WASM modules from source.

### Example: generate documentation site for packages developers.

Expand All @@ -130,7 +137,15 @@ You can also run `yarn run build-wrapper` instead of `yarn run build && yarn run

### Concept: Precompiler

The compiler is capable of producing artifact outputs from a Typst project. Thet artifact outputs can be easily distributed to remote endpoints.
The precompiler is capable of producing artifact outputs from a Typst project. Thet artifact outputs can be easily distributed to remote endpoints.

Install latest precompiler via cargo:

```shell
cargo install --locked --git https://github.com/Myriad-Dreamin/typst.ts typst-ts-cli
```

Or Download the latest release from [GitHub Releases](https://github.com/Myriad-Dreamin/typst.ts/releases).

### Concept: Renderer

Expand All @@ -143,6 +158,10 @@ Import `typst.ts` in your project:
```typescript
import { createTypstRenderer } from '@myriaddreamin/typst.ts';
const renderer = createTypstRenderer();
await renderer.init();
const svg = await renderer.runWithSession(async session => {
// do something with session
});
```

- Using [@myriaddreamin/typst.react][npm::typst.react]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"packages/templates/*"
],
"scripts": {
"build:core": "yarn workspace @myriaddreamin/typst.ts build",
"bump-packages": "python scripts/bump_version.py",
"prepublish-packages": "turbo run prepublish",
"publish:dry": "turbo run prepublish publish:dry",
Expand Down

0 comments on commit 09bb84b

Please sign in to comment.