Skip to content
Merged

Dev #170

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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"editor.detectIndentation": false,
"rust-analyzer.linkedProjects": [
"packages/ducrs/Cargo.toml",
"packages/ducpdf/src/duc2pdf/Cargo.toml"
"packages/ducpdf/src/duc2pdf/Cargo.toml",
"packages/ducsvg/src/pdf2svg/Cargo.toml"
],
"rust-analyzer.files.exclude": [
"packages/ducrs/src/duc_generated.rs"
Expand Down
192 changes: 192 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
resolver = "2"
members = [
"packages/ducrs",
"packages/ducpdf/src/duc2pdf"
"packages/ducpdf/src/duc2pdf",
"packages/ducsvg/src/pdf2svg",
]

[workspace.dependencies]
Expand Down
Binary file modified assets/testing/duc-files/blocks_instances.duc
Binary file not shown.
3 changes: 0 additions & 3 deletions bun.lock

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"scripts": {
"build": "turbo build",
"build:packages": "turbo build --filter=ducjs --filter=ducpy --filter=ducrs --filter=ducsvg --filter=ducpdf",
"sst:wrap": "bash -c 'CMD=\"$1\"; shift; [ -n \"$1\" ] && [ \"$1\" != \"_\" ] && export SST_STAGE=\"$1\"; eval \"$CMD\"' _",
"sst:shell": "bash -c 'CMD=\"$1\"; shift; [ -n \"$1\" ] && [ \"$1\" != \"_\" ] && export SST_STAGE=\"$1\"; eval \"$CMD\"' _",
"flatc:gen": "bun run flatc:gen:duc",
"flatc:gen:duc": "cd schema && bash flatc-duc-generate.sh",
"clean": "bun del-cli \"**/dist\" \".turbo\" \"**/node_modules\" \"**/package-lock.json\" \"**/tsconfig.tsbuildinfo\" \"**/tsconfig.node.tsbuildinfo\" \"**/vite.config.js\"",
Expand All @@ -68,11 +68,11 @@
"ducpdf:build": "turbo build --filter=ducpdf",
"ducpdf:test": "turbo run test --filter=ducpdf",
"semantic-release": "turbo run semantic-release",
"sst:deploy": "bun sst:wrap 'bun run sst:clean && sst unlock && sst refresh && sst deploy'",
"sst:deploy": "bun sst:shell 'bun run sst:clean && sst unlock && sst refresh && sst deploy'",
"sst:clean": "bun del-cli \".sst\" \"**/sst-env.d.ts\" \"**/sst.pyi\"",
"sst:dev": "bun run sst dev",
"knip:deps": "bun sst:wrap 'bun run sst unlock && sst shell -- bunx knip --dependencies'",
"knip": "bun sst:wrap 'bun run sst unlock && sst shell -- bunx knip'"
"knip:deps": "bun sst:shell 'bun run sst unlock && sst shell -- bunx knip --dependencies'",
"knip": "bun sst:shell 'bun run sst unlock && sst shell -- bunx knip'"
},
"workspaces": [
"apps/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/ducpdf/src/duc2pdf/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function initWasm(): Promise<any> {
try {
// Dynamically import the WASM JS bindings
const wasmBindings: any = await import('../wasm');

// The wasm-pack generated module exports a default init function
// that handles loading the WASM file using import.meta.url
// This is the same pattern used by duc_renderer_bin
Expand Down
9 changes: 7 additions & 2 deletions packages/ducpdf/src/duc2pdf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ pub fn convert_duc_to_pdf_rs(duc_data: &[u8]) -> Vec<u8> {
Ok(pdf_bytes) => pdf_bytes,
Err(e) => {
// Log error with context
error_handling::log_error_details(&e, duc_data.len(), "Standard conversion (default options)");
error_handling::log_error_details(
&e,
duc_data.len(),
"Standard conversion (default options)",
);

// Create structured error info and convert to WASM bytes
let error_info = error_handling::create_error_info(&e, duc_data.len(), None);
Expand Down Expand Up @@ -390,7 +394,8 @@ pub fn convert_duc_to_pdf_crop_wasm(
background_color: normalized_background,
..Default::default()
};
let error_info = error_handling::create_error_info(&e, duc_data.len(), Some(&crop_options));
let error_info =
error_handling::create_error_info(&e, duc_data.len(), Some(&crop_options));
error_handling::error_to_wasm_bytes(&error_info)
}
}
Expand Down
Loading