@typespec/http 0.50.0 → 0.51.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.
package/README.md
CHANGED
|
@@ -8,6 +8,30 @@ TypeSpec HTTP protocol binding
|
|
|
8
8
|
npm install @typespec/http
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Linter
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
Add the following in `tspconfig.yaml`:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
linter:
|
|
19
|
+
extends:
|
|
20
|
+
- "@typespec/http/all"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### RuleSets
|
|
24
|
+
|
|
25
|
+
Available ruleSets:
|
|
26
|
+
|
|
27
|
+
- [`@typespec/http/all`](#@typespec/http/all)
|
|
28
|
+
|
|
29
|
+
### Rules
|
|
30
|
+
|
|
31
|
+
| Name | Description |
|
|
32
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
33
|
+
| [`@typespec/http/op-reference-container-route`](https://microsoft.github.io/typespec/standard-library/http/rules/op-reference-container-route) | Check for referenced (`op is`) operations which have a @route on one of their containers. |
|
|
34
|
+
|
|
11
35
|
## Decorators
|
|
12
36
|
|
|
13
37
|
### TypeSpec.Http
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"op-reference-container-route.d.ts","sourceRoot":"","sources":["../../../src/rules/op-reference-container-route.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;
|
|
1
|
+
{"version":3,"file":"op-reference-container-route.d.ts","sourceRoot":"","sources":["../../../src/rules/op-reference-container-route.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B;;EAkExC,CAAC"}
|
|
@@ -2,8 +2,9 @@ import { createRule, paramMessage } from "@typespec/compiler";
|
|
|
2
2
|
import { getRoutePath } from "../route.js";
|
|
3
3
|
export const opReferenceContainerRouteRule = createRule({
|
|
4
4
|
name: "op-reference-container-route",
|
|
5
|
-
description: "Check for referenced (`op is`) operations which have a @route on one of their containers.",
|
|
6
5
|
severity: "warning",
|
|
6
|
+
description: "Check for referenced (`op is`) operations which have a @route on one of their containers.",
|
|
7
|
+
url: "https://microsoft.github.io/typespec/standard-library/http/rules/op-reference-container-route",
|
|
7
8
|
messages: {
|
|
8
9
|
default: paramMessage `Operation ${"opName"} references an operation which has a @route prefix on its namespace or interface: "${"routePrefix"}". This operation will not carry forward the route prefix so the final route may be different than the referenced operation.`,
|
|
9
10
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"op-reference-container-route.js","sourceRoot":"","sources":["../../../src/rules/op-reference-container-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,CAAC,MAAM,6BAA6B,GAAG,UAAU,CAAC;IACtD,IAAI,EAAE,8BAA8B;IACpC,WAAW,EACT,2FAA2F;IAC7F,
|
|
1
|
+
{"version":3,"file":"op-reference-container-route.js","sourceRoot":"","sources":["../../../src/rules/op-reference-container-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,CAAC,MAAM,6BAA6B,GAAG,UAAU,CAAC;IACtD,IAAI,EAAE,8BAA8B;IACpC,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,2FAA2F;IAC7F,GAAG,EAAE,+FAA+F;IACpG,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,aAAa,QAAQ,sFAAsF,aAAa,+HAA+H;KAC7Q;IACD,MAAM,CAAC,OAAO;QACZ,4EAA4E;QAC5E,6EAA6E;QAC7E,sDAA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AAW,EAAE,KAAK,EAAE;yBACxD,CAAC,CAAC;wBACH,OAAO;qBACR;iBACF;gBAED,2EAA2E;gBAC3E,wBAAwB,CAAC,EAAE,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;aAC1D;QACH,CAAC;QAED,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,wBAAwB,CAAC,EAAE,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YACnD,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0-dev.1",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec HTTP protocol binding",
|
|
6
6
|
"homepage": "https://github.com/microsoft/typespec",
|
|
7
|
+
"docusaurusWebsite": "https://microsoft.github.io/typespec",
|
|
7
8
|
"readme": "https://github.com/microsoft/typespec/blob/main/README.md",
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"repository": {
|
|
@@ -38,16 +39,16 @@
|
|
|
38
39
|
"!dist/test/**"
|
|
39
40
|
],
|
|
40
41
|
"peerDependencies": {
|
|
41
|
-
"@typespec/compiler": "~0.50.0"
|
|
42
|
+
"@typespec/compiler": "~0.50.0 || >=0.51.0-dev <0.51.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/mocha": "~10.0.1",
|
|
45
46
|
"@types/node": "~18.11.9",
|
|
46
|
-
"@typespec/compiler": "~0.50.0",
|
|
47
|
-
"@typespec/eslint-config-typespec": "~0.50.0",
|
|
48
|
-
"@typespec/library-linter": "~0.50.0",
|
|
49
|
-
"@typespec/eslint-plugin": "~0.50.0",
|
|
50
|
-
"@typespec/tspd": "~0.46.0",
|
|
47
|
+
"@typespec/compiler": "~0.50.0 || >=0.51.0-dev <0.51.0",
|
|
48
|
+
"@typespec/eslint-config-typespec": "~0.50.0 || >=0.51.0-dev <0.51.0",
|
|
49
|
+
"@typespec/library-linter": "~0.50.0 || >=0.51.0-dev <0.51.0",
|
|
50
|
+
"@typespec/eslint-plugin": "~0.50.0 || >=0.51.0-dev <0.51.0",
|
|
51
|
+
"@typespec/tspd": "~0.46.0 || >=0.47.0-dev <0.47.0",
|
|
51
52
|
"eslint": "^8.49.0",
|
|
52
53
|
"mocha": "~10.2.0",
|
|
53
54
|
"mocha-junit-reporter": "~2.2.1",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"rimraf": "~5.0.1",
|
|
57
58
|
"typescript": "~5.2.2"
|
|
58
59
|
},
|
|
60
|
+
"dependencies": {},
|
|
59
61
|
"scripts": {
|
|
60
62
|
"clean": "rimraf ./dist ./temp",
|
|
61
63
|
"build": "tsc -p . && npm run lint-typespec-library",
|