Skip to content

Fix/strict type - #247

Merged
TrevorBurgoyne merged 3 commits into
mainfrom
fix/strict-type
Jul 21, 2026
Merged

Fix/strict type#247
TrevorBurgoyne merged 3 commits into
mainfrom
fix/strict-type

Conversation

@TrevorBurgoyne

Copy link
Copy Markdown
Member

Fix Strict Typing Compatibility

Description

  • Ship generated .d.ts declarations (dist/types/) and a generated type entry (dist/index.d.ts) instead of pointing consumers' type resolution at the raw .ts source. This stops downstream TypeScript projects from compiling ULabel's source under their own (stricter) tsconfig.
  • Stop publishing the src/ directory in the npm package (files now ships dist/ only).

PR Checklist

  • Merged latest main
  • Version number in package.json has been bumped since last release
  • Version numbers match between package package.json and src/version.js
  • Updated documentation if necessary (currently just in api_spec.md)
  • Added changes to changelog.md

Breaking API Changes

Shouldnt be

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the package’s TypeScript type publishing strategy to avoid downstream projects type-checking ULabel’s raw src/*.ts under stricter consumer tsconfig settings, by shipping generated declaration output under dist/ and pointing types/exports there.

Changes:

  • Add a dedicated tsconfig.types.json and build steps to emit declarations to dist/types/ plus a generated dist/index.d.ts entry with shims.
  • Update internal type-only imports to resolve via explicit ../index paths and tighten the type test harness to strict: true.
  • Adjust npm publishing metadata to ship dist/ only and route type resolution to dist/index.d.ts.

Reviewed changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.types.json New TS project for emitting declaration-only output into dist/types/.
tsconfig.json Excludes dist/ from the main TS build inputs.
tests/types/tsconfig.json Enables strict to validate consumer-like strict type-checking.
src/version.js Bumps library version to 0.23.7.
src/toolbox.ts Updates type-only imports to reference ../index.
src/toolbox_items/submit_buttons.ts Updates type-only import to reference the root index entry.
src/subtask.ts Updates type-only imports to reference ../index.
src/overlays.ts Updates type-only imports to reference ../index.
src/listeners.ts Updates type-only imports to reference ../index.
src/index.d.ts Updates re-export to reference ../index.
src/html_builder.ts Updates type-only imports to reference ../index.
src/configuration.ts Updates type-only imports to reference ../index.
src/canvas_utils.ts Updates type-only imports to reference ../index.
src/annotation.ts Updates type-only imports to reference ../index.
src/annotation_operators.ts Updates type-only imports to reference ../index.
src/actions.ts Updates type-only imports to reference ../index.
scripts/emit-type-shims.js New build helper to generate dist/index.d.ts and shim entries under dist/.
package.json Routes types/exports.types to dist/index.d.ts, ships only dist/, and wires type build steps into build scripts.
package-lock.json Updates lockfile package version metadata to 0.23.7.
eslint.config.mjs Adds scripts to global ignores.
CHANGELOG.md Adds 0.23.7 release notes for the new type publishing approach.

Comment thread eslint.config.mjs
@TrevorBurgoyne TrevorBurgoyne added the bug Something isn't working label Jul 21, 2026
@TrevorBurgoyne
TrevorBurgoyne merged commit bdbd218 into main Jul 21, 2026
4 checks passed
@TrevorBurgoyne
TrevorBurgoyne deleted the fix/strict-type branch July 21, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants