Skip to content

Commit

Permalink
docs: develop external projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Nov 1, 2023
1 parent 7473b9d commit 00df85c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,45 @@ it has the git dependency on [typst](https://github.com/typst/typst).

See [Documentation](https://myriad-dreamin.github.io/typst.ts/cookery).

### Develop projects along with a local built typst.ts

You can add your owned projects to the `projects` folder, so that yarn workspace will
automatically identify your project.

##### Example: link a project by git submodule

To develop core external projects, e.g. `typst-preview`, you could initialize it
by command:

```shell
git submodule update --init --checkout projects/typst-preview
```

##### Example: build and run

Ensured that you have [built typst.ts from
source](#build-from-source-and-check), you can build and run the project by
(typst-preview as a example):

```shell
# install dependencies for project
yarn install --pure-lockfile
# build typst-preview and its dependencies
turbo build --filter=typst-preview
@myriaddreamin/typst-ts-renderer:build: cache hit, replaying logs bc0a0b151bd8eb6d
@myriaddreamin/typst.ts:build: cache hit, replaying logs 729cb43a3242b80
typst-preview-frontend:build: cache miss, executing 5ae30471e8957877
typst-preview-frontend:build: ...
typst-preview-frontend:build: ✓ built in 1.25s
typst-preview-frontend:build: Done in 4.57s.
typst-preview:build: cache miss, executing a1bd8ca8233f8a0c
typst-preview:build: ...
typst-preview:build: ✓ built in 1.01s
typst-preview:build: Done in 3.73s.
```

The project (typst-preview as a example) will cache and use the local built packages.

### Build from source and check

Note: you could build from source with/without wasm-pack.
Expand Down

0 comments on commit 00df85c

Please sign in to comment.