Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove compiler crate #570

Merged
merged 4 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Test
run: |
cargo test --profile release-ci --no-fail-fast \
-p typst-ts-core -p typst-ts-compiler \
-p typst-ts-core \
-p typst-ts-cli -p typst-ts-integration-test
- name: Archive Test Results (WebAssembly Renderer in Chrome)
if: always()
Expand Down
66 changes: 15 additions & 51 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"crates/reflexo",
"crates/reflexo-vfs",
"crates/reflexo-world",
"crates/reflexo-typst",
"crates/conversion/typst2vec",
"crates/conversion/vec2canvas",
"crates/conversion/vec2bbox",
Expand All @@ -24,8 +25,6 @@ members = [
"crates/conversion/vec2svg",

"cli",
"core",
"compiler",

"fuzzers/incremental",

Expand Down Expand Up @@ -211,7 +210,6 @@ reflexo-vec2sema = { version = "0.5.0-rc6", path = "crates/conversion/vec2sema"
reflexo-vec2bbox = { version = "0.5.0-rc6", path = "crates/conversion/vec2bbox" }

typst-ts-core = { version = "0.5.0-rc6", default-features = false }
typst-ts-compiler = { version = "0.5.0-rc6", default-features = false }
typst-ts-test-common = { version = "0.5.0-rc6", path = "tests/common" }

# project exporters
Expand All @@ -223,8 +221,7 @@ typst-ts-dev-server = { version = "0.5.0-rc6", path = "server/dev" }
typst-ts-cli = { version = "0.5.0-rc6", path = "cli" }

[patch.crates-io]
typst-ts-core = { path = "core" }
typst-ts-compiler = { path = "compiler" }
typst-ts-core = { path = "crates/reflexo-typst" }
typst-ts-svg-exporter = { path = "crates/conversion/vec2svg" }

# typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst.ts-v0.10.0" }
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ The JavaScript packages are published on [npm](https://www.npmjs.com/).
The rust crates are not published on [crates.io](https://crates.io/) yet, since
it has the git dependency on [typst](https://github.com/typst/typst).

- Core Library: [typst-ts-core](./core/)

- Compiler Library: [typst-ts-compiler](./compiler/)
- Compiler Library: [reflexo-typst](./crates/reflexo-typst/)

- CLI as a Library: [typst-ts-cli](./cli/)

Expand Down
6 changes: 3 additions & 3 deletions benches/lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ divan = "0.1.3"
typst.workspace = true
once_cell.workspace = true
reflexo-typst2vec.workspace = true
typst-ts-core = { workspace = true, features = ["flat-vector"] }
typst-ts-cli.workspace = true
typst-ts-compiler = { workspace = true, default-features = false, features = [
typst-ts-core = { workspace = true, features = [
"flat-vector",
"system",
# "lazy-fontdb",
"dynamic-layout",
] }
typst-ts-cli.workspace = true
comemo.workspace = true
rayon.workspace = true
dissimilar.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions benches/lowering/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use divan::Bencher;
use once_cell::sync::Lazy;
use reflexo_typst2vec::pass::{IncrTypst2VecPass, Typst2VecPass};
use typst_ts_cli::CompileOnceArgs;
use typst_ts_compiler::{
use typst_ts_core::TypstDocument;
use typst_ts_core::{
CompileDriver as CompileDriverT, Compiler, PureCompiler, ShadowApiExt, TypstSystemWorld,
};
use typst_ts_core::TypstDocument;

type CompileDriver = Lazy<Mutex<CompileDriverT<PureCompiler<TypstSystemWorld>>>>;

Expand Down
3 changes: 1 addition & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ tracing-subscriber.workspace = true
codespan-reporting.workspace = true
human-panic.workspace = true

typst-ts-core = { workspace = true }
typst-ts-compiler = { workspace = true, default-features = false, features = [
typst-ts-core = { workspace = true, default-features = false, features = [
"system",
# "lazy-fontdb",
"dynamic-layout",
Expand Down
10 changes: 5 additions & 5 deletions cli/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ use tokio::sync::mpsc;
use typst::diag::{FileError, FileResult};
use typst::foundations::{Bytes, Dict, IntoValue};
use typst::model::Document;
use typst_ts_compiler::{
use typst_ts_core::config::entry::{EntryOpts, MEMORY_MAIN_ENTRY};
use typst_ts_core::DynExporter;
use typst_ts_core::{config::CompileOpts, exporter_builtins::GroupExporter, path::PathClean};
use typst_ts_core::{
features::{FeatureSet, DIAG_FMT_FEATURE},
CompileActor, CompileDriver, CompileExporter, DynamicLayoutCompiler, PureCompiler,
TypstSystemUniverse,
};
use typst_ts_compiler::{
use typst_ts_core::{
CompileServerOpts, CompileSnapshot, CompileStarter, EntryManager, EntryReader, ShadowApi,
SystemCompilerFeat, TypstSystemWorld,
};
use typst_ts_core::config::entry::{EntryOpts, MEMORY_MAIN_ENTRY};
use typst_ts_core::DynExporter;
use typst_ts_core::{config::CompileOpts, exporter_builtins::GroupExporter, path::PathClean};

use crate::font::fonts;
use crate::utils::current_dir;
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub enum DiagnosticFormat {
Short,
}

impl From<DiagnosticFormat> for typst_ts_compiler::DiagnosticFormat {
impl From<DiagnosticFormat> for typst_ts_core::DiagnosticFormat {
fn from(fmt: DiagnosticFormat) -> Self {
match fmt {
DiagnosticFormat::Human => Self::Human,
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use typst_ts_cli::{
LinkPackagesArgs, ListFontsArgs, ListPackagesArgs, MeasureFontsArgs, Opts, PackageSubCommands,
QueryArgs, QueryReplArgs, Subcommands,
};
use typst_ts_compiler::TypstSystemUniverse;
use typst_ts_core::TypstSystemUniverse;
use typst_ts_core::{config::entry::EntryOpts, exporter_builtins::GroupExporter};
use typst_ts_core::{
config::CompileOpts,
Expand Down Expand Up @@ -127,7 +127,7 @@ fn compile(args: CompileArgs) -> ! {
/// Execute a query command.
pub fn query(args: QueryArgs) -> ! {
use typst_ts_cli::query::format;
use typst_ts_compiler::query::retrieve;
use typst_ts_core::query::retrieve;
let compile_args = args.compile.clone();

let mut exporter = GroupExporter::<Document>::new(vec![]);
Expand Down
4 changes: 2 additions & 2 deletions cli/src/query_repl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use rustyline::validate::MatchingBracketValidator;
use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyEvent};
use rustyline::{Helper, Validator};

use typst_ts_compiler::{CompileDriver, CompileReport, ConsoleDiagReporter, PureCompiler};
use typst_ts_compiler::{ShadowApiExt, TypstSystemWorld};
use typst_ts_core::{typst::prelude::*, GenericExporter};
use typst_ts_core::{CompileDriver, CompileReport, ConsoleDiagReporter, PureCompiler};
use typst_ts_core::{ShadowApiExt, TypstSystemWorld};

use crate::query::serialize;
use crate::CompileOnceArgs;
Expand Down
3 changes: 0 additions & 3 deletions compiler/README.md

This file was deleted.

Loading
Loading