@typespec/html-program-viewer 0.59.0-dev.1 → 0.60.0-dev.0
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/dist/react/index.js
CHANGED
|
@@ -18196,6 +18196,12 @@ const diagnostics = {
|
|
|
18196
18196
|
default: paramMessage `Path "${"path"}" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,
|
|
18197
18197
|
},
|
|
18198
18198
|
},
|
|
18199
|
+
"path-unix-style": {
|
|
18200
|
+
severity: "warning",
|
|
18201
|
+
messages: {
|
|
18202
|
+
default: paramMessage `Path should use unix style separators. Use "/" instead of "\\".`,
|
|
18203
|
+
},
|
|
18204
|
+
},
|
|
18199
18205
|
"config-path-not-found": {
|
|
18200
18206
|
severity: "error",
|
|
18201
18207
|
messages: {
|
|
@@ -18435,6 +18441,7 @@ const diagnostics = {
|
|
|
18435
18441
|
wrongType: paramMessage `Encoding '${"encoding"}' cannot be used on type '${"type"}'. Expected: ${"expected"}.`,
|
|
18436
18442
|
wrongEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'.`,
|
|
18437
18443
|
wrongNumericEncodingType: paramMessage `Encoding '${"encoding"}' on type '${"type"}' is expected to be serialized as '${"expected"}' but got '${"actual"}'. Set '@encode' 2nd parameter to be of type ${"expected"}. e.g. '@encode("${"encoding"}", int32)'`,
|
|
18444
|
+
firstArg: `First argument of "@encode" must be the encoding name or the string type when encoding numeric types.`,
|
|
18438
18445
|
},
|
|
18439
18446
|
},
|
|
18440
18447
|
"invalid-mime-type": {
|
|
@@ -27479,6 +27486,15 @@ function compilerAssert(condition, message, target) {
|
|
|
27479
27486
|
throw new Error(message);
|
|
27480
27487
|
}
|
|
27481
27488
|
|
|
27489
|
+
function absolutePathStatus(path) {
|
|
27490
|
+
if (path.startsWith(".") || !isPathAbsolute(path)) {
|
|
27491
|
+
return "not-absolute";
|
|
27492
|
+
}
|
|
27493
|
+
if (path.includes("\\")) {
|
|
27494
|
+
return "windows-style";
|
|
27495
|
+
}
|
|
27496
|
+
return "valid";
|
|
27497
|
+
}
|
|
27482
27498
|
function createJSONSchemaValidator(schema, options = { strict: true }) {
|
|
27483
27499
|
const ajv = new ajvExports.Ajv({
|
|
27484
27500
|
strict: options.strict,
|
|
@@ -27487,9 +27503,7 @@ function createJSONSchemaValidator(schema, options = { strict: true }) {
|
|
|
27487
27503
|
});
|
|
27488
27504
|
ajv.addFormat("absolute-path", {
|
|
27489
27505
|
type: "string",
|
|
27490
|
-
validate: (path) =>
|
|
27491
|
-
return !path.startsWith(".") && isPathAbsolute(path);
|
|
27492
|
-
},
|
|
27506
|
+
validate: (path) => absolutePathStatus(path) === "valid",
|
|
27493
27507
|
});
|
|
27494
27508
|
return { validate };
|
|
27495
27509
|
function validate(config, target) {
|
|
@@ -27508,11 +27522,22 @@ const IGNORED_AJV_PARAMS = new Set(["type", "errors"]);
|
|
|
27508
27522
|
function ajvErrorToDiagnostic(obj, error, target) {
|
|
27509
27523
|
const tspTarget = resolveTarget(error, target);
|
|
27510
27524
|
if (error.params.format === "absolute-path") {
|
|
27511
|
-
|
|
27512
|
-
|
|
27513
|
-
|
|
27514
|
-
|
|
27515
|
-
|
|
27525
|
+
const value = getErrorValue(obj, error);
|
|
27526
|
+
const status = absolutePathStatus(value);
|
|
27527
|
+
if (status === "windows-style") {
|
|
27528
|
+
return createDiagnostic({
|
|
27529
|
+
code: "path-unix-style",
|
|
27530
|
+
format: { path: value },
|
|
27531
|
+
target: tspTarget,
|
|
27532
|
+
});
|
|
27533
|
+
}
|
|
27534
|
+
else {
|
|
27535
|
+
return createDiagnostic({
|
|
27536
|
+
code: "config-path-absolute",
|
|
27537
|
+
format: { path: value },
|
|
27538
|
+
target: tspTarget,
|
|
27539
|
+
});
|
|
27540
|
+
}
|
|
27516
27541
|
}
|
|
27517
27542
|
const messageLines = [`Schema violation: ${error.message} (${error.instancePath || "/"})`];
|
|
27518
27543
|
for (const [name, value] of Object.entries(error.params).filter(([name]) => !IGNORED_AJV_PARAMS.has(name))) {
|
|
@@ -27584,7 +27609,7 @@ let manifest;
|
|
|
27584
27609
|
try {
|
|
27585
27610
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27586
27611
|
// @ts-ignore
|
|
27587
|
-
manifest = (await import('../manifest-
|
|
27612
|
+
manifest = (await import('../manifest-BApuudHS.js')).default;
|
|
27588
27613
|
}
|
|
27589
27614
|
catch {
|
|
27590
27615
|
const name = "../dist/manifest.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/html-program-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0-dev.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for emitting an html view of the program.",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"!dist/test/**"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@typespec/compiler": "~0.
|
|
39
|
+
"@typespec/compiler": "~0.59.0 || >=0.60.0-dev <0.60.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@fluentui/react-components": "~9.54.5",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@types/node": "~18.11.19",
|
|
55
55
|
"@types/react": "~18.3.3",
|
|
56
56
|
"@types/react-dom": "~18.3.0",
|
|
57
|
-
"@typespec/compiler": "~0.
|
|
57
|
+
"@typespec/compiler": "~0.59.0 || >=0.60.0-dev <0.60.0",
|
|
58
58
|
"@vitejs/plugin-react": "~4.3.1",
|
|
59
59
|
"@vitest/coverage-v8": "^2.0.4",
|
|
60
60
|
"@vitest/ui": "^2.0.4",
|