@typespec/spector 0.1.0-alpha.21-dev.1 → 0.1.0-alpha.21-dev.3
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,11 +1,11 @@
|
|
|
1
1
|
import { readFile } from "fs/promises";
|
|
2
|
-
import yaml from "
|
|
2
|
+
import yaml from "yaml";
|
|
3
3
|
import { SpecConfigJsonSchema } from "./config-schema.js";
|
|
4
4
|
import { SchemaValidator } from "./schema-validator.js";
|
|
5
5
|
const validator = new SchemaValidator(SpecConfigJsonSchema);
|
|
6
6
|
export async function loadSpecConfig(path) {
|
|
7
7
|
const content = await readFile(path);
|
|
8
|
-
const config = yaml.
|
|
8
|
+
const config = yaml.parse(content.toString());
|
|
9
9
|
const diagnostics = validator.validate(config, path);
|
|
10
10
|
return [config, diagnostics];
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,oBAAoB,CAAC,CAAC;AAE5D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAY;IAC/C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,MAAM,GAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrD,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/spector",
|
|
3
|
-
"version": "0.1.0-alpha.21-dev.
|
|
3
|
+
"version": "0.1.0-alpha.21-dev.3",
|
|
4
4
|
"description": "Typespec Core Tool to validate, run mock api, collect coverage.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"homepage": "https://github.com/microsoft/typespec#readme",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@azure/identity": "~4.13.0",
|
|
30
|
-
"@types/js-yaml": "^4.0.5",
|
|
31
30
|
"@typespec/compiler": "^1.6.0",
|
|
32
31
|
"@typespec/http": "^1.6.0",
|
|
33
32
|
"@typespec/rest": "^0.76.0 || >=0.77.0-dev <0.77.0",
|
|
@@ -38,14 +37,14 @@
|
|
|
38
37
|
"body-parser": "^2.2.0",
|
|
39
38
|
"deep-equal": "^2.2.0",
|
|
40
39
|
"express": "^5.1.0",
|
|
41
|
-
"globby": "~
|
|
42
|
-
"js-yaml": "^4.1.0",
|
|
40
|
+
"globby": "~16.0.0",
|
|
43
41
|
"micromatch": "^4.0.8",
|
|
44
42
|
"morgan": "^1.10.0",
|
|
45
43
|
"multer": "^2.0.1",
|
|
46
44
|
"picocolors": "~1.1.1",
|
|
47
45
|
"source-map-support": "~0.5.21",
|
|
48
46
|
"xml2js": "^0.6.2",
|
|
47
|
+
"yaml": "~2.8.0",
|
|
49
48
|
"yargs": "~18.0.0"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
@@ -55,11 +54,11 @@
|
|
|
55
54
|
"@types/micromatch": "^4.0.9",
|
|
56
55
|
"@types/morgan": "^1.9.9",
|
|
57
56
|
"@types/multer": "^2.0.0",
|
|
58
|
-
"@types/node": "~24.
|
|
57
|
+
"@types/node": "~24.10.1",
|
|
59
58
|
"@types/xml2js": "^0.4.11",
|
|
60
59
|
"@types/yargs": "~17.0.33",
|
|
61
60
|
"@typespec/tspd": "^0.73.1 || >=0.74.0-dev <0.74.0",
|
|
62
|
-
"rimraf": "~6.
|
|
61
|
+
"rimraf": "~6.1.2",
|
|
63
62
|
"typescript": "~5.9.2"
|
|
64
63
|
},
|
|
65
64
|
"peerDependencies": {},
|
package/src/config/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile } from "fs/promises";
|
|
2
|
-
import yaml from "
|
|
2
|
+
import yaml from "yaml";
|
|
3
3
|
import { Diagnostic } from "../utils/diagnostic-reporter.js";
|
|
4
4
|
import { SpecConfigJsonSchema } from "./config-schema.js";
|
|
5
5
|
import { SchemaValidator } from "./schema-validator.js";
|
|
@@ -9,7 +9,7 @@ const validator = new SchemaValidator(SpecConfigJsonSchema);
|
|
|
9
9
|
|
|
10
10
|
export async function loadSpecConfig(path: string): Promise<[SpecConfig, Diagnostic[]]> {
|
|
11
11
|
const content = await readFile(path);
|
|
12
|
-
const config: any = yaml.
|
|
12
|
+
const config: any = yaml.parse(content.toString());
|
|
13
13
|
const diagnostics = validator.validate(config, path);
|
|
14
14
|
return [config, diagnostics];
|
|
15
15
|
}
|