Repository navigation
Breaking: Node 22+, latest dependencies, tsdown/Biome/TS 7, and bug fixes - #41
Merged
Merged
Conversation
Node 20 reached end of life in April 2026. jsdom 31, undici 8, vitest 5 and tsup 9 all need Node 22, so engines now mirror jsdom's range. - Runtime: jsdom 31, undici 8, @napi-rs/canvas 1.1, @fontsource/noto-sans 5.3 - Dev: vitest 5, eslint 10, typescript 6.0, tsup 9, jest 30, typescript-eslint 8.72 - Drop unused chai and the redundant @typescript-eslint/* packages - Remove legacy .eslintrc files ignored by ESLint 9+; lint now covers all of src - tsconfig: moduleResolution bundler (node10 is deprecated in TS 6) - tsup: target node22, drop the undeclared glob import - undici polyfills: add MessagePort/MessageChannel for jest-environment-jsdom (undici 8 needs them) and only patch globals that are actually missing - Recalibrate two pixel tolerances for canvas 1.x text and shadow rendering Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx
- Proxy: use EnvHttpProxyAgent so HTTP_PROXY/HTTPS_PROXY apply to the right scheme and NO_PROXY is honoured; re-read variables per request - Send an identifying User-Agent to tile servers and abort fetches after 30s - Decode file:// URLs with fileURLToPath (spaces, Windows drive letters) and build the marker icon path with pathToFileURL - Stop replacing Node's global setTimeout, which broke util.promisify(setTimeout) for any app that imported leaflet-node - initializeEnvironment() options now apply after the automatic init instead of being silently ignored - Keep error causes and fix the remaining lint errors - New tests for image loading, proxies, init options and export positioning; add a coverage floor Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx
- Add the MIT LICENSE file that package.json already promised - CI: test Node 22/24/26, run lint, typecheck and coverage - Publish/release/docs workflows on Node 24 (npm@latest no longer runs on 20) - Release workflow no longer tries to attach image-stitch's bundle - README: API table, Node requirement, network/proxy section, current ts-jest config syntax - Remove stray debugging scripts from the repo root Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
- Build with tsdown instead of tsup, which is no longer maintained. File names are unchanged; index and testing now share one chunk instead of each bundling a copy of the library. - exports map: separate types per condition (.d.mts for import, .d.ts for require). Before this, ESM consumers on moduleResolution nodenext got the CJS-shaped types and `L.map` did not type-check. - Load undici lazily. In the bundled ESM output its static import ran before the polyfills, so importing the package under jest-environment-jsdom threw "TextDecoder is not defined". The proxy agent is cached as a promise so concurrent first requests share one agent. - Replace ESLint and typescript-eslint with Biome (lint and format), keeping noFloatingPromises and noMisusedPromises. Format the repo with Biome. - TypeScript 7.0. Type declarations are byte-identical to the TS 6 build. - Jest fixture is now plain .mjs against dist/, so ts-jest and @types/jest are no longer needed. pretest scripts build first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx
oxlint --type-aware runs typescript-eslint's type-checked rules through tsgolint, which is built on typescript-go (TS 7). This restores the checks dropped with typescript-eslint: no-floating-promises, no-misused-promises, await-thenable, require-await, unbound-method, prefer-promise-reject-errors, restrict-template-expressions, no-base-to-string, only-throw-error and others. Biome still handles formatting and the general lint rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Jonathan · project thread
This updates every dependency, moves the toolchain to tsdown, Biome and TypeScript 7, fixes several bugs that affect people using the library in their own apps, and fills in what's missing for a public npm package. The first commit message starts with "Breaking", so the bump workflow should release this as 3.0.0.
Breaking change
Dependencies and toolchain
indexandtestingnow share one chunk instead of each bundling a copy of the library.noFloatingPromisesandnoMisusedPromisesrules are enabled to cover part of the type-aware checking we lose..d.tsfiles are byte-identical to the TS 6 build.npm audit --omit=devreports 0 vulnerabilities. 19 moderate/low advisories remain, all in dev-only packages inside jest's own dependency tree.Bug fixes
moduleResolution: nodenextgot broken types.L.mapdidn't type-check because both conditions pointed at the CJS-shaped.d.ts. Theexportsmap now givesimportits.d.mtsandrequireits.d.ts. This was broken in 2.x too.TextDecoder is not defined. The bundler hoisted undici's import above the polyfills, so undici is now loaded lazily. The Jest fixture now tests the builtdist/output, which is how it caught this.util.promisify(setTimeout). The polyfill replaced Node's globalsetTimeouteverywhere. It now wraps timers only in jsdom-style environments.MessagePort is not defined. Added MessagePort/MessageChannel polyfills, and all polyfills now apply only when the global is missing.HTTPS_PROXYwas used for http:// URLs,NO_PROXYwas ignored, and the proxy was cached forever. This now uses undici'sEnvHttpProxyAgent, re-reads the variables on each request, and shares one agent across concurrent requests.initializeEnvironment(options)was a no-op after the automatic init. It now applies to maps created afterwards.fileURLToPathandpathToFileURL.User-Agent, which OSM's tile policy requires, and are aborted after 30 seconds.Packaging and CI
LICENSEfile, whichpackage.jsonlisted but didn't exist. Also addedhomepage,bugsand agit+httpsrepository URL.dist/and made them flaky when run together.npm@latestno longer installs on Node 20. The release workflow no longer tries to attach image-stitch's bundle..eslintrc*files. The old lint glob only matchedsrc/polyfills, so most files were never linted.Tests and coverage
initializeEnvironmentoptions,promisify(setTimeout), the marker icon path, and every CSS positioning path in the exporter.vitest.config.mts.Verification
npm run lint,npm run typecheck,npm run test:coverage(178 passed) andnpm run test:docs(17 passed) all pass on Node 22.npm packtarball in a clean project. ESM rendered a PNG, CJSrequireworks for both entry points, and the types check under bothnodenextandbundlerresolution.🤖 Generated with Claude Code
https://claude.ai/code/session_01QhgcNyPGK62bg5XGGZhpkx