Progress for #2564
Changes:
- Decided to cut versioning for now. Starlight doesn't support well now
and would be a decent amount of work. Our doc have been quite stable and
this slows down the build significantly.\
The plan is as follow
1. Merge this as a parallel build to the docusaurus website
2. Add blog back
3. Cleanup things (like migrate more things out of fluentui react
components)
4. Switch the website to use this one
5. If we are happy delete docusaurus
History: we originally intend to use m4 prenamer (opt-in via
flag/option) to keep names in SDK same as from Swagger (mostly for
brownfield).
But later we decided to just use `@clientName` in client.tsp to
explicitly do the naming, if backward-compatibility is an issue.
This flag/option is not used by any service.
This work-in-progress PR tracks merging the JavaScript server code
generator to the TypeSpec repository.
The JavaScript server code generator creates HTTP bindings for TypeSpec
HTTP services and exposes them for binding either to the Node.js http
server directly, or to an Express.js app as middleware.
Closes#3215
---------
Co-authored-by: Will Temple <will@wtemple.net>
Fixes#3369 by changing how types are bundled. In particular, when a
type is not a JSON Schema type, we never create a root schema for it.
Instead, it is inlined into the defs of any schema which references it,
and referenced using a JSON pointer. This PR makes bundling have
essentially no impact on emitted schemas, and is merely a way to bundle
them into a single file.
The approach is as follows:
* When a type references another type outside a JSON Schema namespace,
include the referenced type under $defs:
* Such referenced types do not have a $id or $schema field
* Such referenced types are referenced via JSON pointers not ids
* Bundling does not alter the bundled schemas or introduce new root
schemas. This changes two things from what we do today:
* The `$id` of the bundled schemas now includes the file path as it does
for non-bundled schemas (whereas before it was just the type name)
* non-JSON Schema types do not get $defs in the bundle, so the bundle
has the same root schemas as would be written to disk when not bundling.
In terms of implementation, the basic approach is to not handle bundling
via the emitter framework source files. Instead, we always create source
files for root schemas, and inline the necessary defs as we did before
(but now using JSON pointers). Then when we're about to write source
files, if we're bundling we assemble the bundle and emit that single
file, otherwise we emit each source file that contains a root schema.
Todo:
* [ ] Validate that the bundled schemas continue to work with ajv.
* [ ] Cleanups
---------
Co-authored-by: Vitalii Kryvenko <gersoh3@gmail.com>
Generate the Microsoft policy service files to automatically to:
- add/remove `needs-triage` automatically when there is no area or an
area is added
- add the area on PRs
resolve#3340
- Make the light code theme have accessible contrast.
- Docsearch placeholder contrast tweak
Also minor tweak to the prismjs tokenizer to fix optional property
highlighting
PR added support for it but we need to update the docs to explain the
new feature.
---------
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
Remove the opinionated (wrongly so most of the time) middleman that
brings more config pain than value.
Things to check:
- [x] Parallel build performance vs rush
- [ ] Publishing with submodule
- [x] Changesets
Get rid of mocha and upgrade to vitest which is a more modern
alternative providing, watch, direct typescript compilation out of the
box, expect library and more.
Advantage over mocha:
- Much better cli
- watch mode
- better diff
- Better extension:
- tree organization for files too (not everything flattened)
- update in real time the test(no more need to refresh manually to
discover where are the tests)
- just a little buggy
- Compiles typescript directly
- provides more expectation apis(like jest)
Cons over mocha:
- Slower(about 2x) but that means we don't need to build the test as
part of build which would speed up that part(not as much as is lost)
Todo:
- typespec-azure migration
Those regex were reporting to have some vulnerability for performance,
not sure if this fixes it but I think those were errors to start with
and this is the way the swift prism definition does with with `\(`
instead of `${`
---------
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Somehow the default UI configuration doesn't run on pull requests so
hopefully this will work.
Right now we just get the security warnings after merging which is
unfortunate. It is also hard to run codeql locally so having it on a PR
to make sure we resolve it is nice
We'll get error like that
<img width="993" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/e1ff03d0-1f6a-49e5-8b27-b7c03e2b69f2">
Progress towards providing the ref doc generation as a usable tool by
any typespec library.
Detach the generation from the website, instead each package define
where they want their doc and we generate it.
This adds a new `tspd` package and CLI tool that is meant to be used by
library authors. It will have the following functionalities
- generate docs
- generate TS signatures
- lint library?
---------
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
* gRPC: initial commit moving from demo to public repo
* Added a README
* remove copied changelogs
* added fresh changelog.json
* Some cleanup, removed synthetic models
* WIP testing system
* Recorded a test
* Fixed bug bypassing effective type calculation.
* Made 'simple' even simpler.
* Added test for inferring message names from context
* Supported output message name inference and refactored unreachable types.
* Unleaked discriminated union tags.
* Updated some documentation.
* Capitalize method names, remove space between method name and input type.
* Tweaked proto header
* Extracted writing reservations into own function
* Taught the expectation system to look for diagnostics.
* Check for namespace collisions.
* Fixed simple-error test
* Re-recorded a simple test.
* Renamed grpc -> protobuf, improved handling of many protobuf features
* Implement cross-package references
* Reworked a bunch of docs issues and diagnostics.
* Lazy initialize scalars map
* Some doc updates
* Removed protoc output
* Renamed tests to .tsp
* Updated diagnostics and some documentation
* Updated entrypoint from typespecMain to tspMain
* Updated docs
* Lint/spell fixes
* Updated enum error messages
* Improved namespace handling
* Reject anonymous models in messages
* Removed TODOs
* Fixed test harness on windows
* addressbook scenario
* Several small updates
* Ignored .protoc-out integration folder
* Updated a few documentation entries
* Import from fs rather than import fs
* Increased resilience to failed scalar resolutions.
* Support derived scalars by traversing the scalar inheritance links.
* Add protobuf as website dependency
* Just don't support unions for now
* Better handling of intrinsic types
* Added a note about onValidate
* Added a note about syntax target functions
* Move a symbol
* Add a readme warning.