@typespec/html-program-viewer 0.60.0-dev.1 → 0.60.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
|
@@ -18036,8 +18036,13 @@ const diagnostics = {
|
|
|
18036
18036
|
unassignable: {
|
|
18037
18037
|
severity: "error",
|
|
18038
18038
|
messages: {
|
|
18039
|
-
default: paramMessage `Type '${"
|
|
18040
|
-
|
|
18039
|
+
default: paramMessage `Type '${"sourceType"}' is not assignable to type '${"targetType"}'`,
|
|
18040
|
+
},
|
|
18041
|
+
},
|
|
18042
|
+
"property-unassignable": {
|
|
18043
|
+
severity: "error",
|
|
18044
|
+
messages: {
|
|
18045
|
+
default: paramMessage `Types of property '${"propName"}' are incompatible`,
|
|
18041
18046
|
},
|
|
18042
18047
|
},
|
|
18043
18048
|
"property-required": {
|
|
@@ -27490,9 +27495,9 @@ function absolutePathStatus(path) {
|
|
|
27490
27495
|
if (path.startsWith(".") || !isPathAbsolute(path)) {
|
|
27491
27496
|
return "not-absolute";
|
|
27492
27497
|
}
|
|
27493
|
-
if (path.includes("\\")) {
|
|
27494
|
-
|
|
27495
|
-
}
|
|
27498
|
+
// if (path.includes("\\")) {
|
|
27499
|
+
// return "windows-style";
|
|
27500
|
+
// }
|
|
27496
27501
|
return "valid";
|
|
27497
27502
|
}
|
|
27498
27503
|
function createJSONSchemaValidator(schema, options = { strict: true }) {
|
|
@@ -27523,21 +27528,11 @@ function ajvErrorToDiagnostic(obj, error, target) {
|
|
|
27523
27528
|
const tspTarget = resolveTarget(error, target);
|
|
27524
27529
|
if (error.params.format === "absolute-path") {
|
|
27525
27530
|
const value = getErrorValue(obj, error);
|
|
27526
|
-
|
|
27527
|
-
|
|
27528
|
-
|
|
27529
|
-
|
|
27530
|
-
|
|
27531
|
-
target: tspTarget,
|
|
27532
|
-
});
|
|
27533
|
-
}
|
|
27534
|
-
else {
|
|
27535
|
-
return createDiagnostic({
|
|
27536
|
-
code: "config-path-absolute",
|
|
27537
|
-
format: { path: value },
|
|
27538
|
-
target: tspTarget,
|
|
27539
|
-
});
|
|
27540
|
-
}
|
|
27531
|
+
return createDiagnostic({
|
|
27532
|
+
code: "config-path-absolute",
|
|
27533
|
+
format: { path: value },
|
|
27534
|
+
target: tspTarget,
|
|
27535
|
+
});
|
|
27541
27536
|
}
|
|
27542
27537
|
const messageLines = [`Schema violation: ${error.message} (${error.instancePath || "/"})`];
|
|
27543
27538
|
for (const [name, value] of Object.entries(error.params).filter(([name]) => !IGNORED_AJV_PARAMS.has(name))) {
|
|
@@ -27609,7 +27604,7 @@ let manifest;
|
|
|
27609
27604
|
try {
|
|
27610
27605
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
27611
27606
|
// @ts-ignore
|
|
27612
|
-
manifest = (await import('../manifest-
|
|
27607
|
+
manifest = (await import('../manifest-CGbgVYyS.js')).default;
|
|
27613
27608
|
}
|
|
27614
27609
|
catch {
|
|
27615
27610
|
const name = "../dist/manifest.js";
|
|
@@ -29309,6 +29304,8 @@ function parse$1(original) {
|
|
|
29309
29304
|
return { n, e: exp, s: sign, d: decimal };
|
|
29310
29305
|
}
|
|
29311
29306
|
function stringify(value) {
|
|
29307
|
+
if (value.n === 0n)
|
|
29308
|
+
return "0";
|
|
29312
29309
|
const n = value.n.toString();
|
|
29313
29310
|
const sign = value.s === -1 ? "-" : "";
|
|
29314
29311
|
const int = value.e === 0 ? "0" : n.slice(0, value.e);
|
|
@@ -29404,6 +29401,14 @@ NumericPrototype.toString = function () {
|
|
|
29404
29401
|
],
|
|
29405
29402
|
});
|
|
29406
29403
|
|
|
29404
|
+
var Related;
|
|
29405
|
+
(function (Related) {
|
|
29406
|
+
Related[Related["false"] = 0] = "false";
|
|
29407
|
+
Related[Related["true"] = 1] = "true";
|
|
29408
|
+
Related[Related["maybe"] = 2] = "maybe";
|
|
29409
|
+
})(Related || (Related = {}));
|
|
29410
|
+
// #endregion
|
|
29411
|
+
|
|
29407
29412
|
var ResolutionKind;
|
|
29408
29413
|
(function (ResolutionKind) {
|
|
29409
29414
|
ResolutionKind[ResolutionKind["Value"] = 0] = "Value";
|
|
@@ -29411,12 +29416,6 @@ var ResolutionKind;
|
|
|
29411
29416
|
ResolutionKind[ResolutionKind["BaseType"] = 2] = "BaseType";
|
|
29412
29417
|
ResolutionKind[ResolutionKind["Constraint"] = 3] = "Constraint";
|
|
29413
29418
|
})(ResolutionKind || (ResolutionKind = {}));
|
|
29414
|
-
var Related;
|
|
29415
|
-
(function (Related) {
|
|
29416
|
-
Related[Related["false"] = 0] = "false";
|
|
29417
|
-
Related[Related["true"] = 1] = "true";
|
|
29418
|
-
Related[Related["maybe"] = 2] = "maybe";
|
|
29419
|
-
})(Related || (Related = {}));
|
|
29420
29419
|
|
|
29421
29420
|
var yu=Object.create;var He=Object.defineProperty;var Au=Object.getOwnPropertyDescriptor;var Bu=Object.getOwnPropertyNames;var wu=Object.getPrototypeOf,xu=Object.prototype.hasOwnProperty;var sr=e=>{throw TypeError(e)};var _u=(e,t)=>()=>(e&&(t=e(e=0)),t);var At=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),We=(e,t)=>{for(var r in t)He(e,r,{get:t[r],enumerable:!0});},ar=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Bu(t))!xu.call(e,o)&&o!==r&&He(e,o,{get:()=>t[o],enumerable:!(n=Au(t,o))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?yu(wu(e)):{},ar(He(r,"default",{value:e,enumerable:!0}),e)),vu=e=>ar(He({},"__esModule",{value:!0}),e);var bu=(e,t,r)=>t.has(e)||sr("Cannot "+r);var Dr=(e,t,r)=>t.has(e)?sr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var pe=(e,t,r)=>(bu(e,t,"access private method"),r);var it=At((ia,sn)=>{var on=new Proxy(String,{get:()=>on});sn.exports=on;});var Tn={};We(Tn,{default:()=>_o,shouldHighlight:()=>xo});var xo,_o,kn=_u(()=>{xo=()=>!1,_o=String;});var Pn=At((bD,Xt)=>{var g=String,Ln=function(){return {isColorSupported:!1,reset:g,bold:g,dim:g,italic:g,underline:g,inverse:g,hidden:g,strikethrough:g,black:g,red:g,green:g,yellow:g,blue:g,magenta:g,cyan:g,white:g,gray:g,bgBlack:g,bgRed:g,bgGreen:g,bgYellow:g,bgBlue:g,bgMagenta:g,bgCyan:g,bgWhite:g}};Xt.exports=Ln();Xt.exports.createColors=Ln;});var $n=At(Ct=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.codeFrameColumns=Mn;Ct.default=To;var In=(kn(),vu(Tn)),Hn=vo(Pn(),!0);function Wn(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,r=new WeakMap;return (Wn=function(n){return n?r:t})(e)}function vo(e,t){if(e===null||typeof e!="object"&&typeof e!="function")return {default:e};var r=Wn(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(u!=="default"&&{}.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,r&&r.set(e,n),n}var bo=Hn.default,Rn=(e,t)=>r=>e(t(r)),Zt;function Oo(e){if(e){return (Zt)!=null||(Zt=(0, Hn.createColors)(!0)),Zt}return bo}var Yn=!1;function So(e){return {gutter:e.gray,marker:Rn(e.red,e.bold),message:Rn(e.red,e.bold)}}var jn=/\r\n|[\n\r\u2028\u2029]/;function No(e,t,r){let n=Object.assign({column:0,line:-1},e.start),o=Object.assign({},n,e.end),{linesAbove:u=2,linesBelow:i=3}=r||{},s=n.line,a=n.column,D=o.line,l=o.column,d=Math.max(s-(u+1),0),f=Math.min(t.length,D+i);s===-1&&(d=0),D===-1&&(f=t.length);let p=D-s,c={};if(p)for(let F=0;F<=p;F++){let m=F+s;if(!a)c[m]=!0;else if(F===0){let E=t[m-1].length;c[m]=[a,E-a+1];}else if(F===p)c[m]=[0,l];else {let E=t[m-F].length;c[m]=[0,E];}}else a===l?a?c[s]=[a,0]:c[s]=!0:c[s]=[a,l-a];return {start:d,end:f,markerLines:c}}function Mn(e,t,r={}){let n=(r.highlightCode||r.forceColor)&&(0, In.shouldHighlight)(r),o=Oo(r.forceColor),u=So(o),i=(F,m)=>n?F(m):m,s=e.split(jn),{start:a,end:D,markerLines:l}=No(t,s,r),d=t.start&&typeof t.start.column=="number",f=String(D).length,c=(n?(0, In.default)(e,r):e).split(jn,D).slice(a,D).map((F,m)=>{let E=a+1+m,w=` ${` ${E}`.slice(-f)} |`,h=l[E],C=!l[E+1];if(h){let k="";if(Array.isArray(h)){let v=F.slice(0,Math.max(h[0]-1,0)).replace(/[^\t]/g," "),$=h[1]||1;k=[`
|
|
29422
29421
|
`,i(u.gutter,w.replace(/\d/g," "))," ",v,i(u.marker,"^").repeat($)].join(""),C&&r.message&&(k+=" "+i(u.message,r.message));}return [i(u.marker,">"),i(u.gutter,w),F.length>0?` ${F}`:"",k].join("")}else return ` ${i(u.gutter,w)}${F.length>0?` ${F}`:""}`}).join(`
|
|
@@ -40838,12 +40837,14 @@ function computeTypeNodeProps(path, type, name) {
|
|
|
40838
40837
|
};
|
|
40839
40838
|
}
|
|
40840
40839
|
function computeItemList(path, name, items) {
|
|
40840
|
+
let index = 0;
|
|
40841
40841
|
return {
|
|
40842
40842
|
kind: "list",
|
|
40843
40843
|
id: path,
|
|
40844
40844
|
name,
|
|
40845
40845
|
children: Array.from(items.entries()).map(([key, value]) => {
|
|
40846
|
-
|
|
40846
|
+
const name2 = typeof key === "symbol" ? `sym(${index++})` : key;
|
|
40847
|
+
return computeTypeNode(path, value, name2);
|
|
40847
40848
|
})
|
|
40848
40849
|
};
|
|
40849
40850
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/html-program-viewer",
|
|
3
|
-
"version": "0.60.0
|
|
3
|
+
"version": "0.60.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",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"default": "./dist/emitter/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./react": {
|
|
26
|
+
"development": "./src/react/index.ts",
|
|
26
27
|
"types": "./dist/react/index.d.ts",
|
|
27
28
|
"default": "./dist/react/index.js"
|
|
28
29
|
},
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"!dist/test/**"
|
|
37
38
|
],
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@typespec/compiler": "~0.
|
|
40
|
+
"@typespec/compiler": "~0.60.0"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@fluentui/react-components": "~9.54.5",
|
|
@@ -54,7 +55,6 @@
|
|
|
54
55
|
"@types/node": "~18.11.19",
|
|
55
56
|
"@types/react": "~18.3.3",
|
|
56
57
|
"@types/react-dom": "~18.3.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",
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"vite-plugin-checker": "^0.7.2",
|
|
66
66
|
"vite-plugin-dts": "4.0.0-beta.1",
|
|
67
67
|
"vitest": "^2.0.4",
|
|
68
|
+
"@typespec/compiler": "~0.60.0",
|
|
68
69
|
"@typespec/react-components": "~0.57.0"
|
|
69
70
|
},
|
|
70
71
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"js-value.test.d.ts","sourceRoot":"","sources":["../../../../src/react/js-inspector/js-value/js-value.test.tsx"],"names":[],"mappings":""}
|