Releases: microsoft/typespec
Release list
@typespec/http-specs@0.1.0-alpha.40
@typespec/graphql@0.1.0
Features
- Initial release of the GraphQL emitter
- Support for
@query,@mutation, and@subscriptionoperation decorators - Support for
@graphqlInterfacedecorator to mark models as GraphQL interfaces - Support for
@composedecorator to implement interfaces - Support for
@operationFieldsdecorator to add operations to models - Support for
@specifiedBydecorator for custom scalar URLs - Automatic input type generation with
Inputsuffix @oneOfinput generation for union-as-input parameters- Visibility-based input/output type splitting
- Union flattening and scalar wrapper generation
@typespec/spector@0.1.0-alpha.27
Bug Fixes
- #11274 Bind the mock server to the loopback interface (
127.0.0.1) so the unauthenticated/.admin/stopendpoint can no longer be reached by other hosts on the network. The server is only reachable from the local host.
typespec-stable@1.14.0
@typespec/compiler
Deprecations
-
#11169
tsp code installandtsp vs installnow install the editor extensions from the marketplace instead of downloading thetypespec-vscode/typespec-vsnpm packages.tsp code installdelegates tocode --install-extension microsoft.typespec-vscode, andtsp vs installdownloads the latest vsix from the Visual Studio Marketplace.The
tsp codeandtsp vscommands (install/uninstall) are now deprecated. They keep working but emit a deprecation warning; install and manage the extensions directly from the marketplace instead. -
#10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
Features
-
#11247 Add
setAutoDecoratorAPI to programmatically apply anautodecorator to a target, mirroring what the synthesizedauto decimplementation does when the decorator is written in source. This lets emitters and mutators mark synthetic types without reaching into the program state map directly.import { setAutoDecorator } from "@typespec/compiler"; setAutoDecorator(program, "MyLib.myFlag", target);
-
#10875 Allow
@encode(string)on boolean targets, define case-insensitivetrue/falsestring semantics, and add shared case-insensitive string matcher support with encode/boolean Spector coverage.model FeatureFlags { @encode(string) enabled: boolean; }
-
#10956 Support importing .ts decorator modules from TypeSpec source files.
-
#10197 Added
autodecorator modifier for declaring decorators that auto-store their arguments as metadata without requiring a JavaScript implementation.auto dec label(target: Model, value: valueof string); @label("my-model") model Foo {}
Added compiler API
hasAutoDecorator,getAutoDecoratorValue, andgetAutoDecoratorTargetsfor reading auto decorator values by FQN. -
#11247
createTesternow mounts each discovered library'stspconfig.yamlinto the virtual file system, so experimental features a library opts into (e.g.auto-decorators) are honored when compiling against the tester. -
#10805 Dim unused
#suppressdirectives for available compiler and library diagnostics in editor scenarios.#suppress "deprecated" "old suppression" model Widget {}
Bug Fixes
- #11113 Warn on duplicate
#suppressdirectives on the same node. - #10921 Fix diagnostic target node mapping for value entities.
- #11235 Fix directory entrypoint resolution ignoring
package.jsontspMainwhen atspconfig.yamlwithkind: projectis present but does not specify anentrypoint. The resolution order is now: explicit configentrypoint, thenpackage.jsontspMain, thenmain.tsp. - #11011 Keep the
is/extendskeyword on the declaration line when the base is a template reference with multiple arguments. The template argument list now controls the line breaking instead of the keyword being pushed onto its own indented line. - #11010 Fix formatter inserting a blank line and over-indenting a
unionexpression used directly as one of multiple template arguments (e.g.PickProperties<Source, "a" | "b">) - #11235 Fix compiler feature flags (e.g.
auto-decorators) not being enabled for library code. A library can now opt into a feature via its owntspconfig.yamlfeatures, enabling it only for that library's source files without requiring the consuming project to enable it. - #11121 Fix memory leak in the experimental mutator engine where a module-level
seencache pinned the type graph of every mutated program in memory for the lifetime of the process. The cache is now scoped perProgram(via aWeakMap), so it is released once the program is garbage collected while still being shared across the nested mutations required for recursive type graphs to terminate. - #11056 Fix
Expected type.internal compiler error when a string template interpolates a function call that references a template parameter on a template declaration (e.g.@doc("${myFn(T)}") model Crud<T extends Reflection.Model> {}). The deferred function call now defers the whole template, which is evaluated at instantiation.
@typespec/http
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/openapi
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/openapi3
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
Features
-
#10892 Add opt-in
enum-strategyemitter option to emit TypeSpec enums as annotated enumerations (aoneOfofconstsubschemas with per-membertitle/description). Supported for OpenAPI 3.1.0 and above; emitting with OpenAPI 3.0.0 falls back to the default form and reports a warning.options: "@typespec/openapi3": enum-strategy: annotated
For example, the following TypeSpec:
/** Type of pet. */ enum PetType { /** A loyal canine companion. */ @summary("Dog") Dog: "dog", /** A self-sufficient feline. */ @summary("Cat") Cat: "cat", }
emits:
PetType: description: Type of pet. oneOf: - const: dog title: Dog description: A loyal canine companion. - const: cat title: Cat description: A self-sufficient feline.
-
#11185 Stop wrapping
$refin an unnecessaryallOfwhen emitting OpenAPI 3.1 (and 3.2). When a referenced schema carries sibling keywords (for exampledescription,default,readOnly, orexternalDocs), those keywords are now placed directly next to the$ref, as allowed by JSON Schema 2020-12. OpenAPI 3.0 output is unchanged, since it does not permit sibling keywords next to a$ref.
Bug Fixes
- #10995 Fix OpenAPI import to emit
@cookiedecorators for cookie parameters, including nullable and type-null schema variants. - #11204 Fix
@extensionbeing duplicated on both the parameter object and itsschemain OpenAPI output. Parameter extensions are now emitted only on the parameter object. - #11203 Fix stray
itemsbeing emitted on a property whose array type is encoded to a scalar via@encode(e.g.ArrayEncoding.commaDelimited).
@typespec/json-schema
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
typespec-vscode
No changes, version bump only.
@typespec/prettier-plugin-typespec
No changes, version bump only.
@typespec/xml@0.84.0
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/versioning@0.84.0
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/tspd@0.76.0
@typespec/streams@0.84.0
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/sse@0.84.0
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.
@typespec/rest@0.84.0
Deprecations
- #10964 Deprecate old testing framework (
createTestHost,createTestRunner,createTestWrapper,createTestLibrary,BasicTestRunner,TypeSpecTestLibrary, etc.). UsecreateTesterfrom@typespec/compiler/testinginstead.