Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
7b9e84d
main-v2.5: Phase A restructure (CP-A)
aka-blackboots Sep 30, 2026
30bd986
Add one verify command for main-v2.5
aka-blackboots Sep 30, 2026
3c917e5
Merge task/verify-command
aka-blackboots Sep 30, 2026
92b07ab
test: verify step selection and flake classification are pure and exp…
aka-blackboots Sep 30, 2026
8072ee2
Tune verify: cached clippy, flake policy, concurrent browser runs
aka-blackboots Sep 30, 2026
993c673
Merge task/check-tuning
aka-blackboots Sep 30, 2026
d5ca9b1
test: batch subtraction matches main's recorded results, handlers and…
aka-blackboots Sep 30, 2026
923ce5d
Record main's batch subtraction answers in the parity oracle
aka-blackboots Sep 30, 2026
ea49060
Merge task/b2-batch
aka-blackboots Sep 30, 2026
679bc96
test: operations no longer import world_graph and errors keep their c…
aka-blackboots Sep 30, 2026
8e2c026
test: boolean, matrix and batch tessellations match main's canonical …
aka-blackboots Sep 30, 2026
e5483d4
Tighten batch oracle module layout and visibility
aka-blackboots Sep 30, 2026
5605cc3
Give operations its own OperationError and map errors by graph context
aka-blackboots Sep 30, 2026
65bfddb
Record main's canonical tessellations of boolean, matrix and batch re…
aka-blackboots Sep 30, 2026
8837e27
Merge task/b2-batch
aka-blackboots Sep 30, 2026
bdccc6f
Merge task/b5-operation-error
aka-blackboots Sep 30, 2026
da22466
Merge task/b2-tessellation
aka-blackboots Sep 30, 2026
257d19e
Share the parity fixture reader and order the oracle's canonical steps
aka-blackboots Sep 30, 2026
86a80b4
Narrow invalid to operations and drop stray blank import line
aka-blackboots Sep 30, 2026
0ac4952
Merge task/b5-operation-error
aka-blackboots Sep 30, 2026
a47d680
Merge task/b2-tessellation
aka-blackboots Sep 30, 2026
711212f
Re-key sweep line_edge duplicate member to its new line
aka-blackboots Sep 30, 2026
efeac53
Re-key the oracle's canonical duplicates to their shifted lines
aka-blackboots Sep 30, 2026
82d2ceb
Merge task/b5-operation-error
aka-blackboots Sep 30, 2026
99f0ec7
Merge task/b2-tessellation
aka-blackboots Sep 30, 2026
3e19080
test: STEP export walks body children and bounds names and node lists
aka-blackboots Sep 30, 2026
688c757
test: graph errors carry typed details for operate and export failures
aka-blackboots Sep 30, 2026
22f619f
Export Body children and bound STEP names and node lists
aka-blackboots Sep 30, 2026
2d0345f
test: every validity fixture reproduces its source verdict and circul…
aka-blackboots Sep 30, 2026
ee770d4
Type graph error details and record errors as one JSON form
aka-blackboots Sep 30, 2026
88798a7
Merge task/b5-error-details
aka-blackboots Sep 30, 2026
a49b545
Merge task/b10-export
aka-blackboots Sep 30, 2026
50eac37
Merge task/b2-validity-and-d4
aka-blackboots Sep 30, 2026
ba2f47e
test: multi-tool subtract falls back serially on a plain coverage gap…
aka-blackboots Sep 30, 2026
ba938dc
Fall back serially from a plain batch coverage gap and stop chains on…
aka-blackboots Sep 30, 2026
10b099c
test: extrude hole-rule violations are rejected as InvalidParameter b…
aka-blackboots Sep 30, 2026
c863d79
Pre-check extrude hole rules in the operations layer as InvalidParameter
aka-blackboots Sep 30, 2026
5402487
test: extrusions follow the loop's right-hand rule, keep 1e-6 rad til…
aka-blackboots Sep 30, 2026
bbc6f98
test: circular sweep caps carry exact cylinder pcurves and split line…
aka-blackboots Sep 30, 2026
ad83f94
Give circular sweep caps exact Line2 pcurves and stop flagging split …
aka-blackboots Sep 30, 2026
27d7f13
Orient profiles by the loop's Newell normal and never flatten tilted …
aka-blackboots Sep 30, 2026
66e0c37
test: sweep rejects a 1e-6 rad profile tilt and merges a collinear di…
aka-blackboots Sep 30, 2026
c499c82
Bound sweep perpendicularity and collinear merge by the cross product
aka-blackboots Sep 30, 2026
55ddf82
Merge task/b6-multi-tool
aka-blackboots Sep 30, 2026
40a9b9e
Merge task/b7-holes
aka-blackboots Sep 30, 2026
4d4496c
Merge task/b7-caps-and-seams
aka-blackboots Sep 30, 2026
896931d
Merge task/b7-normal-and-tilt
aka-blackboots Sep 30, 2026
1c5d673
Merge task/b7-sweep-tolerances
aka-blackboots Sep 30, 2026
7d4c9a4
test: binding payloads and inputs use camelCase keys
aka-blackboots Sep 30, 2026
303ae92
Use camelCase JSON keys on binding-visible world graph types
aka-blackboots Sep 30, 2026
e7578dc
test: PLACE applies its formula and returns its input, and quarter tu…
aka-blackboots Sep 30, 2026
5e9034b
Make quarter-turn rotations exact
aka-blackboots Sep 30, 2026
95d71a7
Apply the PLACE formula and record its input
aka-blackboots Sep 30, 2026
d83690b
Return the placement form from worldPlacement
aka-blackboots Sep 30, 2026
0e99e40
test: world placement form composes the parent chain
aka-blackboots Sep 30, 2026
ed17940
Merge task/b8-camelcase
aka-blackboots Sep 30, 2026
c928bc0
Merge task/b8-placement
aka-blackboots Sep 30, 2026
dd44fdd
test: graph accepts only the standard accuracy, input types reject un…
aka-blackboots Sep 30, 2026
9e3ae72
Fix the graph accuracy, close the last open inputs and clear copied r…
aka-blackboots Sep 30, 2026
918c8a2
test: graph create contract checks body type before commit and genera…
aka-blackboots Sep 30, 2026
9786271
Check the expected body type before commit and generate kind-prefixed…
aka-blackboots Sep 30, 2026
47443c5
Merge task/b9-body-type-and-ids
aka-blackboots Sep 30, 2026
d5b2fb5
Merge task/b9-contract-rest
aka-blackboots Sep 30, 2026
0ebf0c7
Split the browser specs into one file per topic
aka-blackboots Sep 30, 2026
7da40c0
test: bindings drop truncated marks and expose local bounds and displ…
aka-blackboots Sep 30, 2026
18bf363
Add local bounds and display bucket bindings, drop truncated marks an…
aka-blackboots Sep 30, 2026
a58d2be
Reuse the shared coarse accuracy in the binding tests
aka-blackboots Sep 30, 2026
033a289
test: create is memoised, reset rebuilds and invalidates old bodies, …
aka-blackboots Oct 1, 2026
29dd471
Memoise create, rebuild the runtime on reset and guard flush re-entry
aka-blackboots Oct 1, 2026
dae1a21
Merge task/c-kernel-bindings
aka-blackboots Oct 1, 2026
e283102
Merge task/c7-spec-layout
aka-blackboots Oct 1, 2026
8ec076e
Merge task/c1-lifecycle
aka-blackboots Oct 1, 2026
b00b4b2
Share one tolerance-taking near helper across the world graph tests
aka-blackboots Oct 1, 2026
3cb1fa9
Merge task/c-kernel-bindings
aka-blackboots Oct 1, 2026
37b3af9
test: kernel calls go through the session and errors name the public …
aka-blackboots Oct 1, 2026
dc1458d
Route every graph call through the kernel session and type kernel pay…
aka-blackboots Oct 1, 2026
6ab87c9
Merge task/c2-session-and-errors
aka-blackboots Oct 1, 2026
5683490
Narrow codec decode visibility and drop the stale worker JSON.parse a…
aka-blackboots Oct 1, 2026
f477524
Merge task/c2-session-and-errors
aka-blackboots Oct 1, 2026
2cd424e
test: ogId reuse rollback, truncated marks, flush cost, materials, pl…
aka-blackboots Oct 1, 2026
391b0ef
Key the SDK mirror by handle and generation and let rollback find its…
aka-blackboots Oct 1, 2026
ae5f1b0
Merge task/c3-mirror-marks-materials
aka-blackboots Oct 1, 2026
9094dce
test: worker message guards, missing-worker fallback, real crash reco…
aka-blackboots Oct 1, 2026
f27a52b
Guard worker messages, settle requests through one ready promise and …
aka-blackboots Oct 1, 2026
56b5f35
Merge task/c4-worker
aka-blackboots Oct 1, 2026
e95f61b
test: render pass membership, settled reporting and the LOD controller
aka-blackboots Oct 1, 2026
e43af1c
Evaluate LOD once per render pass through one controller
aka-blackboots Oct 1, 2026
83a5882
Merge task/c5-render-pass-and-lod
aka-blackboots Oct 1, 2026
6fdc78f
test: overlapping settled calls leave no temporary target behind
aka-blackboots Oct 1, 2026
5201c31
Stack settled's temporary deflection targets so overlapping calls unw…
aka-blackboots Oct 1, 2026
4d7d754
Merge task/c5-render-pass-and-lod
aka-blackboots Oct 1, 2026
88b912f
test: picking maps hits without scans, export rejects stale handles, …
aka-blackboots Oct 1, 2026
72d35d4
Resolve picks through a pick-target map and check export handles befo…
aka-blackboots Oct 1, 2026
37a8e6a
Merge task/c6-picking-export-and-test-honesty
aka-blackboots Oct 1, 2026
5faacaa
test: relative imports name TypeScript modules without .js
aka-blackboots Oct 1, 2026
1ab83f0
Drop .js from relative imports of TypeScript modules
aka-blackboots Oct 1, 2026
49e3deb
Merge task/c-import-specifiers
aka-blackboots Oct 1, 2026
74d1479
test: part-21 oracle enforces exact uncertainty, contexts, voids and …
aka-blackboots Oct 1, 2026
367d3ce
Give the part-21 oracle typed accessors and a complex-entity splitter
aka-blackboots Oct 1, 2026
967a9d9
Check every BREP_WITH_VOIDS void in the part-21 oracle
aka-blackboots Oct 1, 2026
043c687
Check contexts, units and the uncertainty link in the part-21 oracle
aka-blackboots Oct 1, 2026
c7add6a
test: native acceptance and storey scenes, rail-minus-wall clearance …
aka-blackboots Oct 1, 2026
d8145b6
Hold part-21 vertices and pcurve samples to the exact file uncertainty
aka-blackboots Oct 1, 2026
fffc2c4
Build acceptance and storey scenes natively and measure the real storey
aka-blackboots Oct 1, 2026
bcb1c06
Measure part-21 ellipse distance to the closest point
aka-blackboots Oct 1, 2026
ac364c0
Report the parameter direction of conic pcurves
aka-blackboots Oct 1, 2026
4c09670
Match step reports against the file and normalise names for comparison
aka-blackboots Oct 1, 2026
def1146
Merge task/d1-oracle-rules
aka-blackboots Oct 1, 2026
d30e217
Merge task/d2-scenes
aka-blackboots Oct 1, 2026
a139cef
Share test-support vector helpers and narrow scene and part21 visibility
aka-blackboots Oct 1, 2026
6ab4771
Merge task/w-d1-standards
aka-blackboots Oct 1, 2026
12afaa5
test: short planar arc loops tessellate at a coarse deflection
aka-blackboots Oct 1, 2026
a71852f
Raise arcs in planar loops that would tessellate below three points
aka-blackboots Oct 1, 2026
6d518bd
test: STEP exports equal the placed BRep bit for bit and every reacha…
aka-blackboots Oct 1, 2026
5a2791c
Expose the placed-BRep value oracle to the STEP tests
aka-blackboots Oct 1, 2026
ccb6bdd
Merge task/d1-oracle-tests
aka-blackboots Oct 1, 2026
ce42cd1
Merge task/d-arc-minimum
aka-blackboots Oct 1, 2026
c200cc8
Share the STEP oracle's entity, bits and pcurve helpers once
aka-blackboots Oct 1, 2026
90f45f3
Merge task/w-d2-standards
aka-blackboots Oct 1, 2026
8df5016
test: acceptance level and storey STEP pass the Part-21 oracle from R…
aka-blackboots Oct 1, 2026
943d82b
Check browser STEP exports against the oracle and the native scene
aka-blackboots Oct 1, 2026
5827e13
Size the STEP oracle rows' timeouts from measured runs
aka-blackboots Oct 1, 2026
aa2b591
Merge task/d2-acceptance-oracle
aka-blackboots Oct 1, 2026
387f20b
test: performance budgets check sizes everywhere and timings per plat…
aka-blackboots Oct 1, 2026
f8f31b8
Add the budget rules and drop the performance retry policy
aka-blackboots Oct 1, 2026
f09ad63
test: every golden scene matches the recorded golden for this target
aka-blackboots Oct 1, 2026
2ed18d4
Enforce performance sizes everywhere and timings per platform
aka-blackboots Oct 1, 2026
e4a5335
Compare the whole snapshot corpus against a recorded golden per target
aka-blackboots Oct 1, 2026
7248802
Merge task/e1-budgets
aka-blackboots Oct 1, 2026
c313174
Merge task/e2-goldens
aka-blackboots Oct 1, 2026
0d0e195
Narrow the golden alias and cover a missing timing key outside CI
aka-blackboots Oct 1, 2026
86e439b
test: the wasm run fails without a passing test and the built declara…
aka-blackboots Oct 1, 2026
f5fb5de
Run the local gate in CI and ship node16-resolvable declarations
aka-blackboots Oct 1, 2026
c89b64b
Merge task/e3-ci
aka-blackboots Oct 1, 2026
69454d2
Remove the 2.0 tree
aka-blackboots Oct 2, 2026
3d66702
Move the 2.5 tree to main
aka-blackboots Oct 2, 2026
3081546
Point the ignore rules at the 2.5 tree in main
aka-blackboots Oct 2, 2026
f7b1879
Remove the parity oracle and keep its recorded fixtures
aka-blackboots Oct 2, 2026
df1c574
Replace the root build with a wrapper around main
aka-blackboots Oct 2, 2026
1533c39
Name main in the acceptance page's file-protocol hint
aka-blackboots Oct 2, 2026
3e5263e
Run the verification workflow from main
aka-blackboots Oct 2, 2026
d70240f
Publish the 2.5 package only from a manual release run
aka-blackboots Oct 2, 2026
4f89d23
Point the build and release notes at main
aka-blackboots Oct 2, 2026
c7a093f
Merge task/f1-make-standard
aka-blackboots Oct 2, 2026
a84b1fb
test: the package ships a true readme, licence and package details
aka-blackboots Oct 2, 2026
72c5d0b
Make the public README, package and contributor notes true for 2.5
aka-blackboots Oct 2, 2026
5251bcd
test: the README quick start boots from URLs, draws the wall and expo…
aka-blackboots Oct 2, 2026
3faa8ba
Re-wrap the local build paragraph in developer.md
aka-blackboots Oct 2, 2026
b02ab82
Merge task/g1-public-docs
aka-blackboots Oct 2, 2026
19acc8b
test: package README leaves footnotes and data-src alone, README ts f…
aka-blackboots Oct 2, 2026
33b3838
Correct the README and developer notes, and keep footnotes and data-s…
aka-blackboots Oct 2, 2026
45b9111
Merge task/g1-docs-fixes
aka-blackboots Oct 2, 2026
4037164
Correct the developer notes, README examples line, parity provenance …
aka-blackboots Oct 2, 2026
ee222f5
Merge task/g2-docs-polish
aka-blackboots Oct 2, 2026
24e09d2
Delete the 2.0 comparison-only fixtures and rework their readers
aka-blackboots Oct 2, 2026
f55605e
Format the reworked matrix STEP helper
aka-blackboots Oct 2, 2026
7f11f79
Rename the parity fixtures and test binary to cases
aka-blackboots Oct 2, 2026
40d1945
Delete CORPUS.md and drop parity from the golden targets notes
aka-blackboots Oct 2, 2026
e76ebf8
Merge task/h1-retire-comparison
aka-blackboots Oct 2, 2026
fbaec57
test: MIGRATION.md ts blocks type-check against the built package
aka-blackboots Oct 2, 2026
4e88f27
Add a migration guide for moving code from 2.0 to 2.5
aka-blackboots Oct 2, 2026
9f991f9
Describe the Different behaviour lists accurately in MIGRATION.md
aka-blackboots Oct 2, 2026
a257b43
Merge task/i1-migration-guide
aka-blackboots Oct 2, 2026
61a9d82
Correct the 2.0 to 2.5 migration guide where it misled
aka-blackboots Oct 2, 2026
ee355ae
Merge task/i1-guide-fixes
aka-blackboots Oct 2, 2026
96bd101
Correct the sweep turn and placement rows in the migration guide
aka-blackboots Oct 2, 2026
4c7053a
Merge task/i1-guide-fixes2
aka-blackboots Oct 2, 2026
ba0012e
Make the version note true after release and finish the guide wording
aka-blackboots Oct 2, 2026
f965a9b
Name the expected-result tests after what they compare
aka-blackboots Oct 2, 2026
8bb3131
Merge task/j1-leftovers
aka-blackboots Oct 2, 2026
42632ed
Correct four loose sentences in the guides
aka-blackboots Oct 2, 2026
bfe3a03
Merge task/j2-four-sentences
aka-blackboots Oct 2, 2026
169cdaa
Point the guide at its check steps, the optional marker and the sweep…
aka-blackboots Oct 2, 2026
d31a14c
Merge task/j3-guide-pointers
aka-blackboots Oct 2, 2026
a4ab1db
test: CI builds the golden scenes and checks no timing
aka-blackboots Oct 2, 2026
ed1e198
Run the golden comparison and timing budgets off CI only
aka-blackboots Oct 2, 2026
bba680b
test: stored results are compared only off CI
aka-blackboots Oct 2, 2026
4c386b3
Compare results with stored ones off CI only
aka-blackboots Oct 2, 2026
148f8f8
Merge task/k1-ci-no-recording
aka-blackboots Oct 2, 2026
e1e2989
Merge task/k2-ci-stored-results
aka-blackboots Oct 2, 2026
046ac35
Say the golden test compares no hash on CI or an unrecorded target
aka-blackboots Oct 2, 2026
0a08367
Merge task/k3-targets-wording
aka-blackboots Oct 2, 2026
cf9bb18
Say which texts the goldens hash, where CI runs and what the release …
aka-blackboots Oct 2, 2026
e8e6151
Merge task/k4-closeout-wording
aka-blackboots Oct 2, 2026
46a8455
updates
aka-blackboots Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 0 additions & 15 deletions .claude/settings.json

This file was deleted.

166 changes: 56 additions & 110 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Release Package

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: write
Expand All @@ -16,43 +13,29 @@ jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version-changed: ${{ steps.version-check.outputs.changed }}
current-version: ${{ steps.version-check.outputs.current-version }}
previous-version: ${{ steps.version-check.outputs.previous-version }}
is-valid-increment: ${{ steps.version-check.outputs.is-valid-increment }}
current-version: ${{ steps.current-version.outputs.version }}
npm-exists: ${{ steps.npm-check.outputs.exists }}
should-publish: ${{ steps.publish-decision.outputs.should-publish }}

steps:
- name: Checkout current commit
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '26'

- name: Get current version
id: current-version
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
CURRENT_VERSION=$(node -p "require('./main/package.json').version")
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT

- name: Get previous version
id: previous-version
run: |
# Get the previous commit
PREV_COMMIT=$(git rev-parse HEAD~1)
# Get package.json from previous commit
PREV_VERSION=$(git show $PREV_COMMIT:package.json | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin', 'utf8')).version")
echo "version=$PREV_VERSION" >> $GITHUB_OUTPUT

- name: Check if current version exists on NPM
id: npm-check
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
PACKAGE_NAME=$(node -p "require('./main/package.json').name")
CURRENT_VERSION="${{ steps.current-version.outputs.version }}"

echo "Checking if $PACKAGE_NAME@$CURRENT_VERSION exists on NPM..."
Expand All @@ -65,70 +48,27 @@ jobs:
echo "❌ Version $CURRENT_VERSION does not exist on NPM"
fi

- name: Check version change and validate increment
id: version-check
run: |
CURRENT="${{ steps.current-version.outputs.version }}"
PREVIOUS="${{ steps.previous-version.outputs.version }}"

echo "current-version=$CURRENT" >> $GITHUB_OUTPUT
echo "previous-version=$PREVIOUS" >> $GITHUB_OUTPUT

if [ "$CURRENT" != "$PREVIOUS" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "Version changed from $PREVIOUS to $CURRENT"

# Install semver for version comparison
npm install -g semver

# Check if current version is greater than previous
if semver gt "$CURRENT" "$PREVIOUS"; then
echo "is-valid-increment=true" >> $GITHUB_OUTPUT
echo "✅ Valid version increment: $PREVIOUS → $CURRENT"
else
echo "is-valid-increment=false" >> $GITHUB_OUTPUT
echo "❌ Invalid version increment: $PREVIOUS → $CURRENT"
echo "Current version must be greater than previous version"
exit 1
fi
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "Version unchanged: $CURRENT"
fi

- name: Decide whether to publish
id: publish-decision
run: |
VERSION_CHANGED="${{ steps.version-check.outputs.changed }}"
IS_VALID_INCREMENT="${{ steps.version-check.outputs.is-valid-increment }}"
NPM_EXISTS="${{ steps.npm-check.outputs.exists }}"
CURRENT_VERSION="${{ steps.current-version.outputs.version }}"

echo "🔍 Publishing Decision Matrix:"
echo " Version Changed: $VERSION_CHANGED"
echo " Valid Increment: $IS_VALID_INCREMENT"
echo " Exists on NPM: $NPM_EXISTS"
echo " Current Version: $CURRENT_VERSION"

# Publish if:
# 1. Version changed AND it's a valid increment, OR
# 2. Current version doesn't exist on NPM (failed previous build)
if [[ "$VERSION_CHANGED" == "true" && "$IS_VALID_INCREMENT" == "true" ]] || [[ "$NPM_EXISTS" == "false" ]]; then

echo "Exists on NPM: $NPM_EXISTS"
echo "Current Version: $CURRENT_VERSION"

if [[ "$NPM_EXISTS" == "false" ]]; then
echo "should-publish=true" >> $GITHUB_OUTPUT
if [[ "$VERSION_CHANGED" == "true" ]]; then
echo "✅ Will publish: Version increment detected"
else
echo "✅ Will publish: Version missing from NPM (likely failed previous build)"
fi
echo "✅ Will publish: Version $CURRENT_VERSION is not on NPM"
else
echo "should-publish=false" >> $GITHUB_OUTPUT
echo "⏭️ Will skip: Version unchanged and already exists on NPM"
echo "⏭️ Will skip: Version $CURRENT_VERSION already exists on NPM"
fi

build-and-publish:
needs: check-version
runs-on: ubuntu-latest
if: needs.check-version.outputs.should-publish == 'true'
if: github.ref == 'refs/heads/main' && needs.check-version.outputs.should-publish == 'true'

steps:
- name: Checkout code
Expand All @@ -137,67 +77,82 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '26'
registry-url: 'https://registry.npmjs.org'

- name: Setup Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
toolchain: '1.88.0'
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- id: wasm-pack
uses: actions/cache@v4
with:
path: ~/.cargo/bin/wasm-pack
key: wasm-pack-0.13.1-${{ runner.os }}-${{ runner.arch }}

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
if: steps.wasm-pack.outputs.cache-hit != 'true'
run: cargo install wasm-pack --version 0.13.1 --locked

- name: Cache Rust dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
main/opengeometry/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
main/opengeometry/test-support/target
key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('main/**/Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}-

- name: Cache Node.js dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('main/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install dependencies
working-directory: main
run: npm ci

- name: Lint TypeScript
run: npm run lint:check
- name: Fetch crate dependencies
working-directory: main
run: |
git ls-files '*Cargo.lock' | while read -r lock; do
cargo fetch --locked --manifest-path "$(dirname "$lock")/Cargo.toml"
done

- name: Run build
working-directory: main
run: npm run build

- name: Verify dist directory
run: |
echo "Checking dist directory contents:"
ls -la dist/
ls -la main/dist/
echo "Checking if package.json exists in dist:"
if [ -f "dist/package.json" ]; then
if [ -f "main/dist/package.json" ]; then
echo "✅ package.json found in dist"
echo "Dist package version: $(node -p "require('./dist/package.json').version")"
echo "Dist package version: $(node -p "require('./main/dist/package.json').version")"
else
echo "❌ package.json not found in dist"
exit 1
fi

- name: Run tests
run: npm test
- name: Run checks
working-directory: main
run: npm run check

- name: Final NPM existence check
id: final-npm-check
run: |
PACKAGE_NAME=$(node -p "require('./dist/package.json').name")
PACKAGE_NAME=$(node -p "require('./main/dist/package.json').name")
VERSION="${{ needs.check-version.outputs.current-version }}"

echo "🔍 Final check before publishing..."
Expand All @@ -211,9 +166,8 @@ jobs:

- name: Publish to NPM
if: steps.final-npm-check.outputs.exists == 'false'
run: |
cd dist
npm publish --access public
working-directory: main/dist
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -226,7 +180,7 @@ jobs:
body: |
## Changes in v${{ needs.check-version.outputs.current-version }}

${{ needs.check-version.outputs.version-changed == 'true' && format('Version bumped from {0} to {1}', needs.check-version.outputs.previous-version, needs.check-version.outputs.current-version) || format('Recovery publish for version {0}', needs.check-version.outputs.current-version) }}
Published from a manual run of the release workflow.

### Package Information
- **Package Name**: opengeometry
Expand Down Expand Up @@ -256,11 +210,7 @@ jobs:
echo "**Package**: [opengeometry@${{ needs.check-version.outputs.current-version }}](https://www.npmjs.com/package/opengeometry)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Publish Reason" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.check-version.outputs.version-changed }}" == "true" ]]; then
echo "- 📈 Version increment: ${{ needs.check-version.outputs.previous-version }} → ${{ needs.check-version.outputs.current-version }}" >> $GITHUB_STEP_SUMMARY
else
echo "- 🔄 Recovery publish: Version was missing from NPM registry" >> $GITHUB_STEP_SUMMARY
fi
echo "- Manual run: Version was not on NPM" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
echo "- Check the [NPM package page](https://www.npmjs.com/package/opengeometry)" >> $GITHUB_STEP_SUMMARY
Expand All @@ -286,13 +236,9 @@ jobs:
run: |
echo "## ⏭️ Build Skipped" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Reason**: No version change and package already exists on NPM" >> $GITHUB_STEP_SUMMARY
echo "**Reason**: This version already exists on NPM" >> $GITHUB_STEP_SUMMARY
echo "**Current Version**: ${{ needs.check-version.outputs.current-version }}" >> $GITHUB_STEP_SUMMARY
echo "**NPM Status**: ✅ Already published" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### To trigger a new release:" >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
echo 'npm version patch # for bug fixes' >> $GITHUB_STEP_SUMMARY
echo 'npm version minor # for new features' >> $GITHUB_STEP_SUMMARY
echo 'npm version major # for breaking changes' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "### To publish a new release:" >> $GITHUB_STEP_SUMMARY
echo "Bump the version in main/package.json, main/package-lock.json, main/opengeometry/Cargo.toml, main/opengeometry/Cargo.lock and main/opengeometry/test-support/Cargo.lock, merge to main, then start this workflow by hand on main." >> $GITHUB_STEP_SUMMARY
Loading
Loading