-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/mapper-model-expression
- Loading branch information
Showing
100 changed files
with
1,792 additions
and
1,508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
changeKind: fix | ||
packages: | ||
- "@typespec/bundler" | ||
--- | ||
|
||
Allow bundling libraries that don't import their `main` file from the TypeSpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
changeKind: feature | ||
packages: | ||
- "@typespec/compiler" | ||
--- | ||
|
||
Add new way to define decorator implementation with `$decorators` export. | ||
```ts | ||
export const $decorators = { | ||
"TypeSpec.OpenAPI": { | ||
useRef: $useRef, | ||
oneOf: $oneOf, | ||
}, | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking | ||
changeKind: feature | ||
packages: | ||
- "@typespec/http" | ||
- "@typespec/json-schema" | ||
- "@typespec/openapi" | ||
- "@typespec/openapi3" | ||
- "@typespec/protobuf" | ||
- "@typespec/rest" | ||
- "@typespec/versioning" | ||
- "@typespec/xml" | ||
--- | ||
|
||
Internals: Migrate to new api for declaring decorator implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,180 +1,5 @@ | ||
/** An error here would mean that the decorator is not exported or doesn't have the right name. */ | ||
import { | ||
$deprecated, | ||
$discriminator, | ||
$doc, | ||
$encode, | ||
$encodedName, | ||
$error, | ||
$errorsDoc, | ||
$example, | ||
$format, | ||
$friendlyName, | ||
$inspectType, | ||
$inspectTypeName, | ||
$key, | ||
$knownValues, | ||
$list, | ||
$maxItems, | ||
$maxLength, | ||
$maxValue, | ||
$maxValueExclusive, | ||
$minItems, | ||
$minLength, | ||
$minValue, | ||
$minValueExclusive, | ||
$opExample, | ||
$overload, | ||
$parameterVisibility, | ||
$pattern, | ||
$projectedName, | ||
$returnTypeVisibility, | ||
$returnsDoc, | ||
$secret, | ||
$service, | ||
$summary, | ||
$tag, | ||
$visibility, | ||
$withDefaultKeyVisibility, | ||
$withOptionalProperties, | ||
$withPickedProperties, | ||
$withUpdateableProperties, | ||
$withVisibility, | ||
$withoutDefaultValues, | ||
$withoutOmittedProperties, | ||
} from "../src/index.js"; | ||
import type { | ||
DeprecatedDecorator, | ||
DiscriminatorDecorator, | ||
DocDecorator, | ||
EncodeDecorator, | ||
EncodedNameDecorator, | ||
ErrorDecorator, | ||
ErrorsDocDecorator, | ||
ExampleDecorator, | ||
FormatDecorator, | ||
FriendlyNameDecorator, | ||
InspectTypeDecorator, | ||
InspectTypeNameDecorator, | ||
KeyDecorator, | ||
KnownValuesDecorator, | ||
ListDecorator, | ||
MaxItemsDecorator, | ||
MaxLengthDecorator, | ||
MaxValueDecorator, | ||
MaxValueExclusiveDecorator, | ||
MinItemsDecorator, | ||
MinLengthDecorator, | ||
MinValueDecorator, | ||
MinValueExclusiveDecorator, | ||
OpExampleDecorator, | ||
OverloadDecorator, | ||
ParameterVisibilityDecorator, | ||
PatternDecorator, | ||
ProjectedNameDecorator, | ||
ReturnTypeVisibilityDecorator, | ||
ReturnsDocDecorator, | ||
SecretDecorator, | ||
ServiceDecorator, | ||
SummaryDecorator, | ||
TagDecorator, | ||
VisibilityDecorator, | ||
WithDefaultKeyVisibilityDecorator, | ||
WithOptionalPropertiesDecorator, | ||
WithPickedPropertiesDecorator, | ||
WithUpdateablePropertiesDecorator, | ||
WithVisibilityDecorator, | ||
WithoutDefaultValuesDecorator, | ||
WithoutOmittedPropertiesDecorator, | ||
} from "./TypeSpec.js"; | ||
|
||
type Decorators = { | ||
$encode: EncodeDecorator; | ||
$doc: DocDecorator; | ||
$withOptionalProperties: WithOptionalPropertiesDecorator; | ||
$withUpdateableProperties: WithUpdateablePropertiesDecorator; | ||
$withoutOmittedProperties: WithoutOmittedPropertiesDecorator; | ||
$withPickedProperties: WithPickedPropertiesDecorator; | ||
$withoutDefaultValues: WithoutDefaultValuesDecorator; | ||
$withDefaultKeyVisibility: WithDefaultKeyVisibilityDecorator; | ||
$summary: SummaryDecorator; | ||
$returnsDoc: ReturnsDocDecorator; | ||
$errorsDoc: ErrorsDocDecorator; | ||
$deprecated: DeprecatedDecorator; | ||
$service: ServiceDecorator; | ||
$error: ErrorDecorator; | ||
$format: FormatDecorator; | ||
$pattern: PatternDecorator; | ||
$minLength: MinLengthDecorator; | ||
$maxLength: MaxLengthDecorator; | ||
$minItems: MinItemsDecorator; | ||
$maxItems: MaxItemsDecorator; | ||
$minValue: MinValueDecorator; | ||
$maxValue: MaxValueDecorator; | ||
$minValueExclusive: MinValueExclusiveDecorator; | ||
$maxValueExclusive: MaxValueExclusiveDecorator; | ||
$secret: SecretDecorator; | ||
$list: ListDecorator; | ||
$tag: TagDecorator; | ||
$friendlyName: FriendlyNameDecorator; | ||
$knownValues: KnownValuesDecorator; | ||
$key: KeyDecorator; | ||
$overload: OverloadDecorator; | ||
$projectedName: ProjectedNameDecorator; | ||
$encodedName: EncodedNameDecorator; | ||
$discriminator: DiscriminatorDecorator; | ||
$example: ExampleDecorator; | ||
$opExample: OpExampleDecorator; | ||
$visibility: VisibilityDecorator; | ||
$withVisibility: WithVisibilityDecorator; | ||
$inspectType: InspectTypeDecorator; | ||
$inspectTypeName: InspectTypeNameDecorator; | ||
$parameterVisibility: ParameterVisibilityDecorator; | ||
$returnTypeVisibility: ReturnTypeVisibilityDecorator; | ||
}; | ||
|
||
import { $decorators } from "../src/index.js"; | ||
import type { TypeSpecDecorators } from "./TypeSpec.js"; | ||
/** An error here would mean that the exported decorator is not using the same signature. Make sure to have export const $decName: DecNameDecorator = (...) => ... */ | ||
const _: Decorators = { | ||
$encode, | ||
$doc, | ||
$withOptionalProperties, | ||
$withUpdateableProperties, | ||
$withoutOmittedProperties, | ||
$withPickedProperties, | ||
$withoutDefaultValues, | ||
$withDefaultKeyVisibility, | ||
$summary, | ||
$returnsDoc, | ||
$errorsDoc, | ||
$deprecated, | ||
$service, | ||
$error, | ||
$format, | ||
$pattern, | ||
$minLength, | ||
$maxLength, | ||
$minItems, | ||
$maxItems, | ||
$minValue, | ||
$maxValue, | ||
$minValueExclusive, | ||
$maxValueExclusive, | ||
$secret, | ||
$list, | ||
$tag, | ||
$friendlyName, | ||
$knownValues, | ||
$key, | ||
$overload, | ||
$projectedName, | ||
$encodedName, | ||
$discriminator, | ||
$example, | ||
$opExample, | ||
$visibility, | ||
$withVisibility, | ||
$inspectType, | ||
$inspectTypeName, | ||
$parameterVisibility, | ||
$returnTypeVisibility, | ||
}; | ||
const _: TypeSpecDecorators = $decorators["TypeSpec"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import "../../dist/src/lib/decorators.js"; | ||
import "../../dist/src/lib/tsp-index.js"; | ||
|
||
using TypeSpec.Reflection; | ||
|
||
|
Oops, something went wrong.