handlemyfile 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- handlemyfile-0.1.0/.gemini/rules/anti-overfitting-layout-invariants.md +27 -0
- handlemyfile-0.1.0/.gemini/rules/empirical-user-validation.md +13 -0
- handlemyfile-0.1.0/.gemini/rules/pdf-page-boundary-preservation.md +32 -0
- handlemyfile-0.1.0/.gemini/rules/zero-heuristic-spatial-geometry.md +28 -0
- handlemyfile-0.1.0/.github/workflows/publish-crates.yml +19 -0
- handlemyfile-0.1.0/.github/workflows/publish-npm.yml +38 -0
- handlemyfile-0.1.0/.github/workflows/publish-pypi.yml +108 -0
- handlemyfile-0.1.0/.gitignore +3 -0
- handlemyfile-0.1.0/Cargo.lock +1217 -0
- handlemyfile-0.1.0/Cargo.toml +62 -0
- handlemyfile-0.1.0/LICENSE +21 -0
- handlemyfile-0.1.0/PKG-INFO +276 -0
- handlemyfile-0.1.0/README.md +245 -0
- handlemyfile-0.1.0/claude_analysis.md +705 -0
- handlemyfile-0.1.0/claude_architect_analysis.txt +1 -0
- handlemyfile-0.1.0/claude_super_analysis.md +724 -0
- handlemyfile-0.1.0/claude_table_analysis.md +703 -0
- handlemyfile-0.1.0/docs/10_STEP_ROADMAP.md +97 -0
- handlemyfile-0.1.0/docs/DOCX_OOXML_INTERNALS_MATHEMATICS.md +247 -0
- handlemyfile-0.1.0/docs/EXISTING_LIBRARIES_FATAL_FLAWS_TEARDOWN.md +115 -0
- handlemyfile-0.1.0/docs/PDF_ADVANCED_INTERNALS_EDGE_CASES.md +176 -0
- handlemyfile-0.1.0/docs/PDF_INTERNALS_MATHEMATICS.md +176 -0
- handlemyfile-0.1.0/docs/PROMPT_FOR_AI_RESEARCHER.md +87 -0
- handlemyfile-0.1.0/docs/pdftodocx.md +163 -0
- handlemyfile-0.1.0/docs/research.md +366 -0
- handlemyfile-0.1.0/gpt4o_geometry_analysis.txt +162 -0
- handlemyfile-0.1.0/index.html +332 -0
- handlemyfile-0.1.0/meta_llama_table_analysis.md +514 -0
- handlemyfile-0.1.0/package.json +44 -0
- handlemyfile-0.1.0/pyproject.toml +47 -0
- handlemyfile-0.1.0/python/handlemyfile/__init__.py +8 -0
- handlemyfile-0.1.0/python/handlemyfile/__init__.pyi +26 -0
- handlemyfile-0.1.0/python/handlemyfile/cli.py +39 -0
- handlemyfile-0.1.0/scratch/check_case_study_tables.mjs +45 -0
- handlemyfile-0.1.0/scratch/check_laporan_glyphs.mjs +16 -0
- handlemyfile-0.1.0/scratch/check_pdf_pages.mjs +12 -0
- handlemyfile-0.1.0/scratch/f34aaad_doc.rs +0 -0
- handlemyfile-0.1.0/scratch/find_page.mjs +6 -0
- handlemyfile-0.1.0/scratch/inspect_all_artifacts.mjs +33 -0
- handlemyfile-0.1.0/scratch/inspect_all_breaks.mjs +64 -0
- handlemyfile-0.1.0/scratch/inspect_btc_hf.mjs +47 -0
- handlemyfile-0.1.0/scratch/inspect_h1.mjs +39 -0
- handlemyfile-0.1.0/scratch/inspect_juknis.mjs +21 -0
- handlemyfile-0.1.0/scratch/inspect_juknis_docx.mjs +41 -0
- handlemyfile-0.1.0/scratch/inspect_laporan_hf.mjs +44 -0
- handlemyfile-0.1.0/scratch/inspect_p4_p5.mjs +36 -0
- handlemyfile-0.1.0/scratch/inspect_page_bboxes.mjs +7 -0
- handlemyfile-0.1.0/scratch/inspect_pages_dla.mjs +29 -0
- handlemyfile-0.1.0/scratch/inspect_zero_egress.mjs +26 -0
- handlemyfile-0.1.0/scratch/test_btc_break.mjs +42 -0
- handlemyfile-0.1.0/scratch/test_glyphs_details.mjs +15 -0
- handlemyfile-0.1.0/scratch/test_handlemyfile_output.docx +0 -0
- handlemyfile-0.1.0/scratch/test_laporan.mjs +20 -0
- handlemyfile-0.1.0/scratch/test_laporan_debug.mjs +13 -0
- handlemyfile-0.1.0/scratch/test_laporan_sections.mjs +61 -0
- handlemyfile-0.1.0/scratch/test_zero_egress_layout.mjs +36 -0
- handlemyfile-0.1.0/src/dla/classifier.rs +722 -0
- handlemyfile-0.1.0/src/dla/docstrum.rs +277 -0
- handlemyfile-0.1.0/src/dla/mod.rs +1091 -0
- handlemyfile-0.1.0/src/dla/otsu.rs +209 -0
- handlemyfile-0.1.0/src/dla/rxyc.rs +695 -0
- handlemyfile-0.1.0/src/dla/tables.rs +1563 -0
- handlemyfile-0.1.0/src/dla/tabs.rs +261 -0
- handlemyfile-0.1.0/src/dla/tensor.rs +122 -0
- handlemyfile-0.1.0/src/docx/document.rs +1718 -0
- handlemyfile-0.1.0/src/docx/mod.rs +199 -0
- handlemyfile-0.1.0/src/docx/numbering.rs +70 -0
- handlemyfile-0.1.0/src/docx/relationships.rs +286 -0
- handlemyfile-0.1.0/src/docx/styles.rs +152 -0
- handlemyfile-0.1.0/src/lib.rs +125 -0
- handlemyfile-0.1.0/src/main.rs +56 -0
- handlemyfile-0.1.0/src/models/mod.rs +493 -0
- handlemyfile-0.1.0/src/pdf/evaluator.rs +707 -0
- handlemyfile-0.1.0/src/pdf/font.rs +750 -0
- handlemyfile-0.1.0/src/pdf/image.rs +478 -0
- handlemyfile-0.1.0/src/pdf/mod.rs +14 -0
- handlemyfile-0.1.0/src/pdf/parser.rs +213 -0
- handlemyfile-0.1.0/src/pdf/predictor.rs +165 -0
- handlemyfile-0.1.0/src/pdf/state.rs +131 -0
- handlemyfile-0.1.0/src/pdf/struct_tree.rs +833 -0
- handlemyfile-0.1.0/src/utils/mod.rs +134 -0
- handlemyfile-0.1.0/test-app.js +224 -0
- handlemyfile-0.1.0/test_capy.docx +0 -0
- handlemyfile-0.1.0/tests/Brief__Case_Study_Job_Vacancy_Detail__fullstacksdetcandidate-40747646-1784-45dd-9c2b-eb180c85c54c - Copy.pdf +0 -0
- handlemyfile-0.1.0/tests/CAPYBALA__Context_Aware_Pruning_for_Yielding_and_Backtrack_Aligned_Loop_Avoidance_in_Autonomous_Software_Engineering_Agents__Anonim.pdf +0 -0
- Cryptographic Gating for Autonomous AI Agents.pdf +0 -0
- handlemyfile-0.1.0/tests/Zero-Egress In-Browser Document Processing Systems Using Web Workers.pdf +0 -0
- handlemyfile-0.1.0/tests/check_boundaries.mjs +35 -0
- handlemyfile-0.1.0/tests/check_p0_docx.py +6 -0
- handlemyfile-0.1.0/tests/check_real.mjs +102 -0
- handlemyfile-0.1.0/tests/check_sec4.mjs +33 -0
- handlemyfile-0.1.0/tests/debug_p1.mjs +19 -0
- handlemyfile-0.1.0/tests/debug_p47.mjs +35 -0
- handlemyfile-0.1.0/tests/find_p0_table.mjs +31 -0
- handlemyfile-0.1.0/tests/find_stream.py +3 -0
- handlemyfile-0.1.0/tests/inspect_all_headings.mjs +41 -0
- handlemyfile-0.1.0/tests/inspect_all_pages.mjs +20 -0
- handlemyfile-0.1.0/tests/inspect_archive.py +24 -0
- handlemyfile-0.1.0/tests/inspect_brief.mjs +26 -0
- handlemyfile-0.1.0/tests/inspect_footer_runs.mjs +18 -0
- handlemyfile-0.1.0/tests/inspect_hf_bboxes.mjs +28 -0
- handlemyfile-0.1.0/tests/inspect_laporan.mjs +40 -0
- handlemyfile-0.1.0/tests/inspect_laporan_pn.mjs +22 -0
- handlemyfile-0.1.0/tests/inspect_p0_table.mjs +44 -0
- handlemyfile-0.1.0/tests/inspect_p1_vp.mjs +16 -0
- handlemyfile-0.1.0/tests/inspect_page1.mjs +33 -0
- handlemyfile-0.1.0/tests/inspect_page_densities.mjs +21 -0
- handlemyfile-0.1.0/tests/inspect_real_tables.mjs +23 -0
- handlemyfile-0.1.0/tests/inspect_tables.mjs +25 -0
- handlemyfile-0.1.0/tests/inspect_vectors.mjs +19 -0
- handlemyfile-0.1.0/tests/manual_test_suite/01_arxiv_attention_is_all_you_need.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/02_mozilla_tracemonkey_twocolumn.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/03_commercial_invoice_tabular.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/04_w3c_dummy_baseline.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/05_us_irs_tax_form_160f.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/06_ieee_academic_twocolumn_capybala.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/07_cryptographic_gating_dualtrust.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/08_embedded_truetype_fonts.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/09_zapf_dingbats_symbols.pdf +0 -0
- handlemyfile-0.1.0/tests/manual_test_suite/10_technical_brief_coda_multi_tables.pdf +0 -0
- handlemyfile-0.1.0/tests/run_all_tests.mjs +30 -0
- handlemyfile-0.1.0/tests/test_images_and_tables_precision.mjs +145 -0
- handlemyfile-0.1.0/tests/test_margins_alignment_spacing.mjs +94 -0
- handlemyfile-0.1.0/tests/test_step3.rs +40 -0
- handlemyfile-0.1.0/tests/test_table_components.mjs +98 -0
- handlemyfile-0.1.0/tests/test_wasm_step10.js +159 -0
- handlemyfile-0.1.0/tests/test_wasm_step3.js +23 -0
- handlemyfile-0.1.0/tests/test_wasm_step4.js +42 -0
- handlemyfile-0.1.0/tests/test_wasm_step5.js +85 -0
- handlemyfile-0.1.0/tests/test_wasm_step6.js +217 -0
- handlemyfile-0.1.0/tests/test_wasm_step7.js +173 -0
- handlemyfile-0.1.0/tests/test_wasm_step8.js +207 -0
- handlemyfile-0.1.0/tests/test_wasm_step9.js +161 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Rule: Anti-Overfitting & Continuous Geometric Layout Invariants
|
|
2
|
+
|
|
3
|
+
## 1. Absolute Prohibition on Single-Document Hyper-Analysis
|
|
4
|
+
- NEVER inspect or micro-tune code against the coordinate idiosyncrasies of a single document in isolation.
|
|
5
|
+
- Do NOT write temporary scripts to inspect single-document bounding boxes and then hardcode thresholds tailored to that document.
|
|
6
|
+
- Single-document tailoring is an anti-pattern that guarantees regressions on other document types. All algorithms must be derived from universal mathematical and typographic principles.
|
|
7
|
+
|
|
8
|
+
## 2. Prohibition of Discrete If-Else Thresholds on Continuous 2D Space
|
|
9
|
+
- Document layout is a continuous 2D spatial domain ($x, y, w, h$, font metrics, density).
|
|
10
|
+
- NEVER use discrete integer count thresholds (e.g., `left_count >= 1 && right_count >= 1`) to make global layout decisions (such as Single-Column vs Multi-Column).
|
|
11
|
+
- Structural layout classification must be governed by continuous mathematical models:
|
|
12
|
+
1. **Text Mass Symmetry Ratio**:
|
|
13
|
+
$$\mathcal{S}_{\text{mass}} = \frac{\min(M_L, M_R)}{\max(M_L, M_R)} \ge 0.40$$
|
|
14
|
+
Where $M_L$ and $M_R$ are the aggregated text masses (character counts or total glyph area) of non-wide blocks on each side of the page center. Isolated marginal metadata (e.g. right-aligned resume dates, line numbers, page numbers) represent $< 15\%$ of total text mass and must NEVER trigger multi-column mode.
|
|
15
|
+
2. **Baseline Pairing for Tab Stops**:
|
|
16
|
+
When two blocks share the same vertical baseline ($|\Delta y| \le 2.0\text{ pt}$), they belong to the same logical line and must be modeled as Tab Stops (`<w:tab/>`), not parallel column partitions.
|
|
17
|
+
3. **Scale-Invariant Font Proportions**:
|
|
18
|
+
All whitespace decision boundaries (Docstrum word clustering, gutter thresholds, line leading) must be strictly proportional to local font em-size ($0.18 - 0.32\text{ em}$), never fixed point constants (`16.0 pt`, `54.0 pt`).
|
|
19
|
+
|
|
20
|
+
## 3. Mandatory Multi-Class Corpus Verification
|
|
21
|
+
- Any modification to layout analysis, clustering, or DOCX generation must be validated across a diverse multi-class corpus:
|
|
22
|
+
1. Single-page table-dense documents (e.g. exam papers, forms).
|
|
23
|
+
2. Single-column ATS resumes/CVs with right-aligned dates.
|
|
24
|
+
3. Multi-column academic papers (IEEE/ACM) with spanning titles and figures.
|
|
25
|
+
4. Standard narrative documents / reports.
|
|
26
|
+
- If an algorithm works for Document A but breaks Document B, the mathematical abstraction is incomplete and must be redesigned, never patched with another `if-else`.
|
|
27
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Rule: Empirical User Validation & Ban on Self-Adulatory AI Benchmarks
|
|
2
|
+
|
|
3
|
+
1. **No Synthetic "Victory Lap" Benchmarks**:
|
|
4
|
+
- Never present self-generated statistical tables claiming "100% fixed", "0 errors", or "perfect accuracy" as proof of task completion.
|
|
5
|
+
- Internal script checks are intermediate sanity checks for the agent's internal development loop only, NOT authoritative proof of correctness for the user.
|
|
6
|
+
|
|
7
|
+
2. **User is the Sole Empirical Ground Truth**:
|
|
8
|
+
- The user's inspection of the rendered document in Microsoft Word is the only valid acceptance test.
|
|
9
|
+
- When presenting fixes, describe the specific architectural and geometric root cause that was addressed, explain what visual defects it resolves, and invite the user to verify the actual output.
|
|
10
|
+
|
|
11
|
+
3. **Holistic Visual & Document Layout Respect**:
|
|
12
|
+
- Never consider a feature "fixed" by looking at isolated metrics (such as alignment tag counts) when adjacent structural integrity (e.g., vertical slicing across math formulas, footnote contamination into body sentences) remains broken.
|
|
13
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Rule: 1:1 PDF Page Boundary Preservation & Geometric Spacing
|
|
2
|
+
|
|
3
|
+
1. **82% Density Threshold for Page Breaks**:
|
|
4
|
+
- Insert explicit `<w:br w:type="page"/>` ONLY when:
|
|
5
|
+
a. `prev_max_y < (page_height * 0.82)`: Intentional author page termination (Thesis Cover, Lembar Pengesahan, Kata Pengantar, Daftar Isi, or chapter endings).
|
|
6
|
+
b. Next page begins with a major section/chapter title (`H1` at $y_{\min} \le 120\text{ pt}$).
|
|
7
|
+
c. Orientation change (Portrait $\leftrightarrow$ Landscape).
|
|
8
|
+
- On dense pages ($\ge 82\%$ full with continuing body/table content), do NOT insert artificial hard page breaks. Word's natural text layout flows them without creating single-line orphaned pages (which previously exploded 8-page documents into 15 pages).
|
|
9
|
+
|
|
10
|
+
2. **Native Right Tab Stop for Running Headers & Footers**:
|
|
11
|
+
- Never use OOXML tables (`<w:tbl>`) in `<w:hdr>` or `<w:ftr>`. Tables in headers/footers have cell margins, borders, and row height constraints that inflate vertical footprint to $>40\text{ pt}$, pushing the footer up into body tables.
|
|
12
|
+
- Use a single-line paragraph with a native Word right tab stop (`<w:tabs><w:tab w:val="right" w:leader="none" w:pos="{printable_width}"/></w:tabs>`):
|
|
13
|
+
Left text (date/URL), tab character (`<w:tab/>`), right text / dynamic page number (`PAGE / NUMPAGES`).
|
|
14
|
+
- Takes up exactly 1 line height ($\sim 11\text{ pt}$) with zero vertical overhead.
|
|
15
|
+
|
|
16
|
+
3. **Vertical Margin Clearance & Dynamic Clamping**:
|
|
17
|
+
- Always enforce `w:header="360" w:footer="360"` ($18\text{ pt}$).
|
|
18
|
+
- Body margins `w:top` and `w:bottom` must be dynamically derived from the document and clamped to safe typographic bounds: `clamp(28.0, 72.0)` points. Never force a minimum of $54\text{ pt}$ which artificially clips tight IEEE/academic margins ($\sim 36-44\text{ pt}$) and pushes content across page boundaries.
|
|
19
|
+
|
|
20
|
+
4. **Zero Synthetic Spacing Inflation**:
|
|
21
|
+
- Never inject arbitrary hardcoded paragraph spacing constants (e.g. `+12pt`, `+6pt`, `+80 twips`).
|
|
22
|
+
- Derive `space_before` strictly from the visual vertical delta ($\Delta y = y_{\min}(i) - y_{\max}(i-1) - 2.0$) between bounding boxes in the PDF.
|
|
23
|
+
- Keep `space_after = 0.0` and let `space_before` faithfully represent inter-block distance.
|
|
24
|
+
|
|
25
|
+
5. **Zero Natural Language Keywords (Strict Language-Agnostic Engine)**:
|
|
26
|
+
- NEVER hardcode human language keywords or strings (e.g. "DAFTAR ISI", "TABLE OF CONTENTS", "BAB", "CHAPTER", "KATA PENGANTAR", "HALAMAN", "PAGE", "LEMBAR PENGESAHAN", etc.) in any part of the engine (DLA, classifier, rxyc, table detector, or DOCX generator).
|
|
27
|
+
- The engine must operate universally across all languages and scripts (Latin, Cyrillic, CJK, Arabic, Devanagari, etc.).
|
|
28
|
+
- All structural decisions must be derived strictly from:
|
|
29
|
+
a. **Typography**: Relative font size ratios ($font \ge 1.35 \times median\_body$), font weights (`is_bold`), Unicode casing properties (`is_all_caps` via `is_alphabetic` and `is_uppercase`).
|
|
30
|
+
b. **Spatial Geometry**: Coordinates ($y_{\min} \le 160\text{ pt}$ for page-top titles), horizontal alignment (`alignment == "center"`), block length ($\le 2$ lines, $\le 80$ characters), and bounding box margins.
|
|
31
|
+
c. **Structural Leader Patterns**: Universal dot leader patterns (`..` or trailing page number with tab gap $\ge 20\text{ pt}$ or $x \ge 350\text{ pt}$) to detect TOC rows and generate native Word dot-leader tabs, completely independent of natural language strings.
|
|
32
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Zero-Heuristic Spatial Geometry Invariants: Strict Prohibition of Discrete If-Else Branching on 2D Space"
|
|
3
|
+
globs: "src/**/*.rs"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Zero-Heuristic Spatial Geometry Standard
|
|
7
|
+
|
|
8
|
+
## Core Invariant
|
|
9
|
+
Continuous 2D spatial coordinates $(x, y, w, h)$ must NEVER be partitioned using discrete boolean `if-else` branching with arbitrary magic constants (e.g. `x <= mid + 15.0`, `left_count >= 1 && right_count >= 1`, `gap >= 7.0`).
|
|
10
|
+
|
|
11
|
+
## Enforced Design Principles
|
|
12
|
+
1. **Topological 1D Interval Merging for Lines**:
|
|
13
|
+
- Two bounding intervals $[y_{\min}, y_{\max}]$ and $[y'_{\min}, y'_{\max}]$ belong to the same physical text line if their vertical projection intervals overlap:
|
|
14
|
+
$$\max(y_{\min}, y'_{\min}) < \min(y_{\max}, y'_{\max})$$
|
|
15
|
+
- Horizontal gaps on the same vertical line represent **Tab Stops** (`<w:tab/>`) or paragraph indentations, NOT separate columns.
|
|
16
|
+
- Resumes, invoices, receipts, legal signatures, and exam headers with left-aligned descriptions and right-aligned dates/amounts MUST remain on the same line.
|
|
17
|
+
|
|
18
|
+
2. **Continuous Projection Gutter Analysis for Columns**:
|
|
19
|
+
- A multi-column layout requires a continuous, unobstructed vertical whitespace gutter spanning across multiple paragraphs.
|
|
20
|
+
- Column classification must never be evaluated as an arbitrary page-wide boolean flag.
|
|
21
|
+
|
|
22
|
+
3. **No Arbitrary Magic Numbers**:
|
|
23
|
+
- All spatial thresholds must be derived dynamically from intrinsic document metrics (median font size, inter-character docstrum spacing, page printable width).
|
|
24
|
+
- Never inject hardcoded coordinates like `15.0`, `35.0`, `75.0`, or `120`.
|
|
25
|
+
|
|
26
|
+
4. **Preserve Embedded Graphics & Masks**:
|
|
27
|
+
- Image masks (`/ImageMask true`) and inverted decode tables (`/Decode [1 0]`) must be respected to prevent transparent signatures and stamps from rendering as solid black boxes.
|
|
28
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Publish to Crates.io
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install Rust toolchain
|
|
16
|
+
uses: dtolnay/rust-toolchain@stable
|
|
17
|
+
|
|
18
|
+
- name: Publish to Crates.io
|
|
19
|
+
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Publish to NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Install Rust toolchain
|
|
16
|
+
uses: dtolnay/rust-toolchain@stable
|
|
17
|
+
with:
|
|
18
|
+
targets: wasm32-unknown-unknown
|
|
19
|
+
|
|
20
|
+
- name: Install wasm-pack
|
|
21
|
+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
22
|
+
|
|
23
|
+
- name: Set up Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version: '20'
|
|
27
|
+
registry-url: 'https://registry.npmjs.org'
|
|
28
|
+
|
|
29
|
+
- name: Build WebAssembly Package
|
|
30
|
+
run: wasm-pack build --target web --out-name handlemyfile
|
|
31
|
+
|
|
32
|
+
- name: Copy License to pkg
|
|
33
|
+
run: cp LICENSE pkg/
|
|
34
|
+
|
|
35
|
+
- name: Publish to NPM
|
|
36
|
+
run: npm publish pkg --access public
|
|
37
|
+
env:
|
|
38
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
linux:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
target: [x86_64, aarch64]
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.11'
|
|
23
|
+
- name: Build wheels
|
|
24
|
+
uses: PyO3/maturin-action@v1
|
|
25
|
+
with:
|
|
26
|
+
target: ${{ matrix.target }}
|
|
27
|
+
args: --release --out dist --features python
|
|
28
|
+
sccache: 'true'
|
|
29
|
+
manylinux: auto
|
|
30
|
+
- name: Upload wheels
|
|
31
|
+
uses: actions/upload-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: wheels-linux-${{ matrix.target }}
|
|
34
|
+
path: dist
|
|
35
|
+
|
|
36
|
+
windows:
|
|
37
|
+
runs-on: windows-latest
|
|
38
|
+
strategy:
|
|
39
|
+
matrix:
|
|
40
|
+
target: [x64]
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
- uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: '3.11'
|
|
46
|
+
architecture: ${{ matrix.target }}
|
|
47
|
+
- name: Build wheels
|
|
48
|
+
uses: PyO3/maturin-action@v1
|
|
49
|
+
with:
|
|
50
|
+
target: ${{ matrix.target }}
|
|
51
|
+
args: --release --out dist --features python
|
|
52
|
+
sccache: 'true'
|
|
53
|
+
- name: Upload wheels
|
|
54
|
+
uses: actions/upload-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: wheels-windows-${{ matrix.target }}
|
|
57
|
+
path: dist
|
|
58
|
+
|
|
59
|
+
macos:
|
|
60
|
+
runs-on: macos-latest
|
|
61
|
+
strategy:
|
|
62
|
+
matrix:
|
|
63
|
+
target: [x86_64, aarch64]
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
- uses: actions/setup-python@v5
|
|
67
|
+
with:
|
|
68
|
+
python-version: '3.11'
|
|
69
|
+
- name: Build wheels
|
|
70
|
+
uses: PyO3/maturin-action@v1
|
|
71
|
+
with:
|
|
72
|
+
target: ${{ matrix.target }}
|
|
73
|
+
args: --release --out dist --features python
|
|
74
|
+
sccache: 'true'
|
|
75
|
+
- name: Upload wheels
|
|
76
|
+
uses: actions/upload-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: wheels-macos-${{ matrix.target }}
|
|
79
|
+
path: dist
|
|
80
|
+
|
|
81
|
+
sdist:
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v4
|
|
85
|
+
- name: Build sdist
|
|
86
|
+
uses: PyO3/maturin-action@v1
|
|
87
|
+
with:
|
|
88
|
+
command: sdist
|
|
89
|
+
args: --out dist
|
|
90
|
+
- name: Upload sdist
|
|
91
|
+
uses: actions/upload-artifact@v4
|
|
92
|
+
with:
|
|
93
|
+
name: wheels-sdist
|
|
94
|
+
path: dist
|
|
95
|
+
|
|
96
|
+
release:
|
|
97
|
+
name: Release to PyPI
|
|
98
|
+
runs-on: ubuntu-latest
|
|
99
|
+
needs: [linux, windows, macos, sdist]
|
|
100
|
+
steps:
|
|
101
|
+
- uses: actions/download-artifact@v4
|
|
102
|
+
with:
|
|
103
|
+
path: dist
|
|
104
|
+
merge-multiple: true
|
|
105
|
+
- name: Publish to PyPI
|
|
106
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
107
|
+
with:
|
|
108
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|