Ensure you can access internal resources with npm run refreshVSToken
, then install the dependencies using npm install
.
Run npm run dev
and a new browser window should open with the editor. Changes to files will trigger a rebuild and refresh the browser. This view will only show the topology editor. To test all functionality, you need to run the actual extension as explained below.
Run npm run compile
and press F5 in VS Code. You should see the extension in the bottom right, expand it if needed. On first run, you need to connect to an Azure IoT Hub using a connection string. You can then manage graph topologies and instances on the chosen device.
You can get a connection string by following the instructions in the Quickstart. Follow the steps up until Configure the Azure IoT Tools extension and use the connection string in this extension instead of Azure IoT Tools.
To avoid redundant recalculation of the list of available nodes shown in the sidebar and the information about each, this information is pre-computed and stored on disk. The definitions are derived from the Swagger JSON for LVA. You should be able to find it in the azure-rest-api-specs repo.
During this pre-computation, two files are generated in the src/definitions/data
folder: nodes.json
and i18n.en.json
. The second file contains all localizable description strings extracted from the node definitions. nodes.json
only contains placeholders, the descriptions are localized when the editor runs.
If needed (for example when a new version is released), create a new folder in tools/definition-generator
for the version you are introducing. Add a LiveVideoAnalytics.json
file with the updated Swagger definitions and a list usableNodes.json
. Update tools/definition-generator/entry.ts
with the version you are targeting and run npm run create-definitions
to create the a new set of pre-computed files.
Only new values are added to the i18n.en.json
file. Already localized values are left unchanged. To regenerate this file from scratch, delete it and rerun the definition generator. You can also regenerate specific keys by deleting them from the file and running the command. The nodes.json
file is overwritten each time.
src/data/index.ts
contains type TypeScript definitions automatically generated using AutoRest. See this document for more information on how to generate them.
- Install AutoRest:
npm install -g autorest
- Download a copy of azure-rest-api-specs (clone or download as ZIP). You can just unzip the needed folder (
LiveVideoAnalytics.Edge
). - Navigate into the folder containing the LVA Swagger definition (probably
cd specification/mediaservices/data-plane/LiveVideoAnalytics.Edge/BRANCH/VERSION
), - Run
autorest --typescript --input-file="LiveVideoAnalytics.json" --output-folder="output" --generate-metadata --enum-types=true --model-date-time-as-string=true
- Open the generated
index.ts
file inoutput\src\models
and make the following changes to fix errors:- Remove the import statements
- Remove type definitions including references to
msRest.HttpResponse
- Remove
extends ServiceClientOptions
When run in VS Code, the editor will automatically adapt to the user's theme. Avoid using pre-defined colors and try to use var(--vscode-*)
CSS variables defined by VS Code to theme UI elements. You can also add new variables scoped to the user's theme kind (light, dark, high contrast) in App.css
.
Since the VS Code theme variables are not available when run in the browser for development mode, variables from the default light theme have been predefined in public/index.html
.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.