Skip to content

Add TypeScript definition file to package.json - #187

Open
ecstrema wants to merge 2 commits into
OpenBeta:developfrom
ecstrema:patch-1
Open

ecstrema wants to merge 2 commits into
OpenBeta:developfrom
ecstrema:patch-1

Conversation

@ecstrema

@ecstrema ecstrema commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Currently, when using the 0.0.55 with typescript 7, I get the following error:

Could not find a declaration file for module '@openbeta/sandbag'. 'C:/Users/remim/prog/climbhub/node_modules/.bun/@openbeta+sandbag@0.0.55/node_modules/@openbeta/sandbag/dist/sandbag.esm.js' implicitly has an 'any' type.
  There are types at 'C:/Users/remim/prog/climbhub/node_modules/.bun/@openbeta+sandbag@0.0.55/node_modules/@openbeta/sandbag/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@openbeta/sandbag' library may need to update its package.json or typings.ts(7016)

It seems that although referenced by the "types" field, they are not exported, so typescript 7 refuses to use them.

Adding "types" to export fixes it.

Currently, when using the 0.0.55 with typescript 7, I get the following error:

```
Could not find a declaration file for module '@openbeta/sandbag'. 'C:/Users/remim/prog/climbhub/node_modules/.bun/@OpenBeta+sandbag@0.0.55/node_modules/@openbeta/sandbag/dist/sandbag.esm.js' implicitly has an 'any' type.
  There are types at 'C:/Users/remim/prog/climbhub/node_modules/.bun/@OpenBeta+sandbag@0.0.55/node_modules/@openbeta/sandbag/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@openbeta/sandbag' library may need to update its package.json or typings.ts(7016)
```

It seems that although referenced by the "types" field, they are not exported, so typescript 7 refuses to use them.

Adding "types" to export fixes it.
@github-actions

github-actions Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Coverage report

Caution

Coverage does not meet threshold
Statements coverage not met for global: expected <=999999 not covered statements, but got 630

St.❔
Category Percentage Covered / Total
🟢 Statements
87.87% (-0.08% 🔻)
630/717
🟡 Branches 67.54% 129/191
🟢 Functions
81.25% (+1.98% 🔼)
130/160
🟢 Lines
86.91% (+0.02% 🔼)
571/657

Test suite run success

268 tests passing in 17 suites.

Report generated by 🧪jest coverage report action from 8eedf4c

@CocoisBuggy

Copy link
Copy Markdown
Contributor

@ecstrema thanks for your contribution, the CI checks are failing because you have introduced a JSON syntax error

@ecstrema

Copy link
Copy Markdown
Contributor Author

This should now be fixed now. Sorry it was a single line so i didn't bother cloning. I edited directly in github's interface, which is far from good.

@CocoisBuggy

Copy link
Copy Markdown
Contributor

Shot for the quick fix! I think you're using bun? I haven't checked but maybe they parse the package.json more leniently than yarn/node.

The lint issue is a bit strange, I'll investigate that

@ecstrema

Copy link
Copy Markdown
Contributor Author

It's probably artifacts from the repo itself, but might be worth a better look.

@ecstrema

Copy link
Copy Markdown
Contributor Author

It might be simpler to add it to #191 though.

@ecstrema

Copy link
Copy Markdown
Contributor Author

Also, when are you planning the next release? I've been building my own library, but i'd prefer switching to this one to avoid maintaining it.

This branch has not been deployed

No deployments
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.

2 participants