From 00df85c91588e1f6a29a2498363106807e9e18a0 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Wed, 1 Nov 2023 11:47:48 +0800 Subject: [PATCH] docs: develop external projects --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index df9a9086..91c191b6 100644 --- a/README.md +++ b/README.md @@ -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.