@typespec/playground 0.8.0-dev.2 → 0.8.0-dev.6

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { c as createBrowserHost, r as registerMonacoLanguage } from './services-CPLOnj6Z.js';
1
+ export { c as createBrowserHost, r as registerMonacoLanguage } from './services-CXtSSQdQ.js';
2
2
  export { createUrlStateStorage } from './state-storage.js';
3
3
 
4
4
  function registerMonacoDefaultWorkersForVite() {
@@ -5,7 +5,7 @@ import { mergeClasses, Popover, PopoverTrigger, PopoverSurface, Title3, Table, T
5
5
  import { Settings24Regular, Save16Regular, Broom16Filled, Bug16Regular, FolderListRegular, DataLineRegular, ErrorCircle16Filled, Warning16Filled, ChevronDown16Regular } from '@fluentui/react-icons';
6
6
  import debounce from 'debounce';
7
7
  import { CompletionItemTag } from 'vscode-languageserver';
8
- import { a as resolveVirtualPath, g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage } from '../services-CPLOnj6Z.js';
8
+ import { a as resolveVirtualPath, g as getMonacoRange, c as createBrowserHost, r as registerMonacoLanguage } from '../services-CXtSSQdQ.js';
9
9
  import { ErrorBoundary } from 'react-error-boundary';
10
10
  import { TypeGraph } from '@typespec/html-program-viewer/react';
11
11
  import '@typespec/html-program-viewer/style.css';
@@ -13,11 +13,11 @@ import { getSourceLocation } from '@typespec/compiler';
13
13
  import { createRoot } from 'react-dom/client';
14
14
  import { createUrlStateStorage } from '../state-storage.js';
15
15
 
16
- const PlaygroundContext = createContext(undefined);
16
+ const PlaygroundContext = createContext(void 0);
17
17
  const PlaygroundContextProvider = PlaygroundContext.Provider;
18
18
  function usePlaygroundContext() {
19
19
  const context = useContext(PlaygroundContext);
20
- if (context === undefined) {
20
+ if (context === void 0) {
21
21
  throw new Error("usePlaygroundContext must be used within a PlaygroundContextProvider");
22
22
  }
23
23
  return context;
@@ -138,7 +138,7 @@ const Footer = ({ className, children }) => {
138
138
 
139
139
  function useControllableValue(controlledValue, defaultUncontrolledValue, onChange) {
140
140
  const [value, setValue] = useState(defaultUncontrolledValue);
141
- const isControlled = useMemo(() => controlledValue !== undefined, []);
141
+ const isControlled = useMemo(() => controlledValue !== void 0, []);
142
142
  const currentValue = isControlled ? controlledValue : value;
143
143
  const valueRef = useRef(currentValue);
144
144
  const onChangeRef = useRef(onChange);
@@ -181,7 +181,7 @@ function requireReactJsxRuntime_production_min () {
181
181
  if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
182
182
  hasRequiredReactJsxRuntime_production_min = 1;
183
183
  var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
184
- function q(c,a,g){var b,d={},e=null,h=null;undefined!==g&&(e=""+g);undefined!==a.key&&(e=""+a.key);undefined!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) undefined===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
184
+ function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
185
185
  return reactJsxRuntime_production_min;
186
186
  }
187
187
 
@@ -787,7 +787,7 @@ function requireReactJsxRuntime_development () {
787
787
 
788
788
  for (var typeSpecName in typeSpecs) {
789
789
  if (has(typeSpecs, typeSpecName)) {
790
- var error$1 = undefined; // Prop type validation may throw. In case they do, we don't want to
790
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
791
791
  // fail the render phase where it didn't fail before. So we log it.
792
792
  // After these have been cleaned up, we'll let them throw.
793
793
 
@@ -1537,8 +1537,6 @@ const style$1$1 = {
1537
1537
  "split-pane": "_split-pane_v2eo6_1",
1538
1538
  "split-disabled": "_split-disabled_v2eo6_8",
1539
1539
  "split-pane-dragging": "_split-pane-dragging_v2eo6_12",
1540
- "react-split-vertical": "_react-split-vertical_v2eo6_12",
1541
- "react-split-horizontal": "_react-split-horizontal_v2eo6_16",
1542
1540
  sash: sash,
1543
1541
  "sash-disabled": "_sash-disabled_v2eo6_29",
1544
1542
  "sash-vertical": "_sash-vertical_v2eo6_33",
@@ -1921,7 +1919,7 @@ const EmitterOptionsForm = ({
1921
1919
  [library.name, options, optionsChanged]
1922
1920
  );
1923
1921
  const emitterOptionsSchema = library.definition?.emitter?.options?.properties;
1924
- if (emitterOptionsSchema === undefined) {
1922
+ if (emitterOptionsSchema === void 0) {
1925
1923
  return /* @__PURE__ */ jsx(Fragment, { children: '"No options"' });
1926
1924
  }
1927
1925
  const entries = Object.entries(emitterOptionsSchema);
@@ -2034,7 +2032,7 @@ const LinterForm = ({
2034
2032
  onLinterRuleSetChanged
2035
2033
  }) => {
2036
2034
  const rulesets = Object.values(libraries).flatMap((lib) => {
2037
- const linter = lib.linter ?? lib.definition?.linter;
2035
+ const linter = lib.linter;
2038
2036
  return Object.keys(linter?.ruleSets ?? {}).map((x) => `${lib.name}/${x}`);
2039
2037
  });
2040
2038
  if (rulesets.length === 0) {
@@ -2170,8 +2168,8 @@ const EditorCommandBar = ({
2170
2168
  onSelectedSampleNameChange,
2171
2169
  commandBarButtons
2172
2170
  }) => {
2173
- const documentation = documentationUrl ? /* @__PURE__ */ jsx("label", { children: /* @__PURE__ */ jsx(Link, { href: documentationUrl, target: "_blank", children: "Docs" }) }) : undefined;
2174
- const bugButton = fileBug ? /* @__PURE__ */ jsx(FileBugButton, { onClick: fileBug }) : undefined;
2171
+ const documentation = documentationUrl ? /* @__PURE__ */ jsx("label", { children: /* @__PURE__ */ jsx(Link, { href: documentationUrl, target: "_blank", children: "Docs" }) }) : void 0;
2172
+ const bugButton = fileBug ? /* @__PURE__ */ jsx(FileBugButton, { onClick: fileBug }) : void 0;
2175
2173
  const emitters = useMemo(
2176
2174
  () => Object.values(host.libraries).filter((x) => x.isEmitter).map((x) => x.name),
2177
2175
  [host.libraries]
@@ -2305,7 +2303,6 @@ const tabs = "_tabs_1x6x2_1";
2305
2303
  const tab = "_tab_1x6x2_1";
2306
2304
  const style$5 = {
2307
2305
  tabs: tabs,
2308
- "tab-divider": "_tab-divider_1x6x2_7",
2309
2306
  tab: tab,
2310
2307
  "tab--selected": "_tab--selected_1x6x2_18"
2311
2308
  };
@@ -2415,7 +2412,7 @@ const OutputView = ({
2415
2412
  () => resolveViewers(viewers, fileViewers),
2416
2413
  [fileViewers, viewers]
2417
2414
  );
2418
- if (compilationState === undefined) {
2415
+ if (compilationState === void 0) {
2419
2416
  return /* @__PURE__ */ jsx(Fragment, {});
2420
2417
  }
2421
2418
  if ("internalCompilerError" in compilationState) {
@@ -2566,7 +2563,7 @@ const style$1 = {
2566
2563
 
2567
2564
  const ProblemPaneHeader = memo(({ compilationState, ...props }) => {
2568
2565
  const noProblem = /* @__PURE__ */ jsx(Container, { status: "none", ...props, children: "No problems" });
2569
- if (compilationState === undefined) {
2566
+ if (compilationState === void 0) {
2570
2567
  return noProblem;
2571
2568
  }
2572
2569
  if ("internalCompilerError" in compilationState) {
@@ -2600,7 +2597,7 @@ const Container = ({ children, className, status, onClick, collaped }) => {
2600
2597
  return /* @__PURE__ */ jsxs(
2601
2598
  "div",
2602
2599
  {
2603
- tabIndex: onClick === undefined ? undefined : 0,
2600
+ tabIndex: onClick === void 0 ? void 0 : 0,
2604
2601
  className: mergeClasses(
2605
2602
  style$1["header"],
2606
2603
  status === "error" && style$1["header--error"],
@@ -2659,7 +2656,7 @@ const ProblemPaneContent = ({
2659
2656
  compilationState,
2660
2657
  onDiagnosticSelected
2661
2658
  }) => {
2662
- if (compilationState === undefined) {
2659
+ if (compilationState === void 0) {
2663
2660
  return /* @__PURE__ */ jsx(Fragment, {});
2664
2661
  }
2665
2662
  if ("internalCompilerError" in compilationState) {
@@ -2671,7 +2668,7 @@ const ProblemPaneContent = ({
2671
2668
 
2672
2669
  const Playground = (props) => {
2673
2670
  const { host, onSave } = props;
2674
- const editorRef = useRef(undefined);
2671
+ const editorRef = useRef(void 0);
2675
2672
  useEffect(() => {
2676
2673
  editor.setTheme(props.editorOptions?.theme ?? "typespec");
2677
2674
  }, [props.editorOptions?.theme]);
@@ -2695,7 +2692,7 @@ const Playground = (props) => {
2695
2692
  return Boolean(selectedSampleName && content === props.samples?.[selectedSampleName]?.content);
2696
2693
  }, [content, selectedSampleName, props.samples]);
2697
2694
  const typespecModel = useMonacoModel("inmemory://test/main.tsp", "typespec");
2698
- const [compilationState, setCompilationState] = useState(undefined);
2695
+ const [compilationState, setCompilationState] = useState(void 0);
2699
2696
  const doCompile = useCallback(async () => {
2700
2697
  const content2 = typespecModel.getValue();
2701
2698
  setContent(content2);
@@ -2707,7 +2704,7 @@ const Playground = (props) => {
2707
2704
  ...getMonacoRange(typespecCompiler, diag.target),
2708
2705
  message: diag.message,
2709
2706
  severity: diag.severity === "error" ? MarkerSeverity.Error : MarkerSeverity.Warning,
2710
- tags: diag.code === "deprecated" ? [CompletionItemTag.Deprecated] : undefined
2707
+ tags: diag.code === "deprecated" ? [CompletionItemTag.Deprecated] : void 0
2711
2708
  }));
2712
2709
  editor.setModelMarkers(typespecModel, "owner", markers ?? []);
2713
2710
  } else {
@@ -2762,7 +2759,7 @@ const Playground = (props) => {
2762
2759
  content: typespecModel.getValue(),
2763
2760
  emitter: selectedEmitter,
2764
2761
  options: compilerOptions,
2765
- sampleName: isSampleUntouched ? selectedSampleName : undefined
2762
+ sampleName: isSampleUntouched ? selectedSampleName : void 0
2766
2763
  });
2767
2764
  }
2768
2765
  }, [
@@ -2838,7 +2835,7 @@ const Playground = (props) => {
2838
2835
  onSelectedSampleNameChange,
2839
2836
  saveCode,
2840
2837
  formatCode,
2841
- fileBug: props.onFileBug ? fileBug : undefined,
2838
+ fileBug: props.onFileBug ? fileBug : void 0,
2842
2839
  commandBarButtons: props.commandBarButtons,
2843
2840
  documentationUrl: props.links?.documentationUrl
2844
2841
  }
@@ -2877,8 +2874,8 @@ const Playground = (props) => {
2877
2874
  ] }) });
2878
2875
  };
2879
2876
  const verticalPaneSizesConst = {
2880
- collapsed: [undefined, 30],
2881
- expanded: [undefined, 200]
2877
+ collapsed: [void 0, 30],
2878
+ expanded: [void 0, 200]
2882
2879
  };
2883
2880
  const outputDir = resolveVirtualPath("tsp-output");
2884
2881
  async function compile(host, content, selectedEmitter, options) {
@@ -2980,7 +2977,7 @@ const StandalonePlayground = (config) => {
2980
2977
  },
2981
2978
  [config.defaultEmitter, config.libraries, context]
2982
2979
  );
2983
- if (context === undefined || fixedOptions === undefined) {
2980
+ if (context === void 0 || fixedOptions === void 0) {
2984
2981
  return config.fallback;
2985
2982
  }
2986
2983
  const options = {
@@ -2990,7 +2987,7 @@ const StandalonePlayground = (config) => {
2990
2987
  };
2991
2988
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2992
2989
  /* @__PURE__ */ jsx(Toaster, { toasterId }),
2993
- /* @__PURE__ */ jsx(Playground, { ...options })
2990
+ options && /* @__PURE__ */ jsx(Playground, { ...options })
2994
2991
  ] });
2995
2992
  };
2996
2993
  async function createReactPlayground(config) {
@@ -1,4 +1,4 @@
1
- import { resolvePath, createSourceFile, getSourceFileKindFromExt, TypeSpecLanguageConfiguration } from '@typespec/compiler';
1
+ import { resolvePath, getSourceFileKindFromExt, createSourceFile, TypeSpecLanguageConfiguration } from '@typespec/compiler';
2
2
  import * as monaco from 'monaco-editor';
3
3
  import * as lsp from 'vscode-languageserver';
4
4
  import { DiagnosticSeverity, FormattingOptions, DocumentHighlightKind } from 'vscode-languageserver';
@@ -51,7 +51,7 @@ function createBrowserHostInternal(options) {
51
51
  libraries,
52
52
  async readUrl(url) {
53
53
  const contents = virtualFs.get(url);
54
- if (contents === undefined) {
54
+ if (contents === void 0) {
55
55
  const e = new Error(`File ${url} not found.`);
56
56
  e.code = "ENOENT";
57
57
  throw e;
@@ -61,7 +61,7 @@ function createBrowserHostInternal(options) {
61
61
  async readFile(path) {
62
62
  path = resolveVirtualPath(path);
63
63
  const contents = virtualFs.get(path);
64
- if (contents === undefined) {
64
+ if (contents === void 0) {
65
65
  const e = new Error(`File ${path} not found.`);
66
66
  e.code = "ENOENT";
67
67
  throw e;
@@ -101,7 +101,7 @@ function createBrowserHostInternal(options) {
101
101
  async getJsImport(path) {
102
102
  path = resolveVirtualPath(path);
103
103
  const module = await jsImports.get(path);
104
- if (module === undefined) {
104
+ if (module === void 0) {
105
105
  const e = new Error(`Module ${path} not found`);
106
106
  e.code = "MODULE_NOT_FOUND";
107
107
  throw e;
@@ -185,7 +185,7 @@ function foldingRange(range2) {
185
185
  return {
186
186
  start: range2.startLine + 1,
187
187
  end: range2.endLine + 1,
188
- kind: range2.kind ? new monaco.languages.FoldingRangeKind(range2.kind) : undefined
188
+ kind: range2.kind ? new monaco.languages.FoldingRangeKind(range2.kind) : void 0
189
189
  };
190
190
  }
191
191
  function textEdits(edit) {
@@ -274,11 +274,11 @@ function getTypeSpecLanguageConfiguration() {
274
274
  onEnterRules: TypeSpecLanguageConfiguration.onEnterRules.map((rule) => {
275
275
  return {
276
276
  beforeText: new RegExp(rule.beforeText.pattern),
277
- previousLineText: "previousLineText" in rule ? new RegExp(rule.previousLineText.pattern) : undefined,
277
+ previousLineText: "previousLineText" in rule ? new RegExp(rule.previousLineText.pattern) : void 0,
278
278
  action: {
279
279
  indentAction: getIndentAction(rule.action.indent),
280
- appendText: "appendText" in rule.action ? rule.action.appendText : undefined,
281
- removeText: "removeText" in rule.action ? rule.action.removeText : undefined
280
+ appendText: "appendText" in rule.action ? rule.action.appendText : void 0,
281
+ removeText: "removeText" in rule.action ? rule.action.removeText : void 0
282
282
  }
283
283
  };
284
284
  })
@@ -295,7 +295,7 @@ async function registerMonacoLanguage(host) {
295
295
  compilerHost: host,
296
296
  getOpenDocumentByURL(url) {
297
297
  const model = monaco.editor.getModel(monaco.Uri.parse(url));
298
- return model ? textDocumentForModel(model) : undefined;
298
+ return model ? textDocumentForModel(model) : void 0;
299
299
  },
300
300
  sendDiagnostics() {
301
301
  },
@@ -377,7 +377,7 @@ async function registerMonacoLanguage(host) {
377
377
  case DocumentHighlightKind.Write:
378
378
  return monaco.languages.DocumentHighlightKind.Write;
379
379
  default:
380
- return undefined;
380
+ return void 0;
381
381
  }
382
382
  }
383
383
  function monacoHoverContents(contents) {
@@ -389,7 +389,7 @@ async function registerMonacoLanguage(host) {
389
389
  }
390
390
  return {
391
391
  contents: monacoHoverContents(hover.contents),
392
- range: hover.range ? LspToMonaco.range(hover.range) : undefined
392
+ range: hover.range ? LspToMonaco.range(hover.range) : void 0
393
393
  };
394
394
  }
395
395
  function monacoWorkspaceEdit(edit) {
@@ -397,7 +397,7 @@ async function registerMonacoLanguage(host) {
397
397
  for (const [uri, changes] of Object.entries(edit.changes ?? {})) {
398
398
  const resource = monaco.Uri.parse(uri);
399
399
  for (const change of changes) {
400
- edits.push({ resource, textEdit: LspToMonaco.textEdit(change), versionId: undefined });
400
+ edits.push({ resource, textEdit: LspToMonaco.textEdit(change), versionId: void 0 });
401
401
  }
402
402
  }
403
403
  return { edits };
@@ -556,7 +556,7 @@ async function registerMonacoLanguage(host) {
556
556
  }
557
557
  function getMonacoRange(typespecCompiler, target) {
558
558
  const loc = typespecCompiler.getSourceLocation(target);
559
- if (loc === undefined || loc.file.path !== "/test/main.tsp") {
559
+ if (loc === void 0 || loc.file.path !== "/test/main.tsp") {
560
560
  return {
561
561
  startLineNumber: 1,
562
562
  startColumn: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-settings-dialog-button.d.ts","sourceRoot":"","sources":["../../../../src/react/settings/compiler-settings-dialog-button.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,uBAAuB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,4BAA4B,mEAItC,iCAAiC,4CAuBnC,CAAC"}
1
+ {"version":3,"file":"compiler-settings-dialog-button.d.ts","sourceRoot":"","sources":["../../../../src/react/settings/compiler-settings-dialog-button.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D,MAAM,WAAW,iCAAiC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,eAAe,CAAC;IACjC,uBAAuB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,4BAA4B,GAAI,gEAI1C,iCAAiC,4CAuBnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"linter-form.d.ts","sourceRoot":"","sources":["../../../../src/react/settings/linter-form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAuCzD,CAAC"}
1
+ {"version":3,"file":"linter-form.d.ts","sourceRoot":"","sources":["../../../../src/react/settings/linter-form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAChD,aAAa,EAAE,aAAa,CAAC;IAC7B,sBAAsB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CAsCzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/react/viewers/react-wrapper.tsx"],"names":[],"mappings":"gCAMuB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAAvC,wBAeE"}
1
+ {"version":3,"file":"react-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/react/viewers/react-wrapper.tsx"],"names":[],"mappings":"yBAMgB,OAAO;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE;AAAvC,wBAeE"}
@@ -1,4 +1,4 @@
1
- import { CompilerHost, CompilerOptions, LinterDefinition, NodePackage, TypeSpecLibrary } from '@typespec/compiler';
1
+ import { CompilerHost, CompilerOptions, LinterDefinition, PackageJson, TypeSpecLibrary } from '@typespec/compiler';
2
2
  export interface PlaygroundSample {
3
3
  filename: string;
4
4
  preferredEmitter?: string;
@@ -10,7 +10,7 @@ export interface PlaygroundSample {
10
10
  }
11
11
  export interface PlaygroundTspLibrary {
12
12
  name: string;
13
- packageJson: NodePackage;
13
+ packageJson: PackageJson;
14
14
  isEmitter: boolean;
15
15
  definition?: TypeSpecLibrary<any>;
16
16
  linter?: LinterDefinition;
@@ -24,7 +24,7 @@ function createUrlStateStorage(schema) {
24
24
  `Error decompressing query parameter ${item.queryParam} with content:`,
25
25
  value
26
26
  );
27
- return undefined;
27
+ return void 0;
28
28
  }
29
29
  } else {
30
30
  return value;
@@ -39,7 +39,7 @@ function createUrlStateStorage(schema) {
39
39
  `Error decompressing query parameter ${item.queryParam} with content:`,
40
40
  value
41
41
  );
42
- return undefined;
42
+ return void 0;
43
43
  }
44
44
  } else {
45
45
  return value;
@@ -50,7 +50,7 @@ function createUrlStateStorage(schema) {
50
50
  history.pushState(null, "", window.location.pathname + "?" + params.toString());
51
51
  }
52
52
  function resolveSearchParams(data, mergeWithExisting = false) {
53
- const params = new URLSearchParams(mergeWithExisting ? location.search : undefined);
53
+ const params = new URLSearchParams(mergeWithExisting ? location.search : void 0);
54
54
  for (const [key, item] of Object.entries(schema)) {
55
55
  const value = data[key];
56
56
  if (value) {
package/dist/style.css CHANGED
@@ -100,10 +100,10 @@
100
100
  width: 100%;
101
101
  overflow: hidden;
102
102
  }
103
- ._tree_16lfo_1 {
103
+ ._tree_16t0l_1 {
104
104
  outline: none;
105
105
  }
106
- ._tree-row_16lfo_4 {
106
+ ._tree-row_16t0l_4 {
107
107
  cursor: pointer;
108
108
  display: block;
109
109
  height: 22px;
@@ -116,32 +116,34 @@
116
116
  display: flex;
117
117
  }
118
118
 
119
- ._tree-row_16lfo_4:hover,
120
- ._tree-row_16lfo_4._focus_16lfo_18 {
119
+ ._tree-row_16t0l_4:hover,
120
+ ._tree-row_16t0l_4._focus_16t0l_18 {
121
121
  background: var(--colorNeutralBackground4);
122
122
  }
123
123
 
124
- ._tree-row_16lfo_4._active_16lfo_22 {
124
+ ._tree-row_16t0l_4._active_16t0l_22 {
125
125
  background: var(--colorNeutralBackground2Selected);
126
126
  }
127
127
 
128
- ._tree-row_16lfo_4 ._caret_16lfo_26 {
128
+ ._tree-row_16t0l_4 ._caret_16t0l_26 {
129
129
  width: 16px;
130
+ flex: 0 0 16px;
130
131
  display: flex;
131
132
  align-items: center;
132
133
  }
133
134
 
134
- ._tree-row_16lfo_4 ._icon_16lfo_32 {
135
+ ._tree-row_16t0l_4 ._icon_16t0l_33 {
135
136
  width: 16px;
137
+ flex: 0 0 16px;
136
138
  display: flex;
137
139
  align-items: center;
138
140
  }
139
141
 
140
- ._tree-row_16lfo_4 ._label_16lfo_38 {
142
+ ._tree-row_16t0l_4 ._label_16t0l_40 {
141
143
  flex: 1;
142
144
  }
143
145
 
144
- ._tree-row_16lfo_4 ._column_16lfo_42:last-child {
146
+ ._tree-row_16t0l_4 ._column_16t0l_44:last-child {
145
147
  margin-right: 5px;
146
148
  }
147
149
  ._form_sqeas_1 {
@@ -13,7 +13,7 @@ function definePlaygroundViteConfig(config) {
13
13
  if (id.includes("/node_modules/monaco-editor/esm/vs/editor")) {
14
14
  return "monaco";
15
15
  }
16
- return undefined;
16
+ return void 0;
17
17
  }
18
18
  }
19
19
  }
@@ -31,7 +31,7 @@ function definePlaygroundViteConfig(config) {
31
31
  !config.skipBundleLibraries ? typespecBundlePlugin({
32
32
  folderName: "libs",
33
33
  libraries: config.libraries
34
- }) : undefined
34
+ }) : void 0
35
35
  ],
36
36
  server: {
37
37
  fs: {
@@ -83,7 +83,7 @@ function playgroundManifestPlugin(config) {
83
83
  };`;
84
84
  return file;
85
85
  }
86
- return undefined;
86
+ return void 0;
87
87
  }
88
88
  };
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typespec/playground",
3
- "version": "0.8.0-dev.2",
3
+ "version": "0.8.0-dev.6",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec playground UI components.",
6
6
  "homepage": "https://typespec.io",
@@ -51,7 +51,7 @@
51
51
  "./styles.css": "./dist/style.css"
52
52
  },
53
53
  "engines": {
54
- "node": ">=18.0.0"
54
+ "node": ">=20.0.0"
55
55
  },
56
56
  "files": [
57
57
  "lib/*.tsp",
@@ -59,17 +59,17 @@
59
59
  "!dist/test/**"
60
60
  ],
61
61
  "dependencies": {
62
- "@fluentui/react-components": "~9.57.0",
63
- "@fluentui/react-icons": "^2.0.271",
64
- "@typespec/bundler": "~0.1.11 || >=0.2.0-dev <0.2.0",
65
- "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0",
66
- "@typespec/html-program-viewer": "~0.64.0 || >=0.65.0-dev <0.65.0",
67
- "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0",
68
- "@typespec/openapi": "~0.64.0 || >=0.65.0-dev <0.65.0",
69
- "@typespec/openapi3": "~0.64.0 || >=0.65.0-dev <0.65.0",
70
- "@typespec/protobuf": "~0.64.0 || >=0.65.0-dev <0.65.0",
71
- "@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0",
72
- "@typespec/versioning": "~0.64.0 || >=0.65.0-dev <0.65.0",
62
+ "@fluentui/react-components": "~9.60.0",
63
+ "@fluentui/react-icons": "^2.0.279",
64
+ "@typespec/bundler": "~0.2.1 || >=0.3.0-dev <0.3.0",
65
+ "@typespec/compiler": "~0.66.0 || >=0.67.0-dev <0.67.0",
66
+ "@typespec/html-program-viewer": "~0.66.0 || >=0.67.0-dev <0.67.0",
67
+ "@typespec/http": "~0.66.0 || >=0.67.0-dev <0.67.0",
68
+ "@typespec/openapi": "~0.66.0 || >=0.67.0-dev <0.67.0",
69
+ "@typespec/openapi3": "~0.66.0 || >=0.67.0-dev <0.67.0",
70
+ "@typespec/protobuf": "~0.66.0 || >=0.67.0-dev <0.67.0",
71
+ "@typespec/rest": "~0.66.0 || >=0.67.0-dev <0.67.0",
72
+ "@typespec/versioning": "~0.66.0 || >=0.67.0-dev <0.67.0",
73
73
  "clsx": "^2.1.1",
74
74
  "debounce": "~2.2.0",
75
75
  "lzutf8": "0.6.3",
@@ -77,34 +77,34 @@
77
77
  "react": "~18.3.1",
78
78
  "react-dom": "~18.3.1",
79
79
  "react-error-boundary": "^5.0.0",
80
- "swagger-ui-dist": "^5.18.2",
80
+ "swagger-ui-dist": "^5.20.0",
81
81
  "vscode-languageserver": "~9.0.1",
82
82
  "vscode-languageserver-textdocument": "~1.0.12"
83
83
  },
84
84
  "devDependencies": {
85
- "@babel/core": "^7.26.0",
86
- "@playwright/test": "^1.49.1",
87
- "@storybook/addon-actions": "^8.5.0",
88
- "@storybook/cli": "^8.5.0",
89
- "@storybook/react": "^8.5.0",
90
- "@storybook/react-vite": "^8.5.0",
91
- "@storybook/test": "^8.5.0",
92
- "@storybook/types": "^8.5.0",
85
+ "@babel/core": "^7.26.9",
86
+ "@playwright/test": "^1.50.1",
87
+ "@storybook/addon-actions": "^8.6.3",
88
+ "@storybook/cli": "^8.6.3",
89
+ "@storybook/react": "^8.6.3",
90
+ "@storybook/react-vite": "^8.6.3",
91
+ "@storybook/test": "^8.6.3",
92
+ "@storybook/types": "^8.6.3",
93
93
  "@types/debounce": "~1.2.4",
94
- "@types/node": "~22.10.10",
94
+ "@types/node": "~22.13.9",
95
95
  "@types/react": "~18.3.11",
96
96
  "@types/react-dom": "~18.3.0",
97
97
  "@types/swagger-ui-dist": "~3.30.5",
98
- "@typespec/bundler": "~0.1.11 || >=0.2.0-dev <0.2.0",
98
+ "@typespec/bundler": "~0.2.1 || >=0.3.0-dev <0.3.0",
99
99
  "@vitejs/plugin-react": "~4.3.4",
100
100
  "c8": "^10.1.3",
101
101
  "cross-env": "~7.0.3",
102
- "es-module-shims": "~2.0.5",
102
+ "es-module-shims": "~2.0.10",
103
103
  "rimraf": "~6.0.1",
104
- "typescript": "~5.7.3",
105
- "vite": "^6.0.11",
106
- "vite-plugin-checker": "^0.8.0",
107
- "vite-plugin-dts": "4.5.0",
104
+ "typescript": "~5.8.2",
105
+ "vite": "^6.2.0",
106
+ "vite-plugin-checker": "^0.9.0",
107
+ "vite-plugin-dts": "4.5.3",
108
108
  "@typespec/react-components": "~0.57.0"
109
109
  },
110
110
  "peerDependencies": {},