Skip to content

feat: export dist wasm files and package.json - #228

Merged
khaledhosny merged 2 commits into
harfbuzz:mainfrom
danielroe:fix/export-subset-wasm
Aug 25, 2026
Merged

feat: export dist wasm files and package.json#228
khaledhosny merged 2 commits into
harfbuzz:mainfrom
danielroe:fix/export-subset-wasm

Conversation

@danielroe

Copy link
Copy Markdown
Contributor

currently esm users can't import individual wasm files - this exposes them so (for example) this documented example continues to work:

https://github.com/harfbuzz/harfbuzzjs/blob/main/examples/harfbuzz-subset.example.node.js#L12-L16

(my motivation: I'm trying to prepare a PR to https://github.com/papandreou/subset-font to update to the latest version of harfbuzzjs, and it needs direct wasm access)

Comment thread package.json Outdated
}
},
"./dist/*.wasm": "./dist/*.wasm",
"./package.json": "./package.json"

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.

I understand .wasm, but what is package.json needed for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

happy to drop it - I have no particular need of it, but added it as I often do in case people need to check the version of the package that is installed, e.g.:

import pkg from 'harfbuzzjs/package.json'

echo(pkg.version)

the alternative, should this be needed, is doing strange things to find the directory of the package, and then readFileSync - but of course this is theoretical as I guess no one's asked for this yet!

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.

Drop it then, please.

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.

@khaledhosny, the package.json export was dropped but the PR’s title wasn’t revised, which made the automatically generated change log inaccurate: https://github.com/harfbuzz/harfbuzzjs/releases/tag/v1.6.1

Comment thread package.json Outdated
@khaledhosny
khaledhosny merged commit 739196a into harfbuzz:main Aug 25, 2026
3 checks passed
@khaledhosny

Copy link
Copy Markdown
Contributor

Thanks!

@lianghai

lianghai commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Yay we got @danielroe’s contribution!

@danielroe
danielroe deleted the fix/export-subset-wasm branch September 5, 2026 16:17
@danielroe

Copy link
Copy Markdown
Contributor Author

lovely to bump into you here! @lianghai!

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.

3 participants