Fix/strict type - #247
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.jsonand build steps to emit declarations todist/types/plus a generateddist/index.d.tsentry with shims. - Update internal type-only imports to resolve via explicit
../indexpaths and tighten the type test harness tostrict: true. - Adjust npm publishing metadata to ship
dist/only and route type resolution todist/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. |
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.
Fix Strict Typing Compatibility
Description
.d.tsdeclarations (dist/types/) and a generated type entry (dist/index.d.ts) instead of pointing consumers' type resolution at the raw.tssource. This stops downstream TypeScript projects from compiling ULabel's source under their own (stricter)tsconfig.src/directory in the npm package (filesnow shipsdist/only).PR Checklist
package.jsonhas been bumped since last releasepackage.jsonandsrc/version.jsapi_spec.md)changelog.mdBreaking API Changes
Shouldnt be