We received good news from the Microsoft Edge Extension team that their publish API is now in beta available: link.
Following a brief discussion with the edge team, we immediately get to work on a nodejs module to abstract away the API calls. 8 hours later, we released our new open source package Edge Webstore Upload module, with the code available to audit here under MIT License.
Our initial process to deliver this module is as follow:
- Using our internal github template
qttto bootstrap a node module
- Mirroring the setup in our Chrome Webstore Upload module
While mirroring, we also upgrade the dependencies on both project to latest. As we refine our build setup, we found that ES interop via a final bundling in BMS is achievable. Thus, we converted
ewu to target just ESM.
Above concludes our setup phase. We now start our exploration with the edge publish API. At Plasmo, we love ourselves a quick, iterative, feedback-driven, explorative programming session. The basic idea is that there is an evaluator that continuously run our code as we press ctrl+s. For this, our evaluator is the unit test runner (jest).
Since the API gives example in curl, we used this curl to fetch tool to convert the calls, and then convert it to got api manually. Once the API usage is clear, we start moving our test code into our library module's class method, and refactor the unit test to be more modular for each API call. We then study the response type and the error returned by the API, and compose them into typescript types. We then exports everything so that other library can consume our code.
Since the edge API is very straight forward, there was not many challenge we faced while working on our node API. There were two annoying issues:
- Creating the test zip file
- ESM + jest + TypeScript
We found quick workaround for the above, but maybe future tooling improvement will make it easier.
For annoying issue #1, we have added a new sub command to our internal tool
test-zip, which creates a new
test.zip chrome extension file that can be quicky used for our future test modules. It only generate chrome extension at the moment, but maybe we can add another params for firefox addons, as well as safari?
Captain's Log released: link
The Microsoft Edge Extension publish API is now publicly available: link.