Skip to content

Migrate build to tsdown and vary piece shapes - #10

Merged
ShadowNineX merged 4 commits into
mainfrom
fix/tsdown-distinct-pieces
Aug 25, 2026
Merged

Migrate build to tsdown and vary piece shapes#10
ShadowNineX merged 4 commits into
mainfrom
fix/tsdown-distinct-pieces

Conversation

@TailsProwerWorks

Copy link
Copy Markdown
Collaborator

Summary

  • replace tsup with tsdown while preserving package entry filenames and docs IIFE output
  • add deterministic per-edge shape variation for generated jigsaw pieces, with Canvas and Manufacturer opt-out/configuration
  • persist piece shape profiles through import/export and document the new behavior
  • update compatible dependency ranges and lockfile entries

Tests

  • bun run lint
  • bun run all
  • npm pack --dry-run
  • node -e "const hb = require('./dist/index.js'); if (!hb.Puzzle || !hb.default) throw new Error('bad cjs exports');"
  • node --input-type=module -e "import hb, { Puzzle } from './dist/index.mjs'; if (!Puzzle || !hb.Puzzle) throw new Error('bad esm exports');"

Notes

  • tsdown emits non-fatal MIXED_EXPORTS notices because the existing public API intentionally exposes both named exports and a default namespace.
  • npm pack now includes a small tsdown Rolldown runtime chunk used by the ESM build.

Fixes #9
Fixes #6

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c6f3c7a-ee0e-465d-850c-09b5aef66e21


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Aug 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedtypescript-eslint@​8.58.2 ⏵ 8.67.010010074 +198100
Updated@​vitest/​coverage-v8@​4.1.4 ⏵ 4.1.11991007999 +2100
Updatedvitest@​4.1.4 ⏵ 4.1.1198 +110079 +199 +1100
Updatedjiti@​2.6.1 ⏵ 2.7.097 +1100100 +182100
Addedtsdown@​0.22.14981008896100
Updatedkonva@​10.2.5 ⏵ 10.3.110010010092 +4100
Updated@​antfu/​eslint-config@​8.2.0 ⏵ 8.3.09710010095 +1100
Updatedjsdom@​29.0.2 ⏵ 29.1.198100100 +195100
Updatedeslint@​10.2.1 ⏵ 10.9.09710010097 +1100

View full report

@socket-security

socket-security Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm jsdom is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package.jsonnpm/jsdom@29.1.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jsdom@29.1.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@TailsProwerWorks

Copy link
Copy Markdown
Collaborator Author

Follow-up for review feedback:

  • Replaced all generic .length assertions using toBe/equivalent patterns in the test suite with toHaveLength(...), including the additional nested outline test case.
  • Added user-facing docs for generated piece shape variation at /guides/piece-shape-variation/ and linked it in the docs sidebar.
  • Installed docs dependencies from the existing docs lockfile to validate the Astro docs build; docs/bun.lock was normalized to match docs/package.json ranges, with no package version upgrade added in this follow-up.

Verification run:

  • bun test test/canvas.test.ts test/manufacturer.test.ts test/outline.test.ts test/puzzle.test.ts test/shuffler.test.ts - 94 passed
  • bun run lint - passed
  • bun run typecheck - passed
  • bun run all - 19 files / 315 tests passed; build passed with existing tsdown MIXED_EXPORTS notices
  • bun run build in docs/ initially failed because Astro telemetry tried to write /home/sandbox/.config/astro; rerun with ASTRO_TELEMETRY_DISABLED=1 XDG_CONFIG_HOME=/tmp/astro-config XDG_CACHE_HOME=/tmp/astro-cache bun run build passed and generated /guides/piece-shape-variation/index.html.
  • npm pack --dry-run - passed
  • CJS and ESM export smoke checks - passed

Commit: 58ee298

@sonarqubecloud

Copy link
Copy Markdown

@ShadowNineX
ShadowNineX merged commit 4c7f460 into main Aug 25, 2026
6 checks passed
@ShadowNineX
ShadowNineX deleted the fix/tsdown-distinct-pieces branch August 25, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate to tsdown Differentiate each jigsaw piece slightly to better mimic real-world puzzles

2 participants