Wasm build and publish - #3316
Conversation
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
this should probably use the latest version of the action (i.e. v6 as of now). Same for all other official actions
| removeSelected(): void; | ||
|
|
||
| /** Direct access to Emscripten's virtual filesystem. */ | ||
| FS: any; |
There was a problem hiding this comment.
this might use the types from @types/emscripten to define the proper type here instead of using any
| "types": "./js/praat-wasm.d.ts" | ||
| }, | ||
| "./classes": { | ||
| "import": "./js/classes.mjs" |
There was a problem hiding this comment.
If this file is exposed for direct import, it should probably have its type declarations to make it usable in Typescript (the praat-wasm.d.ts file can then reference classes.d.ts instead of duplicating them)
| }, | ||
| "./worker-client": { | ||
| "import": "./js/worker-client.mjs", | ||
| "types": "./js/praat-wasm.d.ts" |
There was a problem hiding this comment.
this looks wrong to me. worker-client.mjs does not export the full praat-wasm API. It exports only createPraatWorker. This should have a worker-client.d.ts file matching the API of that file
| ], | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/reynoldsnlp/praat.github.io.git" |
There was a problem hiding this comment.
should probably be updated to be the praat repository
| "import": "./js/classes.mjs" | ||
| }, | ||
| "./worker": { | ||
| "import": "./js/worker.mjs" |
There was a problem hiding this comment.
this one should also have type declarations
There was a problem hiding this comment.
should the generated wasm file really be committed in git ?
| * Add snake_case aliases for all camelCase methods on a prototype. | ||
| * @param {Function} cls | ||
| */ | ||
| function addSnakeCaseAliases (cls) { |
There was a problem hiding this comment.
Do we need those snake case aliases ? That's quite uncommon in JS packages
This wasm build is already passing tests and I published to npm. A deployed example is here.