View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0021381 | MMW 5 | Extensions framework | public | 2024-11-30 04:02 | 2024-11-30 04:53 |
Reporter | drakinite | Assigned To | |||
Priority | high | Severity | feature | Reproducibility | N/A |
Status | assigned | Resolution | open | ||
Product Version | 2024.1 | ||||
Target Version | 2024.1 | ||||
Summary | 0021381: Add TypeScript / type hinting support for addon developers | ||||
Description | The objective is to publish MM's typescript declaration files to a NPM package that can be imported in the addon developers' projects, with assistance from pack-mmip for automating the initialization and build process. The addition of type hinting should be really helpful for addon developers writing JS. The general idea is that the "declarations" folder that's emitted by the new typescript compile process is turned into a NPM package, which can be imported into their project. When their tsconfig.json is set up right (which I plan to be autogenerated with a `pack-mmip --init` call), VS Code (and hopefully other IDEs with TS support) will automatically understand all of the custom functions and window extensions that MM makes, and then you can create imports in your file, like import Multiview from 'mediamonkey-types/controls/multiview'. The IDE will then understand that it's importing the Multiview class. Then, when pack-mmip is called to package the addon, it runs a simple post-processing script that replaces 'mediamonkey-types' in the import string with the appropriate relative path (e.g. dialogs/dlgUndockedControls.ts's import would turn into import Multiview from '../controls/multiview'. | ||||
Tags | No tags attached. | ||||
Fixed in build | |||||