@typespec/versioning 0.77.0 → 0.78.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DecoratorContext, Enum, EnumMember, Interface, Model, ModelProperty, Namespace, Operation, Scalar, Type, Union, UnionVariant } from "@typespec/compiler";
|
|
1
|
+
import type { DecoratorContext, DecoratorValidatorCallbacks, Enum, EnumMember, Interface, Model, ModelProperty, Namespace, Operation, Scalar, Type, Union, UnionVariant } from "@typespec/compiler";
|
|
2
2
|
/**
|
|
3
3
|
* Identifies that the decorated namespace is versioned by the provided enum.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@ import type { DecoratorContext, Enum, EnumMember, Interface, Model, ModelPropert
|
|
|
14
14
|
* }
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export type VersionedDecorator = (context: DecoratorContext, target: Namespace, versions: Enum) => void;
|
|
17
|
+
export type VersionedDecorator = (context: DecoratorContext, target: Namespace, versions: Enum) => DecoratorValidatorCallbacks | void;
|
|
18
18
|
/**
|
|
19
19
|
* Identifies that a namespace or a given versioning enum member relies upon a versioned package.
|
|
20
20
|
*
|
|
@@ -40,7 +40,7 @@ export type VersionedDecorator = (context: DecoratorContext, target: Namespace,
|
|
|
40
40
|
* }
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
export type UseDependencyDecorator = (context: DecoratorContext, target: EnumMember | Namespace, ...versionRecords: EnumMember[]) => void;
|
|
43
|
+
export type UseDependencyDecorator = (context: DecoratorContext, target: EnumMember | Namespace, ...versionRecords: EnumMember[]) => DecoratorValidatorCallbacks | void;
|
|
44
44
|
/**
|
|
45
45
|
* Identifies when the target was added.
|
|
46
46
|
*
|
|
@@ -61,7 +61,7 @@ export type UseDependencyDecorator = (context: DecoratorContext, target: EnumMem
|
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
export type AddedDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember) => void;
|
|
64
|
+
export type AddedDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember) => DecoratorValidatorCallbacks | void;
|
|
65
65
|
/**
|
|
66
66
|
* Identifies when the target was removed.
|
|
67
67
|
*
|
|
@@ -82,7 +82,7 @@ export type AddedDecorator = (context: DecoratorContext, target: Model | ModelPr
|
|
|
82
82
|
* }
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
|
-
export type RemovedDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember) => void;
|
|
85
|
+
export type RemovedDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember) => DecoratorValidatorCallbacks | void;
|
|
86
86
|
/**
|
|
87
87
|
* Identifies when the target has been renamed.
|
|
88
88
|
*
|
|
@@ -94,7 +94,7 @@ export type RemovedDecorator = (context: DecoratorContext, target: Model | Model
|
|
|
94
94
|
* op newName(): void;
|
|
95
95
|
* ```
|
|
96
96
|
*/
|
|
97
|
-
export type RenamedFromDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember, oldName: string) => void;
|
|
97
|
+
export type RenamedFromDecorator = (context: DecoratorContext, target: Model | ModelProperty | Operation | Enum | EnumMember | Union | UnionVariant | Scalar | Interface, version: EnumMember, oldName: string) => DecoratorValidatorCallbacks | void;
|
|
98
98
|
/**
|
|
99
99
|
* Identifies when a target was made optional.
|
|
100
100
|
*
|
|
@@ -108,7 +108,7 @@ export type RenamedFromDecorator = (context: DecoratorContext, target: Model | M
|
|
|
108
108
|
* }
|
|
109
109
|
* ```
|
|
110
110
|
*/
|
|
111
|
-
export type MadeOptionalDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember) => void;
|
|
111
|
+
export type MadeOptionalDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember) => DecoratorValidatorCallbacks | void;
|
|
112
112
|
/**
|
|
113
113
|
* Identifies when a target was made required.
|
|
114
114
|
*
|
|
@@ -122,21 +122,21 @@ export type MadeOptionalDecorator = (context: DecoratorContext, target: ModelPro
|
|
|
122
122
|
* }
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
|
-
export type MadeRequiredDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember) => void;
|
|
125
|
+
export type MadeRequiredDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember) => DecoratorValidatorCallbacks | void;
|
|
126
126
|
/**
|
|
127
127
|
* Identifies when the target type changed.
|
|
128
128
|
*
|
|
129
129
|
* @param version The version that the target type changed in.
|
|
130
130
|
* @param oldType The previous type of the target.
|
|
131
131
|
*/
|
|
132
|
-
export type TypeChangedFromDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember, oldType: Type) => void;
|
|
132
|
+
export type TypeChangedFromDecorator = (context: DecoratorContext, target: ModelProperty, version: EnumMember, oldType: Type) => DecoratorValidatorCallbacks | void;
|
|
133
133
|
/**
|
|
134
134
|
* Identifies when the target type changed.
|
|
135
135
|
*
|
|
136
136
|
* @param version The version that the target type changed in.
|
|
137
137
|
* @param oldType The previous type of the target.
|
|
138
138
|
*/
|
|
139
|
-
export type ReturnTypeChangedFromDecorator = (context: DecoratorContext, target: Operation, version: EnumMember, oldType: Type) => void;
|
|
139
|
+
export type ReturnTypeChangedFromDecorator = (context: DecoratorContext, target: Operation, version: EnumMember, oldType: Type) => DecoratorValidatorCallbacks | void;
|
|
140
140
|
export type TypeSpecVersioningDecorators = {
|
|
141
141
|
versioned: VersionedDecorator;
|
|
142
142
|
useDependency: UseDependencyDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeSpec.Versioning.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,MAAM,EACN,IAAI,EACJ,KAAK,EACL,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,IAAI,KACX,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"TypeSpec.Versioning.d.ts","sourceRoot":"","sources":["../../generated-defs/TypeSpec.Versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,MAAM,EACN,IAAI,EACJ,KAAK,EACL,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,IAAI,KACX,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,GAAG,cAAc,EAAE,UAAU,EAAE,KAC5B,2BAA2B,GAAG,IAAI,CAAC;AAExC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EACF,KAAK,GACL,aAAa,GACb,SAAS,GACT,IAAI,GACJ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,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,IAAI,KACV,2BAA2B,GAAG,IAAI,CAAC;AAExC,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,kBAAkB,CAAC;IAC9B,aAAa,EAAE,sBAAsB,CAAC;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,oBAAoB,CAAC;IAClC,YAAY,EAAE,qBAAqB,CAAC;IACpC,YAAY,EAAE,qBAAqB,CAAC;IACpC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,qBAAqB,EAAE,8BAA8B,CAAC;CACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/versioning",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.78.0-dev.1",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for declaring and emitting versioned APIs",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -39,20 +39,21 @@
|
|
|
39
39
|
"!dist/test/**"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@typespec/compiler": "^1.7.
|
|
42
|
+
"@typespec/compiler": "^1.7.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "~24.10.1",
|
|
46
|
+
"@typespec/compiler": "^1.7.1",
|
|
47
|
+
"@typespec/library-linter": "^0.77.0 || >=0.78.0-dev <0.78.0",
|
|
48
|
+
"@typespec/tspd": "^0.73.2 || >=0.74.0-dev <0.74.0",
|
|
46
49
|
"@vitest/coverage-v8": "^4.0.4",
|
|
47
50
|
"@vitest/ui": "^4.0.4",
|
|
48
51
|
"c8": "^10.1.3",
|
|
49
52
|
"rimraf": "~6.1.2",
|
|
50
53
|
"typescript": "~5.9.2",
|
|
51
|
-
"vitest": "^4.0.4"
|
|
52
|
-
"@typespec/compiler": "^1.7.0",
|
|
53
|
-
"@typespec/library-linter": "^0.77.0",
|
|
54
|
-
"@typespec/tspd": "^0.73.2"
|
|
54
|
+
"vitest": "^4.0.4"
|
|
55
55
|
},
|
|
56
|
+
"dependencies": {},
|
|
56
57
|
"scripts": {
|
|
57
58
|
"clean": "rimraf ./dist ./temp",
|
|
58
59
|
"build": "pnpm gen-extern-signature && tsc -p . && pnpm lint-typespec-library",
|