Commit graph

102 commits

Author SHA1 Message Date
QuadnucYard
bcd6af975e
feat: multi-page export and no-write support (#2098)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
## Features

- Support multi-page export in the server export command. Added an extra
arg to decide whether to write to the file or only return data for
client use (page preview in exporter). VSCode users can use this feature
via the quick-export command or code lens.
- (refactor) Move most export logic from tinymist to tinymist-task,
excluding typlite-related, which already depends on tinymist-task.
- Added relevant export tests. The export e2e test now includes hash
checking for all targets.

## Not done

- Support new args in `TypstExtraArgs` for CLI compilation.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-13 23:02:44 +08:00
Myriad-Dreamin
42e3a3eb73
fix: bad refactor in "fix: invalidate cached snapshot after compile" (#2165)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
fix #2163, partially reverts Myriad-Dreamin/tinymist#2057 @jo3-l

---------

Co-authored-by: Joseph Liu <jo3.l.dev@outlook.com>
2025-10-11 02:19:39 +08:00
ParaN3xus
b239224a63
feat: add js package registry support for tinymist-wasm (#2102)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-01 16:40:21 +08:00
Myriad-Dreamin
53488dad22
fix: remove Clone trait bounds from diagnostics iterators (#2136)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This requires new release of world crates, while we didn't plan it.
2025-09-27 17:02:06 +08:00
Joseph Liu
6b52aa70ba
feat: new lint warning for unknown math vars (#2065)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Add a lint warning for unknown math variables[^1], powered by Tinymist's
existing reference analysis. This allows users to see all such undefined
variables at once if they have the linter enabled, instead of just the
first error from the compiler. The autofix from #2062 is also applicable
to these warnings.

Example:
![example of new warning in VS
Code](https://github.com/user-attachments/assets/42672d50-e637-49b2-907b-aa413431e55e)
(The first error is pre-existing and emitted by the Typst compiler; the
second warning is new from this PR and emitted by us.)

Implementation notes:
- The generated diagnostic tries to closely match the corresponding
Typst compiler error, with one deliberate change: to differentiate the
Tinymist warning and the compiler error, we use the message `potentially
unknown variable: ...` instead of `unknown variable: ...`. I am not the
biggest fan of this choice, but I think it is very important that users
don't blame the Typst compiler for warnings that we generate; changing
the message so that it isn't an exact clone is the best way I thought of
for now.
- We avoid duplicating a warning if the compiler has already generated
an error for a given identifier by computing a set of `KnownLintIssues`
from the compiler diagnostics and threading this information through the
lint routines.

[^1]: If users like this warning, we can extend it later to apply to
undefined variables outside of math as well.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-09-24 01:09:10 +08:00
Myriad-Dreamin
ef08eaa93b
feat: enhance CLI and argument documentation (#2072)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This PR improves the help message of the CLL. Also, we change the verbs
in the help message from plural (e.g. `compiles`) to singular (e.g.
`compile`). This matches the style of `clap-rs`.

Added tests about critical help messages.
2025-09-03 17:02:42 +08:00
QuadnucYard
ce447185d1
dev: drop if_chain and collapse if statements (#2097)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-09-01 16:46:54 +08:00
Myriad-Dreamin
b938914ecf
feat: execute cpu tasks in place in wasm (#2086)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-28 00:30:58 +08:00
Joseph Liu
66351570a6
fix(tinymist-project): invalidate cached snapshot after compile (#2057)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR fixes a latent cache invalidation issue with project snapshots.
I recommend reviewing commit-by-commit, even though this is a small
change. Only the last commit changes behavior; the rest are cleaning up
code to make it easier to see what is happening.

---

Here's what I think is the problem.

Project instance states (`ProjectInsState`) provide access to a snapshot
of the latest compilation result. This snapshot is cached for
performance:
```rust
match self.snapshot.as_ref() {
    Some(snap) if snap.world().revision() == self.verse.revision => snap.clone(),
    // otherwise recompute
}
```
Unfortunately, it turns out that the cached snapshot may be outdated
even if the revision matches. (In practice, it will usually just lag one
compilation behind, and I think this is why it hasn't caused any
observable issues--one compilation behind is not that much, especially
if the user is continuously typing.)

To see the issue, consider the following sequence of steps. Assume
initially all revisions are `0`.
1. User triggers a recompilation, say by typing into the file.
     - This triggers an `Interrupt::Memory` or similar.
2. The changes are applied to the vfs and recompilation begins.
     - `verse.revision` is incremented to `verse.revision = 1`.
3. Before compilation finishes, a project snapshot is requested.
- The project compiler checks the cached snapshot first, which still has
`snap.world().revision() == 0`.
- Since `verse.revision = 1` was already incremented before the
compilation finished, a new snapshot is created and cached--even though
nothing has actually been recompiled yet.
    - The cached snapshot now has `snap.world().revision() == 1`.
4. Compilation finishes, and some data from the resulting compilation
artifact is recorded.
5. Another project snapshot is requested.
- Since the snapshot was recomputed already in (3), the revisions appear
to match and the outdated, cached snapshot is returned.

The fix here is to just clear the cached snapshot in (4) after
recompilation finishes.

---

I would add a regression test, but it didn't seem easy to write an
automated test that can differentiate the change here. I tested this
locally by adding some logging around when the cached snapshot is used
and when it is recomputed.

As mentioned on Discord, I noticed this problem when adding some more
data to project snapshots on a local fork of Tinymist, which caused the
slightly outdated state to become a little more obvious.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-27 00:45:38 +08:00
Myriad-Dreamin
6573ed917b
feat: make watch access model (#2067)
<img width="2087" height="1144" alt="0c29317922c3c829deb7f364b22ccaee"
src="https://github.com/user-attachments/assets/cfb8143e-21c6-45c8-9492-a4237473c0f0"
/>
2025-08-26 23:54:41 +08:00
Myriad-Dreamin
2fc5d919e9
build: bump version to 0.13.24 (#2085)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.24
2025-08-26 16:15:03 +08:00
Myriad-Dreamin
468e993649
build: bump version to 0.13.24-rc3 (#2080)
+tag v0.13.24-rc3
2025-08-25 10:44:49 +08:00
Myriad-Dreamin
9a8476ecfb
build: bump version to 0.13.24-rc2 (#2077)
+tag v0.13.24-rc2
2025-08-25 06:16:18 +08:00
Myriad-Dreamin
b7845cb785
build: bump world crates to 0.13.24-rc1 (#2047) 2025-08-24 23:22:06 +08:00
Myriad-Dreamin
5ee01b59a9
refactor: create main files (#2054) 2025-08-24 06:12:11 +08:00
Myriad-Dreamin
532f25abe9
docs: document all public items in rust codebase (#2058)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-08-21 12:50:03 +08:00
Myriad-Dreamin
05280aec4d
feat: bump edition of most crates to rust 2024 (#2042)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-18 16:48:41 +08:00
Myriad-Dreamin
f7f2760520
feat: use tinymist_std::time for wasm32 targets (#2028)
`std::time` are not implemented for wasm32 targets, so we should use the
time crate made by ourselves.
2025-08-12 04:40:04 +08:00
Myriad-Dreamin
ce5ab81760
feat: move and compile tinymist crate for wasm32 target (#2027)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-11 13:14:26 +08:00
Myriad-Dreamin
79f68dc94d
feat: compile tinymist-query for wasm32 target (#1947)
- #2025 
- #2026

---------

Co-authored-by: Momijiichigo <ichigomomiji436@gmail.com>
2025-08-11 09:35:07 +08:00
Myriad-Dreamin
b102b42d2c
feat: compile diag crate for wasm32 target (#2026) 2025-08-11 08:49:37 +08:00
Myriad-Dreamin
8431f386ce
feat: compile lock crate for wasm32 target (#2025) 2025-08-11 08:17:20 +08:00
Myriad-Dreamin
c3fa0c5cb2
fix: ensure that the lockfile is respected (#2000) 2025-08-07 07:42:02 +08:00
Myriad-Dreamin
7455d11629
fix: emit save events to cover issue of notify (#2006) 2025-08-06 21:15:56 +08:00
Myriad-Dreamin
3a4fa98b42
feat: implement delegate access model (#1943)
This is to avoid touching underlying file system if the extension is run
with liveshare.
2025-07-31 01:21:17 +08:00
Myriad-Dreamin
f9c348c7d7
feat: introduce dyn access model for futher development (#1898)
prepare for #1413 and #836
2025-07-31 00:30:13 +08:00
moeleak
3821861134
fix: correctly handle relative user-specified output paths in compile command (#1941)
This change ensures that user-specified output paths in the compile
command are properly handled, including relative paths.

Previously, the export task would reject relative output paths with an
error. This change converts relative paths to absolute paths by joining
them with the current working directory, allowing users to specify
relative paths like 'output/test.pdf' when compiling documents.

The fix adds path normalization using PathClean and handles the
conversion gracefully while maintaining the existing behavior for
absolute paths.

Fixes the issue where commands like:
  tinymist compile resume-en.typ ./output/test.pdf
would fail with "output path is relative" error.
2025-07-30 21:35:36 +08:00
Myriad-Dreamin
75fc5f3bca
fix: emit onSaved signal to exporter when vfs is clean (#1939)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This bugs involves two main component: the compiler and the exporter,
the compiler compiles first and then exporter exports then. it is useful
to emit `CompileSignal::by_fs_events` to exporter even if vfs is clean
at the time we save a document.

An example triggering this bug. When user sets `exportPdf` to `onSave`,
It *bugged*:
1. OnTyped first: User types some character at T1. compiler learns that
the file content is of revision R1. the compiler compiles with revision
R1, which is needed by diagnostics event.
2. OnSaved then: Editor saves the document at T2. the compilation is
skipped early because file content is still under revision R1. In
previous version, The compilation is skipped and therefore the export is
also skipped. This is *bugged* if user sets `exportPdf` to `onSave`,
because the exporter is not run in both steps.

This PR emits the onSaved signals to both the compiler and the exporter
in the step 2.
2025-07-30 04:49:30 +08:00
Myriad-Dreamin
d59a15df1a
build: bump version to 0.13.16 (#1934) 2025-07-29 15:16:18 +08:00
Myriad-Dreamin
9181619e95
build: bump version to 0.13.16-rc3 (#1928)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
* build: bump version to 0.13.16-rc3

* build: update asset crates
2025-07-26 17:54:25 +08:00
Myriad-Dreamin
3c40385cd2
build: bump version to 0.13.16-rc2 (#1919)
* build: bump version to 0.13.16-rc2

* docs: update changelog

* fix: update reflexo versions

* build: bump asset crates
2025-07-24 01:37:42 +08:00
Myriad-Dreamin
e6c1894ce4
build: bump world crates to 0.13.16-rc1 (#1905)
* docs: update changelog

* build: bump world crates to 0.13.16-rc1

* build: bump reflexo crates to pre v0.6.1-rc2
2025-07-16 12:28:05 +08:00
Myriad-Dreamin
0849d6c641
feat: compilation respect SOURCE_DATE_EPOCH (#1631)
* Changes before error encountered

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* feat: errors caused by copilot

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-07-09 19:09:58 +08:00
Myriad-Dreamin
d0a478929e
fix: don't export on entry change and first filesystem sync (#1854)
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: make real onSave export conditions

* fix: remove fix

* feat: pass export tests

* fix: revert bootstrap changes

* feat: reduce num of exports

* fix: diag tests
2025-06-29 21:54:05 +08:00
Eric Long
9d9d360db9
fix(test): running test as root (#1817)
* fix(test): running test as root

The dummy root path /root conflicts with root user's home directory on Linux and redacts incorrectly. Our downstream CI environment builds tinymist in docker as root and encounters the problem. Change the path to `/dummy-root` fixes it. To ensure consistency, other similar occurences are also prefixed with `dummy-`.

* dev: deduplicate a bit

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-16 13:01:25 +08:00
Myriad-Dreamin
4871cd3917
build: bump version to 0.13.12 (#1715)
* docs: update changelog

* build: bump version to 0.13.12

* build: bump assets  to v0.13.12
2025-04-30 14:45:23 +08:00
Myriad-Dreamin
0552d4bb4f
build: bump version to 0.13.12-rc6 (#1713)
* fix: sync-ls warnings

* build: bump version to 0.13.12-rc6

* fix: lint config bug

* build: fix assets ver

* feat: bump asset crate
2025-04-30 13:53:28 +08:00
Myriad-Dreamin
f4a6d2b271
build: bump version to 0.13.12-rc5 (#1710)
* build: bump version to 0.13.12-rc5

* build: bump assets to v0.13.12-rc5

* docs: edit changelog
2025-04-30 02:09:28 +08:00
Myriad-Dreamin
042fc2a477
feat: forbid weird embedded font uses and make toml dep optional (#1701)
* cg

* fix: forbid weird embedded

* feat: optional toml
2025-04-25 17:56:17 +08:00
Myriad-Dreamin
923155a2e2
build: bump version to 0.13.12-rc4 (#1680) 2025-04-18 02:40:51 +08:00
Myriad-Dreamin
8f4f07673f
build: bump version to 0.13.12-rc3 (#1676)
* build: bump version to 0.13.12-rc3

* build: update assets
2025-04-17 20:23:38 +08:00
Myriad-Dreamin
a3758038ee
build: bump version to 0.13.12-rc2 (#1674)
* build: bump version to v0.13.12-rc2

* build: update targets

* build: update assets

* fix: warning
2025-04-17 17:02:34 +08:00
Myriad-Dreamin
84c211c7eb
feat: extract package implementation (#1647)
* feat: extract registry implementation

* feat: tinymist package

* fix: guard

* fix: guard 2

* feat: no specifier

* fix: temp_dir_in impl

* fix: impls

* feat: UniversePack::new

* feat: clone into memory

* feat: implement some pack for testing

* build: update cargo.lock

* feat: fit for web

* fix: guard
2025-04-16 18:19:03 +08:00
Myriad-Dreamin
9d1007a4f3
feat: refactor and add page count for the status bar format (#1666)
* feat: refactor and add page count for the status bar format

* chore: edit code style

* chore: edit code style

* chore: edit code style

* chore: edit code style

* chore: edit code style
2025-04-16 17:45:53 +08:00
Myriad-Dreamin
92c5e40abd
feat: resolve roots of typst packages (#1663) 2025-04-16 13:51:33 +08:00
Myriad-Dreamin
39d13c83f6
refactor: simplify world font impl and add docs (#1645)
* fix: remove unnecessary &mut in FontResolverImpl::append_font()

* refactor: better readablity in FontResolverImpl::rebuild()

* feat: FontResovlerImpl::clone_and_rebuild()

Change FontSlot to store Arc to QueryRef<Font, FontLoader>, so we can
clone FontSlot and share the cached loaded font between different slots.

Since CompilerUniverse only holds a immutable Arc to FontResovlerImpl,
adding clone_and_rebuild method allow us to append and rebuild without
mutable access to FontResovlerImpl.

* refactor: remove partial_book and modify methods from FontResolverImpl

partial_book is removed from FontResolverImpl, all the modifying methods
are also removed.
new method get_fonts and new_with_fonts are added.
If you want to modify fonts, you can get all fonts and modify them, then
call new_with_fonts to create a new FontResolverImpl.

* refactor: SystemFontSearch, BrowserFontSearch

- Both font searcher now is just a wrapper for Vec<(FontInfo,
  FontSlot)>, typst::FontBook will be built when converting into
  FontResolverImpl.

- Provide a method with_fonts_mut() so user can get a direct mutable
  access to the under lying fonts vector to do any changes.

- Support searcher -> resolver and resolver -> searcher conversion.

* refactor: api change to biulder pattern

Method new_with_resolver() is added since CompilerUniverse only holds
Arc reference to resolver, and we can't move it out.

* fix: add fontdb::Database to SystemFontSearcher

Store fonts info in db, load them in bulk when calling flush()

* chore: merge `FontResolverImpl` and `TinymistFontResolver`

* feat: remove font profile feature

* feat: remove project font

* docs: comment the font resolver trait

* docs: comment the font slot struct

* docs: comment the crate

* test: move system tests

* dev: clean resolver

* dev: clean searchers

* dev: clean par iters

* feat: enrich memory font resolver

* todo: useless reuse

* dev: remove reuse api

* dev: build font book in `fn build`

* fix: make clippy happy

* fix: bad use

---------

Co-authored-by: c0per <60544162+c0per@users.noreply.github.com>
2025-04-15 22:23:13 +08:00
Myriad-Dreamin
769fc93df9
fix: remove system time deps from crates (#1621)
* fix: remove system time deps from crates

* fix: remove system time deps from crates

* fix: smater feature gate

* docs: add some todos

* Update time.rs

* Update Cargo.toml

* build: remove hard dep chrono
2025-04-08 01:46:05 +08:00
Myriad-Dreamin
b97335c0ef
fix: order to publish crates (#1609)
* fix: order to publish crates

* fix: bad version
2025-03-31 17:03:26 +08:00
Myriad-Dreamin
71116758ef
build: bump world crates to 0.13.12-rc1 (#1608)
* refactor: move `debug_loc`

* build: fix rev

* build: bump tinymist inner version

* build: bump tinymist world version

* build: bump world crates to 0.13.12-rc1

* fix: used bad patch

* fix: clippy errors
2025-03-31 16:01:51 +08:00
Myriad-Dreamin
90f9949f8c
feat: support --feature and --pdf-standard. (#1596) 2025-03-28 17:42:03 +08:00