pnpm install
pnpm build:app
pnpm watchpnpm build:appbuilds the front-end app (i.e. the H5Web viewer) with Vite.pnpm watchcompiles the extension code withtscin watch mode.
Once watch mode is running, press F5 to run the extension in debug mode in a new VS Code window. If this doesn't work, check that the JavaScript Debugger extension is enabled.
Whenever you change the code of the front-end app, run pnpm build:app again in
a separate terminal, wait for Vite to finish building the app, and reload the VS
Code window where the extension is running with Ctrl+R.
- When the user opens an HDF5 file, a new webview editor opens up.
- The webview is
initialised with an HTML document that references the compiled front-end
assets located in the
distdirectory. - VS Code loads the webview, which kicks off the H5Web viewer.
- Once the
Appcomponent is mounted, it notifies the extension that the viewer is ready using VS Code'spostMessageAPI. - The extension then sends the URI and name of the HDF5 file opened by the user to the viewer.
- Finally, the viewer fetches the file with the given URI as an array buffer,
passes that buffer to the
H5WasmBufferProvider, and renders H5Web'sAppcomponent. - If the file is larger than 2 GB and can't fit into a single buffer, the
Appcomponent renders a fallbackStandaloneViewer, which offers to the user to browse for the file from inside the webview. In doing so, the webview can make use of H5Web'sH5WasmLocalFileProvider, which has no file size restriction.
pnpm lint- run all linting and code formatting commandspnpm lint:eslint- lint all TS and JS files with ESLintpnpm lint:eslint --fix- auto-fix linting issuespnpm lint:prettier- check that all files have been formatted with Prettierpnpm lint:prettier --write- format all files with Prettier
The H5Web extension is published to the Visual Studio Marketplace and to the Open VSX Registry. To be able to publish to these platforms, you must first follow the steps outlined in the respective sections below.
Before publishing, remember to update the CHANGELOG and commit/push all
changes. Then, run the following command to publish the extension to the VS Code
Marketplace:
pnpm pub <patch|minor|major|x.y.z>This will build the front-end app and the extension, bump the version in
package.json and publish the extension to the Marketplace.
Do not use the
pnpm publishcommand, as this is a reserved command for publishing packages to the NPM repository.
It will take a few minutes before the new version appears in the Marketplace, and it may take a while longer before you're able to update the extension in VS Code.
Once you're able to install the new version and confirm that it works as expected, proceed with publishing the extension to the Open VSX Registry:
pnpm pub:ovsx -p <token>Do not pass a version number this time!
Once the extension is published, push the tag created by the first pnpm pub
command, and
publish a new release on
GitHub to advertise it.
To be allowed to publish an extension to the Visual Studio Marketplace you must have access to both the H5Web publisher account on the Marketplace and the H5Web organisation on Azure DevOps, with the same Microsoft account.
Then, you have to
generate a Personal Access Token
(PAT) on Azure DevOps. Then, use the vsce CLI and your PAT to add h5web to
the list of known publishers on your machine:
pnpx vsce login h5webYou're now ready to publish the extension to the Visual Studio Marketplace.
Users of VSCodium and other forks of VSCode may not be able to install extensions from the Visual Studio Marketplace. The Open VSX Registry is an alternative managed by the Eclipse Foundation.
To be allowed to
publish an extension
to the registry you must create an Eclipse account,
link it to your Open VSX Registry account, create a personal access token, and
be added as a member of the h5web namespace by an owner of that namespace.
If the
h5webnamespace no longer has an owner, you may claim ownership publicly.