-
Notifications
You must be signed in to change notification settings - Fork 61
Key Concepts of TypeSpec
A basic introduction to TypeSpec. At the very least, you need to know that currently, codegen's TypeSpec parsing is done on the frontend.
It's a Git submodule, usually we use git submodule update --init --recursive --checkout --force to sync with it.
https://github.com/Azure/typespec-azure leverages https://github.com/microsoft/typespec as "core".
The parsing logic is in the frontend. It'll generate an initial data model to backend.
TypespecCommandGenerator transforms swagger to aaz data model. It contains several APIs:
- @bp.route("//<list_path:mod_names>/ResourceProviders", methods=("GET",))
- @bp.route("//<list_path:mod_names>/ResourceProviders/<rp_name>/TypeSpec", methods=("GET",))
Entry file is main.tsp. The frontend doesn't have direct access to the disk, so it will ask for this from the backend.
web/src/typespec/brower-host.ts, the entire TypeSpec functionality does need a browser host.
eng/scripts/bundle_dists.js packages all TypeSpec libraries.
Emitter is kind of plugin.