Skip to content

Releases: microsoft/typespec

@typespec/http-specs@0.1.0-alpha.40

Pre-release

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 21 Jul 17:57
3af767f

Features

@typespec/graphql@0.1.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 17 Jul 14:46
1b9efa8

Features

  • Initial release of the GraphQL emitter
  • Support for @query, @mutation, and @subscription operation decorators
  • Support for @graphqlInterface decorator to mark models as GraphQL interfaces
  • Support for @compose decorator to implement interfaces
  • Support for @operationFields decorator to add operations to models
  • Support for @specifiedBy decorator for custom scalar URLs
  • Automatic input type generation with Input suffix
  • @oneOf input 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

Pre-release

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 17 Jul 17:54
9f51322

Bug Fixes

  • #11274 Bind the mock server to the loopback interface (127.0.0.1) so the unauthenticated /.admin/stop endpoint 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

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

@typespec/compiler

Deprecations

  • #11169 tsp code install and tsp vs install now install the editor extensions from the marketplace instead of downloading the typespec-vscode/typespec-vs npm packages. tsp code install delegates to code --install-extension microsoft.typespec-vscode, and tsp vs install downloads the latest vsix from the Visual Studio Marketplace.

    The tsp code and tsp vs commands (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.). Use createTester from @typespec/compiler/testing instead.

Features

  • #11247 Add setAutoDecorator API to programmatically apply an auto decorator to a target, mirroring what the synthesized auto dec implementation 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-insensitive true/false string 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 auto decorator 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, and getAutoDecoratorTargets for reading auto decorator values by FQN.

  • #11247 createTester now mounts each discovered library's tspconfig.yaml into 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 #suppress directives for available compiler and library diagnostics in editor scenarios.

    #suppress "deprecated" "old suppression"
    model Widget {}

Bug Fixes

  • #11113 Warn on duplicate #suppress directives on the same node.
  • #10921 Fix diagnostic target node mapping for value entities.
  • #11235 Fix directory entrypoint resolution ignoring package.json tspMain when a tspconfig.yaml with kind: project is present but does not specify an entrypoint. The resolution order is now: explicit config entrypoint, then package.json tspMain, then main.tsp.
  • #11011 Keep the is/extends keyword 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 union expression 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 own tspconfig.yaml features, 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 seen cache pinned the type graph of every mutated program in memory for the lifetime of the process. The cache is now scoped per Program (via a WeakMap), 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.). Use createTester from @typespec/compiler/testing instead.

@typespec/openapi

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

@typespec/openapi3

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

Features

  • #10892 Add opt-in enum-strategy emitter option to emit TypeSpec enums as annotated enumerations (a oneOf of const subschemas with per-member title/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 $ref in an unnecessary allOf when emitting OpenAPI 3.1 (and 3.2). When a referenced schema carries sibling keywords (for example description, default, readOnly, or externalDocs), 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 @cookie decorators for cookie parameters, including nullable and type-null schema variants.
  • #11204 Fix @extension being duplicated on both the parameter object and its schema in OpenAPI output. Parameter extensions are now emitted only on the parameter object.
  • #11203 Fix stray items being 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.). Use createTester from @typespec/compiler/testing instead.

typespec-vscode

No changes, version bump only.

@typespec/prettier-plugin-typespec

No changes, version bump only.

@typespec/xml@0.84.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

@typespec/versioning@0.84.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

@typespec/tspd@0.76.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

Features

  • #10197 tspd gen-extern-signature now generates typed accessor functions for auto decorators (e.g., isMyFlag, getMyLabel).
  • #11247 tspd gen-extern-signature now also generates a typed setter (e.g. setMyFlag, setMyLabel) for each auto decorator, alongside the existing is*/get* readers.

@typespec/streams@0.84.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

@typespec/sse@0.84.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:08
156c91d

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.

@typespec/rest@0.84.0

Choose a tag to compare

@azure-sdk-automation azure-sdk-automation released this 14 Jul 19:07
156c91d

Deprecations

  • #10964 Deprecate old testing framework (createTestHost, createTestRunner, createTestWrapper, createTestLibrary, BasicTestRunner, TypeSpecTestLibrary, etc.). Use createTester from @typespec/compiler/testing instead.