laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
44.97k stars 4.89k forks source link

unable to import @joplin/turndown into my esm project #10640

Open vassudanagunta opened 2 months ago

vassudanagunta commented 2 months ago

Operating system

macOS

Joplin version

latest

Desktop version info

No response

Current behaviour

import TurndownService from '@joplin/turndown'

results in

error TS7016: Could not find a declaration file for module '@joplin/turndown'. '.../node_modules/@joplin/turndown/lib/turndown.cjs.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/joplin__turndown` if it exists or add a new declaration (.d.ts) file containing `declare module '@joplin/turndown';`

The same thing happens for @joplin/turndown-plugin-gfm.

Expected behaviour

Looking in the node_modules/@joplin/turndown, I only see turndown.cjs.js, not the .es.mjs version that the package.json build script mentions.

I was hoping to use your version of Turndown.js!

Logs

No response

personalizedrefrigerator commented 2 months ago

Based on packages/turndown/package.json, it seems that only the CJS version of the library is built in CI: https://github.com/laurent22/joplin/blob/8eda8d3c849c01b5f3c79662afaf004e434d61b1/packages/turndown/package.json#L44 https://github.com/laurent22/joplin/blob/8eda8d3c849c01b5f3c79662afaf004e434d61b1/packages/turndown/package.json#L50

The prepare step might need to be changed to npm run build-all to support ESM.

github-actions[bot] commented 1 month ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

vassudanagunta commented 1 month ago

This is still a needed fix. I hesitate to take a stab at it as I don't (yet) use Joplin and I not sure I can do the update safely without breaking the primary client (Joplin).

github-actions[bot] commented 2 weeks ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

vassudanagunta commented 1 week ago

Yes, this really ought to be fixed. @personalizedrefrigerator seems to know what's what. I was hoping it would happen. I'm not familiar at all with the codebase and build system, otherwise I'd make a PR.